@solibo/solibo-ui 2.2.10 → 2.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index15.css +1 -1
  3. package/dist/assets/index17.css +1 -1
  4. package/dist/assets/index21.css +1 -1
  5. package/dist/assets/index22.css +1 -1
  6. package/dist/assets/index23.css +1 -1
  7. package/dist/assets/index24.css +1 -1
  8. package/dist/assets/index25.css +1 -1
  9. package/dist/assets/index26.css +1 -1
  10. package/dist/assets/index27.css +1 -1
  11. package/dist/assets/index28.css +1 -1
  12. package/dist/assets/index29.css +1 -1
  13. package/dist/assets/index30.css +1 -1
  14. package/dist/assets/index31.css +1 -1
  15. package/dist/assets/index32.css +1 -1
  16. package/dist/assets/index33.css +1 -1
  17. package/dist/assets/index34.css +1 -1
  18. package/dist/assets/index35.css +1 -1
  19. package/dist/assets/index36.css +1 -1
  20. package/dist/assets/index37.css +1 -1
  21. package/dist/assets/index38.css +1 -1
  22. package/dist/assets/index39.css +1 -1
  23. package/dist/assets/index40.css +1 -1
  24. package/dist/assets/index41.css +1 -1
  25. package/dist/assets/index42.css +1 -1
  26. package/dist/assets/index43.css +1 -1
  27. package/dist/assets/index44.css +1 -1
  28. package/dist/assets/index45.css +1 -1
  29. package/dist/assets/index46.css +1 -1
  30. package/dist/assets/index47.css +1 -1
  31. package/dist/assets/index48.css +1 -1
  32. package/dist/assets/index49.css +1 -1
  33. package/dist/assets/index50.css +1 -1
  34. package/dist/assets/index51.css +1 -1
  35. package/dist/assets/index52.css +1 -1
  36. package/dist/assets/index53.css +1 -1
  37. package/dist/assets/index54.css +1 -1
  38. package/dist/assets/index55.css +1 -1
  39. package/dist/assets/index56.css +1 -1
  40. package/dist/assets/index57.css +1 -0
  41. package/dist/assets/index58.css +1 -0
  42. package/dist/components/app-link/index.cjs +1 -1
  43. package/dist/components/app-link/index.js +1 -1
  44. package/dist/components/app-shell/index.cjs +1 -1
  45. package/dist/components/app-shell/index.js +1 -1
  46. package/dist/components/aside/index.cjs +1 -1
  47. package/dist/components/aside/index.js +1 -1
  48. package/dist/components/avatar/index.cjs +1 -1
  49. package/dist/components/avatar/index.js +1 -1
  50. package/dist/components/badge/index.cjs +1 -1
  51. package/dist/components/badge/index.js +1 -1
  52. package/dist/components/banner/index.cjs +1 -1
  53. package/dist/components/banner/index.js +1 -1
  54. package/dist/components/branding/index.cjs +1 -1
  55. package/dist/components/branding/index.js +1 -1
  56. package/dist/components/button/index.cjs +1 -1
  57. package/dist/components/button/index.js +34 -34
  58. package/dist/components/card/index.cjs +1 -1
  59. package/dist/components/card/index.js +1 -1
  60. package/dist/components/checkbox/index.cjs +1 -1
  61. package/dist/components/checkbox/index.js +1 -1
  62. package/dist/components/chip/index.cjs +1 -1
  63. package/dist/components/chip/index.js +1 -1
  64. package/dist/components/clipboard/index.cjs +1 -1
  65. package/dist/components/clipboard/index.js +1 -1
  66. package/dist/components/collapsible/index.cjs +1 -1
  67. package/dist/components/collapsible/index.js +1 -1
  68. package/dist/components/comment/index.cjs +1 -0
  69. package/dist/components/comment/index.js +10 -0
  70. package/dist/components/comments/index.cjs +1 -0
  71. package/dist/components/comments/index.js +58 -0
  72. package/dist/components/controls/index.cjs +1 -2
  73. package/dist/components/controls/index.js +6 -139
  74. package/dist/components/croppable/index.cjs +1 -1
  75. package/dist/components/croppable/index.js +1 -1
  76. package/dist/components/dialog/index.cjs +1 -1
  77. package/dist/components/dialog/index.js +1 -1
  78. package/dist/components/divider/index.cjs +1 -1
  79. package/dist/components/divider/index.js +1 -1
  80. package/dist/components/dropdown/index.cjs +1 -1
  81. package/dist/components/dropdown/index.js +3 -3
  82. package/dist/components/dropzone/index.cjs +1 -1
  83. package/dist/components/dropzone/index.js +1 -1
  84. package/dist/components/editor/index.cjs +1 -1
  85. package/dist/components/editor/index.js +491 -470
  86. package/dist/components/empty-state/index.cjs +1 -1
  87. package/dist/components/empty-state/index.js +1 -1
  88. package/dist/components/fieldset/index.cjs +1 -1
  89. package/dist/components/fieldset/index.js +1 -1
  90. package/dist/components/figure/index.cjs +1 -1
  91. package/dist/components/figure/index.js +1 -1
  92. package/dist/components/file/index.cjs +1 -1
  93. package/dist/components/file/index.js +1 -1
  94. package/dist/components/footer/index.cjs +1 -1
  95. package/dist/components/footer/index.js +1 -1
  96. package/dist/components/form/index.cjs +1 -1
  97. package/dist/components/form/index.js +1 -1
  98. package/dist/components/graph/index.cjs +1 -1
  99. package/dist/components/graph/index.js +1 -1
  100. package/dist/components/group/index.cjs +1 -1
  101. package/dist/components/group/index.js +1 -1
  102. package/dist/components/icon/index.cjs +1 -1
  103. package/dist/components/icon/index.js +1 -1
  104. package/dist/components/iframe/index.cjs +1 -1
  105. package/dist/components/iframe/index.js +5 -5
  106. package/dist/components/input/index.cjs +1 -1
  107. package/dist/components/input/index.js +1 -1
  108. package/dist/components/link/index.cjs +1 -1
  109. package/dist/components/link/index.js +1 -1
  110. package/dist/components/list/index.cjs +1 -1
  111. package/dist/components/list/index.js +1 -1
  112. package/dist/components/loading/index.cjs +1 -1
  113. package/dist/components/loading/index.js +1 -1
  114. package/dist/components/message/index.cjs +1 -1
  115. package/dist/components/message/index.js +42 -37
  116. package/dist/components/messages/index.cjs +1 -1
  117. package/dist/components/messages/index.js +105 -79
  118. package/dist/components/popover/index.cjs +1 -1
  119. package/dist/components/popover/index.js +1 -1
  120. package/dist/components/search/index.cjs +1 -1
  121. package/dist/components/search/index.js +14 -14
  122. package/dist/components/select/index.cjs +1 -1
  123. package/dist/components/select/index.js +1 -1
  124. package/dist/components/toolbar/index.cjs +1 -1
  125. package/dist/components/toolbar/index.js +1 -1
  126. package/dist/content-Duav5qcc.js +10 -0
  127. package/dist/content-i-MRPlxK.cjs +1 -0
  128. package/dist/index-Bl5EEYDv.cjs +2 -0
  129. package/dist/index-DQuc_Zkg.js +149 -0
  130. package/dist/index-DqZSdMHT.cjs +1 -0
  131. package/dist/{index-Dd20d_9U.js → index-FSKjg3Z8.js} +1 -1
  132. package/dist/{index-Dx-KtGBg.js → index-HVXauXrX.js} +1 -1
  133. package/dist/index-KGoXYG8u.js +123 -0
  134. package/dist/{index-7blZaPiA.cjs → index-S1XsOUKE.cjs} +1 -1
  135. package/dist/{index-VLDsM9it.cjs → index-riaH5c_S.cjs} +1 -1
  136. package/dist/index.cjs +1 -1
  137. package/dist/index.d.ts +78 -3
  138. package/dist/index.js +110 -104
  139. package/dist/tokens.json +1 -1
  140. package/package.json +1 -1
