@gem-sdk/core 2.0.0-dev.869 → 2.0.0-dev.876
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/ComponentWrapperPreview.js +1 -1
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +1 -1
- package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -1
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +1 -1
- package/dist/cjs/components/constant.js +1 -1
- package/dist/cjs/contexts/BuilderPreviewContext.js +1 -1
- package/dist/esm/components/ComponentToolbarPreview.js +1 -1
- package/dist/esm/components/ComponentWrapperPreview.js +1 -1
- package/dist/esm/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +1 -1
- package/dist/esm/components/ai-generator/components/PickProduct.js +1 -1
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +1 -1
- package/dist/esm/components/constant.js +1 -1
- package/dist/esm/contexts/BuilderPreviewContext.js +1 -1
- package/dist/types/index.d.ts +7 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"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"),ShopContext=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../hooks/useCartUI.js");var CreateThemeSection=require("./theme-section/CreateThemeSection.js"),AIContentGenerator=require("./ai-generator/AIContentGenerator.js"),AIGenContentLoading=require("./ai-generator/AIGenContentLoading.js"),Tooltip=require("./toolbar/Tooltip.js"),ThemeSectionStatus=require("./theme-section/ThemeSectionStatus.js"),useToolbarPostPurchase=require("../hooks/useToolbarPostPurchase.js"),Resize=require("./resize/Resize.js");require("../helpers/convert.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=e.isThemeSection,i=ShopContext.useShopStore(e=>e.pageType),o=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getParents),n=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getItem("ROOT")),r=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[a,l]=react.useState(null),[s,d]=react.useState(!1),[u,c]=react.useState(!1),[C,h]=react.useState([]),[x,m]=react.useState("top"),[p,j]=react.useState(!1),[b,g]=react.useState({width:"",text:""}),[v,S]=react.useState(!1),R=react.useMemo(()=>"POST_PURCHASE"===i,[i]),{checkDisableDelete:w,getTooltipText:f,checkDisableDuplicate:T}=useToolbarPostPurchase.usePostPurchase(e.uid,e.tag||""),P=(e,t)=>{let i=C.length,o=e.getBoundingClientRect(),n=t.getBoundingClientRect();return o.top-n.top<36*i},H=(e,t)=>{let i=t||e;if(e&&!isSection(e))return notVisible(e)&&P(t,e)?e:e.parentElement?H(e.parentElement,i):void 0},V=react.useCallback(()=>{if("Section"==e.tag)return"bottom";let t=document.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?m("bottom"):m("top")}},[e.tag]),M=react.useCallback(t=>{let i=t.detail;if(i?.componentUid==e.uid){V(),R&&(j(w()),g(f()),S(T()));let t=o(e.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&r||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);h(t)}else h([]),d(!1)},[e.uid,R,o,w,f,T,r,V]);if(react.useEffect(()=>(window.addEventListener("editor:active-component",M),()=>{window.removeEventListener("editor:active-component",M)}),[M]),"section"===e.type||e.editorConfigs?.toolbar?.hide)return null;let Z=()=>n?.childrens?.length||0,E=()=>"Section"!==e.tag?-1:n?.childrens?.length?n.childrens.findIndex(t=>t==e.uid):-1,L=e=>{if(!C.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(s)c(!1),d(!1);else{let e=H(i,i);if(e)c(!0);else{let e=i.getBoundingClientRect();e.top<36*C.length?c(!0):c(!1)}d(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!s}});window.dispatchEvent(o)},B=i=>{i.preventDefault(),i.stopPropagation();let o=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t}});return window.dispatchEvent(o),!1},q=i=>{if(i.preventDefault(),i.stopPropagation(),Z()>=25&&"Section"==e.tag)return!1;let o=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t}});return window.dispatchEvent(o),!1},I=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},A=()=>{l(null),window.removeEventListener("editor:close-add-section-popup",A)},k=(t,i)=>{if(t.preventDefault(),t.stopPropagation(),Z()>=25)return!1;let o=t.target;if(o){l(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",A)}return!1},y=()=>{let t=e.name&&e.name===`Section ${e.uid}`;return Z()>=20?`${t?"Section":e?.name} ${E()+1}/25`:t?`Section ${E()+1}`:e?.name};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!("Section"==e.tag&&r)&&jsxRuntime.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==e.tag,"data-toolbar-theme-section":"Section"==e.tag&&!!t||r,"data-toolbar-limit":E()>=25,children:[jsxRuntime.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>L(e),"aria-hidden":"true",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"})]})}),"Section"==e.tag?jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:y()}):jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:e.customLabel||e.label}),"Section"!==e.tag&&C.length>0&&jsxRuntime.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":s,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"})})})]}),s&&C.map((e,t)=>{let i=e?.childrens?.length??0,o=e.label;return"Row"===e.label&&(o=i<=1?e.label+" "+i+" col":e.label+" "+i+" cols"),jsxRuntime.jsxs("div",{"data-toolbar-parent":!0,"data-parent-uid":e.uid,"data-toolbar-theme-section":r,"data-toolbar-parent-revert":u,style:{top:u?`${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:o})]},e.uid)}),"Section"===e.tag&&!e.isThemeSection&&"STATIC"!==i&&"POST_PURCHASE"!==i&&25>E()&&jsxRuntime.jsx(CreateThemeSection.CreateThemeSection,{...e}),"Section"===e.tag&&jsxRuntime.jsx(AIContentGenerator.AIContentGenerator,{...e}),"Sticky"==e.tag&&jsxRuntime.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>I(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"})})}),jsxRuntime.jsx(Tooltip.default,{enable:"Section"==e.tag&&Z()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"bottom","data-toolbar-duplicate":!0,"data-toolbar-disable":"Section"==e.tag&&Z()>=25||v,onClick:v?void 0:e=>q(e),"aria-hidden":"true",className:v?"!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=>p?null:B(e),enable:p,"data-toolbar-disable":p,width:b.width,text:b.text,position:x,"aria-hidden":"true",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"})})})]},e.uid),"STATIC"!==i&&"POST_PURCHASE"!==i&&25>E()&&jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper,{...e}),jsxRuntime.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==e.tag,"data-outline-theme-section":"Section"==e.tag&&!!t||r,"data-outline-limit":E()>=25},"outline-"+e.uid),"Section"==e.tag&&!r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tooltip.default,{enable:Z()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":Z()>=25,"data-toolbar-add-open":"above"==a,onClick:e=>k(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:Z()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":Z()>=25,"data-toolbar-add-open":"below"==a,onClick:e=>k(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"})})})]}),"Section"===e.tag&&jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading,{...e}),jsxRuntime.jsx(Resize.default,{...e})]})};var ComponentToolbarPreview$1=react.memo(ComponentToolbarPreview);exports.default=ComponentToolbarPreview$1;
|
|
1
|
+
"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"),ShopContext=require("../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../hooks/useCartUI.js");var CreateThemeSection=require("./theme-section/CreateThemeSection.js"),AIContentGenerator=require("./ai-generator/AIContentGenerator.js"),AIGenContentLoading=require("./ai-generator/AIGenContentLoading.js"),Tooltip=require("./toolbar/Tooltip.js"),ThemeSectionStatus=require("./theme-section/ThemeSectionStatus.js"),useToolbarPostPurchase=require("../hooks/useToolbarPostPurchase.js"),Resize=require("./resize/Resize.js");require("../helpers/convert.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=e.isThemeSection,i=e.isShopifySection,o=ShopContext.useShopStore(e=>e.pageType),n=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getParents),l=BuilderPreviewContext.useBuilderPreviewStore(e=>e.getItem("ROOT")),r=BuilderPreviewContext.useBuilderPreviewStore(e=>e.isThemeSectionEditor),[a,s]=react.useState(null),[d,u]=react.useState(!1),[C,c]=react.useState(!1),[h,x]=react.useState([]),[p,m]=react.useState("top"),[j,v]=react.useState(!1),[b,g]=react.useState({width:"",text:""}),[R,f]=react.useState(!1),w=react.useMemo(()=>"POST_PURCHASE"===o,[o]),{checkDisableDelete:S,getTooltipText:T,checkDisableDuplicate:P}=useToolbarPostPurchase.usePostPurchase(e.uid,e.tag||""),M=(e,t)=>{let i=h.length,o=e.getBoundingClientRect(),n=t.getBoundingClientRect();return o.top-n.top<36*i},V=(e,t)=>{let i=t||e;if(e&&!isSection(e))return notVisible(e)&&M(t,e)?e:e.parentElement?V(e.parentElement,i):void 0},Z=react.useCallback(()=>{if("Section"==e.tag)return"bottom";let t=document.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?m("bottom"):m("top")}},[e.tag]),H=react.useCallback(t=>{let i=t.detail;if(i?.componentUid==e.uid){Z(),w&&(v(S()),g(T()),f(P()));let t=n(e.uid).filter(e=>!("ROOT"===e.uid||"Section"===e.tag&&r||e.editorConfigs?.toolbar?.hide||e.editorConfigs?.component?.noSetting)).slice(0,3);x(t)}else x([]),u(!1)},[e.uid,w,n,S,T,P,r,Z]);if(react.useEffect(()=>(window.addEventListener("editor:active-component",H),()=>{window.removeEventListener("editor:active-component",H)}),[H]),"section"===e.type||e.editorConfigs?.toolbar?.hide)return null;let E=()=>l?.childrens?.length||0,L=()=>"Section"!==e.tag?-1:l?.childrens?.length?l.childrens.findIndex(t=>t==e.uid):-1,y=e=>{if(!h.length)return;let t=e?.target||null,i=t.closest("[data-toolbar-active]");if(!t||!i)return;if(d)c(!1),u(!1);else{let e=V(i,i);if(e)c(!0);else{let e=i.getBoundingClientRect();e.top<36*h.length?c(!0):c(!1)}u(!0)}let o=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!d}});window.dispatchEvent(o)},B=o=>{o.preventDefault(),o.stopPropagation();let n=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t,isShopifySection:i}});return window.dispatchEvent(n),!1},q=o=>{if(o.preventDefault(),o.stopPropagation(),E()>=25&&"Section"==e.tag)return!1;let n=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:e.uid,isThemeSection:t,isShopifySection:i}});return window.dispatchEvent(n),!1},I=t=>{t.preventDefault(),t.stopPropagation();let o=new CustomEvent("editor:toolbar:visibility-shopify-section",{bubbles:!0,detail:{componentUid:e.uid,isShopifySection:i}});return window.dispatchEvent(o),!1},A=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},k=()=>{s(null),window.removeEventListener("editor:close-add-section-popup",k)},F=(t,i)=>{if(t.preventDefault(),t.stopPropagation(),E()>=25)return!1;let o=t.target;if(o){s(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",k)}return!1},U=()=>{if(i)return`Shopify section: ${e.name}`;let t=e.name&&e.name===`Section ${e.uid}`;return E()>=20?`${t?"Section":e?.name} ${L()+1}/25`:t?`Section ${L()+1}`:e?.name};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!("Section"==e.tag&&r)&&jsxRuntime.jsxs("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==e.tag,"data-toolbar-theme-section":"Section"==e.tag&&!!t||r,"data-toolbar-shopify-section":"Section"==e.tag&&!!i,"data-toolbar-limit":L()>=25,children:[jsxRuntime.jsxs("div",{"data-toolbar-show-parent":!0,onClick:e=>y(e),"aria-hidden":"true",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"})]})}),"Section"==e.tag?jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:U()}):jsxRuntime.jsx("div",{"data-toolbar-name":!0,children:e.customLabel||e.label}),"Section"!==e.tag&&h.length>0&&jsxRuntime.jsx("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":d,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"})})})]}),d&&h.map((e,t)=>{let i=e?.childrens?.length??0,o=e.label;return"Row"===e.label&&(o=i<=1?e.label+" "+i+" col":e.label+" "+i+" cols"),jsxRuntime.jsxs("div",{"data-toolbar-parent":!0,"data-parent-uid":e.uid,"data-toolbar-theme-section":r,"data-toolbar-parent-revert":C,style:{top:C?`${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:o})]},e.uid)}),"Section"===e.tag&&!e.isThemeSection&&"STATIC"!==o&&"POST_PURCHASE"!==o&&!e.isShopifySection&&25>L()&&jsxRuntime.jsx(CreateThemeSection.CreateThemeSection,{...e}),jsxRuntime.jsx(AIContentGenerator.AIContentGenerator,{...e}),"Sticky"==e.tag&&jsxRuntime.jsx("div",{"data-toolbar-zoom-out":!0,onClick:e=>A(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"})})}),jsxRuntime.jsx(Tooltip.default,{enable:"Section"==e.tag&&E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"bottom","data-toolbar-duplicate":!0,"data-toolbar-disable":"Section"==e.tag&&E()>=25||R,onClick:R?void 0:e=>q(e),"aria-hidden":"true",className:R?"!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"})})}),"Section"===e.tag&&e.isShopifySection&&jsxRuntime.jsx(Tooltip.default,{enable:!1,text:"",position:"bottom","data-toolbar-visibility":!0,onClick:e=>I(e),"aria-hidden":"true",children:e.isShopifyVisibility?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:"M10.4998 7.99841C10.499 6.61803 9.37945 5.49961 7.99909 5.50027C6.6187 5.50071 5.49975 6.61987 5.49975 8.00027C5.49975 9.38099 6.61904 10.5003 7.99975 10.5003C9.38021 10.5003 10.4996 9.38184 10.4998 8.00107V7.99841ZM7.99949 6.50027C8.82762 6.49983 9.49931 7.17081 9.49975 7.99894V8.00054C9.49975 8.8288 8.82836 9.50027 7.99975 9.50027C7.17133 9.50027 6.49975 8.8287 6.49975 8.00027C6.49975 7.172 7.17122 6.50049 7.99949 6.50027Z",fill:"white"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99869 3.50098C4.53098 3.50106 2.24443 6.11641 1.43599 7.20809C1.0847 7.68246 1.08696 8.32021 1.43971 8.79238C2.25325 9.88131 4.55461 12.4995 7.9987 12.4995C11.5041 12.4995 13.7751 9.87636 14.5731 8.78489C14.9175 8.31382 14.915 7.68401 14.5684 7.21544C13.7641 6.12774 11.474 3.50089 7.99869 3.50098ZM2.23962 7.80322C3.016 6.75484 5.04126 4.50105 7.99871 4.50098C10.9629 4.50091 12.9916 6.76501 13.7644 7.81003C13.8513 7.92751 13.8516 8.07739 13.7658 8.19472C13.0028 9.23835 10.9929 11.4995 7.9987 11.4995C5.0648 11.4995 3.025 9.24349 2.24082 8.19386C2.15178 8.07468 2.15162 7.92206 2.23962 7.80322Z",fill:"white"})]}):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:"M10.4998 7.99857C10.499 6.61819 9.37945 5.49977 7.99909 5.50044C6.6187 5.50088 5.49975 6.62003 5.49975 8.00044C5.49975 9.38115 6.61904 10.5004 7.99975 10.5004C9.38021 10.5004 10.4996 9.382 10.4998 8.00124V7.99857ZM7.99949 6.50044C8.82762 6.49999 9.49931 7.17097 9.49975 7.9991V8.0007C9.49975 8.82896 8.82836 9.50044 7.99975 9.50044C7.17133 9.50044 6.49975 8.82886 6.49975 8.00044C6.49975 7.17216 7.17122 6.50066 7.99949 6.50044Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99869 3.50114C4.53098 3.50122 2.24443 6.11658 1.43599 7.20825C1.0847 7.68262 1.08696 8.32038 1.43971 8.79254C2.25325 9.88147 4.55461 12.4997 7.9987 12.4997C11.5041 12.4997 13.7751 9.87652 14.5731 8.78505C14.9175 8.31398 14.915 7.68417 14.5684 7.2156C13.7641 6.1279 11.474 3.50106 7.99869 3.50114ZM2.23962 7.80338C3.016 6.755 5.04126 4.50121 7.99871 4.50114C10.9629 4.50107 12.9916 6.76517 13.7644 7.81019C13.8513 7.92767 13.8516 8.07755 13.7658 8.19488C13.0028 9.23851 10.9929 11.4997 7.9987 11.4997C5.0648 11.4997 3.025 9.24365 2.24082 8.19402C2.15178 8.07484 2.15162 7.92222 2.23962 7.80338Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.4607 2.6163C14.6728 2.87086 14.6384 3.2492 14.3839 3.46134L2.38387 13.4613C2.1293 13.6735 1.75096 13.6391 1.53882 13.3845C1.32668 13.13 1.36108 12.7516 1.61565 12.5395L13.6156 2.53947C13.8702 2.32733 14.2486 2.36173 14.4607 2.6163Z",fill:"#F9F9F9"})]})}),jsxRuntime.jsx(Tooltip.default,{"data-toolbar-delete":!0,onClick:e=>j?null:B(e),enable:j,"data-toolbar-disable":j,width:b.width,text:b.text,position:p,"aria-hidden":"true",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"})})})]},e.uid),"STATIC"!==o&&"POST_PURCHASE"!==o&&25>L()&&jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatusWrapper,{...e}),jsxRuntime.jsx("div",{"data-outline":!0,"data-outline-section":"Section"==e.tag,"data-outline-theme-section":"Section"==e.tag&&!!t||r,"data-outline-shopify-section":"Section"==e.tag&&!!i,"data-outline-limit":L()>=25},"outline-"+e.uid),"Section"==e.tag&&!r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tooltip.default,{enable:E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":E()>=25,"data-toolbar-add-open":"above"==a,onClick:e=>F(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:E()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":E()>=25,"data-toolbar-add-open":"below"==a,onClick:e=>F(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"})})})]}),jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading,{...e}),jsxRuntime.jsx(Resize.default,{...e})]})};var ComponentToolbarPreview$1=react.memo(ComponentToolbarPreview);exports.default=ComponentToolbarPreview$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),composeAdvanceStyle=require("../helpers/compose-advance-style.js"),constant=require("./constant.js"),RenderCustomCode=require("./RenderCustomCode.js"),ComponentToolbarPreview=require("./ComponentToolbarPreview.js"),useApplyAnimation=require("../hooks/animation/useApplyAnimation.js");require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var shop=require("../hooks/shop.js");require("vanilla-lazyload"),require("../hooks/useCartUI.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),composeAdvanceStyle=require("../helpers/compose-advance-style.js"),constant=require("./constant.js"),RenderCustomCode=require("./RenderCustomCode.js"),ComponentToolbarPreview=require("./ComponentToolbarPreview.js"),useApplyAnimation=require("../hooks/animation/useApplyAnimation.js");require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var shop=require("../hooks/shop.js");require("vanilla-lazyload"),require("../hooks/useCartUI.js");var cls=require("../helpers/cls.js");require("../helpers/convert.js");const ComponentWrapperPreview=({children:e,...t})=>{react.useEffect(()=>{let e=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:t.uid}});window.dispatchEvent(e)},[t.uid]),useApplyAnimation.default({props:t});let n=shop.usePageType();if("section"===t.type)return null;let o={};if("Section"===t.tag&&t.isThemeSection&&(o["data-theme-section"]=!0),"Section"===t.tag&&t.isShopifySection&&(o["data-shopify-section"]=!0,o["data-toolbar-wrap"]=!0),t.editorConfigs){let e=t.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(o["data-placeholder-not-append-before-after"]=!0),e.placeholder?.notAppendLeftRight&&(o["data-placeholder-not-append-left-right"]=!0),e.toolbar?.parent&&(o["data-toolbar-parent"]=!0),e.component?.noDelete&&(o["data-component-no-delete"]=!0),e.component?.noDuplicate&&(o["data-component-no-duplicate"]=!0),e.component?.noDragDrop&&(o["data-component-no-drag-drop"]=!0),e.component?.noSetting&&(o["data-component-no-setting"]=!0),e.component?.isThirdParty&&(o["data-component-is-third-party"]=!0),e.toolbar?.hide&&(o["data-toolbar-hide"]=!0),e.slots?.children&&(o["data-slots-children"]=!0),e.toolbar?.hide||(o["data-toolbar-wrap"]=!0)}t?.editorConfigs?.toolbar?.hide||(o["data-toolbar-wrap"]=!0);let a=e=>"GP_FUNNEL_PAGE"===n&&["ProductList","Header"].includes(e),s=composeAdvanceStyle.composeAdvanceStyle(t.advanced,t.tag,n),i=t.advanced,r={...o,"data-uid":t.uid,"data-component-type":"component","data-component-tag":t.tag,"data-component-label":t.label,"data-not-droppable":a(t.tag)},d=({name:e,visibility:t})=>jsxRuntime.jsxs("div",{className:cls.cls("gp-flex gp-items-center gp-justify-center gp-gap-[8px] gp-bg-[#F4F4F4] gp-p-[16px] gp-border gp-border-[#D6D6D6]",{"gp-opacity-[0.6]":!t}),children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M19.1475 5.16194C19.1416 5.1148 19.1197 5.0713 19.0857 5.03911C19.0516 5.00692 19.0076 4.9881 18.9614 4.98597C18.8835 4.98597 17.3469 4.95397 17.3469 4.95397C17.3469 4.95397 16.0588 3.67419 15.9342 3.5311C15.8104 3.40312 15.5619 3.43512 15.4684 3.46711L14.8166 3.67508C14.7361 3.40491 14.6323 3.14259 14.5067 2.89121C14.0566 1.99536 13.3727 1.51544 12.5659 1.51544C12.5044 1.51544 12.4577 1.51544 12.3954 1.53144C12.3642 1.49945 12.3486 1.46745 12.3175 1.45145C11.9608 1.06752 11.5107 0.875552 10.967 0.891549C9.92824 0.923543 8.88772 1.70741 8.03419 3.08318C7.44467 4.05901 6.99453 5.27392 6.8543 6.21776C5.65969 6.6017 4.82087 6.87365 4.79057 6.87365C4.18461 7.06562 4.16903 7.08161 4.09199 7.67351C4.06082 8.12144 2.47754 20.7415 2.47754 20.7415L15.7636 23.1091L21.522 21.6374C21.5064 21.6374 19.1631 5.27392 19.1475 5.16194ZM14.1492 3.89904C13.8062 4.00572 13.4648 4.11772 13.1251 4.23498C13.1251 3.69108 13.0472 2.92321 12.8143 2.28331C13.6064 2.41129 13.9942 3.33914 14.1492 3.89904ZM12.4265 4.44206C11.7279 4.66602 10.9679 4.90598 10.207 5.14594C10.4243 4.29808 10.8277 3.46623 11.3245 2.90632C11.533 2.66965 11.7863 2.47913 12.069 2.34641C12.3806 2.9712 12.4421 3.85105 12.4265 4.44206ZM10.9982 1.61143C11.2466 1.61143 11.4483 1.65942 11.6197 1.7874C11.3127 1.95192 11.0387 2.17444 10.8121 2.44329C10.1455 3.17916 9.63305 4.31408 9.43135 5.4179C8.79423 5.62586 8.17356 5.81783 7.61521 5.9938C7.98744 4.25009 9.39933 1.65942 10.9982 1.61143Z",fill:"#95BF47"}),jsxRuntime.jsx("path",{d:"M18.9647 4.94709C18.8851 4.94709 17.3155 4.91503 17.3155 4.91503C17.3155 4.91503 15.9981 3.63242 15.8716 3.48812C15.8261 3.43951 15.7635 3.41074 15.6973 3.40796V23.1094L21.5828 21.6344L19.1709 5.12345C19.1399 5.01122 19.0444 4.94709 18.9647 4.94709Z",fill:"#5E8E3E"}),jsxRuntime.jsx("path",{d:"M13.0575 8.51577L12.3029 10.8908C12.3029 10.8908 11.4602 10.5663 10.4599 10.6253C8.98595 10.6991 8.98595 11.4809 8.98595 11.6727C9.07404 12.7348 12.39 12.9709 12.5828 15.4631C12.7238 17.4251 11.3545 18.7675 9.35396 18.8708C6.96778 18.9733 5.65137 17.7939 5.65137 17.7939L6.16032 15.9794C6.16032 15.9794 7.49435 16.8203 8.5465 16.7613C9.23162 16.7318 9.4949 16.245 9.45967 15.9204C9.35396 14.5337 6.65165 14.6223 6.47645 12.3365C6.33551 10.4188 7.82712 8.48626 11.1265 8.30924C12.4076 8.23548 13.0575 8.51577 13.0575 8.51577Z",fill:"white"})]}),jsxRuntime.jsx("span",{className:"gp-text-[#212121] gp-text-[14px] gp-leading-[24px] gp-font-medium",children:e})]});return constant.disableWrap.includes(t.tag)&&react.isValidElement(e)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:i}),jsxRuntime.jsxs(e.type,{className:i?.cssClass,...e.props,style:s,builderAttrs:r,advanced:i,children:[t.isShopifySection?jsxRuntime.jsx(d,{name:t.name??"",visibility:!!t.isShopifyVisibility}):e.props.children,jsxRuntime.jsx(ComponentToolbarPreview.default,{...t})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:i}),jsxRuntime.jsxs("div",{style:constant.excludeApplyStyle.includes(t.tag)?{"--mb":s?.["--mb"],"--mb-tablet":s?.["--mb-tablet"],"--mb-mobile":s?.["--mb-mobile"]}:s,className:`${t.uid} ${t.advanced?.cssClass?t.advanced?.cssClass:""}`,...r,children:[!constant.excludeApplyStyle.includes(t.tag)&&e,react.isValidElement(e)&&constant.excludeApplyStyle.includes(t.tag)&&jsxRuntime.jsx(e.type,{...e.props,style:s,advanced:i}),jsxRuntime.jsx(ComponentToolbarPreview.default,{...t})]})]})};var ComponentWrapperPreview$1=react.memo(ComponentWrapperPreview);exports.default=ComponentWrapperPreview$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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"),PickProduct=require("./components/PickProduct.js"),ToneAndVoice=require("./components/ToneAndVoice.js"),classNames=require("classnames"),useListenEventGenerate=require("./hooks/useListenEventGenerate.js"),useGettingGenerateRequest=require("./hooks/useGettingGenerateRequest.js");const AIContentGenerator=({...e})=>{let[t,s]=react.useState(!1),[n,i]=react.useState(!1),
|
|
1
|
+
"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"),PickProduct=require("./components/PickProduct.js"),ToneAndVoice=require("./components/ToneAndVoice.js"),classNames=require("classnames"),useListenEventGenerate=require("./hooks/useListenEventGenerate.js"),useGettingGenerateRequest=require("./hooks/useGettingGenerateRequest.js");const AIContentGenerator=({...e})=>{let[t,s]=react.useState(!1),[n,i]=react.useState(!1),{isGenerating:r,onGenerate:o}=useListenEventGenerate.useListenEventGenerate({uid:e.uid,tag:String(e.tag)}),{getRequestBody:a,prompt:c,changeProductName:g,changePrompt:p}=useGettingGenerateRequest.useGettingGenerateRequest(),u=()=>{s(!t)},l=()=>{s(!1)},m=e=>{p(e.target.value)},d=react.useCallback(t=>{let s=t.detail;s?.componentUid!==e.uid&&l()},[e.uid]),x=()=>{i(!n)},j=()=>{let e=a();o(e)};return react.useEffect(()=>{r||l()},[r]),react.useEffect(()=>(window.addEventListener("editor:active-component",d),()=>{window.removeEventListener("editor:active-component",d)}),[d]),jsxRuntime.jsxs("div",{className:"gp-relative",children:[jsxRuntime.jsx("div",{className:"gp-border-r-[#6a6a6a]"}),jsxRuntime.jsx("div",{className:"gp-border-r-[#6a6a6a] gp-border-r gp-pr-1 gp-mr-1",children:jsxRuntime.jsxs("button",{className:"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:u,children:[jsxRuntime.jsx(AIIcon.AIIcon,{}),"AI Content"]})}),jsxRuntime.jsxs("div",{className:classNames({"gp-hidden":!t,"gp-right-0":"Section"===e.tag,"gp-left-0":"Section"!==e.tag},"gp-absolute gp-top-8 gp-right-0 gp-rounded-lg gp-bg-[#151515] gp-p-4 gp-w-[312px] !gp-max-w-[312px] !gp-cursor-default"),children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-justify-between gp-mb-4",children:[jsxRuntime.jsx("span",{className:"gp-font-medium gp-text-sm",children:"Write with GemAI"}),jsxRuntime.jsx("button",{className:"gp-p-2 gp-cursor-pointer hover:gp-bg-[#3B3B3B] gp-rounded-md",onClick:l,children:jsxRuntime.jsx(CloseIcon.CloseIcon,{})})]}),jsxRuntime.jsxs("div",{className:"gp-mt-2",children:[jsxRuntime.jsx("div",{className:"gp-mb-4",children:jsxRuntime.jsx("span",{className:"gp-text-xs",children:"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:"e.g: Generate feature benefits",rows:4,value:c,onChange:m})}),jsxRuntime.jsx("div",{className:"gp-mb-4",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:x,children:["Show more",jsxRuntime.jsx("span",{className:classNames({"gp-rotate-180":n}),children:jsxRuntime.jsx(ShowMoreIcon.ShowMoreIcon,{})})]})}),jsxRuntime.jsxs("div",{className:classNames({"gp-hidden":!n},"gp-mb-4 gp-gap-4 gp-flex gp-flex-col"),children:[jsxRuntime.jsx(ToneAndVoice.ToneAndVoice,{}),jsxRuntime.jsx(PickProduct.PickProduct,{changeProductName:g})]}),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:j,children:r?"Generating...":"Generate"})]})]})]})};exports.AIContentGenerator=AIContentGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react");const AIGenContentLoading=({...e})=>{let[t,n]=react.useState(!1),[r,
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react");const AIGenContentLoading=({...e})=>{let[t,n]=react.useState(!1),[r,a]=react.useState(1),s=react.useRef(null),i=react.useCallback(t=>{let r=t.detail;if(r?.sectionUid===e.uid){if("loading"===r.status){n(!0);return}if("success"===r.status){n(!1);return}}},[e.uid]);return react.useEffect(()=>{if(t){s.current=setInterval(()=>{a(e=>3===e?1:e+1)},500);return}s.current&&clearInterval(s.current)},[t]),react.useEffect(()=>(window.addEventListener("editor:ai-generate-content-status",i),()=>{window.removeEventListener("editor:ai-generate-content-status",i)}),[i]),t?jsxRuntime.jsx("div",{className:"gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full gp-bg-white gp-bg-opacity-70 gp-flex gp-justify-center gp-items-center",children:jsxRuntime.jsxs("span",{className:"gp-font-medium",children:["Generating Content",Array.from(Array(r).keys()).map(()=>".")]})}):null};exports.AIGenContentLoading=AIGenContentLoading;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var useProductsQuery=require("../../../hooks/shop/use-products-query.js");require("vanilla-lazyload"),require("../../../hooks/useCartUI.js"),require("react-transition-group"),require("@gem-sdk/core"),require("classnames"),require("../../../helpers/convert.js");const PickProduct=e=>{let{data:s,isLoading:r}=useProductsQuery.useProductsQuery([]),[t,a]=react.useState(),[
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react");require("zustand"),require("swr"),require("@gem-sdk/adapter-shopify"),require("swr/mutation");var useProductsQuery=require("../../../hooks/shop/use-products-query.js");require("vanilla-lazyload"),require("../../../hooks/useCartUI.js"),require("react-transition-group"),require("@gem-sdk/core"),require("classnames"),require("../../../helpers/convert.js");const PickProduct=e=>{let{data:s,isLoading:r}=useProductsQuery.useProductsQuery([]),[t,a]=react.useState(),[g,u]=react.useState(!1),i=()=>{u(!g)},p=e=>{a(e),u(!1)};return react.useEffect(()=>{if(s?.products?.edges.length&&!t){let e=s.products.edges[0]?.node;e&&a({id:e?.id,name:e?.title,image:e.featuredImage?.src})}},[s,t]),react.useEffect(()=>{t&&t.name&&e.changeProductName(t.name)},[t,e]),jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-gap-2",children:[jsxRuntime.jsx("p",{className:"gp-py-2 gp-text-xs",children:"Product"}),jsxRuntime.jsxs("div",{className:"gp-relative",children:[r?jsxRuntime.jsx("div",{children:jsxRuntime.jsx("span",{className:"gp-text-xs",children:"Getting products..."})}):jsxRuntime.jsxs("button",{className:"gp-flex gp-gap-2 gp-items-center gp-w-full gp-p-2 gp-rounded-lg gp-bg-[#333333] gp-text-xs",onClick:i,children:[jsxRuntime.jsx("img",{className:"gp-rounded-lg gp-w-10 gp-h-10",src:t?.image,alt:"product_image"}),jsxRuntime.jsx("span",{className:"gp-truncate gp-max-w-[210px]",children:t?.name})]}),g&&jsxRuntime.jsx("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:s?.products?.edges.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:()=>{p({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,alt:"product_image"}),jsxRuntime.jsx("span",{className:"gp-truncate gp-max-w-[210px] gp-text-xs",children:e.node?.title})]},e.node?.id))})]})]})};exports.PickProduct=PickProduct;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var react=require("react");const useListenEventGenerate=e=>{let
|
|
1
|
+
"use strict";var react=require("react");const useListenEventGenerate=e=>{let{uid:t,tag:n}=e,[s,a]=react.useState(!1),i=e=>{let s=new CustomEvent("editor:toolbar:ai-generate-content",{bubbles:!0,detail:{componentUid:t,componentTag:n,genRequest:e}});window.dispatchEvent(s),a(!0),r("loading")},r=e=>{let n=new CustomEvent("editor:ai-generate-content-status",{bubbles:!0,detail:{status:e,sectionUid:t}});window.dispatchEvent(n)},o=react.useCallback(e=>{let n=e.detail;n?.sectionUid===t&&"success"===n.status&&a(!1)},[t]);return react.useEffect(()=>(window.addEventListener("editor:ai-generate-content-status",o),()=>{window.removeEventListener("editor:ai-generate-content-status",o)}),[o]),{isGenerating:s,onGenerate:i}};exports.useListenEventGenerate=useListenEventGenerate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","PostPurchaseProductImages","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];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","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","PostPurchaseProductImages","Sticky","Heading","ProductBadge"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList","ProductBadge"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];exports.customRenderChildren=customRenderChildren,exports.disableWrap=disableWrap,exports.excludeApplyStyle=excludeApplyStyle,exports.postPurchaseRequiredElements=postPurchaseRequiredElements,exports.postPurchaseWrapElements=postPurchaseWrapElements;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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)=>zustand.createStore((i,r)=>({state:e,loaded:!1,isThemeSectionEditor:!!t,dynamicProduct:null,dynamicCollection:null,addItem:e=>{let{position:t,data:l}=e,
|
|
1
|
+
"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)=>zustand.createStore((i,r)=>({state:e,loaded:!1,isThemeSectionEditor:!!t,dynamicProduct:null,dynamicCollection:null,addItem:e=>{let{position:t,data:l}=e,s=r().state,n=Date.now();if("section"===e.type){if(!Array.isArray(l)){let e=l.uid,r=s.ROOT;r.childrens?r.childrens.splice(t??0,0,e):r.childrens=[e],r.dateModified=n,i({state:{...s,[e]:{uid:e,type:"section",label:l.label},ROOT:cloneDeep.cloneDeep(r)}})}}else{let{id:r,data:l}=e,d=r?s[r]??s.ROOT:s.ROOT;if("section"===d.type)return;if(Array.isArray(l)){let e=l.map(e=>e.uid),r=l.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),i({state:{...s,...r,[d.uid]:cloneDeep.cloneDeep(d)}})}else{let e=normalizeBuilderData.normalizeBuilderData(l);d.dateModified=n,d.childrens=d.childrens??[],d.childrens.splice(t??0,0,l.uid),i({state:{...s,...e,[d.uid]:cloneDeep.cloneDeep(d)}})}}},changeItemProp:(e,t,l)=>{if(!l||!["setting","style","advanced"].includes(l))return;let s=r().state,n=s[e];if(n?.type!=="section"&&n){let r=Date.now();switch(n.dateModified=r,l){case"setting":i({state:{...s,[e]:{...n,settings:{...n.settings,...t}}}});break;case"style":i({state:{...s,[e]:{...n,styles:{...n.styles,...t}}}});break;case"advanced":i({state:{...s,[e]:{...n,advanced:{...n.advanced,...t}}}})}}},forceChangeItemProp:(e,t,l)=>{if(!l||!["setting","style","advanced"].includes(l))return;let s=r().state,n=s[e];if(n?.type!=="section"&&n){let r=Date.now();switch(n.dateModified=r,l){case"setting":i({state:{...s,[e]:{...n,settings:t}}});break;case"style":i({state:{...s,[e]:{...n,styles:t}}});break;case"advanced":i({state:{...s,[e]:{...n,advanced:t}}})}}},changeItemPropByKey:({id:e,key:t,data:l,group:s})=>{if(!s||!["setting","style","advanced"].includes(s))return;let n=r().state,d=n[e];if(d?.type!=="section"&&d){let r={style:d.styles??{},advanced:d.advanced??{},setting:d.settings??{}};void 0===l?(console.warn("Data is undefined"),delete r[s][t]):r[s][t]=l,i({state:{...n,[e]:{...d,settings:{...r.setting},styles:{...r.style},advanced:{...r.advanced}}}})}},getItem:e=>r().state[e],removeItem:e=>{if("ROOT"===e)i({state:{ROOT:root}});else{let t=r().state;removeByKey(e,t);let l=Object.entries(t).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(l){let r=Date.now(),[s,n]=l;if("section"===n.type)return;n.childrens=n.childrens?.filter(t=>t!==e),n.dateModified=r,i({state:{...t,[s]:cloneDeep.cloneDeep(n)}})}}},moveItem:(e,t,l)=>{let s=r().state,n=s[e],d=s[t];if(n&&d&&"section"!==d.type){if("section"===n.type){let t=s.ROOT;if(!t.childrens)return;let r=t.childrens.findIndex(t=>t===e);moveByIndex(t.childrens,r,l??0),i({state:{...s,ROOT:cloneDeep.cloneDeep(t)}})}else{let r=Object.entries(s).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(n&&r){let a=Date.now(),[,c]=r;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!==l&&(moveByIndex(c.childrens,t,l??0),i({state:{...s,[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(l??0,0,n.uid),i({state:{...s,[d.uid]:cloneDeep.cloneDeep(d),[c.uid]:cloneDeep.cloneDeep(c)}}))}}}},forceChangeState:e=>{i({state:e,loaded:!0})},initState:e=>{if(Array.isArray(e)){let t=e.map(e=>e.uid),r=e.reduceRight((e,t)=>{let i=normalizeBuilderData.normalizeBuilderData(t);return{...e,...i}},{});i({loaded:!0,state:{ROOT:{...root,childrens:t},...r}})}else{let t=normalizeBuilderData.normalizeBuilderData(e);i({loaded:!0,state:{ROOT:{...root,childrens:[e.uid]},...t}})}},addSection:(e,t)=>{let l=r().state,s=l.ROOT;s.childrens||(s.childrens=[]),s.childrens.splice(t??0,0,e.uid),i({state:{...l,ROOT:cloneDeep.cloneDeep(s)}})},getParents:(e,t)=>{let i=r().state,l=[],s=0,n=e;for(;!t||!(s>=t);){let e=Object.entries(i).find(([,e])=>"section"!==e.type&&e.childrens?.includes(n));if(!e)break;let[,t]=e;if(!t)break;l.push(t),n=t.uid,s++}return l},updateItemName:(e,t)=>{let l=r().state,s=l[e];s&&(s.name=t,i({state:{...l,[e]:cloneDeep.cloneDeep(s)}}))},updateItemAttribute:(e,t,l)=>{if(!l||!["label","customLabel","isShopifyVisibility"].includes(l))return;let s=r().state,n=s[e];if(n){if("section"!==n.type){let e=Date.now();n.dateModified=e}let r={...n,[l]:t};i({state:{...s,[e]:r}})}}})),BuilderPreviewProvider=({children:e,state:t,isThemeSectionEditor:i,lazy:r,...l})=>{let s=r?react.Suspense:react.Fragment,n=react.useMemo(()=>createBuilderPreviewProvider(t,i),[t,i]);return jsxRuntime.jsx(s,{children:jsxRuntime.jsx(BuilderPreviewContext.Provider,{...l,value:n,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 +1 @@
|
|
|
1
|
-
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{memo as i,useState as n,useMemo as l,useCallback as a,useEffect as r}from"react";import"zustand";import{useBuilderPreviewStore as d}from"../contexts/BuilderPreviewContext.js";import{useShopStore as C}from"../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr";import"swr/mutation";import"vanilla-lazyload";import"../hooks/useCartUI.js";import{CreateThemeSection as c}from"./theme-section/CreateThemeSection.js";import{AIContentGenerator as p}from"./ai-generator/AIContentGenerator.js";import{AIGenContentLoading as s}from"./ai-generator/AIGenContentLoading.js";import h from"./toolbar/Tooltip.js";import{ThemeSectionStatusWrapper as u}from"./theme-section/ThemeSectionStatus.js";import{usePostPurchase as m}from"../hooks/useToolbarPostPurchase.js";import b from"./resize/Resize.js";import"../helpers/convert.js";let SECTION_LIMIT=25,notVisible=t=>{let e=getComputedStyle(t).overflow;return"visible"!==e},isSection=t=>{let e=t.getAttribute("data-component-tag");return"Section"===e},ComponentToolbarPreview=i=>{let g=i.isThemeSection,v=C(t=>t.pageType),f=d(t=>t.getParents),w=d(t=>t.getItem("ROOT")),S=d(t=>t.isThemeSectionEditor),[H,V]=n(null),[T,x]=n(!1),[M,Z]=n(!1),[E,P]=n([]),[L,R]=n("top"),[B,j]=n(!1),[y,k]=n({width:"",text:""}),[I,U]=n(!1),A=l(()=>"POST_PURCHASE"===v,[v]),{checkDisableDelete:O,getTooltipText:$,checkDisableDuplicate:z}=m(i.uid,i.tag||""),D=(t,e)=>{let o=E.length,i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.top-n.top<36*o},_=(t,e)=>{let o=e||t;if(t&&!isSection(t))return notVisible(t)&&D(e,t)?t:t.parentElement?_(t.parentElement,o):void 0},G=a(()=>{if("Section"==i.tag)return"bottom";let t=document.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?R("bottom"):R("top")}},[i.tag]),N=a(t=>{let e=t.detail;if(e?.componentUid==i.uid){G(),A&&(j(O()),k($()),U(z()));let t=f(i.uid).filter(t=>!("ROOT"===t.uid||"Section"===t.tag&&S||t.editorConfigs?.toolbar?.hide||t.editorConfigs?.component?.noSetting)).slice(0,3);P(t)}else P([]),x(!1)},[i.uid,A,f,O,$,z,S,G]);if(r(()=>(window.addEventListener("editor:active-component",N),()=>{window.removeEventListener("editor:active-component",N)}),[N]),"section"===i.type||i.editorConfigs?.toolbar?.hide)return null;let q=()=>w?.childrens?.length||0,F=()=>"Section"!==i.tag?-1:w?.childrens?.length?w.childrens.findIndex(t=>t==i.uid):-1,J=t=>{if(!E.length)return;let e=t?.target||null,o=e.closest("[data-toolbar-active]");if(!e||!o)return;if(T)Z(!1),x(!1);else{let t=_(o,o);if(t)Z(!0);else{let t=o.getBoundingClientRect();t.top<36*E.length?Z(!0):Z(!1)}x(!0)}let i=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!T}});window.dispatchEvent(i)},K=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:g}});return window.dispatchEvent(e),!1},Q=t=>{if(t.preventDefault(),t.stopPropagation(),q()>=25&&"Section"==i.tag)return!1;let e=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:g}});return window.dispatchEvent(e),!1},W=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:i.uid}});return window.dispatchEvent(e),!1},X=()=>{V(null),window.removeEventListener("editor:close-add-section-popup",X)},Y=(t,e)=>{if(t.preventDefault(),t.stopPropagation(),q()>=25)return!1;let o=t.target;if(o){V(e);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:i.uid,position:e,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",X)}return!1},tt=()=>{let t=i.name&&i.name===`Section ${i.uid}`;return q()>=20?`${t?"Section":i?.name} ${F()+1}/25`:t?`Section ${F()+1}`:i?.name};return t(e,{children:[!("Section"==i.tag&&S)&&t("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==i.tag,"data-toolbar-theme-section":"Section"==i.tag&&!!g||S,"data-toolbar-limit":F()>=25,children:[t("div",{"data-toolbar-show-parent":!0,onClick:t=>J(t),"aria-hidden":"true",children:[o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"==i.tag?o("div",{"data-toolbar-name":!0,children:tt()}):o("div",{"data-toolbar-name":!0,children:i.customLabel||i.label}),"Section"!==i.tag&&E.length>0&&o("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":T,children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),T&&E.map((e,i)=>{let n=e?.childrens?.length??0,l=e.label;return"Row"===e.label&&(l=n<=1?e.label+" "+n+" col":e.label+" "+n+" cols"),t("div",{"data-toolbar-parent":!0,"data-parent-uid":e.uid,"data-toolbar-theme-section":S,"data-toolbar-parent-revert":M,style:{top:M?`${36*(i+1)}px`:`${-36*(i+1)}px`},children:[o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"})]})}),o("div",{"data-toolbar-name":!0,children:l})]},e.uid)}),"Section"===i.tag&&!i.isThemeSection&&"STATIC"!==v&&"POST_PURCHASE"!==v&&25>F()&&o(c,{...i}),"Section"===i.tag&&o(p,{...i}),"Sticky"==i.tag&&o("div",{"data-toolbar-zoom-out":!0,onClick:t=>W(t),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("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"})})}),o(h,{enable:"Section"==i.tag&&q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"bottom","data-toolbar-duplicate":!0,"data-toolbar-disable":"Section"==i.tag&&q()>=25||I,onClick:I?void 0:t=>Q(t),"aria-hidden":"true",className:I?"!gp-cursor-not-allowed":"",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),o(h,{"data-toolbar-delete":!0,onClick:t=>B?null:K(t),enable:B,"data-toolbar-disable":B,width:y.width,text:y.text,position:L,"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]},i.uid),"STATIC"!==v&&"POST_PURCHASE"!==v&&25>F()&&o(u,{...i}),o("div",{"data-outline":!0,"data-outline-section":"Section"==i.tag,"data-outline-theme-section":"Section"==i.tag&&!!g||S,"data-outline-limit":F()>=25},"outline-"+i.uid),"Section"==i.tag&&!S&&t(e,{children:[o(h,{enable:q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":q()>=25,"data-toolbar-add-open":"above"==H,onClick:t=>Y(t,"above"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),o(h,{enable:q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":q()>=25,"data-toolbar-add-open":"below"==H,onClick:t=>Y(t,"below"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),"Section"===i.tag&&o(s,{...i}),o(b,{...i})]})};var ComponentToolbarPreview$1=i(ComponentToolbarPreview);export{ComponentToolbarPreview$1 as default};
|
|
1
|
+
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{memo as i,useState as n,useMemo as l,useCallback as a,useEffect as r}from"react";import"zustand";import{useBuilderPreviewStore as d}from"../contexts/BuilderPreviewContext.js";import{useShopStore as C}from"../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr";import"swr/mutation";import"vanilla-lazyload";import"../hooks/useCartUI.js";import{CreateThemeSection as c}from"./theme-section/CreateThemeSection.js";import{AIContentGenerator as p}from"./ai-generator/AIContentGenerator.js";import{AIGenContentLoading as h}from"./ai-generator/AIGenContentLoading.js";import s from"./toolbar/Tooltip.js";import{ThemeSectionStatusWrapper as u}from"./theme-section/ThemeSectionStatus.js";import{usePostPurchase as m}from"../hooks/useToolbarPostPurchase.js";import v from"./resize/Resize.js";import"../helpers/convert.js";let SECTION_LIMIT=25,notVisible=t=>{let e=getComputedStyle(t).overflow;return"visible"!==e},isSection=t=>{let e=t.getAttribute("data-component-tag");return"Section"===e},ComponentToolbarPreview=i=>{let b=i.isThemeSection,g=i.isShopifySection,f=C(t=>t.pageType),w=d(t=>t.getParents),S=d(t=>t.getItem("ROOT")),M=d(t=>t.isThemeSectionEditor),[V,Z]=n(null),[x,H]=n(!1),[R,E]=n(!1),[T,y]=n([]),[P,L]=n("top"),[B,j]=n(!1),[k,I]=n({width:"",text:""}),[U,F]=n(!1),$=l(()=>"POST_PURCHASE"===f,[f]),{checkDisableDelete:A,getTooltipText:O,checkDisableDuplicate:z}=m(i.uid,i.tag||""),D=(t,e)=>{let o=T.length,i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return i.top-n.top<36*o},_=(t,e)=>{let o=e||t;if(t&&!isSection(t))return notVisible(t)&&D(e,t)?t:t.parentElement?_(t.parentElement,o):void 0},G=a(()=>{if("Section"==i.tag)return"bottom";let t=document.querySelector('[data-toolbar-active="true"]');if(t){let e=t.getBoundingClientRect();e.top<60?L("bottom"):L("top")}},[i.tag]),N=a(t=>{let e=t.detail;if(e?.componentUid==i.uid){G(),$&&(j(A()),I(O()),F(z()));let t=w(i.uid).filter(t=>!("ROOT"===t.uid||"Section"===t.tag&&M||t.editorConfigs?.toolbar?.hide||t.editorConfigs?.component?.noSetting)).slice(0,3);y(t)}else y([]),H(!1)},[i.uid,$,w,A,O,z,M,G]);if(r(()=>(window.addEventListener("editor:active-component",N),()=>{window.removeEventListener("editor:active-component",N)}),[N]),"section"===i.type||i.editorConfigs?.toolbar?.hide)return null;let q=()=>S?.childrens?.length||0,J=()=>"Section"!==i.tag?-1:S?.childrens?.length?S.childrens.findIndex(t=>t==i.uid):-1,K=t=>{if(!T.length)return;let e=t?.target||null,o=e.closest("[data-toolbar-active]");if(!e||!o)return;if(x)E(!1),H(!1);else{let t=_(o,o);if(t)E(!0);else{let t=o.getBoundingClientRect();t.top<36*T.length?E(!0):E(!1)}H(!0)}let i=new CustomEvent("editor:toolbar:show-parents",{bubbles:!0,detail:{value:!x}});window.dispatchEvent(i)},Q=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:delete-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:b,isShopifySection:g}});return window.dispatchEvent(e),!1},W=t=>{if(t.preventDefault(),t.stopPropagation(),q()>=25&&"Section"==i.tag)return!1;let e=new CustomEvent("editor:toolbar:duplicate-component",{bubbles:!0,detail:{componentUid:i.uid,isThemeSection:b,isShopifySection:g}});return window.dispatchEvent(e),!1},X=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:visibility-shopify-section",{bubbles:!0,detail:{componentUid:i.uid,isShopifySection:g}});return window.dispatchEvent(e),!1},Y=t=>{t.preventDefault(),t.stopPropagation();let e=new CustomEvent("editor:toolbar:zoom-out-component",{bubbles:!0,detail:{componentUid:i.uid}});return window.dispatchEvent(e),!1},tt=()=>{Z(null),window.removeEventListener("editor:close-add-section-popup",tt)},te=(t,e)=>{if(t.preventDefault(),t.stopPropagation(),q()>=25)return!1;let o=t.target;if(o){Z(e);let t=o.getBoundingClientRect(),n=new CustomEvent("editor:toolbar:add-section",{bubbles:!0,detail:{componentUid:i.uid,position:e,top:t.top+t.height/2}});window.dispatchEvent(n),window.addEventListener("editor:close-add-section-popup",tt)}return!1},to=()=>{if(g)return`Shopify section: ${i.name}`;let t=i.name&&i.name===`Section ${i.uid}`;return q()>=20?`${t?"Section":i?.name} ${J()+1}/25`:t?`Section ${J()+1}`:i?.name};return t(e,{children:[!("Section"==i.tag&&M)&&t("div",{"data-toolbar":!0,"data-toolbar-section":"Section"==i.tag,"data-toolbar-theme-section":"Section"==i.tag&&!!b||M,"data-toolbar-shopify-section":"Section"==i.tag&&!!g,"data-toolbar-limit":J()>=25,children:[t("div",{"data-toolbar-show-parent":!0,onClick:t=>K(t),"aria-hidden":"true",children:[o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"==i.tag?o("div",{"data-toolbar-name":!0,children:to()}):o("div",{"data-toolbar-name":!0,children:i.customLabel||i.label}),"Section"!==i.tag&&T.length>0&&o("div",{"data-toolbar-icon-parent":!0,"data-toolbar-icon-parent-open":x,children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),x&&T.map((e,i)=>{let n=e?.childrens?.length??0,l=e.label;return"Row"===e.label&&(l=n<=1?e.label+" "+n+" col":e.label+" "+n+" cols"),t("div",{"data-toolbar-parent":!0,"data-parent-uid":e.uid,"data-toolbar-theme-section":M,"data-toolbar-parent-revert":R,style:{top:R?`${36*(i+1)}px`:`${-36*(i+1)}px`},children:[o("div",{"data-toolbar-icon-drag":!0,children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[o("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"}),o("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"}),o("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"}),o("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"}),o("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"}),o("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"})]})}),o("div",{"data-toolbar-name":!0,children:l})]},e.uid)}),"Section"===i.tag&&!i.isThemeSection&&"STATIC"!==f&&"POST_PURCHASE"!==f&&!i.isShopifySection&&25>J()&&o(c,{...i}),o(p,{...i}),"Sticky"==i.tag&&o("div",{"data-toolbar-zoom-out":!0,onClick:t=>Y(t),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o("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"})})}),o(s,{enable:"Section"==i.tag&&q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"bottom","data-toolbar-duplicate":!0,"data-toolbar-disable":"Section"==i.tag&&q()>=25||U,onClick:U?void 0:t=>W(t),"aria-hidden":"true",className:U?"!gp-cursor-not-allowed":"",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),"Section"===i.tag&&i.isShopifySection&&o(s,{enable:!1,text:"",position:"bottom","data-toolbar-visibility":!0,onClick:t=>X(t),"aria-hidden":"true",children:i.isShopifyVisibility?t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4998 7.99841C10.499 6.61803 9.37945 5.49961 7.99909 5.50027C6.6187 5.50071 5.49975 6.61987 5.49975 8.00027C5.49975 9.38099 6.61904 10.5003 7.99975 10.5003C9.38021 10.5003 10.4996 9.38184 10.4998 8.00107V7.99841ZM7.99949 6.50027C8.82762 6.49983 9.49931 7.17081 9.49975 7.99894V8.00054C9.49975 8.8288 8.82836 9.50027 7.99975 9.50027C7.17133 9.50027 6.49975 8.8287 6.49975 8.00027C6.49975 7.172 7.17122 6.50049 7.99949 6.50027Z",fill:"white"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99869 3.50098C4.53098 3.50106 2.24443 6.11641 1.43599 7.20809C1.0847 7.68246 1.08696 8.32021 1.43971 8.79238C2.25325 9.88131 4.55461 12.4995 7.9987 12.4995C11.5041 12.4995 13.7751 9.87636 14.5731 8.78489C14.9175 8.31382 14.915 7.68401 14.5684 7.21544C13.7641 6.12774 11.474 3.50089 7.99869 3.50098ZM2.23962 7.80322C3.016 6.75484 5.04126 4.50105 7.99871 4.50098C10.9629 4.50091 12.9916 6.76501 13.7644 7.81003C13.8513 7.92751 13.8516 8.07739 13.7658 8.19472C13.0028 9.23835 10.9929 11.4995 7.9987 11.4995C5.0648 11.4995 3.025 9.24349 2.24082 8.19386C2.15178 8.07468 2.15162 7.92206 2.23962 7.80322Z",fill:"white"})]}):t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4998 7.99857C10.499 6.61819 9.37945 5.49977 7.99909 5.50044C6.6187 5.50088 5.49975 6.62003 5.49975 8.00044C5.49975 9.38115 6.61904 10.5004 7.99975 10.5004C9.38021 10.5004 10.4996 9.382 10.4998 8.00124V7.99857ZM7.99949 6.50044C8.82762 6.49999 9.49931 7.17097 9.49975 7.9991V8.0007C9.49975 8.82896 8.82836 9.50044 7.99975 9.50044C7.17133 9.50044 6.49975 8.82886 6.49975 8.00044C6.49975 7.17216 7.17122 6.50066 7.99949 6.50044Z",fill:"#F9F9F9"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99869 3.50114C4.53098 3.50122 2.24443 6.11658 1.43599 7.20825C1.0847 7.68262 1.08696 8.32038 1.43971 8.79254C2.25325 9.88147 4.55461 12.4997 7.9987 12.4997C11.5041 12.4997 13.7751 9.87652 14.5731 8.78505C14.9175 8.31398 14.915 7.68417 14.5684 7.2156C13.7641 6.1279 11.474 3.50106 7.99869 3.50114ZM2.23962 7.80338C3.016 6.755 5.04126 4.50121 7.99871 4.50114C10.9629 4.50107 12.9916 6.76517 13.7644 7.81019C13.8513 7.92767 13.8516 8.07755 13.7658 8.19488C13.0028 9.23851 10.9929 11.4997 7.9987 11.4997C5.0648 11.4997 3.025 9.24365 2.24082 8.19402C2.15178 8.07484 2.15162 7.92222 2.23962 7.80338Z",fill:"#F9F9F9"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.4607 2.6163C14.6728 2.87086 14.6384 3.2492 14.3839 3.46134L2.38387 13.4613C2.1293 13.6735 1.75096 13.6391 1.53882 13.3845C1.32668 13.13 1.36108 12.7516 1.61565 12.5395L13.6156 2.53947C13.8702 2.32733 14.2486 2.36173 14.4607 2.6163Z",fill:"#F9F9F9"})]})}),o(s,{"data-toolbar-delete":!0,onClick:t=>B?null:Q(t),enable:B,"data-toolbar-disable":B,width:k.width,text:k.text,position:P,"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]},i.uid),"STATIC"!==f&&"POST_PURCHASE"!==f&&25>J()&&o(u,{...i}),o("div",{"data-outline":!0,"data-outline-section":"Section"==i.tag,"data-outline-theme-section":"Section"==i.tag&&!!b||M,"data-outline-shopify-section":"Section"==i.tag&&!!g,"data-outline-limit":J()>=25},"outline-"+i.uid),"Section"==i.tag&&!M&&t(e,{children:[o(s,{enable:q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-top":!0,"data-toolbar-disable":q()>=25,"data-toolbar-add-open":"above"==V,onClick:t=>te(t,"above"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})}),o(s,{enable:q()>=25,text:"Page has reached Shopify’s 25 section-limit",position:"top","data-toolbar-add-bottom":!0,"data-toolbar-disable":q()>=25,"data-toolbar-add-open":"below"==V,onClick:t=>te(t,"below"),"aria-hidden":"true",children:o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o("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"})})})]}),o(h,{...i}),o(v,{...i})]})};var ComponentToolbarPreview$1=i(ComponentToolbarPreview);export{ComponentToolbarPreview$1 as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{memo as a,useEffect as n,isValidElement as
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{memo as a,useEffect as n,isValidElement as i}from"react";import{composeAdvanceStyle as p}from"../helpers/compose-advance-style.js";import{disableWrap as r,excludeApplyStyle as d}from"./constant.js";import l from"./RenderCustomCode.js";import s from"./ComponentToolbarPreview.js";import m from"../hooks/animation/useApplyAnimation.js";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import{usePageType as c}from"../hooks/shop.js";import"vanilla-lazyload";import"../hooks/useCartUI.js";import{cls as C}from"../helpers/cls.js";import"../helpers/convert.js";let ComponentWrapperPreview=({children:a,...h})=>{n(()=>{let e=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:h.uid}});window.dispatchEvent(e)},[h.uid]),m({props:h});let g=c();if("section"===h.type)return null;let f={};if("Section"===h.tag&&h.isThemeSection&&(f["data-theme-section"]=!0),"Section"===h.tag&&h.isShopifySection&&(f["data-shopify-section"]=!0,f["data-toolbar-wrap"]=!0),h.editorConfigs){let e=h.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(f["data-placeholder-not-append-before-after"]=!0),e.placeholder?.notAppendLeftRight&&(f["data-placeholder-not-append-left-right"]=!0),e.toolbar?.parent&&(f["data-toolbar-parent"]=!0),e.component?.noDelete&&(f["data-component-no-delete"]=!0),e.component?.noDuplicate&&(f["data-component-no-duplicate"]=!0),e.component?.noDragDrop&&(f["data-component-no-drag-drop"]=!0),e.component?.noSetting&&(f["data-component-no-setting"]=!0),e.component?.isThirdParty&&(f["data-component-is-third-party"]=!0),e.toolbar?.hide&&(f["data-toolbar-hide"]=!0),e.slots?.children&&(f["data-slots-children"]=!0),e.toolbar?.hide||(f["data-toolbar-wrap"]=!0)}h?.editorConfigs?.toolbar?.hide||(f["data-toolbar-wrap"]=!0);let b=e=>"GP_FUNNEL_PAGE"===g&&["ProductList","Header"].includes(e),u=p(h.advanced,h.tag,g),v=h.advanced,w={...f,"data-uid":h.uid,"data-component-type":"component","data-component-tag":h.tag,"data-component-label":h.label,"data-not-droppable":b(h.tag)},y=({name:t,visibility:a})=>e("div",{className:C("gp-flex gp-items-center gp-justify-center gp-gap-[8px] gp-bg-[#F4F4F4] gp-p-[16px] gp-border gp-border-[#D6D6D6]",{"gp-opacity-[0.6]":!a}),children:[e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o("path",{d:"M19.1475 5.16194C19.1416 5.1148 19.1197 5.0713 19.0857 5.03911C19.0516 5.00692 19.0076 4.9881 18.9614 4.98597C18.8835 4.98597 17.3469 4.95397 17.3469 4.95397C17.3469 4.95397 16.0588 3.67419 15.9342 3.5311C15.8104 3.40312 15.5619 3.43512 15.4684 3.46711L14.8166 3.67508C14.7361 3.40491 14.6323 3.14259 14.5067 2.89121C14.0566 1.99536 13.3727 1.51544 12.5659 1.51544C12.5044 1.51544 12.4577 1.51544 12.3954 1.53144C12.3642 1.49945 12.3486 1.46745 12.3175 1.45145C11.9608 1.06752 11.5107 0.875552 10.967 0.891549C9.92824 0.923543 8.88772 1.70741 8.03419 3.08318C7.44467 4.05901 6.99453 5.27392 6.8543 6.21776C5.65969 6.6017 4.82087 6.87365 4.79057 6.87365C4.18461 7.06562 4.16903 7.08161 4.09199 7.67351C4.06082 8.12144 2.47754 20.7415 2.47754 20.7415L15.7636 23.1091L21.522 21.6374C21.5064 21.6374 19.1631 5.27392 19.1475 5.16194ZM14.1492 3.89904C13.8062 4.00572 13.4648 4.11772 13.1251 4.23498C13.1251 3.69108 13.0472 2.92321 12.8143 2.28331C13.6064 2.41129 13.9942 3.33914 14.1492 3.89904ZM12.4265 4.44206C11.7279 4.66602 10.9679 4.90598 10.207 5.14594C10.4243 4.29808 10.8277 3.46623 11.3245 2.90632C11.533 2.66965 11.7863 2.47913 12.069 2.34641C12.3806 2.9712 12.4421 3.85105 12.4265 4.44206ZM10.9982 1.61143C11.2466 1.61143 11.4483 1.65942 11.6197 1.7874C11.3127 1.95192 11.0387 2.17444 10.8121 2.44329C10.1455 3.17916 9.63305 4.31408 9.43135 5.4179C8.79423 5.62586 8.17356 5.81783 7.61521 5.9938C7.98744 4.25009 9.39933 1.65942 10.9982 1.61143Z",fill:"#95BF47"}),o("path",{d:"M18.9647 4.94709C18.8851 4.94709 17.3155 4.91503 17.3155 4.91503C17.3155 4.91503 15.9981 3.63242 15.8716 3.48812C15.8261 3.43951 15.7635 3.41074 15.6973 3.40796V23.1094L21.5828 21.6344L19.1709 5.12345C19.1399 5.01122 19.0444 4.94709 18.9647 4.94709Z",fill:"#5E8E3E"}),o("path",{d:"M13.0575 8.51577L12.3029 10.8908C12.3029 10.8908 11.4602 10.5663 10.4599 10.6253C8.98595 10.6991 8.98595 11.4809 8.98595 11.6727C9.07404 12.7348 12.39 12.9709 12.5828 15.4631C12.7238 17.4251 11.3545 18.7675 9.35396 18.8708C6.96778 18.9733 5.65137 17.7939 5.65137 17.7939L6.16032 15.9794C6.16032 15.9794 7.49435 16.8203 8.5465 16.7613C9.23162 16.7318 9.4949 16.245 9.45967 15.9204C9.35396 14.5337 6.65165 14.6223 6.47645 12.3365C6.33551 10.4188 7.82712 8.48626 11.1265 8.30924C12.4076 8.23548 13.0575 8.51577 13.0575 8.51577Z",fill:"white"})]}),o("span",{className:"gp-text-[#212121] gp-text-[14px] gp-leading-[24px] gp-font-medium",children:t})]});return r.includes(h.tag)&&i(a)?e(t,{children:[o(l,{uid:h.uid,advanced:v}),e(a.type,{className:v?.cssClass,...a.props,style:u,builderAttrs:w,advanced:v,children:[h.isShopifySection?o(y,{name:h.name??"",visibility:!!h.isShopifyVisibility}):a.props.children,o(s,{...h})]})]}):e(t,{children:[o(l,{uid:h.uid,advanced:v}),e("div",{style:d.includes(h.tag)?{"--mb":u?.["--mb"],"--mb-tablet":u?.["--mb-tablet"],"--mb-mobile":u?.["--mb-mobile"]}:u,className:`${h.uid} ${h.advanced?.cssClass?h.advanced?.cssClass:""}`,...w,children:[!d.includes(h.tag)&&a,i(a)&&d.includes(h.tag)&&o(a.type,{...a.props,style:u,advanced:v}),o(s,{...h})]})]})};var ComponentWrapperPreview$1=a(ComponentWrapperPreview);export{ComponentWrapperPreview$1 as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as p,useCallback as o,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as p,useCallback as o,useEffect as r}from"react";import{AIIcon as g}from"./icons/AIIcon.js";import{CloseIcon as n}from"./icons/CloseIcon.js";import{ShowMoreIcon as i}from"./icons/ShowMoreIcon.js";import{PickProduct as a}from"./components/PickProduct.js";import{ToneAndVoice as s}from"./components/ToneAndVoice.js";import l from"classnames";import{useListenEventGenerate as c}from"./hooks/useListenEventGenerate.js";import{useGettingGenerateRequest as d}from"./hooks/useGettingGenerateRequest.js";let AIContentGenerator=({...m})=>{let[u,h]=p(!1),[f,x]=p(!1),{isGenerating:b,onGenerate:v}=c({uid:m.uid,tag:String(m.tag)}),{getRequestBody:N,prompt:w,changeProductName:A,changePrompt:C}=d(),j=()=>{h(!u)},G=()=>{h(!1)},k=e=>{C(e.target.value)},I=o(e=>{let t=e.detail;t?.componentUid!==m.uid&&G()},[m.uid]),B=()=>{x(!f)},y=()=>{let e=N();v(e)};return r(()=>{b||G()},[b]),r(()=>(window.addEventListener("editor:active-component",I),()=>{window.removeEventListener("editor:active-component",I)}),[I]),e("div",{className:"gp-relative",children:[t("div",{className:"gp-border-r-[#6a6a6a]"}),t("div",{className:"gp-border-r-[#6a6a6a] gp-border-r gp-pr-1 gp-mr-1",children:e("button",{className:"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:j,children:[t(g,{}),"AI Content"]})}),e("div",{className:l({"gp-hidden":!u,"gp-right-0":"Section"===m.tag,"gp-left-0":"Section"!==m.tag},"gp-absolute gp-top-8 gp-right-0 gp-rounded-lg gp-bg-[#151515] gp-p-4 gp-w-[312px] !gp-max-w-[312px] !gp-cursor-default"),children:[e("div",{className:"gp-flex gp-items-center gp-justify-between gp-mb-4",children:[t("span",{className:"gp-font-medium gp-text-sm",children:"Write with GemAI"}),t("button",{className:"gp-p-2 gp-cursor-pointer hover:gp-bg-[#3B3B3B] gp-rounded-md",onClick:G,children:t(n,{})})]}),e("div",{className:"gp-mt-2",children:[t("div",{className:"gp-mb-4",children:t("span",{className:"gp-text-xs",children:"What would you like to describe here?"})}),t("div",{className:"gp-mb-4 gp-flex",children:t("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:"e.g: Generate feature benefits",rows:4,value:w,onChange:k})}),t("div",{className:"gp-mb-4",children:e("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:B,children:["Show more",t("span",{className:l({"gp-rotate-180":f}),children:t(i,{})})]})}),e("div",{className:l({"gp-hidden":!f},"gp-mb-4 gp-gap-4 gp-flex gp-flex-col"),children:[t(s,{}),t(a,{changeProductName:A})]}),t("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:y,children:b?"Generating...":"Generate"})]})]})]})};export{AIContentGenerator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as n,useRef as r,useCallback as i,useEffect as a}from"react";let AIGenContentLoading=({...s})=>{let[o,l]=n(!1),[u,g]=n(1),c=r(null),p=i(e=>{let t=e.detail;if(t?.sectionUid===s.uid){if("loading"===t.status){l(!0);return}if("success"===t.status){l(!1);return}}},[s.uid]);return a(()=>{if(o){c.current=setInterval(()=>{g(e=>3===e?1:e+1)},500);return}c.current&&clearInterval(c.current)},[o]),a(()=>(window.addEventListener("editor:ai-generate-content-status",p),()=>{window.removeEventListener("editor:ai-generate-content-status",p)}),[p]),o?e("div",{className:"gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full gp-bg-white gp-bg-opacity-70 gp-flex gp-justify-center gp-items-center",children:t("span",{className:"gp-font-medium",children:["Generating Content",Array.from(Array(u).keys()).map(()=>".")]})}):null};export{AIGenContentLoading};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as e,jsx as p}from"react/jsx-runtime";import{useState as t,useEffect as g}from"react";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import{useProductsQuery as r}from"../../../hooks/shop/use-products-query.js";import"vanilla-lazyload";import"../../../hooks/useCartUI.js";import"react-transition-group";import"@gem-sdk/core";import"classnames";import"../../../helpers/convert.js";let PickProduct=a=>{let{data:s,isLoading:o}=r([]),[d,i]=t(),[l,c]=t(!1),m=()=>{c(!l)},n=e=>{i(e),c(!1)};return g(()=>{if(s?.products?.edges.length&&!d){let e=s.products.edges[0]?.node;e&&i({id:e?.id,name:e?.title,image:e.featuredImage?.src})}},[s,d]),g(()=>{d&&d.name&&a.changeProductName(d.name)},[d,a]),e("div",{className:"gp-flex gp-flex-col gp-gap-2",children:[p("p",{className:"gp-py-2 gp-text-xs",children:"Product"}),e("div",{className:"gp-relative",children:[o?p("div",{children:p("span",{className:"gp-text-xs",children:"Getting products..."})}):e("button",{className:"gp-flex gp-gap-2 gp-items-center gp-w-full gp-p-2 gp-rounded-lg gp-bg-[#333333] gp-text-xs",onClick:m,children:[p("img",{className:"gp-rounded-lg gp-w-10 gp-h-10",src:d?.image,alt:"product_image"}),p("span",{className:"gp-truncate gp-max-w-[210px]",children:d?.name})]}),l&&p("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:s?.products?.edges.map(t=>e("button",{className:"gp-flex gp-p-2 hover:gp-bg-[#3B3B3B] gp-rounded-lg gp-cursor-pointer gp-gap-2 gp-items-center",onClick:()=>{n({id:t.node?.id,name:t.node?.title,image:t.node?.featuredImage?.src})},children:[p("img",{className:"gp-rounded-lg gp-w-10 gp-h-10",src:t.node?.featuredImage?.src,alt:"product_image"}),p("span",{className:"gp-truncate gp-max-w-[210px] gp-text-xs",children:t.node?.title})]},t.node?.id))})]})]})};export{PickProduct};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useCallback as t,useEffect as n}from"react";let useListenEventGenerate=i=>{let
|
|
1
|
+
import{useState as e,useCallback as t,useEffect as n}from"react";let useListenEventGenerate=i=>{let{uid:s,tag:o}=i,[a,d]=e(!1),r=e=>{let t=new CustomEvent("editor:toolbar:ai-generate-content",{bubbles:!0,detail:{componentUid:s,componentTag:o,genRequest:e}});window.dispatchEvent(t),d(!0),u("loading")},u=e=>{let t=new CustomEvent("editor:ai-generate-content-status",{bubbles:!0,detail:{status:e,sectionUid:s}});window.dispatchEvent(t)},c=t(e=>{let t=e.detail;t?.sectionUid===s&&"success"===t.status&&d(!1)},[s]);return n(()=>(window.addEventListener("editor:ai-generate-content-status",c),()=>{window.removeEventListener("editor:ai-generate-content-status",c)}),[c]),{isGenerating:a,onGenerate:r}};export{useListenEventGenerate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","PostPurchaseProductImages","Sticky","Heading"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];export{customRenderChildren,disableWrap,excludeApplyStyle,postPurchaseRequiredElements,postPurchaseWrapElements};
|
|
1
|
+
let disableWrap=["Col","CollectionBanner","Row","Section","Image","Text","Button","ProductButton","Cart","Tabs","TabItem","Carousel","CarouselItem","ShopPayButton","AccordionItem","Video","Header","HeroBanner","Icon","HTMLCode","IconListHoz","IconListItem","CSSCode","FormEmail","FormDropdown","SubmitButton","Dialog","TextField","FormTextarea","ProductPrice","Product","ProductImages","ProductImagesV2","PostPurchaseProductImages","Sticky","Heading","ProductBadge"],customRenderChildren=["Accordion","AccordionItem","Row","IconList","Tabs"],excludeApplyStyle=["IconListV2","IconList","ProductBadge"],postPurchaseRequiredElements=["PostPurchaseProductOffer","PostPurchaseProductTitle","PostPurchaseProductPrice","PostPurchaseAcceptButton","PostPurchaseButton","PostPurchaseCalloutBox","PostPurchaseProductPriceBreakdown","PostPurchaseProductImages","PostPurchaseCalloutText"],postPurchaseWrapElements=["Row","Section","PostPurchaseCalloutBox","PostPurchaseProductOffer"];export{customRenderChildren,disableWrap,excludeApplyStyle,postPurchaseRequiredElements,postPurchaseWrapElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as i,createContext as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as i,createContext as s,Suspense as d,Fragment as r}from"react";import{useStore as l,createStore as n}from"zustand";import{cloneDeep as a}from"../helpers/clone-deep.js";import{normalizeBuilderData as c}from"../helpers/normalize-builder-data.js";function moveByIndex(e,t,i){let s=e.splice(t,1)[0];void 0!==s&&e.splice(i,0,s)}function removeByKey(e,t){let i=t[e];i&&(delete t[e],"section"!==i.type&&i.childrens?.map(e=>removeByKey(e,t)))}let BuilderPreviewContext=s(null),root={uid:"ROOT",tag:"Root",label:"Root",childrens:[]},createBuilderPreviewProvider=(e,t)=>n((i,s)=>({state:e,loaded:!1,isThemeSectionEditor:!!t,dynamicProduct:null,dynamicCollection:null,addItem:e=>{let{position:t,data:d}=e,r=s().state,l=Date.now();if("section"===e.type){if(!Array.isArray(d)){let e=d.uid,s=r.ROOT;s.childrens?s.childrens.splice(t??0,0,e):s.childrens=[e],s.dateModified=l,i({state:{...r,[e]:{uid:e,type:"section",label:d.label},ROOT:a(s)}})}}else{let{id:s,data:d}=e,n=s?r[s]??r.ROOT:r.ROOT;if("section"===n.type)return;if(Array.isArray(d)){let e=d.map(e=>e.uid),s=d.reduceRight((e,t)=>{let i=c(t);return{...e,...i}},{});n.dateModified=l,n.childrens=n.childrens??[],n.childrens.splice(t??0,0,...e),i({state:{...r,...s,[n.uid]:a(n)}})}else{let e=c(d);n.dateModified=l,n.childrens=n.childrens??[],n.childrens.splice(t??0,0,d.uid),i({state:{...r,...e,[n.uid]:a(n)}})}}},changeItemProp:(e,t,d)=>{if(!d||!["setting","style","advanced"].includes(d))return;let r=s().state,l=r[e];if(l?.type!=="section"&&l){let s=Date.now();switch(l.dateModified=s,d){case"setting":i({state:{...r,[e]:{...l,settings:{...l.settings,...t}}}});break;case"style":i({state:{...r,[e]:{...l,styles:{...l.styles,...t}}}});break;case"advanced":i({state:{...r,[e]:{...l,advanced:{...l.advanced,...t}}}})}}},forceChangeItemProp:(e,t,d)=>{if(!d||!["setting","style","advanced"].includes(d))return;let r=s().state,l=r[e];if(l?.type!=="section"&&l){let s=Date.now();switch(l.dateModified=s,d){case"setting":i({state:{...r,[e]:{...l,settings:t}}});break;case"style":i({state:{...r,[e]:{...l,styles:t}}});break;case"advanced":i({state:{...r,[e]:{...l,advanced:t}}})}}},changeItemPropByKey:({id:e,key:t,data:d,group:r})=>{if(!r||!["setting","style","advanced"].includes(r))return;let l=s().state,n=l[e];if(n?.type!=="section"&&n){let s={style:n.styles??{},advanced:n.advanced??{},setting:n.settings??{}};void 0===d?(console.warn("Data is undefined"),delete s[r][t]):s[r][t]=d,i({state:{...l,[e]:{...n,settings:{...s.setting},styles:{...s.style},advanced:{...s.advanced}}}})}},getItem:e=>s().state[e],removeItem:e=>{if("ROOT"===e)i({state:{ROOT:root}});else{let t=s().state;removeByKey(e,t);let d=Object.entries(t).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(d){let s=Date.now(),[r,l]=d;if("section"===l.type)return;l.childrens=l.childrens?.filter(t=>t!==e),l.dateModified=s,i({state:{...t,[r]:a(l)}})}}},moveItem:(e,t,d)=>{let r=s().state,l=r[e],n=r[t];if(l&&n&&"section"!==n.type){if("section"===l.type){let t=r.ROOT;if(!t.childrens)return;let s=t.childrens.findIndex(t=>t===e);moveByIndex(t.childrens,s,d??0),i({state:{...r,ROOT:a(t)}})}else{let s=Object.entries(r).find(([,t])=>"section"!==t.type&&t.childrens?.includes(e));if(l&&s){let c=Date.now(),[,o]=s;if("section"===o.type)return;if(o.dateModified=c,t===o.uid&&o.childrens){let t=o.childrens.findIndex(t=>t===e);o.childrens&&t!==d&&(moveByIndex(o.childrens,t,d??0),i({state:{...r,[o.uid]:a(o)}}))}else o.childrens=o.childrens?.filter(t=>t!==e),n&&(n.dateModified=c,n.childrens=n.childrens??[],n.childrens.splice(d??0,0,l.uid),i({state:{...r,[n.uid]:a(n),[o.uid]:a(o)}}))}}}},forceChangeState:e=>{i({state:e,loaded:!0})},initState:e=>{if(Array.isArray(e)){let t=e.map(e=>e.uid),s=e.reduceRight((e,t)=>{let i=c(t);return{...e,...i}},{});i({loaded:!0,state:{ROOT:{...root,childrens:t},...s}})}else{let t=c(e);i({loaded:!0,state:{ROOT:{...root,childrens:[e.uid]},...t}})}},addSection:(e,t)=>{let d=s().state,r=d.ROOT;r.childrens||(r.childrens=[]),r.childrens.splice(t??0,0,e.uid),i({state:{...d,ROOT:a(r)}})},getParents:(e,t)=>{let i=s().state,d=[],r=0,l=e;for(;!t||!(r>=t);){let e=Object.entries(i).find(([,e])=>"section"!==e.type&&e.childrens?.includes(l));if(!e)break;let[,t]=e;if(!t)break;d.push(t),l=t.uid,r++}return d},updateItemName:(e,t)=>{let d=s().state,r=d[e];r&&(r.name=t,i({state:{...d,[e]:a(r)}}))},updateItemAttribute:(e,t,d)=>{if(!d||!["label","customLabel","isShopifyVisibility"].includes(d))return;let r=s().state,l=r[e];if(l){if("section"!==l.type){let e=Date.now();l.dateModified=e}let s={...l,[d]:t};i({state:{...r,[e]:s}})}}})),BuilderPreviewProvider=({children:i,state:s,isThemeSectionEditor:l,lazy:n,...a})=>{let c=n?d:r,o=t(()=>createBuilderPreviewProvider(s,l),[s,l]);return e(c,{children:e(BuilderPreviewContext.Provider,{...a,value:o,children:i})})},useBuilderPreviewStore=(e,t)=>{let s=i(BuilderPreviewContext);if(!s)throw Error("useBuilderPreviewStore must be used within a BuilderPreviewProvider");return l(s,e,t)};export{BuilderPreviewProvider,useBuilderPreviewStore};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6478,6 +6478,8 @@ type BlockEntity = {
|
|
|
6478
6478
|
isThemeSection?: boolean;
|
|
6479
6479
|
needPublishing?: boolean;
|
|
6480
6480
|
status?: ThemeSectionStatus$1;
|
|
6481
|
+
isShopifySection?: boolean;
|
|
6482
|
+
isShopifyVisibility?: boolean;
|
|
6481
6483
|
};
|
|
6482
6484
|
type SectionEntity = {
|
|
6483
6485
|
uid: string;
|
|
@@ -6488,6 +6490,8 @@ type SectionEntity = {
|
|
|
6488
6490
|
isThemeSection?: boolean;
|
|
6489
6491
|
status?: ThemeSectionStatus$1;
|
|
6490
6492
|
needPublishing?: boolean;
|
|
6493
|
+
isShopifySection?: boolean;
|
|
6494
|
+
isShopifyVisibility?: boolean;
|
|
6491
6495
|
};
|
|
6492
6496
|
type ThemeSectionStatus$1 = 'DRAFT' | 'PUBLISHED' | 'NEED_PUBLISHING';
|
|
6493
6497
|
type BuilderEntity = BlockEntity | SectionEntity;
|
|
@@ -6539,8 +6543,8 @@ type SaleFunnelDiscountEdge$1 = {
|
|
|
6539
6543
|
cursor: Scalars$1['Cursor'];
|
|
6540
6544
|
node?: Maybe$1<SaleFunnelDiscount$1>;
|
|
6541
6545
|
};
|
|
6542
|
-
type ProductOffer = Maybe$1<Pick<SaleFunnelDiscountEdge$1,
|
|
6543
|
-
node?: Maybe$1<Pick<SaleFunnelDiscount$1,
|
|
6546
|
+
type ProductOffer = Maybe$1<Pick<SaleFunnelDiscountEdge$1, 'cursor'> & {
|
|
6547
|
+
node?: Maybe$1<Pick<SaleFunnelDiscount$1, 'id' | 'value' | 'type' | 'position' | 'objectBaseID' | 'objectType' | 'title' | 'valueType' | 'isEnabled'>>;
|
|
6544
6548
|
}>;
|
|
6545
6549
|
|
|
6546
6550
|
type InitComponentType<T = any> = {
|
|
@@ -6959,6 +6963,7 @@ type PositionControlType<T> = SharedControlType<T> & {
|
|
|
6959
6963
|
|
|
6960
6964
|
type PositionSquareControlType<T> = SharedControlType<T> & {
|
|
6961
6965
|
type: 'position:square';
|
|
6966
|
+
ignoreValue?: string[];
|
|
6962
6967
|
};
|
|
6963
6968
|
|
|
6964
6969
|
type RadioGroupControlType = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.876",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@gem-sdk/adapter-shopify": "1.14.0-dev.619",
|
|
31
|
-
"@gem-sdk/styles": "
|
|
31
|
+
"@gem-sdk/styles": "2.0.0-dev.877",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|