@gem-sdk/pages 3.0.0-pre-production.0 → 3.0.0

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.
Files changed (150) hide show
  1. package/dist/cjs/components/ErrorBoundary.js +2 -40
  2. package/dist/cjs/components/ErrorFallback.js +2 -26
  3. package/dist/cjs/components/FacebookPixel.js +4 -36
  4. package/dist/cjs/components/FooterForPostPurchase.js +2 -34
  5. package/dist/cjs/components/GoogleAnalytic.js +6 -67
  6. package/dist/cjs/components/TikTokPixel.js +4 -19
  7. package/dist/cjs/components/builder/Body.js +2 -36
  8. package/dist/cjs/components/builder/Footer.js +2 -154
  9. package/dist/cjs/components/builder/Header.js +2 -189
  10. package/dist/cjs/components/builder/PopupManager.js +2 -63
  11. package/dist/cjs/components/builder/SwitchView.js +2 -184
  12. package/dist/cjs/components/builder/Toolbar.js +2 -706
  13. package/dist/cjs/components/builder/Toolbox.js +2 -494
  14. package/dist/cjs/components/builder/const.js +1 -56
  15. package/dist/cjs/components/builder/toolbar/const.js +1 -7
  16. package/dist/cjs/components/builder/toolbar/utils/findDOMClosest.js +1 -41
  17. package/dist/cjs/components/builder/toolbar/utils/findOverflowParent.js +1 -20
  18. package/dist/cjs/components/builder/toolbar/utils/getChildrenByAttrSelector.js +1 -18
  19. package/dist/cjs/components/builder/toolbar/utils/getDOMElementParents.js +1 -32
  20. package/dist/cjs/components/builder/toolbar/utils/isOverParent.js +1 -16
  21. package/dist/cjs/components/builder/toolbar/utils/isOverToolbarPosition.js +1 -12
  22. package/dist/cjs/components/builder/toolbar/utils/isSection.js +1 -8
  23. package/dist/cjs/components/builder/toolbar/utils/notVisible.js +1 -8
  24. package/dist/cjs/components/builder/toolbar/utils/waitForElementToExist.js +1 -27
  25. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +2 -150
  26. package/dist/cjs/components/image-to-layout/DropElement.js +2 -190
  27. package/dist/cjs/components/image-to-layout/ImageToLayout.js +2 -41
  28. package/dist/cjs/constants/index.js +1 -0
  29. package/dist/cjs/index.js +1 -82
  30. package/dist/cjs/layouts/main.js +2 -30
  31. package/dist/cjs/libs/api/get-builder-props.js +1 -46
  32. package/dist/cjs/libs/api/get-collection-props.js +1 -68
  33. package/dist/cjs/libs/api/get-home-page-props-v2.js +1 -145
  34. package/dist/cjs/libs/api/get-home-page-props.js +1 -151
  35. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -300
  36. package/dist/cjs/libs/api/get-preview-props.js +1 -18
  37. package/dist/cjs/libs/api/get-product-props.js +1 -73
  38. package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -159
  39. package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -168
  40. package/dist/cjs/libs/api/get-static-page-props.js +1 -148
  41. package/dist/cjs/libs/custom-fonts.js +6 -60
  42. package/dist/cjs/libs/fetcher.js +1 -100
  43. package/dist/cjs/libs/get-layout.js +1 -13
  44. package/dist/cjs/libs/get-storefront-api.js +1 -12
  45. package/dist/cjs/libs/getStaticPaths.js +1 -10
  46. package/dist/cjs/libs/google-fonts.js +1 -118
  47. package/dist/cjs/libs/helpers/check-option-font.js +1 -65
  48. package/dist/cjs/libs/helpers/common.js +1 -27
  49. package/dist/cjs/libs/helpers/extract-operation.js +1 -0
  50. package/dist/cjs/libs/helpers/gen-css.js +1 -135
  51. package/dist/cjs/libs/helpers/gen-fonts.js +1 -90
  52. package/dist/cjs/libs/helpers/generate-manifres.js +1 -5
  53. package/dist/cjs/libs/helpers/get-fallback.js +1 -34
  54. package/dist/cjs/libs/helpers/get-metafield.js +1 -0
  55. package/dist/cjs/libs/helpers/normalize.js +1 -103
  56. package/dist/cjs/libs/helpers/parse-json.js +1 -16
  57. package/dist/cjs/libs/helpers/sentry.js +1 -17
  58. package/dist/cjs/libs/helpers/user-agent.js +1 -7
  59. package/dist/cjs/libs/hooks/use-tracking-view.js +2 -42
  60. package/dist/cjs/libs/hooks/usePagePreview.js +1 -92
  61. package/dist/cjs/libs/parse-html.js +1 -34
  62. package/dist/cjs/libs/shopify-cdn-with-google-fonts.js +1 -1845
  63. package/dist/cjs/pages/404.js +2 -43
  64. package/dist/cjs/pages/500.js +2 -74
  65. package/dist/cjs/pages/CollectionGlobalProvider.js +2 -59
  66. package/dist/cjs/pages/builder.js +2 -115
  67. package/dist/cjs/pages/collection-detail.js +2 -64
  68. package/dist/cjs/pages/preview.js +2 -26
  69. package/dist/cjs/pages/product-detail.js +2 -69
  70. package/dist/cjs/pages/static-v2.js +5 -133
  71. package/dist/cjs/pages/static.js +2 -75
  72. package/dist/cjs/store/libs-store.js +1 -14
  73. package/dist/esm/components/ErrorBoundary.js +2 -38
  74. package/dist/esm/components/ErrorFallback.js +2 -24
  75. package/dist/esm/components/FacebookPixel.js +4 -34
  76. package/dist/esm/components/FooterForPostPurchase.js +2 -30
  77. package/dist/esm/components/GoogleAnalytic.js +6 -65
  78. package/dist/esm/components/TikTokPixel.js +4 -17
  79. package/dist/esm/components/builder/Body.js +2 -32
  80. package/dist/esm/components/builder/Footer.js +2 -150
  81. package/dist/esm/components/builder/Header.js +2 -185
  82. package/dist/esm/components/builder/PopupManager.js +2 -59
  83. package/dist/esm/components/builder/SwitchView.js +2 -180
  84. package/dist/esm/components/builder/Toolbar.js +2 -702
  85. package/dist/esm/components/builder/Toolbox.js +2 -490
  86. package/dist/esm/components/builder/const.js +1 -54
  87. package/dist/esm/components/builder/toolbar/const.js +1 -4
  88. package/dist/esm/components/builder/toolbar/utils/findDOMClosest.js +1 -39
  89. package/dist/esm/components/builder/toolbar/utils/findOverflowParent.js +1 -18
  90. package/dist/esm/components/builder/toolbar/utils/getChildrenByAttrSelector.js +1 -16
  91. package/dist/esm/components/builder/toolbar/utils/getDOMElementParents.js +1 -30
  92. package/dist/esm/components/builder/toolbar/utils/isOverParent.js +1 -14
  93. package/dist/esm/components/builder/toolbar/utils/isOverToolbarPosition.js +1 -10
  94. package/dist/esm/components/builder/toolbar/utils/isSection.js +1 -6
  95. package/dist/esm/components/builder/toolbar/utils/notVisible.js +1 -6
  96. package/dist/esm/components/builder/toolbar/utils/waitForElementToExist.js +1 -25
  97. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +2 -146
  98. package/dist/esm/components/image-to-layout/DropElement.js +2 -188
  99. package/dist/esm/components/image-to-layout/ImageToLayout.js +2 -37
  100. package/dist/esm/constants/index.js +1 -0
  101. package/dist/esm/index.js +1 -36
  102. package/dist/esm/layouts/main.js +2 -26
  103. package/dist/esm/libs/api/get-builder-props.js +1 -44
  104. package/dist/esm/libs/api/get-collection-props.js +1 -66
  105. package/dist/esm/libs/api/get-home-page-props-v2.js +1 -143
  106. package/dist/esm/libs/api/get-home-page-props.js +1 -149
  107. package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -292
  108. package/dist/esm/libs/api/get-preview-props.js +1 -16
  109. package/dist/esm/libs/api/get-product-props.js +1 -71
  110. package/dist/esm/libs/api/get-static-page-props-preview.js +1 -157
  111. package/dist/esm/libs/api/get-static-page-props-v2.js +1 -166
  112. package/dist/esm/libs/api/get-static-page-props.js +1 -146
  113. package/dist/esm/libs/custom-fonts.js +6 -55
  114. package/dist/esm/libs/fetcher.js +1 -96
  115. package/dist/esm/libs/get-layout.js +1 -11
  116. package/dist/esm/libs/get-storefront-api.js +1 -10
  117. package/dist/esm/libs/getStaticPaths.js +1 -8
  118. package/dist/esm/libs/google-fonts.js +1 -112
  119. package/dist/esm/libs/helpers/check-option-font.js +1 -63
  120. package/dist/esm/libs/helpers/common.js +1 -24
  121. package/dist/esm/libs/helpers/extract-operation.js +1 -0
  122. package/dist/esm/libs/helpers/gen-css.js +1 -133
  123. package/dist/esm/libs/helpers/gen-fonts.js +1 -87
  124. package/dist/esm/libs/helpers/generate-manifres.js +1 -3
  125. package/dist/esm/libs/helpers/get-fallback.js +1 -32
  126. package/dist/esm/libs/helpers/get-metafield.js +1 -0
  127. package/dist/esm/libs/helpers/normalize.js +1 -96
  128. package/dist/esm/libs/helpers/parse-json.js +1 -13
  129. package/dist/esm/libs/helpers/sentry.js +1 -15
  130. package/dist/esm/libs/helpers/user-agent.js +1 -5
  131. package/dist/esm/libs/hooks/use-tracking-view.js +2 -40
  132. package/dist/esm/libs/hooks/usePagePreview.js +1 -90
  133. package/dist/esm/libs/parse-html.js +1 -32
  134. package/dist/esm/libs/shopify-cdn-with-google-fonts.js +1 -1843
  135. package/dist/esm/pages/404.js +2 -41
  136. package/dist/esm/pages/500.js +2 -72
  137. package/dist/esm/pages/CollectionGlobalProvider.js +2 -55
  138. package/dist/esm/pages/builder.js +2 -113
  139. package/dist/esm/pages/collection-detail.js +2 -60
  140. package/dist/esm/pages/preview.js +2 -24
  141. package/dist/esm/pages/product-detail.js +2 -65
  142. package/dist/esm/pages/static-v2.js +5 -131
  143. package/dist/esm/pages/static.js +2 -71
  144. package/dist/esm/store/libs-store.js +1 -12
  145. package/dist/types/index.d.ts +61 -63
  146. package/package.json +7 -7
  147. package/dist/cjs/components/builder/InteractionSelectOnPageHeader.js +0 -192
  148. package/dist/cjs/libs/helpers/gen-favicon.js +0 -22
  149. package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +0 -188
  150. package/dist/esm/libs/helpers/gen-favicon.js +0 -20
