@gem-sdk/core 1.53.0-dev.135 → 1.53.0-dev.139
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.
|
@@ -385,9 +385,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
385
385
|
fill: "none",
|
|
386
386
|
xmlns: "http://www.w3.org/2000/svg",
|
|
387
387
|
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
d: "M4.
|
|
388
|
+
"fill-rule": "evenodd",
|
|
389
|
+
"clip-rule": "evenodd",
|
|
390
|
+
d: "M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",
|
|
391
391
|
fill: "#F9F9F9"
|
|
392
392
|
})
|
|
393
393
|
})
|
|
@@ -395,15 +395,15 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
395
395
|
isShowIconInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
396
396
|
className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
|
|
397
397
|
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
398
|
-
width: "
|
|
399
|
-
height: "
|
|
400
|
-
viewBox: "0 0
|
|
398
|
+
width: "16",
|
|
399
|
+
height: "16",
|
|
400
|
+
viewBox: "0 0 16 16",
|
|
401
401
|
fill: "none",
|
|
402
402
|
xmlns: "http://www.w3.org/2000/svg",
|
|
403
403
|
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
d: "
|
|
404
|
+
"fill-rule": "evenodd",
|
|
405
|
+
"clip-rule": "evenodd",
|
|
406
|
+
d: "M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",
|
|
407
407
|
fill: "#F9F9F9"
|
|
408
408
|
})
|
|
409
409
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
4
|
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,36 +17,16 @@ 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 = ()=>{
|
|
21
21
|
const { closeSelectOnPage } = index.useInteraction();
|
|
22
|
-
const
|
|
22
|
+
const settingType = PageContext.usePageStore((s)=>s.interactionData?.settingType);
|
|
23
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
24
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
46
25
|
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-
|
|
26
|
+
className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-xs gp-font-medium gp-hidden interaction-use-custom-element ",
|
|
48
27
|
onClick: closeSelectOnPage,
|
|
49
|
-
|
|
28
|
+
"data-setup-interaction": true,
|
|
29
|
+
children: settingType === 'TRIGGER' ? 'Set as trigger' : 'Set as target'
|
|
50
30
|
})
|
|
51
31
|
});
|
|
52
32
|
};
|
|
@@ -381,9 +381,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
381
381
|
fill: "none",
|
|
382
382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
383
383
|
children: /*#__PURE__*/ jsx("path", {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
d: "M4.
|
|
384
|
+
"fill-rule": "evenodd",
|
|
385
|
+
"clip-rule": "evenodd",
|
|
386
|
+
d: "M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",
|
|
387
387
|
fill: "#F9F9F9"
|
|
388
388
|
})
|
|
389
389
|
})
|
|
@@ -391,15 +391,15 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
391
391
|
isShowIconInteractionTarget && /*#__PURE__*/ jsx("div", {
|
|
392
392
|
className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
|
|
393
393
|
children: /*#__PURE__*/ jsx("svg", {
|
|
394
|
-
width: "
|
|
395
|
-
height: "
|
|
396
|
-
viewBox: "0 0
|
|
394
|
+
width: "16",
|
|
395
|
+
height: "16",
|
|
396
|
+
viewBox: "0 0 16 16",
|
|
397
397
|
fill: "none",
|
|
398
398
|
xmlns: "http://www.w3.org/2000/svg",
|
|
399
399
|
children: /*#__PURE__*/ jsx("path", {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
d: "
|
|
400
|
+
"fill-rule": "evenodd",
|
|
401
|
+
"clip-rule": "evenodd",
|
|
402
|
+
d: "M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",
|
|
403
403
|
fill: "#F9F9F9"
|
|
404
404
|
})
|
|
405
405
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
2
|
import 'zustand';
|
|
3
|
+
import 'react';
|
|
4
4
|
import 'swr';
|
|
5
5
|
import { usePageStore } from '../contexts/PageContext.js';
|
|
6
6
|
import '@gem-sdk/adapter-shopify';
|
|
@@ -15,36 +15,16 @@ import 'dayjs';
|
|
|
15
15
|
import { useInteraction } from '../helpers/interaction/index.js';
|
|
16
16
|
import '../helpers/convert.js';
|
|
17
17
|
|
|
18
|
-
const InteractionSuffix = (
|
|
18
|
+
const InteractionSuffix = ()=>{
|
|
19
19
|
const { closeSelectOnPage } = useInteraction();
|
|
20
|
-
const
|
|
20
|
+
const settingType = usePageStore((s)=>s.interactionData?.settingType);
|
|
21
21
|
const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
22
|
-
const isCurrentInteractionTarget = useMemo(()=>{
|
|
23
|
-
return currentInteraction?.targets?.find((t)=>t.uid === uid && t.type !== 'PAGE');
|
|
24
|
-
}, [
|
|
25
|
-
currentInteraction,
|
|
26
|
-
uid
|
|
27
|
-
]);
|
|
28
|
-
const isCurrentInteractionTrigger = useMemo(()=>{
|
|
29
|
-
return currentInteraction?.self?.uid === uid && currentInteraction?.self?.type !== 'PAGE';
|
|
30
|
-
}, [
|
|
31
|
-
currentInteraction,
|
|
32
|
-
uid
|
|
33
|
-
]);
|
|
34
|
-
const isDisplay = useMemo(()=>{
|
|
35
|
-
return isCurrentInteractionTarget || isCurrentInteractionTrigger;
|
|
36
|
-
}, [
|
|
37
|
-
isCurrentInteractionTarget,
|
|
38
|
-
isCurrentInteractionTrigger
|
|
39
|
-
]);
|
|
40
|
-
if (!isDisplay) {
|
|
41
|
-
return /*#__PURE__*/ jsx(Fragment, {});
|
|
42
|
-
}
|
|
43
22
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
44
23
|
children: isSelectOnPage && /*#__PURE__*/ jsx("button", {
|
|
45
|
-
className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-
|
|
24
|
+
className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-xs gp-font-medium gp-hidden interaction-use-custom-element ",
|
|
46
25
|
onClick: closeSelectOnPage,
|
|
47
|
-
|
|
26
|
+
"data-setup-interaction": true,
|
|
27
|
+
children: settingType === 'TRIGGER' ? 'Set as trigger' : 'Set as target'
|
|
48
28
|
})
|
|
49
29
|
});
|
|
50
30
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6989,6 +6989,7 @@ type Mapped$7<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
|
6989
6989
|
active?: boolean;
|
|
6990
6990
|
};
|
|
6991
6991
|
devices?: ResponsiveConfig<U>;
|
|
6992
|
+
compoDefaultValue?: ResponsiveConfig<U>;
|
|
6992
6993
|
emptyOnClear?: boolean;
|
|
6993
6994
|
showVideo?: boolean;
|
|
6994
6995
|
} : {
|
|
@@ -7027,6 +7028,7 @@ type Mapped$7<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
|
7027
7028
|
emptyOnClear?: boolean;
|
|
7028
7029
|
showVideo?: boolean;
|
|
7029
7030
|
default?: T;
|
|
7031
|
+
compoDefaultValue?: T;
|
|
7030
7032
|
};
|
|
7031
7033
|
type SharedControlType<T> = {
|
|
7032
7034
|
[K in keyof T]-?: Mapped$7<K, T[K]>;
|
|
@@ -7881,6 +7883,7 @@ type DropdownInput<T> = SharedControlType<T> & {
|
|
|
7881
7883
|
reversed?: boolean;
|
|
7882
7884
|
showValue?: boolean;
|
|
7883
7885
|
}[];
|
|
7886
|
+
isRowWith?: boolean;
|
|
7884
7887
|
};
|
|
7885
7888
|
|
|
7886
7889
|
type Dropdown<T> = SharedControlType<T> & {
|
|
@@ -8215,9 +8218,30 @@ type SettingUIControl = {
|
|
|
8215
8218
|
state?: SettingStateType;
|
|
8216
8219
|
};
|
|
8217
8220
|
searchKeyword?: string;
|
|
8221
|
+
controlChangeTrigger?: ControlTrigger;
|
|
8218
8222
|
tabs?: SettingUITab[];
|
|
8219
8223
|
info?: LabelWithLang;
|
|
8224
|
+
compoDefaultValue?: any | Record<NameDevices$1, any>;
|
|
8220
8225
|
} & SettingUICompo;
|
|
8226
|
+
type ControlTriggerAction$1 = {
|
|
8227
|
+
controlId: string;
|
|
8228
|
+
newValue: any;
|
|
8229
|
+
field: string;
|
|
8230
|
+
controlType: string;
|
|
8231
|
+
groupType: string;
|
|
8232
|
+
valueIfNull?: any;
|
|
8233
|
+
};
|
|
8234
|
+
type ControlTriggerSetting = {
|
|
8235
|
+
source?: string[];
|
|
8236
|
+
condition?: string;
|
|
8237
|
+
action: ControlTriggerAction$1;
|
|
8238
|
+
};
|
|
8239
|
+
type ControlTrigger = {
|
|
8240
|
+
settings?: ControlTriggerSetting[];
|
|
8241
|
+
options?: {
|
|
8242
|
+
noRecordHistory?: boolean;
|
|
8243
|
+
};
|
|
8244
|
+
};
|
|
8221
8245
|
type SettingUICompo = {
|
|
8222
8246
|
controls?: SettingUIControl[];
|
|
8223
8247
|
iconName?: string;
|
|
@@ -8300,8 +8324,7 @@ type BackgroundImageValue = {
|
|
|
8300
8324
|
altText?: string;
|
|
8301
8325
|
imageTitle?: string;
|
|
8302
8326
|
lazyLoad?: boolean;
|
|
8303
|
-
|
|
8304
|
-
quality?: string;
|
|
8327
|
+
preload?: boolean;
|
|
8305
8328
|
};
|
|
8306
8329
|
type BgSize = 'cover' | 'contain' | '100% 100%';
|
|
8307
8330
|
type BgRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.53.0-dev.
|
|
3
|
+
"version": "1.53.0-dev.139",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@gem-sdk/adapter-shopify": "1.53.0-dev.105",
|
|
31
|
-
"@gem-sdk/styles": "1.53.0-dev.
|
|
31
|
+
"@gem-sdk/styles": "1.53.0-dev.139",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|