@lls/vivi 24.1.7-0b548db8 → 24.1.7-13f884fc

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.
@@ -83,68 +83,6 @@
83
83
  }
84
84
  }
85
85
 
86
- /* css-modules:css-modules://O33TtB9PRCTwb4sTLsvHxRLVlvvgk7rVn2k8rnGvKak.css */
87
- .vv-s56jqa-editGrid {
88
- flex-direction: column;
89
- width: 100%;
90
- display: flex;
91
- }
92
- .vv-s56jqa-editGrid .vv-s56jqa-layout {
93
- box-sizing: border-box;
94
- flex-direction: column;
95
- gap: 8px;
96
- width: 100%;
97
- padding: 8px;
98
- display: flex;
99
- }
100
- .vv-s56jqa-editGrid .vv-s56jqa-illu {
101
- border: 4px solid #002747;
102
- border-radius: 8px;
103
- flex: 2;
104
- min-width: 0;
105
- position: relative;
106
- }
107
- .vv-s56jqa-editGrid .vv-s56jqa-illu > img {
108
- aspect-ratio: 3149 / 2126;
109
- width: 100%;
110
- display: block;
111
- }
112
- .vv-s56jqa-editGrid .vv-s56jqa-illu .vv-s56jqa-pictureZone {
113
- top: var(--v-picturezone-y);
114
- left: var(--v-picturezone-x);
115
- width: var(--v-picturezone-w);
116
- height: var(--v-picturezone-h);
117
- border: 5px solid green;
118
- position: absolute;
119
- }
120
- .vv-s56jqa-editGrid .vv-s56jqa-interface {
121
- box-sizing: border-box;
122
- background: #fff;
123
- border-radius: 8px;
124
- flex: 1;
125
- min-width: 200px;
126
- padding: 8px;
127
- box-shadow: 0 4px 4px #04224d1f;
128
- }
129
- .vv-s56jqa-viewGrid {
130
- width: 100%;
131
- }
132
- .vv-s56jqa-viewGrid .vv-s56jqa-illu {
133
- position: relative;
134
- }
135
- .vv-s56jqa-viewGrid .vv-s56jqa-illu > img {
136
- aspect-ratio: 3149 / 2126;
137
- width: 100%;
138
- }
139
- .vv-s56jqa-viewGrid .vv-s56jqa-illu .vv-s56jqa-pictureZone {
140
- top: var(--v-picturezone-y);
141
- left: var(--v-picturezone-x);
142
- width: var(--v-picturezone-w);
143
- height: var(--v-picturezone-h);
144
- border: 5px solid green;
145
- position: absolute;
146
- }
147
-
148
86
  /* css-modules:css-modules://J5_xl3NfC9uUzCf8dvnv2lVDvTF6x61j2B3MI8uRK3U.css */
149
87
  .vv--ZTaFW-divSearch {
150
88
  cursor: pointer;
package/lib/index.js CHANGED
@@ -58,8 +58,7 @@ var init_layoutTemplate = __esm({
58
58
 
59
59
  // src/utils/template.ts
60
60
  import _3 from "lodash/fp.js";
61
- import { nanoid } from "nanoid";
62
- var getDocumentByUuid, getDepth, parseErrorsInContentMd, getDocumentUniqueId, getMissingUuid, getMissingId, updateTemplate, addDocumentToTemplate, deleteDocumentFromTemplate;
61
+ var getDocumentByUuid, getDepth, parseErrorsInContentMd, getDocumentUniqueId, getMissingUuid, getMissingId, updateTemplate, concatAttribs;
63
62
  var init_template = __esm({
64
63
  "src/utils/template.ts"() {
65
64
  "use strict";
@@ -92,31 +91,19 @@ var init_template = __esm({
92
91
  return node;
93
92
  });
94
93
  };
95
- addDocumentToTemplate = (template, partialDoc) => {
96
- const uuid = nanoid();
97
- const children = [
98
- ...template.children ?? [],
99
- {
100
- // id: newCardId(), //TODO vraisemblablement inutile. A supprimer si création de page côté BE ok sans
101
- uuid,
102
- contentMd: ""
94
+ concatAttribs = (obj, ignoredAttrs) => {
95
+ let s = "";
96
+ for (const key in obj) {
97
+ if (ignoredAttrs.has(key))
98
+ continue;
99
+ if (key === "src" || key === "placeholder") {
100
+ const backSrcKey = _3.getOr(obj[key], 1, obj[key].match(/(?:.*)?:\/\/(?:.*)?\/(.*)/));
101
+ s += key + backSrcKey;
102
+ } else {
103
+ s += key + obj[key];
103
104
  }
104
- ];
105
- const layouts = {
106
- primary: [
107
- ...template?.layouts?.primary ?? [],
108
- {
109
- id: uuid,
110
- ...partialDoc
111
- }
112
- ]
113
- };
114
- return { ...template, children, layouts };
115
- };
116
- deleteDocumentFromTemplate = (template, docUuid) => {
117
- const children = template.children?.filter((child) => child.uuid !== docUuid) ?? [];
118
- const layouts = { primary: template.layouts?.primary?.filter((doc) => doc.id !== docUuid) ?? [] };
119
- return { ...template, children, layouts };
105
+ }
106
+ return s;
120
107
  };
121
108
  }
122
109
  });
@@ -306,7 +293,7 @@ var init_src_components_core_DocumentToolbar = __esm({
306
293
  "tmp_esbuild/_src_components_core_DocumentToolbar.module.css"() {
307
294
  "use strict";
308
295
  init_v55PWB9nAJQuRkGNDb4PSzswK0IT8X6YlIgXJ4Px4dA();
309
- src_components_core_DocumentToolbar_default = { "toggleMenuButton": "vv-JySIna-toggleMenuButton", "toolbar": "vv-JySIna-toolbar", "parentToolbar": "vv-JySIna-parentToolbar" };
296
+ src_components_core_DocumentToolbar_default = { "parentToolbar": "vv-JySIna-parentToolbar", "toggleMenuButton": "vv-JySIna-toggleMenuButton", "toolbar": "vv-JySIna-toolbar" };
310
297
  }
311
298
  });
312
299
 
@@ -399,7 +386,8 @@ var init_constants = __esm({
399
386
 
400
387
  // src/utils/string.ts
401
388
  import _8 from "lodash/fp.js";
402
- var OPENING_TAG_CHAR, ESCAPED_OPENING_TAG_CHAR, CLOSING_TAG_CHAR, removeTrailingNewLines, escapeTags, escapeTagContent;
389
+ import murmur from "murmurhash";
390
+ var OPENING_TAG_CHAR, ESCAPED_OPENING_TAG_CHAR, CLOSING_TAG_CHAR, removeTrailingNewLines, escapeTags, escapeTagContent, hash;
403
391
  var init_string = __esm({
404
392
  "src/utils/string.ts"() {
405
393
  "use strict";
@@ -424,6 +412,7 @@ var init_string = __esm({
424
412
  }
425
413
  return out;
426
414
  };
415
+ hash = (s) => murmur(s).toString(16);
427
416
  }
428
417
  });
429
418
 
@@ -522,164 +511,14 @@ var init_DocumentHtml = __esm({
522
511
  }
523
512
  });
524
513
 
525
- // css-modules:css-modules://O33TtB9PRCTwb4sTLsvHxRLVlvvgk7rVn2k8rnGvKak.css
526
- var init_O33TtB9PRCTwb4sTLsvHxRLVlvvgk7rVn2k8rnGvKak = __esm({
527
- "css-modules:css-modules://O33TtB9PRCTwb4sTLsvHxRLVlvvgk7rVn2k8rnGvKak.css"() {
528
- }
529
- });
530
-
531
- // tmp_esbuild/_src_components_primarygrid_Grid.module.css
532
- var src_components_primarygrid_Grid_default;
533
- var init_src_components_primarygrid_Grid = __esm({
534
- "tmp_esbuild/_src_components_primarygrid_Grid.module.css"() {
535
- "use strict";
536
- init_O33TtB9PRCTwb4sTLsvHxRLVlvvgk7rVn2k8rnGvKak();
537
- src_components_primarygrid_Grid_default = { "viewGrid": "vv-s56jqa-viewGrid", "pictureZone": "vv-s56jqa-pictureZone", "layout": "vv-s56jqa-layout", "illu": "vv-s56jqa-illu", "editGrid": "vv-s56jqa-editGrid", "interface": "vv-s56jqa-interface" };
538
- }
539
- });
540
-
541
- // src/components/primarygrid/Grid.module.css
542
- var init_Grid = __esm({
543
- "src/components/primarygrid/Grid.module.css"() {
544
- "use strict";
545
- init_src_components_primarygrid_Grid();
546
- }
547
- });
548
-
549
- // src/utils/url.ts
550
- var asLlsWebp;
551
- var init_url = __esm({
552
- "src/utils/url.ts"() {
553
- "use strict";
554
- asLlsWebp = (url) => {
555
- return /https:\/\/assets(-mid|-lite|-dev|-dev-mid|-dev-lite)?\.lls\.fr.*\.(png|jpe?g)$/.test(url) ? url.replace(/\.(png|jpe?g)$/, ".webp") : url;
556
- };
557
- }
558
- });
559
-
560
- // src/components/primarygrid/Grid.tsx
561
- import { useEffect as useEffect2, useState as useState2 } from "react";
562
- import { Button as Button2, TextField } from "@lls/lls-kit";
563
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
564
- var EditGrid, ViewGrid, PrimaryGrid, Grid_default;
565
- var init_Grid2 = __esm({
566
- "src/components/primarygrid/Grid.tsx"() {
514
+ // src/components/Div.tsx
515
+ import { jsx as jsx3 } from "react/jsx-runtime";
516
+ var Div, Div_default;
517
+ var init_Div = __esm({
518
+ "src/components/Div.tsx"() {
567
519
  "use strict";
568
- init_store();
569
- init_mode();
570
- init_Grid();
571
- init_url();
572
- EditGrid = ({ children, picture }) => {
573
- const { addPicture, addDocument, updateLayouts, deleteDocument, layouts } = useReadMdRendererProps([
574
- "layouts",
575
- "addPicture",
576
- "addDocument",
577
- "updateLayouts",
578
- "deleteDocument"
579
- ]);
580
- const [picValue, setPicValue] = useState2(picture);
581
- const [layoutItems, setLayoutItems] = useState2({ items: layouts?.primary ?? [], draft: false });
582
- useEffect2(() => {
583
- setLayoutItems({ items: layouts?.primary ?? [], draft: false });
584
- }, [layouts?.primary]);
585
- const onChangePicture = () => {
586
- addPicture(picValue ?? "");
587
- };
588
- const onChangeLayoutItem = (id, prop, value) => {
589
- setLayoutItems((prev) => ({ items: prev.items.map((item) => item.id === id ? { ...item, [prop]: value } : item), draft: true }));
590
- };
591
- useEffect2(() => {
592
- if (!layoutItems.draft)
593
- return;
594
- const timeoutId = setTimeout(() => {
595
- updateLayouts({ primary: layoutItems.items });
596
- }, 1e3);
597
- return () => {
598
- clearTimeout(timeoutId);
599
- };
600
- }, [updateLayouts, layoutItems]);
601
- return /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.editGrid, children: [
602
- /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.layout, children: [
603
- /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.interface, children: [
604
- /* @__PURE__ */ jsx3("h3", { children: "Interface d'\xE9dition" }),
605
- /* @__PURE__ */ jsx3(TextField, { type: "text", label: "url de la double page", value: picValue, onChange: setPicValue }),
606
- /* @__PURE__ */ jsx3(Button2, { onClick: onChangePicture, children: "Submit" }),
607
- /* @__PURE__ */ jsx3("hr", {}),
608
- /* @__PURE__ */ jsx3(Button2, { onClick: () => addDocument({ x: 50, y: 50, w: 100, h: 100 }), children: "Add document" }),
609
- layoutItems.items.map((layoutItem, index) => {
610
- return /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.zone, children: [
611
- /* @__PURE__ */ jsxs3("h3", { children: [
612
- "Document ",
613
- index + 1
614
- ] }),
615
- ["x", "y", "w", "h"].map((prop) => {
616
- return /* @__PURE__ */ jsx3(
617
- TextField,
618
- {
619
- type: "number",
620
- label: prop,
621
- value: layoutItem[prop],
622
- width: "100px",
623
- onChange: (value) => onChangeLayoutItem(layoutItem.id, prop, value)
624
- },
625
- prop
626
- );
627
- }),
628
- /* @__PURE__ */ jsx3(Button2, { theme: "error", onClick: () => deleteDocument(layoutItem.id), children: "Remove" })
629
- ] }, layoutItem.id);
630
- })
631
- ] }),
632
- /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.illu, children: [
633
- picture && /* @__PURE__ */ jsx3("img", { alt: "illustration", src: asLlsWebp(picture) }),
634
- layoutItems.items.map((layoutItem) => {
635
- return /* @__PURE__ */ jsx3(
636
- "div",
637
- {
638
- className: src_components_primarygrid_Grid_default.pictureZone,
639
- style: {
640
- "--v-picturezone-x": `${layoutItem.x}px`,
641
- "--v-picturezone-y": `${layoutItem.y}px`,
642
- "--v-picturezone-w": `${layoutItem.w}px`,
643
- "--v-picturezone-h": `${layoutItem.h}px`
644
- }
645
- },
646
- layoutItem.id
647
- );
648
- })
649
- ] })
650
- ] }),
651
- /* @__PURE__ */ jsx3("div", { className: src_components_primarygrid_Grid_default.docs, children: /* @__PURE__ */ jsx3("b", { children }) })
652
- ] });
653
- };
654
- ViewGrid = ({ children, picture }) => {
655
- const { layouts } = useReadMdRendererProps(["layouts"]);
656
- return /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.viewGrid, children: [
657
- /* @__PURE__ */ jsxs3("div", { className: src_components_primarygrid_Grid_default.illu, children: [
658
- picture && /* @__PURE__ */ jsx3("img", { alt: "illustration", src: asLlsWebp(picture) }),
659
- layouts?.primary?.map((layoutItem) => {
660
- return /* @__PURE__ */ jsx3(
661
- "div",
662
- {
663
- className: src_components_primarygrid_Grid_default.pictureZone,
664
- style: {
665
- "--v-picturezone-x": `${layoutItem.x}px`,
666
- "--v-picturezone-y": `${layoutItem.y}px`,
667
- "--v-picturezone-w": `${layoutItem.w}px`,
668
- "--v-picturezone-h": `${layoutItem.h}px`
669
- }
670
- },
671
- layoutItem.id
672
- );
673
- })
674
- ] }),
675
- /* @__PURE__ */ jsx3("div", { className: src_components_primarygrid_Grid_default.docs, children: /* @__PURE__ */ jsx3("b", { children }) })
676
- ] });
677
- };
678
- PrimaryGrid = (props) => {
679
- const { mode } = useReadMdRendererProps(["mode"]);
680
- return isEditMode(mode) ? /* @__PURE__ */ jsx3(EditGrid, { ...props }) : /* @__PURE__ */ jsx3(ViewGrid, { ...props });
681
- };
682
- Grid_default = PrimaryGrid;
520
+ Div = ({ children }) => /* @__PURE__ */ jsx3("b", { children });
521
+ Div_default = Div;
683
522
  }
