@gem-sdk/pages 1.22.31-staging.1 → 1.23.0-moon.57

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { useMatchMutate, useShopStore, useBuilderPreviewStore, useSectionStore, useModalStore } from '@gem-sdk/core';
2
+ import { useMatchMutate, useShopStore, usePageStore, useBuilderPreviewStore, useSectionStore, useModalStore } from '@gem-sdk/core';
3
3
  import { memo, useMemo, useCallback, useEffect } from 'react';
4
4
  import { getStorefrontApi } from '../../libs/get-storefront-api.js';
5
5
  import { createFontUrl } from '../../libs/google-fonts.js';
@@ -8,12 +8,12 @@ import { getFontsFromDataBuilder } from '../../libs/helpers/gen-fonts.js';
8
8
  import { shopifyCdnWithGoogleFonts } from '../../libs/shopify-cdn-with-google-fonts.js';
9
9
 
10
10
  const globalStyleId = 'global-style';
11
- const globalFontId = 'google-font-builder';
12
- const fontElementSettingClassName = 'google-font-element';
13
11
  const Toolbox = ()=>{
14
12
  const matchMutate = useMatchMutate();
15
13
  const provider = useShopStore((s)=>s.provider);
16
14
  const changeStorefrontInfo = useShopStore((s)=>s.changeStorefrontInfo);
15
+ const setDynamicProduct = usePageStore((s)=>s.setDynamicProduct);
16
+ const setDynamicCollection = usePageStore((s)=>s.setDynamicCollection);
17
17
  const initState = useBuilderPreviewStore((s)=>s.initState);
18
18
  const state = useBuilderPreviewStore((s)=>s.state);
19
19
  const initNormalizeState = useBuilderPreviewStore((s)=>s.forceChangeState);
@@ -25,15 +25,68 @@ const Toolbox = ()=>{
25
25
  const addSection = useSectionStore((s)=>s.addSection);
26
26
  const changeSwatches = useShopStore((s)=>s.changeSwatches);
27
27
  const changeLayoutSettings = useShopStore((s)=>s.changeLayoutSettings);
28
+ const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
29
+ const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
28
30
  const clearModal = useModalStore((s)=>s.clearModal);
29
31
  const fonts = useMemo(()=>getFontsFromDataBuilder(state), [
30
32
  state
31
33
  ]);
32
- const customFontUrl = useMemo(()=>{
33
- return createFontUrl(fonts);
34
- }, [
35
- fonts
36
- ]);
34
+ const setFontsToHead = (className, fonts)=>{
35
+ // clear fonts
36
+ if (!fonts?.length) {
37
+ const googleFonts = document.querySelectorAll(`.${className}`);
38
+ googleFonts.forEach((googleFont)=>{
39
+ googleFont.remove();
40
+ });
41
+ return;
42
+ }
43
+ // clear fonts not use
44
+ const googleFonts = document.querySelectorAll(`.${className}`);
45
+ googleFonts.forEach((googleFont)=>{
46
+ const fontName = googleFont.getAttribute('data-font');
47
+ const variantName = googleFont.getAttribute('data-font-variant');
48
+ if (!fontName || !variantName) {
49
+ googleFont.remove();
50
+ } else {
51
+ const isUse = fonts.find((font)=>font.family == fontName && font.variants.includes(variantName));
52
+ if (!isUse) {
53
+ googleFont.remove();
54
+ }
55
+ }
56
+ });
57
+ // append new fonts
58
+ for (const font of fonts){
59
+ if (font.type == 'google') {
60
+ if (font.variants?.length) {
61
+ for (const variant of font.variants){
62
+ const cloneFont = JSON.parse(JSON.stringify(font));
63
+ cloneFont.variants = [
64
+ variant
65
+ ]; // set single variant. Fix error reload font when change href other variant
66
+ const fontName = cloneFont.family;
67
+ const variantName = variant;
68
+ const url = createFontUrl([
69
+ cloneFont
70
+ ]);
71
+ if (url) {
72
+ const googleFont = document.querySelector(`.${className}[data-font="${fontName}"][data-font-variant="${variantName}"]`);
73
+ if (googleFont) {
74
+ continue;
75
+ } else {
76
+ const link = document.createElement('link');
77
+ link.className = className;
78
+ link.dataset.font = fontName;
79
+ link.dataset.fontVariant = variantName;
80
+ link.href = url;
81
+ link.rel = 'stylesheet';
82
+ document.head.appendChild(link);
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ };
37
90
  // Revalidate all query with key match query/
38
91
  const onRevalidateQuery = useCallback(()=>{
39
92
  matchMutate(/query\//, {
@@ -69,22 +122,8 @@ const Toolbox = ()=>{
69
122
  }
70
123
  return item;
71
124
  });
72
- const fontUrl = createFontUrl(font);
73
125
  const globalStyle = document.getElementById(globalStyleId);
74
- const googleFont = document.getElementById(globalFontId);
75
- if (fontUrl) {
76
- if (googleFont) {
77
- if (googleFont.getAttribute('href') !== fontUrl) {
78
- googleFont.setAttribute('href', fontUrl);
79
- }
80
- } else {
81
- const link = document.createElement('link');
82
- link.id = globalFontId;
83
- link.href = fontUrl;
84
- link.rel = 'stylesheet';
85
- document.head.appendChild(link);
86
- }
87
- }
126
+ setFontsToHead('google-font-builder', font);
88
127
  if (globalStyle) {
89
128
  globalStyle.innerHTML = themeStyle;
90
129
  } else {
@@ -217,25 +256,40 @@ const Toolbox = ()=>{
217
256
  }, [
218
257
  changeLayoutSettings
219
258
  ]);
259
+ const onUpdateCreateThemeSectionCount = useCallback((e)=>{
260
+ const count = e.detail;
261
+ if (!count) return;
262
+ changeCreateThemeSectionCount(count);
263
+ }, [
264
+ changeCreateThemeSectionCount
265
+ ]);
266
+ const onUpdateShopPlan = useCallback((e)=>{
267
+ const shopPlan = e.detail;
268
+ if (!shopPlan) return;
269
+ changeShopPlan(shopPlan);
270
+ }, [
271
+ changeShopPlan
272
+ ]);
273
+ const onUpdateDynamicProduct = useCallback((e)=>{
274
+ const product = e.detail;
275
+ if (!product) return;
276
+ setDynamicProduct(product);
277
+ }, [
278
+ setDynamicProduct
279
+ ]);
280
+ const onUpdateDynamicCollection = useCallback((e)=>{
281
+ const collection = e.detail;
282
+ if (!collection) return;
283
+ setDynamicCollection(collection);
284
+ }, [
285
+ setDynamicCollection
286
+ ]);
220
287
  useEffect(()=>{
221
- if (customFontUrl) {
222
- const fontId = 'google-font';
223
- const googleFont = document.querySelector(`.${fontElementSettingClassName}[data-font="${fontId}"]`);
224
- if (googleFont) {
225
- if (googleFont.getAttribute('href') !== customFontUrl) {
226
- googleFont.setAttribute('href', customFontUrl);
227
- }
228
- } else {
229
- const link = document.createElement('link');
230
- link.className = fontElementSettingClassName;
231
- link.dataset.font = fontId;
232
- link.href = customFontUrl;
233
- link.rel = 'stylesheet';
234
- document.head.appendChild(link);
235
- }
288
+ if (fonts) {
289
+ setFontsToHead('google-font-element', fonts);
236
290
  }
237
291
  }, [
238
- customFontUrl
292
+ fonts
239
293
  ]);
240
294
  useEffect(()=>{
241
295
  window.addEventListener('update-shop-info', onChangeShopInfo);
@@ -249,6 +303,10 @@ const Toolbox = ()=>{
249
303
  window.addEventListener('set-global-style', onChangeGlobalStyle);
250
304
  window.addEventListener('update-global-swatches-data', onChangeSwatchesData);
251
305
  window.addEventListener('on-off-header-footer', onChangeLayoutSettingData);
306
+ window.addEventListener('update-create-theme-section-count', onUpdateCreateThemeSectionCount);
307
+ window.addEventListener('update-shop-plan', onUpdateShopPlan);
308
+ window.addEventListener('set-dynamic-product', onUpdateDynamicProduct);
309
+ window.addEventListener('set-dynamic-collection', onUpdateDynamicCollection);
252
310
  return ()=>{
253
311
  window.removeEventListener('update-shop-info', onChangeShopInfo);
254
312
  window.removeEventListener('revalidate-query', onRevalidateQuery);
@@ -260,9 +318,14 @@ const Toolbox = ()=>{
260
318
  window.removeEventListener('set-global-style', onChangeGlobalStyle);
261
319
  window.removeEventListener('update-global-swatches-data', onChangeSwatchesData);
262
320
  window.removeEventListener('on-off-header-footer', onChangeLayoutSettingData);
321
+ window.removeEventListener('update-create-theme-section-count', onUpdateCreateThemeSectionCount);
322
+ window.removeEventListener('update-shop-plan', onUpdateShopPlan);
323
+ window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
324
+ window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
263
325
  };
264
326
  }, [
265
327
  onAddEntity,
328
+ onUpdateShopPlan,
266
329
  onForceUpdateEntityProps,
267
330
  onUpdateEntityProp,
268
331
  onInitBuilder,
@@ -272,7 +335,10 @@ const Toolbox = ()=>{
272
335
  onChangeSwatchesData,
273
336
  onRevalidateQuery,
274
337
  onChangeShopInfo,
275
- onChangeLayoutSettingData
338
+ onChangeLayoutSettingData,
339
+ onUpdateCreateThemeSectionCount,
340
+ onUpdateDynamicProduct,
341
+ onUpdateDynamicCollection
276
342
  ]);
277
343
  return /*#__PURE__*/ jsx("div", {
278
344
  className: "toolbox"
@@ -33,11 +33,6 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
33
33
  const totalSection = useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
34
34
  const [link, setLink] = useState('');
35
35
  const [isInput, setIsInput] = useState(false);
36
- const onClick = (index)=>{
37
- if (index === 1) {
38
- setIsInput(true);
39
- }
40
- };
41
36
  useEffect(()=>{
42
37
  if (!isInput || totalSection === 0) {
43
38
  setLink('');
@@ -78,11 +73,10 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
78
73
  className: "absolute top-[-12px] bg-white px-[8px] text-[14px] font-normal text-[#9E9E9E]",
79
74
  children: "Add section"
80
75
  }),
81
- ACTIONS_DATA.map((action, index)=>{
76
+ ACTIONS_DATA.map((action)=>{
82
77
  return /*#__PURE__*/ jsxs("div", {
83
78
  className: `relative mx-1 h-[60px] w-[172px] cursor-pointer flex-col items-center justify-center rounded-[3px] bg-[#F4F4F4] hover:bg-black/10 ${isInput ? 'hidden' : 'flex'}`,
84
79
  id: action.id,
85
- onClick: ()=>onClick(index),
86
80
  "aria-hidden": true,
87
81
  children: [
88
82
  /*#__PURE__*/ jsxs("div", {
@@ -1,6 +1,6 @@
1
1
  import { PublishedThemePagesDocument, StorePropertyDocument } from '@gem-sdk/core';
2
2
  import { ShopMetaDocument } from '@gem-sdk/adapter-shopify';
3
- import { getFontFromGlobalStyle } from '../google-fonts.js';
3
+ import { getFontStyleFromPageTemplate, getFontFromGlobalStyle } from '../google-fonts.js';
4
4
  import { genCSS } from '../helpers/gen-css.js';
5
5
  import { generateManifest } from '../helpers/generate-manifres.js';
6
6
  import { getFallbackV2 } from '../helpers/get-fallback.js';
@@ -33,7 +33,8 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
33
33
  throw new Error(`No data builder found for Home page`);
34
34
  }
35
35
  const homeTemplate = parseBuilderTemplateV2(dataBuilder);
36
- const [fontStyle, fallback] = await Promise.all([
36
+ const [elementFontStyle, fontStyle, fallback] = await Promise.all([
37
+ getFontStyleFromPageTemplate(homeTemplate),
37
38
  getFontFromGlobalStyle(dataBuilder?.pageStyle?.data),
38
39
  getFallbackV2(fetcher, homeTemplate)
39
40
  ]);
@@ -113,6 +114,7 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
113
114
  return serializableJson({
114
115
  themeStyle: genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
115
116
  fontStyle,
117
+ elementFontStyle,
116
118
  builderData: homeTemplate,
117
119
  swr: {
118
120
  fallback
@@ -1,7 +1,7 @@
1
1
  import { PreviewPageDocument, StorePropertyDocument } from '@gem-sdk/core';
2
2
  import { ShopMetaDocument } from '@gem-sdk/adapter-shopify';
3
3
  import { captureException } from '@sentry/nextjs';
4
- import { getFontFromGlobalStyle } from '../google-fonts.js';
4
+ import { getFontStyleFromPageTemplate, getFontFromGlobalStyle } from '../google-fonts.js';
5
5
  import { genCSS } from '../helpers/gen-css.js';
6
6
  import { generateManifest } from '../helpers/generate-manifres.js';
7
7
  import { getFallbackV2 } from '../helpers/get-fallback.js';
@@ -36,7 +36,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
36
36
  throw new Error(`No data builder found for slug: /preview/${slug}`);
37
37
  }
38
38
  const pageTemplate = parseBuilderTemplateV2(dataBuilder);
39
- const [fontStyle, fallback] = await Promise.all([
39
+ const [elementFontStyle, fontStyle, fallback] = await Promise.all([
40
+ getFontStyleFromPageTemplate(pageTemplate),
40
41
  getFontFromGlobalStyle(dataBuilder?.pageStyle?.data),
41
42
  getFallbackV2(fetcher, pageTemplate)
42
43
  ]);
@@ -118,6 +119,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
118
119
  return serializableJson({
119
120
  themeStyle: genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
120
121
  fontStyle,
122
+ elementFontStyle,
121
123
  builderData: pageTemplate,
122
124
  pageType,
123
125
  moneyFormat: shopMeta?.shop.moneyFormat ?? null,
@@ -34,11 +34,17 @@ const getFontFromGroupSetting = (fonts, groupSetting)=>{
34
34
  if (isFontFamily) {
35
35
  isFontFamily.variants.push(customFontWeight);
36
36
  } else {
37
+ const fontVariants = [
38
+ customFontWeight
39
+ ];
40
+ if (customFontWeight !== '700') {
41
+ if (variants.includes('700')) {
42
+ fontVariants.push('700'); // Auto add 700 for bold in editor inline
43
+ }
44
+ }
37
45
  fonts.push({
38
46
  family: customFontFamily,
39
- variants: [
40
- customFontWeight
41
- ],
47
+ variants: fontVariants,
42
48
  subsets: [],
43
49
  type: 'google'
44
50
  });
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { BuilderComponentProvider, SectionProvider, BuilderPreviewProvider, RenderPreview } from '@gem-sdk/core';
2
+ import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderPreviewProvider, RenderPreview } from '@gem-sdk/core';
3
3
  import { NextSeo } from 'next-seo';
4
4
  import Head from 'next/head';
5
5
  import { useState, useMemo, useEffect } from 'react';
@@ -10,8 +10,9 @@ import CollectionGlobalProvider from './CollectionGlobalProvider.js';
10
10
  import PopupManager from '../components/builder/PopupManager.js';
11
11
  import ImageToLayout from '../components/image-to-layout/ImageToLayout.js';
12
12
  import AddSectionImageToLayout from '../components/image-to-layout/AddSectionImageToLayout.js';
13
+ import Toolbar from '../components/builder/Toolbar.js';
13
14
 
14
- const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout })=>{
15
+ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor })=>{
15
16
  const [loadSuccess, setLoadSuccess] = useState(false);
16
17
  const initState = useMemo(()=>({
17
18
  ROOT: {
@@ -47,43 +48,50 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
47
48
  })
48
49
  ]
49
50
  }),
50
- /*#__PURE__*/ jsx(BuilderComponentProvider, {
51
- components: components,
52
- children: /*#__PURE__*/ jsx(SectionProvider, {
53
- data: sectionData,
54
- children: /*#__PURE__*/ jsxs(BuilderPreviewProvider, {
55
- state: initState,
56
- children: [
57
- /*#__PURE__*/ jsx(Toolbox, {}),
58
- /*#__PURE__*/ jsx(PopupManager, {}),
59
- loadSuccess && /*#__PURE__*/ jsxs("div", {
60
- className: "builder z-1 relative",
61
- children: [
62
- /*#__PURE__*/ jsx(Header, {}),
63
- /*#__PURE__*/ jsx("div", {
64
- id: "storefront",
65
- children: pageType === 'GP_COLLECTION' ? /*#__PURE__*/ jsx(CollectionGlobalProvider, {
66
- children: /*#__PURE__*/ jsx(RenderPreview, {
51
+ /*#__PURE__*/ jsx(PageProvider, {
52
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
53
+ components: components,
54
+ children: /*#__PURE__*/ jsx(SectionProvider, {
55
+ data: sectionData,
56
+ children: /*#__PURE__*/ jsxs(BuilderPreviewProvider, {
57
+ state: initState,
58
+ isThemeSectionEditor: isThemeSectionEditor,
59
+ children: [
60
+ /*#__PURE__*/ jsx(Toolbox, {}),
61
+ /*#__PURE__*/ jsx(Toolbar, {}),
62
+ /*#__PURE__*/ jsx(PopupManager, {}),
63
+ loadSuccess && /*#__PURE__*/ jsxs("div", {
64
+ className: "builder z-1 relative",
65
+ children: [
66
+ isThemeSectionEditor ? /*#__PURE__*/ jsx("div", {
67
+ className: "h-[40px] bg-[#f4f4f4]"
68
+ }) : /*#__PURE__*/ jsx(Header, {}),
69
+ /*#__PURE__*/ jsx("div", {
70
+ id: "storefront",
71
+ className: isThemeSectionEditor ? 'theme-section-editor' : '',
72
+ children: pageType === 'GP_COLLECTION' ? /*#__PURE__*/ jsx(CollectionGlobalProvider, {
73
+ children: /*#__PURE__*/ jsx(RenderPreview, {
74
+ uid: "ROOT"
75
+ })
76
+ }) : /*#__PURE__*/ jsx(RenderPreview, {
67
77
  uid: "ROOT"
68
78
  })
69
- }) : /*#__PURE__*/ jsx(RenderPreview, {
70
- uid: "ROOT"
71
- })
72
- }),
73
- /*#__PURE__*/ jsx(ImageToLayout, {
74
- editorImageToLayout: editorImageToLayout || false
75
- }),
76
- /*#__PURE__*/ jsx(AddSectionImageToLayout, {
77
- editorImageToLayout: editorImageToLayout || false
78
- }),
79
- /*#__PURE__*/ jsx("div", {
80
- id: "visual-content"
81
- }),
82
- /*#__PURE__*/ jsx(Footer, {})
83
- ]
84
- })
85
- ]
86
- }, "preview")
79
+ }),
80
+ /*#__PURE__*/ jsx(ImageToLayout, {
81
+ editorImageToLayout: editorImageToLayout || false
82
+ }),
83
+ /*#__PURE__*/ jsx(AddSectionImageToLayout, {
84
+ editorImageToLayout: editorImageToLayout || false
85
+ }),
86
+ /*#__PURE__*/ jsx("div", {
87
+ id: "visual-content"
88
+ }),
89
+ !isThemeSectionEditor && /*#__PURE__*/ jsx(Footer, {})
90
+ ]
91
+ })
92
+ ]
93
+ }, "preview")
94
+ })
87
95
  })
88
96
  })
89
97
  ]
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
2
+ import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
3
  import { NextSeo } from 'next-seo';
4
4
  import dynamic from 'next/dynamic';
5
5
  import Head from 'next/head';
@@ -36,16 +36,18 @@ const CollectionDetailPage = ({ seo, components, builderData, sectionData, theme
36
36
  })
37
37
  ]
38
38
  }),
39
- /*#__PURE__*/ jsx(BuilderComponentProvider, {
40
- components: components,
41
- children: /*#__PURE__*/ jsx(SectionProvider, {
42
- data: sectionData,
43
- children: /*#__PURE__*/ jsx(CollectionProvider, {
44
- collection: collection,
45
- children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
46
- state: builderData,
47
- children: /*#__PURE__*/ jsx(Render, {
48
- uid: "ROOT"
39
+ /*#__PURE__*/ jsx(PageProvider, {
40
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
41
+ components: components,
42
+ children: /*#__PURE__*/ jsx(SectionProvider, {
43
+ data: sectionData,
44
+ children: /*#__PURE__*/ jsx(CollectionProvider, {
45
+ collection: collection,
46
+ children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
47
+ state: builderData,
48
+ children: /*#__PURE__*/ jsx(Render, {
49
+ uid: "ROOT"
50
+ })
49
51
  })
50
52
  })
51
53
  })
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { BuilderComponentProvider, SectionProvider, BuilderProvider, Render, AddOn } from '@gem-sdk/core';
2
+ import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render, AddOn } from '@gem-sdk/core';
3
3
  import { NextSeo } from 'next-seo';
4
4
  import dynamic from 'next/dynamic';
5
5
  import Head from 'next/head';
@@ -36,23 +36,25 @@ const ProductDetailPage = ({ themeStyle, fontStyle, seo, product, components, bu
36
36
  })
37
37
  ]
38
38
  }),
39
- /*#__PURE__*/ jsx(BuilderComponentProvider, {
40
- components: components,
41
- children: /*#__PURE__*/ jsx(SectionProvider, {
42
- data: sectionData,
43
- children: /*#__PURE__*/ jsxs(ProductProvider, {
44
- product: product,
45
- children: [
46
- builderData && /*#__PURE__*/ jsx(BuilderProvider, {
47
- state: builderData,
48
- children: /*#__PURE__*/ jsx(Render, {
49
- uid: "ROOT"
39
+ /*#__PURE__*/ jsx(PageProvider, {
40
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
41
+ components: components,
42
+ children: /*#__PURE__*/ jsx(SectionProvider, {
43
+ data: sectionData,
44
+ children: /*#__PURE__*/ jsxs(ProductProvider, {
45
+ product: product,
46
+ children: [
47
+ builderData && /*#__PURE__*/ jsx(BuilderProvider, {
48
+ state: builderData,
49
+ children: /*#__PURE__*/ jsx(Render, {
50
+ uid: "ROOT"
51
+ })
52
+ }),
53
+ /*#__PURE__*/ jsx(AddOn, {
54
+ name: "sticky-add-to-cart"
50
55
  })
51
- }),
52
- /*#__PURE__*/ jsx(AddOn, {
53
- name: "sticky-add-to-cart"
54
- })
55
- ]
56
+ ]
57
+ })
56
58
  })
57
59
  })
58
60
  })
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
2
+ import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
3
  import { NextSeo } from 'next-seo';
4
4
  import Head from 'next/head';
5
5
  import { useRouter } from 'next/router';
@@ -59,18 +59,20 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
59
59
  }, fontStyle))
60
60
  ]
61
61
  }),
62
- /*#__PURE__*/ jsx(BuilderComponentProvider, {
63
- components: components,
64
- children: /*#__PURE__*/ jsx(SectionProvider, {
65
- data: sectionData,
66
- children: builderData?.map((builder)=>/*#__PURE__*/ jsx(BuilderProvider, {
67
- state: builder.data,
68
- lazy: builder.lazy,
69
- priority: builder.priority,
70
- children: /*#__PURE__*/ jsx(Render, {
71
- uid: builder.uid
72
- })
73
- }, builder.uid))
62
+ /*#__PURE__*/ jsx(PageProvider, {
63
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
64
+ components: components,
65
+ children: /*#__PURE__*/ jsx(SectionProvider, {
66
+ data: sectionData,
67
+ children: builderData?.map((builder)=>/*#__PURE__*/ jsx(BuilderProvider, {
68
+ state: builder.data,
69
+ lazy: builder.lazy,
70
+ priority: builder.priority,
71
+ children: /*#__PURE__*/ jsx(Render, {
72
+ uid: builder.uid
73
+ })
74
+ }, builder.uid))
75
+ })
74
76
  })
75
77
  })
76
78
  ]
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
2
+ import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
3
  import { NextSeo } from 'next-seo';
4
4
  import Head from 'next/head';
5
5
  import { useRouter } from 'next/router';
@@ -48,17 +48,19 @@ const StaticPage = ({ components, builderData, sectionData, seo, themeStyle, fon
48
48
  })
49
49
  ]
50
50
  }),
51
- /*#__PURE__*/ jsx(BuilderComponentProvider, {
52
- components: components,
53
- children: /*#__PURE__*/ jsx(SectionProvider, {
54
- data: sectionData,
55
- children: /*#__PURE__*/ jsx(Fragment, {
56
- children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
57
- state: builderData,
58
- children: /*#__PURE__*/ jsx(Render, {
59
- uid: "ROOT"
60
- })
61
- }, "body")
51
+ /*#__PURE__*/ jsx(PageProvider, {
52
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
53
+ components: components,
54
+ children: /*#__PURE__*/ jsx(SectionProvider, {
55
+ data: sectionData,
56
+ children: /*#__PURE__*/ jsx(Fragment, {
57
+ children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
58
+ state: builderData,
59
+ children: /*#__PURE__*/ jsx(Render, {
60
+ uid: "ROOT"
61
+ })
62
+ }, "body")
63
+ })
62
64
  })
63
65
  })
64
66
  })
@@ -146,6 +146,7 @@ type BuilderPageProps = {
146
146
  mode?: RenderMode;
147
147
  pageType: ShopType.PublishedThemePageType;
148
148
  editorImageToLayout?: boolean;
149
+ isThemeSectionEditor?: boolean;
149
150
  };
150
151
  declare const BuilderPage: React.FC<BuilderPageProps>;
151
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.22.31-staging.1",
3
+ "version": "1.23.0-moon.57",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,10 +25,10 @@
25
25
  "next-seo": "^6.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "1.22.31-staging.1",
29
- "@gem-sdk/plugin-cookie-bar": "1.22.31-staging.1",
30
- "@gem-sdk/plugin-quick-view": "1.22.31-staging.1",
31
- "@gem-sdk/plugin-sticky-add-to-cart": "1.22.31-staging.1"
28
+ "@gem-sdk/core": "1.23.0-staging.55",
29
+ "@gem-sdk/plugin-cookie-bar": "1.23.0-staging.26",
30
+ "@gem-sdk/plugin-quick-view": "1.23.0-staging.26",
31
+ "@gem-sdk/plugin-sticky-add-to-cart": "1.23.0-staging.26"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "next": ">=13"