@gem-sdk/pages 2.0.0-dev.695 → 2.0.0-dev.699

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.
@@ -40,6 +40,7 @@ const Toolbox = ()=>{
40
40
  const changeLayoutSettings = core.useShopStore((s)=>s.changeLayoutSettings);
41
41
  const changeCreateThemeSectionCount = core.useShopStore((s)=>s.changeCreateThemeSectionCount);
42
42
  const changeShopPlan = core.useShopStore((s)=>s.changeShopPlan);
43
+ const updatePriceWithCurrency = core.useShopStore((s)=>s.updatePriceWithCurrency);
43
44
  const changeFontType = libsStore.libsStore((s)=>s.changeFontType);
44
45
  const fontType = libsStore.libsStore((s)=>s.fontType);
45
46
  const clearModal = core.useModalStore((s)=>s.clearModal);
@@ -299,6 +300,13 @@ const Toolbox = ()=>{
299
300
  }, [
300
301
  changeShopPlan
301
302
  ]);
303
+ const onUpdatePriceWithCurrency = react.useCallback((e)=>{
304
+ const showPriceCurrency = e.detail;
305
+ if (!showPriceCurrency) return;
306
+ updatePriceWithCurrency(showPriceCurrency);
307
+ }, [
308
+ updatePriceWithCurrency
309
+ ]);
302
310
  const onUpdateFontType = react.useCallback((e)=>{
303
311
  const fontType = e.detail;
304
312
  if (!fontType) return;
@@ -436,6 +444,7 @@ const Toolbox = ()=>{
436
444
  window.addEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
437
445
  window.addEventListener('change-sidebar-mode', onChangeSidebarMode);
438
446
  window.addEventListener('update-font-type', onUpdateFontType);
447
+ window.addEventListener('update-price-with-currency', onUpdatePriceWithCurrency);
439
448
  return ()=>{
440
449
  window.removeEventListener('update-shop-info', onChangeShopInfo);
441
450
  window.removeEventListener('revalidate-query', onRevalidateQuery);
@@ -449,6 +458,7 @@ const Toolbox = ()=>{
449
458
  window.removeEventListener('on-off-header-footer', onChangeLayoutSettingData);
450
459
  window.removeEventListener('update-create-theme-section-count', onUpdateCreateThemeSectionCount);
451
460
  window.removeEventListener('update-shop-plan', onUpdateShopPlan);
461
+ window.removeEventListener('update-price-with-currency', onUpdatePriceWithCurrency);
452
462
  window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
453
463
  window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
454
464
  window.removeEventListener('update-item-name', onUpdateItemName);
@@ -487,7 +497,8 @@ const Toolbox = ()=>{
487
497
  onUpdateInteractionSettingType,
488
498
  onUpdateFontType,
489
499
  onChangeSidebarMode,
490
- onUpdateDynamicDiscountOffer
500
+ onUpdateDynamicDiscountOffer,
501
+ onUpdatePriceWithCurrency
491
502
  ]);
492
503
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
493
504
  className: "toolbox"
@@ -9,6 +9,7 @@ const SALE_FUNNEL_PAGE_TYPES = [
9
9
  'GP_PRE_SALE_PAGE'
10
10
  ];
11
11
  const DropElement = ()=>{
12
+ const { t } = core.useI18n();
12
13
  const editingPageType = core.useShopStore((s)=>s.pageType);
13
14
  const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
14
15
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
@@ -117,7 +118,7 @@ const DropElement = ()=>{
117
118
  children: [
118
119
  /*#__PURE__*/ jsxRuntime.jsx("div", {
119
120
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
120
- children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
121
+ children: isFunnelSalesPage ? t('Start building with Sections/Elements or') : t('Start with Sections from sidebar')
121
122
  }),
122
123
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
123
124
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -130,7 +131,7 @@ const DropElement = ()=>{
130
131
  } else dispatchEventBuildWithSectionActiveTab(true);
131
132
  },
132
133
  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]",
133
- children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
134
+ children: isFunnelSalesPage ? t('Use existing page designs') : t('Add sections')
134
135
  }),
135
136
  /*#__PURE__*/ jsxRuntime.jsx("button", {
136
137
  "data-button-add-elements": true,
@@ -140,7 +141,7 @@ const DropElement = ()=>{
140
141
  } else dispatchEventBuildWithSectionActiveTab(false);
141
142
  },
142
143
  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]",
143
- children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
144
+ children: isFunnelSalesPage ? t('Explore templates') : t('Add elements')
144
145
  })
145
146
  ]
146
147
  }),
@@ -179,7 +180,7 @@ const DropElement = ()=>{
179
180
  "aria-hidden": "true",
180
181
  id: "gp-img-to-layout-gallery-btn",
181
182
  className: "gp-relative gp-cursor-pointer gp-text-[14px] gp-font-medium gp-text-[#3C67FF]",
182
- children: "Start with Generating from URL or image"
183
+ children: t('Start with Generating from URL or image')
183
184
  })
184
185
  })
185
186
  ]
