@gem-sdk/pages 1.28.2 → 1.29.11
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.
|
@@ -559,7 +559,7 @@ const Toolbar = ()=>{
|
|
|
559
559
|
if (isDragging.current) return;
|
|
560
560
|
if (isResizeSpacing.current) return;
|
|
561
561
|
const $target = e.target;
|
|
562
|
-
if (!$target) {
|
|
562
|
+
if (!$target || typeof $target.closest !== 'function') {
|
|
563
563
|
removeHoverOverlayComponent();
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
@@ -28,6 +28,7 @@ const Toolbox = ()=>{
|
|
|
28
28
|
const removeItem = core.useBuilderPreviewStore((s)=>s.removeItem);
|
|
29
29
|
const addSection = core.useSectionStore((s)=>s.addSection);
|
|
30
30
|
const changeSwatches = core.useShopStore((s)=>s.changeSwatches);
|
|
31
|
+
const updateItemName = core.useBuilderPreviewStore((s)=>s.updateItemName);
|
|
31
32
|
const changeLayoutSettings = core.useShopStore((s)=>s.changeLayoutSettings);
|
|
32
33
|
const changeCreateThemeSectionCount = core.useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
33
34
|
const changeShopPlan = core.useShopStore((s)=>s.changeShopPlan);
|
|
@@ -295,6 +296,21 @@ const Toolbox = ()=>{
|
|
|
295
296
|
}, [
|
|
296
297
|
fonts
|
|
297
298
|
]);
|
|
299
|
+
const onUpdateItemName = react.useCallback((e)=>{
|
|
300
|
+
const detail = e.detail;
|
|
301
|
+
if (detail.uid) {
|
|
302
|
+
updateItemName(detail.uid, detail.name || '');
|
|
303
|
+
}
|
|
304
|
+
}, [
|
|
305
|
+
updateItemName
|
|
306
|
+
]);
|
|
307
|
+
react.useEffect(()=>{
|
|
308
|
+
if (fonts) {
|
|
309
|
+
setFontsToHead('google-font-element', fonts);
|
|
310
|
+
}
|
|
311
|
+
}, [
|
|
312
|
+
fonts
|
|
313
|
+
]);
|
|
298
314
|
react.useEffect(()=>{
|
|
299
315
|
window.addEventListener('update-shop-info', onChangeShopInfo);
|
|
300
316
|
window.addEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -311,6 +327,7 @@ const Toolbox = ()=>{
|
|
|
311
327
|
window.addEventListener('update-shop-plan', onUpdateShopPlan);
|
|
312
328
|
window.addEventListener('set-dynamic-product', onUpdateDynamicProduct);
|
|
313
329
|
window.addEventListener('set-dynamic-collection', onUpdateDynamicCollection);
|
|
330
|
+
window.addEventListener('update-item-name', onUpdateItemName);
|
|
314
331
|
return ()=>{
|
|
315
332
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
316
333
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -326,6 +343,7 @@ const Toolbox = ()=>{
|
|
|
326
343
|
window.removeEventListener('update-shop-plan', onUpdateShopPlan);
|
|
327
344
|
window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
|
|
328
345
|
window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
|
|
346
|
+
window.removeEventListener('update-item-name', onUpdateItemName);
|
|
329
347
|
};
|
|
330
348
|
}, [
|
|
331
349
|
onAddEntity,
|
|
@@ -342,7 +360,8 @@ const Toolbox = ()=>{
|
|
|
342
360
|
onChangeLayoutSettingData,
|
|
343
361
|
onUpdateCreateThemeSectionCount,
|
|
344
362
|
onUpdateDynamicProduct,
|
|
345
|
-
onUpdateDynamicCollection
|
|
363
|
+
onUpdateDynamicCollection,
|
|
364
|
+
onUpdateItemName
|
|
346
365
|
]);
|
|
347
366
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
348
367
|
className: "toolbox"
|
|
@@ -555,7 +555,7 @@ const Toolbar = ()=>{
|
|
|
555
555
|
if (isDragging.current) return;
|
|
556
556
|
if (isResizeSpacing.current) return;
|
|
557
557
|
const $target = e.target;
|
|
558
|
-
if (!$target) {
|
|
558
|
+
if (!$target || typeof $target.closest !== 'function') {
|
|
559
559
|
removeHoverOverlayComponent();
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
@@ -24,6 +24,7 @@ const Toolbox = ()=>{
|
|
|
24
24
|
const removeItem = useBuilderPreviewStore((s)=>s.removeItem);
|
|
25
25
|
const addSection = useSectionStore((s)=>s.addSection);
|
|
26
26
|
const changeSwatches = useShopStore((s)=>s.changeSwatches);
|
|
27
|
+
const updateItemName = useBuilderPreviewStore((s)=>s.updateItemName);
|
|
27
28
|
const changeLayoutSettings = useShopStore((s)=>s.changeLayoutSettings);
|
|
28
29
|
const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
29
30
|
const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
|
|
@@ -291,6 +292,21 @@ const Toolbox = ()=>{
|
|
|
291
292
|
}, [
|
|
292
293
|
fonts
|
|
293
294
|
]);
|
|
295
|
+
const onUpdateItemName = useCallback((e)=>{
|
|
296
|
+
const detail = e.detail;
|
|
297
|
+
if (detail.uid) {
|
|
298
|
+
updateItemName(detail.uid, detail.name || '');
|
|
299
|
+
}
|
|
300
|
+
}, [
|
|
301
|
+
updateItemName
|
|
302
|
+
]);
|
|
303
|
+
useEffect(()=>{
|
|
304
|
+
if (fonts) {
|
|
305
|
+
setFontsToHead('google-font-element', fonts);
|
|
306
|
+
}
|
|
307
|
+
}, [
|
|
308
|
+
fonts
|
|
309
|
+
]);
|
|
294
310
|
useEffect(()=>{
|
|
295
311
|
window.addEventListener('update-shop-info', onChangeShopInfo);
|
|
296
312
|
window.addEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -307,6 +323,7 @@ const Toolbox = ()=>{
|
|
|
307
323
|
window.addEventListener('update-shop-plan', onUpdateShopPlan);
|
|
308
324
|
window.addEventListener('set-dynamic-product', onUpdateDynamicProduct);
|
|
309
325
|
window.addEventListener('set-dynamic-collection', onUpdateDynamicCollection);
|
|
326
|
+
window.addEventListener('update-item-name', onUpdateItemName);
|
|
310
327
|
return ()=>{
|
|
311
328
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
312
329
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -322,6 +339,7 @@ const Toolbox = ()=>{
|
|
|
322
339
|
window.removeEventListener('update-shop-plan', onUpdateShopPlan);
|
|
323
340
|
window.removeEventListener('set-dynamic-product', onUpdateDynamicProduct);
|
|
324
341
|
window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
|
|
342
|
+
window.removeEventListener('update-item-name', onUpdateItemName);
|
|
325
343
|
};
|
|
326
344
|
}, [
|
|
327
345
|
onAddEntity,
|
|
@@ -338,7 +356,8 @@ const Toolbox = ()=>{
|
|
|
338
356
|
onChangeLayoutSettingData,
|
|
339
357
|
onUpdateCreateThemeSectionCount,
|
|
340
358
|
onUpdateDynamicProduct,
|
|
341
|
-
onUpdateDynamicCollection
|
|
359
|
+
onUpdateDynamicCollection,
|
|
360
|
+
onUpdateItemName
|
|
342
361
|
]);
|
|
343
362
|
return /*#__PURE__*/ jsx("div", {
|
|
344
363
|
className: "toolbox"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"next-seo": "^6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "1.
|
|
28
|
+
"@gem-sdk/core": "1.29.5",
|
|
29
29
|
"@gem-sdk/plugin-cookie-bar": "1.25.0",
|
|
30
30
|
"@gem-sdk/plugin-quick-view": "1.25.0",
|
|
31
31
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.25.0"
|