@gem-sdk/core 1.56.0-staging.0 → 1.56.0-staging.13
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 +172 -101
- package/dist/cjs/components/ComponentWrapper.js +16 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +16 -2
- package/dist/cjs/components/InteractionSuffix.js +54 -0
- package/dist/cjs/components/Render.liquid.js +22 -7
- package/dist/cjs/contexts/PageContext.js +37 -1
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/cjs/helpers/animations.js +17 -8
- package/dist/cjs/helpers/background.js +1 -1
- package/dist/cjs/helpers/interaction/index.js +85 -0
- package/dist/cjs/helpers/third-party/appConfig.js +14 -0
- package/dist/cjs/helpers/third-party/appSetting.js +16 -0
- 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 +6 -4
- package/dist/cjs/hooks/useInteraction.js +19 -0
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/types/animations.js +2 -0
- package/dist/cjs/types/custom.js +51 -0
- package/dist/esm/components/ComponentToolbarPreview.js +172 -101
- package/dist/esm/components/ComponentWrapper.js +16 -1
- package/dist/esm/components/ComponentWrapperPreview.js +16 -2
- package/dist/esm/components/InteractionSuffix.js +52 -0
- package/dist/esm/components/Render.liquid.js +22 -7
- package/dist/esm/contexts/PageContext.js +37 -1
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/esm/helpers/animations.js +17 -8
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/interaction/index.js +83 -0
- package/dist/esm/helpers/third-party/appConfig.js +13 -1
- package/dist/esm/helpers/third-party/appSetting.js +16 -0
- 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 +6 -4
- package/dist/esm/hooks/useInteraction.js +17 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/types/animations.js +2 -0
- package/dist/esm/types/custom.js +51 -0
- package/dist/types/index.d.ts +121 -6
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ var react = require('react');
|
|
|
7
7
|
require('zustand');
|
|
8
8
|
var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
|
|
9
9
|
var ShopContext = require('../contexts/ShopContext.js');
|
|
10
|
+
var PageContext = require('../contexts/PageContext.js');
|
|
10
11
|
require('@gem-sdk/adapter-shopify');
|
|
11
12
|
require('swr');
|
|
12
13
|
require('swr/mutation');
|
|
@@ -21,6 +22,7 @@ var useToolbarPostPurchase = require('../hooks/useToolbarPostPurchase.js');
|
|
|
21
22
|
var constant = require('./constant.js');
|
|
22
23
|
var AIContentGenerator = require('./ai-generator/AIContentGenerator.js');
|
|
23
24
|
var AIGenContentLoading = require('./ai-generator/AIGenContentLoading.js');
|
|
25
|
+
var InteractionSuffix = require('./InteractionSuffix.js');
|
|
24
26
|
require('../helpers/convert.js');
|
|
25
27
|
|
|
26
28
|
const SECTION_LIMIT = 25;
|
|
@@ -53,6 +55,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
53
55
|
text: ''
|
|
54
56
|
});
|
|
55
57
|
const [isDisableDuplicate, setIsDisableDuplicate] = react.useState(false);
|
|
58
|
+
const interactionData = PageContext.usePageStore((s)=>s.interactionData);
|
|
56
59
|
const isSaleFunnelPage = react.useMemo(()=>editingPageType === 'POST_PURCHASE', [
|
|
57
60
|
editingPageType
|
|
58
61
|
]);
|
|
@@ -132,6 +135,33 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
132
135
|
articleUid,
|
|
133
136
|
linkShopDefault
|
|
134
137
|
]);
|
|
138
|
+
const isSelectOnPage = react.useMemo(()=>interactionData?.isSelectOnPage, [
|
|
139
|
+
interactionData?.isSelectOnPage
|
|
140
|
+
]);
|
|
141
|
+
const settingType = react.useMemo(()=>interactionData?.settingType, [
|
|
142
|
+
interactionData?.settingType
|
|
143
|
+
]);
|
|
144
|
+
const isShowIconInteractionTarget = react.useMemo(()=>{
|
|
145
|
+
return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
|
|
146
|
+
}, [
|
|
147
|
+
interactionData?.item?.targets,
|
|
148
|
+
props.uid,
|
|
149
|
+
settingType
|
|
150
|
+
]);
|
|
151
|
+
const isShowIconInteractionTrigger = react.useMemo(()=>{
|
|
152
|
+
return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
|
|
153
|
+
}, [
|
|
154
|
+
interactionData?.item?.self?.type,
|
|
155
|
+
interactionData?.item?.self?.uid,
|
|
156
|
+
props.uid,
|
|
157
|
+
settingType
|
|
158
|
+
]);
|
|
159
|
+
const isDisplayIconDrag = react.useMemo(()=>{
|
|
160
|
+
return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
|
|
161
|
+
}, [
|
|
162
|
+
isShowIconInteractionTarget,
|
|
163
|
+
isShowIconInteractionTrigger
|
|
164
|
+
]);
|
|
135
165
|
// Get parents
|
|
136
166
|
const onActiveComponent = react.useCallback((e)=>{
|
|
137
167
|
const detail = e.detail;
|
|
@@ -344,7 +374,39 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
344
374
|
onClick: (e)=>onShowParent(e),
|
|
345
375
|
"aria-hidden": "true",
|
|
346
376
|
children: [
|
|
347
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
377
|
+
isShowIconInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
378
|
+
className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
|
|
379
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
380
|
+
width: "12",
|
|
381
|
+
height: "13",
|
|
382
|
+
viewBox: "0 0 12 13",
|
|
383
|
+
fill: "none",
|
|
384
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
385
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
386
|
+
fillRule: "evenodd",
|
|
387
|
+
clipRule: "evenodd",
|
|
388
|
+
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",
|
|
389
|
+
fill: "#F9F9F9"
|
|
390
|
+
})
|
|
391
|
+
})
|
|
392
|
+
}),
|
|
393
|
+
isShowIconInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
394
|
+
className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
|
|
395
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
396
|
+
width: "14",
|
|
397
|
+
height: "14",
|
|
398
|
+
viewBox: "0 0 14 14",
|
|
399
|
+
fill: "none",
|
|
400
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
401
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
402
|
+
fillRule: "evenodd",
|
|
403
|
+
clipRule: "evenodd",
|
|
404
|
+
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",
|
|
405
|
+
fill: "#F9F9F9"
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
}),
|
|
409
|
+
isDisplayIconDrag && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
348
410
|
"data-toolbar-icon-drag": true,
|
|
349
411
|
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
350
412
|
width: "16",
|
|
@@ -491,109 +553,118 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
491
553
|
]
|
|
492
554
|
}, parent.uid);
|
|
493
555
|
}),
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
556
|
+
!isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
557
|
+
children: [
|
|
558
|
+
' ',
|
|
559
|
+
props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
|
|
560
|
+
...props
|
|
561
|
+
}),
|
|
562
|
+
isEnableAIContent() && /*#__PURE__*/ jsxRuntime.jsx(AIContentGenerator.AIContentGenerator, {
|
|
563
|
+
...props
|
|
564
|
+
}),
|
|
565
|
+
props.tag == 'Sticky' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
566
|
+
"data-toolbar-zoom-out": true,
|
|
567
|
+
onClick: (e)=>onZoomOut(e),
|
|
568
|
+
"aria-hidden": "true",
|
|
569
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
570
|
+
width: "16",
|
|
571
|
+
height: "16",
|
|
572
|
+
viewBox: "0 0 16 16",
|
|
573
|
+
fill: "none",
|
|
574
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
575
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
576
|
+
fillRule: "evenodd",
|
|
577
|
+
clipRule: "evenodd",
|
|
578
|
+
d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
|
|
579
|
+
fill: "currentColor"
|
|
580
|
+
})
|
|
581
|
+
})
|
|
582
|
+
}),
|
|
583
|
+
editAbleElementList.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
584
|
+
"data-toolbar-title": true,
|
|
585
|
+
enable: true,
|
|
586
|
+
"data-toolbar-disable": false,
|
|
587
|
+
text: "Edit content in Shopify",
|
|
588
|
+
position: "top",
|
|
589
|
+
onClick: goToShopifyEditLink,
|
|
590
|
+
"aria-hidden": "true",
|
|
591
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
592
|
+
width: "16",
|
|
593
|
+
height: "16",
|
|
594
|
+
viewBox: "0 0 16 16",
|
|
595
|
+
fill: "none",
|
|
596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
597
|
+
children: [
|
|
598
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
599
|
+
fillRule: "evenodd",
|
|
600
|
+
clipRule: "evenodd",
|
|
601
|
+
d: "M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",
|
|
602
|
+
fill: "currentColor"
|
|
603
|
+
}),
|
|
604
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
605
|
+
d: "M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",
|
|
606
|
+
fill: "currentColor"
|
|
607
|
+
}),
|
|
608
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
609
|
+
d: "M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",
|
|
610
|
+
fill: "currentColor"
|
|
611
|
+
}),
|
|
612
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
613
|
+
d: "M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",
|
|
614
|
+
fill: "currentColor"
|
|
615
|
+
})
|
|
616
|
+
]
|
|
617
|
+
})
|
|
618
|
+
}),
|
|
619
|
+
/*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
620
|
+
enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
|
|
621
|
+
text: "Page has reached Shopify’s 25 section-limit",
|
|
622
|
+
position: "bottom",
|
|
623
|
+
"data-toolbar-duplicate": true,
|
|
624
|
+
"data-toolbar-disable": props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isDisableDuplicate,
|
|
625
|
+
onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
|
|
626
|
+
"aria-hidden": "true",
|
|
627
|
+
className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
|
|
628
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
629
|
+
width: "16",
|
|
630
|
+
height: "16",
|
|
631
|
+
viewBox: "0 0 16 16",
|
|
632
|
+
fill: "none",
|
|
633
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
634
|
+
fillRule: "evenodd",
|
|
635
|
+
clipRule: "evenodd",
|
|
636
|
+
d: "M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",
|
|
637
|
+
fill: "currentColor"
|
|
638
|
+
})
|
|
639
|
+
})
|
|
640
|
+
}),
|
|
641
|
+
/*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
642
|
+
"data-toolbar-delete": true,
|
|
643
|
+
onClick: (e)=>isDisableDelete ? null : onDelete(e),
|
|
644
|
+
enable: isDisableDelete,
|
|
645
|
+
"data-toolbar-disable": isDisableDelete,
|
|
646
|
+
width: tooltipText.width,
|
|
647
|
+
text: tooltipText.text,
|
|
648
|
+
position: deleteTooltipPosition,
|
|
649
|
+
"aria-hidden": "true",
|
|
650
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
651
|
+
width: "16",
|
|
652
|
+
height: "16",
|
|
653
|
+
viewBox: "0 0 16 16",
|
|
654
|
+
fill: "none",
|
|
655
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
656
|
+
fillRule: "evenodd",
|
|
657
|
+
clipRule: "evenodd",
|
|
658
|
+
d: "M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",
|
|
659
|
+
fill: "currentColor"
|
|
660
|
+
})
|
|
550
661
|
})
|
|
551
|
-
]
|
|
552
|
-
})
|
|
553
|
-
}),
|
|
554
|
-
/*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
555
|
-
enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
|
|
556
|
-
text: "Page has reached Shopify’s 25 section-limit",
|
|
557
|
-
position: "bottom",
|
|
558
|
-
"data-toolbar-duplicate": true,
|
|
559
|
-
"data-toolbar-disable": props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isDisableDuplicate,
|
|
560
|
-
onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
|
|
561
|
-
"aria-hidden": "true",
|
|
562
|
-
className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
|
|
563
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
564
|
-
width: "16",
|
|
565
|
-
height: "16",
|
|
566
|
-
viewBox: "0 0 16 16",
|
|
567
|
-
fill: "none",
|
|
568
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
569
|
-
fillRule: "evenodd",
|
|
570
|
-
clipRule: "evenodd",
|
|
571
|
-
d: "M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",
|
|
572
|
-
fill: "currentColor"
|
|
573
662
|
})
|
|
574
|
-
|
|
663
|
+
]
|
|
575
664
|
}),
|
|
576
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
enable: isDisableDelete,
|
|
580
|
-
"data-toolbar-disable": isDisableDelete,
|
|
581
|
-
width: tooltipText.width,
|
|
582
|
-
text: tooltipText.text,
|
|
583
|
-
position: deleteTooltipPosition,
|
|
584
|
-
"aria-hidden": "true",
|
|
585
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
586
|
-
width: "16",
|
|
587
|
-
height: "16",
|
|
588
|
-
viewBox: "0 0 16 16",
|
|
589
|
-
fill: "none",
|
|
590
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
591
|
-
fillRule: "evenodd",
|
|
592
|
-
clipRule: "evenodd",
|
|
593
|
-
d: "M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",
|
|
594
|
-
fill: "currentColor"
|
|
595
|
-
})
|
|
596
|
-
})
|
|
665
|
+
/*#__PURE__*/ jsxRuntime.jsx(InteractionSuffix.InteractionSuffix, {
|
|
666
|
+
tag: props.tag,
|
|
667
|
+
uid: props.uid
|
|
597
668
|
})
|
|
598
669
|
]
|
|
599
670
|
}, props.uid),
|
|
@@ -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
|
})
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var composeAdvanceStyle = require('../helpers/compose-advance-style.js');
|
|
8
|
+
var useInteraction = require('../hooks/useInteraction.js');
|
|
8
9
|
var constant = require('./constant.js');
|
|
9
10
|
var RenderCustomCode = require('./RenderCustomCode.js');
|
|
10
11
|
var ComponentToolbarPreview = require('./ComponentToolbarPreview.js');
|
|
@@ -32,6 +33,19 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
32
33
|
}, [
|
|
33
34
|
props.uid
|
|
34
35
|
]);
|
|
36
|
+
const currentProps = props;
|
|
37
|
+
const { getAnimationByUid } = useInteraction.useInteraction();
|
|
38
|
+
const animationByInteraction = getAnimationByUid(props.uid);
|
|
39
|
+
if (animationByInteraction) {
|
|
40
|
+
currentProps.advanced = {
|
|
41
|
+
...currentProps.advanced,
|
|
42
|
+
animation: {
|
|
43
|
+
desktop: animationByInteraction,
|
|
44
|
+
tablet: animationByInteraction,
|
|
45
|
+
mobile: animationByInteraction
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
35
49
|
const pageType = shop.usePageType();
|
|
36
50
|
if (props.type === 'section') {
|
|
37
51
|
return null;
|
|
@@ -136,7 +150,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
136
150
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
137
151
|
children: [
|
|
138
152
|
/*#__PURE__*/ jsxRuntime.jsx(ComponentAnimation.default, {
|
|
139
|
-
...
|
|
153
|
+
...currentProps
|
|
140
154
|
}),
|
|
141
155
|
/*#__PURE__*/ jsxRuntime.jsx(RenderCustomCode.default, {
|
|
142
156
|
uid: props.uid,
|
|
@@ -165,7 +179,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
165
179
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
166
180
|
children: [
|
|
167
181
|
/*#__PURE__*/ jsxRuntime.jsx(ComponentAnimation.default, {
|
|
168
|
-
...
|
|
182
|
+
...currentProps
|
|
169
183
|
}),
|
|
170
184
|
/*#__PURE__*/ jsxRuntime.jsx(RenderCustomCode.default, {
|
|
171
185
|
uid: props.uid,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
require('zustand');
|
|
6
|
+
require('swr');
|
|
7
|
+
var PageContext = require('../contexts/PageContext.js');
|
|
8
|
+
require('@gem-sdk/adapter-shopify');
|
|
9
|
+
require('swr/mutation');
|
|
10
|
+
require('swr/infinite');
|
|
11
|
+
require('vanilla-lazyload');
|
|
12
|
+
require('../hooks/useCartUI.js');
|
|
13
|
+
require('react-transition-group');
|
|
14
|
+
require('@gem-sdk/core');
|
|
15
|
+
require('classnames');
|
|
16
|
+
require('dayjs');
|
|
17
|
+
var index = require('../helpers/interaction/index.js');
|
|
18
|
+
require('../helpers/convert.js');
|
|
19
|
+
|
|
20
|
+
const InteractionSuffix = ({ uid })=>{
|
|
21
|
+
const { closeSelectOnPage } = index.useInteraction();
|
|
22
|
+
const currentInteraction = PageContext.usePageStore((s)=>s.interactionData?.item);
|
|
23
|
+
const isSelectOnPage = PageContext.usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
24
|
+
const isCurrentInteractionTarget = react.useMemo(()=>{
|
|
25
|
+
return currentInteraction?.targets?.find((t)=>t.uid === uid && t.type !== 'PAGE');
|
|
26
|
+
}, [
|
|
27
|
+
currentInteraction,
|
|
28
|
+
uid
|
|
29
|
+
]);
|
|
30
|
+
const isCurrentInteractionTrigger = react.useMemo(()=>{
|
|
31
|
+
return currentInteraction?.self?.uid === uid && currentInteraction?.self?.type !== 'PAGE';
|
|
32
|
+
}, [
|
|
33
|
+
currentInteraction,
|
|
34
|
+
uid
|
|
35
|
+
]);
|
|
36
|
+
const isDisplay = react.useMemo(()=>{
|
|
37
|
+
return isCurrentInteractionTarget || isCurrentInteractionTrigger;
|
|
38
|
+
}, [
|
|
39
|
+
isCurrentInteractionTarget,
|
|
40
|
+
isCurrentInteractionTrigger
|
|
41
|
+
]);
|
|
42
|
+
if (!isDisplay) {
|
|
43
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
44
|
+
}
|
|
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
|
+
})
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.InteractionSuffix = InteractionSuffix;
|
|
@@ -39,7 +39,6 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
39
39
|
const item = builder[uid];
|
|
40
40
|
const Component = components[item?.tag];
|
|
41
41
|
if (!Component) {
|
|
42
|
-
console.log('Miss component: ', item);
|
|
43
42
|
return {
|
|
44
43
|
liquid: '',
|
|
45
44
|
extraFiles
|
|
@@ -76,6 +75,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
76
75
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
77
76
|
pageContext,
|
|
78
77
|
...passProps,
|
|
78
|
+
builderAttrs: {
|
|
79
|
+
...passProps.builderAttrs
|
|
80
|
+
},
|
|
79
81
|
rawChildren: item.childrens.map((id)=>{
|
|
80
82
|
return {
|
|
81
83
|
...builder[id],
|
|
@@ -111,11 +113,14 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
111
113
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
112
114
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
113
115
|
pageContext,
|
|
114
|
-
...passProps
|
|
116
|
+
...passProps,
|
|
117
|
+
builderAttrs: {
|
|
118
|
+
...passProps.builderAttrs
|
|
119
|
+
}
|
|
115
120
|
});
|
|
116
121
|
});
|
|
117
122
|
} else {
|
|
118
|
-
liquid = render.template`<div style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
123
|
+
liquid = render.template`<div gp-el-wrapper style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
119
124
|
${render.RenderIf(item?.childrens?.length, ()=>{
|
|
120
125
|
return Component({
|
|
121
126
|
builderProps: {
|
|
@@ -130,6 +135,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
130
135
|
},
|
|
131
136
|
pageContext,
|
|
132
137
|
...passProps,
|
|
138
|
+
builderAttrs: {
|
|
139
|
+
...passProps.builderAttrs
|
|
140
|
+
},
|
|
133
141
|
rawChildren: item.childrens.map((id)=>{
|
|
134
142
|
return {
|
|
135
143
|
...builder[id],
|
|
@@ -166,7 +174,10 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
166
174
|
pageContext,
|
|
167
175
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
168
176
|
style: componentIconList.includes(item.tag) ? style : null,
|
|
169
|
-
...passProps
|
|
177
|
+
...passProps,
|
|
178
|
+
builderAttrs: {
|
|
179
|
+
...passProps.builderAttrs
|
|
180
|
+
}
|
|
170
181
|
});
|
|
171
182
|
})}
|
|
172
183
|
</div>`;
|
|
@@ -204,7 +215,7 @@ const RenderCustomCode = (item)=>{
|
|
|
204
215
|
};
|
|
205
216
|
const appendAnimation = (props, liquid)=>{
|
|
206
217
|
const { advanced, tag } = props;
|
|
207
|
-
const { animation, op: opacity } = advanced ?? {};
|
|
218
|
+
const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction } = advanced ?? {};
|
|
208
219
|
const getAnimationType = (settings, type)=>{
|
|
209
220
|
return settings?.triggerConfig?.[type]?.animation ?? 'none';
|
|
210
221
|
};
|
|
@@ -218,7 +229,8 @@ const appendAnimation = (props, liquid)=>{
|
|
|
218
229
|
const hoverDesktop = getAnimationType(getSettingsByDevice('desktop'), 'hover');
|
|
219
230
|
const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
|
|
220
231
|
const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
|
|
221
|
-
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
232
|
+
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none' || !!hasAnimationInteraction;
|
|
233
|
+
const enableAnimationWhenInit = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
222
234
|
if (!enableAnimation) return liquid;
|
|
223
235
|
const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
|
|
224
236
|
'shake',
|
|
@@ -231,10 +243,13 @@ const appendAnimation = (props, liquid)=>{
|
|
|
231
243
|
};
|
|
232
244
|
return render.template`
|
|
233
245
|
<gp-animation
|
|
246
|
+
gp-interaction-wrapper
|
|
247
|
+
display-init="${displayInitInteraction === false ? 'hide' : 'show'}"
|
|
234
248
|
gp-data='${JSON.stringify({
|
|
235
249
|
config: animation,
|
|
236
250
|
tag,
|
|
237
|
-
opacity
|
|
251
|
+
opacity,
|
|
252
|
+
notEnableAnimationWhenInit: !enableAnimationWhenInit
|
|
238
253
|
})}'
|
|
239
254
|
style="${{
|
|
240
255
|
display: 'contents'
|
|
@@ -31,6 +31,39 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
|
31
31
|
set({
|
|
32
32
|
publicStoreFrontData: publicStoreFrontData
|
|
33
33
|
});
|
|
34
|
+
},
|
|
35
|
+
setInteractionIsSelectOnPage: (value)=>{
|
|
36
|
+
set((state)=>({
|
|
37
|
+
interactionData: {
|
|
38
|
+
...state.interactionData,
|
|
39
|
+
isSelectOnPage: value
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
},
|
|
43
|
+
setInteractionItem: (item)=>{
|
|
44
|
+
set((state)=>({
|
|
45
|
+
interactionData: {
|
|
46
|
+
...state.interactionData,
|
|
47
|
+
item,
|
|
48
|
+
isSelectOnPage: state.interactionData?.isSelectOnPage || false
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
},
|
|
52
|
+
setInteractionSelectType: (selectType)=>{
|
|
53
|
+
set((state)=>({
|
|
54
|
+
interactionData: {
|
|
55
|
+
...state.interactionData,
|
|
56
|
+
selectType
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
},
|
|
60
|
+
setInteractionSettingType: (settingType)=>{
|
|
61
|
+
set((state)=>({
|
|
62
|
+
interactionData: {
|
|
63
|
+
...state.interactionData,
|
|
64
|
+
settingType
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
34
67
|
}
|
|
35
68
|
}));
|
|
36
69
|
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
|
|
@@ -38,7 +71,10 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
|
|
|
38
71
|
dynamicProduct,
|
|
39
72
|
dynamicCollection,
|
|
40
73
|
productOffers,
|
|
41
|
-
publicStoreFrontData
|
|
74
|
+
publicStoreFrontData,
|
|
75
|
+
interactionData: {
|
|
76
|
+
selectType: 'ELEMENT'
|
|
77
|
+
}
|
|
42
78
|
}), [
|
|
43
79
|
dynamicProduct,
|
|
44
80
|
dynamicCollection,
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
themePageCustomFonts {
|
|
29
29
|
...CustomFontSelect
|
|
30
30
|
}
|
|
31
|
+
interaction {
|
|
32
|
+
id
|
|
33
|
+
value
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
`;
|
|
33
37
|
const PreviewThemePageSelect = `
|
|
@@ -55,6 +59,10 @@ const PreviewThemePageSelect = `
|
|
|
55
59
|
themePageCustomCode {
|
|
56
60
|
...CustomCodeSelect
|
|
57
61
|
}
|
|
62
|
+
interaction {
|
|
63
|
+
id
|
|
64
|
+
value
|
|
65
|
+
}
|
|
58
66
|
}
|
|
59
67
|
`;
|
|
60
68
|
|