@@ -36,6 +36,7 @@ const Toolbox = ()=>{
36
36
  const changeLayoutSettings = useShopStore((s)=>s.changeLayoutSettings);
37
37
  const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
38
38
  const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
39
+ const updatePriceWithCurrency = useShopStore((s)=>s.updatePriceWithCurrency);
39
40
  const changeFontType = libsStore((s)=>s.changeFontType);
40
41
  const fontType = libsStore((s)=>s.fontType);
41
42
  const clearModal = useModalStore((s)=>s.clearModal);
@@ -295,6 +296,13 @@ const Toolbox = ()=>{
295
296
  }, [
296
297
  changeShopPlan
297
298
  ]);
299
+ const onUpdatePriceWithCurrency = useCallback((e)=>{
300
+ const showPriceCurrency = e.detail;
301
+ if (!showPriceCurrency) return;
302
+ updatePriceWithCurrency(showPriceCurrency);
303
+ }, [
304
+ updatePriceWithCurrency
305
+ ]);
298
306
  const onUpdateFontType = useCallback((e)=>{
299
307
  const fontType = e.detail;
300
308
  if (!fontType) return;
@@ -432,6 +440,7 @@ const Toolbox = ()=>{
432
440
  window.addEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
433
441
  window.addEventListener('change-sidebar-mode', onChangeSidebarMode);
434
442
  window.addEventListener('update-font-type', onUpdateFontType);
443
+ window.addEventListener('update-price-with-currency', onUpdatePriceWithCurrency);
435
444
  return ()=>{
436
445
  window.removeEventListener('update-shop-info', onChangeShopInfo);
437
446
  window.removeEventListener('revalidate-query', onRevalidateQuery);
@@ -445,6 +454,7 @@ const Toolbox = ()=>{
445
454
  window.removeEventListener('on-off-header-footer', onChangeLayoutSettingData);
446
455
  window.removeEventListener('update-create-theme-section-count', onUpdateCreateThemeSectionCount);
447
456
  window.removeEventListener('update-shop-plan', onUpdateShopPlan);
457
+ window.removeEventListener('update-price-with-currency', onUpdatePriceWithCurrency);
448
458
  window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
449
459
  window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
450
460
  window.removeEventListener('update-item-name', onUpdateItemName);
@@ -483,7 +493,8 @@ const Toolbox = ()=>{
483
493
  onUpdateInteractionSettingType,
484
494
  onUpdateFontType,
485
495
  onChangeSidebarMode,
486
- onUpdateDynamicDiscountOffer
496
+ onUpdateDynamicDiscountOffer,
497
+ onUpdatePriceWithCurrency
487
498
  ]);
488
499
  return /*#__PURE__*/ jsx("div", {
489
500
  className: "toolbox"
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useShopStore } from '@gem-sdk/core';
3
+ import { useI18n, useShopStore } from '@gem-sdk/core';
4
4
 
5
5
  const SALE_FUNNEL_PAGE_TYPES = [
6
6
  'GP_FUNNEL_PAGE',
7
7
  'GP_PRE_SALE_PAGE'
8
8
  ];
9
9
  const DropElement = ()=>{
10
+ const { t } = useI18n();
10
11
  const editingPageType = useShopStore((s)=>s.pageType);
11
12
  const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
12
13
  const dispatchEventBuildWithSectionActiveTab = (value)=>{
@@ -115,7 +116,7 @@ const DropElement = ()=>{
115
116
  children: [
116
117
  /*#__PURE__*/ jsx("div", {
117
118
  className: "gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",
118
- children: isFunnelSalesPage ? 'Start building with Sections/Elements or' : 'Start with Sections from sidebar'
119
+ children: isFunnelSalesPage ? t('Start building with Sections/Elements or') : t('Start with Sections from sidebar')
119
120
  }),
120
121
  /*#__PURE__*/ jsxs("div", {
121
122
  className: "gp-flex gp-gap-3 gp-justify-between",
@@ -128,7 +129,7 @@ const DropElement = ()=>{
128
129
  } else dispatchEventBuildWithSectionActiveTab(true);
129
130
  },
130
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]",
131
- children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
132
+ children: isFunnelSalesPage ? t('Use existing page designs') : t('Add sections')
132
133
  }),
133
134
  /*#__PURE__*/ jsx("button", {
134
135
  "data-button-add-elements": true,
@@ -138,7 +139,7 @@ const DropElement = ()=>{
138
139
  } else dispatchEventBuildWithSectionActiveTab(false);
139
140
  },
140
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]",
141
- children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
142
+ children: isFunnelSalesPage ? t('Explore templates') : t('Add elements')
142
143
  })
143
144
  ]
144
145
  }),
@@ -177,7 +178,7 @@ const DropElement = ()=>{
177
178
  "aria-hidden": "true",
178
179
  id: "gp-img-to-layout-gallery-btn",
179
180
  className: "gp-relative gp-cursor-pointer gp-text-[14px] gp-font-medium gp-text-[#3C67FF]",
180
- children: "Start with Generating from URL or image"
181
+ children: t('Start with Generating from URL or image')
181
182
  })
182
183
  })
183
184
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.695",
3
+ "version": "2.0.0-dev.699",
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.695",
29
+ "@gem-sdk/core": "2.0.0-dev.699",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.695",
31
31
  "@gem-sdk/plugin-quick-view": "2.0.0-dev.695",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.695"