@gem-sdk/core 1.14.0-dev.587 → 1.14.0-dev.589
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");const ComponentWrapperPreview=({children:e,...t})=>{if(react.useEffect(()=>{let e=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:t.uid}});window.dispatchEvent(e)},[t.uid]),useApplyAnimation.default({props:t}),"section"===t.type)return null;let o={};if("Section"===t.tag&&t.isThemeSection&&(o["data-theme-section"]=!0),t.editorConfigs){let e=t.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(o["data-placeholder-not-append-before-after"]=!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 n=composeAdvanceStyle.composeAdvanceStyle(t.advanced,t.tag),a=t.advanced,
|
|
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");const ComponentWrapperPreview=({children:e,...t})=>{if(react.useEffect(()=>{let e=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:t.uid}});window.dispatchEvent(e)},[t.uid]),useApplyAnimation.default({props:t}),"section"===t.type)return null;let o={};if("Section"===t.tag&&t.isThemeSection&&(o["data-theme-section"]=!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 n=composeAdvanceStyle.composeAdvanceStyle(t.advanced,t.tag),a=t.advanced,r={...o,"data-uid":t.uid,"data-component-type":"component","data-component-tag":t.tag,"data-component-label":t.label};return constant.disableWrap.includes(t.tag)&&react.isValidElement(e)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:a}),jsxRuntime.jsxs(e.type,{className:a?.cssClass,...e.props,style:n,builderAttrs:r,advanced:a,children:[e.props.children,jsxRuntime.jsx(ComponentToolbarPreview.ComponentToolbarPreview,{...t})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(RenderCustomCode.default,{uid:t.uid,advanced:a}),jsxRuntime.jsxs("div",{style:constant.excludeApplyStyle.includes(t.tag)?{"--mb":n?.["--mb"],"--mb-tablet":n?.["--mb-tablet"],"--mb-mobile":n?.["--mb-mobile"]}:n,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:n,advanced:a}),jsxRuntime.jsx(ComponentToolbarPreview.ComponentToolbarPreview,{...t})]})]})};exports.default=ComponentWrapperPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{useEffect as a,isValidElement as n}from"react";import{composeAdvanceStyle as d}from"../helpers/compose-advance-style.js";import{disableWrap as r,excludeApplyStyle as i}from"./constant.js";import p from"./RenderCustomCode.js";import{ComponentToolbarPreview as l}from"./ComponentToolbarPreview.js";import
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{useEffect as a,isValidElement as n}from"react";import{composeAdvanceStyle as d}from"../helpers/compose-advance-style.js";import{disableWrap as r,excludeApplyStyle as i}from"./constant.js";import p from"./RenderCustomCode.js";import{ComponentToolbarPreview as l}from"./ComponentToolbarPreview.js";import c from"../hooks/animation/useApplyAnimation.js";let ComponentWrapperPreview=({children:s,...m})=>{if(a(()=>{let e=new CustomEvent("editor:component:render",{bubbles:!0,detail:{componentUid:m.uid}});window.dispatchEvent(e)},[m.uid]),c({props:m}),"section"===m.type)return null;let b={};if("Section"===m.tag&&m.isThemeSection&&(b["data-theme-section"]=!0),m.editorConfigs){let e=m.editorConfigs;e.placeholder?.notAppendBeforeAfter&&(b["data-placeholder-not-append-before-after"]=!0),e.placeholder?.notAppendLeftRight&&(b["data-placeholder-not-append-left-right"]=!0),e.toolbar?.parent&&(b["data-toolbar-parent"]=!0),e.component?.noDelete&&(b["data-component-no-delete"]=!0),e.component?.noDuplicate&&(b["data-component-no-duplicate"]=!0),e.component?.noDragDrop&&(b["data-component-no-drag-drop"]=!0),e.component?.noSetting&&(b["data-component-no-setting"]=!0),e.component?.isThirdParty&&(b["data-component-is-third-party"]=!0),e.toolbar?.hide&&(b["data-toolbar-hide"]=!0),e.slots?.children&&(b["data-slots-children"]=!0),e.toolbar?.hide||(b["data-toolbar-wrap"]=!0)}m?.editorConfigs?.toolbar?.hide||(b["data-toolbar-wrap"]=!0);let h=d(m.advanced,m.tag),u=m.advanced,f={...b,"data-uid":m.uid,"data-component-type":"component","data-component-tag":m.tag,"data-component-label":m.label};return r.includes(m.tag)&&n(s)?e(t,{children:[o(p,{uid:m.uid,advanced:u}),e(s.type,{className:u?.cssClass,...s.props,style:h,builderAttrs:f,advanced:u,children:[s.props.children,o(l,{...m})]})]}):e(t,{children:[o(p,{uid:m.uid,advanced:u}),e("div",{style:i.includes(m.tag)?{"--mb":h?.["--mb"],"--mb-tablet":h?.["--mb-tablet"],"--mb-mobile":h?.["--mb-mobile"]}:h,className:`${m.uid} ${m.advanced?.cssClass?m.advanced?.cssClass:""}`,...f,children:[!i.includes(m.tag)&&s,n(s)&&i.includes(m.tag)&&o(s.type,{...s.props,style:h,advanced:u}),o(l,{...m})]})]})};export{ComponentWrapperPreview as default};
|
package/dist/types/index.d.ts
CHANGED