@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.
|
@@ -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:
|
|
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 (
|
|
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:
|
|
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 (
|
|
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:
|
|
142
|
+
children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
|
|
138
143
|
})
|
|
139
144
|
]
|
|
140
145
|
}),
|
|
@@ -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:
|
|
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 (
|
|
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:
|
|
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 (
|
|
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:
|
|
140
|
+
children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
|
|
136
141
|
})
|
|
137
142
|
]
|
|
138
143
|
}),
|