@gem-sdk/pages 1.13.8 → 1.13.35

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.
@@ -41,7 +41,7 @@ const Footer = ()=>{
41
41
  'fixed bottom-0 w-full': shouldFixed
42
42
  }),
43
43
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
44
- className: "flex flex-1 h-[40px] items-center justify-between",
44
+ className: "flex h-[40px] flex-1 items-center justify-between",
45
45
  style: {
46
46
  maxWidth: `var(--g-ct-w)`,
47
47
  ...core.makeStyleResponsive('ml', defaultMargin),
@@ -78,7 +78,7 @@ const Footer = ()=>{
78
78
  ]
79
79
  }),
80
80
  /*#__PURE__*/ jsxRuntime.jsx("div", {
81
- className: "gp-footer hover:bg-[#0000001a] invisible absolute left-[8px] flex h-[24px] w-[24px] cursor-pointer items-center justify-center rounded bg-[#EEEEEE] p-[4px] group-hover:visible",
81
+ className: "gp-footer invisible absolute left-[8px] flex h-[24px] w-[24px] cursor-pointer items-center justify-center rounded bg-[#EEEEEE] p-[4px] hover:bg-[#0000001a] group-hover:visible",
82
82
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
83
83
  className: "flex h-[24px] w-[24px] items-center justify-center",
84
84
  children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
@@ -13,11 +13,11 @@ const defaultMargin = {
13
13
  const Header = ()=>{
14
14
  const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
15
15
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
16
- className: core.cls('gp-header-container border-b border-1 border-[#EEEEEE] group relative font-sans flex justify-center', {
16
+ className: core.cls('gp-header-container border-1 group relative flex justify-center border-b border-[#EEEEEE] font-sans', {
17
17
  hidden: !layoutSetting?.showHeader
18
18
  }),
19
19
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
20
- className: "flex flex-1 h-[40px] items-center justify-between",
20
+ className: "flex h-[40px] flex-1 items-center justify-between",
21
21
  style: {
22
22
  maxWidth: `var(--g-ct-w)`,
23
23
  ...core.makeStyleResponsive('ml', defaultMargin),
@@ -47,9 +47,9 @@ const Header = ()=>{
47
47
  ]
48
48
  }),
49
49
  /*#__PURE__*/ jsxRuntime.jsx("div", {
50
- className: "gp-header invisible flex h-[24px] w-[24px] cursor-pointer items-center justify-center rounded bg-[#EEEEEE] p-[4px] group-hover:visible absolute left-[8px] hover:bg-[#0000001a]",
50
+ className: "gp-header invisible absolute left-[8px] flex h-[24px] w-[24px] cursor-pointer items-center justify-center rounded bg-[#EEEEEE] p-[4px] hover:bg-[#0000001a] group-hover:visible",
51
51
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
52
- className: "h-[24px] w-[24px] flex items-center justify-center",
52
+ className: "flex h-[24px] w-[24px] items-center justify-center",
53
53
  children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
54
54
  width: "14",
55
55
  height: "14",
@@ -0,0 +1,279 @@
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 ACTIONS_DATA = [
10
+ {
11
+ title: 'Choose templates',
12
+ content: 'inspired by CRO experts',
13
+ hasAILogo: false,
14
+ id: 'gps-add-section-bottom-from-library'
15
+ },
16
+ {
17
+ title: 'Insert URL',
18
+ content: 'to generate layout',
19
+ hasAILogo: true,
20
+ id: 'gps-add-section-bottom-from-url'
21
+ },
22
+ {
23
+ title: 'Upload image',
24
+ content: 'to generate layout',
25
+ hasAILogo: true,
26
+ id: 'gps-add-section-bottom-from-image'
27
+ }
28
+ ];
29
+ const FOOTER_HEIGHT = 48;
30
+ const defaultPadding = {
31
+ desktop: 'var(--g-ct-p)',
32
+ tablet: 'var(--g-ct-p)',
33
+ mobile: 'var(--g-ct-p)'
34
+ };
35
+ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
36
+ const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
37
+ const totalSection = core.useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
38
+ const [link, setLink] = react.useState('');
39
+ const [isInput, setIsInput] = react.useState(false);
40
+ const onClick = (index)=>{
41
+ if (index === 1) {
42
+ setIsInput(true);
43
+ }
44
+ };
45
+ react.useEffect(()=>{
46
+ if (!isInput || totalSection === 0) {
47
+ setLink('');
48
+ setIsInput(false);
49
+ }
50
+ }, [
51
+ isInput,
52
+ totalSection
53
+ ]);
54
+ const loaded = core.useBuilderPreviewStore((state)=>state.loaded);
55
+ const offset = react.useMemo(()=>{
56
+ let result = 0;
57
+ if (layoutSetting?.showFooter) {
58
+ result += FOOTER_HEIGHT;
59
+ }
60
+ return result;
61
+ }, [
62
+ layoutSetting?.showFooter
63
+ ]);
64
+ if (!loaded) {
65
+ return null;
66
+ }
67
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
68
+ id: "gps-add-section-image-to-layout-of-bottom",
69
+ className: `justify-center ${totalSection && editorImageToLayout ? 'flex' : 'hidden'}`,
70
+ style: {
71
+ ...core.makeStyleResponsive('pl', defaultPadding),
72
+ ...core.makeStyleResponsive('pr', defaultPadding)
73
+ },
74
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
75
+ className: `gps-base-font-family relative mb-[24px] mt-[40px] flex flex-1 justify-center rounded-[3px] border border-[#EEEEEE] py-[24px]`,
76
+ style: {
77
+ maxWidth: `var(--g-ct-w)`,
78
+ marginBottom: `${offset + 48}px`
79
+ },
80
+ children: [
81
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
82
+ className: "absolute top-[-12px] bg-white px-[8px] text-[14px] font-normal text-[#9E9E9E]",
83
+ children: "Add section"
84
+ }),
85
+ ACTIONS_DATA.map((action, index)=>{
86
+ const CustomTag = index == 2 ? `label` : `div`;
87
+ return /*#__PURE__*/ jsxRuntime.jsxs(CustomTag, {
88
+ className: `relative mx-1 h-[60px] w-[172px] cursor-pointer flex-col items-center justify-center rounded-[3px] bg-[#F4F4F4] hover:bg-black/10 ${isInput ? 'hidden' : 'flex'}`,
89
+ htmlFor: "gp-add-section-bottom-from-select-image",
90
+ id: action.id,
91
+ onClick: ()=>onClick(index),
92
+ "aria-hidden": true,
93
+ children: [
94
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
95
+ className: "mb-[4px] flex gap-2 text-[14px] font-medium text-[#212121]",
96
+ children: [
97
+ action.title,
98
+ action.hasAILogo && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
99
+ width: "35",
100
+ height: "20",
101
+ viewBox: "0 0 35 20",
102
+ fill: "none",
103
+ xmlns: "http://www.w3.org/2000/svg",
104
+ children: [
105
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
106
+ d: "M0 3C0 1.34315 1.34315 0 3 0H32C33.6569 0 35 1.34315 35 3V17C35 18.6569 33.6569 20 32 20H3C1.34315 20 0 18.6569 0 17V3Z",
107
+ fill: "#EBDDF8"
108
+ }),
109
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
110
+ d: "M4.95881 14V5.27273H8.15483C8.77415 5.27273 9.28693 5.375 9.69318 5.57955C10.0994 5.78125 10.4034 6.0554 10.6051 6.40199C10.8068 6.74574 10.9077 7.13352 10.9077 7.56534C10.9077 7.92898 10.8409 8.2358 10.7074 8.4858C10.5739 8.73295 10.3949 8.93182 10.1705 9.08239C9.94886 9.23011 9.70455 9.33807 9.4375 9.40625V9.49148C9.72727 9.50568 10.0099 9.59943 10.2855 9.77273C10.5639 9.94318 10.794 10.1861 10.9759 10.5014C11.1577 10.8168 11.2486 11.2003 11.2486 11.652C11.2486 12.098 11.1435 12.4986 10.9332 12.8537C10.7259 13.206 10.4048 13.4858 9.97017 13.6932C9.53551 13.8977 8.98011 14 8.30398 14H4.95881ZM6.27557 12.8707H8.17614C8.80682 12.8707 9.25852 12.7486 9.53125 12.5043C9.80398 12.2599 9.94034 11.9545 9.94034 11.5881C9.94034 11.3125 9.87074 11.0597 9.73153 10.8295C9.59233 10.5994 9.39347 10.4162 9.13494 10.2798C8.87926 10.1435 8.57528 10.0753 8.22301 10.0753H6.27557V12.8707ZM6.27557 9.0483H8.03977C8.33523 9.0483 8.60085 8.99148 8.83665 8.87784C9.07528 8.7642 9.2642 8.60511 9.40341 8.40057C9.54545 8.19318 9.61648 7.94886 9.61648 7.66761C9.61648 7.30682 9.49006 7.00426 9.23722 6.75994C8.98438 6.51562 8.59659 6.39347 8.07386 6.39347H6.27557V9.0483ZM15.5291 14.1321C14.8842 14.1321 14.3288 13.9943 13.8629 13.7188C13.3999 13.4403 13.0419 13.0497 12.7891 12.5469C12.5391 12.0412 12.4141 11.4489 12.4141 10.7699C12.4141 10.0994 12.5391 9.50852 12.7891 8.99716C13.0419 8.4858 13.3942 8.08665 13.8459 7.79972C14.3004 7.51278 14.8317 7.36932 15.4396 7.36932C15.8089 7.36932 16.1669 7.4304 16.5135 7.55256C16.8601 7.67472 17.1712 7.86648 17.4467 8.12784C17.7223 8.3892 17.9396 8.72869 18.0987 9.14631C18.2578 9.56108 18.3374 10.0653 18.3374 10.6591V11.1108H13.1342V10.1562H17.0888C17.0888 9.82102 17.0206 9.52415 16.8842 9.26562C16.7479 9.00426 16.5561 8.7983 16.3089 8.64773C16.0646 8.49716 15.7777 8.42188 15.4482 8.42188C15.0902 8.42188 14.7777 8.50994 14.5107 8.68608C14.2464 8.85937 14.0419 9.08665 13.897 9.3679C13.755 9.64631 13.6839 9.94886 13.6839 10.2756V11.0213C13.6839 11.4588 13.7607 11.831 13.9141 12.1378C14.0703 12.4446 14.2876 12.679 14.5661 12.8409C14.8445 13 15.1697 13.0795 15.5419 13.0795C15.7834 13.0795 16.0036 13.0455 16.2024 12.9773C16.4013 12.9062 16.5732 12.8011 16.718 12.6619C16.8629 12.5227 16.9737 12.3509 17.0504 12.1463L18.2564 12.3636C18.1598 12.7187 17.9865 13.0298 17.7365 13.2969C17.4893 13.5611 17.1783 13.767 16.8033 13.9148C16.4311 14.0597 16.0064 14.1321 15.5291 14.1321ZM22.8065 7.45455V8.47727H19.2312V7.45455H22.8065ZM20.19 5.88636H21.4641V12.0781C21.4641 12.3253 21.5011 12.5114 21.5749 12.6364C21.6488 12.7585 21.744 12.8423 21.8604 12.8878C21.9798 12.9304 22.109 12.9517 22.2482 12.9517C22.3505 12.9517 22.44 12.9446 22.5167 12.9304C22.5934 12.9162 22.6531 12.9048 22.6957 12.8963L22.9258 13.9489C22.8519 13.9773 22.7468 14.0057 22.6104 14.0341C22.4741 14.0653 22.3036 14.0824 22.0991 14.0852C21.7638 14.0909 21.4513 14.0312 21.1616 13.9062C20.8718 13.7812 20.6374 13.5881 20.4585 13.3267C20.2795 13.0653 20.19 12.7372 20.19 12.3423V5.88636ZM26.1207 14.1449C25.706 14.1449 25.331 14.0682 24.9957 13.9148C24.6605 13.7585 24.3949 13.5327 24.1989 13.2372C24.0057 12.9418 23.9091 12.5795 23.9091 12.1506C23.9091 11.7812 23.9801 11.4773 24.1222 11.2386C24.2642 11 24.456 10.8111 24.6974 10.6719C24.9389 10.5327 25.2088 10.4276 25.5071 10.3565C25.8054 10.2855 26.1094 10.2315 26.419 10.1946C26.8111 10.1491 27.1293 10.1122 27.3736 10.0838C27.6179 10.0526 27.7955 10.0028 27.9062 9.93466C28.017 9.86648 28.0724 9.75568 28.0724 9.60227V9.57244C28.0724 9.20028 27.9673 8.91193 27.7571 8.70739C27.5497 8.50284 27.2401 8.40057 26.8281 8.40057C26.3991 8.40057 26.0611 8.49574 25.8139 8.68608C25.5696 8.87358 25.4006 9.08239 25.3068 9.3125L24.1094 9.03977C24.2514 8.64205 24.4588 8.32102 24.7315 8.0767C25.0071 7.82955 25.3239 7.65057 25.6818 7.53977C26.0398 7.42614 26.4162 7.36932 26.8111 7.36932C27.0724 7.36932 27.3494 7.40057 27.642 7.46307C27.9375 7.52273 28.2131 7.63352 28.4688 7.79545C28.7273 7.95739 28.9389 8.18892 29.1037 8.49006C29.2685 8.78835 29.3509 9.17614 29.3509 9.65341V14H28.1065V13.1051H28.0554C27.973 13.2699 27.8494 13.4318 27.6847 13.5909C27.5199 13.75 27.3082 13.8821 27.0497 13.9872C26.7912 14.0923 26.4815 14.1449 26.1207 14.1449ZM26.3977 13.1222C26.75 13.1222 27.0511 13.0526 27.3011 12.9134C27.554 12.7741 27.7457 12.5923 27.8764 12.3679C28.0099 12.1406 28.0767 11.8977 28.0767 11.6392V10.7955C28.0313 10.8409 27.9432 10.8835 27.8125 10.9233C27.6847 10.9602 27.5384 10.9929 27.3736 11.0213C27.2088 11.0469 27.0483 11.071 26.892 11.0938C26.7358 11.1136 26.6051 11.1307 26.5 11.1449C26.2528 11.1761 26.027 11.2287 25.8224 11.3026C25.6207 11.3764 25.4588 11.483 25.3366 11.6222C25.2173 11.7585 25.1577 11.9403 25.1577 12.1676C25.1577 12.483 25.2741 12.7216 25.5071 12.8835C25.7401 13.0426 26.0369 13.1222 26.3977 13.1222Z",
111
+ fill: "url(#paint0_linear_5214_50736)"
112
+ }),
113
+ /*#__PURE__*/ jsxRuntime.jsx("defs", {
114
+ children: /*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
115
+ id: "paint0_linear_5214_50736",
116
+ x1: "31",
117
+ y1: "15.2703",
118
+ x2: "3.99944",
119
+ y2: "15.2287",
120
+ gradientUnits: "userSpaceOnUse",
121
+ children: [
122
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
123
+ stopColor: "#874CFD"
124
+ }),
125
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
126
+ offset: "1",
127
+ stopColor: "#3C38E1"
128
+ })
129
+ ]
130
+ })
131
+ })
132
+ ]
133
+ })
134
+ ]
135
+ }),
136
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
137
+ className: "flex items-center ",
138
+ children: [
139
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
140
+ className: "mr-[3px] text-center text-[12px] font-normal text-[#676767]",
141
+ children: action.content
142
+ }),
143
+ action.id === 'gps-add-section-bottom-from-image' && /*#__PURE__*/ jsxRuntime.jsx("input", {
144
+ id: "gp-add-section-bottom-from-select-image",
145
+ className: "rounded-medium z-2 absolute left-0 top-0 hidden h-full w-full cursor-pointer opacity-0 outline-none",
146
+ type: "file",
147
+ accept: ".png, .jpg, .jpeg"
148
+ })
149
+ ]
150
+ })
151
+ ]
152
+ }, action.id);
153
+ }),
154
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
155
+ className: `relative max-w-[calc(100%_-_32px)] items-center ${isInput ? 'flex' : 'hidden'}`,
156
+ children: [
157
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
158
+ "aria-hidden": true,
159
+ id: "image-to-layout-input-wrapper-add-section-close",
160
+ onClick: ()=>setIsInput(false),
161
+ className: "mr-2 flex h-[32px] w-[32px] cursor-pointer items-center justify-center rounded-[3px] hover:bg-black/10",
162
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
163
+ width: "16",
164
+ height: "16",
165
+ viewBox: "0 0 16 16",
166
+ fill: "none",
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
169
+ d: "M5.62928 4.21433C5.8296 4.02426 6.15437 4.02426 6.35468 4.21433C6.555 4.40441 6.555 4.71259 6.35468 4.90266L3.61734 7.50012L13.3918 7.50012C13.6679 7.50012 13.8918 7.72398 13.8918 8.00012C13.8918 8.27626 13.6679 8.50012 13.3918 8.50012L3.61729 8.50012L6.35468 11.0976C6.555 11.2877 6.555 11.5959 6.35468 11.7859C6.15437 11.976 5.8296 11.976 5.62928 11.7859L2.00229 8.3443C1.80197 8.15423 1.80197 7.84605 2.00229 7.65598L5.62928 4.21433Z",
170
+ fill: "#212121"
171
+ })
172
+ })
173
+ }),
174
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
175
+ className: "image-to-layout-input-wrapper-add-section flex h-[60px] w-[500px] max-w-[calc(100%_-_40px)] items-center rounded-[3px] border py-[10px] pl-4 pr-2",
176
+ children: [
177
+ !link ? /*#__PURE__*/ jsxRuntime.jsxs("svg", {
178
+ width: "21",
179
+ height: "20",
180
+ viewBox: "0 0 21 20",
181
+ fill: "none",
182
+ xmlns: "http://www.w3.org/2000/svg",
183
+ children: [
184
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
185
+ d: "M15.0455 3.3397C14.9859 3.155 14.7246 3.155 14.6649 3.3397L14.3917 4.18545C14.2941 4.48763 14.0588 4.72549 13.7576 4.82633L12.9216 5.1063C12.7396 5.16724 12.7396 5.42466 12.9216 5.4856L13.7576 5.76557C14.0588 5.8664 14.2941 6.10426 14.3917 6.40645L14.6649 7.2522C14.7246 7.4369 14.9859 7.4369 15.0455 7.2522L15.3187 6.40645C15.4163 6.10426 15.6517 5.8664 15.9528 5.76557L16.7889 5.4856C16.9708 5.42466 16.9708 5.16724 16.7889 5.1063L15.9528 4.82633C15.6517 4.72549 15.4163 4.48763 15.3187 4.18545L15.0455 3.3397Z",
186
+ fill: "#9E9E9E"
187
+ }),
188
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
189
+ d: "M10.0157 4.1343C9.9262 3.85725 9.53422 3.85725 9.44473 4.1343L8.49438 7.07649C8.20156 7.98304 7.49557 8.69662 6.5922 8.99912L3.70474 9.96602C3.43175 10.0574 3.43175 10.4436 3.70474 10.535L6.59221 11.5019C7.49557 11.8044 8.20156 12.5179 8.49438 13.4245L9.44473 16.3667C9.53422 16.6437 9.9262 16.6437 10.0157 16.3667L10.966 13.4245C11.2589 12.5179 11.9649 11.8044 12.8682 11.5019L15.7557 10.535C16.0287 10.4436 16.0287 10.0574 15.7557 9.96602L12.8682 8.99912C11.9649 8.69662 11.2589 7.98304 10.966 7.07649L10.0157 4.1343Z",
190
+ fill: "#9E9E9E"
191
+ })
192
+ ]
193
+ }) : /*#__PURE__*/ jsxRuntime.jsxs("svg", {
194
+ width: "21",
195
+ height: "21",
196
+ viewBox: "0 0 21 21",
197
+ fill: "none",
198
+ xmlns: "http://www.w3.org/2000/svg",
199
+ children: [
200
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
201
+ d: "M15.0455 3.8397C14.9859 3.655 14.7246 3.655 14.6649 3.8397L14.3917 4.68545C14.2941 4.98763 14.0588 5.22549 13.7576 5.32633L12.9216 5.6063C12.7396 5.66724 12.7396 5.92466 12.9216 5.9856L13.7576 6.26557C14.0588 6.3664 14.2941 6.60426 14.3917 6.90645L14.6649 7.7522C14.7246 7.9369 14.9859 7.9369 15.0455 7.7522L15.3187 6.90645C15.4163 6.60426 15.6517 6.3664 15.9528 6.26557L16.7889 5.9856C16.9708 5.92466 16.9708 5.66724 16.7889 5.6063L15.9528 5.32633C15.6517 5.22549 15.4163 4.98763 15.3187 4.68545L15.0455 3.8397Z",
202
+ fill: "url(#paint0_linear_5189_39651)"
203
+ }),
204
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
205
+ d: "M10.0157 4.6343C9.9262 4.35725 9.53422 4.35725 9.44473 4.6343L8.49438 7.57649C8.20156 8.48304 7.49557 9.19662 6.5922 9.49912L3.70474 10.466C3.43175 10.5574 3.43175 10.9436 3.70474 11.035L6.59221 12.0019C7.49557 12.3044 8.20156 13.0179 8.49438 13.9245L9.44473 16.8667C9.53422 17.1437 9.9262 17.1437 10.0157 16.8667L10.966 13.9245C11.2589 13.0179 11.9649 12.3044 12.8682 12.0019L15.7557 11.035C16.0287 10.9436 16.0287 10.5574 15.7557 10.466L12.8682 9.49912C11.9649 9.19662 11.2589 8.48304 10.966 7.57649L10.0157 4.6343Z",
206
+ fill: "url(#paint1_linear_5189_39651)"
207
+ }),
208
+ /*#__PURE__*/ jsxRuntime.jsxs("defs", {
209
+ children: [
210
+ /*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
211
+ id: "paint0_linear_5189_39651",
212
+ x1: "16.9254",
213
+ y1: "13.9119",
214
+ x2: "3.49971",
215
+ y2: "13.8965",
216
+ gradientUnits: "userSpaceOnUse",
217
+ children: [
218
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
219
+ stopColor: "#874CFD"
220
+ }),
221
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
222
+ offset: "1",
223
+ stopColor: "#3C38E1"
224
+ })
225
+ ]
226
+ }),
227
+ /*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
228
+ id: "paint1_linear_5189_39651",
229
+ x1: "16.9254",
230
+ y1: "13.9119",
231
+ x2: "3.49971",
232
+ y2: "13.8965",
233
+ gradientUnits: "userSpaceOnUse",
234
+ children: [
235
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
236
+ stopColor: "#874CFD"
237
+ }),
238
+ /*#__PURE__*/ jsxRuntime.jsx("stop", {
239
+ offset: "1",
240
+ stopColor: "#3C38E1"
241
+ })
242
+ ]
243
+ })
244
+ ]
245
+ })
246
+ ]
247
+ }),
248
+ /*#__PURE__*/ jsxRuntime.jsx("input", {
249
+ onChange: (event)=>{
250
+ setLink(event.target.value);
251
+ },
252
+ autoComplete: "off",
253
+ id: "gp-img-to-layout-bottom-input-link",
254
+ placeholder: "Paste your link",
255
+ className: "ml-2 mr-2 h-[56px] flex-1 text-[14px] text-[#676767] outline-none"
256
+ }),
257
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
258
+ "aria-disabled": !link,
259
+ id: "gp-img-to-layout-bottom-generate-btn",
260
+ className: `generate-image-to-layout-btn flex h-[36px] w-[86px] cursor-pointer items-center justify-center rounded-[3px] text-sm font-medium ${!link ? 'btn-disable cursor-not-allowed' : ''}`,
261
+ children: "Generate"
262
+ })
263
+ ]
264
+ }),
265
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
266
+ className: "error-url-bottom-add-section absolute bottom-[-20px] left-[40px] mx-[-1px] flex hidden w-[600px] max-w-[100%] items-center justify-center",
267
+ children: /*#__PURE__*/ jsxRuntime.jsx("span", {
268
+ className: "ml-2 text-xs text-[#C3362B]",
269
+ children: "Please use an valid URL to generate"
270
+ })
271
+ })
272
+ ]
273
+ })
274
+ ]
275
+ })
276
+ });
277
+ };
278
+
279
+ exports.default = AddSectionImageToLayout;
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ const DropElement = ()=>{
6
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
7
+ className: "flex w-full flex-1 flex-col items-center justify-center",
8
+ children: [
9
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
10
+ className: "mb-6 text-sm font-normal text-[#676767]",
11
+ children: "Drag element from sidebar here"
12
+ }),
13
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
14
+ width: "276",
15
+ height: "129",
16
+ viewBox: "0 0 276 129",
17
+ fill: "none",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: [
20
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
21
+ x: "47",
22
+ y: "0.5",
23
+ width: "182",
24
+ height: "128",
25
+ rx: "8",
26
+ fill: "#E8E9EC"
27
+ }),
28
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
29
+ x: "124",
30
+ y: "12.5",
31
+ width: "94",
32
+ height: "104",
33
+ rx: "6",
34
+ fill: "white",
35
+ stroke: "#AEB6CD",
36
+ strokeWidth: "1.5",
37
+ strokeLinecap: "round",
38
+ strokeDasharray: "2 4"
39
+ }),
40
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
41
+ x: "59",
42
+ y: "14.5",
43
+ width: "44",
44
+ height: "22",
45
+ rx: "2",
46
+ fill: "white"
47
+ }),
48
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
49
+ x: "59",
50
+ y: "67.5",
51
+ width: "44",
52
+ height: "22",
53
+ rx: "2",
54
+ fill: "white"
55
+ }),
56
+ /*#__PURE__*/ jsxRuntime.jsx("g", {
57
+ clipPath: "url(#clip0_3791_281943)",
58
+ children: /*#__PURE__*/ jsxRuntime.jsx("rect", {
59
+ x: "59",
60
+ y: "41.5",
61
+ width: "44",
62
+ height: "22",
63
+ rx: "2",
64
+ fill: "#BDCEFF"
65
+ })
66
+ }),
67
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
68
+ x: "59",
69
+ y: "94.5",
70
+ width: "44",
71
+ height: "22",
72
+ rx: "2",
73
+ fill: "white"
74
+ }),
75
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
76
+ x: "112",
77
+ y: "39.5",
78
+ width: "71",
79
+ height: "50.0492",
80
+ rx: "3.4918",
81
+ fill: "#3C67FF"
82
+ }),
83
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
84
+ opacity: "0.8",
85
+ d: "M147.819 73.2147C148.963 74.508 148.04 76.5453 146.314 76.5395L131.719 76.4905C129.999 76.4848 129.088 74.456 130.226 73.1671L137.495 64.9309C138.291 64.0294 139.697 64.0288 140.493 64.9296L147.819 73.2147Z",
86
+ fill: "white",
87
+ fillOpacity: "0.84"
88
+ }),
89
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
90
+ d: "M167.258 73.1989C168.397 74.4947 167.471 76.5281 165.746 76.5193L140.732 76.3927C139.006 76.384 138.101 74.3387 139.256 73.0551L151.851 59.0548C152.652 58.1648 154.05 58.1728 154.84 59.072L167.258 73.1989Z",
91
+ fill: "white"
92
+ }),
93
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
94
+ opacity: "0.8",
95
+ d: "M136.608 58.3724C139.141 58.0841 140.904 55.8675 140.616 53.3346C140.328 50.8017 138.111 49.0381 135.578 49.3263C133.045 49.6145 131.282 51.8311 131.57 54.364C131.858 56.8969 134.075 58.6606 136.608 58.3724Z",
96
+ fill: "white",
97
+ fillOpacity: "0.84"
98
+ }),
99
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
100
+ d: "M189.56 94.5C189.7 94.6393 189.81 94.8047 189.886 94.9867C189.961 95.1687 190 95.3638 190 95.5608C190 95.7578 189.961 95.9529 189.886 96.1349C189.81 96.3169 189.7 96.4823 189.56 96.6216L189.122 97.0603C188.982 97.1997 188.817 97.3102 188.635 97.3856C188.453 97.461 188.258 97.4998 188.061 97.4998C187.864 97.4998 187.669 97.461 187.487 97.3856C187.305 97.3102 187.139 97.1997 187 97.0603L181.82 91.8816L179.769 96.601C179.654 96.8687 179.463 97.0966 179.219 97.2565C178.976 97.4163 178.691 97.501 178.399 97.5H178.326C178.023 97.4873 177.73 97.3816 177.488 97.1971C177.247 97.0126 177.068 96.7584 176.975 96.4688L172.075 81.4613C171.989 81.1987 171.978 80.9174 172.042 80.6486C172.106 80.3799 172.243 80.1342 172.439 79.9388C172.634 79.7434 172.88 79.606 173.149 79.5418C173.417 79.4776 173.699 79.4891 173.961 79.575L188.969 84.4753C189.256 84.5713 189.507 84.7517 189.689 84.9929C189.872 85.2341 189.977 85.5249 189.991 85.827C190.006 86.1291 189.928 86.4285 189.769 86.6858C189.61 86.9432 189.377 87.1465 189.101 87.2691L184.382 89.3203L189.56 94.5Z",
101
+ fill: "#2B2D34",
102
+ stroke: "#E8E8E8"
103
+ }),
104
+ /*#__PURE__*/ jsxRuntime.jsx("defs", {
105
+ children: /*#__PURE__*/ jsxRuntime.jsx("clipPath", {
106
+ id: "clip0_3791_281943",
107
+ children: /*#__PURE__*/ jsxRuntime.jsx("rect", {
108
+ x: "59",
109
+ y: "41.5",
110
+ width: "44",
111
+ height: "22",
112
+ rx: "2",
113
+ fill: "white"
114
+ })
115
+ })
116
+ })
117
+ ]
118
+ })
119
+ ]
120
+ });
121
+ };
122
+
123
+ exports.DropElement = DropElement;
@@ -0,0 +1,62 @@
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
+ var DropElement = require('./DropElement.js');
9
+ var ImageToLayoutInput = require('./ImageToLayoutInput.js');
10
+
11
+ const HEADER_HEIGHT = 40;
12
+ const FOOTER_HEIGHT = 50;
13
+ const ImageToLayout = ({ editorImageToLayout })=>{
14
+ const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
15
+ const totalSection = core.useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
16
+ const loaded = core.useBuilderPreviewStore((state)=>state.loaded);
17
+ const offset = react.useMemo(()=>{
18
+ let result = 0;
19
+ if (layoutSetting?.showFooter) {
20
+ result += FOOTER_HEIGHT;
21
+ }
22
+ if (layoutSetting?.showHeader) {
23
+ result += HEADER_HEIGHT;
24
+ }
25
+ return result;
26
+ }, [
27
+ layoutSetting?.showHeader,
28
+ layoutSetting?.showFooter
29
+ ]);
30
+ if (!loaded) {
31
+ return null;
32
+ }
33
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
34
+ children: [
35
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
36
+ id: "gp-img-to-layout-wrapper",
37
+ className: core.cls(`sf-add-section-placeholder tablet:!px-0 gps-base-font-family flex-1 flex-col bg-[#F4F4F4]`, {
38
+ hidden: !editorImageToLayout || !!totalSection,
39
+ flex: editorImageToLayout && !totalSection
40
+ }),
41
+ style: {
42
+ height: `calc(100vh - ${offset}px)`
43
+ },
44
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
45
+ id: "gps-gem-ai-input-wrapper",
46
+ className: "mobile:px-[0px] flex h-full w-full flex-1 flex-col items-center justify-center rounded-[3px] bg-white px-[72px] py-[32px]",
47
+ children: [
48
+ /*#__PURE__*/ jsxRuntime.jsx(DropElement.DropElement, {}),
49
+ /*#__PURE__*/ jsxRuntime.jsx(ImageToLayoutInput.ImageToLayoutInput, {
50
+ totalSection: totalSection || 0
51
+ })
52
+ ]
53
+ })
54
+ }),
55
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
56
+ className: "limited-section"
57
+ })
58
+ ]
59
+ });
60
+ };
61
+
62
+ exports.default = ImageToLayout;