@gem-sdk/core 12.0.0-staging.51 → 12.0.0-staging.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ComponentToolbarPreview.js +1 -1
- package/dist/cjs/components/Render.liquid.js +1 -1
- package/dist/cjs/components/RenderCustomCode.js +1 -1
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -1
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +1 -1
- package/dist/cjs/components/constant.js +1 -1
- package/dist/cjs/components/resize/Spacing.js +1 -1
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -2
- package/dist/cjs/components/toolbar/SectionErrorBanner.js +2 -0
- package/dist/cjs/contexts/BuilderPreviewContext.js +1 -1
- package/dist/cjs/contexts/PageContext.js +1 -1
- package/dist/cjs/contexts/ProductContext.js +1 -1
- package/dist/cjs/graphql/fragments/media.generated.js +1 -0
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +0 -4
- package/dist/cjs/graphql/fragments/product-little.generated.js +1 -1
- package/dist/cjs/graphql/fragments/product-variants-with-selling-plans-select.generated.js +42 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +11 -2
- package/dist/cjs/graphql/queries/product-value-label.generated.js +4 -6
- package/dist/cjs/graphql/queries/product-variant-with-selling-plans.generated.js +25 -0
- package/dist/cjs/graphql/queries/products-with-selling-plans.generated.js +82 -0
- package/dist/cjs/graphql/queries/products.generated.js +6 -0
- package/dist/cjs/graphql/queries/productsV2.generated.js +5 -5
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +5 -2
- package/dist/cjs/graphql-app-api/queries/ThemePageMeta.generated.js +30 -0
- package/dist/cjs/helpers/background.js +1 -1
- package/dist/cjs/helpers/interaction/index.js +1 -1
- package/dist/cjs/helpers/liquid.js +1 -0
- package/dist/cjs/helpers/queries/get-products.js +1 -1
- package/dist/cjs/helpers/queries/getProductOffers.js +1 -0
- package/dist/cjs/hooks/animation/animations.js +0 -1
- package/dist/cjs/hooks/shop/use-products-query.js +0 -1
- package/dist/cjs/hooks/shop/useProductOffersQuery.js +2 -0
- package/dist/cjs/hooks/useAnimations.js +1 -1
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -2
- package/dist/cjs/hooks/useProduct.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/ComponentToolbarPreview.js +1 -1
- package/dist/esm/components/Render.liquid.js +1 -1
- package/dist/esm/components/RenderCustomCode.js +1 -1
- package/dist/esm/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/esm/components/ai-generator/components/PickProduct.js +1 -1
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -1
- package/dist/esm/components/constant.js +1 -1
- package/dist/esm/components/resize/Spacing.js +1 -1
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -2
- package/dist/esm/components/toolbar/SectionErrorBanner.js +2 -0
- package/dist/esm/contexts/BuilderPreviewContext.js +1 -1
- package/dist/esm/contexts/PageContext.js +1 -1
- package/dist/esm/contexts/ProductContext.js +1 -1
- package/dist/esm/graphql/fragments/media.generated.js +1 -0
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +0 -4
- package/dist/esm/graphql/fragments/product-little.generated.js +1 -1
- package/dist/esm/graphql/fragments/product-variants-with-selling-plans-select.generated.js +42 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +11 -2
- package/dist/esm/graphql/queries/product-value-label.generated.js +4 -6
- package/dist/esm/graphql/queries/product-variant-with-selling-plans.generated.js +25 -0
- package/dist/esm/graphql/queries/products-with-selling-plans.generated.js +82 -0
- package/dist/esm/graphql/queries/products.generated.js +6 -0
- package/dist/esm/graphql/queries/productsV2.generated.js +5 -5
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +5 -2
- package/dist/esm/graphql-app-api/queries/ThemePageMeta.generated.js +30 -0
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/interaction/index.js +1 -1
- package/dist/esm/helpers/liquid.js +1 -0
- package/dist/esm/helpers/queries/get-products.js +1 -1
- package/dist/esm/helpers/queries/getProductOffers.js +1 -0
- package/dist/esm/hooks/animation/animations.js +0 -1
- package/dist/esm/hooks/shop/use-products-query.js +0 -1
- package/dist/esm/hooks/shop/useProductOffersQuery.js +2 -0
- package/dist/esm/hooks/useAnimations.js +1 -1
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -2
- package/dist/esm/hooks/useProduct.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/index.d.ts +12141 -1841
- package/package.json +10 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand");var BuilderPreviewContext=require("../contexts/BuilderPreviewContext.js"),PageContext=require("../contexts/PageContext.js"),CreateThemeSection=require("./theme-section/CreateThemeSection.js"),Tooltip=require("./toolbar/Tooltip.js"),ThemeSectionStatus=require("./theme-section/ThemeSectionStatus.js"),Resize=require("./resize/Resize.js"),useToolbarPostPurchase=require("../hooks/useToolbarPostPurchase.js"),constant=require("./constant.js"),AIContentGenerator=require("./ai-generator/AIContentGenerator.js"),AIGenContentLoading=require("./ai-generator/AIGenContentLoading.js"),InteractionSuffix=require("./InteractionSuffix.js"),core=require("@gem-sdk/core");require("swr"),require("../helpers/convert.js"),require("crc-32");var ShopContext=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js");const SECTION_LIMIT=25,notVisible=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},isSection=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t},ComponentToolbarPreview=e=>{let{t}=core.useI18nStore(),i=e.isThemeSection,o=!!e.isShopifySection,n=ShopContext.useShopStore(e=>e.storefrontUrl),r=ShopContext.useShopStore(e=>e.pageType),l=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getParents),a=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getItem("ROOT")),s=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[d,u]=react.useState(null),[C,c]=react.useState(!1),[h,m]=react.useState(!1),[x,p]=react.useState([]),[j,g]=react.useState("top"),[f,v]=react.useState(!1),[b,R]=react.useState(!1),[w,S]=react.useState(""),[M,L]=react.useState(""),[P,T]=react.useState({width:"",text:""}),[y,Z]=react.useState(!1),E=PageContext.usePageStore(e=>e.interactionData),H=react.useMemo(()=>"POST_PURCHASE"===r,[r]),{checkDisableDelete:V,getTooltipText:q,checkDisableDuplicate:A}=useToolbarPostPurchase.usePostPurchase(e.uid,e.tag||""),I=["ProductTitle","ProductDescription","ProductPrice"],B=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],k=[...I,...B],F=(e,t)=>{let i=x.length,o=e.getBoundingClientRect(),n=t.getBoundingClientRect();return o.top-n.top<36*i},G=(e,t)=>{let i=t||e;if(e&&!isSection(e))return notVisible(e)&&F(t,e)?e:e.parentElement?G(e.parentElement,i):void 0},$=react.useCallback(()=>a?.childrens?.length||0,[a?.childrens?.length]),O=react.useCallback(()=>{if("Section"==e.tag)return"bottom";let t=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?g("bottom"):g("top")}},[e.tag]),U=react.useMemo(()=>{let e=/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;return n?n.match(e)?.[1]:""},[n]),D=react.useMemo(()=>`https://admin.shopify.com/store/${U}`,[U]),N=react.useMemo(()=>w?`${D}/products/${w}`:"",[D,w]),_=react.useMemo(()=>M?`${D}/articles/${M.replace("gid://shopify/Article/","")}`:"",[M,D]),z=react.useMemo(()=>E?.isSelectOnPage,[E?.isSelectOnPage]),W=react.useMemo(()=>E?.settingType,[E?.settingType]),J=react.useMemo(()=>E?.item?.targets?.find(t=>t.uid===e.uid&&t?.type!=="PAGE")&&"TARGET"===W,[E?.item?.targets,e.uid,W]),K=react.useMemo(()=>E?.item?.self?.uid===e.uid&&E?.item?.self.type!=="PAGE"&&"TRIGGER"===W,[E?.item?.self?.type,E?.item?.self?.uid,e.uid,W]),Q=react.useMemo(()=>!J&&!K,[J,K]),X=react.useMemo(()=>f||o,[f,o]),Y=react.useMemo(()=>y||o||$()>25&&"Section"===e.tag,[$,y,o,e.tag]),ee=react.useCallback(t=>{let i=t.detail;if(i?.articleId&&L(i.articleId),i?.productId&&S(i.productId),i?.componentUid==e.uid){R(!0),O(),H&&(v(V()),T(q()),Z(A()));let t=l(e.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&s||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);p(t)}else R(!1),p([]),c(!1)},[e.uid,H,l,V,q,A,s,O]);if(react.useEffect(()=>(window.addEventListener("editor:active-component",ee),()=>{window.removeEventListener("editor:active-component",ee)}),[ee]),"section"===e.type||e.editorConfigs?.toolbar?.hide)return null;let et=()=>"Section"!==e.tag?-1:a?.childrens?.length?a.childrens.findIndex(t=>t==e.uid):-1,ei=e=>{let i=e?.childrens?.length??0;if("Row"===e.label){let e=1===i?t("Row {colNumber} col",{colNumber:i}):t("Row {colNumber} cols",{colNumber:i});return e}return t(e.label)},eo=e=>{if(!x.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(C)m(!1),c(!1);else{let e=G(i,i);if(e)m(!0);else{let e=i.getBoundingClientRect();e.top<36*x.length?m(!0):m(!1)}c(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!C}});window.dispatchEvent(o)},en=()=>{if(B.includes(e.tag)){window.open(_,"_blank");return}if(I.includes(e.tag)){window.open(N,"_blank");return}window.open(D,"_blank")},er=t=>{t.preventDefault(),t.stopPropagation();let n=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:i,isShopifySection:o}});return window.dispatchEvent(n),!1},el=t=>{t.preventDefault(),t.stopPropagation();let n=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:i,isShopifySection:o}});return window.dispatchEvent(n),!1},ea=()=>e.customLabel||e.label,es=t=>{t.preventDefault(),t.stopPropagation();let i=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:e.uid}});return window.dispatchEvent(i),!1},ed=()=>{u(null),window.removeEventListener("editor:close-add-section-popup",ed)},eu=(t,i)=>{if(t.preventDefault(),t.stopPropagation(),$()>=25)return!1;let o=t.target;if(o){u(i);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:e.uid,position:i,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",ed)}return!1},eC=()=>{if(o)return e.name?.includes("Shopify section:")?e.name:`Shopify section: ${e.name}`;let i=e.name&&e.name===`Section ${e.uid}`;return $()>=20?`${i?"Section":e?.name} ${et()+1}/25`:i?`${t("Section")} ${et()+1}`:e?.name},ec=()=>{let{isShopifySection:t,tag:o}=e;return!t&&(!i||!!s)&&constant.ableGenerateContentElements.includes(o)};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!("Section"==e.tag&&s)&&jsxRuntime.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==e.tag,"data-toolbar-theme-section":"Section"==e.tag&&!!i||s,"data-toolbar-shopify-section":"Section"==e.tag&&!!o,"data-toolbar-limit":et()>=25,children:[jsxRuntime.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>eo(e),"aria-hidden":"true",children:[K&&jsxRuntime.jsx("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:jsxRuntime.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),J&&jsxRuntime.jsx("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),b&&Q&&jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==e.tag?jsxRuntime.jsxs("div",{"data-toolbar-name":!0,children:[eC(),b&&o&&!e.isShopifyVisibility&&jsxRuntime.jsxs("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:t(ea())}),b&&"Section"!==e.tag&&x.length>0&&jsxRuntime.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":C,children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),b&&C&&x.map((e,t)=>jsxRuntime.jsxs("div",{"data-toolbar-parent":!0,"data-component-tag":e.tag,"data-parent-uid":e.uid,"data-toolbar-theme-section":s,"data-toolbar-parent-revert":h,style:{top:h?`${36*(t+1)}px`:`${-36*(t+1)}px`},children:[jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:ei(e)})]},e.uid)),b&&!z&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ","Section"===e.tag&&!e.isThemeSection&&"STATIC"!==r&&"POST_PURCHASE"!==r&&!e.isShopifySection&&25>et()&&jsxRuntime.jsx(CreateThemeSection.CreateThemeSection,{...e}),ec()&&jsxRuntime.jsx(AIContentGenerator.AIContentGenerator,{...e}),"Sticky"==e.tag&&jsxRuntime.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>es(e),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),k.includes(e.tag)&&jsxRuntime.jsx(Tooltip.default,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:t("Edit content in Shopify"),position:"top",onClick:en,"aria-hidden":"true",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),jsxRuntime.jsx(Tooltip.default,{enable:"Section"==e.tag&&$()>=25||o,text:o?t("Disabled. Please edit in Shopify Editor"):t("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":Y,onClick:Y?void 0:e=>el(e),"aria-hidden":"true",className:Y?"!gp-cursor-not-allowed":"",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),jsxRuntime.jsx(Tooltip.default,{"data-toolbar-delete":!0,onClick:e=>X?null:er(e),enable:X,"data-toolbar-disable":X,text:o?t("Disabled. Please edit in Shopify Editor"):P.text,width:P.width,position:o?"bottom":j,"aria-hidden":"true",className:X?"!gp-cursor-not-allowed":"",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),jsxRuntime.jsx(InteractionSuffix.InteractionSuffix,{uid:e.uid})]},e.uid),"STATIC"!==r&&"POST_PURCHASE"!==r&&25>et()&&jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper,{...e}),jsxRuntime.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==e.tag,"data-outline-theme-section":"Section"==e.tag&&!!i||s,"data-outline-shopify-section":"Section"==e.tag&&!!o,"data-outline-limit":et()>=25},"outline-"+e.uid),"Section"==e.tag&&!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tooltip.default,{enable:$()>=25,text:t("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":$()>=25,"data-toolbar-add-open":"above"==d,onClick:e=>eu(e,"above"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),jsxRuntime.jsx(Tooltip.default,{enable:$()>=25,text:t("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":$()>=25,"data-toolbar-add-open":"below"==d,onClick:e=>eu(e,"below"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),constant.ableGenerateContentElements.includes(e.tag)&&b&&jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading,{...e}),b&&jsxRuntime.jsx(Resize.default,{...e})]})};var ComponentToolbarPreview$1=react.memo(ComponentToolbarPreview);exports.default=ComponentToolbarPreview$1;
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand");var BuilderPreviewContext=require("../contexts/BuilderPreviewContext.js"),PageContext=require("../contexts/PageContext.js"),CreateThemeSection=require("./theme-section/CreateThemeSection.js"),Tooltip=require("./toolbar/Tooltip.js"),SectionErrorBanner=require("./toolbar/SectionErrorBanner.js"),ThemeSectionStatus=require("./theme-section/ThemeSectionStatus.js"),Resize=require("./resize/Resize.js"),useToolbarPostPurchase=require("../hooks/useToolbarPostPurchase.js"),constant=require("./constant.js"),AIContentGenerator=require("./ai-generator/AIContentGenerator.js"),AIGenContentLoading=require("./ai-generator/AIGenContentLoading.js"),InteractionSuffix=require("./InteractionSuffix.js"),core=require("@gem-sdk/core");require("swr"),require("../helpers/convert.js"),require("crc-32");var ShopContext=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js");const SECTION_LIMIT=25,notVisible=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t},isSection=e=>{let t=e.getAttribute("data-component-tag");return"Section"===t},ComponentToolbarPreview=e=>{let{t}=core.useI18nStore(),i=e.isThemeSection,o=!!e.isShopifySection,n=ShopContext.useShopStore(e=>e.storefrontUrl),r=ShopContext.useShopStore(e=>e.pageType),l=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getParents),a=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getItem("ROOT")),s=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[d,u]=react.useState(null),[C,c]=react.useState(!1),[m,h]=react.useState(!1),[x,p]=react.useState([]),[j,g]=react.useState("top"),[f,v]=react.useState(!1),[b,w]=react.useState(!1),[R,S]=react.useState(""),[M,L]=react.useState(""),[P,T]=react.useState({width:"",text:""}),[y,Z]=react.useState(!1),E=BuilderPreviewContext.useBuilderPreviewStore(e=>e.errorSectionList),B=react.useMemo(()=>{if(!E)return null;let t=E?.find(t=>t.uid===e.uid);return t},[E,e.uid]),H=PageContext.usePageStore(e=>e.interactionData),V=react.useMemo(()=>"POST_PURCHASE"===r,[r]),{checkDisableDelete:q,getTooltipText:I,checkDisableDuplicate:A}=useToolbarPostPurchase.usePostPurchase(e.uid,e.tag||""),k=["ProductTitle","ProductDescription","ProductPrice"],F=["ArticleTitle","ArticleContent","ArticleImage","ArticleAuthor","ArticleCategory","ArticleDate","ArticleExcerpt","ArticleTags"],G=[...k,...F],$=(e,t)=>{let i=x.length,o=e.getBoundingClientRect(),n=t.getBoundingClientRect();return o.top-n.top<36*i},O=(e,t)=>{let i=t||e;if(e&&!isSection(e))return notVisible(e)&&$(t,e)?e:e.parentElement?O(e.parentElement,i):void 0},D=react.useCallback(()=>a?.childrens?.length||0,[a?.childrens?.length]),U=react.useCallback(()=>{if("Section"==e.tag)return"bottom";let t=document.body.querySelector("#storefront")?.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?g("bottom"):g("top")}},[e.tag]),N=react.useMemo(()=>{let e=/^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;return n?n.match(e)?.[1]:""},[n]),_=react.useMemo(()=>`https://admin.shopify.com/store/${N}`,[N]),z=react.useMemo(()=>R?`${_}/products/${R}`:"",[_,R]),W=react.useMemo(()=>M?`${_}/articles/${M.replace("gid://shopify/Article/","")}`:"",[M,_]),J=react.useMemo(()=>H?.isSelectOnPage,[H?.isSelectOnPage]),K=react.useMemo(()=>H?.settingType,[H?.settingType]),Q=react.useMemo(()=>H?.item?.targets?.find(t=>t.uid===e.uid&&t?.type!=="PAGE")&&"TARGET"===K,[H?.item?.targets,e.uid,K]),X=react.useMemo(()=>H?.item?.self?.uid===e.uid&&H?.item?.self.type!=="PAGE"&&"TRIGGER"===K,[H?.item?.self?.type,H?.item?.self?.uid,e.uid,K]),Y=react.useMemo(()=>!Q&&!X,[Q,X]),ee=react.useMemo(()=>f||o,[f,o]),et=react.useMemo(()=>y||o||D()>25&&"Section"===e.tag||!!B,[D,y,o,e.tag,B]),ei=react.useCallback(t=>{let i=t.detail;if(i?.articleId&&L(i.articleId),i?.productId&&S(i.productId),i?.componentUid==e.uid){w(!0),U(),V&&(v(q()),T(I()),Z(A()));let t=l(e.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&s||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);p(t)}else w(!1),p([]),c(!1)},[e.uid,V,l,q,I,A,s,U]),eo=BuilderPreviewContext.useBuilderPreviewStore(e=>e.dismissPublishError),en=react.useCallback(()=>{eo(e.uid)},[eo,e.uid]),er=react.useCallback(()=>"Section"!==e.tag?-1:a?.childrens?.length?a.childrens.findIndex(t=>t==e.uid):-1,[a?.childrens,e.uid,e.tag]),el=react.useMemo(()=>er()>=25,[er]),ea=react.useMemo(()=>!!B||el,[B,el]);if(react.useEffect(()=>(window.addEventListener("editor:active-component",ei),()=>{window.removeEventListener("editor:active-component",ei)}),[ei]),"section"===e.type||e.editorConfigs?.toolbar?.hide)return null;let es=e=>{let i=e?.childrens?.length??0;if("Row"===e.label){let e=1===i?t("Row {colNumber} col",{colNumber:i}):t("Row {colNumber} cols",{colNumber:i});return e}return t(e.label)},ed=e=>{if(!x.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(C)h(!1),c(!1);else{let e=O(i,i);if(e)h(!0);else{let e=i.getBoundingClientRect();e.top<36*x.length?h(!0):h(!1)}c(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!C}});window.dispatchEvent(o)},eu=()=>{if(F.includes(e.tag)){window.open(W,"_blank");return}if(k.includes(e.tag)){window.open(z,"_blank");return}window.open(_,"_blank")},eC=t=>{t.preventDefault(),t.stopPropagation();let n=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:i,isShopifySection:o}});return window.dispatchEvent(n),!1},ec=t=>{t.preventDefault(),t.stopPropagation();let n=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:i,isShopifySection:o}});return window.dispatchEvent(n),!1},em=()=>e.customLabel||e.label,eh=t=>{t.preventDefault(),t.stopPropagation();let i=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:e.uid}});return window.dispatchEvent(i),!1},ex=()=>{u(null),window.removeEventListener("editor:close-add-section-popup",ex)},ep=(t,i)=>{if(t.preventDefault(),t.stopPropagation(),D()>=25)return!1;let o=t.target;if(o){u(i);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:e.uid,position:i,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",ex)}return!1},ej=()=>{if(o)return e.name?.includes("Shopify section:")?e.name:`Shopify section: ${e.name}`;let i=e.name&&e.name===`Section ${e.uid}`;return D()>=20?`${i?"Section":e?.name} ${er()+1}/25`:i?`${t("Section")} ${er()+1}`:e?.name},eg=()=>{let{isShopifySection:t,tag:o}=e;return!t&&(!i||!!s)&&constant.ableGenerateContentElements.includes(o)&&!B},ef="Section"===e.tag&&!e.isThemeSection&&"STATIC"!==r&&"POST_PURCHASE"!==r&&!e.isShopifySection&&25>er()&&!B;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!("Section"==e.tag&&s)&&jsxRuntime.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==e.tag,"data-toolbar-theme-section":"Section"==e.tag&&!!i||s,"data-toolbar-shopify-section":"Section"==e.tag&&!!o,"data-toolbar-limit":er()>=25||!!B,children:[jsxRuntime.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>ed(e),"aria-hidden":"true",children:[X&&jsxRuntime.jsx("div",{className:"gp-hidden gp-w-[12px] interaction-use-custom-element",children:jsxRuntime.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",fill:"#F9F9F9"})})}),Q&&jsxRuntime.jsx("div",{className:"gp-hidden gp-w-[14px] interaction-use-custom-element",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",fill:"#F9F9F9"})})}),b&&Y&&jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),"Section"==e.tag?jsxRuntime.jsxs("div",{"data-toolbar-name":!0,children:[ej(),b&&o&&!e.isShopifyVisibility&&jsxRuntime.jsxs("svg",{"data-toolbar-visibility":!0,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",fill:"#F9F9F9"})]})]}):jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:t(em())}),b&&"Section"!==e.tag&&x.length>0&&jsxRuntime.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":C,children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M5.65522 10C5.07265 10 4.7809 9.22865 5.19284 8.77753L7.53762 6.20974C7.79298 5.93009 8.20702 5.93009 8.46238 6.20974L10.8072 8.77754C11.2191 9.22866 10.9274 10 10.3448 10H5.65522Z",fill:"currentColor"})})})]}),b&&C&&x.map((e,t)=>jsxRuntime.jsxs("div",{"data-toolbar-parent":!0,"data-component-tag":e.tag,"data-parent-uid":e.uid,"data-toolbar-theme-section":s,"data-toolbar-parent-revert":m,style:{top:m?`${36*(t+1)}px`:`${-36*(t+1)}px`},children:[jsxRuntime.jsx("div",{"data-toolbar-icon-drag":!0,children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M5.5 4.5C6.32843 4.5 7 3.82843 7 3C7 2.17157 6.32843 1.5 5.5 1.5C4.67157 1.5 4 2.17157 4 3C4 3.82843 4.67157 4.5 5.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M5.5 9.5C6.32843 9.5 7 8.82843 7 8C7 7.17157 6.32843 6.5 5.5 6.5C4.67157 6.5 4 7.17157 4 8C4 8.82843 4.67157 9.5 5.5 9.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7 13C7 13.8284 6.32843 14.5 5.5 14.5C4.67157 14.5 4 13.8284 4 13C4 12.1716 4.67157 11.5 5.5 11.5C6.32843 11.5 7 12.1716 7 13Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 4.5C11.3284 4.5 12 3.82843 12 3C12 2.17157 11.3284 1.5 10.5 1.5C9.67157 1.5 9 2.17157 9 3C9 3.82843 9.67157 4.5 10.5 4.5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 8C12 8.82843 11.3284 9.5 10.5 9.5C9.67157 9.5 9 8.82843 9 8C9 7.17157 9.67157 6.5 10.5 6.5C11.3284 6.5 12 7.17157 12 8Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.5 14.5C11.3284 14.5 12 13.8284 12 13C12 12.1716 11.3284 11.5 10.5 11.5C9.67157 11.5 9 12.1716 9 13C9 13.8284 9.67157 14.5 10.5 14.5Z",fill:"currentColor"})]})}),jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:es(e)})]},e.uid)),b&&!J&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",ef&&jsxRuntime.jsx(CreateThemeSection.CreateThemeSection,{...e}),eg()&&jsxRuntime.jsx(AIContentGenerator.AIContentGenerator,{...e}),"Sticky"==e.tag&&jsxRuntime.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>eh(e),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",fill:"currentColor"})})}),G.includes(e.tag)&&jsxRuntime.jsx(Tooltip.default,{"data-toolbar-title":!0,enable:!0,"data-toolbar-disable":!1,text:t("Edit content in Shopify"),position:"top",onClick:eu,"aria-hidden":"true",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",fill:"currentColor"})]})}),jsxRuntime.jsx(Tooltip.default,{enable:"Section"==e.tag&&D()>=25||o,text:o?t("Disabled. Please edit in Shopify Editor"):t("Page has reached Shopify’s 25 section-limit"),position:"bottom",width:"200px","data-toolbar-duplicate":!0,"data-toolbar-disable":et,onClick:et?void 0:e=>ec(e),"aria-hidden":"true",className:et?"!gp-cursor-not-allowed":"",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",fill:"currentColor"})})}),jsxRuntime.jsx(Tooltip.default,{"data-toolbar-delete":!0,onClick:e=>ee?null:eC(e),enable:ee,"data-toolbar-disable":ee,text:o?t("Disabled. Please edit in Shopify Editor"):P.text,width:P.width,position:o?"bottom":j,"aria-hidden":"true",className:ee?"!gp-cursor-not-allowed":"",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",fill:"currentColor"})})})]}),jsxRuntime.jsx(InteractionSuffix.InteractionSuffix,{uid:e.uid})]},e.uid),"STATIC"!==r&&"POST_PURCHASE"!==r&&25>er()&&jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper,{...e}),jsxRuntime.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==e.tag,"data-outline-theme-section":"Section"==e.tag&&!!i||s,"data-outline-shopify-section":"Section"==e.tag&&!!o,"data-outline-limit":ea,"data-outline-error":!!B},"outline-"+e.uid),"Section"==e.tag&&!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tooltip.default,{enable:D()>=25,text:t("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":D()>=25,"data-toolbar-add-open":"above"==d,onClick:e=>ep(e,"above"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})}),jsxRuntime.jsx(Tooltip.default,{enable:D()>=25,text:t("Page has reached Shopify’s 25 section-limit"),position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":D()>=25,"data-toolbar-add-open":"below"==d,onClick:e=>ep(e,"below"),"aria-hidden":"true",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8.45 3.95C8.45 3.70147 8.24853 3.5 8 3.5C7.75147 3.5 7.55 3.70147 7.55 3.95V7.55H3.95C3.70147 7.55 3.5 7.75147 3.5 8C3.5 8.24853 3.70147 8.45 3.95 8.45H7.55V12.05C7.55 12.2985 7.75147 12.5 8 12.5C8.24853 12.5 8.45 12.2985 8.45 12.05V8.45H12.05C12.2985 8.45 12.5 8.24853 12.5 8C12.5 7.75147 12.2985 7.55 12.05 7.55H8.45V3.95Z",fill:"#212121"})})})]}),B&&jsxRuntime.jsx(SectionErrorBanner.SectionErrorBanner,{errorSectionInfo:B,onDismiss:en}),constant.ableGenerateContentElements.includes(e.tag)&&b&&jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading,{...e}),b&&jsxRuntime.jsx(Resize.default,{...e})]})};var ComponentToolbarPreview$1=react.memo(ComponentToolbarPreview);exports.default=ComponentToolbarPreview$1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var makeStyle=require("../helpers/make-style.js");require("react"),require("react/jsx-runtime"),require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js"),require("react-transition-group")
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var makeStyle=require("../helpers/make-style.js");require("react"),require("react/jsx-runtime"),require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js"),require("react-transition-group");var constant=require("./constant.js");require("classnames"),require("dayjs"),require("@gem-sdk/core");var composeAdvanceStyle=require("../helpers/compose-advance-style.js"),convert=require("../helpers/convert.js");require("crc-32");var render=require("../helpers/render.js");const componentsRenderWithParentId=["CarouselItem","CarouselItemV3"],componentTexts=["Text","Heading"],componentIconList=["IconListV2","IconList"],componentUsingAdvanced=["IconList","ProductVariants"],Render=({uid:e,builder:t,components:r,parentId:n,extraFiles:s={},pageContext:i,additionalSettings:d,...a})=>{let l=t[e],o=r[l?.tag];if(!o||!l||l?.type==="section")return{liquid:"",extraFiles:s};{let s={extraFiles:{}},c=composeAdvanceStyle.composeAdvanceStyle(l.advanced,l.tag),p="";p=constant.disableWrap.includes(l.tag)?render.RenderIf(l?.childrens?.length,()=>o({builderProps:{uid:e,builderData:l},styles:l.styles,setting:l.settings,style:c,advanced:l.advanced,parentId:componentsRenderWithParentId.includes(l.tag)?n:null,pageContext:i,...d,...a,builderAttrs:{...a.builderAttrs},rawChildren:l.childrens.map(e=>({...t[e],uid:e,builder:t,components:r,customProps:s,pageContext:i,...d})),children:constant.customRenderChildren.includes(l.tag)?"":WrapRenderChildren({uid:e,customProps:s},l.childrens.map(e=>RenderChildren({uid:e,builder:t,components:r,customProps:s,parentTag:l.tag,pageContext:i,...d})))}),()=>o({builderProps:{uid:e,builderData:l},styles:l.styles,setting:l.settings,advanced:l.advanced,style:c,isText:!!componentTexts.includes(l.tag)||null,parentId:componentsRenderWithParentId.includes(l.tag)?n:null,pageContext:i,...a,builderAttrs:{...a.builderAttrs}})):render.template`<div gp-el-wrapper style="${componentIconList.includes(l.tag)?"":c}" class="${l.uid} ${l?.childrens?.length||"IconListItemHoz"!==l.tag?"":"hidden"}">
|
|
3
3
|
${render.RenderIf(l?.childrens?.length,()=>o({builderProps:{uid:e,builderData:l},styles:l.styles,setting:l.settings,advanced:{...componentUsingAdvanced.includes(l.tag)?l?.advanced:{},cssClass:l?.advanced?.cssClass},pageContext:i,...d,...a,builderAttrs:{...a.builderAttrs},rawChildren:l.childrens.map(e=>({...t[e],uid:e,builder:t,components:r,customProps:s,pageContext:i,...d})),children:constant.customRenderChildren.includes(l.tag)?"":WrapRenderChildren({uid:e,customProps:s},l.childrens.map(e=>RenderChildren({uid:e,builder:t,components:r,customProps:s,parentTag:l.tag,pageContext:i,...d})))}),()=>o({builderProps:{uid:e,builderData:l},styles:l.styles,setting:l.settings,advanced:{...componentUsingAdvanced.includes(l.tag)?l?.advanced:{},cssClass:l?.advanced?.cssClass},pageContext:i,...d,isText:!!componentTexts.includes(l.tag)||null,style:componentIconList.includes(l.tag)?c:null,...a,builderAttrs:{...a.builderAttrs}}))}
|
|
4
4
|
</div>`;let{cssCode:u,jsCode:m}=RenderCustomCode(l);return u&&(p+=u),m&&(p+=m),{liquid:p=appendAnimation(l,p),extraFiles:s.extraFiles}}},RenderCustomCode=e=>{let{css:t,javascript:r,rootClassName:n}=e.advanced?.editorData||{},s=t?.replaceAll(n,e.uid),i=r?.replaceAll(n,e.uid),d=render.RenderIf(!!t,render.template`
|
|
5
5
|
<style id="${`custom-css-${e?.uid}`}">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Head=require("next/head"),Script=require("next/script"),react=require("react");require("zustand"),require("react-transition-group"),require("
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Head=require("next/head"),Script=require("next/script"),react=require("react");require("zustand"),require("react-transition-group"),require("swr"),require("swr/infinite");var shop=require("../hooks/shop.js");require("classnames"),require("dayjs"),require("@gem-sdk/core"),require("../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js"),require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js");const RenderCustomCode=({uid:e,advanced:r})=>{let s=shop.useEditorMode(),{css:t,javascript:i,rootClassName:u}=r?.editorData||{},a=t?.replaceAll(u,e),o=i?.replaceAll(u,e),n={css:`custom-css-${e}`,javascript:`custom-js-${e}`},c=react.useMemo(()=>`
|
|
3
3
|
try {
|
|
4
4
|
${o}
|
|
5
5
|
} catch(err){}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),AIIcon=require("./icons/AIIcon.js"),CloseIcon=require("./icons/CloseIcon.js"),ShowMoreIcon=require("./icons/ShowMoreIcon.js"),WarningIcon=require("./icons/WarningIcon.js"),UpgradeIcon=require("./icons/UpgradeIcon.js"),PickProduct=require("./components/PickProduct.js"),ToneAndVoice=require("./components/ToneAndVoice.js"),classNames=require("classnames"),useListenEventGenerate=require("./hooks/useListenEventGenerate.js"),useGettingGenerateRequest=require("./hooks/useGettingGenerateRequest.js"),useFlipPopup=require("./hooks/useFlipPopup.js"),useCheckingProductInside=require("./hooks/useCheckingProductInside.js");require("zustand");var I18nContext=require("../../contexts/I18nContext.js");require("react-transition-group")
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),AIIcon=require("./icons/AIIcon.js"),CloseIcon=require("./icons/CloseIcon.js"),ShowMoreIcon=require("./icons/ShowMoreIcon.js"),WarningIcon=require("./icons/WarningIcon.js"),UpgradeIcon=require("./icons/UpgradeIcon.js"),PickProduct=require("./components/PickProduct.js"),ToneAndVoice=require("./components/ToneAndVoice.js"),classNames=require("classnames"),useListenEventGenerate=require("./hooks/useListenEventGenerate.js"),useGettingGenerateRequest=require("./hooks/useGettingGenerateRequest.js"),useFlipPopup=require("./hooks/useFlipPopup.js"),useCheckingProductInside=require("./hooks/useCheckingProductInside.js");require("zustand");var I18nContext=require("../../contexts/I18nContext.js");require("react-transition-group");var ShopContext=require("../../contexts/ShopContext.js"),dayjs=require("dayjs");require("@gem-sdk/core"),require("swr"),require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/custom.js"),require("../../types/animations.js");const AIContentGenerator=({...e})=>{let[t,s]=react.useState(!1),[n,r]=react.useState(!1),i=react.useRef(null),o=react.useRef(null),a=react.useRef(null),u=react.useRef(null),p=dayjs().add(1,"month").startOf("month").format("DD MMM"),{t:g}=I18nContext.useI18nStore(),{popupPositionX:c,popupPositionY:l,isValidating:d,bodyMaxHeight:x}=useFlipPopup.useFlipPopup(t,{genTool:i,genPopup:o,genPopupHeader:a,genButtonWrapper:u}),{isGenerating:m,onGenerate:j,onOpenProductElementSettings:h,goToPricing:f}=useListenEventGenerate.useListenEventGenerate({uid:e.uid,tag:String(e.tag)}),{getRequestBody:I,prompt:R,changeProductName:b,changePrompt:v,changeTone:q}=useGettingGenerateRequest.useGettingGenerateRequest(),{productElement:C,checkSectionHasProduct:w}=useCheckingProductInside.useCheckingProductInside(i),N=ShopContext.useShopStore(e=>e.generateContentLimitation),k=()=>{s(!t)},A=()=>{s(!1)},y=e=>{v(e.target.value)},G=react.useCallback(t=>{let s=t.detail;if(s?.componentUid!==e.uid){A();return}w()},[e.uid,w]),S=()=>{r(!n)},P=()=>{let e=I();j(e),A()},E=()=>{h(C.uid??"")};return react.useEffect(()=>{m||A()},[m]),react.useEffect(()=>{if(C.productId){r(!1);return}r(!0)},[C]),react.useEffect(()=>(window.addEventListener("editor:active-component",G),()=>{window.removeEventListener("editor:active-component",G)}),[G]),jsxRuntime.jsxs("div",{className:"gp-gen-content-toolbar-wrapper gp-relative",ref:i,children:[jsxRuntime.jsx("div",{className:"gp-gen-content-btn gp-border-r gp-pr-1 gp-mr-1",children:jsxRuntime.jsxs("button",{className:classNames({"gp-toolbar-ai-active":t},"gp-p-1 gp-text-xs gp-flex gp-gap-1 gp-items-center gp-rounded-md hover:gp-bg-[#3B3B3B] gp-font-medium"),onClick:k,children:[jsxRuntime.jsx(AIIcon.AIIcon,{}),g("AI Content")]})}),jsxRuntime.jsxs("div",{className:classNames({"gp-hidden":!t,"gp-right-0":"Section"===e.tag||"right"===c,"gp-left-0":"left"===c&&"Section"!==e.tag,"gp-top-8":"top"===l,"gp-bottom-8":"bottom"===l,"!gp-visible":!d},"gp-absolute gp-invisible gp-rounded-lg gp-bg-[#151515] gp-w-[312px] !gp-max-w-[312px] !gp-cursor-default"),ref:o,children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between gp-px-4 gp-py-[10px]",ref:a,children:[jsxRuntime.jsx("span",{className:"gp-font-medium gp-text-sm",children:g("Write with GemAI")}),jsxRuntime.jsx("button",{className:"gp-p-2 gp-cursor-pointer hover:gp-bg-[#3B3B3B] gp-rounded-md",onClick:A,children:jsxRuntime.jsx(CloseIcon.CloseIcon,{})})]}),jsxRuntime.jsx("div",{className:classNames({"gp-overflow-auto":null!==x},"gp-pt-2 gp-text-left gp-px-4 scrollbar:gp-w-1 scrollbar-thumb:gp-bg-[#999] scrollbar-thumb:gp-rounded-xl"),style:{maxHeight:null!==x?`${x}px`:"auto"},children:N?.isAllow?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"gp-mb-4",children:jsxRuntime.jsx("span",{className:"gp-text-xs",children:g("What would you like to describe here?")})}),jsxRuntime.jsx("div",{className:"gp-mb-4 gp-flex",children:jsxRuntime.jsx("textarea",{className:"gp-p-2 gp-bg-[#333333] gp-rounded-lg gp-w-full gp-text-xs gp-text-white placeholder:gp-text-[#AAAAAA] gp-resize-none focus-visible:gp-outline-none",placeholder:g("e.g: generate feature benefits"),rows:4,value:R,onChange:y})}),jsxRuntime.jsxs("div",{className:classNames({"gp-hidden":!n},"gp-mb-4 gp-gap-4 gp-flex gp-flex-col"),children:[jsxRuntime.jsx(ToneAndVoice.ToneAndVoice,{changeToneAndVoice:q}),jsxRuntime.jsx(PickProduct.PickProduct,{changeProductName:b,openProductSetting:E,productId:C.productId})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("button",{className:"gp-flex gp-justify-center gp-items-center gp-w-full gp-bg-[#333333] gp-py-2 gp-rounded-lg gp-gap-2 gp-text-xs gp-font-medium",onClick:S,children:[g("Show more"),jsxRuntime.jsx("span",{className:classNames({"gp-rotate-180":n}),children:jsxRuntime.jsx(ShowMoreIcon.ShowMoreIcon,{})})]})})]}):jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-2 gp-p-3 gp-rounded-xl gp-bg-[#FDB913] gp-bg-opacity-20",children:[jsxRuntime.jsx("div",{className:"gp-flex-none gp-w-7 gp-h-7 gp-rounded-lg gp-bg-[#FFB800] gp-flex gp-justify-center gp-items-center",children:jsxRuntime.jsx(WarningIcon.WarningIcon,{})}),jsxRuntime.jsxs("p",{className:"gp-text-xs gp-whitespace-normal",children:[g("You've reached {maxGenerateCount}/{maxGenerateCount} rewrites of your AI generative this month.",{maxGenerateCount:N?.maxGenerateCount}),jsxRuntime.jsx("br",{}),g("Resets on {nextMonth}.",{nextMonth:p})]})]})}),jsxRuntime.jsx("div",{className:"gp-p-4",ref:u,children:N?.isAllow?jsxRuntime.jsx("button",{className:"gp-rounded-lg gp-w-full gp-text-xs gp-font-medium gp-bg-gradient-to-tl gp-from-[#3C38E1] gp-to-[#874CFD] gp-py-2",onClick:P,children:g(m?"Generating...":"Generate")}):jsxRuntime.jsxs("button",{className:"gp-flex gp-items-center gp-gap-2 gp-justify-center gp-rounded-lg gp-w-full gp-text-xs gp-font-medium gp-bg-gradient-to-tl gp-from-[#3C38E1] gp-to-[#874CFD] gp-py-2",onClick:f,children:[jsxRuntime.jsx(UpgradeIcon.UpgradeIcon,{}),N?.nextQuota?g("Upgrade to generate {nextQuota} rewrites",{nextQuota:N?.nextQuota}):g("You have reached limit this month")]})})]})]})};exports.AIContentGenerator=AIContentGenerator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),SearchIcon=require("../icons/SearchIcon.js"),useProductsQuery=require("../../../hooks/shop/use-products-query.js"),classNames=require("classnames");require("zustand");var I18nContext=require("../../../contexts/I18nContext.js");require("react-transition-group"),require("
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),SearchIcon=require("../icons/SearchIcon.js"),useProductsQuery=require("../../../hooks/shop/use-products-query.js"),classNames=require("classnames");require("zustand");var I18nContext=require("../../../contexts/I18nContext.js");require("react-transition-group"),require("swr"),require("dayjs"),require("@gem-sdk/core"),require("../../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var useProductQuery=require("../../../hooks/shop/use-product-query.js");require("vanilla-lazyload"),require("../../../hooks/useCartUI.js"),require("../../../hooks/useStickyStore.js"),require("../../../types/builder.js"),require("../../../types/custom.js"),require("../../../types/animations.js");const PickProduct=e=>{let{t}=I18nContext.useI18nStore(),[s,r]=react.useState(e.productId?void 0:{first:8}),{data:u,isLoading:a,isValidating:i,size:c,setSize:n}=useProductsQuery.useListProductQuery(s,{revalidateFirstPage:!1}),{data:p}=useProductQuery.useProductQuery(e.productId),[o,l]=react.useState(),[g,d]=react.useState(!1),m=react.useRef(null),x=react.useRef(null),j=()=>{e.productId||d(!g)},h=e=>{l(e),d(!1)},f=e=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{let t=e.target.value??"";if(t){r({first:8,where:{titleContainsFold:t}});return}r({first:8})},200)},b=()=>{e.openProductSetting()},q=e=>{let t=e.target;t.scrollHeight-t.scrollTop===t.clientHeight&&(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{n(c+1)},50))},R=react.useMemo(()=>u?.reduce((e,t)=>[...e,...t.products?.edges??[]],[])??[],[u]);react.useEffect(()=>{if(R.length&&!o&&!e.productId){let e=R[0]?.node;e&&l({id:e?.id,name:e?.title,image:e.featuredImage?.src})}},[R,o,e.productId]),react.useEffect(()=>{o&&o.name&&e.changeProductName(o.name)},[o,e]),react.useEffect(()=>{p&&l({id:p.id,name:p.title,image:p.featuredImage?.src})},[p]);let v="https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif";return jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-2",children:[jsxRuntime.jsx("p",{className:"gp-py-2 gp-text-xs",children:t("Product")}),jsxRuntime.jsxs("div",{className:"gp-relative",children:[!a||o?jsxRuntime.jsxs("button",{className:classNames({"gp-cursor-default":e.productId},"gp-flex gp-gap-2 gp-items-center gp-w-full gp-p-2 gp-rounded-lg gp-bg-[#333333] gp-text-xs"),onClick:j,children:[jsxRuntime.jsx("img",{className:"gp-rounded-lg gp-w-10 gp-h-10",src:o?.image||v,alt:"product_image"}),jsxRuntime.jsx("span",{className:"gp-truncate gp-max-w-[210px]",children:o?.name})]}):jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("span",{className:"gp-text-xs",children:[t("Getting products"),"..."]})}),e.productId&&jsxRuntime.jsx("div",{className:"gp-mt-2 gp-text-xs",children:jsxRuntime.jsxs("p",{children:[t("You can manage it in")," ",jsxRuntime.jsx("button",{className:"gp-text-[#8AA4FF] gp-cursor-pointer hover:gp-underline",onClick:b,children:t("Product element")})]})}),g&&jsxRuntime.jsxs("div",{className:"gp-absolute gp-w-full gp-top-16 gp-left-0 gp-rounded-lg gp-bg-[#333333] gp-p-2 gp-flex gp-flex-col gp-gap-2 gp-z-10",children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-gap-2 gp-p-2",children:[jsxRuntime.jsx(SearchIcon.SearchIcon,{}),jsxRuntime.jsx("input",{className:"gp-bg-transparent gp-w-full focus-visible:!gp-outline-none gp-text-xs",placeholder:t("Search product")+"...",onChange:f})]}),jsxRuntime.jsxs("div",{className:"gp-max-h-[168px] gp-overflow-auto scrollbar:gp-w-1 scrollbar-thumb:gp-bg-[#999] scrollbar-thumb:gp-rounded-xl",onScroll:q,children:[R?.map(e=>jsxRuntime.jsxs("button",{className:"gp-flex gp-p-2 hover:gp-bg-[#3B3B3B] gp-rounded-lg gp-cursor-pointer gp-gap-2 gp-items-center",onClick:()=>{h({id:e.node?.id,name:e.node?.title,image:e.node?.featuredImage?.src})},children:[jsxRuntime.jsx("img",{className:"gp-rounded-lg gp-w-10 gp-h-10",src:e.node?.featuredImage?.src||v,alt:"product_image"}),jsxRuntime.jsx("span",{className:"gp-truncate gp-max-w-[210px] gp-text-xs",children:e.node?.title})]},e.node?.id)),a||i&&jsxRuntime.jsx("div",{className:"gp-p-2",children:jsxRuntime.jsxs("span",{className:"gp-text-xs",children:[t("Getting products"),"..."]})})]})]})]})]})};exports.PickProduct=PickProduct;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),DropdownIcon=require("../icons/DropdownIcon.js"),classNames=require("classnames");require("zustand");var I18nContext=require("../../../contexts/I18nContext.js");require("react-transition-group"),require("
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),DropdownIcon=require("../icons/DropdownIcon.js"),classNames=require("classnames");require("zustand");var I18nContext=require("../../../contexts/I18nContext.js");require("react-transition-group"),require("swr"),require("swr/infinite"),require("dayjs"),require("@gem-sdk/core"),require("../../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../../hooks/useCartUI.js"),require("../../../hooks/useStickyStore.js"),require("../../../types/builder.js"),require("../../../types/custom.js"),require("../../../types/animations.js");const ToneAndVoice=e=>{let{t:s}=I18nContext.useI18nStore(),r=[{label:s("Persuasive"),value:"Persuasive"},{label:s("Friendly"),value:"Friendly"},{label:s("Professional"),value:"Professional"},{label:s("Casual"),value:"Casual"}],[i,n]=react.useState(r[0]),[a,t]=react.useState(!1),l=()=>{t(!a)},u=e=>{n(e),t(!1)};return react.useEffect(()=>{i&&e.changeToneAndVoice(i.value)},[i,e]),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-2",children:[jsxRuntime.jsx("p",{className:"gp-py-2 gp-text-xs",children:s("Tone and Voice")}),jsxRuntime.jsxs("div",{className:"gp-relative",children:[jsxRuntime.jsxs("button",{className:"gp-flex gp-justify-between gp-items-center gp-w-full gp-p-2 gp-rounded-lg gp-bg-[#333333] gp-text-xs",onClick:l,children:[i?.label,jsxRuntime.jsx(DropdownIcon.DropdownIcon,{})]}),a?jsxRuntime.jsx("div",{className:"gp-absolute gp-w-full gp-top-10 gp-left-0 gp-rounded-lg gp-bg-[#333333] gp-p-2 gp-flex gp-flex-col gp-gap-2 gp-z-10",children:r.map(e=>jsxRuntime.jsxs("button",{className:"gp-flex gp-p-2 hover:gp-bg-[#3B3B3B] gp-rounded-lg gp-cursor-pointer gp-gap-3 gp-items-center",onClick:()=>u(e),children:[jsxRuntime.jsx("div",{className:classNames({"gp-invisible":i?.value!==e.value}),children:jsxRuntime.jsx(DropdownIcon.TickIcon,{})}),jsxRuntime.jsx("span",{className:"gp-text-xs",children:e.label})]},e.value))}):null]})]})})};exports.ToneAndVoice=ToneAndVoice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","CarouselV3","CarouselItemV3","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductList","ProductListV3","ProductImages","ProductImagesV2","ProductImagesV3","PostPurchaseProductImages","Sticky","Heading","EstimateDate","ProductBadge","Marquee","MarqueeItem","Newsletter","ContactForm","ArticleList"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs","Marquee","MarqueeItem"],excludeApplyStyle=["IconListV2","IconList","ProductBadge"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"],ableGenerateContentElements=["Section"];exports.ableGenerateContentElements=ableGenerateContentElements,exports.customRenderChildren=customRenderChildren,exports.disableWrap=disableWrap,exports.excludeApplyStyle=excludeApplyStyle,exports.postPurchaseRequiredElements=postPurchaseRequiredElements,exports.postPurchaseWrapElements=postPurchaseWrapElements;
|
|
1
|
+
"use strict";const disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","CarouselV3","CarouselItemV3","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductList","ProductListV3","ProductImages","ProductImagesV2","ProductImagesV3","PostPurchaseProductImages","Sticky","Heading","EstimateDate","ProductBadge","Marquee","MarqueeItem","Newsletter","ContactForm","ArticleList","PostPurchaseProductSubscription","PostPurchaseBuyerConsent"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs","Marquee","MarqueeItem"],excludeApplyStyle=["IconListV2","IconList","ProductBadge"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"],ableGenerateContentElements=["Section"];exports.ableGenerateContentElements=ableGenerateContentElements,exports.customRenderChildren=customRenderChildren,exports.disableWrap=disableWrap,exports.excludeApplyStyle=excludeApplyStyle,exports.postPurchaseRequiredElements=postPurchaseRequiredElements,exports.postPurchaseWrapElements=postPurchaseWrapElements;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand");var BuilderPreviewContext=require("../../contexts/BuilderPreviewContext.js"),device=require("../../constants/device.js");require("react-transition-group"),require("
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand");var BuilderPreviewContext=require("../../contexts/BuilderPreviewContext.js"),device=require("../../constants/device.js");require("react-transition-group"),require("swr"),require("swr/infinite");var shop=require("../../hooks/shop.js");function Spacing(e){let t=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),r=shop.usePageType(),n=react.useRef(null),i=react.useRef(null),a=react.useRef(null),s=react.useRef(!1),u=react.useRef(0),o=react.useRef(0),c=react.useRef(null),[l,d]=react.useState(0),[m,p]=react.useState(!1),g=react.useRef(null),v=e=>{let t=e.clientY,r=Math.ceil(t-u.current),n=o.current||0,i=n+r>=0?`${n+r}px`:"0px";return{newValue:i}},f=e=>{if(n.current&&i.current){let{newValue:t}=v(e);i.current.style.height=t,n.current.style.top=t;let r=n.current.closest("[data-toolbar-wrap]");r&&(r.style.marginBottom=t,q(t))}},b=()=>{j()},w=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s.current=!0;let e=new CustomEvent("editor:toolbar:resize-spacing",{bubbles:!0,detail:{value:!0}});window.dispatchEvent(e),document.addEventListener("mousemove",f),document.addEventListener("mouseup",b)},100)},j=()=>{a.current&&clearTimeout(a.current),s.current=!1;let t=new CustomEvent("editor:toolbar:resize-spacing",{bubbles:!0,detail:{value:!1}});if(window.dispatchEvent(t),n.current){let t=getComputedStyle(n.current),r=t.top,i=new CustomEvent("editor:toolbar:change-margin-bottom",{bubbles:!0,detail:{componentUid:e.uid,marginBottom:r}});window.dispatchEvent(i)}let r=n.current?.closest("[data-toolbar-wrap]");r&&(r.style.marginBottom=""),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",b)},h=(e,t)=>{let r=e.children.length;if(r)for(let n=0;n<r;n++){let r=e.children[n];if(r){let e=r.getAttribute(t);if(e)return r}}},x=e=>{let t=e.getAttribute("data-component-tag");return"Row"===t||"Product"===t},y=react.useCallback(e=>{let t=n.current?.closest("[data-toolbar-wrap]");if(!t)return;let r=h(t,"data-toolbar");if(!r)return;let a=r.getAttribute("data-toolbar-active");if(!a)return;let s=getComputedStyle(t),u=h(t,"data-spacing"),o=u?.querySelector("[data-spacing-margin-bottom]")||null;if(o&&i.current&&n.current){let r=s.marginBottom;if(e&&q(r),0>parseFloat(r)&&(r="0"),i.current.style.height=r,n.current.style.top=r,o.setAttribute("data-spacing-margin-bottom-active","true"),x(t))i.current.style.left="0";else{let e=s.paddingLeft,t=`-${e}`,r=`translate(${t}, -100%)`;i.current.style.left=t,n.current.style.transform=r}}},[]),q=e=>{let t=parseFloat(e);d(t),p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1)},2e3);let r=t<=28&&t>=0?t/2+16:t>28?0:16;c.current&&(c.current.style.transform=`translateY(${r}px)`)},E=usePrevious(e.advanced?.["spacing-setting"]);react.useEffect(()=>{let t=R(E,e.advanced?.["spacing-setting"]);y(t)},[E,e.advanced,y]);let R=(e,t)=>device.DEVICES.some(r=>JSON.stringify(e?.[r]?.margin?.bottom)!==JSON.stringify(t?.[r]?.margin?.bottom)),S=react.useCallback(()=>{y()},[y]);return react.useEffect(()=>(window.addEventListener("editor:toolbar:update-margin-bottom",()=>y),window.addEventListener("editor:toolbar:update-padding-left",()=>y),window.addEventListener("resize",S),()=>{window.removeEventListener("editor:toolbar:update-margin-bottom",()=>y),window.removeEventListener("editor:toolbar:update-padding-left",()=>y),window.removeEventListener("resize",S)}),[S,y]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Section"!==e.tag&&"POST_PURCHASE"!==r&&jsxRuntime.jsx("div",{"data-spacing":!0,"data-spacing-theme-section":t,className:"gp-absolute gp-w-full gp-bottom-0",children:jsxRuntime.jsxs("div",{"data-spacing-margin-bottom":!0,children:[jsxRuntime.jsxs("div",{"data-spacing-margin-bottom-bg":!0,ref:i,children:[jsxRuntime.jsx("div",{"data-spacing-margin-bottom-value":!0}),jsxRuntime.jsx("div",{"data-active":m,"data-value-number":!0,ref:c,children:l})]}),jsxRuntime.jsx("div",{ref:n,"data-spacing-margin-bottom-drag":!0,onMouseDown:e=>{if(n.current){let t=getComputedStyle(n.current);u.current=e.clientY,o.current=parseFloat(t.top),w()}},onMouseUp:()=>{j()},role:"presentation"})]})})})}require("classnames"),require("dayjs"),require("@gem-sdk/core"),require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/custom.js"),require("../../types/animations.js");const usePrevious=e=>{let t=react.useRef();return react.useEffect(()=>{t.current=e},[e]),t.current};exports.default=Spacing;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group"),core=require("@gem-sdk/core");const TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:e,isFreeLimit:t,isRender:i,children:o,limitCreateThemeSection:s,onMouseEnter:n,onMouseLeave:a,onActions:c})=>{let{t:r}=core.useI18nStore(),m=react.useRef(null),l=t?"Upgrade to create Theme Section":"Create Theme Section",u=()=>{window.open("https://help.gempages.net/articles/theme-section","_blank")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:n,onMouseLeave:a,children:[o,i&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:e,timeout:350,nodeRef:m,unmountOnExit:!0,children:e=>jsxRuntime.jsx("div",{className:"theme-section-tooltip",ref:m,style:{...defaultStyles,...transitions[e]},children:s?.isLimit&&!t?jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body theme-section-tooltip__body-limit",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title theme-section-tooltip__body-limit__title",children:"Upgrade plan"}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body-desc theme-section-tooltip__body-limit__desc",children:["You’ve reached the maximum number of theme sections on your plan (",s.total,"/",s.limit,")"]}),jsxRuntime.jsx("button",{onClick:e=>c(e),children:"Upgrade plan to create more"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__image",children:jsxRuntime.jsx("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme Section"}),jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-desc",children:"A global section that can be used on all your GemPages & Shopify pages."})]}),jsxRuntime.jsxs("div",{className:core.cls("theme-section-tooltip__action",{"theme-section-tooltip__action-limit":t}),children:[jsxRuntime.jsx("button",{onClick:e=>c(e),children:r(l)}),t&&jsxRuntime.jsx("div",{onClick:u,"aria-hidden":!0,className:"theme-section-tooltip__action-learn-more",children:"Learn more about Theme Section"})]})]})})})]})})};exports.ThemeSectionTooltip=ThemeSectionTooltip;
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group");require("zustand");var I18nContext=require("../../contexts/I18nContext.js"),cls=require("../../helpers/cls.js");require("swr"),require("swr/infinite"),require("classnames"),require("dayjs"),require("@gem-sdk/core"),require("../../helpers/convert.js"),require("crc-32"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../hooks/useStickyStore.js"),require("../../types/builder.js"),require("../../types/custom.js"),require("../../types/animations.js");const TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:e,isFreeLimit:t,isRender:i,children:s,limitCreateThemeSection:o,onMouseEnter:n,onMouseLeave:r,onActions:a})=>{let{t:c}=I18nContext.useI18nStore(),l=react.useRef(null),m=t?"Upgrade to create Theme Section":"Create Theme Section",u=()=>{window.open("https://help.gempages.net/articles/theme-section","_blank")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:n,onMouseLeave:r,children:[s,i&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:e,timeout:350,nodeRef:l,unmountOnExit:!0,children:e=>jsxRuntime.jsx("div",{className:"theme-section-tooltip",ref:l,style:{...defaultStyles,...transitions[e]},children:o?.isLimit&&!t?jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body theme-section-tooltip__body-limit",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title theme-section-tooltip__body-limit__title",children:"Upgrade plan"}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body-desc theme-section-tooltip__body-limit__desc",children:["You’ve reached the maximum number of theme sections on your plan (",o.total,"/",o.limit,")"]}),jsxRuntime.jsx("button",{onClick:e=>a(e),children:"Upgrade plan to create more"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__image",children:jsxRuntime.jsx("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme Section"}),jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-desc",children:"A global section that can be used on all your GemPages & Shopify pages."})]}),jsxRuntime.jsxs("div",{className:cls.cls("theme-section-tooltip__action",{"theme-section-tooltip__action-limit":t}),children:[jsxRuntime.jsx("button",{onClick:e=>a(e),children:c(m)}),t&&jsxRuntime.jsx("div",{onClick:u,"aria-hidden":!0,className:"theme-section-tooltip__action-learn-more",children:"Learn more about Theme Section"})]})]})})})]})})};exports.ThemeSectionTooltip=ThemeSectionTooltip;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime");const SECTION_SIZE_GUIDE_URL="https://www.google.com/",SectionErrorBanner=({errorSectionInfo:e,onDismiss:i})=>e.isDismissed?null:jsxRuntime.jsx("div",{"data-toolbar-error-banner":!0,className:"gp-flex gp-items-center gp-px-2 gp-top-0 gp-w-full gp-absolute gp-bg-[#FEE4E3] gp-border-t gp-border-t-[#C3362B] gp-text-xs gp-text-[#C3362B] gp-leading-5",children:jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-1.5 gp-w-full",children:[jsxRuntime.jsxs("svg",{className:"gp-flex-shrink-0 gp-mt-2.5",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44772 14.5 9 14.0523 9 13.5C9 12.9477 9.44772 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"#C3362B"}),jsxRuntime.jsx("path",{d:"M10.75 6.25001C10.75 5.8358 10.4142 5.50001 10 5.5C9.5858 5.49999 9.25001 5.83578 9.25 6.24999L9.24994 10.75C9.24993 11.1642 9.58572 11.5 9.99993 11.5C10.4141 11.5 10.7499 11.1642 10.7499 10.75L10.75 6.25001Z",fill:"#C3362B"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 17C13.866 17 17 13.866 17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 13.866 6.13401 17 10 17ZM10 15.5C13.0376 15.5 15.5 13.0376 15.5 10C15.5 6.96243 13.0376 4.5 10 4.5C6.96243 4.5 4.5 6.96243 4.5 10C4.5 13.0376 6.96243 15.5 10 15.5Z",fill:"#C3362B"})]}),jsxRuntime.jsxs("div",{className:"gp-w-full gp-py-2.5",children:["LIQUID_SYNTAX_ERROR"===e.type&&"This section contains a syntax error in the code. Please review and fix it, then try verifying again.","SECTION_SIZE_EXCEED_256KB"===e.type&&jsxRuntime.jsxs("div",{children:["This section is over Shopify's 256KB limit. Please follow ",jsxRuntime.jsx("a",{target:"_blank",href:SECTION_SIZE_GUIDE_URL,className:"gp-underline gp-cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),window.open(SECTION_SIZE_GUIDE_URL,"_blank")},rel:"noreferrer",children:"our guide"})," ","to optimize, then try verifying again."]}),"MISSING_SECTION_IN_THEME"===e.type&&"This section was deleted from your live theme. Please delete it from this page, or restore all sections by Force publish."]}),jsxRuntime.jsx("button",{className:"gp-p-1.5 gp-flex-shrink-0 gp-mt-1 gp-h-7",onClick:i,type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M11.1755 12.0243C11.4099 12.2586 11.7898 12.2586 12.0241 12.0243C12.2584 11.79 12.2584 11.4101 12.0241 11.1758L8.84833 8.00005L12.0241 4.82431C12.2584 4.59 12.2584 4.2101 12.0241 3.97579C11.7898 3.74147 11.4099 3.74147 11.1755 3.97579L7.9998 7.15152L4.82407 3.97578C4.58975 3.74147 4.20986 3.74147 3.97554 3.97578C3.74123 4.2101 3.74123 4.59 3.97554 4.82431L7.15128 8.00005L3.97554 11.1758C3.74123 11.4101 3.74123 11.79 3.97554 12.0243C4.20986 12.2586 4.58975 12.2586 4.82407 12.0243L7.9998 8.84858L11.1755 12.0243Z",fill:"#212121"})})})]})});exports.SectionErrorBanner=SectionErrorBanner;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand"),cloneDeep=require("../helpers/clone-deep.js"),normalizeBuilderData=require("../helpers/normalize-builder-data.js");function moveByIndex(e,t,i){let r=e.splice(t,1)[0];void 0!==r&&e.splice(i,0,r)}function removeByKey(e,t){let i=t[e];i&&(delete t[e],"section"!==i.type&&i.childrens?.map(e=>removeByKey(e,t)))}const BuilderPreviewContext=react.createContext(null),root={uid:"ROOT",tag:"Root",label:"Root",childrens:[]},createBuilderPreviewProvider=(e,t,i)=>zustand.createStore((r,
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand"),cloneDeep=require("../helpers/clone-deep.js"),normalizeBuilderData=require("../helpers/normalize-builder-data.js");function moveByIndex(e,t,i){let r=e.splice(t,1)[0];void 0!==r&&e.splice(i,0,r)}function removeByKey(e,t){let i=t[e];i&&(delete t[e],"section"!==i.type&&i.childrens?.map(e=>removeByKey(e,t)))}const BuilderPreviewContext=react.createContext(null),root={uid:"ROOT",tag:"Root",label:"Root",childrens:[]},createBuilderPreviewProvider=(e,t,i)=>zustand.createStore((r,s)=>({state:e,loaded:!1,isThemeSectionEditor:!!i,pageName:t,dynamicProduct:null,dynamicCollection:null,errorSectionList:null,addItem:e=>{let{position:t,data:i}=e,l=s().state,n=Date.now();if("section"===e.type){if(!Array.isArray(i)){let e=i.uid,s=l.ROOT;s.childrens?s.childrens.splice(t??0,0,e):s.childrens=[e],s.dateModified=n,r({state:{...l,[e]:{uid:e,type:"section",label:i.label},ROOT:cloneDeep.cloneDeep(s)}})}}else{let{id:i,data:s}=e,d=i?l[i]??l.ROOT:l.ROOT;if("section"===d.type)return;if(Array.isArray(s)){let e=s.map(e=>e.uid),i=s.reduceRight((e,t)=>{let i=normalizeBuilderData.normalizeBuilderData(t);return{...e,...i}},{});d.dateModified=n,d.childrens=d.childrens??[],d.childrens.splice(t??0,0,...e),r({state:{...l,...i,[d.uid]:cloneDeep.cloneDeep(d)}})}else{let e=normalizeBuilderData.normalizeBuilderData(s);d.dateModified=n,d.childrens=d.childrens??[],d.childrens.splice(t??0,0,s.uid),r({state:{...l,...e,[d.uid]:cloneDeep.cloneDeep(d)}})}}},changeItemProp:(e,t,i)=>{if(!i||!["setting","style","advanced"].includes(i))return;let l=s().state,n=l[e];if(n?.type!=="section"&&n){let s=Date.now();switch(n.dateModified=s,i){case"setting":r({state:{...l,[e]:{...n,settings:{...n.settings,...t}}}});break;case"style":r({state:{...l,[e]:{...n,styles:{...n.styles,...t}}}});break;case"advanced":r({state:{...l,[e]:{...n,advanced:{...n.advanced,...t}}}})}}},forceChangeItemProp:(e,t,i)=>{if(!i||!["setting","style","advanced"].includes(i))return;let l=s().state,n=l[e];if(n?.type!=="section"&&n){let s=Date.now();switch(n.dateModified=s,i){case"setting":r({state:{...l,[e]:{...n,settings:t}}});break;case"style":r({state:{...l,[e]:{...n,styles:t}}});break;case"advanced":r({state:{...l,[e]:{...n,advanced:t}}})}}},changeItemPropByKey:({id:e,key:t,data:i,group:l})=>{if(!l||!["setting","style","advanced"].includes(l))return;let n=s().state,d=n[e];if(d?.type!=="section"&&d){let s={style:d.styles??{},advanced:d.advanced??{},setting:d.settings??{}};void 0===i?(console.warn("Data is undefined"),delete s[l][t]):s[l][t]=i,r({state:{...n,[e]:{...d,settings:{...s.setting},styles:{...s.style},advanced:{...s.advanced}}}})}},getItem:e=>s().state[e],getState:()=>s().state,removeItem:e=>{if("ROOT"===e)r({state:{ROOT:root}});else{let t=s().state;removeByKey(e,t);let i=Object.entries(t).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(i){let s=Date.now(),[l,n]=i;if("section"===n.type)return;n.childrens=n.childrens?.filter(t=>t!==e),n.dateModified=s,r({state:{...t,[l]:cloneDeep.cloneDeep(n)}})}}},moveItem:(e,t,i)=>{let l=s().state,n=l[e],d=l[t];if(n&&d&&"section"!==d.type){if("section"===n.type){let t=l.ROOT;if(!t.childrens)return;let s=t.childrens.findIndex(t=>t===e);moveByIndex(t.childrens,s,i??0),r({state:{...l,ROOT:cloneDeep.cloneDeep(t)}})}else{let s=Object.entries(l).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(n&&s){let a=Date.now(),[,c]=s;if("section"===c.type)return;if(c.dateModified=a,t===c.uid&&c.childrens){let t=c.childrens.findIndex(t=>t===e);c.childrens&&t!==i&&(moveByIndex(c.childrens,t,i??0),r({state:{...l,[c.uid]:cloneDeep.cloneDeep(c)}}))}else c.childrens=c.childrens?.filter(t=>t!==e),d&&(d.dateModified=a,d.childrens=d.childrens??[],d.childrens.splice(i??0,0,n.uid),r({state:{...l,[d.uid]:cloneDeep.cloneDeep(d),[c.uid]:cloneDeep.cloneDeep(c)}}))}}}},forceChangeState:e=>{r({state:e,loaded:!0})},initState:e=>{if(Array.isArray(e)){let t=e.map(e=>e.uid),i=e.reduceRight((e,t)=>{let i=normalizeBuilderData.normalizeBuilderData(t);return{...e,...i}},{});r({loaded:!0,state:{ROOT:{...root,childrens:t},...i}})}else{let t=normalizeBuilderData.normalizeBuilderData(e);r({loaded:!0,state:{ROOT:{...root,childrens:[e.uid]},...t}})}},addSection:(e,t)=>{let i=s().state,l=i.ROOT;l.childrens||(l.childrens=[]),l.childrens.splice(t??0,0,e.uid),r({state:{...i,ROOT:cloneDeep.cloneDeep(l)}})},getParents:(e,t)=>{let i=s().state,r=[],l=0,n=e;for(;!t||!(l>=t);){let e=Object.entries(i).find(([,e])=>"section"!==e.type&&e.childrens?.includes(n));if(!e)break;let[,t]=e;if(!t)break;r.push(t),n=t.uid,l++}return r},updateItemName:(e,t)=>{let i=s().state,l=i[e];l&&(l.name=t,r({state:{...i,[e]:cloneDeep.cloneDeep(l)}}))},updateItemAttribute:(e,t,i)=>{if(!i||!["label","customLabel","isShopifyVisibility"].includes(i))return;let l=s().state,n=l[e];if(n){if("section"!==n.type){let e=Date.now();n.dateModified=e}let s={...n,[i]:t};r({state:{...l,[e]:s}})}},dismissPublishError:e=>{let t=s().errorSectionList;if(!Array.isArray(t))return;let i=t.map(t=>t.uid===e?{...t,isDismissed:!0}:t);r({errorSectionList:i})},setErrorSectionList:e=>r({errorSectionList:e})})),BuilderPreviewProvider=({children:e,state:t,isThemeSectionEditor:i,pageName:r,lazy:s,...l})=>{let n=s?react.Suspense:react.Fragment,d=react.useMemo(()=>createBuilderPreviewProvider(t,r,i),[t,i,r]);return jsxRuntime.jsx(n,{children:jsxRuntime.jsx(BuilderPreviewContext.Provider,{...l,value:d,children:e})})},useBuilderPreviewStore=(e,t)=>{let i=react.useContext(BuilderPreviewContext);if(!i)throw Error("useBuilderPreviewStore must be used within a BuilderPreviewProvider");return zustand.useStore(i,e,t)};exports.BuilderPreviewProvider=BuilderPreviewProvider,exports.useBuilderPreviewStore=useBuilderPreviewStore;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const PageContext=react.createContext(null),createPageStoreProvider=e=>zustand.createStore(t=>({...e,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))}})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:r,productOffers:a,dynamicDiscountOffer:
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const PageContext=react.createContext(null),createPageStoreProvider=e=>zustand.createStore((t,r)=>({...e,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>r().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>r().subscriptionVisible})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:r,productOffers:a,dynamicDiscountOffer:i,publicStoreFrontData:n,assignedProductIds:s,isApplyAllProducts:o,sellingPlanMeta:c,buyerConsentChecked:u,...d})=>{let P=react.useMemo(()=>createPageStoreProvider({dynamicProduct:t,dynamicCollection:r,productOffers:a,assignedProductIds:s,isApplyAllProducts:o,dynamicDiscountOffer:i,publicStoreFrontData:n,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:c,buyerConsentChecked:u}),[t,r,a,i,n,s,o,c,u]);return jsxRuntime.jsx(PageContext.Provider,{...d,value:P,children:e})},usePageStore=(e,t)=>{let r=react.useContext(PageContext);if(!r)throw Error("usePageStore must be used within a PageProvider");return zustand.useStore(r,e,t)};exports.PageProvider=PageProvider,exports.usePageStore=usePageStore;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js");var variant=require("../helpers/variant.js");require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js"),require("react-transition-group"),require("
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("swr/infinite"),require("vanilla-lazyload"),require("../hooks/useCartUI.js"),require("../hooks/useStickyStore.js");var variant=require("../helpers/variant.js");require("../types/builder.js"),require("../types/custom.js"),require("../types/animations.js"),require("react-transition-group"),require("classnames"),require("dayjs"),require("@gem-sdk/core");var flattenConnection=require("../helpers/flatten-connection.js");require("../helpers/convert.js"),require("crc-32");const ProductContext=react.createContext(null),createProductStoreProvider=e=>zustand.createStore((t,r)=>({...e,updateProperty:(e,r)=>{t(t=>({properties:t.properties?.map(t=>t.key===e?{...t,...r}:t)}))},setUseProductCompareAtPrice:e=>{t({useProductCompareAtPrice:e})},setShouldRequireUploadMessage:e=>{t({shouldRequireUploadMessage:e})},setRequireUpload:e=>{t({requireUpload:e})},addProperty:e=>{let i=r().properties;i?.some(t=>t.key===e.key)||t(t=>({properties:[...t.properties??[],e]}))},removeProperty:e=>{t(t=>({properties:t.properties?.filter(t=>t.key!==e)}))},setQuantity:e=>{t({quantity:e>0?e:1})},setProductFeaturedImage:e=>{t({featuredImageGlobal:e})},incrementQuantity:()=>{t(e=>{let t=e.quantity??1;return{quantity:t+1}})},decrementQuantity:()=>{t(e=>{let t=e.quantity??1;return{quantity:t>2?t-1:1}})},setSelectedOption:(e,r)=>{t(t=>e&&r?{selectedOptions:{...t?.selectedOptions,[e]:r}}:t)},forceSelectedOption:e=>{t(t=>({selectedOptions:{...t?.selectedOptions,...e}}))},updateIsSubmit:e=>{t({isSubmit:e})},setHasUpdatePriceFollowQuantity:e=>{t({updatePrice:e})},setHasPreSelected:e=>{t({hasPreSelected:e})},setIsChangeSelectedOption:e=>{t({isChangeSelectedOption:e})},setSubscriptionSellingType:e=>{t({subscriptionSellingType:e})},setSelectedSellingPlan:e=>{t({selectedSellingPlan:e})}})),ProductProvider=({children:e,product:t,initialVariantId:r,initialVariantBaseId:i,quantity:s=1,isSyncProduct:o,hasPreSelected:u,uid:n})=>{let a=react.useId(),d=react.useMemo(()=>{let e,d={};if(t){let s=flattenConnection.flattenConnection(t.variants),o=s[0],u=s.find(e=>variant.checkInStock(e)),n=s.find(e=>e?.id===r||e?.baseID===i)??u??o;d=n?.selectedOptions?.reduce((e,t)=>t.name?{...e,[t.name]:t.value}:e,{}),e=t.medias?.edges.find(e=>e.node?.id===n?.mediaId)?.node??t.featuredImage}return createProductStoreProvider({product:t,quantity:s,selectedOptions:d,uiqueId:a,featuredImageGlobal:e,isSyncProduct:o,hasPreSelected:u,uid:n})},[t,s,a,o,u,r,n]);return jsxRuntime.jsx(ProductContext.Provider,{value:d,children:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})})},useProductStore=(e,t)=>{let r=react.useContext(ProductContext);if(!r)throw Error("Element of product must be used inside a Product");return zustand.useStore(r,e,t)};exports.ProductProvider=ProductProvider,exports.useProductStore=useProductStore;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";const ProductVariantsWithSellingPlansSelect=`
|
|
2
|
+
fragment ProductVariantsWithSellingPlansSelect on ProductVariant {
|
|
3
|
+
id
|
|
4
|
+
title
|
|
5
|
+
barcode
|
|
6
|
+
baseID
|
|
7
|
+
costPrice
|
|
8
|
+
height
|
|
9
|
+
inventoryPolicy
|
|
10
|
+
inventoryQuantity
|
|
11
|
+
inventoryStatus
|
|
12
|
+
isDigital
|
|
13
|
+
length
|
|
14
|
+
lowInventoryAmount
|
|
15
|
+
manageInventory
|
|
16
|
+
mediaId
|
|
17
|
+
platform
|
|
18
|
+
price
|
|
19
|
+
salePrice
|
|
20
|
+
sku
|
|
21
|
+
soldIndividually
|
|
22
|
+
weight
|
|
23
|
+
width
|
|
24
|
+
selectedOptions {
|
|
25
|
+
...SelectedOptionSelect
|
|
26
|
+
}
|
|
27
|
+
media {
|
|
28
|
+
...MediaSelect
|
|
29
|
+
}
|
|
30
|
+
sellingPlanGroups {
|
|
31
|
+
id
|
|
32
|
+
appID
|
|
33
|
+
sellingPlans {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
baseID
|
|
37
|
+
pricingPolicies
|
|
38
|
+
updatedAt
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;exports.ProductVariantsWithSellingPlansSelect=ProductVariantsWithSellingPlansSelect;
|
|
@@ -5,15 +5,24 @@
|
|
|
5
5
|
handle
|
|
6
6
|
isMobile
|
|
7
7
|
sectionPosition
|
|
8
|
+
pageSections {
|
|
9
|
+
...PublishedPageSectionSelect
|
|
10
|
+
}
|
|
8
11
|
themePageCustomSections {
|
|
9
12
|
...PublishedCustomSectionSelect
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
...
|
|
14
|
+
themePageDataSEO {
|
|
15
|
+
...DataSEOSelect
|
|
13
16
|
}
|
|
14
17
|
pageStyle {
|
|
15
18
|
...PublishedThemeStyleSelect
|
|
16
19
|
}
|
|
20
|
+
themePageAnalytic {
|
|
21
|
+
...AnalyticSelect
|
|
22
|
+
}
|
|
23
|
+
themePageCustomCode {
|
|
24
|
+
...CustomCodeSelect
|
|
25
|
+
}
|
|
17
26
|
themePageCustomFonts {
|
|
18
27
|
...CustomFontSelect
|
|
19
28
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";const ProductOptionNameDocument=`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
)
|
|
7
|
-
}`;exports.ProductOptionNameDocument=ProductOptionNameDocument;
|
|
2
|
+
query productOptionName($limit: Int, $offset: Int) {
|
|
3
|
+
productOptionName(limit: $limit, offset: $offset)
|
|
4
|
+
}
|
|
5
|
+
`;exports.ProductOptionNameDocument=ProductOptionNameDocument;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";var productVariantsWithSellingPlansSelect_generated=require("../fragments/product-variants-with-selling-plans-select.generated.js"),selectedOption_generated=require("../fragments/selected-option.generated.js"),media_generated=require("../fragments/media.generated.js");const ProductVariantsWithSellingPlansDocument=`
|
|
2
|
+
query ProductVariantsWithSellingPlans($firstVariant: Int = 50, $afterVariant: Cursor, $orderBy: ProductOrder, $orderByVariant: ProductVariantOrder, $where: ProductWhereInput, $first: Int = 1) {
|
|
3
|
+
variants: products(first: $first, orderBy: $orderBy, where: $where) {
|
|
4
|
+
edges {
|
|
5
|
+
node {
|
|
6
|
+
id
|
|
7
|
+
variants(first: $firstVariant, after: $afterVariant, orderBy: $orderByVariant) {
|
|
8
|
+
edges {
|
|
9
|
+
cursor
|
|
10
|
+
node {
|
|
11
|
+
...ProductVariantsWithSellingPlansSelect
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
pageInfo {
|
|
15
|
+
hasNextPage
|
|
16
|
+
endCursor
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
${productVariantsWithSellingPlansSelect_generated.ProductVariantsWithSellingPlansSelect}
|
|
24
|
+
${selectedOption_generated.SelectedOptionSelect}
|
|
25
|
+
${media_generated.MediaSelect}`;exports.ProductVariantsWithSellingPlansDocument=ProductVariantsWithSellingPlansDocument;
|