@gem-sdk/pages 1.23.0-staging.34 → 1.23.0-staging.349

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 (36) hide show
  1. package/dist/cjs/components/builder/Toolbar.js +317 -149
  2. package/dist/cjs/components/builder/Toolbox.js +106 -53
  3. package/dist/cjs/components/builder/toolbar/Onboarding.js +110 -0
  4. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +1 -7
  5. package/dist/cjs/components/image-to-layout/DropElement.js +128 -87
  6. package/dist/cjs/components/image-to-layout/ImageToLayout.js +2 -8
  7. package/dist/cjs/libs/api/get-home-page-props-v2.js +3 -1
  8. package/dist/cjs/libs/api/get-static-page-props-preview.js +3 -1
  9. package/dist/cjs/libs/google-fonts.js +6 -1
  10. package/dist/cjs/libs/helpers/gen-fonts.js +15 -4
  11. package/dist/cjs/pages/builder.js +43 -41
  12. package/dist/cjs/pages/collection-detail.js +12 -10
  13. package/dist/cjs/pages/product-detail.js +18 -16
  14. package/dist/cjs/pages/static-v2.js +14 -12
  15. package/dist/cjs/pages/static.js +13 -11
  16. package/dist/esm/components/builder/Toolbar.js +318 -150
  17. package/dist/esm/components/builder/Toolbox.js +107 -54
  18. package/dist/esm/components/builder/toolbar/Onboarding.js +106 -0
  19. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +1 -7
  20. package/dist/esm/components/image-to-layout/DropElement.js +128 -87
  21. package/dist/esm/components/image-to-layout/ImageToLayout.js +2 -8
  22. package/dist/esm/libs/api/get-home-page-props-v2.js +4 -2
  23. package/dist/esm/libs/api/get-static-page-props-preview.js +4 -2
  24. package/dist/esm/libs/google-fonts.js +6 -1
  25. package/dist/esm/libs/helpers/gen-fonts.js +15 -4
  26. package/dist/esm/pages/builder.js +44 -42
  27. package/dist/esm/pages/collection-detail.js +13 -11
  28. package/dist/esm/pages/product-detail.js +19 -17
  29. package/dist/esm/pages/static-v2.js +15 -13
  30. package/dist/esm/pages/static.js +14 -12
  31. package/dist/types/index.d.ts +1 -0
  32. package/package.json +3 -3
  33. package/dist/cjs/components/image-to-layout/ImageToLayoutInput.js +0 -193
  34. package/dist/cjs/components/image-to-layout/PagesSuggestion.js +0 -80
  35. package/dist/esm/components/image-to-layout/ImageToLayoutInput.js +0 -191
  36. package/dist/esm/components/image-to-layout/PagesSuggestion.js +0 -78
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { useMatchMutate, useShopStore, useBuilderPreviewStore, useSectionStore, useModalStore } from '@gem-sdk/core';
2
+ import { useMatchMutate, useShopStore, usePageStore, useBuilderPreviewStore, useSectionStore, useModalStore } from '@gem-sdk/core';
3
3
  import { memo, useMemo, useCallback, useEffect } from 'react';
4
4
  import { getStorefrontApi } from '../../libs/get-storefront-api.js';
5
5
  import { createFontUrl } from '../../libs/google-fonts.js';
@@ -8,24 +8,24 @@ import { getFontsFromDataBuilder } from '../../libs/helpers/gen-fonts.js';
8
8
  import { shopifyCdnWithGoogleFonts } from '../../libs/shopify-cdn-with-google-fonts.js';
9
9
 
10
10
  const globalStyleId = 'global-style';
