@gem-sdk/pages 2.0.0-dev.570 → 2.0.0-dev.576

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,13 @@
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var core = require('@gem-sdk/core');
6
6
 
7
+ const SALE_FUNNEL_PAGE_TYPES = [
8
+ 'GP_FUNNEL_PAGE',
9
+ 'GP_PRE_SALE_PAGE'
10
+ ];
7
11
  const DropElement = ()=>{
8
12
  const editingPageType = core.useShopStore((s)=>s.pageType);
13
+ const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
9
14
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
10
15
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
11
16
  bubbles: true,
@@ -112,7 +117,7 @@ const DropElement = ()=>{
112
117
  children: [
113
118
  /*#__PURE__*/ jsxRuntime.jsx("div", {
114
119
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
115
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
120
+ children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
116
121
  }),
117
122
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
118
123
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -120,22 +125,22 @@ const DropElement = ()=>{
120
125
  /*#__PURE__*/ jsxRuntime.jsx("button", {
121
126
  "data-button-add-section": true,
122
127
  onClick: ()=>{
123
- if (editingPageType === 'GP_FUNNEL_PAGE') {
128
+ if (isFunnelSalesPage) {
124
129
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
125
130
  } else dispatchEventBuildWithSectionActiveTab(true);
126
131
  },
127
132
  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]",
128
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
133
+ children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
129
134
  }),
130
135
  /*#__PURE__*/ jsxRuntime.jsx("button", {
131
136
  "data-button-add-elements": true,
132
137
  onClick: ()=>{
133
- if (editingPageType === 'GP_FUNNEL_PAGE') {
138
+ if (isFunnelSalesPage) {
134
139
  dispatchEventBuildWithTemplateActiveTab('templates');
135
140
  } else dispatchEventBuildWithSectionActiveTab(false);
136
141
  },
137
142
  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]",
138
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
143
+ children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
139
144
  })
140
145
  ]
141
146
  }),
@@ -2,8 +2,13 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useShopStore } from '@gem-sdk/core';
4
4
 
5
+ const SALE_FUNNEL_PAGE_TYPES = [
6
+ 'GP_FUNNEL_PAGE',
7
+ 'GP_PRE_SALE_PAGE'
8
+ ];
5
9
  const DropElement = ()=>{
6
10
  const editingPageType = useShopStore((s)=>s.pageType);
11
+ const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
7
12
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
8
13
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
9
14
  bubbles: true,
@@ -110,7 +115,7 @@ const DropElement = ()=>{
110
115
  children: [
111
116
  /*#__PURE__*/ jsx("div", {
112
117
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
113
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
118
+ children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
114
119
  }),
115
120
  /*#__PURE__*/ jsxs("div", {
116
121
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -118,22 +123,22 @@ const DropElement = ()=>{
118
123
  /*#__PURE__*/ jsx("button", {
119
124
  "data-button-add-section": true,
120
125
  onClick: ()=>{
121
- if (editingPageType === 'GP_FUNNEL_PAGE') {
126
+ if (isFunnelSalesPage) {
122
127
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
123
128
  } else dispatchEventBuildWithSectionActiveTab(true);
124
129
  },
125
130
  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]",
126
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
131
+ children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
127
132
  }),
128
133
  /*#__PURE__*/ jsx("button", {
129
134
  "data-button-add-elements": true,
130
135
  onClick: ()=>{
131
- if (editingPageType === 'GP_FUNNEL_PAGE') {
136
+ if (isFunnelSalesPage) {
132
137
  dispatchEventBuildWithTemplateActiveTab('templates');
133
138
  } else dispatchEventBuildWithSectionActiveTab(false);
134
139
  },
135
140
  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]",
136
- children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
141
+ children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
137
142
  })
138
143
  ]
139
144
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.570",
3
+ "version": "2.0.0-dev.576",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "14.2.20"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.0.0-dev.569",
29
+ "@gem-sdk/core": "2.0.0-dev.575",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.348",
31
31
  "@gem-sdk/plugin-quick-view": "2.0.0-dev.348",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.348"