@gem-sdk/pages 2.5.3-staging.4 → 2.5.8

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,13 +3,8 @@
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
- ];
10
6
  const DropElement = ()=>{
11
7
  const editingPageType = core.useShopStore((s)=>s.pageType);
12
- const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
13
8
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
14
9
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
15
10
  bubbles: true,
@@ -116,7 +111,7 @@ const DropElement = ()=>{
116
111
  children: [
117
112
  /*#__PURE__*/ jsxRuntime.jsx("div", {
118
113
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
119
- children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
114
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
120
115
  }),
121
116
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
122
117
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -124,22 +119,22 @@ const DropElement = ()=>{
124
119
  /*#__PURE__*/ jsxRuntime.jsx("button", {
125
120
  "data-button-add-section": true,
126
121
  onClick: ()=>{
127
- if (isFunnelSalesPage) {
122
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
128
123
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
129
124
  } else dispatchEventBuildWithSectionActiveTab(true);
130
125
  },
131
126
  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]",
132
- children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
127
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
133
128
  }),
134
129
  /*#__PURE__*/ jsxRuntime.jsx("button", {
135
130
  "data-button-add-elements": true,
136
131
  onClick: ()=>{
137
- if (isFunnelSalesPage) {
132
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
138
133
  dispatchEventBuildWithTemplateActiveTab('templates');
139
134
  } else dispatchEventBuildWithSectionActiveTab(false);
140
135
  },
141
136
  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]",
142
- children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
137
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
143
138
  })
144
139
  ]
145
140
  }),
@@ -74,8 +74,7 @@ function normalizePageSectionResponseV2(sections, orders) {
74
74
  const parseBuilderTemplateV2 = (data)=>{
75
75
  return normalizePageSectionResponseV2([
76
76
  ...data?.pageSections ?? [],
77
- ...data?.themePageCustomSections ?? [],
78
- ...data?.themeSections ?? []
77
+ ...data?.themePageCustomSections ?? []
79
78
  ], data?.sectionPosition);
80
79
  };
81
80
  const parseBuilderTemplate = (data)=>{
@@ -1,13 +1,8 @@
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
- ];
8
4
  const DropElement = ()=>{
9
5
  const editingPageType = useShopStore((s)=>s.pageType);
10
- const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
11
6
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
12
7
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
13
8
  bubbles: true,
@@ -114,7 +109,7 @@ const DropElement = ()=>{
114
109
  children: [
115
110
  /*#__PURE__*/ jsx("div", {
116
111
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
117
- children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
112
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
118
113
  }),
119
114
  /*#__PURE__*/ jsxs("div", {
120
115
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -122,22 +117,22 @@ const DropElement = ()=>{
122
117
  /*#__PURE__*/ jsx("button", {
123
118
  "data-button-add-section": true,
124
119
  onClick: ()=>{
125
- if (isFunnelSalesPage) {
120
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
126
121
  dispatchEventBuildWithTemplateActiveTab('funnelExisting');
127
122
  } else dispatchEventBuildWithSectionActiveTab(true);
128
123
  },
129
124
  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]",
130
- children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
125
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Use existing page designs' : 'Add sections'
131
126
  }),
132
127
  /*#__PURE__*/ jsx("button", {
133
128
  "data-button-add-elements": true,
134
129
  onClick: ()=>{
135
- if (isFunnelSalesPage) {
130
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
136
131
  dispatchEventBuildWithTemplateActiveTab('templates');
137
132
  } else dispatchEventBuildWithSectionActiveTab(false);
138
133
  },
139
134
  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]",
140
- children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
135
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Explore templates' : 'Add elements'
141
136
  })
142
137
  ]
143
138
  }),
@@ -72,8 +72,7 @@ function normalizePageSectionResponseV2(sections, orders) {
72
72
  const parseBuilderTemplateV2 = (data)=>{
73
73
  return normalizePageSectionResponseV2([
74
74
  ...data?.pageSections ?? [],
75
- ...data?.themePageCustomSections ?? [],
76
- ...data?.themeSections ?? []
75
+ ...data?.themePageCustomSections ?? []
77
76
  ], data?.sectionPosition);
78
77
  };
79
78
  const parseBuilderTemplate = (data)=>{
@@ -143,14 +143,7 @@ declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<Sectio
143
143
  priority: boolean;
144
144
  data: any;
145
145
  }[];
146
- type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
147
- themeSections?: {
148
- id: string;
149
- name: string;
150
- content: string;
151
- }[];
152
- };
153
- declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
146
+ declare const parseBuilderTemplateV2: (data?: PublishedThemePageSelectFragment) => {
154
147
  uid: string;
155
148
  lazy: boolean;
156
149
  priority: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.5.3-staging.4",
3
+ "version": "2.5.8",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.5.3-staging.4",
29
+ "@gem-sdk/core": "2.5.7",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.1.0",
31
31
  "@gem-sdk/plugin-quick-view": "2.1.0",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.1.0"