@gem-sdk/core 1.54.0-staging.49 → 1.54.0-staging.56
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 +18 -25
- package/dist/cjs/helpers/third-party/appConfig.js +7 -0
- package/dist/cjs/helpers/third-party/appSetting.js +9 -0
- package/dist/cjs/helpers/third-party/constant.js +2 -1
- package/dist/esm/components/ComponentToolbarPreview.js +18 -25
- package/dist/esm/helpers/third-party/appConfig.js +7 -1
- package/dist/esm/helpers/third-party/appSetting.js +9 -0
- package/dist/esm/helpers/third-party/constant.js +3 -2
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
46
46
|
const [parents, setParents] = react.useState([]);
|
|
47
47
|
const [deleteTooltipPosition, setDeleteTooltipPosition] = react.useState('top');
|
|
48
48
|
const [isDisableDelete, setIsUnableDelete] = react.useState(false);
|
|
49
|
-
const [
|
|
49
|
+
const [productId, setProductId] = react.useState('');
|
|
50
50
|
const [articleUid, setArticleUid] = react.useState('');
|
|
51
51
|
const [tooltipText, setTooltipText] = react.useState({
|
|
52
52
|
width: '',
|
|
@@ -58,19 +58,19 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
58
58
|
]);
|
|
59
59
|
const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = useToolbarPostPurchase.usePostPurchase(props.uid, props.tag || '');
|
|
60
60
|
const editProductElementList = [
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
61
|
+
'ProductTitle',
|
|
62
|
+
'ProductDescription',
|
|
63
|
+
'ProductPrice'
|
|
64
64
|
];
|
|
65
65
|
const editArticleElementList = [
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
66
|
+
'ArticleTitle',
|
|
67
|
+
'ArticleContent',
|
|
68
|
+
'ArticleImage',
|
|
69
|
+
'ArticleAuthor',
|
|
70
|
+
'ArticleCategory',
|
|
71
|
+
'ArticleDate',
|
|
72
|
+
'ArticleExcerpt',
|
|
73
|
+
'ArticleTags'
|
|
74
74
|
];
|
|
75
75
|
const editAbleElementList = [
|
|
76
76
|
...editProductElementList,
|
|
@@ -106,12 +106,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
106
106
|
}, [
|
|
107
107
|
props.tag
|
|
108
108
|
]);
|
|
109
|
-
const productId = react.useMemo(()=>{
|
|
110
|
-
const ele = document.querySelector(`[data-uid="${parentProductUid}"]`);
|
|
111
|
-
return ele?.getAttribute('data-product-id');
|
|
112
|
-
}, [
|
|
113
|
-
parentProductUid
|
|
114
|
-
]);
|
|
115
109
|
const shopName = react.useMemo(()=>{
|
|
116
110
|
const pattern = /^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;
|
|
117
111
|
if (storefrontUrl) {
|
|
@@ -144,6 +138,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
144
138
|
if (detail?.articleId) {
|
|
145
139
|
setArticleUid(detail.articleId);
|
|
146
140
|
}
|
|
141
|
+
if (detail?.productId) {
|
|
142
|
+
setProductId(detail.productId);
|
|
143
|
+
}
|
|
147
144
|
if (detail?.componentUid == props.uid) {
|
|
148
145
|
getDeleteTooltipPosition();
|
|
149
146
|
if (isSaleFunnelPage) {
|
|
@@ -159,10 +156,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
159
156
|
return true;
|
|
160
157
|
}).slice(0, 3);
|
|
161
158
|
setParents(currentParents);
|
|
162
|
-
const parentFindUid = currentParents.find((item)=>item.tag === 'Product')?.uid;
|
|
163
|
-
if (parentFindUid) {
|
|
164
|
-
setParentProductUid(parentFindUid);
|
|
165
|
-
}
|
|
166
159
|
} else {
|
|
167
160
|
setParents([]);
|
|
168
161
|
setIsShowParent(false);
|
|
@@ -235,11 +228,11 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
235
228
|
window.dispatchEvent(event);
|
|
236
229
|
};
|
|
237
230
|
const goToShopifyEditLink = ()=>{
|
|
238
|
-
if (editArticleElementList.includes(
|
|
231
|
+
if (editArticleElementList.includes(props.tag)) {
|
|
239
232
|
window.open(linkEditArticle, '_blank');
|
|
240
233
|
return;
|
|
241
234
|
}
|
|
242
|
-
if (editProductElementList.includes(
|
|
235
|
+
if (editProductElementList.includes(props.tag)) {
|
|
243
236
|
window.open(linkEditProduct, '_blank');
|
|
244
237
|
return;
|
|
245
238
|
}
|
|
@@ -522,7 +515,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
522
515
|
})
|
|
523
516
|
})
|
|
524
517
|
}),
|
|
525
|
-
editAbleElementList.includes(
|
|
518
|
+
editAbleElementList.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
|
|
526
519
|
"data-toolbar-title": true,
|
|
527
520
|
enable: true,
|
|
528
521
|
"data-toolbar-disable": false,
|
|
@@ -126,7 +126,14 @@ const ProductOptionsCustomizerConfig = {
|
|
|
126
126
|
appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
+
const AppointmentBookingCowlendarConfig = {
|
|
130
|
+
AppointmentBookingCowlendar: {
|
|
131
|
+
appName: 'cowlendar-booking',
|
|
132
|
+
appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
|
|
133
|
+
}
|
|
134
|
+
};
|
|
129
135
|
|
|
136
|
+
exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
|
|
130
137
|
exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
|
|
131
138
|
exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
|
|
132
139
|
exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
|
|
@@ -291,7 +291,16 @@ const ProductOptionsCustomizer = {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
+
const AppointmentBookingCowlendar = {
|
|
295
|
+
AppointmentBookingCowlendar: {
|
|
296
|
+
'app-section': {
|
|
297
|
+
section_title: 'Services list',
|
|
298
|
+
section_type: 'services-list'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
294
302
|
const composeSettingsByWidgetType = {
|
|
303
|
+
...AppointmentBookingCowlendar,
|
|
295
304
|
...ProductOptionsCustomizer,
|
|
296
305
|
...WhatmoreShoppableVideosreel,
|
|
297
306
|
...JunipProductReviewsUgc,
|
|
@@ -23,7 +23,8 @@ const mapShopifyAppMeta = {
|
|
|
23
23
|
...appConfig.PreorderNowWodPresaleConfig,
|
|
24
24
|
...appConfig.YotpoReviewsV3UgcConfig,
|
|
25
25
|
...appConfig.WhatmoreShoppableVideosreelConfig,
|
|
26
|
-
...appConfig.ProductOptionsCustomizerConfig
|
|
26
|
+
...appConfig.ProductOptionsCustomizerConfig,
|
|
27
|
+
...appConfig.AppointmentBookingCowlendarConfig
|
|
27
28
|
};
|
|
28
29
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
29
30
|
|
|
@@ -42,7 +42,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
42
42
|
const [parents, setParents] = useState([]);
|
|
43
43
|
const [deleteTooltipPosition, setDeleteTooltipPosition] = useState('top');
|
|
44
44
|
const [isDisableDelete, setIsUnableDelete] = useState(false);
|
|
45
|
-
const [
|
|
45
|
+
const [productId, setProductId] = useState('');
|
|
46
46
|
const [articleUid, setArticleUid] = useState('');
|
|
47
47
|
const [tooltipText, setTooltipText] = useState({
|
|
48
48
|
width: '',
|
|
@@ -54,19 +54,19 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
54
54
|
]);
|
|
55
55
|
const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = usePostPurchase(props.uid, props.tag || '');
|
|
56
56
|
const editProductElementList = [
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
57
|
+
'ProductTitle',
|
|
58
|
+
'ProductDescription',
|
|
59
|
+
'ProductPrice'
|
|
60
60
|
];
|
|
61
61
|
const editArticleElementList = [
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
62
|
+
'ArticleTitle',
|
|
63
|
+
'ArticleContent',
|
|
64
|
+
'ArticleImage',
|
|
65
|
+
'ArticleAuthor',
|
|
66
|
+
'ArticleCategory',
|
|
67
|
+
'ArticleDate',
|
|
68
|
+
'ArticleExcerpt',
|
|
69
|
+
'ArticleTags'
|
|
70
70
|
];
|
|
71
71
|
const editAbleElementList = [
|
|
72
72
|
...editProductElementList,
|
|
@@ -102,12 +102,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
102
102
|
}, [
|
|
103
103
|
props.tag
|
|
104
104
|
]);
|
|
105
|
-
const productId = useMemo(()=>{
|
|
106
|
-
const ele = document.querySelector(`[data-uid="${parentProductUid}"]`);
|
|
107
|
-
return ele?.getAttribute('data-product-id');
|
|
108
|
-
}, [
|
|
109
|
-
parentProductUid
|
|
110
|
-
]);
|
|
111
105
|
const shopName = useMemo(()=>{
|
|
112
106
|
const pattern = /^(?:https?:\/\/)?([^/]+)\.myshopify\.com/;
|
|
113
107
|
if (storefrontUrl) {
|
|
@@ -140,6 +134,9 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
140
134
|
if (detail?.articleId) {
|
|
141
135
|
setArticleUid(detail.articleId);
|
|
142
136
|
}
|
|
137
|
+
if (detail?.productId) {
|
|
138
|
+
setProductId(detail.productId);
|
|
139
|
+
}
|
|
143
140
|
if (detail?.componentUid == props.uid) {
|
|
144
141
|
getDeleteTooltipPosition();
|
|
145
142
|
if (isSaleFunnelPage) {
|
|
@@ -155,10 +152,6 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
155
152
|
return true;
|
|
156
153
|
}).slice(0, 3);
|
|
157
154
|
setParents(currentParents);
|
|
158
|
-
const parentFindUid = currentParents.find((item)=>item.tag === 'Product')?.uid;
|
|
159
|
-
if (parentFindUid) {
|
|
160
|
-
setParentProductUid(parentFindUid);
|
|
161
|
-
}
|
|
162
155
|
} else {
|
|
163
156
|
setParents([]);
|
|
164
157
|
setIsShowParent(false);
|
|
@@ -231,11 +224,11 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
231
224
|
window.dispatchEvent(event);
|
|
232
225
|
};
|
|
233
226
|
const goToShopifyEditLink = ()=>{
|
|
234
|
-
if (editArticleElementList.includes(
|
|
227
|
+
if (editArticleElementList.includes(props.tag)) {
|
|
235
228
|
window.open(linkEditArticle, '_blank');
|
|
236
229
|
return;
|
|
237
230
|
}
|
|
238
|
-
if (editProductElementList.includes(
|
|
231
|
+
if (editProductElementList.includes(props.tag)) {
|
|
239
232
|
window.open(linkEditProduct, '_blank');
|
|
240
233
|
return;
|
|
241
234
|
}
|
|
@@ -518,7 +511,7 @@ const ComponentToolbarPreview = (props)=>{
|
|
|
518
511
|
})
|
|
519
512
|
})
|
|
520
513
|
}),
|
|
521
|
-
editAbleElementList.includes(
|
|
514
|
+
editAbleElementList.includes(props.tag) && /*#__PURE__*/ jsx(Tooltip, {
|
|
522
515
|
"data-toolbar-title": true,
|
|
523
516
|
enable: true,
|
|
524
517
|
"data-toolbar-disable": false,
|
|
@@ -124,5 +124,11 @@ const ProductOptionsCustomizerConfig = {
|
|
|
124
124
|
appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
+
const AppointmentBookingCowlendarConfig = {
|
|
128
|
+
AppointmentBookingCowlendar: {
|
|
129
|
+
appName: 'cowlendar-booking',
|
|
130
|
+
appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
|
|
131
|
+
}
|
|
132
|
+
};
|
|
127
133
|
|
|
128
|
-
export { BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, ProductOptionsCustomizerConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, WhatmoreShoppableVideosreelConfig, YotpoReviewsV3UgcConfig };
|
|
134
|
+
export { AppointmentBookingCowlendarConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, ProductOptionsCustomizerConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, WhatmoreShoppableVideosreelConfig, YotpoReviewsV3UgcConfig };
|
|
@@ -289,7 +289,16 @@ const ProductOptionsCustomizer = {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
+
const AppointmentBookingCowlendar = {
|
|
293
|
+
AppointmentBookingCowlendar: {
|
|
294
|
+
'app-section': {
|
|
295
|
+
section_title: 'Services list',
|
|
296
|
+
section_type: 'services-list'
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
292
300
|
const composeSettingsByWidgetType = {
|
|
301
|
+
...AppointmentBookingCowlendar,
|
|
293
302
|
...ProductOptionsCustomizer,
|
|
294
303
|
...WhatmoreShoppableVideosreel,
|
|
295
304
|
...JunipProductReviewsUgc,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig, WhatmoreShoppableVideosreelConfig, ProductOptionsCustomizerConfig } from './appConfig.js';
|
|
1
|
+
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig, WhatmoreShoppableVideosreelConfig, ProductOptionsCustomizerConfig, AppointmentBookingCowlendarConfig } from './appConfig.js';
|
|
2
2
|
|
|
3
3
|
const mapShopifyAppMeta = {
|
|
4
4
|
...RechargeSubscriptionsConfig,
|
|
@@ -21,7 +21,8 @@ const mapShopifyAppMeta = {
|
|
|
21
21
|
...PreorderNowWodPresaleConfig,
|
|
22
22
|
...YotpoReviewsV3UgcConfig,
|
|
23
23
|
...WhatmoreShoppableVideosreelConfig,
|
|
24
|
-
...ProductOptionsCustomizerConfig
|
|
24
|
+
...ProductOptionsCustomizerConfig,
|
|
25
|
+
...AppointmentBookingCowlendarConfig
|
|
25
26
|
};
|
|
26
27
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
27
28
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8174,6 +8174,7 @@ type ComponentSetting<P extends BaseProps> = {
|
|
|
8174
8174
|
icon?: string;
|
|
8175
8175
|
settings?: Setting<P>[];
|
|
8176
8176
|
advanced?: Record<string, any>;
|
|
8177
|
+
rootOverride?: Record<string, any>;
|
|
8177
8178
|
init?: InitComponentType[] | {
|
|
8178
8179
|
default: InitComponentType[];
|
|
8179
8180
|
mobileOnly?: InitComponentType[];
|
|
@@ -8289,6 +8290,7 @@ type ComponentPreset = {
|
|
|
8289
8290
|
components: InitComponentType[];
|
|
8290
8291
|
hideTextContent?: boolean;
|
|
8291
8292
|
flowTagComponents?: Record<string, InitComponentType[]>;
|
|
8293
|
+
rootOverride?: Record<string, any>;
|
|
8292
8294
|
};
|
|
8293
8295
|
|
|
8294
8296
|
type PageContext = {
|