@gem-sdk/core 1.58.0-dev.13 → 1.58.0-dev.133
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/AddOn.js +1 -0
- package/dist/cjs/components/ComponentAnimation.js +1 -0
- package/dist/cjs/components/ComponentToolbarPreview.js +33 -19
- package/dist/cjs/components/ComponentWrapper.js +1 -0
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -0
- package/dist/cjs/components/Empty.js +1 -0
- package/dist/cjs/components/InteractionSuffix.js +2 -1
- package/dist/cjs/components/Render.js +1 -0
- package/dist/cjs/components/Render.liquid.js +14 -5
- package/dist/cjs/components/RenderBlock.js +1 -0
- package/dist/cjs/components/RenderCustomCode.js +1 -0
- package/dist/cjs/components/RenderPreview.js +1 -0
- package/dist/cjs/components/RenderSection.js +1 -0
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +2 -1
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +1 -0
- package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +1 -0
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +1 -0
- package/dist/cjs/components/ai-generator/icons/WarningIcon.js +1 -0
- package/dist/cjs/components/resize/Resize.js +1 -0
- package/dist/cjs/components/resize/Spacing.js +1 -0
- package/dist/cjs/components/theme-section/CreateThemeSection.js +2 -1
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +1 -0
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -0
- package/dist/cjs/components/toolbar/Tooltip.js +1 -0
- package/dist/cjs/contexts/AddonContext.js +1 -0
- package/dist/cjs/contexts/ArticleContext.js +1 -0
- package/dist/cjs/contexts/ArticleListContext.js +1 -0
- package/dist/cjs/contexts/BuilderComponent.js +1 -0
- package/dist/cjs/contexts/BuilderContext.js +1 -0
- package/dist/cjs/contexts/BuilderPreviewContext.js +1 -0
- package/dist/cjs/contexts/CartLineContext.js +1 -0
- package/dist/cjs/contexts/CollectionContext.js +1 -0
- package/dist/cjs/contexts/ModalContext.js +1 -0
- package/dist/cjs/contexts/PageContext.js +1 -0
- package/dist/cjs/contexts/ProductContext.js +17 -1
- package/dist/cjs/contexts/ProductListContext.js +1 -0
- package/dist/cjs/contexts/SectionContext.js +1 -0
- package/dist/cjs/contexts/ShopContext.js +1 -0
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +35 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -28
- package/dist/cjs/graphql/queries/articles.generated.js +1 -0
- package/dist/cjs/graphql/queries/preview-page.generated.js +9 -13
- package/dist/cjs/graphql/queries/shop-shopify.generated.js +11 -0
- package/dist/cjs/helpers/align.js +18 -0
- package/dist/cjs/helpers/backgroundImage.js +184 -0
- package/dist/cjs/helpers/compose-advance-style.js +53 -3
- package/dist/cjs/helpers/filter-toolbar-preview.js +1 -0
- package/dist/cjs/helpers/interaction/index.js +2 -1
- package/dist/cjs/helpers/is-empty-children.js +1 -0
- package/dist/cjs/helpers/layout.js +17 -0
- package/dist/cjs/helpers/prefetch-queries.js +5 -3
- package/dist/cjs/helpers/radius.js +3 -1
- package/dist/cjs/helpers/shadow.js +25 -0
- package/dist/cjs/helpers/size.js +30 -2
- package/dist/cjs/helpers/third-party/appConfig.js +63 -0
- package/dist/cjs/helpers/third-party/appSetting.js +339 -2
- package/dist/cjs/helpers/third-party/constant.js +10 -1
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +17 -1
- package/dist/cjs/helpers/typography.js +9 -1
- package/dist/cjs/hooks/animation/useAnimationActions.js +1 -0
- package/dist/cjs/hooks/animation/useAnimationConfig.js +1 -0
- package/dist/cjs/hooks/animation/useAnimationPreview.js +1 -0
- package/dist/cjs/hooks/animation/useAnimationTarget.js +1 -0
- package/dist/cjs/hooks/animation/useApplyAnimation.js +1 -0
- package/dist/cjs/hooks/articles/useArticlesQuery.js +1 -0
- package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -0
- package/dist/cjs/hooks/cart/use-cart-data.js +1 -0
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -0
- package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -0
- package/dist/cjs/hooks/cart/use-create-cart.js +1 -0
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -0
- package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -0
- package/dist/cjs/hooks/shop/use-collection-query.js +1 -0
- package/dist/cjs/hooks/shop/use-collections-query.js +1 -0
- package/dist/cjs/hooks/shop/use-product-query.js +1 -0
- package/dist/cjs/hooks/shop/use-products-query.js +1 -0
- package/dist/cjs/hooks/shop/useShopifyLink.js +47 -0
- package/dist/cjs/hooks/shop.js +10 -0
- package/dist/cjs/hooks/use-current-device.js +1 -0
- package/dist/cjs/hooks/use-lazy-video.js +1 -0
- package/dist/cjs/hooks/useAnimations.js +1 -0
- package/dist/cjs/hooks/useCartId.js +1 -0
- package/dist/cjs/hooks/useCartLine.js +1 -0
- package/dist/cjs/hooks/useCartUI.js +1 -0
- package/dist/cjs/hooks/useCollection.js +1 -0
- package/dist/cjs/hooks/useFetchHandle.js +1 -0
- package/dist/cjs/hooks/useFormatMoney.js +1 -0
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/cjs/hooks/useInteraction.js +1 -0
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -0
- package/dist/cjs/hooks/useLoadScript.js +1 -0
- package/dist/cjs/hooks/useMoney.js +1 -0
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/hooks/useProduct.js +28 -1
- package/dist/cjs/hooks/useProductList.js +1 -0
- package/dist/cjs/hooks/useSuspenseFetch.js +1 -0
- package/dist/cjs/hooks/useSwatchesOptions.js +1 -0
- package/dist/cjs/hooks/useToolbarPostPurchase.js +1 -0
- package/dist/cjs/index.js +28 -10
- package/dist/esm/components/AddOn.js +1 -0
- package/dist/esm/components/ComponentAnimation.js +1 -0
- package/dist/esm/components/ComponentToolbarPreview.js +33 -19
- package/dist/esm/components/ComponentWrapper.js +1 -0
- package/dist/esm/components/ComponentWrapperPreview.js +1 -0
- package/dist/esm/components/Empty.js +1 -0
- package/dist/esm/components/InteractionSuffix.js +2 -1
- package/dist/esm/components/Render.js +1 -0
- package/dist/esm/components/Render.liquid.js +14 -5
- package/dist/esm/components/RenderBlock.js +1 -0
- package/dist/esm/components/RenderCustomCode.js +1 -0
- package/dist/esm/components/RenderPreview.js +1 -0
- package/dist/esm/components/RenderSection.js +1 -0
- package/dist/esm/components/ai-generator/AIContentGenerator.js +2 -1
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +1 -0
- package/dist/esm/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -0
- package/dist/esm/components/ai-generator/icons/AIIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +1 -0
- package/dist/esm/components/ai-generator/icons/WarningIcon.js +1 -0
- package/dist/esm/components/resize/Resize.js +1 -0
- package/dist/esm/components/resize/Spacing.js +1 -0
- package/dist/esm/components/theme-section/CreateThemeSection.js +2 -1
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +1 -0
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -0
- package/dist/esm/components/toolbar/Tooltip.js +1 -0
- package/dist/esm/contexts/AddonContext.js +1 -0
- package/dist/esm/contexts/ArticleContext.js +1 -0
- package/dist/esm/contexts/ArticleListContext.js +1 -0
- package/dist/esm/contexts/BuilderComponent.js +1 -0
- package/dist/esm/contexts/BuilderContext.js +1 -0
- package/dist/esm/contexts/BuilderPreviewContext.js +1 -0
- package/dist/esm/contexts/CartLineContext.js +1 -0
- package/dist/esm/contexts/CollectionContext.js +1 -0
- package/dist/esm/contexts/ModalContext.js +1 -0
- package/dist/esm/contexts/PageContext.js +1 -0
- package/dist/esm/contexts/ProductContext.js +17 -1
- package/dist/esm/contexts/ProductListContext.js +1 -0
- package/dist/esm/contexts/SectionContext.js +1 -0
- package/dist/esm/contexts/ShopContext.js +1 -0
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +33 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +5 -28
- package/dist/esm/graphql/queries/articles.generated.js +1 -0
- package/dist/esm/graphql/queries/preview-page.generated.js +8 -12
- package/dist/esm/graphql/queries/shop-shopify.generated.js +9 -0
- package/dist/esm/helpers/align.js +18 -1
- package/dist/esm/helpers/backgroundImage.js +179 -0
- package/dist/esm/helpers/compose-advance-style.js +53 -3
- package/dist/esm/helpers/filter-toolbar-preview.js +1 -0
- package/dist/esm/helpers/interaction/index.js +2 -1
- package/dist/esm/helpers/is-empty-children.js +1 -0
- package/dist/esm/helpers/layout.js +17 -1
- package/dist/esm/helpers/prefetch-queries.js +5 -3
- package/dist/esm/helpers/radius.js +3 -1
- package/dist/esm/helpers/shadow.js +25 -1
- package/dist/esm/helpers/size.js +29 -3
- package/dist/esm/helpers/third-party/appConfig.js +55 -1
- package/dist/esm/helpers/third-party/appSetting.js +339 -2
- package/dist/esm/helpers/third-party/constant.js +11 -2
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +17 -1
- package/dist/esm/helpers/typography.js +9 -2
- package/dist/esm/hooks/animation/useAnimationActions.js +1 -0
- package/dist/esm/hooks/animation/useAnimationConfig.js +1 -0
- package/dist/esm/hooks/animation/useAnimationPreview.js +1 -0
- package/dist/esm/hooks/animation/useAnimationTarget.js +1 -0
- package/dist/esm/hooks/animation/useApplyAnimation.js +1 -0
- package/dist/esm/hooks/articles/useArticlesQuery.js +1 -0
- package/dist/esm/hooks/cart/use-add-to-cart.js +1 -0
- package/dist/esm/hooks/cart/use-cart-data.js +1 -0
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -0
- package/dist/esm/hooks/cart/use-cart-note-update.js +1 -0
- package/dist/esm/hooks/cart/use-create-cart.js +1 -0
- package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -0
- package/dist/esm/hooks/cart/use-update-cart-item.js +1 -0
- package/dist/esm/hooks/shop/use-collection-query.js +1 -0
- package/dist/esm/hooks/shop/use-collections-query.js +1 -0
- package/dist/esm/hooks/shop/use-product-query.js +1 -0
- package/dist/esm/hooks/shop/use-products-query.js +1 -0
- package/dist/esm/hooks/shop/useShopifyLink.js +45 -0
- package/dist/esm/hooks/shop.js +10 -1
- package/dist/esm/hooks/use-current-device.js +1 -0
- package/dist/esm/hooks/use-lazy-video.js +1 -0
- package/dist/esm/hooks/useAnimations.js +1 -0
- package/dist/esm/hooks/useCartId.js +1 -0
- package/dist/esm/hooks/useCartLine.js +1 -0
- package/dist/esm/hooks/useCartUI.js +1 -0
- package/dist/esm/hooks/useCollection.js +1 -0
- package/dist/esm/hooks/useFetchHandle.js +1 -0
- package/dist/esm/hooks/useFormatMoney.js +1 -0
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/esm/hooks/useInteraction.js +1 -0
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -0
- package/dist/esm/hooks/useLoadScript.js +1 -0
- package/dist/esm/hooks/useMoney.js +1 -0
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/hooks/useProduct.js +27 -2
- package/dist/esm/hooks/useProductList.js +1 -0
- package/dist/esm/hooks/useSuspenseFetch.js +1 -0
- package/dist/esm/hooks/useSwatchesOptions.js +1 -0
- package/dist/esm/hooks/useToolbarPostPurchase.js +1 -0
- package/dist/esm/index.js +14 -11
- package/dist/types/index.d.ts +825 -263
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -6,10 +7,10 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
7
|
var react = require('react');
|
|
7
8
|
require('zustand');
|
|
8
9
|
var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
|
|
9
|
-
var ShopContext = require('../contexts/ShopContext.js');
|
|
10
10
|
var PageContext = require('../contexts/PageContext.js');
|
|
11
|
-
require('
|
|
11
|
+
var ShopContext = require('../contexts/ShopContext.js');
|
|
12
12
|
require('swr');
|
|
13
|
+
require('@gem-sdk/adapter-shopify');
|
|
13
14
|
require('swr/mutation');
|
|
14
15
|
require('swr/infinite');
|
|
15
16
|
require('vanilla-lazyload');
|
|
@@ -36,7 +37,7 @@ const isSection = (el)=>{
|
|
|
36
37
|
};
|
|
37
38
|
const ComponentToolbarPreview = (props)=>{
|
|
38
39
|
const isThemeSection = props.isThemeSection;
|
|
39
|
-
const isShopifySection = props.isShopifySection;
|
|
40
|
+
const isShopifySection = !!props.isShopifySection;
|
|
40
41
|
const storefrontUrl = ShopContext.useShopStore((s)=>s.storefrontUrl);
|
|
41
42
|
const editingPageType = ShopContext.useShopStore((s)=>s.pageType);
|
|
42
43
|
const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
|
|
@@ -47,7 +48,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
47
48
|
const [isShowParentRevert, setIsShowParentRevert] = react.useState(false);
|
|
48
49
|
const [parents, setParents] = react.useState([]);
|
|
49
50
|
const [deleteTooltipPosition, setDeleteTooltipPosition] = react.useState('top');
|
|
50
|
-
const [
|
|
51
|
+
const [isDisableDeleteInSaleFunelPage, setIsDisableDeleteInSaleFunelPage] = react.useState(false);
|
|
51
52
|
const [isActiveToolbarComponent, setIsActiveToolbarComponent] = react.useState(false);
|
|
52
53
|
const [productId, setProductId] = react.useState('');
|
|
53
54
|
const [articleUid, setArticleUid] = react.useState('');
|
|
@@ -55,7 +56,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
55
56
|
width: '',
|
|
56
57
|
text: ''
|
|
57
58
|
});
|
|
58
|
-
const [
|
|
59
|
+
const [isDisableDuplicateInSaleFunnelPage, setIsDisableDuplicateInSaleFunnelPage] = react.useState(false);
|
|
59
60
|
const interactionData = PageContext.usePageStore((s)=>s.interactionData);
|
|
60
61
|
const isSaleFunnelPage = react.useMemo(()=>editingPageType === 'POST_PURCHASE', [
|
|
61
62
|
editingPageType
|
|
@@ -99,6 +100,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
102
|
};
|
|
103
|
+
const getSectionNumber = ()=>{
|
|
104
|
+
return root?.childrens?.length || 0;
|
|
105
|
+
};
|
|
102
106
|
const getDeleteTooltipPosition = react.useCallback(()=>{
|
|
103
107
|
if (props.tag == 'Section') return 'bottom';
|
|
104
108
|
const $toolbar = document.body.querySelector('#storefront')?.querySelector('[data-toolbar-active="true"]');
|
|
@@ -163,6 +167,20 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
163
167
|
isShowIconInteractionTarget,
|
|
164
168
|
isShowIconInteractionTrigger
|
|
165
169
|
]);
|
|
170
|
+
const isDisableDelete = react.useMemo(()=>{
|
|
171
|
+
return isDisableDeleteInSaleFunelPage || isShopifySection;
|
|
172
|
+
}, [
|
|
173
|
+
isDisableDeleteInSaleFunelPage,
|
|
174
|
+
isShopifySection
|
|
175
|
+
]);
|
|
176
|
+
const isDisableDuplicate = react.useMemo(()=>{
|
|
177
|
+
return isDisableDuplicateInSaleFunnelPage || isShopifySection || getSectionNumber() > SECTION_LIMIT && props.tag === 'Section';
|
|
178
|
+
}, [
|
|
179
|
+
getSectionNumber,
|
|
180
|
+
isDisableDuplicateInSaleFunnelPage,
|
|
181
|
+
isShopifySection,
|
|
182
|
+
props.tag
|
|
183
|
+
]);
|
|
166
184
|
// Get parents
|
|
167
185
|
const onActiveComponent = react.useCallback((e)=>{
|
|
168
186
|
const detail = e.detail;
|
|
@@ -176,9 +194,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
176
194
|
setIsActiveToolbarComponent(true);
|
|
177
195
|
getDeleteTooltipPosition();
|
|
178
196
|
if (isSaleFunnelPage) {
|
|
179
|
-
|
|
197
|
+
setIsDisableDeleteInSaleFunelPage(checkDisableDelete());
|
|
180
198
|
setTooltipText(getTooltipText());
|
|
181
|
-
|
|
199
|
+
setIsDisableDuplicateInSaleFunnelPage(checkDisableDuplicate());
|
|
182
200
|
}
|
|
183
201
|
const currentParents = getParents(props.uid).filter((parent)=>{
|
|
184
202
|
if (parent.uid === 'ROOT') return false;
|
|
@@ -218,9 +236,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
218
236
|
if (props.editorConfigs?.toolbar?.hide) {
|
|
219
237
|
return null;
|
|
220
238
|
}
|
|
221
|
-
const getSectionNumber = ()=>{
|
|
222
|
-
return root?.childrens?.length || 0;
|
|
223
|
-
};
|
|
224
239
|
const getIndexSection = ()=>{
|
|
225
240
|
if (props.tag !== 'Section') {
|
|
226
241
|
return -1;
|
|
@@ -288,9 +303,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
288
303
|
const onDuplicate = (e)=>{
|
|
289
304
|
e.preventDefault();
|
|
290
305
|
e.stopPropagation();
|
|
291
|
-
if (getSectionNumber() >= SECTION_LIMIT && props.tag == 'Section') {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
306
|
const event = new CustomEvent('editor:toolbar:duplicate-component', {
|
|
295
307
|
bubbles: true,
|
|
296
308
|
detail: {
|
|
@@ -448,7 +460,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
448
460
|
"data-toolbar-name": true,
|
|
449
461
|
children: [
|
|
450
462
|
getSectionName(),
|
|
451
|
-
isActiveToolbarComponent &&
|
|
463
|
+
isActiveToolbarComponent && isShopifySection && !props.isShopifyVisibility && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
452
464
|
"data-toolbar-visibility": true,
|
|
453
465
|
width: "20",
|
|
454
466
|
height: "20",
|
|
@@ -621,11 +633,12 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
621
633
|
})
|
|
622
634
|
}),
|
|
623
635
|
/*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
624
|
-
enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
|
|
625
|
-
text:
|
|
636
|
+
enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isShopifySection,
|
|
637
|
+
text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : 'Page has reached Shopify’s 25 section-limit',
|
|
626
638
|
position: "bottom",
|
|
639
|
+
width: "200px",
|
|
627
640
|
"data-toolbar-duplicate": true,
|
|
628
|
-
"data-toolbar-disable":
|
|
641
|
+
"data-toolbar-disable": isDisableDuplicate,
|
|
629
642
|
onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
|
|
630
643
|
"aria-hidden": "true",
|
|
631
644
|
className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
|
|
@@ -647,10 +660,11 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
647
660
|
onClick: (e)=>isDisableDelete ? null : onDelete(e),
|
|
648
661
|
enable: isDisableDelete,
|
|
649
662
|
"data-toolbar-disable": isDisableDelete,
|
|
663
|
+
text: isShopifySection ? 'Disabled. Please edit in Shopify Editor' : tooltipText.text,
|
|
650
664
|
width: tooltipText.width,
|
|
651
|
-
|
|
652
|
-
position: deleteTooltipPosition,
|
|
665
|
+
position: isShopifySection ? 'bottom' : deleteTooltipPosition,
|
|
653
666
|
"aria-hidden": "true",
|
|
667
|
+
className: isDisableDelete ? '!gp-cursor-not-allowed' : '',
|
|
654
668
|
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
655
669
|
width: "16",
|
|
656
670
|
height: "16",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
require('zustand');
|
|
5
6
|
require('react');
|
|
6
|
-
require('swr');
|
|
7
7
|
var PageContext = require('../contexts/PageContext.js');
|
|
8
|
+
require('swr');
|
|
8
9
|
require('@gem-sdk/adapter-shopify');
|
|
9
10
|
require('swr/mutation');
|
|
10
11
|
require('swr/infinite');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -35,7 +36,7 @@ const componentIconList = [
|
|
|
35
36
|
const componentUsingAdvanced = [
|
|
36
37
|
'IconList'
|
|
37
38
|
];
|
|
38
|
-
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
|
|
39
|
+
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, additionalSettings, ...passProps })=>{
|
|
39
40
|
const item = builder[uid];
|
|
40
41
|
const Component = components[item?.tag];
|
|
41
42
|
if (!Component) {
|
|
@@ -74,6 +75,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
74
75
|
advanced: item.advanced,
|
|
75
76
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
76
77
|
pageContext,
|
|
78
|
+
...additionalSettings,
|
|
77
79
|
...passProps,
|
|
78
80
|
builderAttrs: {
|
|
79
81
|
...passProps.builderAttrs
|
|
@@ -85,7 +87,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
85
87
|
builder,
|
|
86
88
|
components,
|
|
87
89
|
customProps,
|
|
88
|
-
pageContext
|
|
90
|
+
pageContext,
|
|
91
|
+
...additionalSettings
|
|
89
92
|
};
|
|
90
93
|
}),
|
|
91
94
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -97,7 +100,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
97
100
|
components,
|
|
98
101
|
customProps,
|
|
99
102
|
parentTag: item.tag,
|
|
100
|
-
pageContext
|
|
103
|
+
pageContext,
|
|
104
|
+
...additionalSettings
|
|
101
105
|
}))) : ''
|
|
102
106
|
});
|
|
103
107
|
}, ()=>{
|
|
@@ -113,6 +117,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
113
117
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
114
118
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
115
119
|
pageContext,
|
|
120
|
+
...additionalSettings,
|
|
116
121
|
...passProps,
|
|
117
122
|
builderAttrs: {
|
|
118
123
|
...passProps.builderAttrs
|
|
@@ -134,6 +139,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
134
139
|
cssClass: item?.advanced?.cssClass
|
|
135
140
|
},
|
|
136
141
|
pageContext,
|
|
142
|
+
...additionalSettings,
|
|
137
143
|
...passProps,
|
|
138
144
|
builderAttrs: {
|
|
139
145
|
...passProps.builderAttrs
|
|
@@ -145,7 +151,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
145
151
|
builder,
|
|
146
152
|
components,
|
|
147
153
|
customProps,
|
|
148
|
-
pageContext
|
|
154
|
+
pageContext,
|
|
155
|
+
...additionalSettings
|
|
149
156
|
};
|
|
150
157
|
}),
|
|
151
158
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -157,7 +164,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
157
164
|
components,
|
|
158
165
|
customProps,
|
|
159
166
|
parentTag: item.tag,
|
|
160
|
-
pageContext
|
|
167
|
+
pageContext,
|
|
168
|
+
...additionalSettings
|
|
161
169
|
}))) : ''
|
|
162
170
|
});
|
|
163
171
|
}, ()=>{
|
|
@@ -172,6 +180,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
172
180
|
cssClass: item?.advanced?.cssClass
|
|
173
181
|
},
|
|
174
182
|
pageContext,
|
|
183
|
+
...additionalSettings,
|
|
175
184
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
176
185
|
style: componentIconList.includes(item.tag) ? style : null,
|
|
177
186
|
...passProps,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -16,8 +17,8 @@ var useFlipPopup = require('./hooks/useFlipPopup.js');
|
|
|
16
17
|
var useCheckingProductInside = require('./hooks/useCheckingProductInside.js');
|
|
17
18
|
require('zustand');
|
|
18
19
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
19
|
-
require('@gem-sdk/adapter-shopify');
|
|
20
20
|
require('swr');
|
|
21
|
+
require('@gem-sdk/adapter-shopify');
|
|
21
22
|
require('swr/mutation');
|
|
22
23
|
require('swr/infinite');
|
|
23
24
|
require('vanilla-lazyload');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -5,8 +6,8 @@ var react = require('react');
|
|
|
5
6
|
var ThemeSectionTooltip = require('./ThemeSectionTooltip.js');
|
|
6
7
|
require('zustand');
|
|
7
8
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
8
|
-
require('@gem-sdk/adapter-shopify');
|
|
9
9
|
require('swr');
|
|
10
|
+
require('@gem-sdk/adapter-shopify');
|
|
10
11
|
require('swr/mutation');
|
|
11
12
|
require('swr/infinite');
|
|
12
13
|
require('vanilla-lazyload');
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var zustand = require('zustand');
|
|
5
5
|
var react = require('react');
|
|
6
|
+
var zustand = require('zustand');
|
|
6
7
|
var flattenConnection = require('../helpers/flatten-connection.js');
|
|
7
8
|
var variant = require('../helpers/variant.js');
|
|
8
9
|
|
|
@@ -25,6 +26,21 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
},
|
|
29
|
+
setUseProductCompareAtPrice: (value)=>{
|
|
30
|
+
set({
|
|
31
|
+
useProductCompareAtPrice: value
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
setShouldRequireUploadMessage: (value)=>{
|
|
35
|
+
set({
|
|
36
|
+
shouldRequireUploadMessage: value
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
setRequireUpload: (value)=>{
|
|
40
|
+
set({
|
|
41
|
+
requireUpload: value
|
|
42
|
+
});
|
|
43
|
+
},
|
|
28
44
|
addProperty: (data)=>{
|
|
29
45
|
const properties = get().properties;
|
|
30
46
|
if (!properties?.some((v)=>v.key === data.key)) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable */ const PreviewThemePageSelect = `
|
|
4
|
+
fragment PreviewThemePageSelect on PreviewThemePage {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
handle
|
|
8
|
+
isMobile
|
|
9
|
+
sectionPosition
|
|
10
|
+
pageSections {
|
|
11
|
+
cid
|
|
12
|
+
component
|
|
13
|
+
id
|
|
14
|
+
}
|
|
15
|
+
dataSEO {
|
|
16
|
+
...DataSEOSelect
|
|
17
|
+
}
|
|
18
|
+
themeStyle {
|
|
19
|
+
id
|
|
20
|
+
data
|
|
21
|
+
name
|
|
22
|
+
}
|
|
23
|
+
analytic {
|
|
24
|
+
...AnalyticSelect
|
|
25
|
+
}
|
|
26
|
+
customCode {
|
|
27
|
+
...CustomCodeSelect
|
|
28
|
+
}
|
|
29
|
+
customFonts {
|
|
30
|
+
...CustomFontSelect
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports.PreviewThemePageSelect = PreviewThemePageSelect;
|
|
@@ -32,35 +32,11 @@
|
|
|
32
32
|
id
|
|
33
33
|
value
|
|
34
34
|
}
|
|
35
|
+
metafields {
|
|
36
|
+
key
|
|
37
|
+
value
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
`;
|
|
37
|
-
const PreviewThemePageSelect = `
|
|
38
|
-
fragment PreviewThemePageSelect on PublishedThemePage {
|
|
39
|
-
id
|
|
40
|
-
name
|
|
41
|
-
handle
|
|
42
|
-
isMobile
|
|
43
|
-
sectionPosition
|
|
44
|
-
pageSections {
|
|
45
|
-
...PublishedPageSectionSelect
|
|
46
|
-
}
|
|
47
|
-
themePageCustomSections {
|
|
48
|
-
...PublishedCustomSectionSelect
|
|
49
|
-
}
|
|
50
|
-
themePageDataSEO {
|
|
51
|
-
...DataSEOSelect
|
|
52
|
-
}
|
|
53
|
-
pageStyle {
|
|
54
|
-
...PublishedThemeStyleSelect
|
|
55
|
-
}
|
|
56
|
-
themePageAnalytic {
|
|
57
|
-
...AnalyticSelect
|
|
58
|
-
}
|
|
59
|
-
themePageCustomCode {
|
|
60
|
-
...CustomCodeSelect
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
41
|
|
|
65
|
-
exports.PreviewThemePageSelect = PreviewThemePageSelect;
|
|
66
42
|
exports.PublishedThemePageSelect = PublishedThemePageSelect;
|