@@ -1,152 +1,154 @@
1
- import '../../assets/index43.css';var Rt = Object.defineProperty;
2
- var Ot = (s, r, e) => r in s ? Rt(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var j = (s, r, e) => Ot(s, typeof r != "symbol" ? r + "" : r, e);
4
- import { jsxs as O, jsx as o, Fragment as ct } from "react/jsx-runtime";
5
- import { $generateHtmlFromNodes as $t, $generateNodesFromDOM as Ut } from "@lexical/html";
6
- import { TOGGLE_LINK_COMMAND as ft, $isLinkNode as rt, AutoLinkNode as zt, LinkNode as Bt } from "@lexical/link";
7
- import { $isListNode as pt, $isListItemNode as _t, REMOVE_LIST_COMMAND as Ht, INSERT_UNORDERED_LIST_COMMAND as Ft, ListNode as Wt, ListItemNode as Kt } from "@lexical/list";
8
- import { AutoFocusPlugin as jt } from "@lexical/react/LexicalAutoFocusPlugin";
1
+ import '../../assets/index44.css';var Et = Object.defineProperty;
2
+ var Rt = (l, e, t) => e in l ? Et(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
+ var J = (l, e, t) => Rt(l, typeof e != "symbol" ? e + "" : e, t);
4
+ import { jsxs as F, jsx as s, Fragment as ht } from "react/jsx-runtime";
5
+ import { $generateHtmlFromNodes as Ot, $generateNodesFromDOM as $t } from "@lexical/html";
6
+ import { TOGGLE_LINK_COMMAND as _t, $isLinkNode as st, AutoLinkNode as Ut, LinkNode as Ht } from "@lexical/link";
7
+ import { $isListNode as bt, $isListItemNode as Dt, REMOVE_LIST_COMMAND as Bt, INSERT_UNORDERED_LIST_COMMAND as Ft, ListNode as Wt, ListItemNode as jt } from "@lexical/list";
8
+ import { AutoFocusPlugin as Kt } from "@lexical/react/LexicalAutoFocusPlugin";
9
9
  import { AutoLinkPlugin as Gt } from "@lexical/react/LexicalAutoLinkPlugin";
10
- import { useLexicalComposerContext as wt } from "@lexical/react/LexicalComposerContext";
11
- import { ContentEditable as Zt } from "@lexical/react/LexicalContentEditable";
12
- import { LexicalErrorBoundary as qt } from "@lexical/react/LexicalErrorBoundary";
13
- import { LexicalExtensionComposer as Vt } from "@lexical/react/LexicalExtensionComposer";
14
- import { HistoryPlugin as Xt } from "@lexical/react/LexicalHistoryPlugin";
15
- import { LinkPlugin as Yt } from "@lexical/react/LexicalLinkPlugin";
10
+ import { useLexicalComposerContext as At } from "@lexical/react/LexicalComposerContext";
11
+ import { ContentEditable as qt } from "@lexical/react/LexicalContentEditable";
12
+ import { LexicalErrorBoundary as Yt } from "@lexical/react/LexicalErrorBoundary";
13
+ import { LexicalExtensionComposer as Zt } from "@lexical/react/LexicalExtensionComposer";
14
+ import { HistoryPlugin as Vt } from "@lexical/react/LexicalHistoryPlugin";
15
+ import { LinkPlugin as Xt } from "@lexical/react/LexicalLinkPlugin";
16
16
  import { ListPlugin as Jt } from "@lexical/react/LexicalListPlugin";
17
17
  import { OnChangePlugin as Qt } from "@lexical/react/LexicalOnChangePlugin";
18
18
  import { RichTextPlugin as te } from "@lexical/react/LexicalRichTextPlugin";
19
- import nt from "classix";
20
- import { $getNodeByKey as ut, $isParagraphNode as xt, DecoratorNode as ee, $applyNodeReplacement as re, createCommand as Et, COMMAND_PRIORITY_HIGH as Mt, PASTE_COMMAND as ie, $insertNodes as Ct, $isRangeSelection as bt, $setSelection as Pt, $getSelection as kt, $isTextNode as it, $createTextNode as ne, $isNodeSelection as oe, COMMAND_PRIORITY_LOW as yt, SELECTION_CHANGE_COMMAND as ae, FORMAT_TEXT_COMMAND as Dt, defineExtension as se, $getRoot as le } from "lexical";
21
- import { useRef as x, useState as k, useEffect as F, useCallback as C, useId as ce } from "react";
22
- import vt from "sanitize-html";
23
- import { Button as N } from "../button/index.js";
24
- import { File as ue } from "../file/index.js";
25
- import { mergeRegister as de } from "@lexical/utils";
26
- import { Icon as P } from "../icon/index.js";
27
- import { I as Nt } from "../../index-Dd20d_9U.js";
28
- import { Toolbar as me } from "../toolbar/index.js";
29
- const he = "_field_1trki_3", ge = "_editor_1trki_8", fe = "_submit_1trki_26", pe = "_resizable_1trki_56", _e = "_resized_1trki_60", be = "_invalid_1trki_86", ke = "_error_1trki_90", De = "_dragging_1trki_96", ve = "_content_1trki_100", Ie = "_files_1trki_116", we = "_placeholder_1trki_125", Ce = "_fill_1trki_133", Le = "_meta_1trki_161", Ae = "_active_1trki_170", Me = "_bold_1trki_240", ye = "_italic_1trki_244", Ne = "_underline_1trki_248", xe = "_link_1trki_252", Ee = "_list_1trki_258", Pe = "_paragraph_1trki_259", h = {
30
- field: he,
31
- editor: ge,
32
- submit: fe,
33
- "image-resize-handle": "_image-resize-handle_1trki_50",
34
- resizable: pe,
35
- resized: _e,
36
- "resize-handle": "_resize-handle_1trki_64",
37
- invalid: be,
38
- error: ke,
39
- dragging: De,
40
- content: ve,
41
- "has-files": "_has-files_1trki_112",
42
- files: Ie,
43
- placeholder: we,
44
- fill: Ce,
45
- "fill-editor": "_fill-editor_1trki_141",
46
- meta: Le,
47
- active: Ae,
48
- "inline-image": "_inline-image_1trki_182",
49
- bold: Me,
50
- italic: ye,
51
- underline: Ne,
52
- link: xe,
53
- list: Ee,
54
- paragraph: Pe
19
+ import at from "classix";
20
+ import { $getNodeByKey as gt, $isParagraphNode as xt, DecoratorNode as ee, $applyNodeReplacement as re, createCommand as zt, COMMAND_PRIORITY_HIGH as Mt, PASTE_COMMAND as ie, $insertNodes as Lt, $isRangeSelection as vt, $setSelection as St, $getSelection as It, $isTextNode as lt, $createTextNode as ne, $isNodeSelection as oe, COMMAND_PRIORITY_LOW as yt, SELECTION_CHANGE_COMMAND as se, FORMAT_TEXT_COMMAND as wt, defineExtension as le, $getRoot as ae, CLEAR_HISTORY_COMMAND as ce } from "lexical";
21
+ import { useRef as L, useState as w, useEffect as Z, useCallback as k, useId as ue } from "react";
22
+ import Ct from "sanitize-html";
23
+ import { Button as P } from "../button/index.js";
24
+ import { File as de } from "../file/index.js";
25
+ import { mergeRegister as me } from "@lexical/utils";
26
+ import { Icon as O } from "../icon/index.js";
27
+ import { I as Nt } from "../../index-FSKjg3Z8.js";
28
+ import { Toolbar as he } from "../toolbar/index.js";
29
+ const ge = "_field_mzlbe_3", fe = "_editor_mzlbe_8", pe = "_submit_mzlbe_26", _e = "_resizable_mzlbe_71", be = "_resized_mzlbe_75", De = "_invalid_mzlbe_101", ve = "_error_mzlbe_105", Ie = "_dragging_mzlbe_111", we = "_content_mzlbe_115", Ce = "_embedded_mzlbe_127", ke = "_files_mzlbe_147", Ae = "_placeholder_mzlbe_156", Le = "_fill_mzlbe_164", Me = "_meta_mzlbe_196", ye = "_active_mzlbe_205", Ne = "_bold_mzlbe_276", xe = "_italic_mzlbe_280", ze = "_underline_mzlbe_284", Se = "_link_mzlbe_288", Pe = "_list_mzlbe_294", Te = "_paragraph_mzlbe_295", g = {
30
+ field: ge,
31
+ editor: fe,
32
+ submit: pe,
33
+ "image-resize-handle": "_image-resize-handle_mzlbe_50",
34
+ "with-controls": "_with-controls_mzlbe_56",
35
+ resizable: _e,
36
+ resized: be,
37
+ "resize-handle": "_resize-handle_mzlbe_79",
38
+ invalid: De,
39
+ error: ve,
40
+ dragging: Ie,
41
+ content: we,
42
+ embedded: Ce,
43
+ "has-files": "_has-files_mzlbe_143",
44
+ files: ke,
45
+ placeholder: Ae,
46
+ fill: Le,
47
+ "fill-editor": "_fill-editor_mzlbe_172",
48
+ meta: Me,
49
+ active: ye,
50
+ "inline-image": "_inline-image_mzlbe_217",
51
+ bold: Ne,
52
+ italic: xe,
53
+ underline: ze,
54
+ link: Se,
55
+ list: Pe,
56
+ paragraph: Te
55
57
  };
56
- function Se({
57
- alt: s = "",
58
- editor: r,
59
- height: e,
58
+ function Ee({
59
+ alt: l = "",
60
+ editor: e,
61
+ height: t,
60
62
  nodeKey: c,
61
- soliboDocumentId: g,
62
- soliboDocumentSlot: m,
63
- src: p,
63
+ soliboDocumentId: f,
64
+ soliboDocumentSlot: h,
65
+ src: b,
64
66
  width: n
65
67
  }) {
66
- const u = x(null), f = x(null), [$, A] = k(), L = () => {
67
- const i = r.getRootElement();
68
- if (!i) return 1 / 0;
69
- const l = getComputedStyle(i);
70
- return Math.max(1, i.clientWidth - (parseFloat(l.paddingLeft) || 0) - (parseFloat(l.paddingRight) || 0));
71
- }, S = (i, l = L()) => Math.round(Math.min(l, Math.max(Math.min(32, l), i))), w = (i) => {
72
- r.update(() => {
73
- const l = ut(c);
74
- mt(l) && l.setWidth(i);
75
- }), A(void 0);
68
+ const a = L(null), p = L(null), [z, C] = w(), v = () => {
69
+ const o = e.getRootElement();
70
+ if (!o) return 1 / 0;
71
+ const u = getComputedStyle(o);
72
+ return Math.max(1, o.clientWidth - (parseFloat(u.paddingLeft) || 0) - (parseFloat(u.paddingRight) || 0));
73
+ }, M = (o, u = v()) => Math.round(Math.min(u, Math.max(Math.min(32, u), o))), $ = (o) => {
74
+ e.update(() => {
75
+ const u = gt(c);
76
+ pt(u) && u.setWidth(o);
77
+ }), C(void 0);
76
78
  };
77
- return /* @__PURE__ */ O("span", { className: h["inline-image"], contentEditable: !1, tabIndex: m ? 0 : void 0, onKeyDown: (i) => {
78
- !m || i.target !== i.currentTarget || !["Backspace", "Delete"].includes(i.key) || (i.preventDefault(), i.stopPropagation(), r.update(() => {
79
- const l = ut(c);
80
- if (!mt(l)) return;
81
- const b = l.getParent();
82
- xt(b) && b.getChildrenSize() === 1 ? b.remove() : l.remove(), r.dispatchCommand(St, m);
83
- }), r.focus());
79
+ return /* @__PURE__ */ F("span", { className: g["inline-image"], contentEditable: !1, tabIndex: h ? 0 : void 0, onKeyDown: (o) => {
80
+ !h || o.target !== o.currentTarget || !["Backspace", "Delete"].includes(o.key) || (o.preventDefault(), o.stopPropagation(), e.update(() => {
81
+ const u = gt(c);
82
+ if (!pt(u)) return;
83
+ const D = u.getParent();
84
+ xt(D) && D.getChildrenSize() === 1 ? D.remove() : u.remove(), e.dispatchCommand(Pt, h);
85
+ }), e.focus());
84
86
  }, "data-component": "editorimage", children: [
85
- /* @__PURE__ */ o("img", { alt: s, "data-solibo-document-id": g, "data-solibo-document-slot": m, draggable: !1, height: $ === void 0 ? e : void 0, ref: u, src: p, width: $ ?? n, onClick: (i) => {
86
- var l;
87
- i.preventDefault(), m && ((l = i.currentTarget.parentElement) == null || l.focus()), r.dispatchCommand(Tt, {
87
+ /* @__PURE__ */ s("img", { alt: l, "data-solibo-document-id": f, "data-solibo-document-slot": h, draggable: !1, height: z === void 0 ? t : void 0, ref: a, src: b, width: z ?? n, onClick: (o) => {
88
+ var u;
89
+ o.preventDefault(), h && ((u = o.currentTarget.parentElement) == null || u.focus()), e.dispatchCommand(Tt, {
88
90
  key: c,
89
- soliboDocumentSlot: m,
90
- src: p,
91
+ soliboDocumentSlot: h,
92
+ src: b,
91
93
  width: n
92
94
  });
93
95
  } }),
94
- /* @__PURE__ */ o("button", { type: "button", "aria-label": `Resize image${s ? `: ${s}` : ""}`, title: "Drag to resize; use arrow keys to adjust width", className: h["image-resize-handle"], tabIndex: 0, onClick: (i) => {
95
- i.preventDefault(), i.stopPropagation();
96
- }, onKeyDown: (i) => {
97
- var b;
98
- if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(i.key)) return;
99
- i.preventDefault(), i.stopPropagation();
100
- const l = ((b = u.current) == null ? void 0 : b.getBoundingClientRect().width) ?? n ?? 32;
101
- w(S(l + (["ArrowRight", "ArrowUp"].includes(i.key) ? 10 : -10)));
102
- }, onPointerDown: (i) => {
103
- i.button !== 0 || !u.current || (i.preventDefault(), i.stopPropagation(), i.currentTarget.focus({
96
+ /* @__PURE__ */ s("button", { type: "button", "aria-label": `Resize image${l ? `: ${l}` : ""}`, title: "Drag to resize; use arrow keys to adjust width", className: g["image-resize-handle"], tabIndex: 0, onClick: (o) => {
97
+ o.preventDefault(), o.stopPropagation();
98
+ }, onKeyDown: (o) => {
99
+ var D;
100
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(o.key)) return;
101
+ o.preventDefault(), o.stopPropagation();
102
+ const u = ((D = a.current) == null ? void 0 : D.getBoundingClientRect().width) ?? n ?? 32;
103
+ $(M(u + (["ArrowRight", "ArrowUp"].includes(o.key) ? 10 : -10)));
104
+ }, onPointerDown: (o) => {
105
+ o.button !== 0 || !a.current || (o.preventDefault(), o.stopPropagation(), o.currentTarget.focus({
104
106
  preventScroll: !0
105
- }), i.currentTarget.setPointerCapture(i.pointerId), f.current = {
106
- pointerId: i.pointerId,
107
- x: i.clientX,
108
- width: u.current.getBoundingClientRect().width,
109
- maximum: L()
107
+ }), o.currentTarget.setPointerCapture(o.pointerId), p.current = {
108
+ pointerId: o.pointerId,
109
+ x: o.clientX,
110
+ width: a.current.getBoundingClientRect().width,
111
+ maximum: v()
110
112
  });
111
- }, onPointerMove: (i) => {
112
- const l = f.current;
113
- !l || l.pointerId !== i.pointerId || A(S(l.width + i.clientX - l.x, l.maximum));
114
- }, onPointerUp: (i) => {
115
- const l = f.current;
116
- !l || l.pointerId !== i.pointerId || (f.current = null, w(S(l.width + i.clientX - l.x, l.maximum)), i.currentTarget.releasePointerCapture(i.pointerId));
113
+ }, onPointerMove: (o) => {
114
+ const u = p.current;
115
+ !u || u.pointerId !== o.pointerId || C(M(u.width + o.clientX - u.x, u.maximum));
116
+ }, onPointerUp: (o) => {
117
+ const u = p.current;
118
+ !u || u.pointerId !== o.pointerId || (p.current = null, $(M(u.width + o.clientX - u.x, u.maximum)), o.currentTarget.releasePointerCapture(o.pointerId));
117
119
  }, onPointerCancel: () => {
118
- f.current = null, A(void 0);
120
+ p.current = null, C(void 0);
119
121
  }, onLostPointerCapture: () => {
120
- f.current = null, A(void 0);
122
+ p.current = null, C(void 0);
121
123
  } })
122
124
  ] });
123
125
  }
124
- const St = Et(), Tt = Et();
125
- class ot extends ee {
126
- constructor(e, c, g, m, p, n, u) {
127
- super(p);
128
- j(this, "__src");
129
- j(this, "__alt");
130
- j(this, "__width");
131
- j(this, "__height");
132
- j(this, "__soliboDocumentId");
133
- j(this, "__soliboDocumentSlot");
134
- this.__src = e, this.__alt = c, this.__width = g, this.__height = m, this.__soliboDocumentId = n, this.__soliboDocumentSlot = u;
126
+ const Pt = zt(), Tt = zt();
127
+ class ct extends ee {
128
+ constructor(t, c, f, h, b, n, a) {
129
+ super(b);
130
+ J(this, "__src");
131
+ J(this, "__alt");
132
+ J(this, "__width");
133
+ J(this, "__height");
134
+ J(this, "__soliboDocumentId");
135
+ J(this, "__soliboDocumentSlot");
136
+ this.__src = t, this.__alt = c, this.__width = f, this.__height = h, this.__soliboDocumentId = n, this.__soliboDocumentSlot = a;
135
137
  }
136
138
  static getType() {
137
139
  return "image";
138
140
  }
139
- static clone(e) {
140
- return new ot(e.__src, e.__alt, e.__width, e.__height, e.__key, e.__soliboDocumentId, e.__soliboDocumentSlot);
141
+ static clone(t) {
142
+ return new ct(t.__src, t.__alt, t.__width, t.__height, t.__key, t.__soliboDocumentId, t.__soliboDocumentSlot);
141
143
  }
142
- static importJSON(e) {
143
- return dt({
144
- alt: e.alt,
145
- height: e.height,
146
- soliboDocumentId: e.soliboDocumentId,
147
- soliboDocumentSlot: e.soliboDocumentSlot,
148
- src: e.src,
149
- width: e.width
144
+ static importJSON(t) {
145
+ return ft({
146
+ alt: t.alt,
147
+ height: t.height,
148
+ soliboDocumentId: t.soliboDocumentId,
149
+ soliboDocumentSlot: t.soliboDocumentSlot,
150
+ src: t.src,
151
+ width: t.width
150
152
  });
151
153
  }
152
154
  exportJSON() {
@@ -168,22 +170,22 @@ class ot extends ee {
168
170
  static importDOM() {
169
171
  return {
170
172
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
171
- img: (e) => ({
173
+ img: (t) => ({
172
174
  conversion: (c) => {
173
175
  if (!(c instanceof HTMLImageElement))
174
176
  return null;
175
- const g = c.getAttribute("src") ?? "";
176
- if (!g)
177
+ const f = c.getAttribute("src") ?? "";
178
+ if (!f)
177
179
  return null;
178
- const m = c.getAttribute("width"), p = c.getAttribute("height");
180
+ const h = c.getAttribute("width"), b = c.getAttribute("height");
179
181
  return {
180
- node: dt({
182
+ node: ft({
181
183
  alt: c.getAttribute("alt") ?? "",
182
- height: p ? Number(p) : void 0,
184
+ height: b ? Number(b) : void 0,
183
185
  soliboDocumentId: c.getAttribute("data-solibo-document-id") ?? void 0,
184
186
  soliboDocumentSlot: c.getAttribute("data-solibo-document-slot") ?? void 0,
185
- src: g,
186
- width: m ? Number(m) : void 0
187
+ src: f,
188
+ width: h ? Number(h) : void 0
187
189
  })
188
190
  };
189
191
  },
@@ -192,9 +194,9 @@ class ot extends ee {
192
194
  };
193
195
  }
194
196
  exportDOM() {
195
- const e = document.createElement("img");
196
- return this.__soliboDocumentSlot || e.setAttribute("src", this.__src), this.__soliboDocumentId && e.setAttribute("data-solibo-document-id", this.__soliboDocumentId), this.__soliboDocumentSlot && e.setAttribute("data-solibo-document-slot", this.__soliboDocumentSlot), this.__alt && e.setAttribute("alt", this.__alt), this.__width && e.setAttribute("width", String(this.__width)), this.__height && e.setAttribute("height", String(this.__height)), {
197
- element: e
197
+ const t = document.createElement("img");
198
+ return this.__soliboDocumentSlot || t.setAttribute("src", this.__src), this.__soliboDocumentId && t.setAttribute("data-solibo-document-id", this.__soliboDocumentId), this.__soliboDocumentSlot && t.setAttribute("data-solibo-document-slot", this.__soliboDocumentSlot), this.__alt && t.setAttribute("alt", this.__alt), this.__width && t.setAttribute("width", String(this.__width)), this.__height && t.setAttribute("height", String(this.__height)), {
199
+ element: t
198
200
  };
199
201
  }
200
202
  createDOM() {
@@ -209,465 +211,484 @@ class ot extends ee {
209
211
  getSrc() {
210
212
  return this.__src;
211
213
  }
212
- setSrc(e) {
214
+ setSrc(t) {
213
215
  const c = this.getWritable();
214
- return c.__src = e, c;
216
+ return c.__src = t, c;
215
217
  }
216
- setWidth(e) {
218
+ setWidth(t) {
217
219
  const c = this.getWritable();
218
- return c.__width = e, c.__height = void 0, c;
220
+ return c.__width = t, c.__height = void 0, c;
219
221
  }
220
- decorate(e) {
221
- return /* @__PURE__ */ o(Se, { alt: this.__alt, editor: e, height: this.__height, nodeKey: this.getKey(), soliboDocumentId: this.__soliboDocumentId, soliboDocumentSlot: this.__soliboDocumentSlot, src: this.__src, width: this.__width });
222
+ decorate(t) {
223
+ return /* @__PURE__ */ s(Ee, { alt: this.__alt, editor: t, height: this.__height, nodeKey: this.getKey(), soliboDocumentId: this.__soliboDocumentId, soliboDocumentSlot: this.__soliboDocumentSlot, src: this.__src, width: this.__width });
222
224
  }
223
225
  }
224
- function dt({
225
- alt: s = "",
226
- height: r,
227
- soliboDocumentId: e,
226
+ function ft({
227
+ alt: l = "",
228
+ height: e,
229
+ soliboDocumentId: t,
228
230
  soliboDocumentSlot: c,
229
- src: g,
230
- width: m
231
+ src: f,
232
+ width: h
231
233
  }) {
232
- return re(new ot(g, s, m, r, void 0, e, c));
234
+ return re(new ct(f, l, h, e, void 0, t, c));
233
235
  }
234
- function mt(s) {
235
- return s instanceof ot;
236
+ function pt(l) {
237
+ return l instanceof ct;
236
238
  }
237
- const Te = ({
238
- createImages: s,
239
- onRemove: r
239
+ const Re = ({
240
+ createImages: l,
241
+ onRemove: e
240
242
  }) => {
241
- const [e] = wt();
242
- return F(() => e.registerCommand(St, (c) => (r(c), !0), Mt), [e, r]), F(() => e.registerCommand(ie, (c) => {
243
+ const [t] = At();
244
+ return Z(() => t.registerCommand(Pt, (c) => (e(c), !0), Mt), [t, e]), Z(() => t.registerCommand(ie, (c) => {
243
245
  var n;
244
246
  if (!("clipboardData" in c)) return !1;
245
- const g = c, m = Array.from(((n = g.clipboardData) == null ? void 0 : n.items) ?? []).flatMap((u) => {
246
- if (u.kind !== "file" || !u.type.startsWith("image/")) return [];
247
- const f = u.getAsFile();
248
- return f ? [f] : [];
247
+ const f = c, h = Array.from(((n = f.clipboardData) == null ? void 0 : n.items) ?? []).flatMap((a) => {
248
+ if (a.kind !== "file" || !a.type.startsWith("image/")) return [];
249
+ const p = a.getAsFile();
250
+ return p ? [p] : [];
249
251
  });
250
- if (m.length === 0) return !1;
251
- g.preventDefault();
252
- const p = s(m);
253
- return e.update(() => {
254
- Ct(p.map((u) => dt(u)));
252
+ if (h.length === 0) return !1;
253
+ f.preventDefault();
254
+ const b = l(h);
255
+ return t.update(() => {
256
+ Lt(b.map((a) => ft(a)));
255
257
  }), !0;
256
- }, Mt), [s, e]), null;
257
- }, Re = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/, Oe = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/, $e = [(s) => {
258
- const r = Re.exec(s);
259
- return r != null && r.length ? {
260
- index: r.index,
261
- length: r[0].length,
262
- text: r[0],
263
- url: `mailto:${r[0]}`
258
+ }, Mt), [l, t]), null;
259
+ }, Oe = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/, $e = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/, Ue = [(l) => {
260
+ const e = Oe.exec(l);
261
+ return e != null && e.length ? {
262
+ index: e.index,
263
+ length: e[0].length,
264
+ text: e[0],
265
+ url: `mailto:${e[0]}`
264
266
  } : null;
265
- }, (s) => {
266
- const r = Oe.exec(s);
267
- return r != null && r.length ? {
268
- index: r.index,
269
- length: r[0].length,
270
- text: r[0],
271
- url: r[0].startsWith("http") ? r[0] : `https://${r[0]}`
267
+ }, (l) => {
268
+ const e = $e.exec(l);
269
+ return e != null && e.length ? {
270
+ index: e.index,
271
+ length: e[0].length,
272
+ text: e[0],
273
+ url: e[0].startsWith("http") ? e[0] : `https://${e[0]}`
272
274
  } : null;
273
275
  }];
274
- function It(s) {
276
+ function kt(l) {
275
277
  try {
276
- const r = new URL(s);
277
- return r.protocol === "http:" || r.protocol === "https:";
278
+ const e = new URL(l);
279
+ return e.protocol === "http:" || e.protocol === "https:";
278
280
  } catch {
279
281
  return !1;
280
282
  }
281
283
  }
282
- function Ue({
283
- editableRef: s
284
+ function He({
285
+ editableRef: l
284
286
  }) {
285
- const r = x(null), [e, c] = k(0), [g, m] = k(0);
286
- F(() => {
287
- const n = s.current;
287
+ const e = L(null), [t, c] = w(0), [f, h] = w(0);
288
+ Z(() => {
289
+ const n = l.current;
288
290
  if (!n) return;
289
- const u = () => {
290
- c(Math.round(n.getBoundingClientRect().height)), m(Math.round(parseFloat(getComputedStyle(n).minHeight) || 0));
291
+ const a = () => {
292
+ c(Math.round(n.getBoundingClientRect().height)), h(Math.round(parseFloat(getComputedStyle(n).minHeight) || 0));
291
293
  };
292
- if (u(), typeof ResizeObserver > "u") return;
293
- const f = new ResizeObserver(u);
294
- return f.observe(n), () => f.disconnect();
295
- }, [s]);
296
- const p = (n) => {
297
- const u = s.current;
298
- if (!u) return;
299
- const f = parseFloat(getComputedStyle(u).minHeight) || 0;
300
- u.style.height = `${Math.max(f, n)}px`;
294
+ if (a(), typeof ResizeObserver > "u") return;
295
+ const p = new ResizeObserver(a);
296
+ return p.observe(n), () => p.disconnect();
297
+ }, [l]);
298
+ const b = (n) => {
299
+ const a = l.current;
300
+ if (!a) return;
301
+ const p = parseFloat(getComputedStyle(a).minHeight) || 0;
302
+ a.style.height = `${Math.max(p, n)}px`;
301
303
  };
302
- return /* @__PURE__ */ o("div", { "aria-label": "Resize editor", "aria-orientation": "horizontal", "aria-valuemin": g, "aria-valuenow": e, "aria-valuetext": `${e} pixels`, className: h["resize-handle"], role: "separator", tabIndex: 0, onDoubleClick: () => {
304
+ return /* @__PURE__ */ s("div", { "aria-label": "Resize editor", "aria-orientation": "horizontal", "aria-valuemin": f, "aria-valuenow": t, "aria-valuetext": `${t} pixels`, className: g["resize-handle"], role: "separator", tabIndex: 0, onDoubleClick: () => {
303
305
  var n;
304
- return (n = s.current) == null ? void 0 : n.style.removeProperty("height");
306
+ return (n = l.current) == null ? void 0 : n.style.removeProperty("height");
305
307
  }, onKeyDown: (n) => {
306
- const u = s.current;
307
- u && (n.key === "Home" ? (n.preventDefault(), u.style.removeProperty("height")) : (n.key === "ArrowUp" || n.key === "ArrowDown") && (n.preventDefault(), p(u.getBoundingClientRect().height + (n.key === "ArrowUp" ? 20 : -20))));
308
+ const a = l.current;
309
+ a && (n.key === "Home" ? (n.preventDefault(), a.style.removeProperty("height")) : (n.key === "ArrowUp" || n.key === "ArrowDown") && (n.preventDefault(), b(a.getBoundingClientRect().height + (n.key === "ArrowUp" ? 20 : -20))));
308
310
  }, onPointerDown: (n) => {
309
- const u = s.current;
310
- n.button !== 0 || !u || (n.preventDefault(), n.currentTarget.focus({
311
+ const a = l.current;
312
+ n.button !== 0 || !a || (n.preventDefault(), n.currentTarget.focus({
311
313
  preventScroll: !0
312
- }), n.currentTarget.setPointerCapture(n.pointerId), r.current = {
314
+ }), n.currentTarget.setPointerCapture(n.pointerId), e.current = {
313
315
  pointerId: n.pointerId,
314
316
  y: n.clientY,
315
- height: u.getBoundingClientRect().height
317
+ height: a.getBoundingClientRect().height
316
318
  });
317
319
  }, onPointerMove: (n) => {
318
- !r.current || r.current.pointerId !== n.pointerId || p(r.current.height + r.current.y - n.clientY);
320
+ !e.current || e.current.pointerId !== n.pointerId || b(e.current.height + e.current.y - n.clientY);
319
321
  }, onPointerUp: (n) => {
320
- !r.current || r.current.pointerId !== n.pointerId || (r.current = null, n.currentTarget.releasePointerCapture(n.pointerId));
322
+ !e.current || e.current.pointerId !== n.pointerId || (e.current = null, n.currentTarget.releasePointerCapture(n.pointerId));
321
323
  }, onLostPointerCapture: () => {
322
- r.current = null;
324
+ e.current = null;
323
325
  }, onPointerCancel: () => {
324
- r.current = null;
326
+ e.current = null;
325
327
  }, "data-component": "editorresizehandle" });
326
328
  }
327
- const ze = ({
328
- onFilesSelected: s,
329
- onInlineImageRemove: r
329
+ const Be = ({
330
+ onFilesSelected: l,
331
+ onInlineImageRemove: e
330
332
  }) => {
331
- const [e] = wt(), [c, g] = k(!1), [m, p] = k(!1), [n, u] = k(!1), [f, $] = k(!1), [A, L] = k(!1), [S, w] = k(!1), [i, l] = k(""), [b, G] = k(null), [Z, U] = k(null), [z, M] = k(""), Q = It(z.trim()), q = x(null), at = x(null), tt = x(null), T = x(null), E = x(!1), st = (t) => t.preventDefault(), V = C((t) => {
332
- T.current = bt(t) ? t.clone() : null;
333
- }, []), X = C((t) => {
334
- e.update(() => {
335
- T.current && Pt(T.current), t();
336
- }), T.current = null;
337
- }, [e]), lt = (t) => {
338
- E.current = !0, t.preventDefault();
339
- }, R = () => {
340
- if (E.current) {
341
- E.current = !1;
333
+ const [t] = At(), [c, f] = w(!1), [h, b] = w(!1), [n, a] = w(!1), [p, z] = w(!1), [C, v] = w(!1), [M, $] = w(!1), [o, u] = w(""), [D, W] = w(null), [U, j] = w(null), [H, T] = w(""), K = kt(H.trim()), it = L(null), Q = L(null), nt = L(null), E = L(null), G = L(!1), tt = (r) => r.preventDefault(), et = k((r) => {
334
+ E.current = vt(r) ? r.clone() : null;
335
+ }, []), V = k((r) => {
336
+ t.update(() => {
337
+ E.current && St(E.current), r();
338
+ }), E.current = null;
339
+ }, [t]), ut = (r) => {
340
+ G.current = !0, r.preventDefault();
341
+ }, X = () => {
342
+ if (G.current) {
343
+ G.current = !1;
342
344
  return;
343
345
  }
344
- Y();
345
- }, _ = C(() => {
346
- p(!1), l(""), G(null), U(null);
347
- }, []), v = C(() => {
348
- L(!1), M("");
349
- }, []), W = C((t) => {
350
- p(!0), l((t == null ? void 0 : t.src) ?? ""), G((t == null ? void 0 : t.key) ?? null), U((t == null ? void 0 : t.soliboDocumentSlot) ?? null), v(), t != null && t.soliboDocumentSlot || setTimeout(() => {
351
- var a;
352
- return (a = at.current) == null ? void 0 : a.focus();
346
+ A();
347
+ }, y = k(() => {
348
+ b(!1), u(""), W(null), j(null);
349
+ }, []), R = k(() => {
350
+ v(!1), T("");
351
+ }, []), dt = k((r) => {
352
+ b(!0), u((r == null ? void 0 : r.src) ?? ""), W((r == null ? void 0 : r.key) ?? null), j((r == null ? void 0 : r.soliboDocumentSlot) ?? null), R(), r != null && r.soliboDocumentSlot || setTimeout(() => {
353
+ var _;
354
+ return (_ = Q.current) == null ? void 0 : _.focus();
353
355
  }, 0);
354
- }, [v]), K = C((t) => {
355
- e.getEditorState().read(() => {
356
- V(kt());
357
- }), L(!0), M(t), _(), setTimeout(() => {
358
- var a;
359
- return (a = tt.current) == null ? void 0 : a.focus();
356
+ }, [R]), mt = k((r) => {
357
+ t.getEditorState().read(() => {
358
+ et(It());
359
+ }), v(!0), T(r), y(), setTimeout(() => {
360
+ var _;
361
+ return (_ = nt.current) == null ? void 0 : _.focus();
360
362
  }, 0);
361
- }, [_, e, V]), et = C(() => {
362
- const t = z.trim();
363
- It(t) && (X(() => {
364
- e.dispatchCommand(ft, {
365
- url: t,
363
+ }, [y, t, et]), N = k(() => {
364
+ const r = H.trim();
365
+ kt(r) && (V(() => {
366
+ t.dispatchCommand(_t, {
367
+ url: r,
366
368
  target: "_blank"
367
369
  });
368
- const a = kt();
369
- if (!bt(a)) return;
370
- const d = a.getNodes().at(-1) ?? null, D = (d == null ? void 0 : d.getParent()) ?? null, I = rt(d) ? d : rt(D) ? D : null;
370
+ const _ = It();
371
+ if (!vt(_)) return;
372
+ const x = _.getNodes().at(-1) ?? null, B = (x == null ? void 0 : x.getParent()) ?? null, I = st(x) ? x : st(B) ? B : null;
371
373
  if (I) {
372
- const H = I.getLastChild();
373
- if (it(H)) {
374
- const Lt = H.getTextContent(), At = Lt.replace(/\s+$/, "");
375
- At !== Lt && H.setTextContent(At);
374
+ const i = I.getLastChild();
375
+ if (lt(i)) {
376
+ const S = i.getTextContent(), ot = S.replace(/\s+$/, "");
377
+ ot !== S && i.setTextContent(ot);
376
378
  }
377
- const J = I.getNextSibling();
378
- if (it(J) && /^\s/.test(J.getTextContent())) {
379
- J.select(1, 1);
379
+ const m = I.getNextSibling();
380
+ if (lt(m) && /^\s/.test(m.getTextContent())) {
381
+ m.select(1, 1);
380
382
  return;
381
383
  }
382
- const y = ne(" ");
383
- I.insertAfter(y), y.selectEnd();
384
+ const d = ne(" ");
385
+ I.insertAfter(d), d.selectEnd();
384
386
  }
385
- }), v());
386
- }, [v, e, z, X]), Y = C(() => {
387
- const t = i.trim();
388
- if (!t) {
389
- _();
387
+ }), R());
388
+ }, [R, t, H, V]), A = k(() => {
389
+ const r = o.trim();
390
+ if (!r) {
391
+ y();
390
392
  return;
391
393
  }
392
- e.update(() => {
393
- if (b) {
394
- const a = ut(b);
395
- mt(a) && a.setSrc(t);
394
+ t.update(() => {
395
+ if (D) {
396
+ const _ = gt(D);
397
+ pt(_) && _.setSrc(r);
396
398
  return;
397
399
  }
398
- Ct([dt({
399
- src: t
400
+ Lt([ft({
401
+ src: r
400
402
  })]);
401
- }), _();
402
- }, [_, e, b, i]), ht = C(() => {
403
- if (!b) {
404
- _();
403
+ }), y();
404
+ }, [y, t, D, o]), q = k(() => {
405
+ if (!D) {
406
+ y();
405
407
  return;
406
408
  }
407
- e.update(() => {
408
- const t = ut(b);
409
- if (mt(t)) {
410
- const a = t.getParent();
411
- xt(a) && a.getChildrenSize() === 1 ? a.remove() : t.remove(), Z && (r == null || r(Z));
409
+ t.update(() => {
410
+ const r = gt(D);
411
+ if (pt(r)) {
412
+ const _ = r.getParent();
413
+ xt(_) && _.getChildrenSize() === 1 ? _.remove() : r.remove(), U && (e == null || e(U));
412
414
  }
413
- }), _();
414
- }, [_, e, b, Z, r]), gt = C(() => {
415
- X(() => {
416
- e.dispatchCommand(ft, null);
417
- }), v();
418
- }, [v, e, X]), B = C(() => {
419
- const t = kt();
420
- if (!bt(t)) {
421
- if (oe(t)) {
422
- const D = t.getNodes(), I = D[0] ?? null, H = (I == null ? void 0 : I.getParent()) ?? null;
423
- g(D.some((y) => it(y) && y.hasFormat("bold"))), u(D.some((y) => it(y) && y.hasFormat("italic"))), $(D.some((y) => it(y) && y.hasFormat("underline"))), w(pt(H) || _t(H) || pt(I) || _t(I));
424
- const J = rt(I) ? I : rt(H) ? H : null;
425
- if (J) {
426
- L(!0), M(J.getURL());
415
+ }), y();
416
+ }, [y, t, D, U, e]), rt = k(() => {
417
+ V(() => {
418
+ t.dispatchCommand(_t, null);
419
+ }), R();
420
+ }, [R, t, V]), Y = k(() => {
421
+ const r = It();
422
+ if (!vt(r)) {
423
+ if (oe(r)) {
424
+ const B = r.getNodes(), I = B[0] ?? null, i = (I == null ? void 0 : I.getParent()) ?? null;
425
+ f(B.some((d) => lt(d) && d.hasFormat("bold"))), a(B.some((d) => lt(d) && d.hasFormat("italic"))), z(B.some((d) => lt(d) && d.hasFormat("underline"))), $(bt(i) || Dt(i) || bt(I) || Dt(I));
426
+ const m = st(I) ? I : st(i) ? i : null;
427
+ if (m) {
428
+ v(!0), T(m.getURL());
427
429
  return;
428
430
  }
429
- L(!1), M(""), T.current = null;
431
+ v(!1), T(""), E.current = null;
430
432
  return;
431
433
  }
432
- g(!1), u(!1), $(!1), w(!1), L(!1), M(""), T.current = null;
434
+ f(!1), a(!1), z(!1), $(!1), v(!1), T(""), E.current = null;
433
435
  return;
434
436
  }
435
- const [a] = t.getNodes(), d = (a == null ? void 0 : a.getParent()) ?? null;
436
- if (g(t.hasFormat("bold")), u(t.hasFormat("italic")), $(t.hasFormat("underline")), w(pt(d) || _t(d)), rt(d)) {
437
- L(!0), M(d.getURL()), V(t);
437
+ const [_] = r.getNodes(), x = (_ == null ? void 0 : _.getParent()) ?? null;
438
+ if (f(r.hasFormat("bold")), a(r.hasFormat("italic")), z(r.hasFormat("underline")), $(bt(x) || Dt(x)), st(x)) {
439
+ v(!0), T(x.getURL()), et(r);
438
440
  return;
439
441
  }
440
- L(!1), M(""), T.current = null;
441
- }, [V]);
442
- return F(() => de(e.registerUpdateListener(({
443
- editorState: t
442
+ v(!1), T(""), E.current = null;
443
+ }, [et]);
444
+ return Z(() => me(t.registerUpdateListener(({
445
+ editorState: r
444
446
  }) => {
445
- t.read(() => {
446
- B();
447
+ r.read(() => {
448
+ Y();
447
449
  });
448
- }), e.registerCommand(Tt, (t) => (t.soliboDocumentSlot ? (_(), v()) : W(t), !0), yt), e.registerCommand(ae, () => (e.getEditorState().read(() => {
449
- B();
450
- }), !1), yt)), [_, v, e, W, B]), /* @__PURE__ */ O(me, { variant: "editor", "data-component": "editortoolbar", children: [
451
- /* @__PURE__ */ o(N, { "aria-label": "Bold", "data-active": c, onClick: () => {
452
- e.dispatchCommand(Dt, "bold");
453
- }, title: "Bold", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "TextB" }) }),
454
- /* @__PURE__ */ o(N, { "aria-label": "Italic", "data-active": n, onClick: () => {
455
- e.dispatchCommand(Dt, "italic");
456
- }, title: "Italic", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "TextItalic" }) }),
457
- /* @__PURE__ */ o(N, { "aria-label": "Underline", "data-active": f, onClick: () => {
458
- e.dispatchCommand(Dt, "underline");
459
- }, title: "Underline", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "TextUnderline" }) }),
460
- /* @__PURE__ */ o(N, { "aria-label": "List", "data-active": S, onClick: () => {
461
- S ? e.dispatchCommand(Ht, void 0) : e.dispatchCommand(Ft, void 0);
462
- }, title: "List", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "ListBullets" }) }),
463
- /* @__PURE__ */ o(N, { "aria-label": "Link", "data-active": A, onClick: () => {
464
- A ? K(z) : (e.dispatchCommand(ft, {
450
+ }), t.registerCommand(Tt, (r) => (r.soliboDocumentSlot ? (y(), R()) : dt(r), !0), yt), t.registerCommand(se, () => (t.getEditorState().read(() => {
451
+ Y();
452
+ }), !1), yt)), [y, R, t, dt, Y]), /* @__PURE__ */ F(he, { variant: "editor", "data-component": "editortoolbar", children: [
453
+ /* @__PURE__ */ s(P, { "aria-label": "Bold", "data-active": c, onClick: () => {
454
+ t.dispatchCommand(wt, "bold");
455
+ }, title: "Bold", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "TextB" }) }),
456
+ /* @__PURE__ */ s(P, { "aria-label": "Italic", "data-active": n, onClick: () => {
457
+ t.dispatchCommand(wt, "italic");
458
+ }, title: "Italic", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "TextItalic" }) }),
459
+ /* @__PURE__ */ s(P, { "aria-label": "Underline", "data-active": p, onClick: () => {
460
+ t.dispatchCommand(wt, "underline");
461
+ }, title: "Underline", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "TextUnderline" }) }),
462
+ /* @__PURE__ */ s(P, { "aria-label": "List", "data-active": M, onClick: () => {
463
+ M ? t.dispatchCommand(Bt, void 0) : t.dispatchCommand(Ft, void 0);
464
+ }, title: "List", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "ListBullets" }) }),
465
+ /* @__PURE__ */ s(P, { "aria-label": "Link", "data-active": C, onClick: () => {
466
+ C ? mt(H) : (t.dispatchCommand(_t, {
465
467
  url: "https://"
466
- }), K("https://"));
467
- }, title: "Link", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Link" }) }),
468
- s && /* @__PURE__ */ O(ct, { children: [
469
- /* @__PURE__ */ o("input", { hidden: !0, multiple: !0, onChange: (t) => {
470
- t.target.files && s(t.target.files), t.target.value = "";
471
- }, ref: q, type: "file" }),
472
- /* @__PURE__ */ o(N, { "aria-label": "Upload files", onClick: () => {
473
- var t;
474
- return (t = q.current) == null ? void 0 : t.click();
475
- }, title: "Upload files", variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Paperclip" }) })
468
+ }), mt("https://"));
469
+ }, title: "Link", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Link" }) }),
470
+ l && /* @__PURE__ */ F(ht, { children: [
471
+ /* @__PURE__ */ s("input", { hidden: !0, multiple: !0, onChange: (r) => {
472
+ r.target.files && l(r.target.files), r.target.value = "";
473
+ }, ref: it, type: "file" }),
474
+ /* @__PURE__ */ s(P, { "aria-label": "Upload files", onClick: () => {
475
+ var r;
476
+ return (r = it.current) == null ? void 0 : r.click();
477
+ }, title: "Upload files", variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Paperclip" }) })
476
478
  ] }),
477
- /* @__PURE__ */ O("div", { className: nt(h.meta, A || m ? h.active : ""), children: [
478
- A && /* @__PURE__ */ O(ct, { children: [
479
- /* @__PURE__ */ o(Nt, { "aria-invalid": !Q, onBlur: () => et(), onChange: (t) => M(t.target.value), onKeyDown: (t) => {
480
- t.key === "Enter" && (t.preventDefault(), et());
481
- }, ref: tt, value: z }),
482
- /* @__PURE__ */ o(N, { "aria-label": "Apply link", disabled: !Q, onClick: () => {
483
- et();
484
- }, onMouseDown: st, variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Check" }) }),
485
- /* @__PURE__ */ o(N, { "aria-label": "Remove link", onClick: () => gt(), onMouseDown: st, variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Trash", variant: "danger" }) })
479
+ /* @__PURE__ */ F("div", { className: at(g.meta, C || h ? g.active : ""), children: [
480
+ C && /* @__PURE__ */ F(ht, { children: [
481
+ /* @__PURE__ */ s(Nt, { "aria-invalid": !K, onBlur: () => N(), onChange: (r) => T(r.target.value), onKeyDown: (r) => {
482
+ r.key === "Enter" && (r.preventDefault(), N());
483
+ }, ref: nt, value: H }),
484
+ /* @__PURE__ */ s(P, { "aria-label": "Apply link", disabled: !K, onClick: () => {
485
+ N();
486
+ }, onMouseDown: tt, variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Check" }) }),
487
+ /* @__PURE__ */ s(P, { "aria-label": "Remove link", onClick: () => rt(), onMouseDown: tt, variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Trash", variant: "danger" }) })
486
488
  ] }),
487
- m && /* @__PURE__ */ O(ct, { children: [
488
- !Z && /* @__PURE__ */ O(ct, { children: [
489
- /* @__PURE__ */ o(Nt, { className: nt(h.active), onBlur: R, onChange: (t) => l(t.target.value), onKeyDown: (t) => {
490
- t.key === "Enter" && (t.preventDefault(), E.current = !0, Y());
491
- }, ref: at, value: i }),
492
- /* @__PURE__ */ o(N, { "aria-label": "Apply image", onClick: () => Y(), onMouseDown: lt, variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Check" }) })
489
+ h && /* @__PURE__ */ F(ht, { children: [
490
+ !U && /* @__PURE__ */ F(ht, { children: [
491
+ /* @__PURE__ */ s(Nt, { className: at(g.active), onBlur: X, onChange: (r) => u(r.target.value), onKeyDown: (r) => {
492
+ r.key === "Enter" && (r.preventDefault(), G.current = !0, A());
493
+ }, ref: Q, value: o }),
494
+ /* @__PURE__ */ s(P, { "aria-label": "Apply image", onClick: () => A(), onMouseDown: ut, variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Check" }) })
493
495
  ] }),
494
- /* @__PURE__ */ o(N, { "aria-label": "Remove image", onClick: () => ht(), onMouseDown: lt, variant: "tertiary", children: /* @__PURE__ */ o(P, { name: "Trash", variant: "danger" }) })
496
+ /* @__PURE__ */ s(P, { "aria-label": "Remove image", onClick: () => q(), onMouseDown: ut, variant: "tertiary", children: /* @__PURE__ */ s(O, { name: "Trash", variant: "danger" }) })
495
497
  ] })
496
498
  ] })
497
499
  ] });
498
- }, Be = se({
500
+ }, Fe = le({
499
501
  name: "solibo-editor",
500
502
  namespace: "Editor",
501
- nodes: [zt, Bt, Wt, Kt, ot],
502
- onError(s) {
503
- throw s;
503
+ nodes: [Ut, Ht, Wt, jt, ct],
504
+ onError(l) {
505
+ throw l;
504
506
  },
505
507
  theme: {
506
- link: h.link,
508
+ link: g.link,
507
509
  list: {
508
- ol: h.list,
509
- ul: h.list
510
+ ol: g.list,
511
+ ul: g.list
510
512
  },
511
- paragraph: h.paragraph,
513
+ paragraph: g.paragraph,
512
514
  text: {
513
- bold: h.bold,
514
- italic: h.italic,
515
- underline: h.underline
515
+ bold: g.bold,
516
+ italic: g.italic,
517
+ underline: g.underline
516
518
  }
517
519
  }
518
520
  });
519
- function He({
520
- autofocus: s,
521
- content: r = "",
522
- lastEmittedContentRef: e
521
+ function We({
522
+ autofocus: l,
523
+ content: e = "",
524
+ sessionKey: t,
525
+ lastEmittedContentRef: c,
526
+ imagePreviews: f
523
527
  }) {
524
- const [c] = wt();
525
- return F(() => {
526
- e.current !== r && c.update(() => {
527
- const m = new DOMParser().parseFromString(r, "text/html"), p = Ut(c, m), n = le();
528
- n.clear().select(), Ct(p), s ? n.selectEnd() : Pt(null);
529
- });
530
- }, [s, r, c, e]), null;
528
+ const [h] = At(), b = L(t);
529
+ return Z(() => {
530
+ const n = b.current !== t;
531
+ b.current = t, !(!n && c.current === e) && (h.update(() => {
532
+ const p = new DOMParser().parseFromString(e, "text/html");
533
+ p.querySelectorAll("img[data-solibo-document-slot]").forEach((v) => {
534
+ const M = f.get(v.getAttribute("data-solibo-document-slot"));
535
+ M && v.setAttribute("src", M);
536
+ });
537
+ const z = $t(h, p), C = ae();
538
+ C.clear().select(), Lt(z), l || n ? C.selectEnd() : St(null);
539
+ }, {
540
+ discrete: !0
541
+ }), n && h.dispatchCommand(ce, void 0));
542
+ }, [l, e, h, f, c, t]), null;
531
543
  }
532
- const gr = ({
533
- autofocus: s = !1,
534
- autolink: r = !1,
535
- content: e,
536
- disabled: c = !1,
537
- errorMessage: g,
538
- fill: m = !1,
544
+ const pr = ({
545
+ autofocus: l = !1,
546
+ attachmentsEnabled: e = !0,
547
+ sessionKey: t,
548
+ autolink: c = !1,
549
+ content: f,
550
+ controls: h,
551
+ disabled: b = !1,
552
+ errorMessage: n,
553
+ fill: a = !1,
539
554
  files: p,
540
- inline: n = !1,
541
- inlineImages: u,
542
- invalid: f = !1,
543
- isSubmitting: $ = !1,
544
- maxRows: A = 12,
545
- minRows: L = 1,
546
- onChange: S,
547
- onFilesChange: w,
548
- onInlineImagesChange: i,
549
- onSubmit: l,
550
- onUpload: b,
551
- placeholder: G,
552
- required: Z = !1,
553
- resizable: U = !1,
554
- submitLabel: z = "Submit"
555
+ inline: z = !1,
556
+ inlineImages: C,
557
+ invalid: v = !1,
558
+ isSubmitting: M = !1,
559
+ maxRows: $ = 12,
560
+ minRows: o = 1,
561
+ onChange: u,
562
+ onFilesChange: D,
563
+ onInlineImagesChange: W,
564
+ onSubmit: U,
565
+ onUpload: j,
566
+ placeholder: H,
567
+ required: T = !1,
568
+ resizable: K = !1,
569
+ submitLabel: it = "Submit",
570
+ variant: Q = "default"
555
571
  }) => {
556
- const M = ce(), Q = x(void 0), q = x(null), [at, tt] = k(!1), [T, E] = k(!1), [st, V] = k([]), [X, lt] = k([]), R = x(/* @__PURE__ */ new Map()), _ = p ?? st, v = u ?? X;
557
- F(() => {
558
- const t = q.current;
559
- if (!t) return;
560
- if (!U || m) {
561
- t.style.removeProperty("height"), tt(!1);
572
+ const nt = ue(), E = L(void 0), G = L(!1), tt = L(null), [et, V] = w(!1), [ut, X] = w(!1), [y, R] = w([]), [dt, mt] = w([]), N = L(/* @__PURE__ */ new Map()), A = p ?? y, q = C ?? dt;
573
+ Z(() => {
574
+ const i = tt.current;
575
+ if (!i) return;
576
+ if (!K || a) {
577
+ i.style.removeProperty("height"), V(!1);
562
578
  return;
563
579
  }
564
- const a = () => tt(t.style.height !== ""), d = new MutationObserver(a);
565
- return d.observe(t, {
580
+ const m = () => V(i.style.height !== ""), d = new MutationObserver(m);
581
+ return d.observe(i, {
566
582
  attributes: !0,
567
583
  attributeFilter: ["style"]
568
- }), a(), () => d.disconnect();
569
- }, [m, U]);
570
- const W = (t) => {
571
- p === void 0 && V(t), w == null || w(t);
572
- }, K = C((t) => {
573
- u === void 0 && lt(t), i == null || i(t);
574
- }, [u, i]), et = C((t) => {
575
- const a = t.map((d) => {
576
- const D = `pasted-${crypto.randomUUID()}`, I = URL.createObjectURL(d);
577
- return R.current.set(D, I), {
584
+ }), m(), () => d.disconnect();
585
+ }, [a, K]);
586
+ const rt = (i) => {
587
+ p === void 0 && R(i), D == null || D(i);
588
+ }, Y = k((i) => {
589
+ C === void 0 && mt(i), W == null || W(i);
590
+ }, [C, W]), r = k((i) => {
591
+ const m = i.map((d) => {
592
+ const S = `pasted-${crypto.randomUUID()}`, ot = URL.createObjectURL(d);
593
+ return N.current.set(S, ot), {
578
594
  image: {
579
595
  alt: d.name,
580
- soliboDocumentSlot: D,
581
- src: I
596
+ soliboDocumentSlot: S,
597
+ src: ot
582
598
  },
583
599
  pending: {
584
600
  file: d,
585
- slot: D
601
+ slot: S
586
602
  }
587
603
  };
588
604
  });
589
- return K([...v, ...a.map(({
605
+ return Y([...q, ...m.map(({
590
606
  pending: d
591
- }) => d)]), a.map(({
607
+ }) => d)]), m.map(({
592
608
  image: d
593
609
  }) => d);
594
- }, [v, K]), Y = C((t) => {
595
- K(v.filter((d) => d.slot !== t));
596
- const a = R.current.get(t);
597
- a && URL.revokeObjectURL(a), R.current.delete(t);
598
- }, [v, K]);
599
- F(() => () => {
600
- R.current.forEach((t) => URL.revokeObjectURL(t)), R.current.clear();
601
- }, []), F(() => {
602
- const t = new Set(v.map((a) => a.slot));
603
- R.current.forEach((a, d) => {
604
- t.has(d) || (URL.revokeObjectURL(a), R.current.delete(d));
610
+ }, [q, Y]), _ = k((i) => {
611
+ Y(q.filter((d) => d.slot !== i));
612
+ const m = N.current.get(i);
613
+ m && URL.revokeObjectURL(m), N.current.delete(i);
614
+ }, [q, Y]);
615
+ Z(() => () => {
616
+ N.current.forEach((i) => URL.revokeObjectURL(i)), N.current.clear();
617
+ }, []), Z(() => {
618
+ const i = new Set(q.map((m) => m.slot));
619
+ N.current.forEach((m, d) => {
620
+ i.has(d) || (URL.revokeObjectURL(m), N.current.delete(d));
605
621
  });
606
- }, [v]);
607
- const ht = (t) => {
622
+ }, [q]);
623
+ const x = (i) => {
608
624
  if (typeof DataTransfer < "u") {
609
- const a = new DataTransfer();
610
- return t.forEach((d) => a.items.add(d)), a.files;
625
+ const m = new DataTransfer();
626
+ return i.forEach((d) => m.items.add(d)), m.files;
611
627
  }
612
- return Object.assign([...t], {
613
- item: (a) => t[a] ?? null
628
+ return Object.assign([...i], {
629
+ item: (m) => i[m] ?? null
614
630
  });
615
- }, gt = async () => {
616
- try {
617
- _.length > 0 && await (b == null ? void 0 : b(ht(_))), await (l == null ? void 0 : l()), _.length > 0 && W([]);
618
- } catch {
619
- return;
631
+ }, B = async () => {
632
+ if (!(b || M || G.current)) {
633
+ G.current = !0;
634
+ try {
635
+ e && A.length > 0 && await (j == null ? void 0 : j(x(A))), await (U == null ? void 0 : U()), e && A.length > 0 && rt([]);
636
+ } catch {
637
+ return;
638
+ } finally {
639
+ G.current = !1;
640
+ }
620
641
  }
621
- }, B = (t) => {
622
- t.preventDefault(), t.stopPropagation();
642
+ }, I = (i) => {
643
+ i.preventDefault(), i.stopPropagation();
623
644
  };
624
- return /* @__PURE__ */ O("div", { className: nt(h.field, m && h.fill), "data-max-rows": A, "data-min-rows": L, onDragEnter: (t) => {
625
- B(t), E(!!w);
626
- }, onDragOver: (t) => {
627
- B(t), E(!!w);
628
- }, onDragLeave: (t) => {
629
- B(t), E(!1);
630
- }, onDropCapture: (t) => {
645
+ return /* @__PURE__ */ F("div", { className: at(g.field, a && g.fill), "data-max-rows": $, "data-min-rows": o, onDragEnter: (i) => {
646
+ I(i), X(e && !!D);
647
+ }, onDragOver: (i) => {
648
+ I(i), X(e && !!D);
649
+ }, onDragLeave: (i) => {
650
+ I(i), X(!1);
651
+ }, onDropCapture: (i) => {
631
652
  var d;
632
- const a = (d = t.dataTransfer) == null ? void 0 : d.files;
633
- a != null && a.length && (B(t), (w || b) && W([..._, ...Array.from(a)]), E(!1));
634
- }, onDrop: (t) => {
635
- t.preventDefault(), E(!1);
653
+ const m = (d = i.dataTransfer) == null ? void 0 : d.files;
654
+ m != null && m.length && (I(i), e && (D || j) && rt([...A, ...Array.from(m)]), X(!1));
655
+ }, onDrop: (i) => {
656
+ i.preventDefault(), X(!1);
636
657
  }, "data-component": "editor", children: [
637
- U === "top" && !m && /* @__PURE__ */ o(Ue, { editableRef: q }),
638
- /* @__PURE__ */ o("div", { className: nt(h.editor, m && h["fill-editor"], U === !0 && !m && h.resizable, U && !m && at && h.resized, f && h.invalid, _.length > 0 && h["has-files"]), style: {
639
- "--editor-max-height": `calc(${A * 1.25}em + (2 * var(--scale-8)))`,
640
- "--editor-min-height": `calc(${L * 1.25}em + (2 * var(--scale-8)))`
641
- }, children: /* @__PURE__ */ O(Vt, { contentEditable: null, extension: Be, children: [
642
- !n && /* @__PURE__ */ o(ze, { onInlineImageRemove: Y, onFilesSelected: b || w ? (t) => {
643
- W([..._, ...Array.from(t)]);
658
+ K === "top" && !a && /* @__PURE__ */ s(He, { editableRef: tt }),
659
+ /* @__PURE__ */ s("div", { className: at(g.editor, !!h && g["with-controls"], Q === "embedded" && g.embedded, a && g["fill-editor"], K === !0 && !a && g.resizable, K && !a && et && g.resized, v && g.invalid, A.length > 0 && g["has-files"]), style: {
660
+ "--editor-max-height": `calc(${$ * 1.25}em + (2 * var(--scale-8)))`,
661
+ "--editor-min-height": `calc(${o * 1.25}em + (2 * var(--scale-8)))`
662
+ }, children: /* @__PURE__ */ F(Zt, { contentEditable: null, extension: Fe, children: [
663
+ !z && Q !== "embedded" && /* @__PURE__ */ s(Be, { onInlineImageRemove: e ? _ : void 0, onFilesSelected: e && (j || D) ? (i) => {
664
+ rt([...A, ...Array.from(i)]);
644
665
  } : void 0 }),
645
- /* @__PURE__ */ o("div", { className: nt(h.content, T && h.dragging), children: /* @__PURE__ */ o(te, { contentEditable: /* @__PURE__ */ o(Zt, { ref: q, "aria-placeholder": G ?? "", ariaErrorMessage: f && g ? M : void 0, ariaInvalid: f || void 0, ariaRequired: Z || void 0, placeholder: () => G ? /* @__PURE__ */ o("div", { className: h.placeholder, children: G }) : null }), ErrorBoundary: qt }) }),
646
- !n && l && /* @__PURE__ */ o("div", { className: h.submit, children: /* @__PURE__ */ o(N, { "aria-label": z, "data-cy": "toolbar-submit-button", disabled: c, icon: "PaperPlaneTilt", isLoading: $, onClick: () => void gt(), variant: "primary", children: /* @__PURE__ */ o("span", { children: z }) }) }),
647
- _.length > 0 && /* @__PURE__ */ o("div", { "aria-label": "Files to upload", className: h.files, role: "region", children: _.map((t, a) => /* @__PURE__ */ o(ue, { deleteAccessibleLabel: `Remove ${t.name} from upload queue`, name: t.name, onDelete: () => W(_.filter((d, D) => D !== a)) }, `${t.name}-${t.size}-${t.lastModified}-${a}`)) }),
648
- s && /* @__PURE__ */ o(jt, {}),
649
- r && /* @__PURE__ */ o(Gt, { matchers: $e }),
650
- /* @__PURE__ */ o(Xt, {}),
651
- i && /* @__PURE__ */ o(Te, { createImages: et, onRemove: Y }),
652
- e !== void 0 && /* @__PURE__ */ o(He, { autofocus: s, content: e, lastEmittedContentRef: Q }),
653
- /* @__PURE__ */ o(Yt, { validateUrl: It }),
654
- /* @__PURE__ */ o(Jt, {}),
655
- S && /* @__PURE__ */ o(Qt, { onChange: (t, a) => {
656
- t.read(() => {
657
- const d = $t(a, null), D = vt(d, {
666
+ /* @__PURE__ */ s("div", { className: at(g.content, ut && g.dragging), children: /* @__PURE__ */ s(te, { contentEditable: /* @__PURE__ */ s(qt, { ref: tt, "aria-placeholder": H ?? "", ariaErrorMessage: v && n ? nt : void 0, ariaInvalid: v || void 0, ariaRequired: T || void 0, placeholder: () => H ? /* @__PURE__ */ s("div", { className: g.placeholder, children: H }) : null }), ErrorBoundary: Yt }) }),
667
+ !z && Q !== "embedded" && (h || U) && /* @__PURE__ */ s("div", { className: g.submit, children: h ?? /* @__PURE__ */ s(P, { "aria-label": it, "data-cy": "toolbar-submit-button", disabled: b, icon: "PaperPlaneTilt", isLoading: M, onClick: () => void B(), variant: "primary", children: /* @__PURE__ */ s("span", { children: it }) }) }),
668
+ e && A.length > 0 && /* @__PURE__ */ s("div", { "aria-label": "Files to upload", className: g.files, role: "region", children: A.map((i, m) => /* @__PURE__ */ s(de, { deleteAccessibleLabel: `Remove ${i.name} from upload queue`, name: i.name, onDelete: () => rt(A.filter((d, S) => S !== m)) }, `${i.name}-${i.size}-${i.lastModified}-${m}`)) }),
669
+ l && /* @__PURE__ */ s(Kt, {}),
670
+ c && /* @__PURE__ */ s(Gt, { matchers: Ue }),
671
+ /* @__PURE__ */ s(Vt, {}),
672
+ e && W && /* @__PURE__ */ s(Re, { createImages: r, onRemove: _ }),
673
+ f !== void 0 && /* @__PURE__ */ s(We, { autofocus: l, content: f, sessionKey: t, lastEmittedContentRef: E, imagePreviews: N.current }),
674
+ /* @__PURE__ */ s(Xt, { validateUrl: kt }),
675
+ /* @__PURE__ */ s(Jt, {}),
676
+ u && /* @__PURE__ */ s(Qt, { ignoreHistoryMergeTagChange: !1, onChange: (i, m) => {
677
+ i.read(() => {
678
+ const d = Ot(m, null), S = Ct(d, {
658
679
  allowedAttributes: {
659
- ...vt.defaults.allowedAttributes,
660
- img: [...vt.defaults.allowedAttributes.img ?? [], "data-solibo-document-id", "data-solibo-document-slot"]
680
+ ...Ct.defaults.allowedAttributes,
681
+ img: [...Ct.defaults.allowedAttributes.img ?? [], "data-solibo-document-id", "data-solibo-document-slot"]
661
682
  },
662
683
  allowedTags: ["a", "b", "br", "i", "img", "li", "ol", "p", "u", "ul"]
663
684
  });
664
- Q.current = D, S(D);
685
+ E.current = S, u(S);
665
686
  });
666
687
  } })
667
688
  ] }) }),
668
- f && g && /* @__PURE__ */ o("div", { className: h.error, id: M, children: g })
689
+ v && n && /* @__PURE__ */ s("div", { className: g.error, id: nt, children: n })
669
690
  ] });
670
691
  };
671
692
  export {
672
- gr as Editor
693
+ pr as Editor
673
694
  };