@gem-sdk/pages 1.48.0-dev.43 → 1.50.0
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/builder/Header.js +1 -4
- package/dist/cjs/components/builder/SwitchView.js +0 -1
- package/dist/cjs/components/builder/Toolbar.js +1 -3
- package/dist/cjs/components/builder/Toolbox.js +1 -21
- package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -2
- package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -2
- package/dist/cjs/pages/static-v2.js +5 -18
- package/dist/esm/components/builder/Header.js +2 -5
- package/dist/esm/components/builder/SwitchView.js +0 -1
- package/dist/esm/components/builder/Toolbar.js +1 -3
- package/dist/esm/components/builder/Toolbox.js +1 -21
- package/dist/esm/libs/api/get-static-page-props-preview.js +1 -2
- package/dist/esm/libs/api/get-static-page-props-v2.js +1 -2
- package/dist/esm/pages/static-v2.js +5 -18
- package/dist/types/index.d.ts +0 -1
- package/package.json +5 -5
- package/dist/cjs/components/builder/InteractionSelectOnPageHeader.js +0 -67
- package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +0 -63
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var core = require('@gem-sdk/core');
|
|
7
7
|
var SwitchView = require('./SwitchView.js');
|
|
8
|
-
var InteractionSelectOnPageHeader = require('./InteractionSelectOnPageHeader.js');
|
|
9
8
|
|
|
10
9
|
const defaultMargin = {
|
|
11
10
|
desktop: '16px',
|
|
@@ -22,7 +21,6 @@ const sizeCheck = {
|
|
|
22
21
|
const Header = (props)=>{
|
|
23
22
|
const { pageType, isOriginTemplate } = props;
|
|
24
23
|
const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
|
|
25
|
-
const isSelectOnPage = core.usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
26
24
|
const activeHeader = layoutSetting?.showHeader || isOriginTemplate;
|
|
27
25
|
const headerColor = activeHeader ? HEADER_ON_COLOR : HEADER_OFF_COLOR;
|
|
28
26
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -179,8 +177,7 @@ const Header = (props)=>{
|
|
|
179
177
|
})
|
|
180
178
|
]
|
|
181
179
|
})
|
|
182
|
-
})
|
|
183
|
-
isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx(InteractionSelectOnPageHeader.default, {})
|
|
180
|
+
})
|
|
184
181
|
]
|
|
185
182
|
});
|
|
186
183
|
};
|
|
@@ -579,14 +579,12 @@ const Toolbar = ()=>{
|
|
|
579
579
|
if (await isElementInsideArticle()) {
|
|
580
580
|
articleId = currentComponentActive.current?.articleId || '';
|
|
581
581
|
}
|
|
582
|
-
console.log('$parent$parent', $parent);
|
|
583
582
|
const event = new CustomEvent('editor:toolbar:force-active-component', {
|
|
584
583
|
bubbles: true,
|
|
585
584
|
detail: {
|
|
586
585
|
componentUid: uid,
|
|
587
586
|
productId,
|
|
588
|
-
articleId
|
|
589
|
-
elementTag: $parent.getAttribute('data-component-tag') || ''
|
|
587
|
+
articleId
|
|
590
588
|
}
|
|
591
589
|
});
|
|
592
590
|
outHover($parent);
|
|
@@ -36,8 +36,6 @@ const Toolbox = ()=>{
|
|
|
36
36
|
const changeCreateThemeSectionCount = core.useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
37
37
|
const changeShopPlan = core.useShopStore((s)=>s.changeShopPlan);
|
|
38
38
|
const clearModal = core.useModalStore((s)=>s.clearModal);
|
|
39
|
-
const setInteractionIsSelectOnPage = core.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
40
|
-
const setInteractionItem = core.usePageStore((s)=>s.setInteractionItem);
|
|
41
39
|
const fonts = react.useMemo(()=>genFonts.getFontsFromDataBuilder(state), [
|
|
42
40
|
state
|
|
43
41
|
]);
|
|
@@ -331,18 +329,6 @@ const Toolbox = ()=>{
|
|
|
331
329
|
}, [
|
|
332
330
|
setSalePageProductId
|
|
333
331
|
]);
|
|
334
|
-
const onUpdateInteractionIsSelectOnPage = react.useCallback((e)=>{
|
|
335
|
-
const isSelectOnPage = e.detail;
|
|
336
|
-
setInteractionIsSelectOnPage(isSelectOnPage);
|
|
337
|
-
}, [
|
|
338
|
-
setInteractionIsSelectOnPage
|
|
339
|
-
]);
|
|
340
|
-
const onUpdateInteractionItem = react.useCallback((e)=>{
|
|
341
|
-
const interactionItem = e.detail;
|
|
342
|
-
setInteractionItem(interactionItem);
|
|
343
|
-
}, [
|
|
344
|
-
setInteractionItem
|
|
345
|
-
]);
|
|
346
332
|
react.useEffect(()=>{
|
|
347
333
|
if (fonts) {
|
|
348
334
|
setFontsToHead('google-font-element', fonts);
|
|
@@ -370,8 +356,6 @@ const Toolbox = ()=>{
|
|
|
370
356
|
window.addEventListener('update-item-attribute', onUpdateItemAttribute);
|
|
371
357
|
window.addEventListener('set-product-offer', onUpdateProductOffers);
|
|
372
358
|
window.addEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
|
|
373
|
-
window.addEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
374
|
-
window.addEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
375
359
|
return ()=>{
|
|
376
360
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
377
361
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -391,8 +375,6 @@ const Toolbox = ()=>{
|
|
|
391
375
|
window.removeEventListener('update-item-attribute', onUpdateItemAttribute);
|
|
392
376
|
window.removeEventListener('set-product-offer', onUpdateProductOffers);
|
|
393
377
|
window.removeEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
|
|
394
|
-
window.removeEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
395
|
-
window.removeEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
396
378
|
};
|
|
397
379
|
}, [
|
|
398
380
|
onAddEntity,
|
|
@@ -413,9 +395,7 @@ const Toolbox = ()=>{
|
|
|
413
395
|
onUpdateItemName,
|
|
414
396
|
onUpdateItemAttribute,
|
|
415
397
|
onUpdateProductOffers,
|
|
416
|
-
onUpdateSalePageProductId
|
|
417
|
-
onUpdateInteractionItem,
|
|
418
|
-
onUpdateInteractionIsSelectOnPage
|
|
398
|
+
onUpdateSalePageProductId
|
|
419
399
|
]);
|
|
420
400
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
421
401
|
className: "toolbox"
|
|
@@ -139,8 +139,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
139
139
|
facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
|
|
140
140
|
tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
|
|
141
141
|
customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
|
|
142
|
-
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
|
|
143
|
-
interaction: dataBuilder?.interaction
|
|
142
|
+
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
|
|
144
143
|
});
|
|
145
144
|
} catch (err) {
|
|
146
145
|
nextjs.captureException(err);
|
|
@@ -141,8 +141,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
141
141
|
customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
|
|
142
142
|
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
|
|
143
143
|
pageHandle: dataBuilder.handle ?? null,
|
|
144
|
-
customFonts: customFonts$1
|
|
145
|
-
interaction: dataBuilder?.interaction
|
|
144
|
+
customFonts: customFonts$1
|
|
146
145
|
});
|
|
147
146
|
} catch (err) {
|
|
148
147
|
nextjs.captureException(err);
|
|
@@ -9,11 +9,9 @@ var useTrackingView = require('../libs/hooks/use-tracking-view.js');
|
|
|
9
9
|
var parseHtml = require('../libs/parse-html.js');
|
|
10
10
|
var Header = require('../components/builder/Header.js');
|
|
11
11
|
var FooterForPostPurchase = require('../components/FooterForPostPurchase.js');
|
|
12
|
-
var Script = require('next/script');
|
|
13
12
|
|
|
14
|
-
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview
|
|
13
|
+
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview })=>{
|
|
15
14
|
const router$1 = router.useRouter();
|
|
16
|
-
const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
|
|
17
15
|
useTrackingView.useTrackingView(shopToken, pageHandle, router$1.isFallback);
|
|
18
16
|
if (router$1.isFallback) {
|
|
19
17
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -81,28 +79,17 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
|
|
|
81
79
|
isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
|
|
82
80
|
pageType: "POST_PURCHASE"
|
|
83
81
|
}),
|
|
84
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
85
|
-
dangerouslySetInnerHTML: {
|
|
86
|
-
__html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
|
|
87
|
-
}
|
|
88
|
-
}),
|
|
89
82
|
/*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
|
|
90
83
|
data: sectionData,
|
|
91
|
-
children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.
|
|
84
|
+
children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsx(core.BuilderProvider, {
|
|
92
85
|
state: builder.data,
|
|
93
86
|
lazy: builder.lazy,
|
|
94
87
|
priority: builder.priority,
|
|
95
88
|
isPostPurchase: isPostPurchase,
|
|
96
89
|
isPreview: isPreview,
|
|
97
|
-
children:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
102
|
-
defer: true,
|
|
103
|
-
src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
|
|
104
|
-
})
|
|
105
|
-
]
|
|
90
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
|
|
91
|
+
uid: builder.uid
|
|
92
|
+
})
|
|
106
93
|
}, builder.uid))
|
|
107
94
|
}),
|
|
108
95
|
isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(FooterForPostPurchase.default, {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useShopStore,
|
|
2
|
+
import { useShopStore, cls, makeStyleResponsive } from '@gem-sdk/core';
|
|
3
3
|
import Devices from './SwitchView.js';
|
|
4
|
-
import InteractionSelectOnPageHeader from './InteractionSelectOnPageHeader.js';
|
|
5
4
|
|
|
6
5
|
const defaultMargin = {
|
|
7
6
|
desktop: '16px',
|
|
@@ -18,7 +17,6 @@ const sizeCheck = {
|
|
|
18
17
|
const Header = (props)=>{
|
|
19
18
|
const { pageType, isOriginTemplate } = props;
|
|
20
19
|
const layoutSetting = useShopStore((s)=>s.layoutSettings);
|
|
21
|
-
const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
|
|
22
20
|
const activeHeader = layoutSetting?.showHeader || isOriginTemplate;
|
|
23
21
|
const headerColor = activeHeader ? HEADER_ON_COLOR : HEADER_OFF_COLOR;
|
|
24
22
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -175,8 +173,7 @@ const Header = (props)=>{
|
|
|
175
173
|
})
|
|
176
174
|
]
|
|
177
175
|
})
|
|
178
|
-
})
|
|
179
|
-
isSelectOnPage && /*#__PURE__*/ jsx(InteractionSelectOnPageHeader, {})
|
|
176
|
+
})
|
|
180
177
|
]
|
|
181
178
|
});
|
|
182
179
|
};
|
|
@@ -575,14 +575,12 @@ const Toolbar = ()=>{
|
|
|
575
575
|
if (await isElementInsideArticle()) {
|
|
576
576
|
articleId = currentComponentActive.current?.articleId || '';
|
|
577
577
|
}
|
|
578
|
-
console.log('$parent$parent', $parent);
|
|
579
578
|
const event = new CustomEvent('editor:toolbar:force-active-component', {
|
|
580
579
|
bubbles: true,
|
|
581
580
|
detail: {
|
|
582
581
|
componentUid: uid,
|
|
583
582
|
productId,
|
|
584
|
-
articleId
|
|
585
|
-
elementTag: $parent.getAttribute('data-component-tag') || ''
|
|
583
|
+
articleId
|
|
586
584
|
}
|
|
587
585
|
});
|
|
588
586
|
outHover($parent);
|
|
@@ -32,8 +32,6 @@ const Toolbox = ()=>{
|
|
|
32
32
|
const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
33
33
|
const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
|
|
34
34
|
const clearModal = useModalStore((s)=>s.clearModal);
|
|
35
|
-
const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
36
|
-
const setInteractionItem = usePageStore((s)=>s.setInteractionItem);
|
|
37
35
|
const fonts = useMemo(()=>getFontsFromDataBuilder(state), [
|
|
38
36
|
state
|
|
39
37
|
]);
|
|
@@ -327,18 +325,6 @@ const Toolbox = ()=>{
|
|
|
327
325
|
}, [
|
|
328
326
|
setSalePageProductId
|
|
329
327
|
]);
|
|
330
|
-
const onUpdateInteractionIsSelectOnPage = useCallback((e)=>{
|
|
331
|
-
const isSelectOnPage = e.detail;
|
|
332
|
-
setInteractionIsSelectOnPage(isSelectOnPage);
|
|
333
|
-
}, [
|
|
334
|
-
setInteractionIsSelectOnPage
|
|
335
|
-
]);
|
|
336
|
-
const onUpdateInteractionItem = useCallback((e)=>{
|
|
337
|
-
const interactionItem = e.detail;
|
|
338
|
-
setInteractionItem(interactionItem);
|
|
339
|
-
}, [
|
|
340
|
-
setInteractionItem
|
|
341
|
-
]);
|
|
342
328
|
useEffect(()=>{
|
|
343
329
|
if (fonts) {
|
|
344
330
|
setFontsToHead('google-font-element', fonts);
|
|
@@ -366,8 +352,6 @@ const Toolbox = ()=>{
|
|
|
366
352
|
window.addEventListener('update-item-attribute', onUpdateItemAttribute);
|
|
367
353
|
window.addEventListener('set-product-offer', onUpdateProductOffers);
|
|
368
354
|
window.addEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
|
|
369
|
-
window.addEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
370
|
-
window.addEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
371
355
|
return ()=>{
|
|
372
356
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
373
357
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -387,8 +371,6 @@ const Toolbox = ()=>{
|
|
|
387
371
|
window.removeEventListener('update-item-attribute', onUpdateItemAttribute);
|
|
388
372
|
window.removeEventListener('set-product-offer', onUpdateProductOffers);
|
|
389
373
|
window.removeEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
|
|
390
|
-
window.removeEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
391
|
-
window.removeEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
392
374
|
};
|
|
393
375
|
}, [
|
|
394
376
|
onAddEntity,
|
|
@@ -409,9 +391,7 @@ const Toolbox = ()=>{
|
|
|
409
391
|
onUpdateItemName,
|
|
410
392
|
onUpdateItemAttribute,
|
|
411
393
|
onUpdateProductOffers,
|
|
412
|
-
onUpdateSalePageProductId
|
|
413
|
-
onUpdateInteractionItem,
|
|
414
|
-
onUpdateInteractionIsSelectOnPage
|
|
394
|
+
onUpdateSalePageProductId
|
|
415
395
|
]);
|
|
416
396
|
return /*#__PURE__*/ jsx("div", {
|
|
417
397
|
className: "toolbox"
|
|
@@ -137,8 +137,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
137
137
|
facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
|
|
138
138
|
tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
|
|
139
139
|
customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
|
|
140
|
-
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
|
|
141
|
-
interaction: dataBuilder?.interaction
|
|
140
|
+
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
|
|
142
141
|
});
|
|
143
142
|
} catch (err) {
|
|
144
143
|
captureException(err);
|
|
@@ -139,8 +139,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
139
139
|
customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
|
|
140
140
|
customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
|
|
141
141
|
pageHandle: dataBuilder.handle ?? null,
|
|
142
|
-
customFonts
|
|
143
|
-
interaction: dataBuilder?.interaction
|
|
142
|
+
customFonts
|
|
144
143
|
});
|
|
145
144
|
} catch (err) {
|
|
146
145
|
captureException(err);
|
|
@@ -7,11 +7,9 @@ import { useTrackingView } from '../libs/hooks/use-tracking-view.js';
|
|
|
7
7
|
import { parseHtml } from '../libs/parse-html.js';
|
|
8
8
|
import Header from '../components/builder/Header.js';
|
|
9
9
|
import FooterForPostPurchase from '../components/FooterForPostPurchase.js';
|
|
10
|
-
import Script from 'next/script';
|
|
11
10
|
|
|
12
|
-
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview
|
|
11
|
+
const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview })=>{
|
|
13
12
|
const router = useRouter();
|
|
14
|
-
const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
|
|
15
13
|
useTrackingView(shopToken, pageHandle, router.isFallback);
|
|
16
14
|
if (router.isFallback) {
|
|
17
15
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -79,28 +77,17 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
|
|
|
79
77
|
isPostPurchase && /*#__PURE__*/ jsx(Header, {
|
|
80
78
|
pageType: "POST_PURCHASE"
|
|
81
79
|
}),
|
|
82
|
-
/*#__PURE__*/ jsx("div", {
|
|
83
|
-
dangerouslySetInnerHTML: {
|
|
84
|
-
__html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
80
|
/*#__PURE__*/ jsx(SectionProvider, {
|
|
88
81
|
data: sectionData,
|
|
89
|
-
children: builderData?.map((builder)=>/*#__PURE__*/
|
|
82
|
+
children: builderData?.map((builder)=>/*#__PURE__*/ jsx(BuilderProvider, {
|
|
90
83
|
state: builder.data,
|
|
91
84
|
lazy: builder.lazy,
|
|
92
85
|
priority: builder.priority,
|
|
93
86
|
isPostPurchase: isPostPurchase,
|
|
94
87
|
isPreview: isPreview,
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
/*#__PURE__*/ jsx(Script, {
|
|
100
|
-
defer: true,
|
|
101
|
-
src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
|
|
102
|
-
})
|
|
103
|
-
]
|
|
88
|
+
children: /*#__PURE__*/ jsx(Render, {
|
|
89
|
+
uid: builder.uid
|
|
90
|
+
})
|
|
104
91
|
}, builder.uid))
|
|
105
92
|
}),
|
|
106
93
|
isPostPurchase && /*#__PURE__*/ jsx(FooterForPostPurchase, {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ type PageBuilderProps = {
|
|
|
40
40
|
customCodeBody?: string | null;
|
|
41
41
|
isStorefront?: boolean;
|
|
42
42
|
customFonts?: string | null;
|
|
43
|
-
interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, "id" | "value">>;
|
|
44
43
|
};
|
|
45
44
|
type PageBuilderPropsV2 = {
|
|
46
45
|
builderData?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"next": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "1.
|
|
30
|
-
"@gem-sdk/plugin-cookie-bar": "1.
|
|
31
|
-
"@gem-sdk/plugin-quick-view": "1.
|
|
32
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "1.
|
|
29
|
+
"@gem-sdk/core": "1.50.0",
|
|
30
|
+
"@gem-sdk/plugin-cookie-bar": "1.50.0",
|
|
31
|
+
"@gem-sdk/plugin-quick-view": "1.50.0",
|
|
32
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "1.50.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"next": ">=13"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var core = require('@gem-sdk/core');
|
|
7
|
-
|
|
8
|
-
const InteractionSelectOnPageHeader = ()=>{
|
|
9
|
-
const selectType = core.usePageStore((s)=>s.interactionData?.selectType);
|
|
10
|
-
const setInteractionSelectType = core.usePageStore((s)=>s.setInteractionSelectType);
|
|
11
|
-
const setInteractionIsSelectOnPage = core.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
12
|
-
const closeSelectOnPage = ()=>{
|
|
13
|
-
setInteractionIsSelectOnPage(false);
|
|
14
|
-
const event = new CustomEvent('editor:interaction:change-select-on-page', {
|
|
15
|
-
bubbles: true,
|
|
16
|
-
detail: false
|
|
17
|
-
});
|
|
18
|
-
window.dispatchEvent(event);
|
|
19
|
-
};
|
|
20
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
21
|
-
children: [
|
|
22
|
-
/*#__PURE__*/ jsxRuntime.jsxs("header", {
|
|
23
|
-
className: "gp-flex gp-justify-between gp-h-10 gp-fixed gp-top-0 gp-left-0 gp-w-full gp-z-100",
|
|
24
|
-
children: [
|
|
25
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
|
-
className: "gp-h-10 gp-w-10"
|
|
27
|
-
}),
|
|
28
|
-
/*#__PURE__*/ jsxRuntime.jsxs("section", {
|
|
29
|
-
className: "gp-flex gp-bg-[#3C67FF]/[0.15] gp-items-center gp-h-full gp-rounded-b-lg gp-p-1 gp-gap-1",
|
|
30
|
-
children: [
|
|
31
|
-
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
32
|
-
onClick: ()=>setInteractionSelectType('element'),
|
|
33
|
-
className: `gp-h-8 gp-w-[132px] gp-items-center gp-justify-center gp-text-[12px] gp-leading-5 gp-font-medium gp-flex gp-rounded-[6px] ${selectType === 'element' ? 'gp-bg-[#3C67FF] gp-text-[#F9F9F9]' : 'gp-text-[#3C67FF]'}`,
|
|
34
|
-
children: "Select an element"
|
|
35
|
-
}),
|
|
36
|
-
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
37
|
-
onClick: ()=>setInteractionSelectType('page'),
|
|
38
|
-
className: `gp-h-8 gp-w-[132px] gp-items-center gp-justify-center gp-text-[12px] gp-leading-5 gp-font-medium gp-flex gp-rounded-[6px] ${selectType === 'page' ? 'gp-bg-[#3C67FF] gp-text-[#F9F9F9]' : 'gp-text-[#3C67FF]'}`,
|
|
39
|
-
children: "Choose entire page"
|
|
40
|
-
})
|
|
41
|
-
]
|
|
42
|
-
}),
|
|
43
|
-
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
44
|
-
onClick: closeSelectOnPage,
|
|
45
|
-
className: "gp-h-10 gp-w-10 gp-bg-[#3C67FF]/[0.15] gp-flex gp-items-center gp-justify-center gp-rounded-bl-lg",
|
|
46
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
47
|
-
width: "20",
|
|
48
|
-
height: "20",
|
|
49
|
-
viewBox: "0 0 20 20",
|
|
50
|
-
fill: "none",
|
|
51
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
53
|
-
d: "M3.94194 3.05806C3.69786 2.81398 3.30214 2.81398 3.05806 3.05806C2.81398 3.30214 2.81398 3.69786 3.05806 3.94194L9.11612 10L3.05806 16.0581C2.81398 16.3021 2.81398 16.6979 3.05806 16.9419C3.30214 17.186 3.69786 17.186 3.94194 16.9419L10 10.8839L16.0581 16.9419C16.3021 17.186 16.6979 17.186 16.9419 16.9419C17.186 16.6979 17.186 16.3021 16.9419 16.0581L10.8839 10L16.9419 3.94194C17.186 3.69786 17.186 3.30214 16.9419 3.05806C16.6979 2.81398 16.3021 2.81398 16.0581 3.05806L10 9.11612L3.94194 3.05806Z",
|
|
54
|
-
fill: "#3C67FF"
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
]
|
|
59
|
-
}),
|
|
60
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
61
|
-
className: "gp-h-full gp-w-full gp-fixed gp-top-0 gp-left-0 gp-border-[#3C67FF] gp-border-[2px]"
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.default = InteractionSelectOnPageHeader;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { usePageStore } from '@gem-sdk/core';
|
|
3
|
-
|
|
4
|
-
const InteractionSelectOnPageHeader = ()=>{
|
|
5
|
-
const selectType = usePageStore((s)=>s.interactionData?.selectType);
|
|
6
|
-
const setInteractionSelectType = usePageStore((s)=>s.setInteractionSelectType);
|
|
7
|
-
const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
8
|
-
const closeSelectOnPage = ()=>{
|
|
9
|
-
setInteractionIsSelectOnPage(false);
|
|
10
|
-
const event = new CustomEvent('editor:interaction:change-select-on-page', {
|
|
11
|
-
bubbles: true,
|
|
12
|
-
detail: false
|
|
13
|
-
});
|
|
14
|
-
window.dispatchEvent(event);
|
|
15
|
-
};
|
|
16
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ jsxs("header", {
|
|
19
|
-
className: "gp-flex gp-justify-between gp-h-10 gp-fixed gp-top-0 gp-left-0 gp-w-full gp-z-100",
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ jsx("div", {
|
|
22
|
-
className: "gp-h-10 gp-w-10"
|
|
23
|
-
}),
|
|
24
|
-
/*#__PURE__*/ jsxs("section", {
|
|
25
|
-
className: "gp-flex gp-bg-[#3C67FF]/[0.15] gp-items-center gp-h-full gp-rounded-b-lg gp-p-1 gp-gap-1",
|
|
26
|
-
children: [
|
|
27
|
-
/*#__PURE__*/ jsx("button", {
|
|
28
|
-
onClick: ()=>setInteractionSelectType('element'),
|
|
29
|
-
className: `gp-h-8 gp-w-[132px] gp-items-center gp-justify-center gp-text-[12px] gp-leading-5 gp-font-medium gp-flex gp-rounded-[6px] ${selectType === 'element' ? 'gp-bg-[#3C67FF] gp-text-[#F9F9F9]' : 'gp-text-[#3C67FF]'}`,
|
|
30
|
-
children: "Select an element"
|
|
31
|
-
}),
|
|
32
|
-
/*#__PURE__*/ jsx("button", {
|
|
33
|
-
onClick: ()=>setInteractionSelectType('page'),
|
|
34
|
-
className: `gp-h-8 gp-w-[132px] gp-items-center gp-justify-center gp-text-[12px] gp-leading-5 gp-font-medium gp-flex gp-rounded-[6px] ${selectType === 'page' ? 'gp-bg-[#3C67FF] gp-text-[#F9F9F9]' : 'gp-text-[#3C67FF]'}`,
|
|
35
|
-
children: "Choose entire page"
|
|
36
|
-
})
|
|
37
|
-
]
|
|
38
|
-
}),
|
|
39
|
-
/*#__PURE__*/ jsx("button", {
|
|
40
|
-
onClick: closeSelectOnPage,
|
|
41
|
-
className: "gp-h-10 gp-w-10 gp-bg-[#3C67FF]/[0.15] gp-flex gp-items-center gp-justify-center gp-rounded-bl-lg",
|
|
42
|
-
children: /*#__PURE__*/ jsx("svg", {
|
|
43
|
-
width: "20",
|
|
44
|
-
height: "20",
|
|
45
|
-
viewBox: "0 0 20 20",
|
|
46
|
-
fill: "none",
|
|
47
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
48
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
49
|
-
d: "M3.94194 3.05806C3.69786 2.81398 3.30214 2.81398 3.05806 3.05806C2.81398 3.30214 2.81398 3.69786 3.05806 3.94194L9.11612 10L3.05806 16.0581C2.81398 16.3021 2.81398 16.6979 3.05806 16.9419C3.30214 17.186 3.69786 17.186 3.94194 16.9419L10 10.8839L16.0581 16.9419C16.3021 17.186 16.6979 17.186 16.9419 16.9419C17.186 16.6979 17.186 16.3021 16.9419 16.0581L10.8839 10L16.9419 3.94194C17.186 3.69786 17.186 3.30214 16.9419 3.05806C16.6979 2.81398 16.3021 2.81398 16.0581 3.05806L10 9.11612L3.94194 3.05806Z",
|
|
50
|
-
fill: "#3C67FF"
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
}),
|
|
56
|
-
/*#__PURE__*/ jsx("div", {
|
|
57
|
-
className: "gp-h-full gp-w-full gp-fixed gp-top-0 gp-left-0 gp-border-[#3C67FF] gp-border-[2px]"
|
|
58
|
-
})
|
|
59
|
-
]
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export { InteractionSelectOnPageHeader as default };
|