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