@@ -1,32 +1 @@
1
- 'use strict';
2
-
3
- const getDOMElementParents = ($el, selector, limit)=>{
4
- // Set up a parent array
5
- const parents = [];
6
- // Push each parent $elms to the array
7
- while($el){
8
- $el = $el.parentElement ?? undefined;
9
- if ($el) {
10
- if ($el.tagName === 'BODY' || $el.getAttribute('data-uid') === 'ROOT') {
11
- break;
12
- }
13
- if (selector) {
14
- if ($el.matches(selector)) {
15
- parents.push($el);
16
- if (limit && parents.length == limit) {
17
- return parents;
18
- }
19
- }
20
- continue;
21
- }
22
- parents.push($el);
23
- if (limit && parents.length == limit) {
24
- return parents;
25
- }
26
- }
27
- }
28
- // Return our parent array
29
- return parents;
30
- };
31
-
32
- exports.getDOMElementParents = getDOMElementParents;
1
+ "use strict";const getDOMElementParents=(e,t,n)=>{let r=[];for(;e;)if(e=e.parentElement??void 0){if("BODY"===e.tagName||"ROOT"===e.getAttribute("data-uid"))break;if(t){if(e.matches(t)&&(r.push(e),n&&r.length==n))return r;continue}if(r.push(e),n&&r.length==n)break}return r};exports.getDOMElementParents=getDOMElementParents;
@@ -1,16 +1 @@
1
- 'use strict';
2
-
3
- var _const = require('../const.js');
4
-
5
- const isOverParent = ({ current, parent, index, revert })=>{
6
- for(let i = 0; i < index; i++){
7
- let is = current.top - (_const.TOOLBAR_HOVER_HEIGHT - 1) * i >= parent.top && current.top - (_const.TOOLBAR_HOVER_HEIGHT - 1) * i <= parent.top + parent.height || current.top - (_const.TOOLBAR_HOVER_HEIGHT - 1) * i >= parent.top + parent.height && current.top - (_const.TOOLBAR_HOVER_HEIGHT - 1) * i <= parent.top;
8
- if (revert) {
9
- is = current.bottom + (_const.TOOLBAR_HOVER_HEIGHT - 1) * i >= parent.bottom && current.bottom + (_const.TOOLBAR_HOVER_HEIGHT - 1) * i <= parent.bottom - parent.height || current.bottom + (_const.TOOLBAR_HOVER_HEIGHT - 1) * i >= parent.bottom - parent.height && current.bottom + (_const.TOOLBAR_HOVER_HEIGHT - 1) * i <= parent.bottom;
10
- }
11
- if (is) return true;
12
- }
13
- return false;
14
- };
15
-
16
- exports.isOverParent = isOverParent;
1
+ "use strict";var _const=require("../const.js");const isOverParent=({current:t,parent:o,index:O,revert:_})=>{for(let H=0;H<O;H++){let O=t.top-(_const.TOOLBAR_HOVER_HEIGHT-1)*H>=o.top&&t.top-(_const.TOOLBAR_HOVER_HEIGHT-1)*H<=o.top+o.height||t.top-(_const.TOOLBAR_HOVER_HEIGHT-1)*H>=o.top+o.height&&t.top-(_const.TOOLBAR_HOVER_HEIGHT-1)*H<=o.top;if(_&&(O=t.bottom+(_const.TOOLBAR_HOVER_HEIGHT-1)*H>=o.bottom&&t.bottom+(_const.TOOLBAR_HOVER_HEIGHT-1)*H<=o.bottom-o.height||t.bottom+(_const.TOOLBAR_HOVER_HEIGHT-1)*H>=o.bottom-o.height&&t.bottom+(_const.TOOLBAR_HOVER_HEIGHT-1)*H<=o.bottom),O)return!0}return!1};exports.isOverParent=isOverParent;
@@ -1,12 +1 @@
1
- 'use strict';
2
-
3
- var _const = require('../const.js');
4
-
5
- const isOverToolbarPosition = (el, parent)=>{
6
- const rect = el.getBoundingClientRect();
7
- const rectP = parent.getBoundingClientRect();
8
- // 32px = toolbar active height
9
- return rect.top - rectP.top < _const.TOOLBAR_ACTIVE_HEIGHT + 1;
10
- };
11
-
12
- exports.isOverToolbarPosition = isOverToolbarPosition;
1
+ "use strict";var _const=require("../const.js");const isOverToolbarPosition=(o,t)=>{let e=o.getBoundingClientRect(),i=t.getBoundingClientRect();return e.top-i.top<_const.TOOLBAR_ACTIVE_HEIGHT+1};exports.isOverToolbarPosition=isOverToolbarPosition;
@@ -1,8 +1 @@
1
- 'use strict';
2
-
3
- const isSection = (el)=>{
4
- const tag = el.getAttribute('data-component-tag');
5
- return tag === 'Section';
6
- };
7
-
8
- exports.isSection = isSection;
1
+ "use strict";const isSection=t=>{let e=t.getAttribute("data-component-tag");return"Section"===e};exports.isSection=isSection;
@@ -1,8 +1 @@
1
- 'use strict';
2
-
3
- const notVisible = (el)=>{
4
- const overflow = getComputedStyle(el).overflow;
5
- return overflow !== 'visible';
6
- };
7
-
8
- exports.notVisible = notVisible;
1
+ "use strict";const notVisible=e=>{let t=getComputedStyle(e).overflow;return"visible"!==t};exports.notVisible=notVisible;
@@ -1,27 +1 @@
1
- 'use strict';
2
-
3
- const waitForElementToExist = (selector, timeout = 200)=>{
4
- return new Promise((resolve)=>{
5
- let intervalID = null;
6
- let timeoutID = null;
7
- const findEl = ()=>{
8
- const el = document.body.querySelector('#storefront')?.querySelector(selector);
9
- if (el) {
10
- if (intervalID) clearInterval(intervalID);
11
- if (timeoutID) clearTimeout(timeoutID);
12
- resolve(el);
13
- }
14
- };
15
- findEl();
16
- intervalID = setInterval(()=>{
17
- findEl();
18
- }, 50);
19
- timeoutID = setTimeout(()=>{
20
- if (intervalID) clearInterval(intervalID);
21
- if (timeoutID) clearTimeout(timeoutID);
22
- resolve(null);
23
- }, timeout);
24
- });
25
- };
26
-
27
- exports.waitForElementToExist = waitForElementToExist;
1
+ "use strict";const waitForElementToExist=(e,t=200)=>new Promise(l=>{let r=null,o=null,n=()=>{let t=document.body.querySelector("#storefront")?.querySelector(e);t&&(r&&clearInterval(r),o&&clearTimeout(o),l(t))};n(),r=setInterval(()=>{n()},50),o=setTimeout(()=>{r&&clearInterval(r),o&&clearTimeout(o),l(null)},t)});exports.waitForElementToExist=waitForElementToExist;
@@ -1,150 +1,2 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var core = require('@gem-sdk/core');
8
-
9
- const BASE_DATA = [
10
- {
11
- title: 'Choose templates',
12
- content: 'inspired by CRO experts',
13
- hasAILogo: false,
14
- id: 'gps-add-section-bottom-from-library',
15
- eventID: 'click-add-section-bottom-from-library'
16
- },
17
- {
18
- title: 'Generate layout',
19
- content: 'from URL or image',
20
- hasAILogo: false,
21
- id: 'gps-add-section-bottom-from-url',
22
- eventID: 'click-add-section-bottom-from-url'
23
- },
24
- {
25
- title: 'Add blank section',
26
- content: 'then drag & drop elements',
27
- hasAILogo: false,
28
- id: 'gps-add-section-blank',
29
- eventID: 'click-add-section-blank'
30
- }
31
- ];
32
- const FOOTER_HEIGHT = 48;
33
- const defaultPadding = {
34
- desktop: 'var(--g-ct-p)',
35
- tablet: 'var(--g-ct-p)',
36
- mobile: 'var(--g-ct-p)'
37
- };
38
- const AddSectionImageToLayout = ({ editorImageToLayout })=>{
39
- const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
40
- const totalSection = core.useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
41
- const editingPageType = core.useShopStore((s)=>s.pageType);
42
- let ACTIONS_DATA = BASE_DATA;
43
- if (editingPageType === 'POST_PURCHASE') {
44
- const dataIdNotPostPurchase = [
45
- 'gps-add-section-bottom-from-url',
46
- 'gps-add-section-bottom-from-image',
47
- 'gps-add-section-bottom-from-library'
48
- ];
49
- ACTIONS_DATA = BASE_DATA.filter((item)=>!dataIdNotPostPurchase.includes(item.id));
50
- }
51
- const loaded = core.useBuilderPreviewStore((state)=>state.loaded);
52
- const offset = react.useMemo(()=>{
53
- let result = 0;
54
- if (layoutSetting?.showFooter) {
55
- result += FOOTER_HEIGHT;
56
- }
57
- return result;
58
- }, [
59
- layoutSetting?.showFooter
60
- ]);
61
- if (!loaded) {
62
- return null;
63
- }
64
- const handleAddSectionAction = (eventID)=>{
65
- const event = new CustomEvent(`editor:iframe:${eventID}`);
66
- window.dispatchEvent(event);
67
- };
68
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
69
- id: "gps-add-section-image-to-layout-of-bottom",
70
- className: `gp-justify-center ${totalSection && editorImageToLayout ? 'gp-flex' : 'gp-hidden'}`,
71
- style: {
72
- ...core.makeStyleResponsive('pl', defaultPadding),
73
- ...core.makeStyleResponsive('pr', defaultPadding)
74
- },
75
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
76
- className: `gps-base-font-family gp-relative gp-mb-[24px] gp-mt-[40px] gp-flex gp-flex-1 gp-justify-center gp-rounded-[3px] gp-border gp-border-[#EEEEEE] gp-py-[24px] w375:gp-flex-col w375:gp-gap-y-[8px] w576:gp-flex-col w576:gp-gap-y-[8px]`,
77
- style: {
78
- maxWidth: `var(--g-ct-w)`,
79
- marginBottom: `${offset + 48}px`
80
- },
81
- children: [
82
- /*#__PURE__*/ jsxRuntime.jsx("span", {
83
- className: "gp-absolute gp-top-[-12px] gp-bg-white gp-px-[8px] gp-text-[14px] gp-font-normal gp-text-[#9E9E9E]",
84
- children: "Add section"
85
- }),
86
- ACTIONS_DATA.map((action)=>{
87
- return /*#__PURE__*/ jsxRuntime.jsxs("div", {
88
- className: `gp-relative gp-mx-1 gp-h-[60px] gp-w-[172px] w375:gp-w-auto w576:gp-w-auto gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 gp-flex`,
89
- id: action.id,
90
- onClick: ()=>handleAddSectionAction(action.eventID),
91
- "aria-hidden": true,
92
- children: [
93
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
94
- className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",
95
- children: [
96
- action.title,
97
- action.hasAILogo && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
98
- width: "43",
99
- height: "20",
100
- viewBox: "0 0 43 20",
101
- fill: "none",
102
- xmlns: "http://www.w3.org/2000/svg",
103
- children: [
104
- /*#__PURE__*/ jsxRuntime.jsx("path", {
105
- d: "M0 8C0 3.58172 3.58172 0 8 0H35C39.4183 0 43 3.58172 43 8V12C43 16.4183 39.4183 20 35 20H8C3.58172 20 0 16.4183 0 12V8Z",
106
- fill: "#EBDDF8"
107
- }),
108
- /*#__PURE__*/ jsxRuntime.jsx("path", {
109
- d: "M8.95881 14V5.27273H12.1548C12.7741 5.27273 13.2869 5.375 13.6932 5.57955C14.0994 5.78125 14.4034 6.0554 14.6051 6.40199C14.8068 6.74574 14.9077 7.13352 14.9077 7.56534C14.9077 7.92898 14.8409 8.2358 14.7074 8.4858C14.5739 8.73295 14.3949 8.93182 14.1705 9.08239C13.9489 9.23011 13.7045 9.33807 13.4375 9.40625V9.49148C13.7273 9.50568 14.0099 9.59943 14.2855 9.77273C14.5639 9.94318 14.794 10.1861 14.9759 10.5014C15.1577 10.8168 15.2486 11.2003 15.2486 11.652C15.2486 12.098 15.1435 12.4986 14.9332 12.8537C14.7259 13.206 14.4048 13.4858 13.9702 13.6932C13.5355 13.8977 12.9801 14 12.304 14H8.95881ZM10.2756 12.8707H12.1761C12.8068 12.8707 13.2585 12.7486 13.5312 12.5043C13.804 12.2599 13.9403 11.9545 13.9403 11.5881C13.9403 11.3125 13.8707 11.0597 13.7315 10.8295C13.5923 10.5994 13.3935 10.4162 13.1349 10.2798C12.8793 10.1435 12.5753 10.0753 12.223 10.0753H10.2756V12.8707ZM10.2756 9.0483H12.0398C12.3352 9.0483 12.6009 8.99148 12.8366 8.87784C13.0753 8.7642 13.2642 8.60511 13.4034 8.40057C13.5455 8.19318 13.6165 7.94886 13.6165 7.66761C13.6165 7.30682 13.4901 7.00426 13.2372 6.75994C12.9844 6.51562 12.5966 6.39347 12.0739 6.39347H10.2756V9.0483ZM19.5291 14.1321C18.8842 14.1321 18.3288 13.9943 17.8629 13.7188C17.3999 13.4403 17.0419 13.0497 16.7891 12.5469C16.5391 12.0412 16.4141 11.4489 16.4141 10.7699C16.4141 10.0994 16.5391 9.50852 16.7891 8.99716C17.0419 8.4858 17.3942 8.08665 17.8459 7.79972C18.3004 7.51278 18.8317 7.36932 19.4396 7.36932C19.8089 7.36932 20.1669 7.4304 20.5135 7.55256C20.8601 7.67472 21.1712 7.86648 21.4467 8.12784C21.7223 8.3892 21.9396 8.72869 22.0987 9.14631C22.2578 9.56108 22.3374 10.0653 22.3374 10.6591V11.1108H17.1342V10.1562H21.0888C21.0888 9.82102 21.0206 9.52415 20.8842 9.26562C20.7479 9.00426 20.5561 8.7983 20.3089 8.64773C20.0646 8.49716 19.7777 8.42188 19.4482 8.42188C19.0902 8.42188 18.7777 8.50994 18.5107 8.68608C18.2464 8.85937 18.0419 9.08665 17.897 9.3679C17.755 9.64631 17.6839 9.94886 17.6839 10.2756V11.0213C17.6839 11.4588 17.7607 11.831 17.9141 12.1378C18.0703 12.4446 18.2876 12.679 18.5661 12.8409C18.8445 13 19.1697 13.0795 19.5419 13.0795C19.7834 13.0795 20.0036 13.0455 20.2024 12.9773C20.4013 12.9062 20.5732 12.8011 20.718 12.6619C20.8629 12.5227 20.9737 12.3509 21.0504 12.1463L22.2564 12.3636C22.1598 12.7187 21.9865 13.0298 21.7365 13.2969C21.4893 13.5611 21.1783 13.767 20.8033 13.9148C20.4311 14.0597 20.0064 14.1321 19.5291 14.1321ZM26.8065 7.45455V8.47727H23.2312V7.45455H26.8065ZM24.19 5.88636H25.4641V12.0781C25.4641 12.3253 25.5011 12.5114 25.5749 12.6364C25.6488 12.7585 25.744 12.8423 25.8604 12.8878C25.9798 12.9304 26.109 12.9517 26.2482 12.9517C26.3505 12.9517 26.44 12.9446 26.5167 12.9304C26.5934 12.9162 26.6531 12.9048 26.6957 12.8963L26.9258 13.9489C26.8519 13.9773 26.7468 14.0057 26.6104 14.0341C26.4741 14.0653 26.3036 14.0824 26.0991 14.0852C25.7638 14.0909 25.4513 14.0312 25.1616 13.9062C24.8718 13.7812 24.6374 13.5881 24.4585 13.3267C24.2795 13.0653 24.19 12.7372 24.19 12.3423V5.88636ZM30.1207 14.1449C29.706 14.1449 29.331 14.0682 28.9957 13.9148C28.6605 13.7585 28.3949 13.5327 28.1989 13.2372C28.0057 12.9418 27.9091 12.5795 27.9091 12.1506C27.9091 11.7812 27.9801 11.4773 28.1222 11.2386C28.2642 11 28.456 10.8111 28.6974 10.6719C28.9389 10.5327 29.2088 10.4276 29.5071 10.3565C29.8054 10.2855 30.1094 10.2315 30.419 10.1946C30.8111 10.1491 31.1293 10.1122 31.3736 10.0838C31.6179 10.0526 31.7955 10.0028 31.9062 9.93466C32.017 9.86648 32.0724 9.75568 32.0724 9.60227V9.57244C32.0724 9.20028 31.9673 8.91193 31.7571 8.70739C31.5497 8.50284 31.2401 8.40057 30.8281 8.40057C30.3991 8.40057 30.0611 8.49574 29.8139 8.68608C29.5696 8.87358 29.4006 9.08239 29.3068 9.3125L28.1094 9.03977C28.2514 8.64205 28.4588 8.32102 28.7315 8.0767C29.0071 7.82955 29.3239 7.65057 29.6818 7.53977C30.0398 7.42614 30.4162 7.36932 30.8111 7.36932C31.0724 7.36932 31.3494 7.40057 31.642 7.46307C31.9375 7.52273 32.2131 7.63352 32.4688 7.79545C32.7273 7.95739 32.9389 8.18892 33.1037 8.49006C33.2685 8.78835 33.3509 9.17614 33.3509 9.65341V14H32.1065V13.1051H32.0554C31.973 13.2699 31.8494 13.4318 31.6847 13.5909C31.5199 13.75 31.3082 13.8821 31.0497 13.9872C30.7912 14.0923 30.4815 14.1449 30.1207 14.1449ZM30.3977 13.1222C30.75 13.1222 31.0511 13.0526 31.3011 12.9134C31.554 12.7741 31.7457 12.5923 31.8764 12.3679C32.0099 12.1406 32.0767 11.8977 32.0767 11.6392V10.7955C32.0313 10.8409 31.9432 10.8835 31.8125 10.9233C31.6847 10.9602 31.5384 10.9929 31.3736 11.0213C31.2088 11.0469 31.0483 11.071 30.892 11.0938C30.7358 11.1136 30.6051 11.1307 30.5 11.1449C30.2528 11.1761 30.027 11.2287 29.8224 11.3026C29.6207 11.3764 29.4588 11.483 29.3366 11.6222C29.2173 11.7585 29.1577 11.9403 29.1577 12.1676C29.1577 12.483 29.2741 12.7216 29.5071 12.8835C29.7401 13.0426 30.0369 13.1222 30.3977 13.1222Z",
110
- fill: "url(#paint0_linear_9312_318)"
111
- }),
112
- /*#__PURE__*/ jsxRuntime.jsx("defs", {
113
- children: /*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
114
- id: "paint0_linear_9312_318",
115
- x1: "35",
116
- y1: "15.2703",
117
- x2: "7.99944",
118
- y2: "15.2287",
119
- gradientUnits: "userSpaceOnUse",
120
- children: [
121
- /*#__PURE__*/ jsxRuntime.jsx("stop", {
122
- stopColor: "#874CFD"
123
- }),
124
- /*#__PURE__*/ jsxRuntime.jsx("stop", {
125
- offset: "1",
126
- stopColor: "#3C38E1"
127
- })
128
- ]
129
- })
130
- })
131
- ]
132
- })
133
- ]
134
- }),
135
- /*#__PURE__*/ jsxRuntime.jsx("div", {
136
- className: "gp-flex gp-items-center",
137
- children: /*#__PURE__*/ jsxRuntime.jsx("span", {
138
- className: "gp-mr-[3px] gp-text-center gp-text-[12px] gp-font-normal gp-text-[#676767]",
139
- children: action.content
140
- })
141
- })
142
- ]
143
- }, action.id);
144
- })
145
- ]
146
- })
147
- });
148
- };
149
-
150
- exports.default = AddSectionImageToLayout;
1
+ 'use client';
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),core=require("@gem-sdk/core");const BASE_DATA=[{title:"Choose templates",content:"inspired by CRO experts",hasAILogo:!1,id:"gps-add-section-bottom-from-library",eventID:"click-add-section-bottom-from-library"},{title:"Generate layout",content:"from URL or image",hasAILogo:!1,id:"gps-add-section-bottom-from-url",eventID:"click-add-section-bottom-from-url"},{title:"Add blank section",content:"then drag & drop elements",hasAILogo:!1,id:"gps-add-section-blank",eventID:"click-add-section-blank"}],FOOTER_HEIGHT=48,defaultPadding={desktop:"var(--g-ct-p)",tablet:"var(--g-ct-p)",mobile:"var(--g-ct-p)"},AddSectionImageToLayout=({editorImageToLayout:e})=>{let{t}=core.useI18nStore(),o=core.useShopStore(e=>e.layoutSettings),s=core.useBuilderPreviewStore(e=>e.state.ROOT.childrens?.length),i=core.useShopStore(e=>e.pageType),r=BASE_DATA;if("POST_PURCHASE"===i){let e=["gps-add-section-bottom-from-url","gps-add-section-bottom-from-image","gps-add-section-bottom-from-library"];r=BASE_DATA.filter(t=>!e.includes(t.id))}let p=core.useBuilderPreviewStore(e=>e.loaded),n=react.useMemo(()=>{let e=0;return o?.showFooter&&(e+=48),e},[o?.showFooter]);if(!p)return null;let C=e=>{let t=new CustomEvent(`editor:iframe:${e}`);window.dispatchEvent(t)};return jsxRuntime.jsx("div",{id:"gps-add-section-image-to-layout-of-bottom",className:`gp-justify-center ${s&&e?"gp-flex":"gp-hidden"}`,style:{...core.makeStyleResponsive("pl",defaultPadding),...core.makeStyleResponsive("pr",defaultPadding)},children:jsxRuntime.jsxs("div",{className:"gps-base-font-family gp-relative gp-mb-[24px] gp-mt-[40px] gp-flex gp-flex-1 gp-justify-center gp-rounded-[3px] gp-border gp-border-[#EEEEEE] gp-py-[24px] w375:gp-flex-col w375:gp-gap-y-[8px] w576:gp-flex-col w576:gp-gap-y-[8px]",style:{maxWidth:"var(--g-ct-w)",marginBottom:`${n+48}px`},children:[jsxRuntime.jsx("span",{className:"gp-absolute gp-top-[-12px] gp-bg-white gp-px-[8px] gp-text-[14px] gp-font-normal gp-text-[#9E9E9E]",children:t("Add section")}),r.map(e=>jsxRuntime.jsxs("div",{className:"gp-relative gp-mx-1 gp-min-h-[60px] gp-border-box w375:gp-w-auto w576:gp-w-auto gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 gp-flex gp-p-2",id:e.id,onClick:()=>C(e.eventID),"aria-hidden":!0,children:[jsxRuntime.jsxs("div",{className:"gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",children:[t(e.title),e.hasAILogo&&jsxRuntime.jsxs("svg",{width:"43",height:"20",viewBox:"0 0 43 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H35C39.4183 0 43 3.58172 43 8V12C43 16.4183 39.4183 20 35 20H8C3.58172 20 0 16.4183 0 12V8Z",fill:"#EBDDF8"}),jsxRuntime.jsx("path",{d:"M8.95881 14V5.27273H12.1548C12.7741 5.27273 13.2869 5.375 13.6932 5.57955C14.0994 5.78125 14.4034 6.0554 14.6051 6.40199C14.8068 6.74574 14.9077 7.13352 14.9077 7.56534C14.9077 7.92898 14.8409 8.2358 14.7074 8.4858C14.5739 8.73295 14.3949 8.93182 14.1705 9.08239C13.9489 9.23011 13.7045 9.33807 13.4375 9.40625V9.49148C13.7273 9.50568 14.0099 9.59943 14.2855 9.77273C14.5639 9.94318 14.794 10.1861 14.9759 10.5014C15.1577 10.8168 15.2486 11.2003 15.2486 11.652C15.2486 12.098 15.1435 12.4986 14.9332 12.8537C14.7259 13.206 14.4048 13.4858 13.9702 13.6932C13.5355 13.8977 12.9801 14 12.304 14H8.95881ZM10.2756 12.8707H12.1761C12.8068 12.8707 13.2585 12.7486 13.5312 12.5043C13.804 12.2599 13.9403 11.9545 13.9403 11.5881C13.9403 11.3125 13.8707 11.0597 13.7315 10.8295C13.5923 10.5994 13.3935 10.4162 13.1349 10.2798C12.8793 10.1435 12.5753 10.0753 12.223 10.0753H10.2756V12.8707ZM10.2756 9.0483H12.0398C12.3352 9.0483 12.6009 8.99148 12.8366 8.87784C13.0753 8.7642 13.2642 8.60511 13.4034 8.40057C13.5455 8.19318 13.6165 7.94886 13.6165 7.66761C13.6165 7.30682 13.4901 7.00426 13.2372 6.75994C12.9844 6.51562 12.5966 6.39347 12.0739 6.39347H10.2756V9.0483ZM19.5291 14.1321C18.8842 14.1321 18.3288 13.9943 17.8629 13.7188C17.3999 13.4403 17.0419 13.0497 16.7891 12.5469C16.5391 12.0412 16.4141 11.4489 16.4141 10.7699C16.4141 10.0994 16.5391 9.50852 16.7891 8.99716C17.0419 8.4858 17.3942 8.08665 17.8459 7.79972C18.3004 7.51278 18.8317 7.36932 19.4396 7.36932C19.8089 7.36932 20.1669 7.4304 20.5135 7.55256C20.8601 7.67472 21.1712 7.86648 21.4467 8.12784C21.7223 8.3892 21.9396 8.72869 22.0987 9.14631C22.2578 9.56108 22.3374 10.0653 22.3374 10.6591V11.1108H17.1342V10.1562H21.0888C21.0888 9.82102 21.0206 9.52415 20.8842 9.26562C20.7479 9.00426 20.5561 8.7983 20.3089 8.64773C20.0646 8.49716 19.7777 8.42188 19.4482 8.42188C19.0902 8.42188 18.7777 8.50994 18.5107 8.68608C18.2464 8.85937 18.0419 9.08665 17.897 9.3679C17.755 9.64631 17.6839 9.94886 17.6839 10.2756V11.0213C17.6839 11.4588 17.7607 11.831 17.9141 12.1378C18.0703 12.4446 18.2876 12.679 18.5661 12.8409C18.8445 13 19.1697 13.0795 19.5419 13.0795C19.7834 13.0795 20.0036 13.0455 20.2024 12.9773C20.4013 12.9062 20.5732 12.8011 20.718 12.6619C20.8629 12.5227 20.9737 12.3509 21.0504 12.1463L22.2564 12.3636C22.1598 12.7187 21.9865 13.0298 21.7365 13.2969C21.4893 13.5611 21.1783 13.767 20.8033 13.9148C20.4311 14.0597 20.0064 14.1321 19.5291 14.1321ZM26.8065 7.45455V8.47727H23.2312V7.45455H26.8065ZM24.19 5.88636H25.4641V12.0781C25.4641 12.3253 25.5011 12.5114 25.5749 12.6364C25.6488 12.7585 25.744 12.8423 25.8604 12.8878C25.9798 12.9304 26.109 12.9517 26.2482 12.9517C26.3505 12.9517 26.44 12.9446 26.5167 12.9304C26.5934 12.9162 26.6531 12.9048 26.6957 12.8963L26.9258 13.9489C26.8519 13.9773 26.7468 14.0057 26.6104 14.0341C26.4741 14.0653 26.3036 14.0824 26.0991 14.0852C25.7638 14.0909 25.4513 14.0312 25.1616 13.9062C24.8718 13.7812 24.6374 13.5881 24.4585 13.3267C24.2795 13.0653 24.19 12.7372 24.19 12.3423V5.88636ZM30.1207 14.1449C29.706 14.1449 29.331 14.0682 28.9957 13.9148C28.6605 13.7585 28.3949 13.5327 28.1989 13.2372C28.0057 12.9418 27.9091 12.5795 27.9091 12.1506C27.9091 11.7812 27.9801 11.4773 28.1222 11.2386C28.2642 11 28.456 10.8111 28.6974 10.6719C28.9389 10.5327 29.2088 10.4276 29.5071 10.3565C29.8054 10.2855 30.1094 10.2315 30.419 10.1946C30.8111 10.1491 31.1293 10.1122 31.3736 10.0838C31.6179 10.0526 31.7955 10.0028 31.9062 9.93466C32.017 9.86648 32.0724 9.75568 32.0724 9.60227V9.57244C32.0724 9.20028 31.9673 8.91193 31.7571 8.70739C31.5497 8.50284 31.2401 8.40057 30.8281 8.40057C30.3991 8.40057 30.0611 8.49574 29.8139 8.68608C29.5696 8.87358 29.4006 9.08239 29.3068 9.3125L28.1094 9.03977C28.2514 8.64205 28.4588 8.32102 28.7315 8.0767C29.0071 7.82955 29.3239 7.65057 29.6818 7.53977C30.0398 7.42614 30.4162 7.36932 30.8111 7.36932C31.0724 7.36932 31.3494 7.40057 31.642 7.46307C31.9375 7.52273 32.2131 7.63352 32.4688 7.79545C32.7273 7.95739 32.9389 8.18892 33.1037 8.49006C33.2685 8.78835 33.3509 9.17614 33.3509 9.65341V14H32.1065V13.1051H32.0554C31.973 13.2699 31.8494 13.4318 31.6847 13.5909C31.5199 13.75 31.3082 13.8821 31.0497 13.9872C30.7912 14.0923 30.4815 14.1449 30.1207 14.1449ZM30.3977 13.1222C30.75 13.1222 31.0511 13.0526 31.3011 12.9134C31.554 12.7741 31.7457 12.5923 31.8764 12.3679C32.0099 12.1406 32.0767 11.8977 32.0767 11.6392V10.7955C32.0313 10.8409 31.9432 10.8835 31.8125 10.9233C31.6847 10.9602 31.5384 10.9929 31.3736 11.0213C31.2088 11.0469 31.0483 11.071 30.892 11.0938C30.7358 11.1136 30.6051 11.1307 30.5 11.1449C30.2528 11.1761 30.027 11.2287 29.8224 11.3026C29.6207 11.3764 29.4588 11.483 29.3366 11.6222C29.2173 11.7585 29.1577 11.9403 29.1577 12.1676C29.1577 12.483 29.2741 12.7216 29.5071 12.8835C29.7401 13.0426 30.0369 13.1222 30.3977 13.1222Z",fill:"url(#paint0_linear_9312_318)"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_9312_318",x1:"35",y1:"15.2703",x2:"7.99944",y2:"15.2287",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#874CFD"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#3C38E1"})]})})]})]}),jsxRuntime.jsx("div",{className:"gp-flex gp-items-center",children:jsxRuntime.jsx("span",{className:"gp-mr-[3px] gp-text-center gp-text-[12px] gp-font-normal gp-text-[#676767]",children:t(e.content)})})]},e.id))]})})};exports.default=AddSectionImageToLayout;
@@ -1,190 +1,2 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var core = require('@gem-sdk/core');
5
-
6
- const SALE_FUNNEL_PAGE_TYPES = [
7
- 'GP_FUNNEL_PAGE',
8
- 'GP_PRE_SALE_PAGE'
9
- ];
10
- const DropElement = ()=>{
11
- const editingPageType = core.useShopStore((s)=>s.pageType);
12
- const isFunnelSalesPage = SALE_FUNNEL_PAGE_TYPES.includes(editingPageType || '');
13
- const dispatchEventBuildWithSectionActiveTab = (value)=>{
14
- const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
15
- bubbles: true,
16
- detail: {
17
- value
18
- }
19
- });
20
- window.dispatchEvent(event);
21
- };
22
- const dispatchEventBuildWithTemplateActiveTab = (value)=>{
23
- const event = new CustomEvent('editor:sidebar:build-with-template-active-tab', {
24
- bubbles: true,
25
- detail: {
26
- value
27
- }
28
- });
29
- window.dispatchEvent(event);
30
- };
31
- const handleClickGenerate = (e)=>{
32
- const event = new CustomEvent('editor:sidebar:click-img-to-layout-gallery-btn', e);
33
- window.dispatchEvent(event);
34
- };
35
- return /*#__PURE__*/ jsxRuntime.jsxs("div", {
36
- className: "gp-flex gp-w-full gp-flex-col gp-items-center gp-justify-center",
37
- children: [
38
- /*#__PURE__*/ jsxRuntime.jsxs("svg", {
39
- width: "290",
40
- height: "162",
41
- viewBox: "0 0 290 162",
42
- fill: "none",
43
- xmlns: "http://www.w3.org/2000/svg",
44
- className: "gp-mb-[24px]",
45
- children: [
46
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
47
- x: "0.570588",
48
- y: "0.570588",
49
- width: "288.859",
50
- height: "160.859",
51
- rx: "8.55882",
52
- fill: "white"
53
- }),
54
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
55
- x: "0.570588",
56
- y: "0.570588",
57
- width: "288.859",
58
- height: "160.859",
59
- rx: "8.55882",
60
- stroke: "#E2E2E2",
61
- strokeWidth: "1.14118"
62
- }),
63
- /*#__PURE__*/ jsxRuntime.jsx("path", {
64
- d: "M22.2529 29.6708C22.2529 25.8893 25.3185 22.8237 29.1 22.8237H126.1C129.882 22.8237 132.947 25.8893 132.947 29.6708V132.377C132.947 136.158 129.882 139.224 126.1 139.224H29.1C25.3185 139.224 22.2529 136.158 22.2529 132.377V29.6708Z",
65
- fill: "#3C67FF",
66
- fillOpacity: "0.1"
67
- }),
68
- /*#__PURE__*/ jsxRuntime.jsx("path", {
69
- d: "M76.0283 91.1587C77.3298 92.6353 76.2754 94.958 74.3066 94.9513L57.7218 94.8955C55.762 94.8889 54.7231 92.5777 56.0182 91.1058L64.2787 81.7175C65.1873 80.6849 66.7951 80.6836 67.7039 81.7146L76.0283 91.1587Z",
70
- fill: "#7190FF"
71
- }),
72
- /*#__PURE__*/ jsxRuntime.jsx("path", {
73
- d: "M98.1352 91.1406C99.4315 92.62 98.3727 94.9382 96.4053 94.9282L67.9725 94.7838C66.0044 94.7738 64.9727 92.4437 66.2873 90.9779L80.6046 75.0135C81.5189 73.994 83.118 74.0026 84.0198 75.0318L98.1352 91.1406Z",
74
- fill: "#7190FF"
75
- }),
76
- /*#__PURE__*/ jsxRuntime.jsx("path", {
77
- d: "M63.2783 74.2252C66.1589 73.8964 68.1647 71.3676 67.8369 68.478C67.5091 65.5883 64.9883 63.5762 62.1077 63.905C59.2272 64.2338 57.2214 66.7626 57.5492 69.6523C57.877 72.5419 60.3978 74.554 63.2783 74.2252Z",
78
- fill: "#7190FF"
79
- }),
80
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
81
- x: "157.482",
82
- y: "45.647",
83
- width: "83.3059",
84
- height: "11.4118",
85
- rx: "5.70588",
86
- fill: "#AAAAAA"
87
- }),
88
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
89
- x: "157.5",
90
- y: "98.9995",
91
- width: "48",
92
- height: "18",
93
- rx: "9",
94
- fill: "#3C67FF"
95
- }),
96
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
97
- x: "157.5",
98
- y: "66.9995",
99
- width: "68",
100
- height: "5",
101
- rx: "2.5",
102
- fill: "#E2E2E2"
103
- }),
104
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
105
- x: "157.5",
106
- y: "79.9995",
107
- width: "52",
108
- height: "5",
109
- rx: "2.5",
110
- fill: "#E2E2E2"
111
- })
112
- ]
113
- }),
114
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
115
- className: "gp-flex gp-flex-col gp-items-center",
116
- children: [
117
- /*#__PURE__*/ jsxRuntime.jsx("div", {
118
- 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'
120
- }),
121
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
122
- className: "gp-flex gp-gap-3 gp-justify-between",
123
- children: [
124
- /*#__PURE__*/ jsxRuntime.jsx("button", {
125
- "data-button-add-section": true,
126
- onClick: ()=>{
127
- if (isFunnelSalesPage) {
128
- dispatchEventBuildWithTemplateActiveTab('funnelExisting');
129
- } else dispatchEventBuildWithSectionActiveTab(true);
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]",
132
- children: isFunnelSalesPage ? 'Use existing page designs' : 'Add sections'
133
- }),
134
- /*#__PURE__*/ jsxRuntime.jsx("button", {
135
- "data-button-add-elements": true,
136
- onClick: ()=>{
137
- if (isFunnelSalesPage) {
138
- dispatchEventBuildWithTemplateActiveTab('templates');
139
- } else dispatchEventBuildWithSectionActiveTab(false);
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]",
142
- children: isFunnelSalesPage ? 'Explore templates' : 'Add elements'
143
- })
144
- ]
145
- }),
146
- /*#__PURE__*/ jsxRuntime.jsx("div", {
147
- className: "gp-my-6",
148
- children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
149
- width: "338",
150
- height: "24",
151
- viewBox: "0 0 338 24",
152
- fill: "none",
153
- xmlns: "http://www.w3.org/2000/svg",
154
- children: [
155
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
156
- width: "150",
157
- height: "1",
158
- transform: "translate(0 11.4999)",
159
- fill: "#D6D6D6"
160
- }),
161
- /*#__PURE__*/ jsxRuntime.jsx("path", {
162
- d: "M166.395 17.159C165.705 17.159 165.101 16.995 164.58 16.6668C164.063 16.3387 163.659 15.8797 163.367 15.2897C163.079 14.6997 162.935 14.0104 162.935 13.2215C162.935 12.4261 163.079 11.7317 163.367 11.1384C163.659 10.5452 164.063 10.0845 164.58 9.75633C165.101 9.42821 165.705 9.26414 166.395 9.26414C167.084 9.26414 167.688 9.42821 168.205 9.75633C168.725 10.0845 169.129 10.5452 169.418 11.1384C169.709 11.7317 169.855 12.4261 169.855 13.2215C169.855 14.0104 169.709 14.6997 169.418 15.2897C169.129 15.8797 168.725 16.3387 168.205 16.6668C167.688 16.995 167.084 17.159 166.395 17.159ZM166.395 16.1051C166.919 16.1051 167.349 15.9708 167.688 15.7024C168.026 15.4339 168.276 15.0809 168.438 14.6434C168.601 14.2059 168.682 13.7319 168.682 13.2215C168.682 12.7111 168.601 12.2355 168.438 11.7947C168.276 11.3539 168.026 10.9976 167.688 10.7258C167.349 10.454 166.919 10.3181 166.395 10.3181C165.871 10.3181 165.44 10.454 165.102 10.7258C164.764 10.9976 164.514 11.3539 164.352 11.7947C164.189 12.2355 164.108 12.7111 164.108 13.2215C164.108 13.7319 164.189 14.2059 164.352 14.6434C164.514 15.0809 164.764 15.4339 165.102 15.7024C165.44 15.9708 165.871 16.1051 166.395 16.1051ZM171.646 16.9999V9.36358H172.78V10.517H172.859C172.998 10.1391 173.25 9.83256 173.615 9.59724C173.979 9.36192 174.39 9.24426 174.848 9.24426C174.934 9.24426 175.042 9.24591 175.171 9.24923C175.3 9.25254 175.398 9.25751 175.464 9.26414V10.4573C175.425 10.4474 175.333 10.4325 175.191 10.4126C175.052 10.3894 174.904 10.3778 174.748 10.3778C174.377 10.3778 174.046 10.4557 173.754 10.6114C173.466 10.7639 173.237 10.976 173.068 11.2478C172.902 11.5163 172.819 11.8229 172.819 12.1676V16.9999H171.646Z",
163
- fill: "#676767"
164
- }),
165
- /*#__PURE__*/ jsxRuntime.jsx("rect", {
166
- width: "150",
167
- height: "1",
168
- transform: "translate(188 11.4999)",
169
- fill: "#D6D6D6"
170
- })
171
- ]
172
- })
173
- }),
174
- /*#__PURE__*/ jsxRuntime.jsx("div", {
175
- className: "gp-flex gp-items-center gp-gap-2 gp-text-xs",
176
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
177
- onClick: handleClickGenerate,
178
- "aria-hidden": "true",
179
- id: "gp-img-to-layout-gallery-btn",
180
- className: "gp-relative gp-cursor-pointer gp-text-[14px] gp-font-medium gp-text-[#3C67FF]",
181
- children: "Start with Generating from URL or image"
182
- })
183
- })
184
- ]
185
- })
186
- ]
187
- });
188
- };
189
-
190
- exports.DropElement = DropElement;
1
+ 'use client';
2
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");const SALE_FUNNEL_PAGE_TYPES=["GP_FUNNEL_PAGE","GP_PRE_SALE_PAGE"],DropElement=()=>{let{t:e}=core.useI18n(),t=core.useShopStore(e=>e.pageType),i=SALE_FUNNEL_PAGE_TYPES.includes(t||""),s=e=>{let t=new CustomEvent("editor:sidebar:build-with-section-active-tab",{bubbles:!0,detail:{value:e}});window.dispatchEvent(t)},n=e=>{let t=new CustomEvent("editor:sidebar:build-with-template-active-tab",{bubbles:!0,detail:{value:e}});window.dispatchEvent(t)},l=e=>{let t=new CustomEvent("editor:sidebar:click-img-to-layout-gallery-btn",e);window.dispatchEvent(t)};return jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-flex-col gp-items-center gp-justify-center",children:[jsxRuntime.jsxs("svg",{width:"290",height:"162",viewBox:"0 0 290 162",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"gp-mb-[24px]",children:[jsxRuntime.jsx("rect",{x:"0.570588",y:"0.570588",width:"288.859",height:"160.859",rx:"8.55882",fill:"white"}),jsxRuntime.jsx("rect",{x:"0.570588",y:"0.570588",width:"288.859",height:"160.859",rx:"8.55882",stroke:"#E2E2E2",strokeWidth:"1.14118"}),jsxRuntime.jsx("path",{d:"M22.2529 29.6708C22.2529 25.8893 25.3185 22.8237 29.1 22.8237H126.1C129.882 22.8237 132.947 25.8893 132.947 29.6708V132.377C132.947 136.158 129.882 139.224 126.1 139.224H29.1C25.3185 139.224 22.2529 136.158 22.2529 132.377V29.6708Z",fill:"#3C67FF",fillOpacity:"0.1"}),jsxRuntime.jsx("path",{d:"M76.0283 91.1587C77.3298 92.6353 76.2754 94.958 74.3066 94.9513L57.7218 94.8955C55.762 94.8889 54.7231 92.5777 56.0182 91.1058L64.2787 81.7175C65.1873 80.6849 66.7951 80.6836 67.7039 81.7146L76.0283 91.1587Z",fill:"#7190FF"}),jsxRuntime.jsx("path",{d:"M98.1352 91.1406C99.4315 92.62 98.3727 94.9382 96.4053 94.9282L67.9725 94.7838C66.0044 94.7738 64.9727 92.4437 66.2873 90.9779L80.6046 75.0135C81.5189 73.994 83.118 74.0026 84.0198 75.0318L98.1352 91.1406Z",fill:"#7190FF"}),jsxRuntime.jsx("path",{d:"M63.2783 74.2252C66.1589 73.8964 68.1647 71.3676 67.8369 68.478C67.5091 65.5883 64.9883 63.5762 62.1077 63.905C59.2272 64.2338 57.2214 66.7626 57.5492 69.6523C57.877 72.5419 60.3978 74.554 63.2783 74.2252Z",fill:"#7190FF"}),jsxRuntime.jsx("rect",{x:"157.482",y:"45.647",width:"83.3059",height:"11.4118",rx:"5.70588",fill:"#AAAAAA"}),jsxRuntime.jsx("rect",{x:"157.5",y:"98.9995",width:"48",height:"18",rx:"9",fill:"#3C67FF"}),jsxRuntime.jsx("rect",{x:"157.5",y:"66.9995",width:"68",height:"5",rx:"2.5",fill:"#E2E2E2"}),jsxRuntime.jsx("rect",{x:"157.5",y:"79.9995",width:"52",height:"5",rx:"2.5",fill:"#E2E2E2"})]}),jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-col gp-items-center",children:[jsxRuntime.jsx("div",{className:"gp-text-16 gp-font-medium gp-mb-4 gp-text-[#212121]",children:e(i?"Start building with Sections/Elements or":"Start with Sections from sidebar")}),jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-3 gp-justify-between",children:[jsxRuntime.jsx("button",{"data-button-add-section":!0,onClick:()=>{i?n("funnelExisting"):s(!0)},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]",children:e(i?"Use existing page designs":"Add sections")}),jsxRuntime.jsx("button",{"data-button-add-elements":!0,onClick:()=>{i?n("templates"):s(!1)},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]",children:e(i?"Explore templates":"Add elements")})]}),jsxRuntime.jsx("div",{className:"gp-my-6",children:jsxRuntime.jsxs("svg",{width:"338",height:"24",viewBox:"0 0 338 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{width:"150",height:"1",transform:"translate(0 11.4999)",fill:"#D6D6D6"}),jsxRuntime.jsx("path",{d:"M166.395 17.159C165.705 17.159 165.101 16.995 164.58 16.6668C164.063 16.3387 163.659 15.8797 163.367 15.2897C163.079 14.6997 162.935 14.0104 162.935 13.2215C162.935 12.4261 163.079 11.7317 163.367 11.1384C163.659 10.5452 164.063 10.0845 164.58 9.75633C165.101 9.42821 165.705 9.26414 166.395 9.26414C167.084 9.26414 167.688 9.42821 168.205 9.75633C168.725 10.0845 169.129 10.5452 169.418 11.1384C169.709 11.7317 169.855 12.4261 169.855 13.2215C169.855 14.0104 169.709 14.6997 169.418 15.2897C169.129 15.8797 168.725 16.3387 168.205 16.6668C167.688 16.995 167.084 17.159 166.395 17.159ZM166.395 16.1051C166.919 16.1051 167.349 15.9708 167.688 15.7024C168.026 15.4339 168.276 15.0809 168.438 14.6434C168.601 14.2059 168.682 13.7319 168.682 13.2215C168.682 12.7111 168.601 12.2355 168.438 11.7947C168.276 11.3539 168.026 10.9976 167.688 10.7258C167.349 10.454 166.919 10.3181 166.395 10.3181C165.871 10.3181 165.44 10.454 165.102 10.7258C164.764 10.9976 164.514 11.3539 164.352 11.7947C164.189 12.2355 164.108 12.7111 164.108 13.2215C164.108 13.7319 164.189 14.2059 164.352 14.6434C164.514 15.0809 164.764 15.4339 165.102 15.7024C165.44 15.9708 165.871 16.1051 166.395 16.1051ZM171.646 16.9999V9.36358H172.78V10.517H172.859C172.998 10.1391 173.25 9.83256 173.615 9.59724C173.979 9.36192 174.39 9.24426 174.848 9.24426C174.934 9.24426 175.042 9.24591 175.171 9.24923C175.3 9.25254 175.398 9.25751 175.464 9.26414V10.4573C175.425 10.4474 175.333 10.4325 175.191 10.4126C175.052 10.3894 174.904 10.3778 174.748 10.3778C174.377 10.3778 174.046 10.4557 173.754 10.6114C173.466 10.7639 173.237 10.976 173.068 11.2478C172.902 11.5163 172.819 11.8229 172.819 12.1676V16.9999H171.646Z",fill:"#676767"}),jsxRuntime.jsx("rect",{width:"150",height:"1",transform:"translate(188 11.4999)",fill:"#D6D6D6"})]})}),jsxRuntime.jsx("div",{className:"gp-flex gp-items-center gp-gap-2 gp-text-xs",children:jsxRuntime.jsx("div",{onClick:l,"aria-hidden":"true",id:"gp-img-to-layout-gallery-btn",className:"gp-relative gp-cursor-pointer gp-text-[14px] gp-font-medium gp-text-[#3C67FF]",children:e("Start with Generating from URL or image")})})]})]})};exports.DropElement=DropElement;
@@ -1,41 +1,2 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var core = require('@gem-sdk/core');
7
- var DropElement = require('./DropElement.js');
8
-
9
- const HEADER_HEIGHT = 40;
10
- const FOOTER_HEIGHT = 50;
11
- const ImageToLayout = ({ editorImageToLayout })=>{
12
- const totalSection = core.useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
13
- const loaded = core.useBuilderPreviewStore((state)=>state.loaded);
14
- if (!loaded) {
15
- return null;
16
- }
17
- return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
18
- children: [
19
- /*#__PURE__*/ jsxRuntime.jsx("div", {
20
- id: "gp-img-to-layout-wrapper",
21
- className: core.cls(`sf-add-section-placeholder tablet:!gp-px-0 gps-base-font-family gp-flex-1 gp-flex-col gp-bg-[#F4F4F4]`, {
22
- 'gp-hidden': !editorImageToLayout || !!totalSection,
23
- 'gp-flex': editorImageToLayout && !totalSection
24
- }),
25
- style: {
26
- height: `calc(100vh - ${FOOTER_HEIGHT + HEADER_HEIGHT}px)`
27
- },
28
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
29
- id: "gps-gem-ai-input-wrapper",
30
- className: "mobile:gp-px-[0px] gp-flex gp-h-full gp-w-full gp-flex-1 gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-white gp-px-[72px] gp-py-[32px]",
31
- children: /*#__PURE__*/ jsxRuntime.jsx(DropElement.DropElement, {})
32
- })
33
- }),
34
- /*#__PURE__*/ jsxRuntime.jsx("div", {
35
- className: "limited-section"
36
- })
37
- ]
38
- });
39
- };
40
-
41
- exports.default = ImageToLayout;
1
+ 'use client';
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),DropElement=require("./DropElement.js");const HEADER_HEIGHT=40,FOOTER_HEIGHT=50,ImageToLayout=({editorImageToLayout:e})=>{let t=core.useBuilderPreviewStore(e=>e.state.ROOT.childrens?.length),r=core.useBuilderPreviewStore(e=>e.loaded);return r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{id:"gp-img-to-layout-wrapper",className:core.cls("sf-add-section-placeholder tablet:!gp-px-0 gps-base-font-family gp-flex-1 gp-flex-col gp-bg-[#F4F4F4]",{"gp-hidden":!e||!!t,"gp-flex":e&&!t}),style:{height:"calc(100vh - 90px)"},children:jsxRuntime.jsx("div",{id:"gps-gem-ai-input-wrapper",className:"mobile:gp-px-[0px] gp-flex gp-h-full gp-w-full gp-flex-1 gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-white gp-px-[72px] gp-py-[32px]",children:jsxRuntime.jsx(DropElement.DropElement,{})})}),jsxRuntime.jsx("div",{className:"limited-section"})]}):null};exports.default=ImageToLayout;
@@ -0,0 +1 @@
1
+ "use strict";exports.PublishedThemePageMetafields=void 0,function(e){e.CUSTOM_CODE_HEADER="custom_code_header",e.CUSTOM_CODE_BODY="custom_code_body",e.ANALYTICS_GA_TRACKING_ID="analytics_ga_tracking_id",e.ANALYTICS_FB_PIXEL_ID="analytics_fb_pixel_id",e.ANALYTICS_TIKTOK_PIXEL_ID="analytics_tiktok_pixel_id",e.GLOBAL_META_DESCRIPTION="global-meta-description",e.GLOBAL_META_TITLE="global-meta-title",e.GLOBAL_META_THUMBNAIL="global-meta-thumbnail",e.NOINDEX_KEY="noindex",e.NOFOLLOW_KEY="nofollow"}(exports.PublishedThemePageMetafields||(exports.PublishedThemePageMetafields={}));