684
523
  });
685
524
 
@@ -688,8 +527,8 @@ import React3, { memo, useRef } from "react";
688
527
  import HtmlToReact from "html-to-react";
689
528
  import _9 from "lodash/fp.js";
690
529
  import { cx as cx2 } from "@lls/utils";
691
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
692
- var htmlToReactParser, processNodeDefinitions, MemoToolbar, DocumentHtml, getProcessingInstructions, MdRenderer, DocumentHtml_default;
530
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
531
+ var htmlToReactParser, processNodeDefinitions, MemoToolbar, DocumentHtml, getProcessNode, getProcessingInstructions, MdRenderer, DocumentHtml_default;
693
532
  var init_DocumentHtml2 = __esm({
694
533
  "src/components/core/DocumentHtml.tsx"() {
695
534
  "use strict";
@@ -699,9 +538,10 @@ var init_DocumentHtml2 = __esm({
699
538
  init_dom();
700
539
  init_memo();
701
540
  init_string();
541
+ init_template();
702
542
  init_ErrorBoundary2();
703
543
  init_DocumentHtml();
704
- init_Grid2();
544
+ init_Div();
705
545
  htmlToReactParser = new HtmlToReact.Parser({
706
546
  recognizeSelfClosing: true
707
547
  });
@@ -727,7 +567,7 @@ var init_DocumentHtml2 = __esm({
727
567
  DocumentHtml = ({ toolbarProps: props, mdRendererProps, docJson, children: docChildren }) => {
728
568
  const { mode } = useReadMdRendererProps(["mode"]);
729
569
  const documentRef = useRef(null);
730
- return /* @__PURE__ */ jsxs4(
570
+ return /* @__PURE__ */ jsxs3(
731
571
  "div",
732
572
  {
733
573
  ref: documentRef,
@@ -742,16 +582,32 @@ var init_DocumentHtml2 = __esm({
742
582
  }
743
583
  );
744
584
  };
745
- getProcessingInstructions = ({ docChildren }) => {
585
+ getProcessNode = (handler, nodeName) => (node, children, siblingKey) => {
586
+ if (node.attribs)
587
+ node.attribs.className = `${VIVI_COMPONENT_CLASSNAME_PREFIX}${nodeName}`;
588
+ return handler(node, children, siblingKey);
589
+ };
590
+ getProcessingInstructions = (props) => {
591
+ const tagsIndex = {};
592
+ const ignoredAttrs = /* @__PURE__ */ new Set(["dataAttributes", "className"]);
593
+ const keyToDupe = {};
746
594
  const tag = (nodeName, handler) => ({
747
595
  shouldProcessNode: _9.matchesProperty("name", nodeName),
748
- processNode: handler
596
+ processNode: getProcessNode((node, children) => {
597
+ tagsIndex[nodeName] = (tagsIndex[nodeName] ?? -1) + 1;
598
+ const key = node.name + concatAttribs(node.attribs, ignoredAttrs);
599
+ const hkey = hash(key);
600
+ const uniqKey = (keyToDupe[hkey] || 0) + 1;
601
+ keyToDupe[hkey] = uniqKey;
602
+ return handler(node, children, `${hkey}-${uniqKey}`);
603
+ }, nodeName)
749
604
  });
750
- const shortTag = (name, Component, props = {}, mapAttributes = _9.identity) => {
751
- return tag(name, (node, children, key) => /* @__PURE__ */ jsx4(Component, { ...mapAttributes(node.attribs), children, ...props }, key));
605
+ const shortTag = (name, Component, props2 = {}, mapAttributes = _9.identity) => {
606
+ return tag(name, (node, children, key) => /* @__PURE__ */ jsx4(Component, { ...mapAttributes(node.attribs), children, ...props2 }, key));
752
607
  };
753
608
  return [
754
- tag("primarygrid", (node) => /* @__PURE__ */ jsx4(Grid_default, { ...node.attribs, children: docChildren }, "grid")),
609
+ shortTag("div", Div_default),
610
+ // Bad, bad, not good!
755
611
  {
756
612
  shouldProcessNode: (node) => {
757
613
  if (node.type === "text" && _9.trim(node.data) === "") {
@@ -792,7 +648,7 @@ var init_src_components_core_Document = __esm({
792
648
  "tmp_esbuild/_src_components_core_Document.module.css"() {
793
649
  "use strict";
794
650
  init_J5_xl3NfC9uUzCf8dvnv2lVDvTF6x61j2B3MI8uRK3U();
795
- src_components_core_Document_default = { "rootDocument": "vv--ZTaFW-rootDocument", "divSearch": "vv--ZTaFW-divSearch" };
651
+ src_components_core_Document_default = { "divSearch": "vv--ZTaFW-divSearch", "rootDocument": "vv--ZTaFW-rootDocument" };
796
652
  }
797
653
  });
798
654
 
@@ -878,7 +734,7 @@ var init_src_components_core_viewer_ViewerMd = __esm({
878
734
  "tmp_esbuild/_src_components_core_viewer_ViewerMd.module.css"() {
879
735
  "use strict";
880
736
  init_JpW1nUt7xW7qwOpENEm_oylMzow4l0aKU2OuIG0bXI();
881
- src_components_core_viewer_ViewerMd_default = { "viewer": "vv-j3jlxa-viewer kit-themecss", "viewerInner": "vv-j3jlxa-viewerInner" };
737
+ src_components_core_viewer_ViewerMd_default = { "viewerInner": "vv-j3jlxa-viewerInner", "viewer": "vv-j3jlxa-viewer kit-themecss" };
882
738
  }
883
739
  });
884
740
 
@@ -907,21 +763,9 @@ var init_ViewerMd2 = __esm({
907
763
  init_Codemirror();
908
764
  init_ViewerMd();
909
765
  init_constants();
910
- getMdRendererProps = _11.pick(["isOffline", "isTouchable", "wasSsrRendered", "picture"]);
766
+ getMdRendererProps = _11.pick(["isOffline", "isTouchable", "wasSsrRendered"]);
911
767
  ViewerMd = React5.forwardRef(
912
- ({
913
- template = {},
914
- addPicture = _11.noop,
915
- addDocument = _11.noop,
916
- updateLayouts = _11.noop,
917
- deleteDocument = _11.noop,
918
- onChange = _11.noop,
919
- sizeIndex = 2,
920
- fontFamily = "LatoWeb",
921
- mode = "view",
922
- isDysMode = false,
923
- ...props
924
- }, ref) => {
768
+ ({ template = {}, onChange = _11.noop, sizeIndex = 2, fontFamily = "LatoWeb", mode = "view", isDysMode = false, ...props }, ref) => {
925
769
  const pageId = _11.get("id", template);
926
770
  const onChangeCallbackRef = useRef2(_11.noop);
927
771
  const innerViewerRef = useRef2(null);
@@ -936,20 +780,26 @@ var init_ViewerMd2 = __esm({
936
780
  onChangeCallbackRef.current = (doc, ctx) => {
937
781
  onChange(updateTemplate(template, doc), ctx);
938
782
  };
939
- const { deleteRightResponses, openEditor, openMetadataEditor } = props;
783
+ const { addCard, addLayoutToRoot, onChangeLayout, onRemoveLayout, deleteCard, deleteRightResponses, openEditor, openMetadataEditor } = props;
940
784
  const isPrint2 = isPrint();
941
785
  const mdRendererProps = useMemo(() => {
942
786
  return _11.flow(
943
787
  JSON.parse,
944
788
  _11.assign({
945
789
  // there should only be FUNCTIONS here
946
- addPicture,
947
- addDocument,
948
- updateLayouts,
949
- deleteDocument
790
+ addCard,
791
+ addLayoutToRoot,
792
+ onChangeLayout,
793
+ onRemoveLayout
950
794
  })
951
795
  )(hashMdRendererProps);
952
- }, [hashMdRendererProps, addPicture, addDocument, updateLayouts, deleteDocument]);
796
+ }, [
797
+ hashMdRendererProps,
798
+ addCard,
799
+ addLayoutToRoot,
800
+ onChangeLayout,
801
+ onRemoveLayout
802
+ ]);
953
803
  const onDocChange = useCallback2((doc) => {
954
804
  onChangeCallbackRef.current(doc);
955
805
  }, []);
@@ -967,12 +817,12 @@ var init_ViewerMd2 = __esm({
967
817
  });
968
818
  const toolbarProps = useMemo(() => {
969
819
  return {
970
- deleteDocument,
820
+ deleteCard,
971
821
  deleteRightResponses,
972
822
  openEditor,
973
823
  openMetadataEditor
974
824
  };
975
- }, [deleteDocument, deleteRightResponses, openEditor, openMetadataEditor]);
825
+ }, [deleteCard, deleteRightResponses, openEditor, openMetadataEditor]);
976
826
  return /* @__PURE__ */ jsx6(
977
827
  "div",
978
828
  {
@@ -1000,40 +850,23 @@ var init_EditViewerMd = __esm({
1000
850
  "src/components/core/editor/EditViewerMd.tsx"() {
1001
851
  "use strict";
1002
852
  init_ViewerMd2();
1003
- init_template();
1004
- EditViewerMd = React6.forwardRef(({ template, onChange, ...props }, ref) => {
1005
- const addDocument = useCallback3(
1006
- (docInfos) => {
1007
- onChange((template2) => addDocumentToTemplate(template2, docInfos));
1008
- },
1009
- [onChange]
1010
- );
1011
- const updateLayouts = useCallback3(
1012
- (newLayouts) => {
1013
- onChange((template2) => ({ ...template2, layouts: newLayouts }));
1014
- },
1015
- [onChange]
1016
- );
1017
- const deleteDocument = useCallback3(
1018
- (uuid) => {
1019
- onChange((template2) => deleteDocumentFromTemplate(template2, uuid));
1020
- },
1021
- [onChange]
1022
- );
853
+ EditViewerMd = React6.forwardRef(({ template, setTemplate, isEditorOpen, ...props }, ref) => {
854
+ const addCard = useCallback3(() => {
855
+ }, []);
856
+ const addLayoutToRoot = useCallback3(() => {
857
+ }, []);
858
+ const deleteCard = useCallback3(() => {
859
+ }, []);
1023
860
  const deleteRightResponses = useCallback3(() => {
1024
861
  }, []);
1025
- const addPicture = (picture) => {
1026
- onChange((prev) => ({ ...prev, contentMd: `<primarygrid picture="${picture}" />` }));
1027
- };
1028
862
  return /* @__PURE__ */ jsx7(
1029
863
  ViewerMd_default,
1030
864
  {
1031
865
  template,
1032
- addDocument,
1033
- updateLayouts,
1034
- deleteDocument,
866
+ addCard,
867
+ addLayoutToRoot,
868
+ deleteCard,
1035
869
  deleteRightResponses,
1036
- addPicture,
1037
870
  mode: "edit",
1038
871
  ref,
1039
872
  ...props
@@ -1045,14 +878,14 @@ var init_EditViewerMd = __esm({
1045
878
  });
1046
879
 
1047
880
  // src/hooks/useClientMounted.tsx
1048
- import { useEffect as useEffect3, useState as useState3 } from "react";
881
+ import { useEffect as useEffect2, useState as useState2 } from "react";
1049
882
  var useClientMounted, useClientMounted_default;
1050
883
  var init_useClientMounted = __esm({
1051
884
  "src/hooks/useClientMounted.tsx"() {
1052
885
  "use strict";
1053
886
  useClientMounted = () => {
1054
- const [mounted, setMounted] = useState3(false);
1055
- useEffect3(() => {
887
+ const [mounted, setMounted] = useState2(false);
888
+ useEffect2(() => {
1056
889
  setMounted(true);
1057
890
  }, []);
1058
891
  return mounted;
@@ -1105,7 +938,7 @@ __export(CodemirrorEditor_browser_exports, {
1105
938
  default: () => CodemirrorEditor_browser_default
1106
939
  });
1107
940
  import _12 from "lodash/fp.js";
1108
- import { useEffect as useEffect4, useRef as useRef3, useState as useState4 } from "react";
941
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
1109
942
  import { jsx as jsx8 } from "react/jsx-runtime";
1110
943
  var TAGS, completeAfter, completeIfAfterLt, completeIfInTag, xmlValidator, CodemirrorEditor, CodemirrorEditor_browser_default;
1111
944
  var init_CodemirrorEditor_browser2 = __esm({
@@ -1169,8 +1002,8 @@ var init_CodemirrorEditor_browser2 = __esm({
1169
1002
  onError = _12.noop
1170
1003
  }) => {
1171
1004
  const textarea = useRef3(null);
1172
- const [editor, setEditor] = useState4(null);
1173
- useEffect4(() => {
1005
+ const [editor, setEditor] = useState3(null);
1006
+ useEffect3(() => {
1174
1007
  const fn = async () => {
1175
1008
  const codemirror = (await import("codemirror").then(lazyInterop)).default;
1176
1009
  codemirror.registerHelper("lint", "xml", (text) => xmlValidator(codemirror, text, onError));
@@ -1202,7 +1035,7 @@ var init_CodemirrorEditor_browser2 = __esm({
1202
1035
  };
1203
1036
  fn();
1204
1037
  }, [readOnly, keyMap, componentDidMount, onError]);
1205
- useEffect4(() => {
1038
+ useEffect3(() => {
1206
1039
  if (!editor) {
1207
1040
  return;
1208
1041
  }
@@ -1266,13 +1099,13 @@ var init_EditorHeaderModal = __esm({
1266
1099
  });
1267
1100
 
1268
1101
  // src/components/core/editor/EditorHeaderModal.tsx
1269
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
1102
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
1270
1103
  var EditorHeaderModal, EditorHeaderModal_default;
1271
1104
  var init_EditorHeaderModal2 = __esm({
1272
1105
  "src/components/core/editor/EditorHeaderModal.tsx"() {
1273
1106
  "use strict";
1274
1107
  init_EditorHeaderModal();
1275
- EditorHeaderModal = ({ onClick }) => /* @__PURE__ */ jsxs5("div", { children: [
1108
+ EditorHeaderModal = ({ onClick }) => /* @__PURE__ */ jsxs4("div", { children: [
1276
1109
  /* @__PURE__ */ jsx10(
1277
1110
  "div",
1278
1111
  {
@@ -1309,7 +1142,7 @@ var init_EditorHeaderModal2 = __esm({
1309
1142
  children: "Secondaire"
1310
1143
  }
1311
1144
  ),
1312
- /* @__PURE__ */ jsxs5(
1145
+ /* @__PURE__ */ jsxs4(
1313
1146
  "div",
1314
1147
  {
1315
1148
  className: src_components_core_editor_EditorHeaderModal_default.header,
@@ -1390,7 +1223,7 @@ var init_EditorListModal = __esm({
1390
1223
  });
1391
1224
 
1392
1225
  // src/components/core/editor/EditorListModal.tsx
1393
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
1226
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1394
1227
  var generateList, EditorListModal, EditorListModal_default;
1395
1228
  var init_EditorListModal2 = __esm({
1396
1229
  "src/components/core/editor/EditorListModal.tsx"() {
@@ -1403,7 +1236,7 @@ var init_EditorListModal2 = __esm({
1403
1236
  <li></li>
1404
1237
  </ul>
1405
1238
  `;
1406
- EditorListModal = ({ onClick }) => /* @__PURE__ */ jsxs6("div", { children: [
1239
+ EditorListModal = ({ onClick }) => /* @__PURE__ */ jsxs5("div", { children: [
1407
1240
  /* @__PURE__ */ jsx11("ul", { className: src_components_core_editor_EditorListModal_default.ul, onClick: () => onClick(() => generateList("disc")), children: /* @__PURE__ */ jsx11("li", {}) }),
1408
1241
  /* @__PURE__ */ jsx11("ul", { className: src_components_core_editor_EditorListModal_default.ul, type: "circle", onClick: () => onClick(() => generateList("circle")), children: /* @__PURE__ */ jsx11("li", {}) }),
1409
1242
  /* @__PURE__ */ jsx11("ul", { className: src_components_core_editor_EditorListModal_default.ul, type: "square", onClick: () => onClick(() => generateList("square")), children: /* @__PURE__ */ jsx11("li", {}) })
@@ -1437,13 +1270,13 @@ var init_EditorMathsModal = __esm({
1437
1270
  });
1438
1271
 
1439
1272
  // src/components/core/editor/EditorMathsModal.tsx
1440
- import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
1273
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1441
1274
  var EditorMathsModal, EditorMathsModal_default;
1442
1275
  var init_EditorMathsModal2 = __esm({
1443
1276
  "src/components/core/editor/EditorMathsModal.tsx"() {
1444
1277
  "use strict";
1445
1278
  init_EditorMathsModal();
1446
- EditorMathsModal = ({ onClick }) => /* @__PURE__ */ jsxs7("div", { children: [
1279
+ EditorMathsModal = ({ onClick }) => /* @__PURE__ */ jsxs6("div", { children: [
1447
1280
  /* @__PURE__ */ jsx12("div", { className: src_components_core_editor_EditorMathsModal_default.mathsElement, onClick: () => onClick((selectedText) => `<math>${selectedText}</math>`), children: "KaTeX" }),
1448
1281
  /* @__PURE__ */ jsx12("div", { className: src_components_core_editor_EditorMathsModal_default.mathsElement, onClick: () => onClick((selectedText) => `\\text{${selectedText}}`), children: "\\text {...}" }),
1449
1282
  /* @__PURE__ */ jsx12("div", { className: src_components_core_editor_EditorMathsModal_default.mathsElement, onClick: () => onClick((selectedText) => `<python inline="true">${selectedText}</python>`), children: "python" }),
@@ -1478,7 +1311,7 @@ var init_EditorOrderedListModal = __esm({
1478
1311
  });
1479
1312
 
1480
1313
  // src/components/core/editor/EditorOrderedListModal.tsx
1481
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1314
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1482
1315
  var generateList2, EditorOrderedListModal, EditorOrderedListModal_default;
1483
1316
  var init_EditorOrderedListModal2 = __esm({
1484
1317
  "src/components/core/editor/EditorOrderedListModal.tsx"() {
@@ -1491,28 +1324,28 @@ var init_EditorOrderedListModal2 = __esm({
1491
1324
  <li></li>
1492
1325
  </ol>
1493
1326
  `;
1494
- EditorOrderedListModal = ({ onClick }) => /* @__PURE__ */ jsxs8("div", { children: [
1495
- /* @__PURE__ */ jsxs8("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "1", onClick: () => onClick(() => generateList2("1")), children: [
1327
+ EditorOrderedListModal = ({ onClick }) => /* @__PURE__ */ jsxs7("div", { children: [
1328
+ /* @__PURE__ */ jsxs7("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "1", onClick: () => onClick(() => generateList2("1")), children: [
1496
1329
  /* @__PURE__ */ jsx13("li", {}),
1497
1330
  /* @__PURE__ */ jsx13("li", {}),
1498
1331
  /* @__PURE__ */ jsx13("li", {})
1499
1332
  ] }),
1500
- /* @__PURE__ */ jsxs8("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "a", onClick: () => onClick(() => generateList2("a")), children: [
1333
+ /* @__PURE__ */ jsxs7("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "a", onClick: () => onClick(() => generateList2("a")), children: [
1501
1334
  /* @__PURE__ */ jsx13("li", {}),
1502
1335
  /* @__PURE__ */ jsx13("li", {}),
1503
1336
  /* @__PURE__ */ jsx13("li", {})
1504
1337
  ] }),
1505
- /* @__PURE__ */ jsxs8("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "A", onClick: () => onClick(() => generateList2("A")), children: [
1338
+ /* @__PURE__ */ jsxs7("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "A", onClick: () => onClick(() => generateList2("A")), children: [
1506
1339
  /* @__PURE__ */ jsx13("li", {}),
1507
1340
  /* @__PURE__ */ jsx13("li", {}),
1508
1341
  /* @__PURE__ */ jsx13("li", {})
1509
1342
  ] }),
1510
- /* @__PURE__ */ jsxs8("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "i", onClick: () => onClick(() => generateList2("i")), children: [
1343
+ /* @__PURE__ */ jsxs7("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "i", onClick: () => onClick(() => generateList2("i")), children: [
1511
1344
  /* @__PURE__ */ jsx13("li", {}),
1512
1345
  /* @__PURE__ */ jsx13("li", {}),
1513
1346
  /* @__PURE__ */ jsx13("li", {})
1514
1347
  ] }),
1515
- /* @__PURE__ */ jsxs8("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "I", onClick: () => onClick(() => generateList2("I")), children: [
1348
+ /* @__PURE__ */ jsxs7("ol", { className: src_components_core_editor_EditorOrderedListModal_default.ol, type: "I", onClick: () => onClick(() => generateList2("I")), children: [
1516
1349
  /* @__PURE__ */ jsx13("li", {}),
1517
1350
  /* @__PURE__ */ jsx13("li", {}),
1518
1351
  /* @__PURE__ */ jsx13("li", {})
@@ -1547,13 +1380,13 @@ var init_EditorQuestionModal = __esm({
1547
1380
  });
1548
1381
 
1549
1382
  // src/components/core/editor/EditorQuestionModal.tsx
1550
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1383
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1551
1384
  var EditorQuestionModal, EditorQuestionModal_default;
1552
1385
  var init_EditorQuestionModal2 = __esm({
1553
1386
  "src/components/core/editor/EditorQuestionModal.tsx"() {
1554
1387
  "use strict";
1555
1388
  init_EditorQuestionModal();
1556
- EditorQuestionModal = ({ onClick }) => /* @__PURE__ */ jsxs9("div", { children: [
1389
+ EditorQuestionModal = ({ onClick }) => /* @__PURE__ */ jsxs8("div", { children: [
1557
1390
  /* @__PURE__ */ jsx14("div", { className: src_components_core_editor_EditorQuestionModal_default.question, onClick: () => onClick(() => `<qtarea id="" width="90%" />`), children: "Question textarea" }),
1558
1391
  /* @__PURE__ */ jsx14("div", { className: src_components_core_editor_EditorQuestionModal_default.question, onClick: () => onClick((selectedText) => `<qt id="">${selectedText}</qt>`), children: "Question ouverte" }),
1559
1392
  /* @__PURE__ */ jsx14("div", { className: src_components_core_editor_EditorQuestionModal_default.question, onClick: () => onClick((selectedText) => `<qs id="">${selectedText}</qs>`), children: 'Question "select"' }),
@@ -1625,13 +1458,13 @@ var init_EditorStampModal = __esm({
1625
1458
  });
1626
1459
 
1627
1460
  // src/components/core/editor/EditorStampModal.tsx
1628
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1461
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1629
1462
  var EditorStampModal, EditorStampModal_default;
1630
1463
  var init_EditorStampModal2 = __esm({
1631
1464
  "src/components/core/editor/EditorStampModal.tsx"() {
1632
1465
  "use strict";
1633
1466
  init_EditorStampModal();
1634
- EditorStampModal = ({ onClick }) => /* @__PURE__ */ jsxs10("div", { children: [
1467
+ EditorStampModal = ({ onClick }) => /* @__PURE__ */ jsxs9("div", { children: [
1635
1468
  /* @__PURE__ */ jsx15("div", { className: src_components_core_editor_EditorStampModal_default.stamp, onClick: () => onClick((selectedText) => `<stamp theme="" size="">${selectedText}</stamp>`), children: "Stamp classique" }),
1636
1469
  /* @__PURE__ */ jsx15("div", { className: src_components_core_editor_EditorStampModal_default.stamp, onClick: () => onClick(() => `<stamp theme="" icon="" size=""/>`), children: "Stamp avec icon" })
1637
1470
  ] });
@@ -1679,7 +1512,7 @@ var init_src_components_core_editor_EditorTableModal = __esm({
1679
1512
  "tmp_esbuild/_src_components_core_editor_EditorTableModal.module.css"() {
1680
1513
  "use strict";
1681
1514
  init_PUzC3cfirwsgprCC0t8XaW2Tcxdie8yFOj0O0VakWmM();
1682
- src_components_core_editor_EditorTableModal_default = { "grid": "vv-VbIHYG-grid", "header": "vv-VbIHYG-header", "line": "vv-VbIHYG-line", "cell": "vv-VbIHYG-cell" };
1515
+ src_components_core_editor_EditorTableModal_default = { "header": "vv-VbIHYG-header", "grid": "vv-VbIHYG-grid", "cell": "vv-VbIHYG-cell", "line": "vv-VbIHYG-line" };
1683
1516
  }
1684
1517
  });
1685
1518
 
@@ -1692,9 +1525,9 @@ var init_EditorTableModal = __esm({
1692
1525
  });
1693
1526
 
1694
1527
  // src/components/core/editor/EditorTableModal.tsx
1695
- import { useCallback as useCallback4, useState as useState5 } from "react";
1528
+ import { useCallback as useCallback4, useState as useState4 } from "react";
1696
1529
  import _14 from "lodash/fp.js";
1697
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1530
+ import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1698
1531
  var LINE_COUNT, COLUMN_COUNT, CELL_WIDTH, CELL_HEIGHT, CELL_MARGIN, LINE_WIDTH, Cell, EditorTableModal, EditorTableModal_default;
1699
1532
  var init_EditorTableModal2 = __esm({
1700
1533
  "src/components/core/editor/EditorTableModal.tsx"() {
@@ -1726,7 +1559,7 @@ var init_EditorTableModal2 = __esm({
1726
1559
  );
1727
1560
  };
1728
1561
  EditorTableModal = ({ onClick }) => {
1729
- const [selected, setSelected] = useState5({ line: 0, column: 0 });
1562
+ const [selected, setSelected] = useState4({ line: 0, column: 0 });
1730
1563
  const onMouseEnter = useCallback4(({ column, line }) => {
1731
1564
  setSelected({ line, column });
1732
1565
  }, []);
@@ -1738,7 +1571,7 @@ var init_EditorTableModal2 = __esm({
1738
1571
  );
1739
1572
  const selectedLine = _14.getOr(0, "line", selected);
1740
1573
  const selectedColumn = _14.getOr(0, "column", selected);
1741
- return /* @__PURE__ */ jsxs11("div", { children: [
1574
+ return /* @__PURE__ */ jsxs10("div", { children: [
1742
1575
  /* @__PURE__ */ jsx16("div", { className: src_components_core_editor_EditorTableModal_default.header, children: `${selectedLine} x ${selectedColumn}` }),
1743
1576
  /* @__PURE__ */ jsx16("div", { className: src_components_core_editor_EditorTableModal_default.grid, style: { "--v-line-width": `${LINE_WIDTH}px` }, children: _14.flow(
1744
1577
  _14.range(1),
@@ -1768,7 +1601,7 @@ var init_src_components_core_editor_EditorTitleModal = __esm({
1768
1601
  "tmp_esbuild/_src_components_core_editor_EditorTitleModal.module.css"() {
1769
1602
  "use strict";
1770
1603
  init_cxKXXItV67ua_TIlhaSrnnrkoXVY8_Oh89yukaCrcmw();
1771
- src_components_core_editor_EditorTitleModal_default = { "h3": "vv-_Pgo7W-h3", "h4": "vv-_Pgo7W-h4", "h2": "vv-_Pgo7W-h2", "h1": "vv-_Pgo7W-h1", "body1": "vv-_Pgo7W-body1", "body3": "vv-_Pgo7W-body3", "title": "vv-_Pgo7W-title", "body2": "vv-_Pgo7W-body2" };
1604
+ src_components_core_editor_EditorTitleModal_default = { "h3": "vv-_Pgo7W-h3", "body3": "vv-_Pgo7W-body3", "h1": "vv-_Pgo7W-h1", "title": "vv-_Pgo7W-title", "body1": "vv-_Pgo7W-body1", "h4": "vv-_Pgo7W-h4", "body2": "vv-_Pgo7W-body2", "h2": "vv-_Pgo7W-h2" };
1772
1605
  }
1773
1606
  });
1774
1607
 
@@ -1782,13 +1615,13 @@ var init_EditorTitleModal = __esm({
1782
1615
 
1783
1616
  // src/components/core/editor/EditorTitleModal.tsx
1784
1617
  import { cx as cx4 } from "@lls/utils";
1785
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
1618
+ import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1786
1619
  var EditorTitlesModal, EditorTitleModal_default;
1787
1620
  var init_EditorTitleModal2 = __esm({
1788
1621
  "src/components/core/editor/EditorTitleModal.tsx"() {
1789
1622
  "use strict";
1790
1623
  init_EditorTitleModal();
1791
- EditorTitlesModal = ({ onClick }) => /* @__PURE__ */ jsxs12("div", { children: [
1624
+ EditorTitlesModal = ({ onClick }) => /* @__PURE__ */ jsxs11("div", { children: [
1792
1625
  /* @__PURE__ */ jsx17("div", { className: cx4(src_components_core_editor_EditorTitleModal_default.h1, src_components_core_editor_EditorTitleModal_default.title), onClick: () => onClick((selectedText) => `<h1>${selectedText}</h1>`), children: "h1" }),
1793
1626
  /* @__PURE__ */ jsx17("div", { className: cx4(src_components_core_editor_EditorTitleModal_default.h2, src_components_core_editor_EditorTitleModal_default.title), onClick: () => onClick((selectedText) => `<h2>${selectedText}</h2>`), children: "h2" }),
1794
1627
  /* @__PURE__ */ jsx17("div", { className: cx4(src_components_core_editor_EditorTitleModal_default.h3, src_components_core_editor_EditorTitleModal_default.title), onClick: () => onClick((selectedText) => `<h3>${selectedText}</h3>`), children: "h3" }),
@@ -1826,10 +1659,10 @@ var init_EditorToolbar = __esm({
1826
1659
  });
1827
1660
 
1828
1661
  // src/components/core/editor/EditorToolbar.tsx
1829
- import { forwardRef, useCallback as useCallback5, useState as useState6 } from "react";
1662
+ import { forwardRef, useCallback as useCallback5, useState as useState5 } from "react";
1830
1663
  import xmlFormat from "xml-formatter";
1831
- import { Button as Button3, ButtonsList, Tooltip as Tooltip2 } from "@lls/lls-kit";
1832
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1664
+ import { Button as Button2, ButtonsList, Tooltip as Tooltip2 } from "@lls/lls-kit";
1665
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1833
1666
  import { createElement } from "react";
1834
1667
  var EDITOR_BUTTONS, Dropdown, EditorToolbar, EditorToolbar_default;
1835
1668
  var init_EditorToolbar2 = __esm({
@@ -2020,7 +1853,7 @@ ${selectedText}
2020
1853
  }
2021
1854
  ];
2022
1855
  Dropdown = ({ icon, title, dropdown: Overlay, action }) => {
2023
- const [visible, setVisible] = useState6(false);
1856
+ const [visible, setVisible] = useState5(false);
2024
1857
  const toggleVisible = () => {
2025
1858
  setVisible((isVisible) => !isVisible);
2026
1859
  };
@@ -2037,14 +1870,14 @@ ${selectedText}
2037
1870
  content: /* @__PURE__ */ jsx18(Overlay, { onClick: onClickOverlay })
2038
1871
  }
2039
1872
  ];
2040
- return /* @__PURE__ */ jsxs13("span", { className: src_components_core_editor_EditorToolbar_default.span, onClick: toggleVisible, children: [
2041
- /* @__PURE__ */ jsx18(Tooltip2, { content: title, children: /* @__PURE__ */ jsx18(Button3, { theme: "gray", icon, children: " " }) }),
1873
+ return /* @__PURE__ */ jsxs12("span", { className: src_components_core_editor_EditorToolbar_default.span, onClick: toggleVisible, children: [
1874
+ /* @__PURE__ */ jsx18(Tooltip2, { content: title, children: /* @__PURE__ */ jsx18(Button2, { theme: "gray", icon, children: " " }) }),
2042
1875
  visible && /* @__PURE__ */ jsx18(ButtonsList, { listItems, className: src_components_core_editor_EditorToolbar_default.absoluteMenuButton, zIndex: 1, withMask: false })
2043
1876
  ] });
2044
1877
  };
2045
1878
  EditorToolbar = forwardRef(({ replace }, menuRef) => /* @__PURE__ */ jsx18("div", { className: src_components_core_editor_EditorToolbar_default.editorToolbar, ref: menuRef, children: EDITOR_BUTTONS.map((button, i) => {
2046
1879
  const { icon, action, title, dropdown } = button;
2047
- return dropdown ? /* @__PURE__ */ createElement(Dropdown, { ...button, action: (callback) => replace(callback), key: i }) : /* @__PURE__ */ jsx18(Tooltip2, { content: title, children: /* @__PURE__ */ jsx18(Button3, { theme: "gray", onClick: () => replace(action, title), icon, children: " " }, i) });
1880
+ return dropdown ? /* @__PURE__ */ createElement(Dropdown, { ...button, action: (callback) => replace(callback), key: i }) : /* @__PURE__ */ jsx18(Tooltip2, { content: title, children: /* @__PURE__ */ jsx18(Button2, { theme: "gray", onClick: () => replace(action, title), icon, children: " " }, i) });
2048
1881
  }) }));
2049
1882
  EditorToolbar.displayName = "EditorToolbar";
2050
1883
  EditorToolbar_default = EditorToolbar;
@@ -2076,7 +1909,7 @@ var init_useDragAndResize = __esm({
2076
1909
  });
2077
1910
 
2078
1911
  // ../viewer/src/hooks/useDragAndResize.tsx
2079
- import { useEffect as useEffect5, useRef as useRef4, useState as useState7 } from "react";
1912
+ import { useEffect as useEffect4, useRef as useRef4, useState as useState6 } from "react";
2080
1913
  import _15 from "lodash/fp.js";
2081
1914
  import { Fragment, jsx as jsx19 } from "react/jsx-runtime";
2082
1915
  var resizeHandlersProps, useDragAndResize, useDragAndResize_default;
@@ -2195,11 +2028,11 @@ var init_useDragAndResize2 = __esm({
2195
2028
  const rndRef = useRef4(null);
2196
2029
  const defaultWidth = defaultSize.width || 0;
2197
2030
  const defaultHeight = defaultSize.height || 0;
2198
- const [size, setSize] = useState7({
2031
+ const [size, setSize] = useState6({
2199
2032
  height: defaultHeight,
2200
2033
  width: defaultWidth
2201
2034
  });
2202
- const [resizingData, setResizingData] = useState7({
2035
+ const [resizingData, setResizingData] = useState6({
2203
2036
  isActive: false,
2204
2037
  shouldSizeX: false,
2205
2038
  shouldSizeY: false,
@@ -2209,12 +2042,12 @@ var init_useDragAndResize2 = __esm({
2209
2042
  const positionX = _15.getOr(0, "x", defaultPositions);
2210
2043
  const bodyWidth = _15.getOr(0, "body.offsetWidth", document);
2211
2044
  const x = positionX + defaultWidth > bodyWidth ? positionX - defaultWidth : positionX;
2212
- const [translateData, setTranslateData] = useState7({
2045
+ const [translateData, setTranslateData] = useState6({
2213
2046
  isActive: false,
2214
2047
  x,
2215
2048
  y: _15.getOr(0, "y", defaultPositions)
2216
2049
  });
2217
- useEffect5(() => {
2050
+ useEffect4(() => {
2218
2051
  if (translateData.isActive) {
2219
2052
  const onMouseUp = () => setTranslateData(_15.set("isActive", false));
2220
2053
  const onMouseMove = (e) => setTranslateData(({ x: x2, y, ...translateData2 }) => ({
@@ -2230,7 +2063,7 @@ var init_useDragAndResize2 = __esm({
2230
2063
  };
2231
2064
  }
2232
2065
  }, [translateData]);
2233
- useEffect5(() => {
2066
+ useEffect4(() => {
2234
2067
  if (resizingData.isActive) {
2235
2068
  if (rndRef.current && !(size.height !== 0 && size.width !== 0)) {
2236
2069
  const { height, width } = rndRef.current.getBoundingClientRect();
@@ -2318,7 +2151,7 @@ var init_useDragAndResize2 = __esm({
2318
2151
  );
2319
2152
  }) }) : /* @__PURE__ */ jsx19(Fragment, {});
2320
2153
  const isActive = translateData.isActive || resizingData.isActive;
2321
- useEffect5(() => {
2154
+ useEffect4(() => {
2322
2155
  if (!rndRef.current)
2323
2156
  return;
2324
2157
  rndRef.current.style.userSelect = isActive ? "none" : "unset";
@@ -2351,7 +2184,7 @@ var init_src_components_core_editor_Editor = __esm({
2351
2184
  "tmp_esbuild/_src_components_core_editor_Editor.module.css"() {
2352
2185
  "use strict";
2353
2186
  init_lEiBk0nzPl8xepK8MhbhXKbNfra5VDReD417YnvGVY();
2354
- src_components_core_editor_Editor_default = { "rnd": "vv-cGAezq-rnd", "errorBanner": "vv-cGAezq-errorBanner", "header": "vv-cGAezq-header", "wrapper": "vv-cGAezq-wrapper" };
2187
+ src_components_core_editor_Editor_default = { "rnd": "vv-cGAezq-rnd", "errorBanner": "vv-cGAezq-errorBanner", "wrapper": "vv-cGAezq-wrapper", "header": "vv-cGAezq-header" };
2355
2188
  }
2356
2189
  });
2357
2190
 
@@ -2366,8 +2199,8 @@ var init_Editor = __esm({
2366
2199
  // src/components/core/editor/Editor.tsx
2367
2200
  import { useCallback as useCallback6, useMemo as useMemo2, useRef as useRef5 } from "react";
2368
2201
  import _16 from "lodash/fp.js";
2369
- import { Button as Button4 } from "@lls/lls-kit";
2370
- import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
2202
+ import { Button as Button3 } from "@lls/lls-kit";
2203
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
2371
2204
  var DEFAULT_WIDTH, DEFAULT_HEIGHT, Editor, Editor_default;
2372
2205
  var init_Editor2 = __esm({
2373
2206
  "src/components/core/editor/Editor.tsx"() {
@@ -2415,8 +2248,8 @@ var init_Editor2 = __esm({
2415
2248
  height: DEFAULT_HEIGHT
2416
2249
  }
2417
2250
  });
2418
- return /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_Editor_default.rnd, ref: rndRef, children: [
2419
- /* @__PURE__ */ jsx20("div", { className: src_components_core_editor_Editor_default.header, onMouseDown: launchTranslate, children: /* @__PURE__ */ jsx20(Button4, { onClick: onClose, theme: "gray", children: "cancel" }) }),
2251
+ return /* @__PURE__ */ jsxs13("div", { className: src_components_core_editor_Editor_default.rnd, ref: rndRef, children: [
2252
+ /* @__PURE__ */ jsx20("div", { className: src_components_core_editor_Editor_default.header, onMouseDown: launchTranslate, children: /* @__PURE__ */ jsx20(Button3, { onClick: onClose, theme: "gray", children: "cancel" }) }),
2420
2253
  /* @__PURE__ */ jsx20(EditorToolbar_default, { replace }),
2421
2254
  /* @__PURE__ */ jsx20("div", { className: src_components_core_editor_Editor_default.wrapper, children: /* @__PURE__ */ jsx20(CodemirrorEditor_default, { componentDidMount: setEditor, value: _16.get("contentMd", doc), onChange, keyMap, onError }) }),
2422
2255
  error && /* @__PURE__ */ jsx20("div", { className: src_components_core_editor_Editor_default.errorBanner, children: error }),
@@ -2463,7 +2296,7 @@ var init_useDragAndResize3 = __esm({
2463
2296
  });
2464
2297
 
2465
2298
  // src/hooks/useDragAndResize.tsx
2466
- import { useEffect as useEffect6, useRef as useRef6, useState as useState8 } from "react";
2299
+ import { useEffect as useEffect5, useRef as useRef6, useState as useState7 } from "react";
2467
2300
  import _17 from "lodash/fp.js";
2468
2301
  import { Fragment as Fragment2, jsx as jsx22 } from "react/jsx-runtime";
2469
2302
  var resizeHandlersProps2, useDragAndResize2, useDragAndResize_default2;
@@ -2582,11 +2415,11 @@ var init_useDragAndResize4 = __esm({
2582
2415
  const rndRef = useRef6(null);
2583
2416
  const defaultWidth = defaultSize.width || 0;
2584
2417
  const defaultHeight = defaultSize.height || 0;
2585
- const [size, setSize] = useState8({
2418
+ const [size, setSize] = useState7({
2586
2419
  height: defaultHeight,
2587
2420
  width: defaultWidth
2588
2421
  });
2589
- const [resizingData, setResizingData] = useState8({
2422
+ const [resizingData, setResizingData] = useState7({
2590
2423
  isActive: false,
2591
2424
  shouldSizeX: false,
2592
2425
  shouldSizeY: false,
@@ -2596,12 +2429,12 @@ var init_useDragAndResize4 = __esm({
2596
2429
  const positionX = _17.getOr(0, "x", defaultPositions);
2597
2430
  const bodyWidth = _17.getOr(0, "body.offsetWidth", document);
2598
2431
  const x = positionX + defaultWidth > bodyWidth ? positionX - defaultWidth : positionX;
2599
- const [translateData, setTranslateData] = useState8({
2432
+ const [translateData, setTranslateData] = useState7({
2600
2433
  isActive: false,
2601
2434
  x,
2602
2435
  y: _17.getOr(0, "y", defaultPositions)
2603
2436
  });
2604
- useEffect6(() => {
2437
+ useEffect5(() => {
2605
2438
  if (translateData.isActive) {
2606
2439
  const onMouseUp = () => setTranslateData(_17.set("isActive", false));
2607
2440
  const onMouseMove = (e) => setTranslateData(({ x: x2, y, ...translateData2 }) => ({
@@ -2617,7 +2450,7 @@ var init_useDragAndResize4 = __esm({
2617
2450
  };
2618
2451
  }
2619
2452
  }, [translateData]);
2620
- useEffect6(() => {
2453
+ useEffect5(() => {
2621
2454
  if (resizingData.isActive) {
2622
2455
  if (rndRef.current && !(size.height !== 0 && size.width !== 0)) {
2623
2456
  const { height, width } = rndRef.current.getBoundingClientRect();
@@ -2705,7 +2538,7 @@ var init_useDragAndResize4 = __esm({
2705
2538
  );
2706
2539
  }) }) : /* @__PURE__ */ jsx22(Fragment2, {});
2707
2540
  const isActive = translateData.isActive || resizingData.isActive;
2708
- useEffect6(() => {
2541
+ useEffect5(() => {
2709
2542
  if (!rndRef.current)
2710
2543
  return;
2711
2544
  rndRef.current.style.userSelect = isActive ? "none" : "unset";
@@ -2738,7 +2571,7 @@ var init_src_components_core_editor_MetadataEditor = __esm({
2738
2571
  "tmp_esbuild/_src_components_core_editor_MetadataEditor.module.css"() {
2739
2572
  "use strict";
2740
2573
  init_U8V5nDBlqycdkp1CuS13BrEMfGN5Xkd0n60BqPKYbkc();
2741
- src_components_core_editor_MetadataEditor_default = { "rnd": "vv-ftXTRa-rnd", "header": "vv-ftXTRa-header", "uuid": "vv-ftXTRa-uuid", "fieldWrapper": "vv-ftXTRa-fieldWrapper", "field": "vv-ftXTRa-field", "body": "vv-ftXTRa-body", "select": "vv-ftXTRa-select" };
2574
+ src_components_core_editor_MetadataEditor_default = { "select": "vv-ftXTRa-select", "fieldWrapper": "vv-ftXTRa-fieldWrapper", "body": "vv-ftXTRa-body", "uuid": "vv-ftXTRa-uuid", "field": "vv-ftXTRa-field", "rnd": "vv-ftXTRa-rnd", "header": "vv-ftXTRa-header" };
2742
2575
  }
2743
2576
  });
2744
2577
 
@@ -2753,8 +2586,8 @@ var init_MetadataEditor = __esm({
2753
2586
  // src/components/core/editor/MetadataEditor.tsx
2754
2587
  import _18 from "lodash/fp.js";
2755
2588
  import Select from "react-select";
2756
- import { Button as Button5 } from "@lls/lls-kit";
2757
- import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
2589
+ import { Button as Button4 } from "@lls/lls-kit";
2590
+ import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
2758
2591
  var MetadataEditor, MetadataEditor_default;
2759
2592
  var init_MetadataEditor2 = __esm({
2760
2593
  "src/components/core/editor/MetadataEditor.tsx"() {
@@ -2768,15 +2601,15 @@ var init_MetadataEditor2 = __esm({
2768
2601
  const { handlersElement, launchTranslate, rndRef } = useDragAndResize_default2({
2769
2602
  defaultPositions: positions
2770
2603
  });
2771
- return /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.rnd, ref: rndRef, children: [
2772
- /* @__PURE__ */ jsx23("div", { className: src_components_core_editor_MetadataEditor_default.header, onMouseDown: launchTranslate, children: /* @__PURE__ */ jsx23(Button5, { onClick: onClose, theme: "gray", children: "cancel" }) }),
2773
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.body, children: [
2774
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2604
+ return /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.rnd, ref: rndRef, children: [
2605
+ /* @__PURE__ */ jsx23("div", { className: src_components_core_editor_MetadataEditor_default.header, onMouseDown: launchTranslate, children: /* @__PURE__ */ jsx23(Button4, { onClick: onClose, theme: "gray", children: "cancel" }) }),
2606
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.body, children: [
2607
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2775
2608
  "Uuid:",
2776
2609
  " ",
2777
2610
  /* @__PURE__ */ jsx23("span", { className: src_components_core_editor_MetadataEditor_default.uuid, style: { "--data-font": "monospace" }, children: doc.uuid })
2778
2611
  ] }),
2779
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2612
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2780
2613
  "Title",
2781
2614
  /* @__PURE__ */ jsx23(
2782
2615
  "input",
@@ -2788,7 +2621,7 @@ var init_MetadataEditor2 = __esm({
2788
2621
  }
2789
2622
  )
2790
2623
  ] }),
2791
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2624
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2792
2625
  "Description",
2793
2626
  /* @__PURE__ */ jsx23(
2794
2627
  "input",
@@ -2800,7 +2633,7 @@ var init_MetadataEditor2 = __esm({
2800
2633
  }
2801
2634
  )
2802
2635
  ] }),
2803
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2636
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2804
2637
  "Image",
2805
2638
  /* @__PURE__ */ jsx23(
2806
2639
  "input",
@@ -2812,7 +2645,7 @@ var init_MetadataEditor2 = __esm({
2812
2645
  }
2813
2646
  )
2814
2647
  ] }),
2815
- /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2648
+ /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2816
2649
  "Keywords",
2817
2650
  /* @__PURE__ */ jsx23(
2818
2651
  "input",
@@ -2824,7 +2657,7 @@ var init_MetadataEditor2 = __esm({
2824
2657
  }
2825
2658
  )
2826
2659
  ] }),
2827
- !_18.isEmpty(notions) && /* @__PURE__ */ jsxs15("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2660
+ !_18.isEmpty(notions) && /* @__PURE__ */ jsxs14("div", { className: src_components_core_editor_MetadataEditor_default.fieldWrapper, children: [
2828
2661
  "Notion",
2829
2662
  /* @__PURE__ */ jsx23(
2830
2663
  Select,
@@ -2850,7 +2683,7 @@ var init_MetadataEditor2 = __esm({
2850
2683
 
2851
2684
  // src/hooks/useEditor.tsx
2852
2685
  import _19 from "lodash/fp.js";
2853
- import { useCallback as useCallback7, useEffect as useEffect7, useState as useState9 } from "react";
2686
+ import { useCallback as useCallback7, useEffect as useEffect6, useState as useState8 } from "react";
2854
2687
  var EDITOR_MARGIN, useEditor, useEditor_default;
2855
2688
  var init_useEditor = __esm({
2856
2689
  "src/hooks/useEditor.tsx"() {
@@ -2859,9 +2692,9 @@ var init_useEditor = __esm({
2859
2692
  useEditor = ({
2860
2693
  id
2861
2694
  }) => {
2862
- const [path, setPath] = useState9(void 0);
2863
- const [positions, setPositions] = useState9({ x: 0, y: 0 });
2864
- useEffect7(() => {
2695
+ const [path, setPath] = useState8(void 0);
2696
+ const [positions, setPositions] = useState8({ x: 0, y: 0 });
2697
+ useEffect6(() => {
2865
2698
  _19.noop(id);
2866
2699
  setPath(void 0);
2867
2700
  }, [id]);
@@ -2924,7 +2757,7 @@ var init_src_components_lazy_index_editor = __esm({
2924
2757
  "tmp_esbuild/_src_components_lazy_index.editor.module.css"() {
2925
2758
  "use strict";
2926
2759
  init_vBHtYTubWLIkQ7cwq88_cqGbPrRZDxVu51b9VQwno0();
2927
- src_components_lazy_index_editor_default = { "submit": "vv-RUXZgW-submit", "screen": "vv-RUXZgW-screen", "stickyBar": "vv-RUXZgW-stickyBar", "pageContainer": "vv-RUXZgW-pageContainer", "exitButton": "vv-RUXZgW-exitButton", "alert": "vv-RUXZgW-alert", "button": "vv-RUXZgW-button", "alertOpenedAnimation": "vv-RUXZgW-alertOpenedAnimation" };
2760
+ src_components_lazy_index_editor_default = { "alertOpenedAnimation": "vv-RUXZgW-alertOpenedAnimation", "submit": "vv-RUXZgW-submit", "pageContainer": "vv-RUXZgW-pageContainer", "screen": "vv-RUXZgW-screen", "button": "vv-RUXZgW-button", "alert": "vv-RUXZgW-alert", "exitButton": "vv-RUXZgW-exitButton", "stickyBar": "vv-RUXZgW-stickyBar" };
2928
2761
  }
2929
2762
  });
2930
2763
 
@@ -2941,11 +2774,11 @@ var index_editor_exports = {};
2941
2774
  __export(index_editor_exports, {
2942
2775
  default: () => index_editor_default
2943
2776
  });
2944
- import React8, { useCallback as useCallback8, useEffect as useEffect8, useState as useState10 } from "react";
2777
+ import React8, { useCallback as useCallback8, useEffect as useEffect7, useState as useState9 } from "react";
2945
2778
  import _20 from "lodash/fp.js";
2946
- import { Button as Button6, RadioButton, Snackbar } from "@lls/lls-kit";
2779
+ import { Button as Button5, RadioButton, Snackbar } from "@lls/lls-kit";
2947
2780
  import { copyToClipboard } from "@lls/utils";
2948
- import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
2781
+ import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
2949
2782
  var Editor2, CompactModeButton, CopyButton, EditorStickyBar, EditorNext, index_editor_default;
2950
2783
  var init_index_editor2 = __esm({
2951
2784
  "src/components/lazy/index.editor.tsx"() {
@@ -2968,7 +2801,7 @@ var init_index_editor2 = __esm({
2968
2801
  const onClick = useCallback8(() => {
2969
2802
  setIsCompactMode(!isCompactMode);
2970
2803
  }, [setIsCompactMode, isCompactMode]);
2971
- return /* @__PURE__ */ jsx24(Button6, { theme, accent: "alt", "data-isactive": +isCompactMode, onClick, children: "cm" });
2804
+ return /* @__PURE__ */ jsx24(Button5, { theme, accent: "alt", "data-isactive": +isCompactMode, onClick, children: "cm" });
2972
2805
  };
2973
2806
  CopyButton = ({ template, theme, setCopied = _20.noop }) => {
2974
2807
  const onClick = useCallback8(() => {
@@ -2978,29 +2811,29 @@ var init_index_editor2 = __esm({
2978
2811
  setCopied(false);
2979
2812
  }, 3500);
2980
2813
  }, [template, setCopied]);
2981
- return /* @__PURE__ */ jsx24(Button6, { className: src_components_lazy_index_editor_default.button, theme, accent: "alt", type: "button", onClick, children: "Copier le JSON" });
2814
+ return /* @__PURE__ */ jsx24(Button5, { className: src_components_lazy_index_editor_default.button, theme, accent: "alt", type: "button", onClick, children: "Copier le JSON" });
2982
2815
  };
2983
2816
  EditorStickyBar = ({ mode, setMode, handleSubmit, template, isCompactMode, setIsCompactMode, setCopied }) => {
2984
2817
  const stickyBarTheme = IS_PROD ? "premium" : "primary";
2985
- return /* @__PURE__ */ jsxs16("div", { className: src_components_lazy_index_editor_default.stickyBar, children: [
2818
+ return /* @__PURE__ */ jsxs15("div", { className: src_components_lazy_index_editor_default.stickyBar, children: [
2986
2819
  /* @__PURE__ */ jsx24(RadioButton, { isChecked: mode === "edit", onChange: setMode, label: "Edit", name: "Mode", value: "edit" }),
2987
2820
  /* @__PURE__ */ jsx24(RadioButton, { isChecked: mode === "view", onChange: setMode, label: "View", name: "Mode", value: "view" }),
2988
- /* @__PURE__ */ jsx24(Button6, { theme: stickyBarTheme, onClick: handleSubmit, children: "Submit" }),
2821
+ /* @__PURE__ */ jsx24(Button5, { theme: stickyBarTheme, onClick: handleSubmit, children: "Submit" }),
2989
2822
  /* @__PURE__ */ jsx24(CompactModeButton, { theme: stickyBarTheme, isCompactMode, setIsCompactMode }),
2990
2823
  /* @__PURE__ */ jsx24(CopyButton, { theme: stickyBarTheme, template, setCopied })
2991
2824
  ] });
2992
2825
  };
2993
2826
  EditorNext = React8.forwardRef(({ template, onChange = _20.noop, onSubmit = _20.noop, notions, ...props }, ref) => {
2994
- const [isCompactMode, setIsCompactMode] = useState10(false);
2995
- const [mode, setMode] = useState10("edit");
2996
- const [copied, setCopied] = useState10(false);
2827
+ const [isCompactMode, setIsCompactMode] = useState9(false);
2828
+ const [mode, setMode] = useState9("edit");
2829
+ const [copied, setCopied] = useState9(false);
2997
2830
  const id = template?.id;
2998
2831
  const editEditor = useEditor_default({ id });
2999
2832
  const metadataEditor = useEditor_default({ id });
3000
- const [docLintErrors, setDocLintErrors] = useState10({});
2833
+ const [docLintErrors, setDocLintErrors] = useState9({});
3001
2834
  const firstFoundErrorUuid = _20.findKey.convert({ cap: false })(Boolean, docLintErrors);
3002
- const [showWarningSnackbar, setShowWarningSnackbar] = useState10(false);
3003
- useEffect8(() => {
2835
+ const [showWarningSnackbar, setShowWarningSnackbar] = useState9(false);
2836
+ useEffect7(() => {
3004
2837
  if (showWarningSnackbar) {
3005
2838
  const timeoutId = setTimeout(setShowWarningSnackbar, 1e4, false);
3006
2839
  return () => {
@@ -3008,7 +2841,7 @@ var init_index_editor2 = __esm({
3008
2841
  };
3009
2842
  }
3010
2843
  }, [showWarningSnackbar]);
3011
- useEffect8(() => {
2844
+ useEffect7(() => {
3012
2845
  setDocLintErrors(
3013
2846
  _20.flow(
3014
2847
  _20.get("children"),
@@ -3062,7 +2895,7 @@ ${JSON.stringify(
3062
2895
  },
3063
2896
  [handleSubmit]
3064
2897
  );
3065
- useEffect8(() => {
2898
+ useEffect7(() => {
3066
2899
  window.addEventListener("keydown", onKeyDown);
3067
2900
  return () => {
3068
2901
  window.removeEventListener("keydown", onKeyDown);
@@ -3104,9 +2937,9 @@ ${JSON.stringify(
3104
2937
  setIsCompactMode,
3105
2938
  setCopied
3106
2939
  };
3107
- return /* @__PURE__ */ jsxs16(Fragment3, { children: [
2940
+ return /* @__PURE__ */ jsxs15(Fragment3, { children: [
3108
2941
  /* @__PURE__ */ jsx24(EditorStickyBar, { ...toolbarProps }),
3109
- /* @__PURE__ */ jsx24("div", { className: src_components_lazy_index_editor_default.pageContainer, children: /* @__PURE__ */ jsxs16("div", { className: src_components_lazy_index_editor_default.screen, children: [
2942
+ /* @__PURE__ */ jsx24("div", { className: src_components_lazy_index_editor_default.pageContainer, children: /* @__PURE__ */ jsxs15("div", { className: src_components_lazy_index_editor_default.screen, children: [
3110
2943
  copied && /* @__PURE__ */ jsx24("div", { className: src_components_lazy_index_editor_default.alert, children: "JSON copi\xE9 dans le presse-papier" }),
3111
2944
  isEditMode(mode) ? /* @__PURE__ */ jsx24(
3112
2945
  EditViewerMd_default,
@@ -3118,6 +2951,7 @@ ${JSON.stringify(
3118
2951
  isEditorOpen: Boolean(editEditor.path || metadataEditor.path),
3119
2952
  onChange,
3120
2953
  compactMode: isCompactMode,
2954
+ setTemplate: onChange,
3121
2955
  template
3122
2956
  }
3123
2957
  ) : /* @__PURE__ */ jsx24(ViewerMd_default, { ...props, ref, mode, template, onChange }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lls/vivi",
3
- "version": "24.1.7-0b548db8",
3
+ "version": "24.1.7-13f884fc",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "exports": {
@@ -31,6 +31,7 @@
31
31
  "@types/codemirror": "5.60.6",
32
32
  "@types/domhandler": "2.4.5",
33
33
  "@types/lodash": "4.14.202",
34
+ "@types/murmurhash": "2.0.0",
34
35
  "@types/node": "20.9.3",
35
36
  "@types/react": "18.2.45",
36
37
  "@types/react-dom": "18.2.18",
@@ -44,13 +45,14 @@
44
45
  "typescript": "5.3.3",
45
46
  "vite-tsconfig-paths": "4.2.3",
46
47
  "vitest": "1.1.3",
47
- "@lls/utils": "24.1.7-0b548db8",
48
- "@lls/lls-kit": "24.1.7-0b548db8",
49
- "@lls/vitescripts": "24.1.7-0b548db8"
48
+ "@lls/lls-kit": "24.1.7-13f884fc",
49
+ "@lls/vitescripts": "24.1.7-13f884fc",
50
+ "@lls/utils": "24.1.7-13f884fc"
50
51
  },
51
52
  "dependencies": {
52
53
  "codemirror": "5.65.15",
53
54
  "html-to-react": "1.5.0",
55
+ "murmurhash": "2.0.0",
54
56
  "nanoid": "5.0.5",
55
57
  "react-select": "5.4.0",
56
58
  "xml-formatter": "3.3.2",