@gem-sdk/pages 2.2.0-staging.64 → 2.2.0-staging.68

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.
@@ -161,7 +161,9 @@ const Toolbox = ()=>{
161
161
  } catch {
162
162
  //
163
163
  }
164
- }, []);
164
+ }, [
165
+ fontType
166
+ ]);
165
167
  // Init builder data
166
168
  const onInitBuilder = react.useCallback((e)=>{
167
169
  clearModal();
@@ -3,8 +3,13 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var core = require('@gem-sdk/core');
5
5
 
6
+ const SALE_FUNNEL_PAGE_TYPES = [
7
+ 'GP_FUNNEL_PAGE',
8
+ 'GP_PRE_SALE_PAGE'
9
+ ];
6
10
  const DropElement = ()=>{
7
11
  const editingPageType = core.useShopStore((s)=>s.pageType);
12
+ const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
8
13
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
9
14
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
10
15
  bubbles: true,
@@ -111,7 +116,7 @@ const DropElement = ()=>{
111
116
  children: [
112
117
  /*#__PURE__*/ jsxRuntime.jsx("div", {
113
118
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
114
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
119
+ children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
115
120
  }),
116
121
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
117
122
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -119,22 +124,22 @@ const DropElement = ()=>{
119
124
  /*#__PURE__*/ jsxRuntime.jsx("button", {
120
125
  "data-button-add-section": true,
121
126
  onClick: ()=>{
122
- if (editingPageType === 'GP_FUNNEL_PAGE') {
127
+ if (isFunnelSalesPage) {
123
128
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
124
129
  } else dispatchEventBuildWithSectionActiveTab(true);
125
130
  },
126
131
  className: "gp-flex gp-h-[40px] gp-px-6 gp-items-center gp-font-medium gp-justify-center gp-rounded-[8px] gp-bg-[#1C1C1C] gp-text-[14px] gp-text-white hover:gp-bg-[#3B3B3B]",
127
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
132
+ children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
128
133
  }),
129
134
  /*#__PURE__*/ jsxRuntime.jsx("button", {
130
135
  "data-button-add-elements": true,
131
136
  onClick: ()=>{
132
- if (editingPageType === 'GP_FUNNEL_PAGE') {
137
+ if (isFunnelSalesPage) {
133
138
  dispatchEventBuildWithTemplateActiveTab('templates');
134
139
  } else dispatchEventBuildWithSectionActiveTab(false);
135
140
  },
136
141
  className: "gp-flex gp-h-[40px] gp-px-6 gp-items-center gp-font-medium gp-justify-center gp-rounded-[8px] gp-bg-[#f4f4f4] gp-text-[14px] gp-text-[#212121] hover:gp-bg-[#E2E2E2]",
137
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
142
+ children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
138
143
  })
139
144
  ]
140
145
  }),
@@ -157,7 +157,9 @@ const Toolbox = ()=>{
157
157
  } catch {
158
158
  //
159
159
  }
160
- }, []);
160
+ }, [
161
+ fontType
162
+ ]);
161
163
  // Init builder data
162
164
  const onInitBuilder = useCallback((e)=>{
163
165
  clearModal();
@@ -1,8 +1,13 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useShopStore } from '@gem-sdk/core';
3
3
 
4
+ const SALE_FUNNEL_PAGE_TYPES = [
5
+ 'GP_FUNNEL_PAGE',
6
+ 'GP_PRE_SALE_PAGE'
7
+ ];
4
8
  const DropElement = ()=>{
5
9
  const editingPageType = useShopStore((s)=>s.pageType);
10
+ const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
6
11
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
7
12
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
8
13
  bubbles: true,
@@ -109,7 +114,7 @@ const DropElement = ()=>{
109
114
  children: [
110
115
  /*#__PURE__*/ jsx("div", {
111
116
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
112
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
117
+ children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
113
118
  }),
114
119
  /*#__PURE__*/ jsxs("div", {
115
120
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -117,22 +122,22 @@ const DropElement = ()=>{
117
122
  /*#__PURE__*/ jsx("button", {
118
123
  "data-button-add-section": true,
119
124
  onClick: ()=>{
120
- if (editingPageType === 'GP_FUNNEL_PAGE') {
125
+ if (isFunnelSalesPage) {
121
126
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
122
127
  } else dispatchEventBuildWithSectionActiveTab(true);
123
128
  },
124
129
  className: "gp-flex gp-h-[40px] gp-px-6 gp-items-center gp-font-medium gp-justify-center gp-rounded-[8px] gp-bg-[#1C1C1C] gp-text-[14px] gp-text-white hover:gp-bg-[#3B3B3B]",
125
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
130
+ children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
126
131
  }),
127
132
  /*#__PURE__*/ jsx("button", {
128
133
  "data-button-add-elements": true,
129
134
  onClick: ()=>{
130
- if (editingPageType === 'GP_FUNNEL_PAGE') {
135
+ if (isFunnelSalesPage) {
131
136
  dispatchEventBuildWithTemplateActiveTab('templates');
132
137
  } else dispatchEventBuildWithSectionActiveTab(false);
133
138
  },
134
139
  className: "gp-flex gp-h-[40px] gp-px-6 gp-items-center gp-font-medium gp-justify-center gp-rounded-[8px] gp-bg-[#f4f4f4] gp-text-[14px] gp-text-[#212121] hover:gp-bg-[#E2E2E2]",
135
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
140
+ children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
136
141
  })
137
142
  ]
138
143
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.2.0-staging.64",
3
+ "version": "2.2.0-staging.68",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",