From 734daac863cd3075140423ae0aeb2688619ae50a Mon Sep 17 00:00:00 2001 From: Plasmic Bot Date: Sun, 6 Oct 2024 10:33:23 +0000 Subject: [PATCH] [plasmic] Sync project ravi (r&r) This is an automated commit generated by anahita mansoori using Plasmic (https://plasmic.app/). Project name: ravi (r&r) Project URL: https://studio.plasmic.app/projects/qQzsBf58SqzNJX45iggq96 --- .plasmic/StarRate.tsx | 45 + .../PlasmicGlobalContextsProvider.tsx | 37 +- .../ravi_r_r/PlasmicReviewCard.module.css | 23 + .../plasmic/ravi_r_r/PlasmicReviewCard.tsx | 813 ++++++++++++------ .../ravi_r_r/PlasmicStarRate.module.css | 22 + .plasmic/plasmic/ravi_r_r/PlasmicStarRate.tsx | 289 +++++++ .../ravi_r_r/icons/PlasmicIcon__Icon19.tsx | 38 + .../ravi_r_r/icons/PlasmicIcon__Icon20.tsx | 40 + .../ravi_r_r/icons/PlasmicIcon__Icon21.tsx | 49 ++ plasmic.json | 58 +- plasmic.lock | 31 +- 11 files changed, 1158 insertions(+), 287 deletions(-) create mode 100644 .plasmic/StarRate.tsx create mode 100644 .plasmic/plasmic/ravi_r_r/PlasmicStarRate.module.css create mode 100644 .plasmic/plasmic/ravi_r_r/PlasmicStarRate.tsx create mode 100644 .plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon19.tsx create mode 100644 .plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon20.tsx create mode 100644 .plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon21.tsx diff --git a/.plasmic/StarRate.tsx b/.plasmic/StarRate.tsx new file mode 100644 index 00000000..201c4179 --- /dev/null +++ b/.plasmic/StarRate.tsx @@ -0,0 +1,45 @@ +// This is a skeleton starter React component generated by Plasmic. +// This file is owned by you, feel free to edit as you see fit. +import * as React from "react"; +import { + PlasmicStarRate, + DefaultStarRateProps +} from "./plasmic/ravi_r_r/PlasmicStarRate"; +import { HTMLElementRefOf } from "@plasmicapp/react-web"; + +// Your component props start with props for variants and slots you defined +// in Plasmic, but you can add more here, like event handlers that you can +// attach to named nodes in your component. +// +// If you don't want to expose certain variants or slots as a prop, you can use +// Omit to hide them: +// +// interface StarRateProps extends Omit { +// // etc. +// } +// +// You can also stop extending from DefaultStarRateProps altogether and have +// total control over the props for your component. +export interface StarRateProps extends DefaultStarRateProps {} + +function StarRate_(props: StarRateProps, ref: HTMLElementRefOf<"div">) { + // Use PlasmicStarRate to render this component as it was + // designed in Plasmic, by activating the appropriate variants, + // attaching the appropriate event handlers, etc. You + // can also install whatever React hooks you need here to manage state or + // fetch data. + // + // Props you can pass into PlasmicStarRate are: + // 1. Variants you want to activate, + // 2. Contents for slots you want to fill, + // 3. Overrides for any named node in the component to attach behavior and data, + // 4. Props to set on the root node. + // + // By default, we are just piping all StarRateProps here, but feel free + // to do whatever works for you. + + return ; +} + +const StarRate = React.forwardRef(StarRate_); +export default StarRate; diff --git a/.plasmic/plasmic/ravi_r_r/PlasmicGlobalContextsProvider.tsx b/.plasmic/plasmic/ravi_r_r/PlasmicGlobalContextsProvider.tsx index 35531bff..f89b6cf5 100644 --- a/.plasmic/plasmic/ravi_r_r/PlasmicGlobalContextsProvider.tsx +++ b/.plasmic/plasmic/ravi_r_r/PlasmicGlobalContextsProvider.tsx @@ -9,20 +9,20 @@ import { hasVariant, ensureGlobalVariants } from "@plasmicapp/react-web"; import { AuthGlobalContext } from "@/common/fragment/authGlobalContext"; // plasmic-import: Xco54Kekq-Th/codeComponent import { Fragment } from "@/common/fragment/designSystemGlobalContext"; // plasmic-import: I9xFO0-CXlvU/codeComponent import { GrowthbookGlobalContext } from "@/common/fragment/growthbookGlobalContext"; // plasmic-import: lWTHKw5gCzCj/codeComponent +import { Splunk } from "@/common/fragment/splunk"; // plasmic-import: fAahHOA889lI/codeComponent export interface GlobalContextsProviderProps { children?: React.ReactElement; authGlobalContextProps?: Partial< Omit, "children"> >; - fragmentProps?: Partial< Omit, "children"> >; - growthbookGlobalContextProps?: Partial< Omit, "children"> >; + splunkProps?: Partial, "children">>; } export default function GlobalContextsProvider( @@ -32,7 +32,8 @@ export default function GlobalContextsProvider( children, authGlobalContextProps, fragmentProps, - growthbookGlobalContextProps + growthbookGlobalContextProps, + splunkProps } = props; return ( @@ -44,7 +45,19 @@ export default function GlobalContextsProvider( : undefined } > - + - {children} + + {children} + diff --git a/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.module.css b/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.module.css index 7f808309..b71d759f 100644 --- a/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.module.css +++ b/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.module.css @@ -623,6 +623,10 @@ > img { margin-left: var(--token-vMUQwr5Jto1d); } +.popoverCore:global(.__wab_instance) { + max-width: 100%; + object-fit: cover; +} .freeBox__qhLa0 { display: flex; position: relative; @@ -691,6 +695,25 @@ font-size: var(--token-6NbVMeD6zQwn); position: relative; } +.freeBox__gJfpv { + display: flex; + flex-direction: row-reverse; + position: relative; + width: 170px; + height: auto; + max-width: 100%; + justify-content: space-between; + align-items: stretch; + box-shadow: 0px 4px 16px 0px #00000033; + background: white; + margin-top: -10px; + border-radius: 8px; + padding: 16px; + border: 1px solid #e2e8f0; +} +.starRate:global(.__wab_instance) { + max-width: 100%; +} .freeBox__wNjA9 { display: flex; flex-direction: row; diff --git a/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.tsx b/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.tsx index 07c2c366..71693b44 100644 --- a/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.tsx +++ b/.plasmic/plasmic/ravi_r_r/PlasmicReviewCard.tsx @@ -66,6 +66,8 @@ import Chip from "../../Chip"; // plasmic-import: 1bFBcAoH0lNN/component import Dialog from "../../Dialog"; // plasmic-import: FJiI2-N1is_F/component import Button from "../../Button"; // plasmic-import: oVzoHzMf1TLl/component import ReplyCard from "../../ReplyCard"; // plasmic-import: qY29Y1sogsUa/component +import { Popover } from "@plasmicpkgs/radix-ui"; +import StarRate from "../../StarRate"; // plasmic-import: mLhzoRbR5vw6/component import MultilineTextInput from "../../MultilineTextInput"; // plasmic-import: CZBpNouNw7Ui/component import { Fetcher } from "@plasmicapp/react-web/lib/data-sources"; @@ -159,6 +161,8 @@ export type PlasmicReviewCard__OverridesType = { button?: Flex__; dialog2?: Flex__; نظربیشتراز1?: Flex__<"div">; + popoverCore?: Flex__; + starRate?: Flex__; dialog6?: Flex__; سوشالها?: Flex__<"div">; توئیتر?: Flex__; @@ -331,6 +335,40 @@ function PlasmicReviewCard__RenderFunc(props: { type: "private", variableType: "boolean", initFunc: ({ $props, $state, $queries, $ctx }) => undefined + }, + { + path: "popoverCore.open", + type: "private", + variableType: "boolean", + initFunc: ({ $props, $state, $queries, $ctx }) => false + }, + { + path: "likeRate", + type: "private", + variableType: "number", + initFunc: ({ $props, $state, $queries, $ctx }) => + (() => { + try { + return (() => { + if (typeof window === "undefined") return 0; + return window.localStorage.getItem("likedComments") + ? JSON.parse(localStorage.getItem("likedComments")).find( + item => + item.id === $props.feedbackId && + item.user_id === $ctx.auth.info.id + )?.rate + : 0; + })(); + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return 0; + } + throw e; + } + })() } ], [$props, $ctx, $refs] @@ -1544,308 +1582,521 @@ function PlasmicReviewCard__RenderFunc(props: { hasGap={true} className={classNames(projectcss.all, sty.freeBox__o8WyD)} > - {(() => { - try { - return true; - } catch (e) { - if ( - e instanceof TypeError || - e?.plasmicType === "PlasmicUndefinedDataError" - ) { - return true; - } - throw e; - } - })() ? ( - { - const $steps = {}; + + {(_par => (!_par ? [] : Array.isArray(_par) ? _par : [_par]))( + (() => { + try { + return [1, 2, 3, 4, 5]; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return []; + } + throw e; + } + })() + ).map((__plasmic_item_0, __plasmic_idx_0) => { + const currentItem = __plasmic_item_0; + const currentIndex = __plasmic_idx_0; + return ( + { + const $steps = {}; + + $steps["invokeGlobalAction2"] = !$ctx.auth.isLogin + ? (() => { + const actionArgs = { args: [] }; + return $globalActions[ + "AuthGlobalContext.login" + ]?.apply(null, [...actionArgs.args]); + })() + : undefined; + if ( + $steps["invokeGlobalAction2"] != null && + typeof $steps["invokeGlobalAction2"] === "object" && + typeof $steps["invokeGlobalAction2"].then === + "function" + ) { + $steps["invokeGlobalAction2"] = await $steps[ + "invokeGlobalAction2" + ]; + } - $steps["updateIsLike"] = $ctx.auth.isLogin - ? (() => { - const actionArgs = { - variable: { - objRoot: $state, - variablePath: ["isLike"] - }, - operation: 4 - }; - return (({ - variable, - value, - startIndex, - deleteCount - }) => { - if (!variable) { - return; + $steps["updateLikeRate"] = $ctx.auth.isLogin + ? (() => { + const actionArgs = { + variable: { + objRoot: $state, + variablePath: ["likeRate"] + }, + operation: 0, + value: currentItem + }; + return (({ + variable, + value, + startIndex, + deleteCount + }) => { + if (!variable) { + return; + } + const { objRoot, variablePath } = variable; + + $stateSet(objRoot, variablePath, value); + return value; + })?.apply(null, [actionArgs]); + })() + : undefined; + if ( + $steps["updateLikeRate"] != null && + typeof $steps["updateLikeRate"] === "object" && + typeof $steps["updateLikeRate"].then === "function" + ) { + $steps["updateLikeRate"] = await $steps[ + "updateLikeRate" + ]; } - const { objRoot, variablePath } = variable; - const oldValue = $stateGet(objRoot, variablePath); - $stateSet(objRoot, variablePath, !oldValue); - return !oldValue; - })?.apply(null, [actionArgs]); - })() - : undefined; - if ( - $steps["updateIsLike"] != null && - typeof $steps["updateIsLike"] === "object" && - typeof $steps["updateIsLike"].then === "function" - ) { - $steps["updateIsLike"] = await $steps["updateIsLike"]; - } + $steps["updatePopoverCoreOpen"] = $ctx.auth.isLogin + ? (() => { + const actionArgs = { + variable: { + objRoot: $state, + variablePath: ["popoverCore", "open"] + }, + operation: 0, + value: false + }; + return (({ + variable, + value, + startIndex, + deleteCount + }) => { + if (!variable) { + return; + } + const { objRoot, variablePath } = variable; - $steps["runCode"] = $ctx.auth.isLogin - ? (() => { - const actionArgs = { - customFunction: async () => { - return fetch( - "https://apigw.paziresh24.com/ravi/v1/feedbacks/like-dislike?id=" + - $props.feedbackId, - { - method: "POST", - credentials: "include" - } - ); + $stateSet(objRoot, variablePath, value); + return value; + })?.apply(null, [actionArgs]); + })() + : undefined; + if ( + $steps["updatePopoverCoreOpen"] != null && + typeof $steps["updatePopoverCoreOpen"] === "object" && + typeof $steps["updatePopoverCoreOpen"].then === + "function" + ) { + $steps["updatePopoverCoreOpen"] = await $steps[ + "updatePopoverCoreOpen" + ]; } - }; - return (({ customFunction }) => { - return customFunction(); - })?.apply(null, [actionArgs]); - })() - : undefined; - if ( - $steps["runCode"] != null && - typeof $steps["runCode"] === "object" && - typeof $steps["runCode"].then === "function" - ) { - $steps["runCode"] = await $steps["runCode"]; - } - $steps["saveInLocalStoreg"] = $ctx.auth.isLogin - ? (() => { - const actionArgs = { - customFunction: async () => { - return (() => { - if ($state.isLike) { - const likedComment = { - user_id: $ctx.auth.info.id, - id: $props.feedbackId + $steps["updateIsLike"] = $ctx.auth.isLogin + ? (() => { + const actionArgs = { + variable: { + objRoot: $state, + variablePath: ["isLike"] + }, + operation: 0, + value: true }; - const likedCommentsList = - JSON.parse( - localStorage.getItem("likedComments") - ) || []; - likedCommentsList.push(likedComment); - localStorage.setItem( - "likedComments", - JSON.stringify(likedCommentsList) - ); - } - if (!$state.isLike) { - const likedCommentsList = - JSON.parse( - localStorage.getItem("likedComments") - ) || []; - const index = likedCommentsList.findIndex( - comment => - comment.id === $props.feedbackId && - comment.user_id === $ctx.auth.info.id - ); - if (index !== -1) { - likedCommentsList.splice(index, 1); - return localStorage.setItem( - "likedComments", - JSON.stringify(likedCommentsList) - ); - } - } - })(); + return (({ + variable, + value, + startIndex, + deleteCount + }) => { + if (!variable) { + return; + } + const { objRoot, variablePath } = variable; + + $stateSet(objRoot, variablePath, value); + return value; + })?.apply(null, [actionArgs]); + })() + : undefined; + if ( + $steps["updateIsLike"] != null && + typeof $steps["updateIsLike"] === "object" && + typeof $steps["updateIsLike"].then === "function" + ) { + $steps["updateIsLike"] = await $steps["updateIsLike"]; } - }; - return (({ customFunction }) => { - return customFunction(); - })?.apply(null, [actionArgs]); - })() - : undefined; + + $steps["runCode"] = $ctx.auth.isLogin + ? (() => { + const actionArgs = { + customFunction: async () => { + return (() => { + if ($state.isLike) { + const likedComment = { + user_id: $ctx.auth.info.id, + id: $props.feedbackId, + rate: $state.likeRate + }; + const likedCommentsList = + JSON.parse( + localStorage.getItem("likedComments") + ) || []; + likedCommentsList.push(likedComment); + localStorage.setItem( + "likedComments", + JSON.stringify(likedCommentsList) + ); + } + if (!$state.isLike) { + const likedCommentsList = + JSON.parse( + localStorage.getItem("likedComments") + ) || []; + const index = likedCommentsList.findIndex( + comment => + comment.id === $props.feedbackId && + comment.user_id === $ctx.auth.info.id + ); + if (index !== -1) { + likedCommentsList.splice(index, 1); + return localStorage.setItem( + "likedComments", + JSON.stringify(likedCommentsList) + ); + } + } + })(); + } + }; + return (({ customFunction }) => { + return customFunction(); + })?.apply(null, [actionArgs]); + })() + : undefined; + if ( + $steps["runCode"] != null && + typeof $steps["runCode"] === "object" && + typeof $steps["runCode"].then === "function" + ) { + $steps["runCode"] = await $steps["runCode"]; + } + + $steps["invokeGlobalAction"] = $ctx.auth.isLogin + ? (() => { + const actionArgs = { + args: [ + "POST", + "https://ir-ravi-n8n.darkube.app/webhook/like_rate", + undefined, + (() => { + try { + return { + feedback_id: $props.feedbackId, + rate: $state.likeRate, + user_id: $ctx.auth.info.id + }; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === + "PlasmicUndefinedDataError" + ) { + return undefined; + } + throw e; + } + })() + ] + }; + return $globalActions[ + "Fragment.apiRequest" + ]?.apply(null, [...actionArgs.args]); + })() + : undefined; + if ( + $steps["invokeGlobalAction"] != null && + typeof $steps["invokeGlobalAction"] === "object" && + typeof $steps["invokeGlobalAction"].then === + "function" + ) { + $steps["invokeGlobalAction"] = await $steps[ + "invokeGlobalAction" + ]; + } + }} + selected={(() => { + try { + return currentItem <= $state.likeRate; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return []; + } + throw e; + } + })()} + /> + ); + })} + + } + side={"bottom"} + slideIn={true} + themeResetClass={classNames( + projectcss.root_reset, + projectcss.plasmic_default_styles, + projectcss.plasmic_mixins, + projectcss.plasmic_tokens, + plasmic_fragment_design_system_css.plasmic_tokens + )} + trigger={false} + > + {(() => { + try { + return true; + } catch (e) { if ( - $steps["saveInLocalStoreg"] != null && - typeof $steps["saveInLocalStoreg"] === "object" && - typeof $steps["saveInLocalStoreg"].then === "function" + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" ) { - $steps["saveInLocalStoreg"] = await $steps[ - "saveInLocalStoreg" - ]; + return true; } + throw e; + } + })() ? ( + { + const $steps = {}; - $steps["ifLogin"] = - $ctx.auth.isLogin == false + $steps["ifLogin"] = + $ctx.auth.isLogin == false + ? (() => { + const actionArgs = { args: [] }; + return $globalActions[ + "AuthGlobalContext.login" + ]?.apply(null, [...actionArgs.args]); + })() + : undefined; + if ( + $steps["ifLogin"] != null && + typeof $steps["ifLogin"] === "object" && + typeof $steps["ifLogin"].then === "function" + ) { + $steps["ifLogin"] = await $steps["ifLogin"]; + } + + $steps["updatePopoverCoreOpen"] = $ctx.auth.isLogin ? (() => { - const actionArgs = { args: [] }; - return $globalActions["AuthGlobalContext.login"]?.apply( - null, - [...actionArgs.args] - ); + const actionArgs = { + variable: { + objRoot: $state, + variablePath: ["popoverCore", "open"] + }, + operation: 4, + value: true + }; + return (({ + variable, + value, + startIndex, + deleteCount + }) => { + if (!variable) { + return; + } + const { objRoot, variablePath } = variable; + + const oldValue = $stateGet(objRoot, variablePath); + $stateSet(objRoot, variablePath, !oldValue); + return !oldValue; + })?.apply(null, [actionArgs]); })() : undefined; - if ( - $steps["ifLogin"] != null && - typeof $steps["ifLogin"] === "object" && - typeof $steps["ifLogin"].then === "function" - ) { - $steps["ifLogin"] = await $steps["ifLogin"]; - } + if ( + $steps["updatePopoverCoreOpen"] != null && + typeof $steps["updatePopoverCoreOpen"] === "object" && + typeof $steps["updatePopoverCoreOpen"].then === "function" + ) { + $steps["updatePopoverCoreOpen"] = await $steps[ + "updatePopoverCoreOpen" + ]; + } - $steps["splunk"] = $ctx.auth.isLogin - ? (() => { - const actionArgs = { - customFunction: async () => { - return $$.splunkEvent({ - group: "feedback", - data: { - comment_id: $props.feedbackId, - doc_center: $props.docCenter - }, - type: "like_comment", - token: "3dfb4505-637a-4dfa-8c5d-4e4343d6ba0d", - api_host: "https://splunk-ravi-hec.paziresh24.com" - }); - } - }; - return (({ customFunction }) => { - return customFunction(); - })?.apply(null, [actionArgs]); - })() - : undefined; - if ( - $steps["splunk"] != null && - typeof $steps["splunk"] === "object" && - typeof $steps["splunk"].then === "function" - ) { - $steps["splunk"] = await $steps["splunk"]; - } - }} - > - {(() => { - try { - return +$props.like !== 0 || $state.isLike; - } catch (e) { + $steps["splunk"] = false + ? (() => { + const actionArgs = { + customFunction: async () => { + return $$.splunkEvent({ + group: "feedback", + data: { + comment_id: $props.feedbackId, + doc_center: $props.docCenter + }, + type: "like_comment", + token: "3dfb4505-637a-4dfa-8c5d-4e4343d6ba0d", + api_host: "https://splunk-ravi-hec.paziresh24.com" + }); + } + }; + return (({ customFunction }) => { + return customFunction(); + })?.apply(null, [actionArgs]); + })() + : undefined; if ( - e instanceof TypeError || - e?.plasmicType === "PlasmicUndefinedDataError" + $steps["splunk"] != null && + typeof $steps["splunk"] === "object" && + typeof $steps["splunk"].then === "function" ) { - return true; + $steps["splunk"] = await $steps["splunk"]; } - throw e; - } - })() ? ( + }} + > + {(() => { + try { + return +$props.like !== 0 || $state.isLike; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return true; + } + throw e; + } + })() ? ( +
+ + {(() => { + try { + return $state.isLike + ? Number($props.like) + 1 + : $props.like; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return "2"; + } + throw e; + } + })()} + +
+ ) : null} + {(() => { + try { + return !$state.isLike; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return true; + } + throw e; + } + })() ? ( + + ) : null} + {(() => { + try { + return $state.isLike == true; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return true; + } + throw e; + } + })() ? ( + + ) : null}
- - {(() => { - try { - return $state.isLike - ? Number($props.like) + 1 - : $props.like; - } catch (e) { - if ( - e instanceof TypeError || - e?.plasmicType === "PlasmicUndefinedDataError" - ) { - return "2"; - } - throw e; - } - })()} - + {hasVariant($state, "raviExpFroDrakam", "raviExpFroDrakam") + ? "\u0645\u0641\u06cc\u062f \u0628\u0648\u062f\u061f" + : " \u0686\u0642\u062f\u0631 \u0645\u0641\u06cc\u062f \u0628\u0648\u062f\u061f"}
- ) : null} - {(() => { - try { - return !$state.isLike; - } catch (e) { - if ( - e instanceof TypeError || - e?.plasmicType === "PlasmicUndefinedDataError" - ) { - return true; - } - throw e; - } - })() ? ( - - ) : null} - {(() => { - try { - return $state.isLike == true; - } catch (e) { - if ( - e instanceof TypeError || - e?.plasmicType === "PlasmicUndefinedDataError" - ) { - return true; - } - throw e; - } - })() ? ( - - ) : null} -
- {hasVariant($state, "raviExpFroDrakam", "raviExpFroDrakam") - ? "\u0645\u0641\u06cc\u062f \u0628\u0648\u062f\u061f" - : "\u0645\u0641\u06cc\u062f \u0628\u0648\u062f\u061f"} -
-
- ) : null} +
+ ) : null} +
{ @@ -2844,6 +3095,8 @@ const PlasmicDescendants = { "button", "dialog2", "\u0646\u0638\u0631\u0628\u06cc\u0634\u062a\u0631\u0627\u06321", + "popoverCore", + "starRate", "dialog6", "\u0633\u0648\u0634\u0627\u0644\u0647\u0627", "\u062a\u0648\u0626\u06cc\u062a\u0631", @@ -2881,6 +3134,8 @@ const PlasmicDescendants = { "button", "dialog2", "\u0646\u0638\u0631\u0628\u06cc\u0634\u062a\u0631\u0627\u06321", + "popoverCore", + "starRate", "dialog6", "\u0633\u0648\u0634\u0627\u0644\u0647\u0627", "\u062a\u0648\u0626\u06cc\u062a\u0631", @@ -2900,6 +3155,8 @@ const PlasmicDescendants = { نظربیشتراز1: [ "\u0646\u0638\u0631\u0628\u06cc\u0634\u062a\u0631\u0627\u06321" ], + popoverCore: ["popoverCore", "starRate"], + starRate: ["starRate"], dialog6: [ "dialog6", "\u0633\u0648\u0634\u0627\u0644\u0647\u0627", @@ -2954,6 +3211,8 @@ type NodeDefaultElementType = { button: typeof Button; dialog2: typeof Dialog; نظربیشتراز1: "div"; + popoverCore: typeof Popover; + starRate: typeof StarRate; dialog6: typeof Dialog; سوشالها: "div"; توئیتر: typeof Button; @@ -3053,6 +3312,8 @@ export const PlasmicReviewCard = Object.assign( نظربیشتراز1: makeNodeComponent( "\u0646\u0638\u0631\u0628\u06cc\u0634\u062a\u0631\u0627\u06321" ), + popoverCore: makeNodeComponent("popoverCore"), + starRate: makeNodeComponent("starRate"), dialog6: makeNodeComponent("dialog6"), سوشالها: makeNodeComponent("\u0633\u0648\u0634\u0627\u0644\u0647\u0627"), توئیتر: makeNodeComponent("\u062a\u0648\u0626\u06cc\u062a\u0631"), diff --git a/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.module.css b/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.module.css new file mode 100644 index 00000000..9f19ec98 --- /dev/null +++ b/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.module.css @@ -0,0 +1,22 @@ +.root { + display: flex; + flex-direction: column; + position: relative; + width: 100%; + height: auto; + justify-content: flex-start; + align-items: center; + cursor: pointer; + min-width: 0; +} +.svg { + object-fit: cover; + max-width: 100%; + width: 21px; + height: 21px; + color: #cacaca; + flex-shrink: 0; +} +.svgselected { + color: #ec9c07; +} diff --git a/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.tsx b/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.tsx new file mode 100644 index 00000000..42d08e95 --- /dev/null +++ b/.plasmic/plasmic/ravi_r_r/PlasmicStarRate.tsx @@ -0,0 +1,289 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ + +/** @jsxRuntime classic */ +/** @jsx createPlasmicElementProxy */ +/** @jsxFrag React.Fragment */ + +// This class is auto-generated by Plasmic; please do not edit! +// Plasmic Project: qQzsBf58SqzNJX45iggq96 +// Component: mLhzoRbR5vw6 + +import * as React from "react"; + +import Head from "next/head"; +import Link, { LinkProps } from "next/link"; +import { useRouter } from "next/router"; + +import { + Flex as Flex__, + MultiChoiceArg, + PlasmicDataSourceContextProvider as PlasmicDataSourceContextProvider__, + PlasmicIcon as PlasmicIcon__, + PlasmicImg as PlasmicImg__, + PlasmicLink as PlasmicLink__, + PlasmicPageGuard as PlasmicPageGuard__, + SingleBooleanChoiceArg, + SingleChoiceArg, + Stack as Stack__, + StrictProps, + Trans as Trans__, + classNames, + createPlasmicElementProxy, + deriveRenderOpts, + ensureGlobalVariants, + generateOnMutateForSpec, + generateStateOnChangeProp, + generateStateOnChangePropForCodeComponents, + generateStateValueProp, + get as $stateGet, + hasVariant, + initializeCodeComponentStates, + initializePlasmicStates, + makeFragment, + omit, + pick, + renderPlasmicSlot, + set as $stateSet, + useCurrentUser, + useDollarState, + usePlasmicTranslator, + useTrigger, + wrapWithClassName +} from "@plasmicapp/react-web"; +import { + DataCtxReader as DataCtxReader__, + useDataEnv, + useGlobalActions +} from "@plasmicapp/react-web/lib/host"; + +import "@plasmicapp/react-web/lib/plasmic.css"; + +import plasmic_fragment_design_system_css from "../fragment_design_system/plasmic.module.css"; // plasmic-import: h9Dbk9ygddw7UVEq1NNhKi/projectcss +import projectcss from "./plasmic.module.css"; // plasmic-import: qQzsBf58SqzNJX45iggq96/projectcss +import sty from "./PlasmicStarRate.module.css"; // plasmic-import: mLhzoRbR5vw6/css + +import Icon20Icon from "./icons/PlasmicIcon__Icon20"; // plasmic-import: cgCUDUxysAqU/icon +import Icon19Icon from "./icons/PlasmicIcon__Icon19"; // plasmic-import: RqJpin9qROiW/icon + +createPlasmicElementProxy; + +export type PlasmicStarRate__VariantMembers = { + selected: "selected"; +}; +export type PlasmicStarRate__VariantsArgs = { + selected?: SingleBooleanChoiceArg<"selected">; +}; +type VariantPropType = keyof PlasmicStarRate__VariantsArgs; +export const PlasmicStarRate__VariantProps = new Array( + "selected" +); + +export type PlasmicStarRate__ArgsType = { + onSelect?: () => void; +}; +type ArgPropType = keyof PlasmicStarRate__ArgsType; +export const PlasmicStarRate__ArgProps = new Array("onSelect"); + +export type PlasmicStarRate__OverridesType = { + root?: Flex__<"div">; + svg?: Flex__<"svg">; +}; + +export interface DefaultStarRateProps { + onSelect?: () => void; + selected?: SingleBooleanChoiceArg<"selected">; + className?: string; +} + +const $$ = {}; + +function useNextRouter() { + try { + return useRouter(); + } catch {} + return undefined; +} + +function PlasmicStarRate__RenderFunc(props: { + variants: PlasmicStarRate__VariantsArgs; + args: PlasmicStarRate__ArgsType; + overrides: PlasmicStarRate__OverridesType; + forNode?: string; +}) { + const { variants, overrides, forNode } = props; + + const args = React.useMemo( + () => + Object.assign( + {}, + Object.fromEntries( + Object.entries(props.args).filter(([_, v]) => v !== undefined) + ) + ), + [props.args] + ); + + const $props = { + ...args, + ...variants + }; + + const __nextRouter = useNextRouter(); + const $ctx = useDataEnv?.() || {}; + const refsRef = React.useRef({}); + const $refs = refsRef.current; + + const stateSpecs: Parameters[0] = React.useMemo( + () => [ + { + path: "selected", + type: "private", + variableType: "variant", + initFunc: ({ $props, $state, $queries, $ctx }) => $props.selected + } + ], + [$props, $ctx, $refs] + ); + const $state = useDollarState(stateSpecs, { + $props, + $ctx, + $queries: {}, + $refs + }); + + return ( +
+ { + const $steps = {}; + + $steps["runOnSelect"] = true + ? (() => { + const actionArgs = { eventRef: $props["onSelect"] }; + return (({ eventRef, args }) => { + return eventRef?.(...(args ?? [])); + })?.apply(null, [actionArgs]); + })() + : undefined; + if ( + $steps["runOnSelect"] != null && + typeof $steps["runOnSelect"] === "object" && + typeof $steps["runOnSelect"].then === "function" + ) { + $steps["runOnSelect"] = await $steps["runOnSelect"]; + } + }} + role={"img"} + /> +
+ ) as React.ReactElement | null; +} + +const PlasmicDescendants = { + root: ["root", "svg"], + svg: ["svg"] +} as const; +type NodeNameType = keyof typeof PlasmicDescendants; +type DescendantsType = + (typeof PlasmicDescendants)[T][number]; +type NodeDefaultElementType = { + root: "div"; + svg: "svg"; +}; + +type ReservedPropsType = "variants" | "args" | "overrides"; +type NodeOverridesType = Pick< + PlasmicStarRate__OverridesType, + DescendantsType +>; +type NodeComponentProps = + // Explicitly specify variants, args, and overrides as objects + { + variants?: PlasmicStarRate__VariantsArgs; + args?: PlasmicStarRate__ArgsType; + overrides?: NodeOverridesType; + } & Omit & // Specify variants directly as props + /* Specify args directly as props*/ Omit< + PlasmicStarRate__ArgsType, + ReservedPropsType + > & + /* Specify overrides for each element directly as props*/ Omit< + NodeOverridesType, + ReservedPropsType | VariantPropType | ArgPropType + > & + /* Specify props for the root element*/ Omit< + Partial>, + ReservedPropsType | VariantPropType | ArgPropType | DescendantsType + >; + +function makeNodeComponent(nodeName: NodeName) { + type PropsType = NodeComponentProps & { key?: React.Key }; + const func = function ( + props: T & StrictProps + ) { + const { variants, args, overrides } = React.useMemo( + () => + deriveRenderOpts(props, { + name: nodeName, + descendantNames: PlasmicDescendants[nodeName], + internalArgPropNames: PlasmicStarRate__ArgProps, + internalVariantPropNames: PlasmicStarRate__VariantProps + }), + [props, nodeName] + ); + return PlasmicStarRate__RenderFunc({ + variants, + args, + overrides, + forNode: nodeName + }); + }; + if (nodeName === "root") { + func.displayName = "PlasmicStarRate"; + } else { + func.displayName = `PlasmicStarRate.${nodeName}`; + } + return func; +} + +export const PlasmicStarRate = Object.assign( + // Top-level PlasmicStarRate renders the root element + makeNodeComponent("root"), + { + // Helper components rendering sub-elements + svg: makeNodeComponent("svg"), + + // Metadata about props expected for PlasmicStarRate + internalVariantProps: PlasmicStarRate__VariantProps, + internalArgProps: PlasmicStarRate__ArgProps + } +); + +export default PlasmicStarRate; +/* prettier-ignore-end */ diff --git a/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon19.tsx b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon19.tsx new file mode 100644 index 00000000..9045ce00 --- /dev/null +++ b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon19.tsx @@ -0,0 +1,38 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ +import React from "react"; +import { classNames } from "@plasmicapp/react-web"; + +export type Icon19IconProps = React.ComponentProps<"svg"> & { + title?: string; +}; + +export function Icon19Icon(props: Icon19IconProps) { + const { className, style, title, ...restProps } = props; + return ( + + {title && {title}} + + + + ); +} + +export default Icon19Icon; +/* prettier-ignore-end */ diff --git a/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon20.tsx b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon20.tsx new file mode 100644 index 00000000..4b8ba6f7 --- /dev/null +++ b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon20.tsx @@ -0,0 +1,40 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ +import React from "react"; +import { classNames } from "@plasmicapp/react-web"; + +export type Icon20IconProps = React.ComponentProps<"svg"> & { + title?: string; +}; + +export function Icon20Icon(props: Icon20IconProps) { + const { className, style, title, ...restProps } = props; + return ( + + {title && {title}} + + + + ); +} + +export default Icon20Icon; +/* prettier-ignore-end */ diff --git a/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon21.tsx b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon21.tsx new file mode 100644 index 00000000..e530e0c5 --- /dev/null +++ b/.plasmic/plasmic/ravi_r_r/icons/PlasmicIcon__Icon21.tsx @@ -0,0 +1,49 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ +import React from "react"; +import { classNames } from "@plasmicapp/react-web"; + +export type Icon21IconProps = React.ComponentProps<"svg"> & { + title?: string; +}; + +export function Icon21Icon(props: Icon21IconProps) { + const { className, style, title, ...restProps } = props; + return ( + + {title && {title}} + + + + + + ); +} + +export default Icon21Icon; +/* prettier-ignore-end */ diff --git a/plasmic.json b/plasmic.json index db552af1..40a0967a 100644 --- a/plasmic.json +++ b/plasmic.json @@ -881,7 +881,8 @@ "name": "splunkEvent", "namespace": null } - ] + ], + "jsBundleThemes": [] }, { "projectId": "YUiM7yqBWAqsh8KSnrdj7", @@ -1157,6 +1158,19 @@ "cssFilePath": "plasmic/ravi_r_r/PlasmicEditAndReport.module.css", "scheme": "blackbox", "componentType": "component" + }, + { + "id": "mLhzoRbR5vw6", + "name": "StarRate", + "type": "managed", + "projectId": "qQzsBf58SqzNJX45iggq96", + "renderModuleFilePath": "plasmic/ravi_r_r/PlasmicStarRate.tsx", + "importSpec": { + "modulePath": "StarRate.tsx" + }, + "cssFilePath": "plasmic/ravi_r_r/PlasmicStarRate.module.css", + "scheme": "blackbox", + "componentType": "component" } ], "icons": [ @@ -1274,6 +1288,21 @@ "id": "QzsC7KWBHDeN", "name": "Icon18Icon", "moduleFilePath": "plasmic/ravi_r_r/icons/PlasmicIcon__Icon18.tsx" + }, + { + "id": "RqJpin9qROiW", + "name": "Icon19Icon", + "moduleFilePath": "plasmic/ravi_r_r/icons/PlasmicIcon__Icon19.tsx" + }, + { + "id": "cgCUDUxysAqU", + "name": "Icon20Icon", + "moduleFilePath": "plasmic/ravi_r_r/icons/PlasmicIcon__Icon20.tsx" + }, + { + "id": "BAtt58GWyi8d", + "name": "Icon21Icon", + "moduleFilePath": "plasmic/ravi_r_r/icons/PlasmicIcon__Icon21.tsx" } ], "images": [], @@ -1310,6 +1339,30 @@ "name": "GrowthbookGlobalContext", "displayName": "GrowthbookGlobalContext", "componentImportPath": "@/common/fragment/growthbookGlobalContext" + }, + { + "id": "rQxw_Usvf1CS", + "name": "ApiRequest", + "displayName": "ApiRequest", + "componentImportPath": "@/common/fragment/components/api-request" + }, + { + "id": "Sqa2TCX0_xd4", + "name": "LayoutWithHeaderAndFooter", + "displayName": "LayoutWithHeaderAndFooter", + "componentImportPath": "@/common/components/layouts/layoutWithHeaderAndFooter" + }, + { + "id": "_7EgOQSHXPeF", + "name": "Switch", + "displayName": "Switch", + "componentImportPath": "@/common/fragment/components/switch" + }, + { + "id": "fAahHOA889lI", + "name": "Splunk", + "displayName": "Splunk", + "componentImportPath": "@/common/fragment/splunk" } ], "customFunctions": [ @@ -1320,8 +1373,7 @@ "name": "splunkEvent", "namespace": null } - ], - "jsBundleThemes": [] + ] }, { "projectId": "9Vr5YWkf3w7jj6SsTcCEta", diff --git a/plasmic.lock b/plasmic.lock index f5278606..7f0ebedd 100644 --- a/plasmic.lock +++ b/plasmic.lock @@ -643,18 +643,18 @@ }, { "assetId": "qQzsBf58SqzNJX45iggq96", - "checksum": "532934f0a0f0d7b2230819de013db0fa", + "checksum": "951b2b5661e808281b04dccdd936d581", "type": "globalContexts" }, { "type": "renderModule", "assetId": "hjUuvN6lhrZV", - "checksum": "f8ec5bd18c48cfa52772c31053ec0f55" + "checksum": "8a42d17a98e60f5448d1e6871909d261" }, { "type": "cssRules", "assetId": "hjUuvN6lhrZV", - "checksum": "f8ec5bd18c48cfa52772c31053ec0f55" + "checksum": "8a42d17a98e60f5448d1e6871909d261" }, { "type": "renderModule", @@ -945,6 +945,31 @@ "assetId": "qQzsBf58SqzNJX45iggq96", "type": "projectCss", "checksum": "35d901bfd7dd1fa9b6d6f362dd7e1a2a" + }, + { + "type": "renderModule", + "assetId": "mLhzoRbR5vw6", + "checksum": "16b7802c56f200bfb8f530bd6e1de90f" + }, + { + "type": "cssRules", + "assetId": "mLhzoRbR5vw6", + "checksum": "16b7802c56f200bfb8f530bd6e1de90f" + }, + { + "type": "icon", + "assetId": "RqJpin9qROiW", + "checksum": "8a02edcfdf9f7bf98b807adc60acd500" + }, + { + "type": "icon", + "assetId": "cgCUDUxysAqU", + "checksum": "d4da267a3456338199d965f76ed0b79b" + }, + { + "type": "icon", + "assetId": "BAtt58GWyi8d", + "checksum": "3208140bbcacc763ad85f4cd70feee3a" } ], "codegenVersion": "0.0.1"