@xiwebdesign/xicms-core 7.8.1 → 7.9.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.
- package/dist/admin/lib/pagesClient.js +5 -1
- package/dist/admin/lib/pagesClient.js.map +1 -1
- package/dist/admin/shop/ProductsTab.js +4 -5
- package/dist/admin/shop/ProductsTab.js.map +1 -1
- package/dist/admin/shop/productClient.d.ts +11 -13
- package/dist/admin/shop/productClient.js +44 -4
- package/dist/admin/shop/productClient.js.map +1 -1
- package/dist/admin/visual/VisualEditor.js +137 -46
- package/dist/admin/visual/VisualEditor.js.map +1 -1
- package/dist/components/barOffset.js +7 -1
- package/dist/components/barOffset.js.map +1 -1
- package/dist/demo/demoStore.d.ts +2 -0
- package/dist/demo/demoStore.js +4 -0
- package/dist/demo/demoStore.js.map +1 -1
- package/dist/editor/EditorProvider.d.ts +9 -0
- package/dist/editor/EditorProvider.js +11 -2
- package/dist/editor/EditorProvider.js.map +1 -1
- package/dist/media/ImageContext.d.ts +1 -1
- package/dist/media/ImageContext.js +3 -1
- package/dist/media/ImageContext.js.map +1 -1
- package/dist/render/PublishedPage.js +3 -2
- package/dist/render/PublishedPage.js.map +1 -1
- package/dist/styles.css +23 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -282,7 +282,13 @@ function VisualEditorInner({ onClose }) {
|
|
|
282
282
|
[blocks, liveBlocks]
|
|
283
283
|
);
|
|
284
284
|
nietLiveRef.current = wijzigingen.iets;
|
|
285
|
-
const { publishDraft } = useEditor();
|
|
285
|
+
const { publishDraft, zetFotoVervanger } = useEditor();
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
zetFotoVervanger((field, blockKey) => {
|
|
288
|
+
if (blockKey) setImgPicker({ key: blockKey, field });
|
|
289
|
+
});
|
|
290
|
+
return () => zetFotoVervanger(null);
|
|
291
|
+
}, [zetFotoVervanger]);
|
|
286
292
|
const laatstGepubliceerd = useRef("");
|
|
287
293
|
useEffect(() => {
|
|
288
294
|
if (!draft) return;
|
|
@@ -365,8 +371,12 @@ function VisualEditorInner({ onClose }) {
|
|
|
365
371
|
setBlokknoppen((v) => v.length === 0 ? v : []);
|
|
366
372
|
return;
|
|
367
373
|
}
|
|
374
|
+
let veilig = veiligeBovenkant();
|
|
375
|
+
const herijk = () => {
|
|
376
|
+
veilig = veiligeBovenkant();
|
|
377
|
+
meet();
|
|
378
|
+
};
|
|
368
379
|
const meet = () => {
|
|
369
|
-
const veilig = veiligeBovenkant();
|
|
370
380
|
const gevonden = [];
|
|
371
381
|
for (const el of Array.from(document.querySelectorAll("[data-xicms-block]"))) {
|
|
372
382
|
const key = el.dataset.xicmsBlock;
|
|
@@ -377,6 +387,7 @@ function VisualEditorInner({ onClose }) {
|
|
|
377
387
|
const type = el.dataset.xicmsBlockType ?? "";
|
|
378
388
|
gevonden.push({
|
|
379
389
|
key,
|
|
390
|
+
type,
|
|
380
391
|
top: Math.max(r.top + 8, veilig + 8),
|
|
381
392
|
left: Math.max(r.right - 62, 8),
|
|
382
393
|
label: registryRef.current.get(type)?.label ?? type
|
|
@@ -389,12 +400,18 @@ function VisualEditorInner({ onClose }) {
|
|
|
389
400
|
return gevonden;
|
|
390
401
|
});
|
|
391
402
|
};
|
|
403
|
+
let frame = 0;
|
|
404
|
+
const meetGepland = () => {
|
|
405
|
+
cancelAnimationFrame(frame);
|
|
406
|
+
frame = requestAnimationFrame(meet);
|
|
407
|
+
};
|
|
392
408
|
meet();
|
|
393
|
-
window.addEventListener("scroll",
|
|
394
|
-
window.addEventListener("resize",
|
|
409
|
+
window.addEventListener("scroll", meetGepland, { capture: true, passive: true });
|
|
410
|
+
window.addEventListener("resize", herijk);
|
|
395
411
|
return () => {
|
|
396
|
-
|
|
397
|
-
window.removeEventListener("
|
|
412
|
+
cancelAnimationFrame(frame);
|
|
413
|
+
window.removeEventListener("scroll", meetGepland, { capture: true });
|
|
414
|
+
window.removeEventListener("resize", herijk);
|
|
398
415
|
};
|
|
399
416
|
}, [draft, displayBlocks, registryRef]);
|
|
400
417
|
const [productKnop, setProductKnop] = useState(null);
|
|
@@ -970,46 +987,120 @@ function VisualEditorInner({ onClose }) {
|
|
|
970
987
|
}
|
|
971
988
|
}
|
|
972
989
|
),
|
|
973
|
-
blokknoppen.map((b) =>
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
990
|
+
blokknoppen.map((b) => {
|
|
991
|
+
const i = blocks.findIndex((blok) => blok._key === b.key);
|
|
992
|
+
const isSymbool = b.type === "symbolRef";
|
|
993
|
+
return /* @__PURE__ */ jsxs("div", { className: "xicms-ve-blokknoppen", style: { top: b.top, left: b.left }, children: [
|
|
994
|
+
/* @__PURE__ */ jsx(
|
|
995
|
+
"button",
|
|
996
|
+
{
|
|
997
|
+
type: "button",
|
|
998
|
+
className: `xicms-ve-blokknop${b.key === selectedKey ? " is-on" : ""}`,
|
|
999
|
+
title: `Tekst van ${b.label} bewerken`,
|
|
1000
|
+
"aria-label": `Tekst van ${b.label} bewerken`,
|
|
1001
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1002
|
+
onClick: () => {
|
|
1003
|
+
wilInlineRef.current = true;
|
|
1004
|
+
setSelectedProduct(null);
|
|
1005
|
+
setSelectedKey(b.key);
|
|
1006
|
+
},
|
|
1007
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1008
|
+
/* @__PURE__ */ jsx("path", { d: "M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17v3z" }),
|
|
1009
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 6.5l3 3" })
|
|
1010
|
+
] })
|
|
1011
|
+
}
|
|
1012
|
+
),
|
|
1013
|
+
/* @__PURE__ */ jsx(
|
|
1014
|
+
"button",
|
|
1015
|
+
{
|
|
1016
|
+
type: "button",
|
|
1017
|
+
className: `xicms-ve-blokknop${b.key === selectedKey && panelOpen ? " is-on" : ""}`,
|
|
1018
|
+
title: `Instellingen van ${b.label}`,
|
|
1019
|
+
"aria-label": `Instellingen van ${b.label}`,
|
|
1020
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1021
|
+
onClick: () => {
|
|
1022
|
+
setSelectedProduct(null);
|
|
1023
|
+
setSelectedKey(b.key);
|
|
1024
|
+
setPanelOpen(true);
|
|
1025
|
+
},
|
|
1026
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1027
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
1028
|
+
/* @__PURE__ */ jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
1029
|
+
] })
|
|
1030
|
+
}
|
|
1031
|
+
),
|
|
1032
|
+
i >= 0 && /* @__PURE__ */ jsxs("span", { className: "xicms-ve-blokknoppen__meer", children: [
|
|
1033
|
+
/* @__PURE__ */ jsx(
|
|
1034
|
+
"button",
|
|
1035
|
+
{
|
|
1036
|
+
type: "button",
|
|
1037
|
+
className: "xicms-ve-blokknop",
|
|
1038
|
+
title: "Blok omhoog",
|
|
1039
|
+
"aria-label": `${b.label} omhoog`,
|
|
1040
|
+
disabled: i === 0,
|
|
1041
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1042
|
+
onClick: () => move(i, -1),
|
|
1043
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 19V5M5 12l7-7 7 7" }) })
|
|
1044
|
+
}
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ jsx(
|
|
1047
|
+
"button",
|
|
1048
|
+
{
|
|
1049
|
+
type: "button",
|
|
1050
|
+
className: "xicms-ve-blokknop",
|
|
1051
|
+
title: "Blok omlaag",
|
|
1052
|
+
"aria-label": `${b.label} omlaag`,
|
|
1053
|
+
disabled: i === blocks.length - 1,
|
|
1054
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1055
|
+
onClick: () => move(i, 1),
|
|
1056
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M19 12l-7 7-7-7" }) })
|
|
1057
|
+
}
|
|
1058
|
+
),
|
|
1059
|
+
/* @__PURE__ */ jsx(
|
|
1060
|
+
"button",
|
|
1061
|
+
{
|
|
1062
|
+
type: "button",
|
|
1063
|
+
className: "xicms-ve-blokknop",
|
|
1064
|
+
title: "Blok dupliceren",
|
|
1065
|
+
"aria-label": `${b.label} dupliceren`,
|
|
1066
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1067
|
+
onClick: () => duplicate(i),
|
|
1068
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1069
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
1070
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15V5a2 2 0 0 1 2-2h10" })
|
|
1071
|
+
] })
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
isSymbool && /* @__PURE__ */ jsx(
|
|
1075
|
+
"button",
|
|
1076
|
+
{
|
|
1077
|
+
type: "button",
|
|
1078
|
+
className: "xicms-ve-blokknop",
|
|
1079
|
+
title: "Symbool loskoppelen (wordt een losse kopie)",
|
|
1080
|
+
"aria-label": `${b.label} loskoppelen`,
|
|
1081
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1082
|
+
onClick: () => void detachSymbol(i),
|
|
1083
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1084
|
+
/* @__PURE__ */ jsx("path", { d: "M9 12h6M8 7a4 4 0 0 0 0 8M16 7a4 4 0 0 1 0 8" }),
|
|
1085
|
+
/* @__PURE__ */ jsx("path", { d: "M3 3l18 18" })
|
|
1086
|
+
] })
|
|
1087
|
+
}
|
|
1088
|
+
),
|
|
1089
|
+
/* @__PURE__ */ jsx(
|
|
1090
|
+
"button",
|
|
1091
|
+
{
|
|
1092
|
+
type: "button",
|
|
1093
|
+
className: "xicms-ve-blokknop xicms-ve-blokknop--gevaar",
|
|
1094
|
+
title: "Blok verwijderen",
|
|
1095
|
+
"aria-label": `${b.label} verwijderen`,
|
|
1096
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1097
|
+
onClick: () => void remove(i),
|
|
1098
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14" }) })
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
] })
|
|
1102
|
+
] }, b.key);
|
|
1103
|
+
}),
|
|
1013
1104
|
spots.map((s, i) => /* @__PURE__ */ jsx(
|
|
1014
1105
|
"button",
|
|
1015
1106
|
{
|