@gem-sdk/core 1.44.0-dev.55 → 1.44.0-dev.60
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.
|
@@ -47,6 +47,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
47
47
|
const [deleteTooltipPosition, setDeleteTooltipPosition] = react.useState('top');
|
|
48
48
|
const [isDisableDelete, setIsUnableDelete] = react.useState(false);
|
|
49
49
|
const [parentProductUid, setParentProductUid] = react.useState('');
|
|
50
|
+
const [articleUid, setArticleUid] = react.useState('');
|
|
50
51
|
const [tooltipText, setTooltipText] = react.useState({
|
|
51
52
|
width: '',
|
|
52
53
|
text: ''
|
|
@@ -61,6 +62,18 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
61
62
|
'Product Description',
|
|
62
63
|
'Product Price'
|
|
63
64
|
];
|
|
65
|
+
const editArticleElementList = [
|
|
66
|
+
'Article Title',
|
|
67
|
+
'Article Content',
|
|
68
|
+
'Article Image',
|
|
69
|
+
'Article Author',
|
|
70
|
+
'Article Category',
|
|
71
|
+
'Article Date'
|
|
72
|
+
];
|
|
73
|
+
const editAbleElementList = [
|
|
74
|
+
...editProductElementList,
|
|
75
|
+
...editArticleElementList
|
|
76
|
+
];
|
|
64
77
|
const isOverToolbarPosition = (el, parent)=>{
|
|
65
78
|
const parentLength = parents.length;
|
|
66
79
|
const rect = el.getBoundingClientRect();
|
|
@@ -106,15 +119,29 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
106
119
|
}, [
|
|
107
120
|
storefrontUrl
|
|
108
121
|
]);
|
|
109
|
-
const
|
|
110
|
-
return
|
|
122
|
+
const linkShopDefault = react.useMemo(()=>{
|
|
123
|
+
return `https://admin.shopify.com/store/${shopName}`;
|
|
111
124
|
}, [
|
|
112
|
-
productId,
|
|
113
125
|
shopName
|
|
114
126
|
]);
|
|
127
|
+
const linkEditProduct = react.useMemo(()=>{
|
|
128
|
+
return productId ? `${linkShopDefault}/products/${productId}` : '';
|
|
129
|
+
}, [
|
|
130
|
+
linkShopDefault,
|
|
131
|
+
productId
|
|
132
|
+
]);
|
|
133
|
+
const linkEditArticle = react.useMemo(()=>{
|
|
134
|
+
return articleUid ? `${linkShopDefault}/articles/${articleUid}` : '';
|
|
135
|
+
}, [
|
|
136
|
+
articleUid,
|
|
137
|
+
linkShopDefault
|
|
138
|
+
]);
|
|
115
139
|
// Get parents
|
|
116
140
|
const onActiveComponent = react.useCallback((e)=>{
|
|
117
141
|
const detail = e.detail;
|
|
142
|
+
if (detail?.articleId) {
|
|
143
|
+
setArticleUid(detail.articleId);
|
|
144
|
+
}
|
|
118
145
|
if (detail?.componentUid == props.uid) {
|
|
119
146
|
getDeleteTooltipPosition();
|
|
120
147
|
if (isSaleFunnelPage) {
|
|
@@ -206,7 +233,15 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
206
233
|
window.dispatchEvent(event);
|
|
207
234
|
};
|
|
208
235
|
const goToShopifyEditLink = ()=>{
|
|
209
|
-
|
|
236
|
+
if (editArticleElementList.includes(toolbarName() ?? '')) {
|
|
237
|
+
window.open(linkEditArticle, '_blank');
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (editProductElementList.includes(toolbarName() ?? '')) {
|
|
241
|
+
window.open(linkEditProduct, '_blank');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
window.open(linkShopDefault, '_blank');
|
|
210
245
|
};
|
|
211
246
|
const onDelete = (e)=>{
|
|
212
247
|
e.preventDefault();
|
|
@@ -480,7 +515,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
480
515
|
})
|
|
481
516
|
})
|
|
482
517
|
}),
|
|
483
|
-
|
|
518
|
+
editAbleElementList.includes(toolbarName() ?? '') && /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
484
519
|
"data-toolbar-title": true,
|
|
485
520
|
enable: true,
|
|
486
521
|
"data-toolbar-disable": false,
|
|
@@ -43,6 +43,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
43
43
|
const [deleteTooltipPosition, setDeleteTooltipPosition] = useState('top');
|
|
44
44
|
const [isDisableDelete, setIsUnableDelete] = useState(false);
|
|
45
45
|
const [parentProductUid, setParentProductUid] = useState('');
|
|
46
|
+
const [articleUid, setArticleUid] = useState('');
|
|
46
47
|
const [tooltipText, setTooltipText] = useState({
|
|
47
48
|
width: '',
|
|
48
49
|
text: ''
|
|
@@ -57,6 +58,18 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
57
58
|
'Product Description',
|
|
58
59
|
'Product Price'
|
|
59
60
|
];
|
|
61
|
+
const editArticleElementList = [
|
|
62
|
+
'Article Title',
|
|
63
|
+
'Article Content',
|
|
64
|
+
'Article Image',
|
|
65
|
+
'Article Author',
|
|
66
|
+
'Article Category',
|
|
67
|
+
'Article Date'
|
|
68
|
+
];
|
|
69
|
+
const editAbleElementList = [
|
|
70
|
+
...editProductElementList,
|
|
71
|
+
...editArticleElementList
|
|
72
|
+
];
|
|
60
73
|
const isOverToolbarPosition = (el, parent)=>{
|
|
61
74
|
const parentLength = parents.length;
|
|
62
75
|
const rect = el.getBoundingClientRect();
|
|
@@ -102,15 +115,29 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
102
115
|
}, [
|
|
103
116
|
storefrontUrl
|
|
104
117
|
]);
|
|
105
|
-
const
|
|
106
|
-
return
|
|
118
|
+
const linkShopDefault = useMemo(()=>{
|
|
119
|
+
return `https://admin.shopify.com/store/${shopName}`;
|
|
107
120
|
}, [
|
|
108
|
-
productId,
|
|
109
121
|
shopName
|
|
110
122
|
]);
|
|
123
|
+
const linkEditProduct = useMemo(()=>{
|
|
124
|
+
return productId ? `${linkShopDefault}/products/${productId}` : '';
|
|
125
|
+
}, [
|
|
126
|
+
linkShopDefault,
|
|
127
|
+
productId
|
|
128
|
+
]);
|
|
129
|
+
const linkEditArticle = useMemo(()=>{
|
|
130
|
+
return articleUid ? `${linkShopDefault}/articles/${articleUid}` : '';
|
|
131
|
+
}, [
|
|
132
|
+
articleUid,
|
|
133
|
+
linkShopDefault
|
|
134
|
+
]);
|
|
111
135
|
// Get parents
|
|
112
136
|
const onActiveComponent = useCallback((e)=>{
|
|
113
137
|
const detail = e.detail;
|
|
138
|
+
if (detail?.articleId) {
|
|
139
|
+
setArticleUid(detail.articleId);
|
|
140
|
+
}
|
|
114
141
|
if (detail?.componentUid == props.uid) {
|
|
115
142
|
getDeleteTooltipPosition();
|
|
116
143
|
if (isSaleFunnelPage) {
|
|
@@ -202,7 +229,15 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
202
229
|
window.dispatchEvent(event);
|
|
203
230
|
};
|
|
204
231
|
const goToShopifyEditLink = ()=>{
|
|
205
|
-
|
|
232
|
+
if (editArticleElementList.includes(toolbarName() ?? '')) {
|
|
233
|
+
window.open(linkEditArticle, '_blank');
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (editProductElementList.includes(toolbarName() ?? '')) {
|
|
237
|
+
window.open(linkEditProduct, '_blank');
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
window.open(linkShopDefault, '_blank');
|
|
206
241
|
};
|
|
207
242
|
const onDelete = (e)=>{
|
|
208
243
|
e.preventDefault();
|
|
@@ -476,7 +511,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
476
511
|
})
|
|
477
512
|
})
|
|
478
513
|
}),
|
|
479
|
-
|
|
514
|
+
editAbleElementList.includes(toolbarName() ?? '') && /*#__PURE__*/ jsx(Tooltip, {
|
|
480
515
|
"data-toolbar-title": true,
|
|
481
516
|
enable: true,
|
|
482
517
|
"data-toolbar-disable": false,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8007,7 +8007,7 @@ type SelectProductBundleControlType<T> = SharedControlType<T> & {
|
|
|
8007
8007
|
hide?: boolean;
|
|
8008
8008
|
};
|
|
8009
8009
|
|
|
8010
|
-
type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> |
|
|
8010
|
+
type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | CustomPositionControlType<T> | SneakPeakControlType<T> | PostPurchaseTextareaControlType<T> | DealControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T>;
|
|
8011
8011
|
type ControlTriggerAction = {
|
|
8012
8012
|
controlId: string;
|
|
8013
8013
|
newValue?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.44.0-dev.
|
|
3
|
+
"version": "1.44.0-dev.60",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"type-check": "yarn tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/adapter-shopify": "1.44.0-dev.
|
|
31
|
-
"@gem-sdk/styles": "1.44.0-dev.
|
|
30
|
+
"@gem-sdk/adapter-shopify": "1.44.0-dev.60",
|
|
31
|
+
"@gem-sdk/styles": "1.44.0-dev.60",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|