@gem-sdk/core 1.42.0-dev.62 → 1.42.0-staging.18
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 +6 -54
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -44
- package/dist/cjs/components/Render.liquid.js +0 -2
- package/dist/cjs/components/RenderCustomCode.js +0 -2
- package/dist/cjs/components/constant.js +2 -19
- package/dist/cjs/components/resize/Spacing.js +0 -2
- package/dist/cjs/components/theme-section/CreateThemeSection.js +0 -2
- package/dist/cjs/contexts/BuilderPreviewContext.js +6 -11
- package/dist/cjs/contexts/SectionContext.js +0 -1
- package/dist/cjs/helpers/carousel.js +10 -7
- package/dist/cjs/helpers/colors.js +1 -1
- package/dist/cjs/helpers/queries/get-products.js +0 -23
- package/dist/cjs/helpers/typography.js +4 -4
- package/dist/cjs/hooks/shop/use-products-query.js +0 -29
- package/dist/cjs/hooks/useAnimations.js +0 -2
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +0 -2
- package/dist/cjs/hooks/useProduct.js +0 -2
- package/dist/cjs/index.js +0 -11
- package/dist/esm/components/ComponentToolbarPreview.js +6 -54
- package/dist/esm/components/ComponentWrapperPreview.js +1 -44
- package/dist/esm/components/Render.liquid.js +0 -2
- package/dist/esm/components/RenderCustomCode.js +0 -2
- package/dist/esm/components/constant.js +3 -19
- package/dist/esm/components/resize/Spacing.js +0 -2
- package/dist/esm/components/theme-section/CreateThemeSection.js +0 -2
- package/dist/esm/contexts/BuilderPreviewContext.js +6 -11
- package/dist/esm/contexts/SectionContext.js +0 -1
- package/dist/esm/helpers/carousel.js +10 -7
- package/dist/esm/helpers/colors.js +1 -1
- package/dist/esm/helpers/queries/get-products.js +1 -23
- package/dist/esm/helpers/typography.js +4 -4
- package/dist/esm/hooks/shop/use-products-query.js +2 -30
- package/dist/esm/hooks/useAnimations.js +0 -2
- package/dist/esm/hooks/useInitialSwatchesOptions.js +0 -2
- package/dist/esm/hooks/useProduct.js +0 -2
- package/dist/esm/index.js +0 -4
- package/dist/types/index.d.ts +20 -161
- package/package.json +3 -5
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +0 -205
- package/dist/cjs/components/ai-generator/AIGenContentLoading.js +0 -85
- package/dist/cjs/components/ai-generator/components/PickProduct.js +0 -218
- package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +0 -77
- package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +0 -47
- package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +0 -110
- package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +0 -37
- package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +0 -63
- package/dist/cjs/components/ai-generator/icons/AIIcon.js +0 -67
- package/dist/cjs/components/ai-generator/icons/CloseIcon.js +0 -19
- package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +0 -37
- package/dist/cjs/components/ai-generator/icons/SearchIcon.js +0 -21
- package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +0 -21
- package/dist/cjs/contexts/ArticleContext.js +0 -39
- package/dist/cjs/contexts/ArticleListContext.js +0 -32
- package/dist/cjs/helpers/align.js +0 -19
- package/dist/cjs/hooks/articles/useArticlesQuery.js +0 -152
- package/dist/esm/components/ai-generator/AIContentGenerator.js +0 -203
- package/dist/esm/components/ai-generator/AIGenContentLoading.js +0 -83
- package/dist/esm/components/ai-generator/components/PickProduct.js +0 -216
- package/dist/esm/components/ai-generator/components/ToneAndVoice.js +0 -75
- package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +0 -45
- package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +0 -108
- package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +0 -35
- package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +0 -61
- package/dist/esm/components/ai-generator/icons/AIIcon.js +0 -65
- package/dist/esm/components/ai-generator/icons/CloseIcon.js +0 -17
- package/dist/esm/components/ai-generator/icons/DropdownIcon.js +0 -34
- package/dist/esm/components/ai-generator/icons/SearchIcon.js +0 -19
- package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +0 -19
- package/dist/esm/contexts/ArticleContext.js +0 -36
- package/dist/esm/contexts/ArticleListContext.js +0 -28
- package/dist/esm/helpers/align.js +0 -17
- package/dist/esm/hooks/articles/useArticlesQuery.js +0 -149
|
@@ -10,7 +10,6 @@ var ShopContext = require('../contexts/ShopContext.js');
|
|
|
10
10
|
require('@gem-sdk/adapter-shopify');
|
|
11
11
|
require('swr');
|
|
12
12
|
require('swr/mutation');
|
|
13
|
-
require('swr/infinite');
|
|
14
13
|
require('vanilla-lazyload');
|
|
15
14
|
require('../hooks/useCartUI.js');
|
|
16
15
|
var CreateThemeSection = require('./theme-section/CreateThemeSection.js');
|
|
@@ -18,9 +17,6 @@ var Tooltip = require('./toolbar/Tooltip.js');
|
|
|
18
17
|
var ThemeSectionStatus = require('./theme-section/ThemeSectionStatus.js');
|
|
19
18
|
var Resize = require('./resize/Resize.js');
|
|
20
19
|
var useToolbarPostPurchase = require('../hooks/useToolbarPostPurchase.js');
|
|
21
|
-
var constant = require('./constant.js');
|
|
22
|
-
var AIContentGenerator = require('./ai-generator/AIContentGenerator.js');
|
|
23
|
-
var AIGenContentLoading = require('./ai-generator/AIGenContentLoading.js');
|
|
24
20
|
require('../helpers/convert.js');
|
|
25
21
|
|
|
26
22
|
const SECTION_LIMIT = 25;
|
|
@@ -34,7 +30,6 @@ const isSection = (el)=>{
|
|
|
34
30
|
};
|
|
35
31
|
const ComponentToolbarPreview = (props)=>{
|
|
36
32
|
const isThemeSection = props.isThemeSection;
|
|
37
|
-
const isShopifySection = props.isShopifySection;
|
|
38
33
|
const editingPageType = ShopContext.useShopStore((s)=>s.pageType);
|
|
39
34
|
const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
|
|
40
35
|
const root = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem('ROOT'));
|
|
@@ -180,8 +175,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
180
175
|
bubbles: true,
|
|
181
176
|
detail: {
|
|
182
177
|
componentUid: props.uid,
|
|
183
|
-
isThemeSection
|
|
184
|
-
isShopifySection
|
|
178
|
+
isThemeSection: isThemeSection
|
|
185
179
|
}
|
|
186
180
|
});
|
|
187
181
|
window.dispatchEvent(event);
|
|
@@ -197,8 +191,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
197
191
|
bubbles: true,
|
|
198
192
|
detail: {
|
|
199
193
|
componentUid: props.uid,
|
|
200
|
-
isThemeSection
|
|
201
|
-
isShopifySection
|
|
194
|
+
isThemeSection: isThemeSection
|
|
202
195
|
}
|
|
203
196
|
});
|
|
204
197
|
window.dispatchEvent(event);
|
|
@@ -247,9 +240,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
247
240
|
return false;
|
|
248
241
|
};
|
|
249
242
|
const getSectionName = ()=>{
|
|
250
|
-
if (isShopifySection) {
|
|
251
|
-
return `Shopify section: ${props.name}`;
|
|
252
|
-
}
|
|
253
243
|
const checkRenamedSection = props.name && props.name === `Section ${props.uid}`;
|
|
254
244
|
if (getSectionNumber() >= SECTION_LIMIT - 5) {
|
|
255
245
|
return `${checkRenamedSection ? 'Section' : props?.name} ${getIndexSection() + 1}/${SECTION_LIMIT}`;
|
|
@@ -266,7 +256,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
266
256
|
"data-toolbar": true,
|
|
267
257
|
"data-toolbar-section": props.tag == 'Section',
|
|
268
258
|
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
269
|
-
"data-toolbar-shopify-section": props.tag == 'Section' && !!isShopifySection,
|
|
270
259
|
"data-toolbar-limit": getIndexSection() >= SECTION_LIMIT,
|
|
271
260
|
children: [
|
|
272
261
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -309,39 +298,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
309
298
|
]
|
|
310
299
|
})
|
|
311
300
|
}),
|
|
312
|
-
props.tag == 'Section' ? /*#__PURE__*/ jsxRuntime.
|
|
301
|
+
props.tag == 'Section' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
313
302
|
"data-toolbar-name": true,
|
|
314
|
-
children:
|
|
315
|
-
getSectionName(),
|
|
316
|
-
props.isShopifySection && !props.isShopifyVisibility && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
317
|
-
"data-toolbar-visibility": true,
|
|
318
|
-
width: "20",
|
|
319
|
-
height: "20",
|
|
320
|
-
viewBox: "0 0 20 20",
|
|
321
|
-
fill: "none",
|
|
322
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
323
|
-
children: [
|
|
324
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
325
|
-
fillRule: "evenodd",
|
|
326
|
-
clipRule: "evenodd",
|
|
327
|
-
d: "M13.1252 9.99773C13.1243 8.27226 11.7248 6.87423 9.99935 6.87506C8.27386 6.87561 6.87518 8.27455 6.87518 10.0001C6.87518 11.7259 8.27429 13.1251 10.0002 13.1251C11.7257 13.1251 13.125 11.727 13.1252 10.0011V9.99773ZM9.99985 8.12506C11.035 8.12451 11.8746 8.96322 11.8752 9.99839V10.0004C11.8752 11.0357 11.0359 11.8751 10.0002 11.8751C8.96465 11.8751 8.12518 11.0356 8.12518 10.0001C8.12518 8.96472 8.96451 8.12533 9.99985 8.12506Z",
|
|
328
|
-
fill: "#F9F9F9"
|
|
329
|
-
}),
|
|
330
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
331
|
-
fillRule: "evenodd",
|
|
332
|
-
clipRule: "evenodd",
|
|
333
|
-
d: "M9.99885 4.37593C5.66421 4.37604 2.80603 7.64523 1.79548 9.00983C1.35636 9.60279 1.35918 10.4 1.80012 10.9902C2.81706 12.3514 5.69374 15.6241 9.99886 15.6241C14.3806 15.6241 17.2194 12.3452 18.2168 10.9808C18.6473 10.392 18.6442 9.60472 18.211 9.01902C17.2056 7.65938 14.3429 4.37583 9.99885 4.37593ZM2.80002 9.75374C3.77049 8.44326 6.30207 5.62602 9.99888 5.62593C13.7041 5.62585 16.24 8.45598 17.206 9.76225C17.3146 9.9091 17.3149 10.0965 17.2077 10.2431C16.254 11.5477 13.7416 14.3741 9.99886 14.3741C6.33149 14.3741 3.78173 11.5541 2.80152 10.242C2.69021 10.0931 2.69001 9.90229 2.80002 9.75374Z",
|
|
334
|
-
fill: "#F9F9F9"
|
|
335
|
-
}),
|
|
336
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
337
|
-
fillRule: "evenodd",
|
|
338
|
-
clipRule: "evenodd",
|
|
339
|
-
d: "M18.0763 3.26988C18.3415 3.58809 18.2985 4.06101 17.9803 4.32619L2.98032 16.8262C2.66211 17.0914 2.18919 17.0484 1.92402 16.7302C1.65884 16.412 1.70184 15.939 2.02004 15.6739L17.02 3.17385C17.3383 2.90868 17.8112 2.95167 18.0763 3.26988Z",
|
|
340
|
-
fill: "#F9F9F9"
|
|
341
|
-
})
|
|
342
|
-
]
|
|
343
|
-
})
|
|
344
|
-
]
|
|
303
|
+
children: getSectionName()
|
|
345
304
|
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
346
305
|
"data-toolbar-name": true,
|
|
347
306
|
children: toolbarName()
|
|
@@ -421,10 +380,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
421
380
|
]
|
|
422
381
|
}, parent.uid);
|
|
423
382
|
}),
|
|
424
|
-
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() &&
|
|
425
|
-
...props
|
|
426
|
-
}),
|
|
427
|
-
!props.isShopifySection && constant.ableGenerateContentElements.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(AIContentGenerator.AIContentGenerator, {
|
|
383
|
+
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
|
|
428
384
|
...props
|
|
429
385
|
}),
|
|
430
386
|
props.tag == 'Sticky' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -498,7 +454,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
498
454
|
"data-outline": true,
|
|
499
455
|
"data-outline-section": props.tag == 'Section',
|
|
500
456
|
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
501
|
-
"data-outline-shopify-section": props.tag == 'Section' && !!isShopifySection,
|
|
502
457
|
"data-outline-limit": getIndexSection() >= SECTION_LIMIT
|
|
503
458
|
}, 'outline-' + props.uid),
|
|
504
459
|
props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -545,15 +500,12 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
545
500
|
})
|
|
546
501
|
]
|
|
547
502
|
}),
|
|
548
|
-
constant.ableGenerateContentElements.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(AIGenContentLoading.AIGenContentLoading, {
|
|
549
|
-
...props
|
|
550
|
-
}),
|
|
551
503
|
/*#__PURE__*/ jsxRuntime.jsx(Resize.default, {
|
|
552
504
|
...props
|
|
553
505
|
})
|
|
554
506
|
]
|
|
555
507
|
});
|
|
556
508
|
};
|
|
557
|
-
var ComponentToolbarPreview$1 = /*#__PURE__*/ react.memo(ComponentToolbarPreview);
|
|
509
|
+
var ComponentToolbarPreview$1 = /*#__PURE__*/ react.memo(ComponentToolbarPreview);
|
|
558
510
|
|
|
559
511
|
exports.default = ComponentToolbarPreview$1;
|
|
@@ -14,10 +14,8 @@ require('swr');
|
|
|
14
14
|
require('@gem-sdk/adapter-shopify');
|
|
15
15
|
require('swr/mutation');
|
|
16
16
|
var shop = require('../hooks/shop.js');
|
|
17
|
-
require('swr/infinite');
|
|
18
17
|
require('vanilla-lazyload');
|
|
19
18
|
require('../hooks/useCartUI.js');
|
|
20
|
-
var cls = require('../helpers/cls.js');
|
|
21
19
|
require('../helpers/convert.js');
|
|
22
20
|
|
|
23
21
|
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
@@ -43,10 +41,6 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
43
41
|
if (props.tag === 'Section' && props.isThemeSection) {
|
|
44
42
|
customProps['data-theme-section'] = true;
|
|
45
43
|
}
|
|
46
|
-
if (props.tag === 'Section' && props.isShopifySection) {
|
|
47
|
-
customProps['data-shopify-section'] = true;
|
|
48
|
-
customProps['data-toolbar-wrap'] = true;
|
|
49
|
-
}
|
|
50
44
|
// Build editor configs
|
|
51
45
|
if (props.editorConfigs) {
|
|
52
46
|
const editorConfigs = props.editorConfigs;
|
|
@@ -101,40 +95,6 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
101
95
|
'data-component-label': props.label,
|
|
102
96
|
'data-not-droppable': isNotDroppable(props.tag)
|
|
103
97
|
};
|
|
104
|
-
const ShopifySection = ({ name, visibility })=>{
|
|
105
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
106
|
-
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]', {
|
|
107
|
-
'gp-opacity-60': !visibility
|
|
108
|
-
}),
|
|
109
|
-
children: [
|
|
110
|
-
/*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
111
|
-
width: "24",
|
|
112
|
-
height: "24",
|
|
113
|
-
viewBox: "0 0 24 24",
|
|
114
|
-
fill: "none",
|
|
115
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
116
|
-
children: [
|
|
117
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
118
|
-
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",
|
|
119
|
-
fill: "#95BF47"
|
|
120
|
-
}),
|
|
121
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
122
|
-
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",
|
|
123
|
-
fill: "#5E8E3E"
|
|
124
|
-
}),
|
|
125
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
126
|
-
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",
|
|
127
|
-
fill: "white"
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
}),
|
|
131
|
-
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
132
|
-
className: "gp-text-[#212121] gp-text-[14px] gp-leading-[24px] gp-font-medium",
|
|
133
|
-
children: name
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
98
|
if (constant.disableWrap.includes(props.tag) && /*#__PURE__*/ react.isValidElement(children)) {
|
|
139
99
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
140
100
|
children: [
|
|
@@ -149,10 +109,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
149
109
|
builderAttrs,
|
|
150
110
|
advanced,
|
|
151
111
|
children: [
|
|
152
|
-
props
|
|
153
|
-
name: props.name ?? '',
|
|
154
|
-
visibility: !!props.isShopifyVisibility
|
|
155
|
-
}) : children.props['children'],
|
|
112
|
+
children.props['children'],
|
|
156
113
|
/*#__PURE__*/ jsxRuntime.jsx(ComponentToolbarPreview.default, {
|
|
157
114
|
...props
|
|
158
115
|
})
|
|
@@ -9,13 +9,11 @@ require('zustand');
|
|
|
9
9
|
require('swr');
|
|
10
10
|
require('@gem-sdk/adapter-shopify');
|
|
11
11
|
require('swr/mutation');
|
|
12
|
-
require('swr/infinite');
|
|
13
12
|
require('vanilla-lazyload');
|
|
14
13
|
require('../hooks/useCartUI.js');
|
|
15
14
|
require('react-transition-group');
|
|
16
15
|
require('@gem-sdk/core');
|
|
17
16
|
var constant = require('./constant.js');
|
|
18
|
-
require('classnames');
|
|
19
17
|
var composeAdvanceStyle = require('../helpers/compose-advance-style.js');
|
|
20
18
|
var convert = require('../helpers/convert.js');
|
|
21
19
|
var render = require('../helpers/render.js');
|
|
@@ -11,12 +11,10 @@ require('swr');
|
|
|
11
11
|
require('@gem-sdk/adapter-shopify');
|
|
12
12
|
require('swr/mutation');
|
|
13
13
|
var shop = require('../hooks/shop.js');
|
|
14
|
-
require('swr/infinite');
|
|
15
14
|
require('vanilla-lazyload');
|
|
16
15
|
require('../hooks/useCartUI.js');
|
|
17
16
|
require('react-transition-group');
|
|
18
17
|
require('@gem-sdk/core');
|
|
19
|
-
require('classnames');
|
|
20
18
|
require('../helpers/convert.js');
|
|
21
19
|
|
|
22
20
|
const RenderCustomCode = ({ uid, advanced })=>{
|
|
@@ -36,10 +36,7 @@ const disableWrap = [
|
|
|
36
36
|
'ProductImagesV2',
|
|
37
37
|
'PostPurchaseProductImages',
|
|
38
38
|
'Sticky',
|
|
39
|
-
'Heading'
|
|
40
|
-
'ProductBadge',
|
|
41
|
-
'Marquee',
|
|
42
|
-
'MarqueeItem'
|
|
39
|
+
'Heading'
|
|
43
40
|
];
|
|
44
41
|
const customRenderChildren = [
|
|
45
42
|
'Accordion',
|
|
@@ -50,8 +47,7 @@ const customRenderChildren = [
|
|
|
50
47
|
];
|
|
51
48
|
const excludeApplyStyle = [
|
|
52
49
|
'IconListV2',
|
|
53
|
-
'IconList'
|
|
54
|
-
'ProductBadge'
|
|
50
|
+
'IconList'
|
|
55
51
|
];
|
|
56
52
|
const postPurchaseRequiredElements = [
|
|
57
53
|
'PostPurchaseProductOffer',
|
|
@@ -70,20 +66,7 @@ const postPurchaseWrapElements = [
|
|
|
70
66
|
'PostPurchaseCalloutBox',
|
|
71
67
|
'PostPurchaseProductOffer'
|
|
72
68
|
];
|
|
73
|
-
const ableGenerateContentElements = [
|
|
74
|
-
'Section',
|
|
75
|
-
'Row',
|
|
76
|
-
'Text',
|
|
77
|
-
'Heading',
|
|
78
|
-
'Accordion',
|
|
79
|
-
'Product',
|
|
80
|
-
'HeroBanner',
|
|
81
|
-
'IconList',
|
|
82
|
-
'IconListV2',
|
|
83
|
-
'AdvancedList'
|
|
84
|
-
];
|
|
85
69
|
|
|
86
|
-
exports.ableGenerateContentElements = ableGenerateContentElements;
|
|
87
70
|
exports.customRenderChildren = customRenderChildren;
|
|
88
71
|
exports.disableWrap = disableWrap;
|
|
89
72
|
exports.excludeApplyStyle = excludeApplyStyle;
|
|
@@ -10,12 +10,10 @@ require('swr');
|
|
|
10
10
|
require('@gem-sdk/adapter-shopify');
|
|
11
11
|
require('swr/mutation');
|
|
12
12
|
var shop = require('../../hooks/shop.js');
|
|
13
|
-
require('swr/infinite');
|
|
14
13
|
require('vanilla-lazyload');
|
|
15
14
|
require('../../hooks/useCartUI.js');
|
|
16
15
|
require('react-transition-group');
|
|
17
16
|
require('@gem-sdk/core');
|
|
18
|
-
require('classnames');
|
|
19
17
|
require('../../helpers/convert.js');
|
|
20
18
|
|
|
21
19
|
function Spacing(props) {
|
|
@@ -8,10 +8,8 @@ var ShopContext = require('../../contexts/ShopContext.js');
|
|
|
8
8
|
require('@gem-sdk/adapter-shopify');
|
|
9
9
|
require('swr');
|
|
10
10
|
require('swr/mutation');
|
|
11
|
-
require('swr/infinite');
|
|
12
11
|
require('vanilla-lazyload');
|
|
13
12
|
require('../../hooks/useCartUI.js');
|
|
14
|
-
require('classnames');
|
|
15
13
|
require('../../helpers/convert.js');
|
|
16
14
|
|
|
17
15
|
const SHOW_TOOLTIP_TIMEOUT = 600;
|
|
@@ -253,11 +253,7 @@ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.creat
|
|
|
253
253
|
}
|
|
254
254
|
},
|
|
255
255
|
getItem: (id)=>{
|
|
256
|
-
|
|
257
|
-
return {
|
|
258
|
-
...item,
|
|
259
|
-
rawChildrens: item?.childrens?.map((v)=>get().state[v])
|
|
260
|
-
};
|
|
256
|
+
return get().state[id];
|
|
261
257
|
},
|
|
262
258
|
removeItem: (id)=>{
|
|
263
259
|
if (id === 'ROOT') {
|
|
@@ -432,16 +428,15 @@ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.creat
|
|
|
432
428
|
updateItemAttribute: (id, value, attr)=>{
|
|
433
429
|
if (!attr || ![
|
|
434
430
|
'label',
|
|
435
|
-
'customLabel'
|
|
436
|
-
'isShopifyVisibility'
|
|
431
|
+
'customLabel'
|
|
437
432
|
].includes(attr)) return;
|
|
438
433
|
const state = get().state;
|
|
439
434
|
const item = state[id];
|
|
435
|
+
// Ignore section
|
|
436
|
+
if (item?.type === 'section') return;
|
|
440
437
|
if (item) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
item.dateModified = dateModified;
|
|
444
|
-
}
|
|
438
|
+
const dateModified = Date.now();
|
|
439
|
+
item.dateModified = dateModified;
|
|
445
440
|
const updatedItem = {
|
|
446
441
|
...item,
|
|
447
442
|
[attr]: value
|
|
@@ -10,7 +10,6 @@ const SectionContext = /*#__PURE__*/ react.createContext(null);
|
|
|
10
10
|
const createSectionProvider = (data)=>zustand.createStore((set, get)=>({
|
|
11
11
|
data: data ?? {},
|
|
12
12
|
getSection: (id)=>{
|
|
13
|
-
console.log('get().data', get().data);
|
|
14
13
|
const section = get().data[id];
|
|
15
14
|
return section ?? undefined;
|
|
16
15
|
},
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
var getResonsiveValue = require('./get-resonsive-value.js');
|
|
4
4
|
|
|
5
|
-
const getCarouselContainerHeight = (dotStyle)=>{
|
|
6
|
-
const getVal = (dotStyle)=>{
|
|
7
|
-
|
|
5
|
+
const getCarouselContainerHeight = (dotStyle, dotSize, dotGapToCarousel)=>{
|
|
6
|
+
const getVal = (dotStyle, dotSize, dotGapToCarousel)=>{
|
|
7
|
+
if (dotStyle === 'outside') {
|
|
8
|
+
return `calc(100% - ${dotSize ?? '0'}px - ${!dotGapToCarousel || dotGapToCarousel === 'Auto' ? '0' : dotGapToCarousel}px)`;
|
|
9
|
+
}
|
|
10
|
+
return '100%';
|
|
8
11
|
};
|
|
9
12
|
return {
|
|
10
|
-
desktop: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'desktop')),
|
|
11
|
-
tablet: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'tablet')),
|
|
12
|
-
mobile: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'mobile'))
|
|
13
|
+
desktop: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'desktop'), getResonsiveValue.getResponsiveValueByScreen(dotSize, 'desktop'), getResonsiveValue.getResponsiveValueByScreen(dotGapToCarousel, 'desktop')),
|
|
14
|
+
tablet: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'tablet'), getResonsiveValue.getResponsiveValueByScreen(dotSize, 'tablet'), getResonsiveValue.getResponsiveValueByScreen(dotGapToCarousel, 'tablet')),
|
|
15
|
+
mobile: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'mobile'), getResonsiveValue.getResponsiveValueByScreen(dotSize, 'mobile'), getResonsiveValue.getResponsiveValueByScreen(dotGapToCarousel, 'mobile'))
|
|
13
16
|
};
|
|
14
17
|
};
|
|
15
18
|
const makeContainerWidthOrHeight = (setting)=>{
|
|
16
19
|
const getStyleName = (vertical)=>{
|
|
17
20
|
return vertical ? 'w' : 'h';
|
|
18
21
|
};
|
|
19
|
-
const result = getCarouselContainerHeight(setting.dotStyle);
|
|
22
|
+
const result = getCarouselContainerHeight(setting.dotStyle, setting.dotSize, setting.dotGapToCarousel);
|
|
20
23
|
return {
|
|
21
24
|
[`--${getStyleName(getResonsiveValue.getResponsiveValueByScreen(setting?.vertical, 'desktop'))}`]: result.desktop,
|
|
22
25
|
[`--${getStyleName(getResonsiveValue.getResponsiveValueByScreen(setting?.vertical, 'tablet'))}-tablet`]: result.tablet,
|
|
@@ -156,7 +156,7 @@ const getSingleColorVariable = (color)=>{
|
|
|
156
156
|
};
|
|
157
157
|
function isColor(color) {
|
|
158
158
|
if (!color || typeof color !== 'string') return false;
|
|
159
|
-
return color?.startsWith('#') || color?.startsWith('rgb') || color?.startsWith('hsl') || color?.startsWith('transparent')
|
|
159
|
+
return color?.startsWith('#') || color?.startsWith('rgb') || color?.startsWith('hsl') || color?.startsWith('transparent');
|
|
160
160
|
}
|
|
161
161
|
const getGlobalColorStyle = (data)=>{
|
|
162
162
|
if (!data) return {};
|
|
@@ -80,28 +80,6 @@ const getProductQueryAll = async (fetcher, arg)=>{
|
|
|
80
80
|
const pageData = await fetchProducts(fetcher, variables);
|
|
81
81
|
return pageData;
|
|
82
82
|
};
|
|
83
|
-
const getListProductByVariables = async (fetcher, arg)=>{
|
|
84
|
-
const variables = {
|
|
85
|
-
first: arg.first || 8,
|
|
86
|
-
firstMedia: 1,
|
|
87
|
-
firstVariant: 1,
|
|
88
|
-
orderBy: {
|
|
89
|
-
field: 'PLATFORM_CREATED_AT',
|
|
90
|
-
direction: 'DESC'
|
|
91
|
-
},
|
|
92
|
-
orderByMedia: {
|
|
93
|
-
field: 'POSITION',
|
|
94
|
-
direction: 'ASC'
|
|
95
|
-
},
|
|
96
|
-
where: {
|
|
97
|
-
status: 'ACTIVE',
|
|
98
|
-
...arg.where
|
|
99
|
-
},
|
|
100
|
-
after: arg.after
|
|
101
|
-
};
|
|
102
|
-
const pageData = await fetchProducts(fetcher, variables);
|
|
103
|
-
return pageData;
|
|
104
|
-
};
|
|
105
83
|
const fetchProducts = async (fetcher, variables)=>{
|
|
106
84
|
return fetcher([
|
|
107
85
|
products_generated.ProductsDocument,
|
|
@@ -209,6 +187,5 @@ const mergeMediasToProducts = async ({ fetcher, products, isSample, isStorefront
|
|
|
209
187
|
// );
|
|
210
188
|
// };
|
|
211
189
|
|
|
212
|
-
exports.getListProductByVariables = getListProductByVariables;
|
|
213
190
|
exports.getProductQueryAll = getProductQueryAll;
|
|
214
191
|
exports.getProducts = getProducts;
|
|
@@ -29,7 +29,7 @@ const composeTypographyV2Css = (typography, isImportant)=>{
|
|
|
29
29
|
${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant};` : ''}
|
|
30
30
|
${bold ? `font-weight: bold ${composeImportant};` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant};` : ''}
|
|
31
31
|
${letterSpacing ? `letter-spacing: ${letterSpacing} ${composeImportant};` : ''}
|
|
32
|
-
${lineHeight
|
|
32
|
+
${lineHeight ? `line-height: ${lineHeight} ${composeImportant};` : ''}
|
|
33
33
|
${italic ? `font-style: italic ${composeImportant};` : ''}
|
|
34
34
|
${underline ? `text-decoration-line: underline ${composeImportant};` : ''}
|
|
35
35
|
${transform ? `text-transform: ${transform} ${composeImportant};` : ''}
|
|
@@ -63,10 +63,10 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
63
63
|
fs: !attrs?.italic ? value?.fontStyle : undefined,
|
|
64
64
|
ff: value?.fontFamily ? `var(--g-font-${value.fontFamily.replace(/ /g, '-')}, '${value.fontFamily}'), ${value.fallbackFontFamily}` : undefined,
|
|
65
65
|
weight: !attrs?.bold ? value?.fontWeight : undefined,
|
|
66
|
-
ls: value?.letterSpacing
|
|
66
|
+
ls: value?.letterSpacing,
|
|
67
|
+
lh: value?.lineHeight
|
|
67
68
|
}),
|
|
68
|
-
...makeStyle.makeStyleResponsive('size', value?.fontSize)
|
|
69
|
-
...makeStyle.makeStyleResponsive('lh', value?.lineHeight)
|
|
69
|
+
...makeStyle.makeStyleResponsive('size', value?.fontSize)
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
const composeTypographyAttr = (attrs)=>{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var useSWR = require('swr');
|
|
4
|
-
var useSWRInfinite = require('swr/infinite');
|
|
5
4
|
var getProducts = require('../../helpers/queries/get-products.js');
|
|
6
5
|
var query = require('../../helpers/query.js');
|
|
7
6
|
var shop = require('../shop.js');
|
|
@@ -21,33 +20,6 @@ const useProductsQuery = (ids, options, params)=>{
|
|
|
21
20
|
return getProducts.getProducts(params?.fetcher || fetcher, arg);
|
|
22
21
|
}, options);
|
|
23
22
|
};
|
|
24
|
-
const getKey = (variable)=>{
|
|
25
|
-
return (pageIndex, previousPageData)=>{
|
|
26
|
-
if (!variable || previousPageData && !previousPageData.products?.pageInfo?.hasNextPage) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
if (pageIndex === 0) {
|
|
30
|
-
return [
|
|
31
|
-
'query/products',
|
|
32
|
-
variable
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
return [
|
|
36
|
-
'query/products',
|
|
37
|
-
{
|
|
38
|
-
...variable,
|
|
39
|
-
after: previousPageData.products?.pageInfo?.endCursor
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const useListProductQuery = (variable, options)=>{
|
|
45
|
-
const fetcher = useFetchHandle.useFetchHandle();
|
|
46
|
-
const data = useSWRInfinite(getKey(variable), async ([, arg])=>{
|
|
47
|
-
return getProducts.getListProductByVariables(fetcher, arg);
|
|
48
|
-
}, options);
|
|
49
|
-
return data;
|
|
50
|
-
};
|
|
51
23
|
const useProductsQueryAll = (variable, options)=>{
|
|
52
24
|
const fetcher = useFetchHandle.useFetchHandle();
|
|
53
25
|
return useSWR(variable ? [
|
|
@@ -58,6 +30,5 @@ const useProductsQueryAll = (variable, options)=>{
|
|
|
58
30
|
}, options);
|
|
59
31
|
};
|
|
60
32
|
|
|
61
|
-
exports.useListProductQuery = useListProductQuery;
|
|
62
33
|
exports.useProductsQuery = useProductsQuery;
|
|
63
34
|
exports.useProductsQueryAll = useProductsQueryAll;
|
|
@@ -7,12 +7,10 @@ require('zustand');
|
|
|
7
7
|
require('swr');
|
|
8
8
|
require('@gem-sdk/adapter-shopify');
|
|
9
9
|
require('swr/mutation');
|
|
10
|
-
require('swr/infinite');
|
|
11
10
|
require('vanilla-lazyload');
|
|
12
11
|
require('./useCartUI.js');
|
|
13
12
|
require('react-transition-group');
|
|
14
13
|
require('@gem-sdk/core');
|
|
15
|
-
require('classnames');
|
|
16
14
|
require('../helpers/convert.js');
|
|
17
15
|
|
|
18
16
|
const useAnimations = ()=>{
|
|
@@ -13,12 +13,10 @@ require('react/jsx-runtime');
|
|
|
13
13
|
require('zustand');
|
|
14
14
|
require('@gem-sdk/adapter-shopify');
|
|
15
15
|
require('swr/mutation');
|
|
16
|
-
require('swr/infinite');
|
|
17
16
|
require('vanilla-lazyload');
|
|
18
17
|
require('./useCartUI.js');
|
|
19
18
|
require('react-transition-group');
|
|
20
19
|
require('@gem-sdk/core');
|
|
21
|
-
require('classnames');
|
|
22
20
|
var isBrowser = require('../helpers/is-browser.js');
|
|
23
21
|
require('../helpers/convert.js');
|
|
24
22
|
|
|
@@ -8,13 +8,11 @@ require('swr');
|
|
|
8
8
|
var PageContext = require('../contexts/PageContext.js');
|
|
9
9
|
require('@gem-sdk/adapter-shopify');
|
|
10
10
|
require('swr/mutation');
|
|
11
|
-
require('swr/infinite');
|
|
12
11
|
require('vanilla-lazyload');
|
|
13
12
|
require('./useCartUI.js');
|
|
14
13
|
var variant = require('../helpers/variant.js');
|
|
15
14
|
require('react-transition-group');
|
|
16
15
|
require('@gem-sdk/core');
|
|
17
|
-
require('classnames');
|
|
18
16
|
var flattenConnection = require('../helpers/flatten-connection.js');
|
|
19
17
|
require('../helpers/convert.js');
|
|
20
18
|
var product = require('../helpers/product.js');
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,8 +16,6 @@ var ShopContext = require('./contexts/ShopContext.js');
|
|
|
16
16
|
var PageContext = require('./contexts/PageContext.js');
|
|
17
17
|
var CollectionContext = require('./contexts/CollectionContext.js');
|
|
18
18
|
var ModalContext = require('./contexts/ModalContext.js');
|
|
19
|
-
var ArticleListContext = require('./contexts/ArticleListContext.js');
|
|
20
|
-
var ArticleContext = require('./contexts/ArticleContext.js');
|
|
21
19
|
var pageViewUp_generated = require('./graphql/mutations/page-view-up.generated.js');
|
|
22
20
|
var collectionDetailFilter_generated = require('./graphql/queries/collection-detail-filter.generated.js');
|
|
23
21
|
var collection_generated = require('./graphql/queries/collection.generated.js');
|
|
@@ -53,7 +51,6 @@ var iconList = require('./helpers/icon-list.js');
|
|
|
53
51
|
var isDefined = require('./helpers/is-defined.js');
|
|
54
52
|
var layout = require('./helpers/layout.js');
|
|
55
53
|
var makeStyle = require('./helpers/make-style.js');
|
|
56
|
-
var align = require('./helpers/align.js');
|
|
57
54
|
var product = require('./helpers/product.js');
|
|
58
55
|
var query = require('./helpers/query.js');
|
|
59
56
|
var radius = require('./helpers/radius.js');
|
|
@@ -92,7 +89,6 @@ var useIsomorphicLayoutEffect = require('./hooks/useIsomorphicLayoutEffect.js');
|
|
|
92
89
|
var useLoadScript = require('./hooks/useLoadScript.js');
|
|
93
90
|
var useMoney = require('./hooks/useMoney.js');
|
|
94
91
|
var usePrevious = require('./hooks/usePrevious.js');
|
|
95
|
-
var useArticlesQuery = require('./hooks/articles/useArticlesQuery.js');
|
|
96
92
|
var useProduct = require('./hooks/useProduct.js');
|
|
97
93
|
var useProductList = require('./hooks/useProductList.js');
|
|
98
94
|
var useSuspenseFetch = require('./hooks/useSuspenseFetch.js');
|
|
@@ -140,10 +136,6 @@ exports.CollectionProvider = CollectionContext.CollectionProvider;
|
|
|
140
136
|
exports.useCollectionStore = CollectionContext.useCollectionStore;
|
|
141
137
|
exports.ModalProvider = ModalContext.ModalProvider;
|
|
142
138
|
exports.useModalStore = ModalContext.useModalStore;
|
|
143
|
-
exports.ArticleListProvider = ArticleListContext.ArticleListProvider;
|
|
144
|
-
exports.useArticleListStore = ArticleListContext.useArticleListStore;
|
|
145
|
-
exports.ArticleProvider = ArticleContext.ArticleProvider;
|
|
146
|
-
exports.useArticleStore = ArticleContext.useArticleStore;
|
|
147
139
|
exports.PageViewUpDocument = pageViewUp_generated.PageViewUpDocument;
|
|
148
140
|
exports.CollectionDetailFilterDocument = collectionDetailFilter_generated.CollectionDetailFilterDocument;
|
|
149
141
|
exports.CollectionDocument = collection_generated.CollectionDocument;
|
|
@@ -232,7 +224,6 @@ exports.makeStyleResponsiveState = makeStyle.makeStyleResponsiveState;
|
|
|
232
224
|
exports.makeStyleState = makeStyle.makeStyleState;
|
|
233
225
|
exports.makeWidth = makeStyle.makeWidth;
|
|
234
226
|
exports.removeNullUndefined = makeStyle.removeNullUndefined;
|
|
235
|
-
exports.convertTextAlignToJustify = align.convertTextAlignToJustify;
|
|
236
227
|
exports.checkAvailableVariantInStock = product.checkAvailableVariantInStock;
|
|
237
228
|
exports.getSelectedVariant = product.getSelectedVariant;
|
|
238
229
|
exports.parseSelectedOption = product.parseSelectedOption;
|
|
@@ -328,8 +319,6 @@ exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect.default;
|
|
|
328
319
|
exports.useLoadScript = useLoadScript.default;
|
|
329
320
|
exports.useMoney = useMoney.default;
|
|
330
321
|
exports.usePrevious = usePrevious.usePrevious;
|
|
331
|
-
exports.useArticlesQuery = useArticlesQuery.useArticlesQuery;
|
|
332
|
-
exports.useBlogsQuery = useArticlesQuery.useBlogsQuery;
|
|
333
322
|
exports.useCheckAvailableVariantInStock = useProduct.useCheckAvailableVariantInStock;
|
|
334
323
|
exports.useCurrentVariant = useProduct.useCurrentVariant;
|
|
335
324
|
exports.useCurrentVariantInStock = useProduct.useCurrentVariantInStock;
|