@gem-sdk/core 1.22.31-new-feature.2 → 1.22.31-new-feature.4

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.
@@ -16,7 +16,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
16
16
  const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
17
17
  const root = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem('ROOT'));
18
18
  const isThemeSection = props.isThemeSection;
19
- const isEditThemeSection = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isEditThemeSection);
19
+ const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
20
20
  const [activeAddSection, setActiveAddSection] = react.useState(null);
21
21
  const [isShowParent, setIsShowParent] = react.useState(false);
22
22
  const [isShowParentRevert, setIsShowParentRevert] = react.useState(false);
@@ -142,10 +142,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
142
142
  };
143
143
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
144
144
  children: [
145
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
145
+ !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
146
146
  "data-toolbar": true,
147
147
  "data-toolbar-section": props.tag == 'Section',
148
- "data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection,
148
+ "data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
149
149
  children: [
150
150
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
151
151
  "data-toolbar-show-parent": true,
@@ -213,6 +213,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
213
213
  isShowParent && parents.map((parent, index)=>/*#__PURE__*/ jsxRuntime.jsxs("div", {
214
214
  "data-toolbar-parent": true,
215
215
  "data-parent-uid": parent.uid,
216
+ "data-toolbar-theme-section": isThemeSectionEditor,
216
217
  style: {
217
218
  top: !isShowParentRevert ? `${-24 * (index + 1) + index}px` : `${31 + 24 * index - index}px`
218
219
  },
@@ -300,9 +301,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
300
301
  /*#__PURE__*/ jsxRuntime.jsx("div", {
301
302
  "data-outline": true,
302
303
  "data-outline-section": props.tag == 'Section',
303
- "data-outline-theme-section": props.tag == 'Section' && !!isThemeSection
304
+ "data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor
304
305
  }),
305
- props.tag == 'Section' && !!isEditThemeSection && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
306
+ props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
306
307
  children: [
307
308
  /*#__PURE__*/ jsxRuntime.jsx("div", {
308
309
  "data-toolbar-add-top": true,
@@ -338,8 +339,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
338
339
  })
339
340
  ]
340
341
  }),
341
- /*#__PURE__*/ jsxRuntime.jsx("div", {
342
+ !(props.tag == 'Section' && isThemeSection) && /*#__PURE__*/ jsxRuntime.jsx("div", {
342
343
  "data-spacing": true,
344
+ "data-spacing-theme-section": isThemeSectionEditor,
343
345
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
344
346
  "data-spacing-margin-bottom": true,
345
347
  children: [
@@ -28,10 +28,10 @@ const root = {
28
28
  label: 'Root',
29
29
  childrens: []
30
30
  };
31
- const createBuilderPreviewProvider = (args, isEditThemeSection)=>zustand.createStore((set, get)=>({
31
+ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.createStore((set, get)=>({
32
32
  state: args,
33
33
  loaded: false,
34
- isEditThemeSection: !!isEditThemeSection,
34
+ isThemeSectionEditor: !!isThemeSectionEditor,
35
35
  addItem: (args)=>{
36
36
  const { position, data } = args;
37
37
  const state = get().state;
@@ -411,13 +411,13 @@ const createBuilderPreviewProvider = (args, isEditThemeSection)=>zustand.createS
411
411
  return parents;
412
412
  }
413
413
  }));
414
- const BuilderPreviewProvider = ({ children, state, isEditThemeSection, lazy, ...passProps })=>{
414
+ const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
415
415
  const Component = lazy ? react.Suspense : react.Fragment;
416
416
  const value = react.useMemo(()=>{
417
- return createBuilderPreviewProvider(state, isEditThemeSection);
417
+ return createBuilderPreviewProvider(state, isThemeSectionEditor);
418
418
  }, [
419
419
  state,
420
- isEditThemeSection
420
+ isThemeSectionEditor
421
421
  ]);
422
422
  return /*#__PURE__*/ jsxRuntime.jsx(Component, {
423
423
  children: /*#__PURE__*/ jsxRuntime.jsx(BuilderPreviewContext.Provider, {
@@ -14,7 +14,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
14
14
  const getParents = useBuilderPreviewStore((s)=>s.getParents);
15
15
  const root = useBuilderPreviewStore((s)=>s.getItem('ROOT'));
16
16
  const isThemeSection = props.isThemeSection;
17
- const isEditThemeSection = useBuilderPreviewStore((s)=>s.isEditThemeSection);
17
+ const isThemeSectionEditor = useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
18
18
  const [activeAddSection, setActiveAddSection] = useState(null);
19
19
  const [isShowParent, setIsShowParent] = useState(false);
20
20
  const [isShowParentRevert, setIsShowParentRevert] = useState(false);
@@ -140,10 +140,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
140
140
  };
141
141
  return /*#__PURE__*/ jsxs(Fragment, {
142
142
  children: [
143
- /*#__PURE__*/ jsxs("div", {
143
+ !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxs("div", {
144
144
  "data-toolbar": true,
145
145
  "data-toolbar-section": props.tag == 'Section',
146
- "data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection,
146
+ "data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
147
147
  children: [
148
148
  /*#__PURE__*/ jsxs("div", {
149
149
  "data-toolbar-show-parent": true,
@@ -211,6 +211,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
211
211
  isShowParent && parents.map((parent, index)=>/*#__PURE__*/ jsxs("div", {
212
212
  "data-toolbar-parent": true,
213
213
  "data-parent-uid": parent.uid,
214
+ "data-toolbar-theme-section": isThemeSectionEditor,
214
215
  style: {
215
216
  top: !isShowParentRevert ? `${-24 * (index + 1) + index}px` : `${31 + 24 * index - index}px`
216
217
  },
@@ -298,9 +299,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
298
299
  /*#__PURE__*/ jsx("div", {
299
300
  "data-outline": true,
300
301
  "data-outline-section": props.tag == 'Section',
301
- "data-outline-theme-section": props.tag == 'Section' && !!isThemeSection
302
+ "data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor
302
303
  }),
303
- props.tag == 'Section' && !!isEditThemeSection && /*#__PURE__*/ jsxs(Fragment, {
304
+ props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxs(Fragment, {
304
305
  children: [
305
306
  /*#__PURE__*/ jsx("div", {
306
307
  "data-toolbar-add-top": true,
@@ -336,8 +337,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
336
337
  })
337
338
  ]
338
339
  }),
339
- /*#__PURE__*/ jsx("div", {
340
+ !(props.tag == 'Section' && isThemeSection) && /*#__PURE__*/ jsx("div", {
340
341
  "data-spacing": true,
342
+ "data-spacing-theme-section": isThemeSectionEditor,
341
343
  children: /*#__PURE__*/ jsxs("div", {
342
344
  "data-spacing-margin-bottom": true,
343
345
  children: [
@@ -26,10 +26,10 @@ const root = {
26
26
  label: 'Root',
27
27
  childrens: []
28
28
  };
29
- const createBuilderPreviewProvider = (args, isEditThemeSection)=>createStore((set, get)=>({
29
+ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>createStore((set, get)=>({
30
30
  state: args,
31
31
  loaded: false,
32
- isEditThemeSection: !!isEditThemeSection,
32
+ isThemeSectionEditor: !!isThemeSectionEditor,
33
33
  addItem: (args)=>{
34
34
  const { position, data } = args;
35
35
  const state = get().state;
@@ -409,13 +409,13 @@ const createBuilderPreviewProvider = (args, isEditThemeSection)=>createStore((se
409
409
  return parents;
410
410
  }
411
411
  }));
412
- const BuilderPreviewProvider = ({ children, state, isEditThemeSection, lazy, ...passProps })=>{
412
+ const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
413
413
  const Component = lazy ? Suspense : Fragment;
414
414
  const value = useMemo(()=>{
415
- return createBuilderPreviewProvider(state, isEditThemeSection);
415
+ return createBuilderPreviewProvider(state, isThemeSectionEditor);
416
416
  }, [
417
417
  state,
418
- isEditThemeSection
418
+ isThemeSectionEditor
419
419
  ]);
420
420
  return /*#__PURE__*/ jsx(Component, {
421
421
  children: /*#__PURE__*/ jsx(BuilderPreviewContext.Provider, {
@@ -7309,7 +7309,7 @@ declare const useBuilderStore: <U>(selector: (state: ExtractState<StoreApi<Build
7309
7309
  type BuilderPreviewContextProps = {
7310
7310
  state: BuilderState;
7311
7311
  loaded?: boolean;
7312
- isEditThemeSection?: boolean;
7312
+ isThemeSectionEditor?: boolean;
7313
7313
  addItem: (args: {
7314
7314
  data: BuilderEntityNested | BuilderEntityNested[];
7315
7315
  type?: 'component' | 'section';
@@ -7336,7 +7336,7 @@ type BuilderPreviewProviderProps = Pick<BuilderPreviewContextProps, 'state'> & {
7336
7336
  children: React.ReactNode;
7337
7337
  lazy?: boolean;
7338
7338
  priority?: boolean;
7339
- isEditThemeSection?: boolean;
7339
+ isThemeSectionEditor?: boolean;
7340
7340
  };
7341
7341
  declare const BuilderPreviewProvider: React.FC<BuilderPreviewProviderProps>;
7342
7342
  declare const useBuilderPreviewStore: <U>(selector: (state: ExtractState<StoreApi<BuilderPreviewContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
@@ -7533,7 +7533,7 @@ type ShopProviderProps = {
7533
7533
  children: React.ReactNode;
7534
7534
  key?: React.Key;
7535
7535
  addons: AddonContextProps['components'];
7536
- storeOption: Omit<ShopContextProps, 'changeLocale' | 'changeCurrency' | 'changeSwatches' | 'changeLayoutSettings' | 'changeStorefrontInfo'>;
7536
+ storeOption: Omit<ShopContextProps, 'changeLocale' | 'changeStorefrontInfo' | 'changeCurrency' | 'changeSwatches' | 'changeLayoutSettings' | 'changeCreateThemeSectionCount' | 'changeShopPlan'>;
7537
7537
  queryOption?: React.ComponentProps<typeof SWRConfig>['value'];
7538
7538
  };
7539
7539
  declare const ShopProvider: React.FC<ShopProviderProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.22.31-new-feature.2",
3
+ "version": "1.22.31-new-feature.4",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.22.31-staging.0",
28
- "@gem-sdk/styles": "1.22.31-new-feature.2"
28
+ "@gem-sdk/styles": "1.22.31-new-feature.4"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",