11
- const globalFontId = 'google-font-builder';
12
- const fontElementSettingClassName = 'google-font-element';
13
11
  const Toolbox = ()=>{
14
12
  const matchMutate = useMatchMutate();
15
13
  const provider = useShopStore((s)=>s.provider);
16
14
  const changeStorefrontInfo = useShopStore((s)=>s.changeStorefrontInfo);
15
+ const setDynamicProduct = usePageStore((s)=>s.setDynamicProduct);
16
+ const setDynamicCollection = usePageStore((s)=>s.setDynamicCollection);
17
17
  const initState = useBuilderPreviewStore((s)=>s.initState);
18
18
  const state = useBuilderPreviewStore((s)=>s.state);
19
19
  const initNormalizeState = useBuilderPreviewStore((s)=>s.forceChangeState);
20
20
  const forceChangeItemProp = useBuilderPreviewStore((s)=>s.forceChangeItemProp);
21
21
  const changeItemPropByKey = useBuilderPreviewStore((s)=>s.changeItemPropByKey);
22
- const setDynamicProduct = useBuilderPreviewStore((s)=>s.setDynamicProduct);
23
- const setDynamicCollection = useBuilderPreviewStore((s)=>s.setDynamicCollection);
24
22
  const addItem = useBuilderPreviewStore((s)=>s.addItem);
25
23
  const moveItem = useBuilderPreviewStore((s)=>s.moveItem);
26
24
  const removeItem = useBuilderPreviewStore((s)=>s.removeItem);
27
25
  const addSection = useSectionStore((s)=>s.addSection);
28
26
  const changeSwatches = useShopStore((s)=>s.changeSwatches);
27
+ const updateItemName = useBuilderPreviewStore((s)=>s.updateItemName);
28
+ const updateItemAttribute = useBuilderPreviewStore((s)=>s.updateItemAttribute);
29
29
  const changeLayoutSettings = useShopStore((s)=>s.changeLayoutSettings);
30
30
  const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
31
31
  const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
@@ -33,11 +33,62 @@ const Toolbox = ()=>{
33
33
  const fonts = useMemo(()=>getFontsFromDataBuilder(state), [
34
34
  state
35
35
  ]);
36
- const customFontUrl = useMemo(()=>{
37
- return createFontUrl(fonts);
38
- }, [
39
- fonts
40
- ]);
36
+ const setFontsToHead = (className, fonts)=>{
37
+ // clear fonts
38
+ if (!fonts?.length) {
39
+ const googleFonts = document.querySelectorAll(`.${className}`);
40
+ googleFonts.forEach((googleFont)=>{
41
+ googleFont.remove();
42
+ });
43
+ return;
44
+ }
45
+ // clear fonts not use
46
+ const googleFonts = document.querySelectorAll(`.${className}`);
47
+ googleFonts.forEach((googleFont)=>{
48
+ const fontName = googleFont.getAttribute('data-font');
49
+ const variantName = googleFont.getAttribute('data-font-variant');
50
+ if (!fontName || !variantName) {
51
+ googleFont.remove();
52
+ } else {
53
+ const isUse = fonts.find((font)=>font.family == fontName && font.variants.includes(variantName));
54
+ if (!isUse) {
55
+ googleFont.remove();
56
+ }
57
+ }
58
+ });
59
+ // append new fonts
60
+ for (const font of fonts){
61
+ if (font.type !== 'custom') {
62
+ if (font.variants?.length) {
63
+ for (const variant of font.variants){
64
+ const cloneFont = JSON.parse(JSON.stringify(font));
65
+ cloneFont.variants = [
66
+ variant
67
+ ]; // set single variant. Fix error reload font when change href other variant
68
+ const fontName = cloneFont.family;
69
+ const variantName = variant;
70
+ const url = createFontUrl([
71
+ cloneFont
72
+ ]);
73
+ if (url) {
74
+ const googleFont = document.querySelector(`.${className}[data-font="${fontName}"][data-font-variant="${variantName}"]`);
75
+ if (googleFont) {
76
+ continue;
77
+ } else {
78
+ const link = document.createElement('link');
79
+ link.className = className;
80
+ link.dataset.font = fontName;
81
+ link.dataset.fontVariant = variantName;
82
+ link.href = url;
83
+ link.rel = 'stylesheet';
84
+ document.head.appendChild(link);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ };
41
92
  // Revalidate all query with key match query/
42
93
  const onRevalidateQuery = useCallback(()=>{
43
94
  matchMutate(/query\//, {
@@ -73,22 +124,8 @@ const Toolbox = ()=>{
73
124
  }
74
125
  return item;
75
126
  });
76
- const fontUrl = createFontUrl(font);
77
127
  const globalStyle = document.getElementById(globalStyleId);
78
- const googleFont = document.getElementById(globalFontId);
79
- if (fontUrl) {
80
- if (googleFont) {
81
- if (googleFont.getAttribute('href') !== fontUrl) {
82
- googleFont.setAttribute('href', fontUrl);
83
- }
84
- } else {
85
- const link = document.createElement('link');
86
- link.id = globalFontId;
87
- link.href = fontUrl;
88
- link.rel = 'stylesheet';
89
- document.head.appendChild(link);
90
- }
91
- }
128
+ setFontsToHead('google-font-builder', font);
92
129
  if (globalStyle) {
93
130
  globalStyle.innerHTML = themeStyle;
94
131
  } else {
@@ -222,52 +259,62 @@ const Toolbox = ()=>{
222
259
  changeLayoutSettings
223
260
  ]);
224
261
  const onUpdateCreateThemeSectionCount = useCallback((e)=>{
225
- const detail = e.detail;
226
- if (!detail) return;
227
- changeCreateThemeSectionCount(detail);
262
+ const count = e.detail;
263
+ if (!count) return;
264
+ changeCreateThemeSectionCount(count);
228
265
  }, [
229
266
  changeCreateThemeSectionCount
230
267
  ]);
231
268
  const onUpdateShopPlan = useCallback((e)=>{
232
- const detail = e.detail;
233
- if (!detail) return;
234
- changeShopPlan(detail);
269
+ const shopPlan = e.detail;
270
+ if (!shopPlan) return;
271
+ changeShopPlan(shopPlan);
235
272
  }, [
236
273
  changeShopPlan
237
274
  ]);
238
275
  const onUpdateDynamicProduct = useCallback((e)=>{
239
- const detail = e.detail;
240
- if (!detail) return;
241
- setDynamicProduct(detail);
276
+ const product = e.detail;
277
+ if (!product) return;
278
+ setDynamicProduct(product);
242
279
  }, [
243
280
  setDynamicProduct
244
281
  ]);
245
282
  const onUpdateDynamicCollection = useCallback((e)=>{
246
- const detail = e.detail;
247
- if (!detail) return;
248
- setDynamicCollection(detail);
283
+ const collection = e.detail;
284
+ if (!collection) return;
285
+ setDynamicCollection(collection);
249
286
  }, [
250
287
  setDynamicCollection
251
288
  ]);
252
289
  useEffect(()=>{
253
- if (customFontUrl) {
254
- const fontId = 'google-font';
255
- const googleFont = document.querySelector(`.${fontElementSettingClassName}[data-font="${fontId}"]`);
256
- if (googleFont) {
257
- if (googleFont.getAttribute('href') !== customFontUrl) {
258
- googleFont.setAttribute('href', customFontUrl);
259
- }
260
- } else {
261
- const link = document.createElement('link');
262
- link.className = fontElementSettingClassName;
263
- link.dataset.font = fontId;
264
- link.href = customFontUrl;
265
- link.rel = 'stylesheet';
266
- document.head.appendChild(link);
267
- }
290
+ if (fonts) {
291
+ setFontsToHead('google-font-element', fonts);
292
+ }
293
+ }, [
294
+ fonts
295
+ ]);
296
+ const onUpdateItemName = useCallback((e)=>{
297
+ const detail = e.detail;
298
+ if (detail.uid) {
299
+ updateItemName(detail.uid, detail.name || '');
300
+ }
301
+ }, [
302
+ updateItemName
303
+ ]);
304
+ const onUpdateItemAttribute = useCallback((e)=>{
305
+ const detail = e.detail;
306
+ if (detail.uid) {
307
+ updateItemAttribute(detail.uid, detail.value || '', detail.attr || '');
268
308
  }
269
309
  }, [
270
- customFontUrl
310
+ updateItemAttribute
311
+ ]);
312
+ useEffect(()=>{
313
+ if (fonts) {
314
+ setFontsToHead('google-font-element', fonts);
315
+ }
316
+ }, [
317
+ fonts
271
318
  ]);
272
319
  useEffect(()=>{
273
320
  window.addEventListener('update-shop-info', onChangeShopInfo);
@@ -285,6 +332,8 @@ const Toolbox = ()=>{
285
332
  window.addEventListener('update-shop-plan', onUpdateShopPlan);
286
333
  window.addEventListener('set-dynamic-product', onUpdateDynamicProduct);
287
334
  window.addEventListener('set-dynamic-collection', onUpdateDynamicCollection);
335
+ window.addEventListener('update-item-name', onUpdateItemName);
336
+ window.addEventListener('update-item-attribute', onUpdateItemAttribute);
288
337
  return ()=>{
289
338
  window.removeEventListener('update-shop-info', onChangeShopInfo);
290
339
  window.removeEventListener('revalidate-query', onRevalidateQuery);
@@ -300,6 +349,8 @@ const Toolbox = ()=>{
300
349
  window.removeEventListener('update-shop-plan', onUpdateShopPlan);
301
350
  window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
302
351
  window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
352
+ window.removeEventListener('update-item-name', onUpdateItemName);
353
+ window.removeEventListener('update-item-attribute', onUpdateItemAttribute);
303
354
  };
304
355
  }, [
305
356
  onAddEntity,
@@ -316,7 +367,9 @@ const Toolbox = ()=>{
316
367
  onChangeLayoutSettingData,
317
368
  onUpdateCreateThemeSectionCount,
318
369
  onUpdateDynamicProduct,
319
- onUpdateDynamicCollection
370
+ onUpdateDynamicCollection,
371
+ onUpdateItemName,
372
+ onUpdateItemAttribute
320
373
  ]);
321
374
  return /*#__PURE__*/ jsx("div", {
322
375
  className: "toolbox"
@@ -0,0 +1,106 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { memo } from 'react';
3
+
4
+ const Onboarding = ({ enable, position, onCloseOnboarding })=>{
5
+ const closeOnboarding = ()=>{
6
+ onCloseOnboarding();
7
+ };
8
+ const videoSrc = 'https://ucarecdn.com/de5fd2eb-4525-45a7-ad13-53960dac225e/';
9
+ const Video = ()=>{
10
+ return /*#__PURE__*/ jsxs("video", {
11
+ width: "100%",
12
+ className: "w-full",
13
+ loop: true,
14
+ muted: true,
15
+ autoPlay: true,
16
+ playsInline: true,
17
+ children: [
18
+ /*#__PURE__*/ jsx("source", {
19
+ src: videoSrc,
20
+ type: "video/mp4"
21
+ }),
22
+ "Sorry, your browser doesn‘t support embedded videos."
23
+ ]
24
+ });
25
+ };
26
+ const MemoVideo = /*#__PURE__*/ memo(Video);
27
+ return /*#__PURE__*/ jsx("div", {
28
+ "data-toolbar-onboarding": true,
29
+ "data-toolbar-onboarding-position": position,
30
+ children: enable && /*#__PURE__*/ jsxs(Fragment, {
31
+ children: [
32
+ /*#__PURE__*/ jsx("span", {
33
+ "data-icon": true,
34
+ "data-position": position,
35
+ children: position === 'bottom' ? /*#__PURE__*/ jsx("svg", {
36
+ width: "8",
37
+ height: "4",
38
+ viewBox: "0 0 8 4",
39
+ fill: "none",
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ children: /*#__PURE__*/ jsx("path", {
42
+ d: "M-1.74846e-07 4L4 -1.74846e-07L8 4L-1.74846e-07 4Z",
43
+ fill: "white"
44
+ })
45
+ }) : /*#__PURE__*/ jsx("svg", {
46
+ width: "8",
47
+ height: "4",
48
+ viewBox: "0 0 8 4",
49
+ fill: "none",
50
+ xmlns: "http://www.w3.org/2000/svg",
51
+ children: /*#__PURE__*/ jsx("path", {
52
+ d: "M8 3.33818e-07L4 4L4.76995e-08 7.15256e-07L8 3.33818e-07Z",
53
+ fill: "white"
54
+ })
55
+ })
56
+ }),
57
+ /*#__PURE__*/ jsxs("div", {
58
+ "data-onboarding-wrapper": true,
59
+ children: [
60
+ /*#__PURE__*/ jsx("button", {
61
+ "data-close": true,
62
+ type: "button",
63
+ onClick: closeOnboarding,
64
+ children: /*#__PURE__*/ jsxs("svg", {
65
+ width: "32",
66
+ height: "32",
67
+ viewBox: "0 0 32 32",
68
+ fill: "none",
69
+ xmlns: "http://www.w3.org/2000/svg",
70
+ children: [
71
+ /*#__PURE__*/ jsx("path", {
72
+ fillRule: "evenodd",
73
+ clipRule: "evenodd",
74
+ d: "M10.6464 10.6464C10.8417 10.4512 11.1583 10.4512 11.3536 10.6464L21.3536 20.6464C21.5488 20.8417 21.5488 21.1583 21.3536 21.3536C21.1583 21.5488 20.8417 21.5488 20.6464 21.3536L10.6464 11.3536C10.4512 11.1583 10.4512 10.8417 10.6464 10.6464Z",
75
+ fill: "#212121"
76
+ }),
77
+ /*#__PURE__*/ jsx("path", {
78
+ fillRule: "evenodd",
79
+ clipRule: "evenodd",
80
+ d: "M21.3536 10.6464C21.5488 10.8417 21.5488 11.1583 21.3536 11.3536L11.3536 21.3536C11.1583 21.5488 10.8417 21.5488 10.6464 21.3536C10.4512 21.1583 10.4512 20.8417 10.6464 20.6464L20.6464 10.6464C20.8417 10.4512 21.1583 10.4512 21.3536 10.6464Z",
81
+ fill: "#212121"
82
+ })
83
+ ]
84
+ })
85
+ }),
86
+ /*#__PURE__*/ jsx(MemoVideo, {}),
87
+ /*#__PURE__*/ jsxs("div", {
88
+ "data-content": true,
89
+ children: [
90
+ /*#__PURE__*/ jsx("h3", {
91
+ children: "New way to select parent element"
92
+ }),
93
+ /*#__PURE__*/ jsx("p", {
94
+ children: "Select parent from here in case you can‘t find yours at times."
95
+ })
96
+ ]
97
+ })
98
+ ]
99
+ })
100
+ ]
101
+ })
102
+ });
103
+ };
104
+ var Onboarding$1 = /*#__PURE__*/ memo(Onboarding);
105
+
106
+ export { Onboarding$1 as default };
@@ -33,11 +33,6 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
33
33
  const totalSection = useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
34
34
  const [link, setLink] = useState('');
35
35
  const [isInput, setIsInput] = useState(false);
36
- const onClick = (index)=>{
37
- if (index === 1) {
38
- setIsInput(true);
39
- }
40
- };
41
36
  useEffect(()=>{
42
37
  if (!isInput || totalSection === 0) {
43
38
  setLink('');
@@ -78,11 +73,10 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
78
73
  className: "absolute top-[-12px] bg-white px-[8px] text-[14px] font-normal text-[#9E9E9E]",
79
74
  children: "Add section"
80
75
  }),
81
- ACTIONS_DATA.map((action, index)=>{
76
+ ACTIONS_DATA.map((action)=>{
82
77
  return /*#__PURE__*/ jsxs("div", {
83
78
  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'}`,
84
79
  id: action.id,
85
- onClick: ()=>onClick(index),
86
80
  "aria-hidden": true,
87
81
  children: [
88
82
  /*#__PURE__*/ jsxs("div", {
@@ -1,116 +1,157 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
 
3
3
  const DropElement = ()=>{
4
+ const dispatchEventBuildWithSectionActiveTab = (value)=>{
5
+ const event = new CustomEvent('editor:sidebar:build-with-section-active-tab', {
6
+ bubbles: true,
7
+ detail: {
8
+ value
9
+ }
10
+ });
11
+ window.dispatchEvent(event);
12
+ };
4
13
  return /*#__PURE__*/ jsxs("div", {
5
- className: "flex w-full flex-1 flex-col items-center justify-center",
14
+ className: "flex w-full flex-col items-center justify-center",
6
15
  children: [
7
- /*#__PURE__*/ jsx("span", {
8
- className: "mb-6 text-sm font-normal text-[#676767]",
9
- children: "Drag element from sidebar here"
10
- }),
11
16
  /*#__PURE__*/ jsxs("svg", {
12
- width: "276",
13
- height: "129",
14
- viewBox: "0 0 276 129",
17
+ width: "290",
18
+ height: "162",
19
+ viewBox: "0 0 290 162",
15
20
  fill: "none",
16
21
  xmlns: "http://www.w3.org/2000/svg",
22
+ className: "mb-[24px]",
17
23
  children: [
18
24
  /*#__PURE__*/ jsx("rect", {
19
- x: "47",
20
- y: "0.5",
21
- width: "182",
22
- height: "128",
23
- rx: "8",
24
- fill: "#E8E9EC"
25
+ x: "0.570588",
26
+ y: "0.570588",
27
+ width: "288.859",
28
+ height: "160.859",
29
+ rx: "8.55882",
30
+ fill: "white"
25
31
  }),
26
32
  /*#__PURE__*/ jsx("rect", {
27
- x: "124",
28
- y: "12.5",
29
- width: "94",
30
- height: "104",
31
- rx: "6",
32
- fill: "white",
33
- stroke: "#AEB6CD",
34
- strokeWidth: "1.5",
35
- strokeLinecap: "round",
36
- strokeDasharray: "2 4"
33
+ x: "0.570588",
34
+ y: "0.570588",
35
+ width: "288.859",
36
+ height: "160.859",
37
+ rx: "8.55882",
38
+ stroke: "#E2E2E2",
39
+ strokeWidth: "1.14118"
37
40
  }),
38
- /*#__PURE__*/ jsx("rect", {
39
- x: "59",
40
- y: "14.5",
41
- width: "44",
42
- height: "22",
43
- rx: "2",
44
- fill: "white"
41
+ /*#__PURE__*/ jsx("path", {
42
+ 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",
43
+ fill: "#3C67FF",
44
+ fillOpacity: "0.1"
45
45
  }),
46
- /*#__PURE__*/ jsx("rect", {
47
- x: "59",
48
- y: "67.5",
49
- width: "44",
50
- height: "22",
51
- rx: "2",
52
- fill: "white"
46
+ /*#__PURE__*/ jsx("path", {
47
+ 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",
48
+ fill: "#7190FF"
53
49
  }),
54
- /*#__PURE__*/ jsx("g", {
55
- clipPath: "url(#clip0_3791_281943)",
56
- children: /*#__PURE__*/ jsx("rect", {
57
- x: "59",
58
- y: "41.5",
59
- width: "44",
60
- height: "22",
61
- rx: "2",
62
- fill: "#BDCEFF"
63
- })
50
+ /*#__PURE__*/ jsx("path", {
51
+ 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",
52
+ fill: "#7190FF"
53
+ }),
54
+ /*#__PURE__*/ jsx("path", {
55
+ 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",
56
+ fill: "#7190FF"
64
57
  }),
65
58
  /*#__PURE__*/ jsx("rect", {
66
- x: "59",
67
- y: "94.5",
68
- width: "44",
69
- height: "22",
70
- rx: "2",
71
- fill: "white"
59
+ x: "157.482",
60
+ y: "45.647",
61
+ width: "83.3059",
62
+ height: "11.4118",
63
+ rx: "5.70588",
64
+ fill: "#AAAAAA"
72
65
  }),
73
66
  /*#__PURE__*/ jsx("rect", {
74
- x: "112",
75
- y: "39.5",
76
- width: "71",
77
- height: "50.0492",
78
- rx: "3.4918",
67
+ x: "157.5",
68
+ y: "98.9995",
69
+ width: "48",
70
+ height: "18",
71
+ rx: "9",
79
72
  fill: "#3C67FF"
80
73
  }),
81
- /*#__PURE__*/ jsx("path", {
82
- opacity: "0.8",
83
- 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",
84
- fill: "white",
85
- fillOpacity: "0.84"
74
+ /*#__PURE__*/ jsx("rect", {
75
+ x: "157.5",
76
+ y: "66.9995",
77
+ width: "68",
78
+ height: "5",
79
+ rx: "2.5",
80
+ fill: "#E2E2E2"
86
81
  }),
87
- /*#__PURE__*/ jsx("path", {
88
- 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",
89
- fill: "white"
82
+ /*#__PURE__*/ jsx("rect", {
83
+ x: "157.5",
84
+ y: "79.9995",
85
+ width: "52",
86
+ height: "5",
87
+ rx: "2.5",
88
+ fill: "#E2E2E2"
89
+ })
90
+ ]
91
+ }),
92
+ /*#__PURE__*/ jsxs("div", {
93
+ className: "flex flex-col items-center",
94
+ children: [
95
+ /*#__PURE__*/ jsx("div", {
96
+ className: "text-16 font-medium mb-4 text-[#212121]",
97
+ children: "Start with Sections from sidebar"
90
98
  }),
91
- /*#__PURE__*/ jsx("path", {
92
- opacity: "0.8",
93
- 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",
94
- fill: "white",
95
- fillOpacity: "0.84"
99
+ /*#__PURE__*/ jsxs("div", {
100
+ className: "flex w-[291px] justify-between",
101
+ children: [
102
+ /*#__PURE__*/ jsx("button", {
103
+ onClick: ()=>dispatchEventBuildWithSectionActiveTab(true),
104
+ className: "flex h-[40px] w-[136px] items-center font-medium justify-center rounded-[8px] bg-[#1C1C1C] text-[14px] text-white hover:bg-[#3B3B3B]",
105
+ children: "Add sections"
106
+ }),
107
+ /*#__PURE__*/ jsx("button", {
108
+ onClick: ()=>dispatchEventBuildWithSectionActiveTab(false),
109
+ className: "flex h-[40px] w-[136px] items-center font-medium justify-center rounded-[8px] bg-[#f4f4f4] text-[14px] text-[#212121] hover:bg-[#E2E2E2]",
110
+ children: "Add elements"
111
+ })
112
+ ]
96
113
  }),
97
- /*#__PURE__*/ jsx("path", {
98
- 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",
99
- fill: "#2B2D34",
100
- stroke: "#E8E8E8"
114
+ /*#__PURE__*/ jsx("div", {
115
+ className: "my-6",
116
+ children: /*#__PURE__*/ jsxs("svg", {
117
+ width: "338",
118
+ height: "24",
119
+ viewBox: "0 0 338 24",
120
+ fill: "none",
121
+ xmlns: "http://www.w3.org/2000/svg",
122
+ children: [
123
+ /*#__PURE__*/ jsx("rect", {
124
+ width: "150",
125
+ height: "1",
126
+ transform: "translate(0 11.4999)",
127
+ fill: "#D6D6D6"
128
+ }),
129
+ /*#__PURE__*/ jsx("path", {
130
+ 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",
131
+ fill: "#676767"
132
+ }),
133
+ /*#__PURE__*/ jsx("rect", {
134
+ width: "150",
135
+ height: "1",
136
+ transform: "translate(188 11.4999)",
137
+ fill: "#D6D6D6"
138
+ })
139
+ ]
140
+ })
101
141
  }),
102
- /*#__PURE__*/ jsx("defs", {
103
- children: /*#__PURE__*/ jsx("clipPath", {
104
- id: "clip0_3791_281943",
105
- children: /*#__PURE__*/ jsx("rect", {
106
- x: "59",
107
- y: "41.5",
108
- width: "44",
109
- height: "22",
110
- rx: "2",
111
- fill: "white"
142
+ /*#__PURE__*/ jsxs("div", {
143
+ className: "flex items-center gap-2 text-xs",
144
+ children: [
145
+ /*#__PURE__*/ jsx("div", {
146
+ id: "gp-img-to-layout-gallery-btn",
147
+ className: "relative cursor-pointer text-[14px] font-medium text-[#3C67FF]",
148
+ children: "Start with Generating from URL or image"
149
+ }),
150
+ /*#__PURE__*/ jsx("div", {
151
+ className: "text-medium flex h-[20px] w-[58px] items-center justify-center rounded-[8px] bg-[#3C67FF1A] text-[#0008C9]",
152
+ children: "AI Beta"
112
153
  })
113
- })
154
+ ]
114
155
  })
115
156
  ]
116
157
  })
@@ -1,7 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { useBuilderPreviewStore, cls } from '@gem-sdk/core';
3
3
  import { DropElement } from './DropElement.js';
4
- import { ImageToLayoutInput } from './ImageToLayoutInput.js';
5
4
 
6
5
  const HEADER_HEIGHT = 40;
7
6
  const FOOTER_HEIGHT = 50;
@@ -22,15 +21,10 @@ const ImageToLayout = ({ editorImageToLayout })=>{
22
21
  style: {
23
22
  height: `calc(100vh - ${FOOTER_HEIGHT + HEADER_HEIGHT}px)`
24
23
  },
25
- children: /*#__PURE__*/ jsxs("div", {
24
+ children: /*#__PURE__*/ jsx("div", {
26
25
  id: "gps-gem-ai-input-wrapper",
27
26
  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]",
28
- children: [
29
- /*#__PURE__*/ jsx(DropElement, {}),
30
- /*#__PURE__*/ jsx(ImageToLayoutInput, {
31
- totalSection: totalSection || 0
32
- })
33
- ]
27
+ children: /*#__PURE__*/ jsx(DropElement, {})
34
28
  })
35
29
  }),
36
30
  /*#__PURE__*/ jsx("div", {