@gem-sdk/pages 2.0.0-dev.194 → 2.0.0-dev.201

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.
@@ -2,8 +2,10 @@
2
2
  'use strict';
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
+ var core = require('@gem-sdk/core');
5
6
 
6
7
  const DropElement = ()=>{
8
+ const editingPageType = core.useShopStore((s)=>s.pageType);
7
9
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
8
10
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
9
11
  bubbles: true,
@@ -13,6 +15,15 @@ const DropElement = ()=>{
13
15
  });
14
16
  window.dispatchEvent(event);
15
17
  };
18
+ const dispatchEventBuildWithTemplateActiveTab = (value)=>{
19
+ const event = new CustomEvent('editor:sidebar:build-with-template-active-tab', {
20
+ bubbles: true,
21
+ detail: {
22
+ value
23
+ }
24
+ });
25
+ window.dispatchEvent(event);
26
+ };
16
27
  const handleClickGenerate = (e)=>{
17
28
  const event = new CustomEvent('editor:sidebar:click-img-to-layout-gallery-btn', e);
18
29
  window.dispatchEvent(event);
@@ -101,22 +112,30 @@ const DropElement = ()=>{
101
112
  children: [
102
113
  /*#__PURE__*/ jsxRuntime.jsx("div", {
103
114
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
104
- children: "Start with Sections from sidebar"
115
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
105
116
  }),
106
117
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
107
- className: "gp-flex gp-w-[291px] gp-justify-between",
118
+ className: "gp-flex gp-gap-3 gp-justify-between",
108
119
  children: [
109
120
  /*#__PURE__*/ jsxRuntime.jsx("button", {
110
121
  "data-button-add-section": true,
111
- onClick: ()=>dispatchEventBuildWithSectionActiveTab(true),
112
- className: "gp-flex gp-h-[40px] gp-w-[136px] 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]",
113
- children: "Add sections"
122
+ onClick: ()=>{
123
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
124
+ dispatchEventBuildWithTemplateActiveTab('funnelExisting');
125
+ } else dispatchEventBuildWithSectionActiveTab(true);
126
+ },
127
+ 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'
114
129
  }),
115
130
  /*#__PURE__*/ jsxRuntime.jsx("button", {
116
131
  "data-button-add-elements": true,
117
- onClick: ()=>dispatchEventBuildWithSectionActiveTab(false),
118
- className: "gp-flex gp-h-[40px] gp-w-[136px] 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]",
119
- children: "Add elements"
132
+ onClick: ()=>{
133
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
134
+ dispatchEventBuildWithTemplateActiveTab('templates');
135
+ } else dispatchEventBuildWithSectionActiveTab(false);
136
+ },
137
+ 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'
120
139
  })
121
140
  ]
122
141
  }),
@@ -1,7 +1,9 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useShopStore } from '@gem-sdk/core';
3
4
 
4
5
  const DropElement = ()=>{
6
+ const editingPageType = useShopStore((s)=>s.pageType);
5
7
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
6
8
  const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
7
9
  bubbles: true,
@@ -11,6 +13,15 @@ const DropElement = ()=>{
11
13
  });
12
14
  window.dispatchEvent(event);
13
15
  };
16
+ const dispatchEventBuildWithTemplateActiveTab = (value)=>{
17
+ const event = new CustomEvent('editor:sidebar:build-with-template-active-tab', {
18
+ bubbles: true,
19
+ detail: {
20
+ value
21
+ }
22
+ });
23
+ window.dispatchEvent(event);
24
+ };
14
25
  const handleClickGenerate = (e)=>{
15
26
  const event = new CustomEvent('editor:sidebar:click-img-to-layout-gallery-btn', e);
16
27
  window.dispatchEvent(event);
@@ -99,22 +110,30 @@ const DropElement = ()=>{
99
110
  children: [
100
111
  /*#__PURE__*/ jsx("div", {
101
112
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
102
- children: "Start with Sections from sidebar"
113
+ children: editingPageType === 'GP_FUNNEL_PAGE' ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
103
114
  }),
104
115
  /*#__PURE__*/ jsxs("div", {
105
- className: "gp-flex gp-w-[291px] gp-justify-between",
116
+ className: "gp-flex gp-gap-3 gp-justify-between",
106
117
  children: [
107
118
  /*#__PURE__*/ jsx("button", {
108
119
  "data-button-add-section": true,
109
- onClick: ()=>dispatchEventBuildWithSectionActiveTab(true),
110
- className: "gp-flex gp-h-[40px] gp-w-[136px] 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]",
111
- children: "Add sections"
120
+ onClick: ()=>{
121
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
122
+ dispatchEventBuildWithTemplateActiveTab('funnelExisting');
123
+ } else dispatchEventBuildWithSectionActiveTab(true);
124
+ },
125
+ 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'
112
127
  }),
113
128
  /*#__PURE__*/ jsx("button", {
114
129
  "data-button-add-elements": true,
115
- onClick: ()=>dispatchEventBuildWithSectionActiveTab(false),
116
- className: "gp-flex gp-h-[40px] gp-w-[136px] 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]",
117
- children: "Add elements"
130
+ onClick: ()=>{
131
+ if (editingPageType === 'GP_FUNNEL_PAGE') {
132
+ dispatchEventBuildWithTemplateActiveTab('templates');
133
+ } else dispatchEventBuildWithSectionActiveTab(false);
134
+ },
135
+ 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'
118
137
  })
119
138
  ]
120
139
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.194",
3
+ "version": "2.0.0-dev.201",
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.0.0-dev.195",
29
+ "@gem-sdk/core": "2.0.0-dev.200",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.184",
31
31
  "@gem-sdk/plugin-quick-view": "2.0.0-dev.184",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.184"