@gem-sdk/core 1.53.0-dev.9 → 1.53.0-dev.93
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 +58 -3
- package/dist/cjs/components/ComponentWrapper.js +16 -1
- package/dist/cjs/components/InteractionSuffix.js +9 -70
- package/dist/cjs/components/Render.liquid.js +3 -2
- package/dist/cjs/contexts/PageContext.js +9 -1
- package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
- package/dist/cjs/helpers/animations.js +11 -2
- package/dist/cjs/helpers/background.js +3 -1
- package/dist/cjs/helpers/interaction/index.js +15 -5
- package/dist/cjs/helpers/third-party/appConfig.js +14 -0
- package/dist/cjs/helpers/third-party/appSetting.js +87 -1
- package/dist/cjs/helpers/third-party/constant.js +3 -1
- package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/cjs/hooks/animation/useApplyAnimation.js +5 -5
- package/dist/cjs/index.js +2 -0
- package/dist/esm/components/ComponentToolbarPreview.js +58 -3
- package/dist/esm/components/ComponentWrapper.js +16 -1
- package/dist/esm/components/InteractionSuffix.js +10 -71
- package/dist/esm/components/Render.liquid.js +3 -2
- package/dist/esm/contexts/PageContext.js +9 -1
- package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
- package/dist/esm/helpers/animations.js +11 -2
- package/dist/esm/helpers/background.js +3 -1
- package/dist/esm/helpers/interaction/index.js +15 -5
- package/dist/esm/helpers/third-party/appConfig.js +13 -1
- package/dist/esm/helpers/third-party/appSetting.js +87 -1
- package/dist/esm/helpers/third-party/constant.js +4 -2
- package/dist/esm/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/esm/hooks/animation/useApplyAnimation.js +5 -5
- package/dist/esm/index.js +1 -0
- package/dist/types/index.d.ts +57 -7
- package/package.json +2 -2
|
@@ -60,7 +60,31 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
60
60
|
editingPageType
|
|
61
61
|
]);
|
|
62
62
|
const isSelectOnPage = react.useMemo(()=>interactionData?.isSelectOnPage, [
|
|
63
|
-
interactionData
|
|
63
|
+
interactionData?.isSelectOnPage
|
|
64
|
+
]);
|
|
65
|
+
const settingType = react.useMemo(()=>interactionData?.settingType, [
|
|
66
|
+
interactionData?.settingType
|
|
67
|
+
]);
|
|
68
|
+
const isShowIconInteractionTarget = react.useMemo(()=>{
|
|
69
|
+
return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
|
|
70
|
+
}, [
|
|
71
|
+
interactionData?.item?.targets,
|
|
72
|
+
props.uid,
|
|
73
|
+
settingType
|
|
74
|
+
]);
|
|
75
|
+
const isShowIconInteractionTrigger = react.useMemo(()=>{
|
|
76
|
+
return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
|
|
77
|
+
}, [
|
|
78
|
+
interactionData?.item?.self?.type,
|
|
79
|
+
interactionData?.item?.self?.uid,
|
|
80
|
+
props.uid,
|
|
81
|
+
settingType
|
|
82
|
+
]);
|
|
83
|
+
const isDisplayIconDrag = react.useMemo(()=>{
|
|
84
|
+
return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
|
|
85
|
+
}, [
|
|
86
|
+
isShowIconInteractionTarget,
|
|
87
|
+
isShowIconInteractionTrigger
|
|
64
88
|
]);
|
|
65
89
|
const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = useToolbarPostPurchase.usePostPurchase(props.uid, props.tag || '');
|
|
66
90
|
const editProductElementList = [
|
|
@@ -338,7 +362,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
338
362
|
if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
|
|
339
363
|
return constant.ableGenerateContentElements.includes(tag);
|
|
340
364
|
};
|
|
341
|
-
// if (!isActive) return null;
|
|
342
365
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
343
366
|
children: [
|
|
344
367
|
!(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -353,7 +376,39 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
353
376
|
onClick: (e)=>onShowParent(e),
|
|
354
377
|
"aria-hidden": "true",
|
|
355
378
|
children: [
|
|
356
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
379
|
+
isShowIconInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
380
|
+
className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
|
|
381
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
382
|
+
width: "12",
|
|
383
|
+
height: "13",
|
|
384
|
+
viewBox: "0 0 12 13",
|
|
385
|
+
fill: "none",
|
|
386
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
387
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
388
|
+
fillRule: "evenodd",
|
|
389
|
+
clipRule: "evenodd",
|
|
390
|
+
d: "M4.36823 0.430157C4.51621 0.205309 4.76733 0.0699463 5.0365 0.0699463H9.886C10.2045 0.0699463 10.3952 0.424012 10.2201 0.689974L8.36993 3.49883C8.28234 3.63182 8.37772 3.80885 8.53695 3.80885H10.7492C11.1114 3.80885 11.2871 4.25167 11.0235 4.5L3.03995 12.0213C2.75745 12.2874 2.29956 12.0357 2.37286 11.6546L3.28019 6.93662C3.30391 6.81327 3.20939 6.69885 3.08379 6.69885H0.984895C0.666494 6.69885 0.475723 6.34493 0.650759 6.07895L4.36823 0.430157ZM5.48883 1.20046C5.35424 1.20046 5.22868 1.26814 5.15469 1.38057L2.6027 5.25839C2.51518 5.39137 2.61056 5.56833 2.76976 5.56833H4.27861C4.52982 5.56833 4.71885 5.79718 4.67141 6.04387L4.12087 8.9066C4.08422 9.09717 4.31317 9.22301 4.45442 9.08994L8.49328 5.28494C8.62508 5.16077 8.53721 4.93936 8.35614 4.93936H6.75127C6.4328 4.93936 6.24204 4.5853 6.41722 4.31934L8.26734 1.51048C8.35494 1.37749 8.25956 1.20046 8.10032 1.20046H5.48883Z",
|
|
391
|
+
fill: "#F9F9F9"
|
|
392
|
+
})
|
|
393
|
+
})
|
|
394
|
+
}),
|
|
395
|
+
isShowIconInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
396
|
+
className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
|
|
397
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
398
|
+
width: "14",
|
|
399
|
+
height: "14",
|
|
400
|
+
viewBox: "0 0 14 14",
|
|
401
|
+
fill: "none",
|
|
402
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
403
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
404
|
+
fillRule: "evenodd",
|
|
405
|
+
clipRule: "evenodd",
|
|
406
|
+
d: "M6.2941 2.19513C6.70415 2.13657 6.9891 1.75669 6.93054 1.34663C6.87198 0.936581 6.49209 0.651638 6.08204 0.710196C2.98687 1.15221 0.607666 3.8125 0.607666 7.02978C0.607666 10.5556 3.46588 13.4138 6.99166 13.4138C10.1798 13.4138 12.8209 11.0775 13.2987 8.02354C13.3627 7.61431 13.0828 7.23065 12.6736 7.16663C12.2644 7.1026 11.8807 7.38245 11.8167 7.79169C11.4513 10.127 9.42946 11.9138 6.99166 11.9138C4.2943 11.9138 2.10767 9.72714 2.10767 7.02978C2.10767 4.56958 3.92742 2.53311 6.2941 2.19513ZM9.32325 0.978487C9.59794 0.703796 10.0673 0.833594 10.1618 1.21039L10.648 3.14898C10.6705 3.2384 10.7403 3.30822 10.8297 3.33065L12.7683 3.81691C13.1451 3.91143 13.2749 4.38075 13.0002 4.65544L11.3265 6.32911C11.099 6.55668 10.7758 6.66082 10.4581 6.60891L9.03886 6.37696C8.72123 6.32505 8.39804 6.42918 8.17046 6.65676L7.40064 7.42658C7.16633 7.66089 6.78643 7.66089 6.55211 7.42658C6.3178 7.19227 6.3178 6.81237 6.55211 6.57805L7.32193 5.80823C7.54951 5.58066 7.65364 5.25746 7.60173 4.93983L7.36978 3.52055C7.31787 3.20293 7.42201 2.87973 7.64958 2.65216L9.32325 0.978487ZM8.79074 4.77514C8.82538 4.98713 8.99156 5.15331 9.20355 5.18795L10.2975 5.36674C10.4564 5.3927 10.618 5.34063 10.7317 5.22684L10.9663 4.99227C11.1037 4.85492 11.0388 4.62026 10.8504 4.573L9.98586 4.35615C9.80703 4.3113 9.66739 4.17166 9.62254 3.99283L9.40569 3.12832C9.35843 2.93992 9.12377 2.87502 8.98642 3.01237L8.75185 3.24695C8.63806 3.36073 8.58599 3.52233 8.61195 3.68114L8.79074 4.77514ZM7.02213 4.44284C7.14103 4.83962 6.91577 5.25766 6.51899 5.37657C5.8172 5.58687 5.30708 6.2382 5.30708 7.00672C5.30708 7.94638 6.06883 8.70813 7.00849 8.70813C7.77819 8.70813 8.43033 8.19644 8.6396 7.49302C8.75772 7.096 9.17531 6.86991 9.57233 6.98802C9.96934 7.10614 10.1954 7.52373 10.0773 7.92075C9.68401 9.24279 8.45997 10.2081 7.00849 10.2081C5.2404 10.2081 3.80708 8.77481 3.80708 7.00672C3.80708 5.55746 4.76949 4.33493 6.0884 3.9397C6.48518 3.82079 6.90323 4.04606 7.02213 4.44284Z",
|
|
407
|
+
fill: "#F9F9F9"
|
|
408
|
+
})
|
|
409
|
+
})
|
|
410
|
+
}),
|
|
411
|
+
isDisplayIconDrag && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
357
412
|
"data-toolbar-icon-drag": true,
|
|
358
413
|
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
359
414
|
width: "16",
|
|
@@ -12,6 +12,16 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
|
|
|
12
12
|
if (props.type === 'section') return null;
|
|
13
13
|
const style = composeAdvanceStyle.composeAdvanceStyle(props.advanced, props.tag, pageType);
|
|
14
14
|
const advanced = props.advanced;
|
|
15
|
+
const interactionAttributes = ()=>{
|
|
16
|
+
let result = {};
|
|
17
|
+
if (props.advanced?.displayInitInteraction !== undefined) {
|
|
18
|
+
result = {
|
|
19
|
+
'display-init': props.advanced?.displayInitInteraction === false ? 'hide' : 'show',
|
|
20
|
+
'gp-interaction-wrapper': ''
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
15
25
|
if (constant.disableWrap.includes(props.tag) && /*#__PURE__*/ react.isValidElement(children)) {
|
|
16
26
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
17
27
|
children: [
|
|
@@ -23,7 +33,11 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
|
|
|
23
33
|
className: advanced?.cssClass,
|
|
24
34
|
...children.props,
|
|
25
35
|
style,
|
|
26
|
-
advanced
|
|
36
|
+
advanced,
|
|
37
|
+
builderAttrs: {
|
|
38
|
+
...children.props.builderAttrs,
|
|
39
|
+
...interactionAttributes()
|
|
40
|
+
}
|
|
27
41
|
})
|
|
28
42
|
]
|
|
29
43
|
});
|
|
@@ -36,6 +50,7 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
|
|
|
36
50
|
}),
|
|
37
51
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
38
52
|
style: style,
|
|
53
|
+
...interactionAttributes(),
|
|
39
54
|
className: `${props.uid} ${advanced?.cssClass}`,
|
|
40
55
|
children: children
|
|
41
56
|
})
|
|
@@ -17,18 +17,18 @@ require('dayjs');
|
|
|
17
17
|
var index = require('../helpers/interaction/index.js');
|
|
18
18
|
require('../helpers/convert.js');
|
|
19
19
|
|
|
20
|
-
const InteractionSuffix = ({
|
|
20
|
+
const InteractionSuffix = ({ uid })=>{
|
|
21
21
|
const { closeSelectOnPage } = index.useInteraction();
|
|
22
22
|
const currentInteraction = PageContext.usePageStore((s)=>s.interactionData?.item);
|
|
23
23
|
const isSelectOnPage = PageContext.usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
24
24
|
const isCurrentInteractionTarget = react.useMemo(()=>{
|
|
25
|
-
return currentInteraction?.targets?.find((t)=>t.uid === uid);
|
|
25
|
+
return currentInteraction?.targets?.find((t)=>t.uid === uid && t.type !== 'PAGE');
|
|
26
26
|
}, [
|
|
27
27
|
currentInteraction,
|
|
28
28
|
uid
|
|
29
29
|
]);
|
|
30
30
|
const isCurrentInteractionTrigger = react.useMemo(()=>{
|
|
31
|
-
return currentInteraction?.self?.uid === uid;
|
|
31
|
+
return currentInteraction?.self?.uid === uid && currentInteraction?.self?.type !== 'PAGE';
|
|
32
32
|
}, [
|
|
33
33
|
currentInteraction,
|
|
34
34
|
uid
|
|
@@ -39,76 +39,15 @@ const InteractionSuffix = ({ tag, uid })=>{
|
|
|
39
39
|
isCurrentInteractionTarget,
|
|
40
40
|
isCurrentInteractionTrigger
|
|
41
41
|
]);
|
|
42
|
-
const positionOffset = react.useMemo(()=>{
|
|
43
|
-
if (isCurrentInteractionTrigger && isCurrentInteractionTarget) {
|
|
44
|
-
return 80;
|
|
45
|
-
}
|
|
46
|
-
return 40;
|
|
47
|
-
}, [
|
|
48
|
-
isCurrentInteractionTrigger,
|
|
49
|
-
isCurrentInteractionTarget
|
|
50
|
-
]);
|
|
51
42
|
if (!isDisplay) {
|
|
52
43
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
53
44
|
}
|
|
54
|
-
return /*#__PURE__*/ jsxRuntime.
|
|
55
|
-
children:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}),
|
|
61
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
62
|
-
className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
|
|
63
|
-
}),
|
|
64
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
65
|
-
className: `gp-hidden gp-absolute interaction-suffix gp-gap-[8px] ${tag == 'Section' ? `gp-left-[-${positionOffset}px]` : `gp-right-[-${positionOffset}px]`}`,
|
|
66
|
-
children: [
|
|
67
|
-
isCurrentInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
68
|
-
className: `gp-h-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center `,
|
|
69
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
70
|
-
width: "16",
|
|
71
|
-
height: "16",
|
|
72
|
-
viewBox: "0 0 16 16",
|
|
73
|
-
fill: "none",
|
|
74
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
75
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
76
|
-
fillRule: "evenodd",
|
|
77
|
-
clipRule: "evenodd",
|
|
78
|
-
d: "M12.9196 5.80449C13.0989 5.80449 13.1876 6.02216 13.0595 6.14749L4.83569 14.1892C4.69517 14.3267 4.46149 14.2002 4.49967 14.0074L5.50422 8.93537C5.53483 8.7808 5.41656 8.6368 5.25898 8.6368H3.08019C2.92551 8.6368 2.82938 8.46874 2.90779 8.33541L6.72099 1.85154C6.75692 1.79045 6.8225 1.75293 6.89338 1.75293H12.5729C12.7386 1.75293 12.8324 1.94273 12.7319 2.07435L10.1891 5.40272C10.0634 5.56724 10.1807 5.80449 10.3877 5.80449H12.9196Z",
|
|
79
|
-
fill: "#F9F9F9"
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
}),
|
|
83
|
-
isCurrentInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
84
|
-
className: `gp-h-8 min-w-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center`,
|
|
85
|
-
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
86
|
-
width: "16",
|
|
87
|
-
height: "16",
|
|
88
|
-
viewBox: "0 0 16 16",
|
|
89
|
-
fill: "none",
|
|
90
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
91
|
-
children: [
|
|
92
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
93
|
-
d: "M8.58987 2.11238C8.62815 2.66333 8.21254 3.141 7.66158 3.17928C6.73192 3.24386 5.84034 3.57396 5.09276 4.13034C4.34519 4.68673 3.77304 5.44602 3.44429 6.31801C3.11554 7.19 3.04401 8.13803 3.23821 9.04947C3.4324 9.96092 3.88415 10.7975 4.53978 11.4597C5.19541 12.122 6.02737 12.5821 6.93682 12.7854C7.84626 12.9888 8.79496 12.9268 9.67021 12.6068C10.5455 12.2869 11.3105 11.7224 11.8743 10.9804C12.4382 10.2385 12.7772 9.35025 12.8512 8.42129C12.895 7.87074 13.3768 7.45996 13.9273 7.50377C14.4779 7.54758 14.8887 8.0294 14.8449 8.57994C14.7406 9.8906 14.2622 11.1438 13.4667 12.1906C12.6711 13.2374 11.5918 14.0338 10.3569 14.4852C9.12204 14.9367 7.78353 15.0241 6.50041 14.7373C5.2173 14.4504 4.0435 13.8012 3.11848 12.8668C2.19345 11.9324 1.55609 10.7522 1.28211 9.46624C1.00813 8.1803 1.10905 6.84274 1.57287 5.61247C2.03669 4.3822 2.84393 3.31093 3.89867 2.52593C4.95342 1.74093 6.21133 1.27521 7.52297 1.18409C8.07393 1.14581 8.5516 1.56142 8.58987 2.11238Z",
|
|
94
|
-
fill: "#F9F9F9"
|
|
95
|
-
}),
|
|
96
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
97
|
-
fillRule: "evenodd",
|
|
98
|
-
clipRule: "evenodd",
|
|
99
|
-
d: "M11.9757 1.25658C12.184 1.31428 12.3452 1.47958 12.3976 1.68929L12.7872 3.24774L14.3457 3.63736C14.5554 3.68978 14.7207 3.85096 14.7784 4.05928C14.8361 4.2676 14.7773 4.49085 14.6244 4.64371L12.7167 6.55141C12.5677 6.70044 12.3514 6.76035 12.1469 6.70924L10.5688 6.3147L8.42436 8.45912C8.19005 8.69344 7.81015 8.69344 7.57583 8.45912C7.34152 8.22481 7.34152 7.84491 7.57583 7.61059L9.72025 5.46617L9.32572 3.88804C9.2746 3.68357 9.33451 3.46728 9.48354 3.31825L11.3912 1.41054C11.5441 1.25769 11.7674 1.19888 11.9757 1.25658ZM10.8795 5.15545L12.1084 5.46267L13.0266 4.54451L12.1469 4.3246C11.9319 4.27086 11.7641 4.10301 11.7104 3.88804L11.4904 3.0084L10.5723 3.92656L10.8795 5.15545Z",
|
|
100
|
-
fill: "#F9F9F9"
|
|
101
|
-
}),
|
|
102
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
103
|
-
d: "M7.35783 6.45343C7.87208 6.25201 8.12568 5.67185 7.92426 5.15761C7.72284 4.64336 7.14268 4.38976 6.62844 4.59118C6.05705 4.81498 5.55049 5.17772 5.15453 5.64655C4.75858 6.11538 4.4857 6.67552 4.36055 7.27631C4.23539 7.87709 4.26189 8.49961 4.43764 9.08758C4.6134 9.67555 4.93289 10.2105 5.36727 10.6439C5.80165 11.0774 6.33722 11.3958 6.92556 11.5702C7.51391 11.7445 8.13643 11.7695 8.73683 11.6427C9.33723 11.5158 9.89652 11.2413 10.3641 10.8439C10.8318 10.4465 11.1929 9.93885 11.4151 9.36679C11.615 8.85196 11.3597 8.27254 10.8449 8.07262C10.3301 7.87269 9.75066 8.12797 9.55073 8.6428C9.44887 8.9051 9.28329 9.1378 9.06901 9.3199C8.85474 9.50199 8.59851 9.62774 8.32352 9.68582C8.04853 9.7439 7.76341 9.73249 7.49394 9.65262C7.22445 9.57274 6.97907 9.42691 6.78001 9.22825C6.58093 9.0296 6.43446 8.78439 6.35386 8.51478C6.27327 8.24517 6.26112 7.9597 6.31851 7.6842C6.37591 7.4087 6.50102 7.1519 6.68251 6.93702C6.86399 6.72214 7.0961 6.55595 7.35783 6.45343Z",
|
|
104
|
-
fill: "#F9F9F9"
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
]
|
|
110
|
-
})
|
|
111
|
-
]
|
|
45
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
46
|
+
children: isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
47
|
+
className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-sm gp-font-medium gp-hidden interaction-use-custom-element",
|
|
48
|
+
onClick: closeSelectOnPage,
|
|
49
|
+
children: "Use element"
|
|
50
|
+
})
|
|
112
51
|
});
|
|
113
52
|
};
|
|
114
53
|
|
|
@@ -215,7 +215,7 @@ const RenderCustomCode = (item)=>{
|
|
|
215
215
|
};
|
|
216
216
|
const appendAnimation = (props, liquid)=>{
|
|
217
217
|
const { advanced, tag } = props;
|
|
218
|
-
const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction
|
|
218
|
+
const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction } = advanced ?? {};
|
|
219
219
|
const getAnimationType = (settings, type)=>{
|
|
220
220
|
return settings?.triggerConfig?.[type]?.animation ?? 'none';
|
|
221
221
|
};
|
|
@@ -243,7 +243,8 @@ const appendAnimation = (props, liquid)=>{
|
|
|
243
243
|
};
|
|
244
244
|
return render.template`
|
|
245
245
|
<gp-animation
|
|
246
|
-
|
|
246
|
+
gp-interaction-wrapper
|
|
247
|
+
display-init="${displayInitInteraction === false ? 'hide' : 'show'}"
|
|
247
248
|
gp-data='${JSON.stringify({
|
|
248
249
|
config: animation,
|
|
249
250
|
tag,
|
|
@@ -56,6 +56,14 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
|
56
56
|
selectType
|
|
57
57
|
}
|
|
58
58
|
}));
|
|
59
|
+
},
|
|
60
|
+
setInteractionSettingType: (settingType)=>{
|
|
61
|
+
set((state)=>({
|
|
62
|
+
interactionData: {
|
|
63
|
+
...state.interactionData,
|
|
64
|
+
settingType
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
59
67
|
}
|
|
60
68
|
}));
|
|
61
69
|
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
|
|
@@ -65,7 +73,7 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
|
|
|
65
73
|
productOffers,
|
|
66
74
|
publicStoreFrontData,
|
|
67
75
|
interactionData: {
|
|
68
|
-
selectType: '
|
|
76
|
+
selectType: 'ELEMENT'
|
|
69
77
|
}
|
|
70
78
|
}), [
|
|
71
79
|
dynamicProduct,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const PublishedShopMetasDocument = `
|
|
4
|
+
query PublishedShopMetas($keys: [String!]) {
|
|
5
|
+
publishedShopMetas(keys: $keys) {
|
|
6
|
+
id
|
|
7
|
+
createdAt
|
|
8
|
+
updatedAt
|
|
9
|
+
key
|
|
10
|
+
value
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports.PublishedShopMetasDocument = PublishedShopMetasDocument;
|
|
@@ -53,10 +53,16 @@ const animations = ()=>{
|
|
|
53
53
|
'left',
|
|
54
54
|
'right'
|
|
55
55
|
].includes(direction ?? '') ? 'X' : 'Y';
|
|
56
|
-
|
|
56
|
+
let isNeg = [
|
|
57
57
|
'left',
|
|
58
58
|
'down'
|
|
59
59
|
].includes(direction ?? '') ? '-' : '';
|
|
60
|
+
if (reverse) {
|
|
61
|
+
isNeg = [
|
|
62
|
+
'left',
|
|
63
|
+
'down'
|
|
64
|
+
].includes(direction ?? '') ? '' : '-';
|
|
65
|
+
}
|
|
60
66
|
const preset = [
|
|
61
67
|
{
|
|
62
68
|
opacity: 0,
|
|
@@ -126,7 +132,10 @@ const animations = ()=>{
|
|
|
126
132
|
opacity: 1
|
|
127
133
|
}
|
|
128
134
|
];
|
|
129
|
-
|
|
135
|
+
let zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
|
|
136
|
+
if (reverse) {
|
|
137
|
+
zoomPreset = zoomDirection === 'in' ? zoomOutPreset : zoomInPreset;
|
|
138
|
+
}
|
|
130
139
|
return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
|
|
131
140
|
...generateOptions(normalizedOptions, 700)
|
|
132
141
|
});
|
|
@@ -13,7 +13,9 @@ const getStyleBackgroundByDevice = (background, options)=>{
|
|
|
13
13
|
...getStyleBgColor(background)
|
|
14
14
|
} : {},
|
|
15
15
|
...!options?.ignoreBackgroundImage ? {
|
|
16
|
-
...getStyleBgImage(background, options)
|
|
16
|
+
...getStyleBgImage(background, options)
|
|
17
|
+
} : {},
|
|
18
|
+
...!options?.ignoreBackgroundImageProperties ? {
|
|
17
19
|
...getStyleBgPosition(background),
|
|
18
20
|
...getStyleBgSize(background),
|
|
19
21
|
...getStyleBgRepeat(background)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var react = require('react');
|
|
3
4
|
require('react/jsx-runtime');
|
|
4
5
|
require('zustand');
|
|
5
|
-
require('react');
|
|
6
6
|
require('swr');
|
|
7
7
|
var PageContext = require('../../contexts/PageContext.js');
|
|
8
8
|
require('@gem-sdk/adapter-shopify');
|
|
@@ -17,9 +17,17 @@ require('dayjs');
|
|
|
17
17
|
require('../convert.js');
|
|
18
18
|
|
|
19
19
|
const useInteraction = ()=>{
|
|
20
|
+
const ref = react.useRef(null);
|
|
20
21
|
const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
22
|
+
function findElementIncludingSelf(element, selector) {
|
|
23
|
+
if (!(element instanceof Document) && element?.matches(selector)) {
|
|
24
|
+
return element;
|
|
25
|
+
} else {
|
|
26
|
+
return element?.querySelector(selector);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
21
29
|
const onListener = ({ event, selector }, callback)=>{
|
|
22
|
-
const element = document
|
|
30
|
+
const element = findElementIncludingSelf(ref.current || document, selector);
|
|
23
31
|
if (!element) return;
|
|
24
32
|
element.addEventListener(event, (e)=>{
|
|
25
33
|
const event = e;
|
|
@@ -27,8 +35,8 @@ const useInteraction = ()=>{
|
|
|
27
35
|
if (callback) callback(params);
|
|
28
36
|
});
|
|
29
37
|
};
|
|
30
|
-
const trigger = ({ event, data, selector })=>{
|
|
31
|
-
const element = document.querySelector(selector);
|
|
38
|
+
const trigger = ({ event, data, selector, element: elementParam })=>{
|
|
39
|
+
const element = elementParam || document.querySelector(selector);
|
|
32
40
|
if (!element) return;
|
|
33
41
|
const eventDispatch = new CustomEvent(event, {
|
|
34
42
|
bubbles: false,
|
|
@@ -59,7 +67,9 @@ const useInteraction = ()=>{
|
|
|
59
67
|
onListener,
|
|
60
68
|
trigger,
|
|
61
69
|
saveToElementInteractionData,
|
|
62
|
-
closeSelectOnPage
|
|
70
|
+
closeSelectOnPage,
|
|
71
|
+
ref,
|
|
72
|
+
findElementIncludingSelf
|
|
63
73
|
};
|
|
64
74
|
};
|
|
65
75
|
|
|
@@ -114,6 +114,18 @@ const YotpoReviewsV3UgcConfig = {
|
|
|
114
114
|
appId: 'eb7dfd7d-db44-4334-bc49-c893b51b36cf'
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
+
const WhatmoreShoppableVideosreelConfig = {
|
|
118
|
+
WhatmoreShoppableVideosreel: {
|
|
119
|
+
appName: 'whatmore-shoppable-videos',
|
|
120
|
+
appId: '20db8a72-315a-4364-8885-64219ee48303'
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const ProductOptionsCustomizerConfig = {
|
|
124
|
+
ProductOptionsCustomizer: {
|
|
125
|
+
appName: 'product-options-customizer',
|
|
126
|
+
appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
|
|
127
|
+
}
|
|
128
|
+
};
|
|
117
129
|
|
|
118
130
|
exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
|
|
119
131
|
exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
|
|
@@ -124,6 +136,7 @@ exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
|
|
|
124
136
|
exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
|
|
125
137
|
exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
|
|
126
138
|
exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
|
|
139
|
+
exports.ProductOptionsCustomizerConfig = ProductOptionsCustomizerConfig;
|
|
127
140
|
exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
|
|
128
141
|
exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
|
|
129
142
|
exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
|
|
@@ -133,4 +146,5 @@ exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
|
|
|
133
146
|
exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
|
|
134
147
|
exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
|
|
135
148
|
exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
|
|
149
|
+
exports.WhatmoreShoppableVideosreelConfig = WhatmoreShoppableVideosreelConfig;
|
|
136
150
|
exports.YotpoReviewsV3UgcConfig = YotpoReviewsV3UgcConfig;
|
|
@@ -88,6 +88,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
|
|
|
88
88
|
bundle_id: appSetting?.['customBundleId']
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
+
case 'PumperBundlesVolumeDiscount':
|
|
92
|
+
{
|
|
93
|
+
return {
|
|
94
|
+
...currentSetting,
|
|
95
|
+
selected_product: appSetting?.['productHandle'] || '{{ product }}'
|
|
96
|
+
};
|
|
97
|
+
}
|
|
91
98
|
default:
|
|
92
99
|
return currentSetting;
|
|
93
100
|
}
|
|
@@ -107,7 +114,7 @@ const ReviewxpoProductReviewsApp = {
|
|
|
107
114
|
const PumperBundlesVolumeDiscount = {
|
|
108
115
|
PumperBundlesVolumeDiscount: {
|
|
109
116
|
'app-block': {
|
|
110
|
-
selected_product: '{{product}}',
|
|
117
|
+
selected_product: '{{ product }}',
|
|
111
118
|
using_page_builder: false
|
|
112
119
|
}
|
|
113
120
|
}
|
|
@@ -207,7 +214,86 @@ const YotpoReviews = {
|
|
|
207
214
|
}
|
|
208
215
|
}
|
|
209
216
|
};
|
|
217
|
+
const WhatmoreShoppableVideosreel = {
|
|
218
|
+
WhatmoreShoppableVideosreel: {
|
|
219
|
+
'app-block': {
|
|
220
|
+
"heading": "Watch and Buy",
|
|
221
|
+
"template-type": "template-f",
|
|
222
|
+
"show-views": "show",
|
|
223
|
+
"ui-theme": "round",
|
|
224
|
+
"color-primary": "#343434",
|
|
225
|
+
"color-secondary": "#343434",
|
|
226
|
+
"title-font": "poppins_n4",
|
|
227
|
+
"primary-font": "poppins_n4",
|
|
228
|
+
"title-font-size": 40,
|
|
229
|
+
"title-font-size-portrait": 24,
|
|
230
|
+
"landscape-padding": 40,
|
|
231
|
+
"top-bottom-padding": 20,
|
|
232
|
+
"scroll-video-tile-size": 80,
|
|
233
|
+
"scroll-video-tile-size-portrait": 80,
|
|
234
|
+
"min-height": 380
|
|
235
|
+
},
|
|
236
|
+
'app-block-banner': {
|
|
237
|
+
"template-type": "template-banner-a",
|
|
238
|
+
"ui-theme": "round",
|
|
239
|
+
"banner-video-tile-size": 80
|
|
240
|
+
},
|
|
241
|
+
'app-block-collections': {
|
|
242
|
+
"collectionHeading": "W",
|
|
243
|
+
"template-type": "template-collections-b",
|
|
244
|
+
"ui-theme": "round",
|
|
245
|
+
"color-secondary": "#343434",
|
|
246
|
+
"primary-font": "poppins_n4",
|
|
247
|
+
"tile-size": 60,
|
|
248
|
+
"tile-size-portrait": 60,
|
|
249
|
+
"min-height": 250
|
|
250
|
+
},
|
|
251
|
+
'app-block-stories': {
|
|
252
|
+
"template-type": "template-stories-a",
|
|
253
|
+
"ui-theme": "round",
|
|
254
|
+
"color-primary": "#343434",
|
|
255
|
+
"color-secondary": "#343434",
|
|
256
|
+
"primary-font": "poppins_n4",
|
|
257
|
+
"stories-top-bottom-padding": 0,
|
|
258
|
+
"story-tile-size": 40,
|
|
259
|
+
"story-tile-size-desktop": 40
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const ProductOptionsCustomizer = {
|
|
264
|
+
ProductOptionsCustomizer: {
|
|
265
|
+
'product-page-customizer': {
|
|
266
|
+
"pc_container_size": 100,
|
|
267
|
+
"pc_show_options_total": "initial",
|
|
268
|
+
"pc_customizations_total_text": "Customizations Total:",
|
|
269
|
+
"pc_show_preloader": "hide",
|
|
270
|
+
"pc_preloader_color": "",
|
|
271
|
+
"pc_ignore_redirect_command": true,
|
|
272
|
+
"pc_basic_label_text_color": "#000000",
|
|
273
|
+
"pc_basic_label_font_size": 14,
|
|
274
|
+
"pc_basic_label_bolden": "unset",
|
|
275
|
+
"pc_basic_label_space_above": 0,
|
|
276
|
+
"pc_basic_option_background_color": "#FFFFFF",
|
|
277
|
+
"pc_basic_option_text_color": "#000000",
|
|
278
|
+
"pc_basic_option_border_color": "#000000",
|
|
279
|
+
"pc_basic_option_border_style": "solid",
|
|
280
|
+
"pc_basic_option_border_width": 1,
|
|
281
|
+
"pc_basic_option_curve_the_corners": "none",
|
|
282
|
+
"pc_basic_option_font_size": 14,
|
|
283
|
+
"pc_basic_option_bolden": "none",
|
|
284
|
+
"pc_basic_option_width": 100,
|
|
285
|
+
"pc_basic_option_space_above": 0,
|
|
286
|
+
"pc_basic_option_space_below": 0,
|
|
287
|
+
"pc_basic_option_space_inside": 10,
|
|
288
|
+
"pc_advanced_custom_css": "",
|
|
289
|
+
"pc_advanced_custom_js": "",
|
|
290
|
+
"pc_show_image_swatch_preview": false
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
210
294
|
const composeSettingsByWidgetType = {
|
|
295
|
+
...ProductOptionsCustomizer,
|
|
296
|
+
...WhatmoreShoppableVideosreel,
|
|
211
297
|
...JunipProductReviewsUgc,
|
|
212
298
|
...FlyBundlesUpsellsFbt,
|
|
213
299
|
...PreorderNowWodPresale,
|
|
@@ -21,7 +21,9 @@ const mapShopifyAppMeta = {
|
|
|
21
21
|
...appConfig.FlyBundlesUpsellsFbtConfig,
|
|
22
22
|
...appConfig.JunipProductReviewsUgcConfig,
|
|
23
23
|
...appConfig.PreorderNowWodPresaleConfig,
|
|
24
|
-
...appConfig.YotpoReviewsV3UgcConfig
|
|
24
|
+
...appConfig.YotpoReviewsV3UgcConfig,
|
|
25
|
+
...appConfig.WhatmoreShoppableVideosreelConfig,
|
|
26
|
+
...appConfig.ProductOptionsCustomizerConfig
|
|
25
27
|
};
|
|
26
28
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
27
29
|
|
|
@@ -25,13 +25,13 @@ const useApplyAnimation = ({ props })=>{
|
|
|
25
25
|
setAnimationOnFinish,
|
|
26
26
|
setToolbarActive
|
|
27
27
|
});
|
|
28
|
-
const generateAnimation = react.useCallback(({ target, setting, type })=>{
|
|
29
|
-
return animation[type](target, setting);
|
|
28
|
+
const generateAnimation = react.useCallback(({ target, setting, type, reverse })=>{
|
|
29
|
+
return animation[type](target, setting, reverse);
|
|
30
30
|
}, [
|
|
31
31
|
animation
|
|
32
32
|
]);
|
|
33
33
|
const initListAnimations = react.useCallback(()=>{
|
|
34
|
-
const { type, setting } = getAnimationConfig();
|
|
34
|
+
const { type, setting, reverse } = getAnimationConfig();
|
|
35
35
|
if (!type || type === animations.AnimationType.None || !targetObjects.current.length) {
|
|
36
36
|
cancelAnimation();
|
|
37
37
|
return;
|
|
@@ -39,9 +39,9 @@ const useApplyAnimation = ({ props })=>{
|
|
|
39
39
|
const listAnimations = targetObjects.current.map((item)=>generateAnimation({
|
|
40
40
|
type,
|
|
41
41
|
setting,
|
|
42
|
-
target: item.target
|
|
42
|
+
target: item.target,
|
|
43
|
+
reverse
|
|
43
44
|
}));
|
|
44
|
-
console.log('listAnimations', listAnimations);
|
|
45
45
|
cancelAnimation();
|
|
46
46
|
setAnimation(listAnimations);
|
|
47
47
|
}, [
|
package/dist/cjs/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var ModalContext = require('./contexts/ModalContext.js');
|
|
|
19
19
|
var ArticleListContext = require('./contexts/ArticleListContext.js');
|
|
20
20
|
var ArticleContext = require('./contexts/ArticleContext.js');
|
|
21
21
|
var pageViewUp_generated = require('./graphql/mutations/page-view-up.generated.js');
|
|
22
|
+
var publishedShopMetas = require('./graphql/queries/published-shop-metas.js');
|
|
22
23
|
var collectionDetailFilter_generated = require('./graphql/queries/collection-detail-filter.generated.js');
|
|
23
24
|
var collection_generated = require('./graphql/queries/collection.generated.js');
|
|
24
25
|
var collections_generated = require('./graphql/queries/collections.generated.js');
|
|
@@ -150,6 +151,7 @@ exports.useArticleListStore = ArticleListContext.useArticleListStore;
|
|
|
150
151
|
exports.ArticleProvider = ArticleContext.ArticleProvider;
|
|
151
152
|
exports.useArticleStore = ArticleContext.useArticleStore;
|
|
152
153
|
exports.PageViewUpDocument = pageViewUp_generated.PageViewUpDocument;
|
|
154
|
+
exports.PublishedShopMetasDocument = publishedShopMetas.PublishedShopMetasDocument;
|
|
153
155
|
exports.CollectionDetailFilterDocument = collectionDetailFilter_generated.CollectionDetailFilterDocument;
|
|
154
156
|
exports.CollectionDocument = collection_generated.CollectionDocument;
|
|
155
157
|
exports.CollectionsDocument = collections_generated.CollectionsDocument;
|