@gem-sdk/core 2.0.0-staging.165 → 2.0.0-staging.709
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 +7 -8
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -0
- package/dist/cjs/components/InteractionSuffix.js +1 -0
- package/dist/cjs/components/Render.js +1 -0
- package/dist/cjs/components/Render.liquid.js +9 -9
- package/dist/cjs/components/RenderCustomCode.js +1 -0
- package/dist/cjs/components/RenderPreview.js +1 -0
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +4 -1
- package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/cjs/components/constant.js +7 -3
- package/dist/cjs/components/resize/Spacing.js +1 -0
- package/dist/cjs/components/src/product/helpers/variant-presets.js +540 -27
- package/dist/cjs/components/theme-section/CreateThemeSection.js +5 -7
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +4 -9
- package/dist/cjs/constants/device.js +9 -0
- package/dist/cjs/contexts/BuilderPreviewContext.js +3 -0
- package/dist/cjs/contexts/I18nContext.js +36 -0
- package/dist/cjs/contexts/ProductContext.js +17 -1
- package/dist/cjs/contexts/ShopContext.js +5 -5
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +4 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +2 -11
- package/dist/cjs/graphql/queries/articles.generated.js +5 -4
- package/dist/cjs/graphql/queries/blogs.generated.js +6 -4
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +2 -8
- package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +5 -0
- package/dist/cjs/helpers/align.js +18 -0
- package/dist/cjs/helpers/background.js +55 -2
- package/dist/cjs/helpers/backgroundImage.js +133 -0
- package/dist/cjs/helpers/borders.js +86 -4
- package/dist/cjs/helpers/colors.js +2 -2
- package/dist/cjs/helpers/compose-advance-style.js +79 -0
- package/dist/cjs/helpers/composeClasses.js +13 -0
- package/dist/cjs/helpers/filter-truthy-styles.js +7 -0
- package/dist/cjs/helpers/interaction/index.js +1 -0
- package/dist/cjs/helpers/is-safari.js +4 -1
- package/dist/cjs/helpers/layout.js +17 -0
- package/dist/cjs/helpers/make-style.js +32 -0
- package/dist/cjs/helpers/radius.js +26 -14
- package/dist/cjs/helpers/render.js +2 -2
- package/dist/cjs/helpers/shadow.js +48 -2
- package/dist/cjs/helpers/size.js +44 -0
- package/dist/cjs/helpers/third-party/appConfig.js +92 -1
- package/dist/cjs/helpers/third-party/appSetting.js +217 -4
- package/dist/cjs/helpers/third-party/constant.js +14 -1
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +6 -2
- package/dist/cjs/helpers/typography.js +23 -2
- package/dist/cjs/hooks/useAnimations.js +1 -0
- package/dist/cjs/hooks/useI18n.js +30 -0
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/cjs/hooks/useLoadScript.js +1 -1
- package/dist/cjs/hooks/useProduct.js +7 -1
- package/dist/cjs/hooks/useStickyStore.js +12 -0
- package/dist/cjs/index.js +38 -0
- package/dist/esm/components/ComponentToolbarPreview.js +7 -8
- package/dist/esm/components/ComponentWrapperPreview.js +1 -0
- package/dist/esm/components/InteractionSuffix.js +1 -0
- package/dist/esm/components/Render.js +1 -0
- package/dist/esm/components/Render.liquid.js +9 -9
- package/dist/esm/components/RenderCustomCode.js +1 -0
- package/dist/esm/components/RenderPreview.js +1 -0
- package/dist/esm/components/ai-generator/AIContentGenerator.js +4 -1
- package/dist/esm/components/ai-generator/components/PickProduct.js +1 -0
- package/dist/esm/components/constant.js +7 -3
- package/dist/esm/components/resize/Spacing.js +1 -0
- package/dist/esm/components/src/product/helpers/variant-presets.js +540 -27
- package/dist/esm/components/theme-section/CreateThemeSection.js +5 -7
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +5 -10
- package/dist/esm/constants/device.js +7 -0
- package/dist/esm/contexts/BuilderPreviewContext.js +3 -0
- package/dist/esm/contexts/I18nContext.js +33 -0
- package/dist/esm/contexts/ProductContext.js +17 -1
- package/dist/esm/contexts/ShopContext.js +5 -5
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +4 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +2 -11
- package/dist/esm/graphql/queries/articles.generated.js +5 -4
- package/dist/esm/graphql/queries/blogs.generated.js +6 -4
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +2 -8
- package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +5 -0
- package/dist/esm/helpers/align.js +18 -1
- package/dist/esm/helpers/background.js +54 -3
- package/dist/esm/helpers/backgroundImage.js +128 -0
- package/dist/esm/helpers/borders.js +84 -5
- package/dist/esm/helpers/colors.js +2 -2
- package/dist/esm/helpers/compose-advance-style.js +79 -1
- package/dist/esm/helpers/composeClasses.js +11 -0
- package/dist/esm/helpers/filter-truthy-styles.js +5 -0
- package/dist/esm/helpers/interaction/index.js +1 -0
- package/dist/esm/helpers/is-safari.js +4 -1
- package/dist/esm/helpers/layout.js +17 -1
- package/dist/esm/helpers/make-style.js +31 -1
- package/dist/esm/helpers/radius.js +26 -14
- package/dist/esm/helpers/render.js +2 -2
- package/dist/esm/helpers/shadow.js +47 -3
- package/dist/esm/helpers/size.js +42 -1
- package/dist/esm/helpers/third-party/appConfig.js +80 -2
- package/dist/esm/helpers/third-party/appSetting.js +217 -4
- package/dist/esm/helpers/third-party/constant.js +15 -2
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +6 -2
- package/dist/esm/helpers/typography.js +23 -3
- package/dist/esm/hooks/useAnimations.js +1 -0
- package/dist/esm/hooks/useI18n.js +28 -0
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/esm/hooks/useLoadScript.js +1 -1
- package/dist/esm/hooks/useProduct.js +7 -1
- package/dist/esm/hooks/useStickyStore.js +10 -0
- package/dist/esm/index.js +18 -9
- package/dist/types/index.d.ts +11860 -8943
- package/package.json +3 -3
|
@@ -25,6 +25,7 @@ require('swr/mutation');
|
|
|
25
25
|
require('swr/infinite');
|
|
26
26
|
require('vanilla-lazyload');
|
|
27
27
|
require('../hooks/useCartUI.js');
|
|
28
|
+
require('../hooks/useStickyStore.js');
|
|
28
29
|
|
|
29
30
|
const SECTION_LIMIT = 25;
|
|
30
31
|
const notVisible = (el)=>{
|
|
@@ -137,7 +138,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
137
138
|
productId
|
|
138
139
|
]);
|
|
139
140
|
const linkEditArticle = react.useMemo(()=>{
|
|
140
|
-
return articleUid ? `${linkShopDefault}/articles/${articleUid}` : '';
|
|
141
|
+
return articleUid ? `${linkShopDefault}/articles/${articleUid.replace('gid://shopify/Article/', '')}` : '';
|
|
141
142
|
}, [
|
|
142
143
|
articleUid,
|
|
143
144
|
linkShopDefault
|
|
@@ -247,6 +248,10 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
247
248
|
}
|
|
248
249
|
return -1;
|
|
249
250
|
};
|
|
251
|
+
const getToolbarParentLabel = (parent)=>{
|
|
252
|
+
const parentLength = parent?.childrens?.length ?? 0;
|
|
253
|
+
return parent.label === 'Row' ? `Row ${parentLength} col${parentLength === 1 ? '' : 's'}` : parent.label;
|
|
254
|
+
};
|
|
250
255
|
const onShowParent = (e)=>{
|
|
251
256
|
if (!parents.length) return;
|
|
252
257
|
const $target = (e?.target) || null;
|
|
@@ -512,12 +517,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
512
517
|
]
|
|
513
518
|
}),
|
|
514
519
|
isActiveToolbarComponent && isShowParent && parents.map((parent, index)=>{
|
|
515
|
-
// Update count columns of Row
|
|
516
|
-
const parentLength = parent?.childrens?.length ?? 0;
|
|
517
|
-
let parent_label = parent.label;
|
|
518
|
-
if (parent.label === 'Row') {
|
|
519
|
-
parent_label = parentLength <= 1 ? parent.label + ' ' + parentLength + ' col' : parent.label + ' ' + parentLength + ' cols';
|
|
520
|
-
}
|
|
521
520
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
522
521
|
"data-toolbar-parent": true,
|
|
523
522
|
"data-component-tag": parent.tag,
|
|
@@ -566,7 +565,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
566
565
|
}),
|
|
567
566
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
568
567
|
"data-toolbar-name": true,
|
|
569
|
-
children:
|
|
568
|
+
children: getToolbarParentLabel(parent)
|
|
570
569
|
})
|
|
571
570
|
]
|
|
572
571
|
}, parent.uid);
|
|
@@ -20,6 +20,7 @@ var shop = require('../hooks/shop.js');
|
|
|
20
20
|
require('swr/infinite');
|
|
21
21
|
require('vanilla-lazyload');
|
|
22
22
|
require('../hooks/useCartUI.js');
|
|
23
|
+
require('../hooks/useStickyStore.js');
|
|
23
24
|
var ComponentAnimation = require('./ComponentAnimation.js');
|
|
24
25
|
|
|
25
26
|
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
@@ -17,6 +17,7 @@ require('@gem-sdk/adapter-shopify');
|
|
|
17
17
|
require('swr/mutation');
|
|
18
18
|
require('vanilla-lazyload');
|
|
19
19
|
require('../hooks/useCartUI.js');
|
|
20
|
+
require('../hooks/useStickyStore.js');
|
|
20
21
|
|
|
21
22
|
const InteractionSuffix = ({ uid })=>{
|
|
22
23
|
const { closeSelectOnPage, selectInteractionElement } = index.useInteraction();
|
|
@@ -54,6 +54,7 @@ const Render = ({ uid, ...passProps })=>{
|
|
|
54
54
|
setting: item.settings,
|
|
55
55
|
...passProps,
|
|
56
56
|
children: item.childrens.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(RenderMemo, {
|
|
57
|
+
parentStyle: passProps?.['parentStyle'],
|
|
57
58
|
uid: id
|
|
58
59
|
}, id))
|
|
59
60
|
}) : /*#__PURE__*/ jsxRuntime.jsx(Component, {
|
|
@@ -13,6 +13,7 @@ require('swr/mutation');
|
|
|
13
13
|
require('swr/infinite');
|
|
14
14
|
require('vanilla-lazyload');
|
|
15
15
|
require('../hooks/useCartUI.js');
|
|
16
|
+
require('../hooks/useStickyStore.js');
|
|
16
17
|
require('react-transition-group');
|
|
17
18
|
require('@gem-sdk/core');
|
|
18
19
|
var constant = require('./constant.js');
|
|
@@ -37,7 +38,7 @@ const componentUsingAdvanced = [
|
|
|
37
38
|
'IconList',
|
|
38
39
|
'ProductVariants'
|
|
39
40
|
];
|
|
40
|
-
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext,
|
|
41
|
+
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, additionalSettings, ...passProps })=>{
|
|
41
42
|
const item = builder[uid];
|
|
42
43
|
const Component = components[item?.tag];
|
|
43
44
|
if (!Component) {
|
|
@@ -76,7 +77,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
76
77
|
advanced: item.advanced,
|
|
77
78
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
78
79
|
pageContext,
|
|
79
|
-
|
|
80
|
+
...additionalSettings,
|
|
80
81
|
...passProps,
|
|
81
82
|
builderAttrs: {
|
|
82
83
|
...passProps.builderAttrs
|
|
@@ -89,7 +90,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
89
90
|
components,
|
|
90
91
|
customProps,
|
|
91
92
|
pageContext,
|
|
92
|
-
|
|
93
|
+
...additionalSettings
|
|
93
94
|
};
|
|
94
95
|
}),
|
|
95
96
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -102,7 +103,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
102
103
|
customProps,
|
|
103
104
|
parentTag: item.tag,
|
|
104
105
|
pageContext,
|
|
105
|
-
|
|
106
|
+
...additionalSettings
|
|
106
107
|
}))) : ''
|
|
107
108
|
});
|
|
108
109
|
}, ()=>{
|
|
@@ -118,7 +119,6 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
118
119
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
119
120
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
120
121
|
pageContext,
|
|
121
|
-
enableLazyloadImage,
|
|
122
122
|
...passProps,
|
|
123
123
|
builderAttrs: {
|
|
124
124
|
...passProps.builderAttrs
|
|
@@ -140,7 +140,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
140
140
|
cssClass: item?.advanced?.cssClass
|
|
141
141
|
},
|
|
142
142
|
pageContext,
|
|
143
|
-
|
|
143
|
+
...additionalSettings,
|
|
144
144
|
...passProps,
|
|
145
145
|
builderAttrs: {
|
|
146
146
|
...passProps.builderAttrs
|
|
@@ -153,7 +153,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
153
153
|
components,
|
|
154
154
|
customProps,
|
|
155
155
|
pageContext,
|
|
156
|
-
|
|
156
|
+
...additionalSettings
|
|
157
157
|
};
|
|
158
158
|
}),
|
|
159
159
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -166,7 +166,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
166
166
|
customProps,
|
|
167
167
|
parentTag: item.tag,
|
|
168
168
|
pageContext,
|
|
169
|
-
|
|
169
|
+
...additionalSettings
|
|
170
170
|
}))) : ''
|
|
171
171
|
});
|
|
172
172
|
}, ()=>{
|
|
@@ -182,7 +182,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
182
182
|
cssClass: item?.advanced?.cssClass
|
|
183
183
|
},
|
|
184
184
|
pageContext,
|
|
185
|
-
|
|
185
|
+
...additionalSettings,
|
|
186
186
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
187
187
|
style: componentIconList.includes(item.tag) ? style : null,
|
|
188
188
|
...passProps,
|
|
@@ -20,6 +20,7 @@ require('@gem-sdk/adapter-shopify');
|
|
|
20
20
|
require('swr/mutation');
|
|
21
21
|
require('vanilla-lazyload');
|
|
22
22
|
require('../hooks/useCartUI.js');
|
|
23
|
+
require('../hooks/useStickyStore.js');
|
|
23
24
|
|
|
24
25
|
const RenderCustomCode = ({ uid, advanced })=>{
|
|
25
26
|
const mode = shop.useEditorMode();
|
|
@@ -46,6 +46,7 @@ const RenderPreview = ({ uid, ...passProps })=>{
|
|
|
46
46
|
setting: item.settings,
|
|
47
47
|
...passProps,
|
|
48
48
|
children: item.childrens.map((id)=>/*#__PURE__*/ jsxRuntime.jsx(RenderPreviewMemo, {
|
|
49
|
+
parentStyle: passProps?.['parentStyle'],
|
|
49
50
|
"bundle-item": passProps?.['bundle-item'],
|
|
50
51
|
uid: id
|
|
51
52
|
}, id))
|
|
@@ -16,6 +16,7 @@ var useGettingGenerateRequest = require('./hooks/useGettingGenerateRequest.js');
|
|
|
16
16
|
var useFlipPopup = require('./hooks/useFlipPopup.js');
|
|
17
17
|
var useCheckingProductInside = require('./hooks/useCheckingProductInside.js');
|
|
18
18
|
require('zustand');
|
|
19
|
+
var I18nContext = require('../../contexts/I18nContext.js');
|
|
19
20
|
require('react-transition-group');
|
|
20
21
|
require('@gem-sdk/core');
|
|
21
22
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
@@ -27,6 +28,7 @@ require('swr/mutation');
|
|
|
27
28
|
require('swr/infinite');
|
|
28
29
|
require('vanilla-lazyload');
|
|
29
30
|
require('../../hooks/useCartUI.js');
|
|
31
|
+
require('../../hooks/useStickyStore.js');
|
|
30
32
|
|
|
31
33
|
const AIContentGenerator = ({ ...props })=>{
|
|
32
34
|
const [isShowPopup, setIsShowPopup] = react.useState(false);
|
|
@@ -36,6 +38,7 @@ const AIContentGenerator = ({ ...props })=>{
|
|
|
36
38
|
const genPopupHeader = react.useRef(null);
|
|
37
39
|
const genButtonWrapper = react.useRef(null);
|
|
38
40
|
const nextMonth = dayjs().add(1, 'month').startOf('month').format('DD MMM');
|
|
41
|
+
const { t } = I18nContext.useI18nStore();
|
|
39
42
|
const { popupPositionX, popupPositionY, isValidating: isValidatingFlipPopup, bodyMaxHeight: popupBodyMaxHeight } = useFlipPopup.useFlipPopup(isShowPopup, {
|
|
40
43
|
genTool,
|
|
41
44
|
genPopup,
|
|
@@ -117,7 +120,7 @@ const AIContentGenerator = ({ ...props })=>{
|
|
|
117
120
|
onClick: togglePopup,
|
|
118
121
|
children: [
|
|
119
122
|
/*#__PURE__*/ jsxRuntime.jsx(AIIcon.AIIcon, {}),
|
|
120
|
-
|
|
123
|
+
t('AI Content')
|
|
121
124
|
]
|
|
122
125
|
})
|
|
123
126
|
}),
|
|
@@ -17,6 +17,7 @@ require('swr/mutation');
|
|
|
17
17
|
var useProductQuery = require('../../../hooks/shop/use-product-query.js');
|
|
18
18
|
require('vanilla-lazyload');
|
|
19
19
|
require('../../../hooks/useCartUI.js');
|
|
20
|
+
require('../../../hooks/useStickyStore.js');
|
|
20
21
|
|
|
21
22
|
const PickProduct = (props)=>{
|
|
22
23
|
const LIMIT_PRODUCTS = 8;
|
|
@@ -32,6 +32,7 @@ const disableWrap = [
|
|
|
32
32
|
'FormTextarea',
|
|
33
33
|
'ProductPrice',
|
|
34
34
|
'Product',
|
|
35
|
+
'ProductList',
|
|
35
36
|
'ProductImages',
|
|
36
37
|
'ProductImagesV2',
|
|
37
38
|
'PostPurchaseProductImages',
|
|
@@ -40,14 +41,18 @@ const disableWrap = [
|
|
|
40
41
|
'EstimateDate',
|
|
41
42
|
'ProductBadge',
|
|
42
43
|
'Marquee',
|
|
43
|
-
'MarqueeItem'
|
|
44
|
+
'MarqueeItem',
|
|
45
|
+
'Newsletter',
|
|
46
|
+
'ContactForm'
|
|
44
47
|
];
|
|
45
48
|
const customRenderChildren = [
|
|
46
49
|
'Accordion',
|
|
47
50
|
'AccordionItem',
|
|
48
51
|
'Row',
|
|
49
52
|
'IconList',
|
|
50
|
-
'Tabs'
|
|
53
|
+
'Tabs',
|
|
54
|
+
'Marquee',
|
|
55
|
+
'MarqueeItem'
|
|
51
56
|
];
|
|
52
57
|
const excludeApplyStyle = [
|
|
53
58
|
'IconListV2',
|
|
@@ -61,7 +66,6 @@ const postPurchaseRequiredElements = [
|
|
|
61
66
|
'PostPurchaseAcceptButton',
|
|
62
67
|
'PostPurchaseButton',
|
|
63
68
|
'PostPurchaseCalloutBox',
|
|
64
|
-
'PostPurchaseProductPriceBreakdown',
|
|
65
69
|
'PostPurchaseProductImages',
|
|
66
70
|
'PostPurchaseCalloutText'
|
|
67
71
|
];
|
|
@@ -19,6 +19,7 @@ require('@gem-sdk/adapter-shopify');
|
|
|
19
19
|
require('swr/mutation');
|
|
20
20
|
require('vanilla-lazyload');
|
|
21
21
|
require('../../hooks/useCartUI.js');
|
|
22
|
+
require('../../hooks/useStickyStore.js');
|
|
22
23
|
|
|
23
24
|
function Spacing(props) {
|
|
24
25
|
const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
|