@gem-sdk/core 1.14.0-dev.732 → 1.14.0-dev.733
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.
|
@@ -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"),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 o=shop.usePageType();if("section"===t.type)return null;let n={};if("Section"===t.tag&&t.isThemeSection&&(n["data-theme-section"]=!0),t.editorConfigs){let e=t.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(n["data-placeholder-not-append-before-after"]=!0),e.placeholder?.notAppendLeftRight&&(n["data-placeholder-not-append-left-right"]=!0),e.toolbar?.parent&&(n["data-toolbar-parent"]=!0),e.component?.noDelete&&(n["data-component-no-delete"]=!0),e.component?.noDuplicate&&(n["data-component-no-duplicate"]=!0),e.component?.noDragDrop&&(n["data-component-no-drag-drop"]=!0),e.component?.noSetting&&(n["data-component-no-setting"]=!0),e.component?.isThirdParty&&(n["data-component-is-third-party"]=!0),e.toolbar?.hide&&(n["data-toolbar-hide"]=!0),e.slots?.children&&(n["data-slots-children"]=!0),e.toolbar?.hide||(n["data-toolbar-wrap"]=!0)}t?.editorConfigs?.toolbar?.hide||(n["data-toolbar-wrap"]=!0);let a=composeAdvanceStyle.composeAdvanceStyle(t.advanced,t.tag,o),
|
|
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"),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 o=shop.usePageType();if("section"===t.type)return null;let n={};if("Section"===t.tag&&t.isThemeSection&&(n["data-theme-section"]=!0),t.editorConfigs){let e=t.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(n["data-placeholder-not-append-before-after"]=!0),e.placeholder?.notAppendLeftRight&&(n["data-placeholder-not-append-left-right"]=!0),e.toolbar?.parent&&(n["data-toolbar-parent"]=!0),e.component?.noDelete&&(n["data-component-no-delete"]=!0),e.component?.noDuplicate&&(n["data-component-no-duplicate"]=!0),e.component?.noDragDrop&&(n["data-component-no-drag-drop"]=!0),e.component?.noSetting&&(n["data-component-no-setting"]=!0),e.component?.isThirdParty&&(n["data-component-is-third-party"]=!0),e.toolbar?.hide&&(n["data-toolbar-hide"]=!0),e.slots?.children&&(n["data-slots-children"]=!0),e.toolbar?.hide||(n["data-toolbar-wrap"]=!0)}t?.editorConfigs?.toolbar?.hide||(n["data-toolbar-wrap"]=!0);let a=e=>"GP_FUNNEL_PAGE"===o&&["ProductList","Header"].includes(e),r=composeAdvanceStyle.composeAdvanceStyle(t.advanced,t.tag,o),s=t.advanced,i={...n,"data-uid":t.uid,"data-component-type":"component","data-component-tag":t.tag,"data-component-label":t.label,"data-not-droppable":a(t.tag)};return constant.disableWrap.includes(t.tag)&&react.isValidElement(e)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:s}),jsxRuntime.jsxs(e.type,{className:s?.cssClass,...e.props,style:r,builderAttrs:i,advanced:s,children:[e.props.children,jsxRuntime.jsx(ComponentToolbarPreview.ComponentToolbarPreview,{...t})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:s}),jsxRuntime.jsxs("div",{style:constant.excludeApplyStyle.includes(t.tag)?{"--mb":r?.["--mb"],"--mb-tablet":r?.["--mb-tablet"],"--mb-mobile":r?.["--mb-mobile"]}:r,className:`${t.uid} ${t.advanced?.cssClass?t.advanced?.cssClass:""}`,...i,children:[!constant.excludeApplyStyle.includes(t.tag)&&e,react.isValidElement(e)&&constant.excludeApplyStyle.includes(t.tag)&&jsxRuntime.jsx(e.type,{...e.props,style:r,advanced:s}),jsxRuntime.jsx(ComponentToolbarPreview.ComponentToolbarPreview,{...t})]})]})};exports.default=ComponentWrapperPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useEffect as a,isValidElement as n}from"react";import{composeAdvanceStyle as r}from"../helpers/compose-advance-style.js";import{disableWrap as d,excludeApplyStyle as i}from"./constant.js";import p from"./RenderCustomCode.js";import{ComponentToolbarPreview as l}from"./ComponentToolbarPreview.js";import s from"../hooks/animation/useApplyAnimation.js";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import{usePageType as m}from"../hooks/shop.js";import"vanilla-lazyload";import"../hooks/useCartUI.js";import"../helpers/convert.js";let ComponentWrapperPreview=({children:c,...h})=>{a(()=>{let t=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:h.uid}});window.dispatchEvent(t)},[h.uid]),s({props:h});let u=m();if("section"===h.type)return null;let b={};if("Section"===h.tag&&h.isThemeSection&&(b["data-theme-section"]=!0),h.editorConfigs){let t=h.editorConfigs;t.placeholder?.notAppendBeforeAfter&&(b["data-placeholder-not-append-before-after"]=!0),t.placeholder?.notAppendLeftRight&&(b["data-placeholder-not-append-left-right"]=!0),t.toolbar?.parent&&(b["data-toolbar-parent"]=!0),t.component?.noDelete&&(b["data-component-no-delete"]=!0),t.component?.noDuplicate&&(b["data-component-no-duplicate"]=!0),t.component?.noDragDrop&&(b["data-component-no-drag-drop"]=!0),t.component?.noSetting&&(b["data-component-no-setting"]=!0),t.component?.isThirdParty&&(b["data-component-is-third-party"]=!0),t.toolbar?.hide&&(b["data-toolbar-hide"]=!0),t.slots?.children&&(b["data-slots-children"]=!0),t.toolbar?.hide||(b["data-toolbar-wrap"]=!0)}h?.editorConfigs?.toolbar?.hide||(b["data-toolbar-wrap"]=!0);let f=t=>"GP_FUNNEL_PAGE"===u&&["ProductList","Header"].includes(t),g=r(h.advanced,h.tag,u),v=h.advanced,C={...b,"data-uid":h.uid,"data-component-type":"component","data-component-tag":h.tag,"data-component-label":h.label,"data-not-droppable":f(h.tag)};return d.includes(h.tag)&&n(c)?t(e,{children:[o(p,{uid:h.uid,advanced:v}),t(c.type,{className:v?.cssClass,...c.props,style:g,builderAttrs:C,advanced:v,children:[c.props.children,o(l,{...h})]})]}):t(e,{children:[o(p,{uid:h.uid,advanced:v}),t("div",{style:i.includes(h.tag)?{"--mb":g?.["--mb"],"--mb-tablet":g?.["--mb-tablet"],"--mb-mobile":g?.["--mb-mobile"]}:g,className:`${h.uid} ${h.advanced?.cssClass?h.advanced?.cssClass:""}`,...C,children:[!i.includes(h.tag)&&c,n(c)&&i.includes(h.tag)&&o(c.type,{...c.props,style:g,advanced:v}),o(l,{...h})]})]})};export{ComponentWrapperPreview as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.14.0-dev.
|
|
3
|
+
"version": "1.14.0-dev.733",
|
|
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": "1.14.0-dev.
|
|
31
|
+
"@gem-sdk/styles": "1.14.0-dev.733"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"react-error-boundary": "4.0.10",
|