@gem-sdk/core 1.22.31-new-feature.11 → 1.22.31-new-feature.13

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.
@@ -4,8 +4,9 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('zustand');
6
6
  var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
7
- require('swr');
7
+ var ShopContext = require('../contexts/ShopContext.js');
8
8
  require('@gem-sdk/adapter-shopify');
9
+ require('swr');
9
10
  require('swr/mutation');
10
11
  require('vanilla-lazyload');
11
12
  require('../hooks/useCartUI.js');
@@ -17,6 +18,7 @@ require('../helpers/convert.js');
17
18
  const SECTION_LIMIT = 25;
18
19
  const ComponentToolbarPreview = ({ ...props })=>{
19
20
  const isThemeSection = props.isThemeSection;
21
+ const editingPageType = ShopContext.useShopStore((s)=>s.pageType);
20
22
  const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
21
23
  const root = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem('ROOT'));
22
24
  const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
@@ -273,7 +275,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
273
275
  })
274
276
  ]
275
277
  }, parent.uid)),
276
- getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
278
+ editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
277
279
  ...props
278
280
  }),
279
281
  /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
@@ -316,7 +318,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
316
318
  })
317
319
  ]
318
320
  }),
319
- getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatus, {
321
+ editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(ThemeSectionStatus.ThemeSectionStatus, {
320
322
  ...props
321
323
  }),
322
324
  /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -2,8 +2,9 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { useState, useCallback, useEffect } from 'react';
3
3
  import 'zustand';
4
4
  import { useBuilderPreviewStore } from '../contexts/BuilderPreviewContext.js';
5
- import 'swr';
5
+ import { useShopStore } from '../contexts/ShopContext.js';
6
6
  import '@gem-sdk/adapter-shopify';
7
+ import 'swr';
7
8
  import 'swr/mutation';
8
9
  import 'vanilla-lazyload';
9
10
  import '../hooks/useCartUI.js';
@@ -15,6 +16,7 @@ import '../helpers/convert.js';
15
16
  const SECTION_LIMIT = 25;
16
17
  const ComponentToolbarPreview = ({ ...props })=>{
17
18
  const isThemeSection = props.isThemeSection;
19
+ const editingPageType = useShopStore((s)=>s.pageType);
18
20
  const getParents = useBuilderPreviewStore((s)=>s.getParents);
19
21
  const root = useBuilderPreviewStore((s)=>s.getItem('ROOT'));
20
22
  const isThemeSectionEditor = useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
@@ -271,7 +273,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
271
273
  })
272
274
  ]
273
275
  }, parent.uid)),
274
- getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
276
+ editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
275
277
  ...props
276
278
  }),
277
279
  /*#__PURE__*/ jsx(Tooltip, {
@@ -314,7 +316,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
314
316
  })
315
317
  ]
316
318
  }),
317
- getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsx(ThemeSectionStatus, {
319
+ editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsx(ThemeSectionStatus, {
318
320
  ...props
319
321
  }),
320
322
  /*#__PURE__*/ jsx("div", {
@@ -989,7 +989,7 @@ type ControlUI = {
989
989
  };
990
990
  isMoreSetting?: boolean;
991
991
  };
992
- type PageType = 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'GP_ARTICLE' | 'GP_BLOG' | 'GP_COLLECTION' | 'GP_INDEX' | 'GP_PRODUCT' | 'GP_STATIC' | 'PRODUCT' | 'STATIC';
992
+ type PageType = 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'GP_ARTICLE' | 'GP_BLOG' | 'GP_COLLECTION' | 'GP_INDEX' | 'GP_PRODUCT' | 'GP_STATIC' | 'PRODUCT' | 'STATIC' | 'THEME_SECTION';
993
993
  type ComponentPreset = {
994
994
  id: string;
995
995
  name: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.22.31-new-feature.11",
3
+ "version": "1.22.31-new-feature.13",
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.11"
28
+ "@gem-sdk/styles": "1.22.31-new-feature.13"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",