@revolist/ui 4.0.2-rc → 4.0.3-rc

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 (161) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +345 -263
  3. package/_chunks/{calendar-CpaUK7w1.js → calendar-xpZ0v3xf.js} +39 -29
  4. package/_chunks/{chart-frame-BC99KjGa.js → chart-frame-Cmc7xU1i.js} +16 -13
  5. package/_chunks/{choice-chips-Cs4D-3nH.js → choice-chips-CHQTUdLs.js} +10 -10
  6. package/_chunks/clock-BOhPNlW3.js +4 -0
  7. package/_chunks/{color-palette-BBMFmUNA.js → color-palette-D8vyPfld.js} +1 -1
  8. package/_chunks/{color-picker-D90Jg-M8.js → color-picker-CudqPYZo.js} +10 -10
  9. package/_chunks/{component-YDcfoOLz.js → component-C_T2VN5u.js} +182 -178
  10. package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
  11. package/_chunks/control-AHKXD5Eu.js +93 -0
  12. package/_chunks/{control-tooltip-ztgmsG7H.js → control-tooltip-uscKfAnV.js} +15 -15
  13. package/_chunks/{controls-DIum-E66.js → controls-DsNi8V8I.js} +144 -129
  14. package/_chunks/{date-control-BJSzu79z.js → date-control-DrVFX13g.js} +1 -1
  15. package/_chunks/{date-time-BxPJusp9.js → date-time-qIhp5vaX.js} +143 -145
  16. package/_chunks/{delete-button-Bblyah10.js → delete-button-CW9vjLnk.js} +6 -6
  17. package/_chunks/{dialog.parts-DBqo3Qwb.js → dialog.parts-CKGkC5zP.js} +20 -20
  18. package/_chunks/{duration-87U2EoMS.js → duration-CL68Em0o.js} +16 -15
  19. package/_chunks/{editor-popup-D3JdS8l3.js → editor-popup-WDdtVDNA.js} +5 -5
  20. package/_chunks/field-context-D57PnBbH.js +5 -0
  21. package/_chunks/{framework-mount-C-Zwm44H.js → framework-mount--RTLIqE-.js} +1 -1
  22. package/_chunks/history-controls-B3u3INEK.js +27 -0
  23. package/_chunks/mount-DQ1cpppK.js +257 -0
  24. package/_chunks/native-control-C_yok8_-.js +605 -0
  25. package/_chunks/{number-input-BeIadZuL.js → number-input-BKwA5FnM.js} +2 -2
  26. package/_chunks/{picker-DpP7iQLA.js → picker-h1P5RUgp.js} +2 -2
  27. package/_chunks/popup-CT2uD3go.js +367 -0
  28. package/_chunks/{rating-choice-Ca8ZBty3.js → rating-choice-DZgmaic0.js} +1 -1
  29. package/_chunks/render-m5eMMwFR.js +83 -0
  30. package/_chunks/{reorder-list-Cc3KmfAN.js → reorder-list-CSlqAGHw.js} +1 -1
  31. package/_chunks/request-trail-DSlFix6i.js +618 -0
  32. package/_chunks/rich-text-CH7gIqOS.js +636 -0
  33. package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
  34. package/_form.scss +1 -1
  35. package/ai/_chat.scss +195 -0
  36. package/ai/_style.scss +105 -34
  37. package/ai/chat.d.ts +63 -0
  38. package/ai/components.d.ts +19 -3
  39. package/ai/index.d.ts +2 -0
  40. package/ai/index.js +3 -3
  41. package/ai/mount.d.ts +30 -1
  42. package/ai/prompt-history.d.ts +13 -0
  43. package/ai/transcript.d.ts +25 -0
  44. package/ai/translations.d.ts +1 -1
  45. package/angular/angular.js +0 -3
  46. package/assignee/index.js +34 -35
  47. package/buttons/delete-button.d.ts +2 -1
  48. package/buttons/delete-button.js +1 -1
  49. package/buttons/remove-button.js +1 -1
  50. package/buttons/svg-button.d.ts +1 -0
  51. package/buttons/svg-button.js +5 -5
  52. package/calendar/_calendar.scss +7 -2
  53. package/calendar/calendar.js +1 -1
  54. package/calendar/index.js +2 -2
  55. package/choice-chips/index.js +1 -1
  56. package/color-palette/color-palette.js +1 -1
  57. package/color-palette/color-picker.js +2 -2
  58. package/component-catalog.d.ts +16 -5
  59. package/control-attributes.js +7 -7
  60. package/controls.d.ts +8 -6
  61. package/controls.js +3 -3
  62. package/core/editor-popup.js +1 -1
  63. package/date-time/index.js +1 -1
  64. package/date-time/style.scss +4 -4
  65. package/dialog/dialog.dom.js +8 -8
  66. package/dialog/dialog.parts.js +1 -1
  67. package/distribution-chart/area-chart.js +1 -1
  68. package/distribution-chart/bar-chart.d.ts +5 -2
  69. package/distribution-chart/bar-chart.js +7 -3
  70. package/distribution-chart/chart-frame.d.ts +2 -1
  71. package/distribution-chart/line-chart.js +1 -1
  72. package/dropdown/content.d.ts +2 -1
  73. package/dropdown/content.js +1 -142
  74. package/dropdown/control.d.ts +14 -0
  75. package/dropdown/control.js +1 -0
  76. package/dropdown/control.view.d.ts +6 -0
  77. package/dropdown/dropdown.types.d.ts +4 -0
  78. package/dropdown/editor-dropdown.style.scss +37 -9
  79. package/dropdown/index.d.ts +1 -1
  80. package/dropdown/index.js +3 -4
  81. package/dropdown/lookup-field.js +1 -1
  82. package/dropdown/popup.js +1 -141
  83. package/duration/index.js +1 -1
  84. package/duration/style.scss +1 -1
  85. package/editor-actions.js +1 -1
  86. package/field-configurator.js +6 -6
  87. package/fieldset.d.ts +3 -0
  88. package/filter/filters/slider/single.js +1 -1
  89. package/filter-badge.js +1 -1
  90. package/filter-controls.js +7 -7
  91. package/form-controls/field-context.d.ts +5 -0
  92. package/form-controls/index.js +7 -12
  93. package/form-controls/index.view.d.ts +2 -4
  94. package/form-controls/presentation.js +51 -43
  95. package/formatting/index.js +25 -21
  96. package/framework.js +215 -207
  97. package/history-controls.d.ts +14 -0
  98. package/history-controls.js +1 -0
  99. package/masked-input/index.js +1 -1
  100. package/native-control.d.ts +6 -4
  101. package/native-control.js +3 -26
  102. package/native-styles.css +1 -1
  103. package/native.js +31 -30
  104. package/number-input/index.js +1 -1
  105. package/package.json +18 -13
  106. package/pagination.d.ts +3 -0
  107. package/pagination.js +43 -33
  108. package/pdf-viewer/index.js +1 -1
  109. package/pdf-viewer/style.scss +3 -4
  110. package/preact.d.ts +2 -0
  111. package/preact.js +62 -62
  112. package/rating-choice.js +1 -1
  113. package/react-control.d.ts +0 -1
  114. package/react-control.js +2 -2
  115. package/react.d.ts +13 -3
  116. package/react.js +71 -88
  117. package/reorder-list.js +1 -1
  118. package/resource-picker/resource-picker-popup.js +1 -1
  119. package/resource-picker/resource-picker.js +4 -4
  120. package/resource-picker/resource-picker.scss +6 -3
  121. package/rich-text/engine.d.ts +16 -19
  122. package/rich-text/index.d.ts +7 -7
  123. package/rich-text/index.js +1 -1
  124. package/rich-text/model.d.ts +4 -3
  125. package/rich-text/render-model.d.ts +4 -5
  126. package/rich-text/style.scss +3 -12
  127. package/rich-text/toolbar.d.ts +6 -6
  128. package/rich-text/translations.d.ts +3 -15
  129. package/select.d.ts +20 -0
  130. package/select.js +1 -0
  131. package/status-feedback/exit-snapshot.js +4 -4
  132. package/status-feedback/index.js +2 -2
  133. package/status-feedback/popover.js +10 -10
  134. package/status-feedback/render.js +3 -44
  135. package/status-feedback/status-feedback.scss +7 -0
  136. package/status-feedback/types.d.ts +4 -0
  137. package/status-feedback/use-auto-dismiss.d.ts +3 -0
  138. package/styles/_compositions.scss +3 -1
  139. package/styles/_control.scss +12 -4
  140. package/styles/_primitives.scss +9 -8
  141. package/styles.css +1 -1
  142. package/surfaces.js +45 -45
  143. package/svelte/UiComponent.server.js +1 -48
  144. package/svelte/UiComponent.svelte +0 -21
  145. package/svelte.js +33 -68
  146. package/time-grid.js +1 -1
  147. package/timeline-track/component.d.ts +5 -1
  148. package/timeline-track/index.js +71 -54
  149. package/timeline-track/model.d.ts +9 -0
  150. package/timeline-track/model.js +10 -1
  151. package/ui.css +1 -1
  152. package/vue.d.ts +24 -5
  153. package/vue.js +140 -164
  154. package/_chunks/compat.module-DDB2pm9O.js +0 -229
  155. package/_chunks/dropdown-voWqmwAe.js +0 -357
  156. package/_chunks/mount-DZe_6VtR.js +0 -90
  157. package/_chunks/request-trail-IdNiFvKH.js +0 -347
  158. package/_chunks/rich-text-BzI1DyfF.js +0 -477
  159. package/react-native-select.d.ts +0 -6
  160. package/rich-text/syntax.d.ts +0 -2
  161. package/vue-native-select.d.ts +0 -9
@@ -0,0 +1,636 @@
1
+ import { c as e, i as t, n, t as r } from "./hooks.module-CG3gN83z.js";
2
+ import { t as i } from "./jsxRuntime.module-F6UFnpT-.js";
3
+ import { SvgIcon as a } from "../icons/icon.js";
4
+ import { a as o, n as s } from "./native-control-C_yok8_-.js";
5
+ import { F as c, I as l, L as u, P as d, n as f } from "./controls-DsNi8V8I.js";
6
+ import { SegmentedSwitch as p } from "../segmented-switch/index.js";
7
+ import { n as m } from "./editor-commit-Bq3wSgvr.js";
8
+ import { EditorActions as h } from "../editor-actions.js";
9
+ //#region src/rich-text/model.ts
10
+ var g = /* @__PURE__ */ new Set([
11
+ "p",
12
+ "br",
13
+ "strong",
14
+ "em",
15
+ "s",
16
+ "code",
17
+ "pre",
18
+ "blockquote",
19
+ "ul",
20
+ "ol",
21
+ "li",
22
+ "a",
23
+ "h1",
24
+ "h2",
25
+ "h3",
26
+ "h4",
27
+ "h5",
28
+ "h6"
29
+ ]), _ = /* @__PURE__ */ new Set([
30
+ "script",
31
+ "style",
32
+ "iframe",
33
+ "object",
34
+ "embed",
35
+ "svg",
36
+ "math",
37
+ "template",
38
+ "noscript",
39
+ "head",
40
+ "link",
41
+ "meta",
42
+ "base",
43
+ "input",
44
+ "button",
45
+ "textarea",
46
+ "select"
47
+ ]), v = {
48
+ b: "strong",
49
+ i: "em",
50
+ strike: "s",
51
+ del: "s",
52
+ div: "p"
53
+ }, y = /* @__PURE__ */ new Set([
54
+ "p",
55
+ "pre",
56
+ "blockquote",
57
+ "ul",
58
+ "ol",
59
+ "li",
60
+ "h1",
61
+ "h2",
62
+ "h3",
63
+ "h4",
64
+ "h5",
65
+ "h6"
66
+ ]);
67
+ function b(e) {
68
+ if (!e || /[\u0000-\u0020\u007f]/.test(e)) return !1;
69
+ try {
70
+ return [
71
+ "http:",
72
+ "https:",
73
+ "mailto:"
74
+ ].includes(new URL(e, "https://editor.invalid/").protocol);
75
+ } catch {
76
+ return !1;
77
+ }
78
+ }
79
+ function x(e, t = document) {
80
+ let n = t.createElement("template");
81
+ n.innerHTML = e;
82
+ let r = t.createDocumentFragment(), i = (e, n) => {
83
+ if (e.nodeType === 3) {
84
+ e.textContent && n.appendChild(t.createTextNode(e.textContent));
85
+ return;
86
+ }
87
+ if (e.nodeType !== 1) return;
88
+ let r = e, a = r.localName.toLowerCase();
89
+ if (r.namespaceURI !== "http://www.w3.org/1999/xhtml" || _.has(a)) return;
90
+ let o = v[a] ?? a;
91
+ if (!g.has(o) || o === "a" && !b(r.getAttribute("href") ?? "") || o === "p" && [...r.children].some((e) => y.has(v[e.localName] ?? e.localName))) {
92
+ for (let e of r.childNodes) i(e, n);
93
+ return;
94
+ }
95
+ let s = t.createElement(o);
96
+ o === "a" && (s.setAttribute("href", r.getAttribute("href")), s.setAttribute("rel", "noopener noreferrer")), o === "ol" && /^\d{1,9}$/.test(r.getAttribute("start") ?? "") && s.setAttribute("start", r.getAttribute("start"));
97
+ for (let e of r.childNodes) i(e, s);
98
+ if (!y.has(o) && o !== "br" && !s.textContent && !s.querySelector("br")) return;
99
+ let c = n.lastChild;
100
+ if ([
101
+ "strong",
102
+ "em",
103
+ "s",
104
+ "code",
105
+ "a"
106
+ ].includes(o) && c?.nodeType === 1 && c.cloneNode(!1).isEqualNode(s.cloneNode(!1))) for (; s.firstChild;) c.appendChild(s.firstChild);
107
+ else n.appendChild(s);
108
+ };
109
+ for (let e of n.content.childNodes) i(e, r);
110
+ let a;
111
+ for (let e of [...r.childNodes]) e.nodeType === 1 && y.has(e.localName) ? a = void 0 : (a || (a = t.createElement("p"), r.insertBefore(a, e)), a.appendChild(e));
112
+ return r;
113
+ }
114
+ function S(e, t = document) {
115
+ let n = t.createElement("div");
116
+ return n.appendChild(x(e, t)), n.textContent?.replace(/\u00a0/g, " ").trim() ? n.innerHTML : "";
117
+ }
118
+ //#endregion
119
+ //#region src/rich-text/engine.ts
120
+ var C = {
121
+ formats: [],
122
+ block: null,
123
+ link: !1
124
+ }, w = {
125
+ bold: "strong",
126
+ italic: "em",
127
+ strikethrough: "s",
128
+ code: "code"
129
+ }, T = "p,h1,h2,h3,h4,h5,h6,li,pre";
130
+ function E(e, t, n, r = () => {}) {
131
+ let i = e.ownerDocument, a, o, s = !1, c = [], l = -1, u = 0, d = (e) => e.nodeType === 1 ? e : e.parentElement, f = (t) => e.contains(t.startContainer) && e.contains(t.endContainer), p = () => {
132
+ let t = i.getSelection();
133
+ if (t?.rangeCount && f(t.getRangeAt(0))) return t.getRangeAt(0).cloneRange();
134
+ if (a && f(a)) return a.cloneRange();
135
+ let n = i.createRange();
136
+ return n.selectNodeContents(e), n.collapse(!1), n;
137
+ }, m = (t) => {
138
+ e.focus({ preventScroll: !0 });
139
+ let n = i.getSelection();
140
+ n?.removeAllRanges(), n?.addRange(t), a = t.cloneRange();
141
+ }, h = (t) => {
142
+ let n = [];
143
+ for (; t !== e && t.parentNode;) n.unshift([...t.parentNode.childNodes].indexOf(t)), t = t.parentNode;
144
+ return n;
145
+ }, g = () => {
146
+ let e = p();
147
+ return {
148
+ start: {
149
+ path: h(e.startContainer),
150
+ offset: e.startOffset
151
+ },
152
+ end: {
153
+ path: h(e.endContainer),
154
+ offset: e.endOffset
155
+ }
156
+ };
157
+ }, _ = (t) => {
158
+ let n = (t) => {
159
+ let n = e;
160
+ for (let e of t.path) {
161
+ if (!n.childNodes[e]) break;
162
+ n = n.childNodes[e];
163
+ }
164
+ return {
165
+ node: n,
166
+ offset: Math.min(t.offset, n.nodeType === 3 ? n.textContent?.length ?? 0 : n.childNodes.length)
167
+ };
168
+ }, r = i.createRange();
169
+ if (t) {
170
+ let e = n(t.start), i = n(t.end);
171
+ r.setStart(e.node, e.offset), r.setEnd(i.node, i.offset);
172
+ } else r.selectNodeContents(e), r.collapse(!1);
173
+ m(r);
174
+ }, v = () => ({
175
+ html: e.innerHTML,
176
+ selection: g()
177
+ }), y = () => {
178
+ let t = p(), n = d(t.startContainer), i = n?.closest("pre,li,h1,h2,h3,h4,h5,h6,blockquote"), a = i?.localName, s = a === "pre" ? "code" : a === "li" ? i.parentElement?.localName === "ol" ? "ordered" : "bullet" : a === "h1" ? "h1" : a?.startsWith("h") ? "h2" : a === "blockquote" || n?.closest("blockquote") ? "quote" : "paragraph";
179
+ r({
180
+ formats: o ? [...o] : Object.keys(w).filter((r) => {
181
+ let i = n?.closest(w[r]);
182
+ return !!i && e.contains(i) && (t.collapsed || i.contains(t.endContainer));
183
+ }),
184
+ block: s,
185
+ link: !!n?.closest("a") && e.contains(n.closest("a"))
186
+ });
187
+ }, C = (t = !1) => {
188
+ let r = v(), a = Date.now();
189
+ c[l]?.html === r.html ? c[l] && (c[l].selection = r.selection) : (c = c.slice(0, l + 1), t && a - u < 500 && l > 0 ? c[l] = r : (c.push(r), c.length > 100 && c.shift(), l = c.length - 1)), u = t ? a : 0, n(S(e.innerHTML, i)), y();
190
+ }, E = () => {
191
+ c[l]?.html === e.innerHTML && (c[l].selection = g());
192
+ }, D = () => {
193
+ if (!e.firstChild) {
194
+ let t = i.createElement("p");
195
+ t.appendChild(i.createElement("br")), e.appendChild(t);
196
+ }
197
+ }, O = (t) => {
198
+ e.replaceChildren(x(t, i)), D(), a = void 0, o = void 0, c = [{ html: e.innerHTML }], l = 0, u = 0, y();
199
+ }, k = (t) => {
200
+ let r = l + t;
201
+ if (r < 0 || r >= c.length) return;
202
+ l = r;
203
+ let a = c[r];
204
+ e.replaceChildren(x(a.html, i)), D(), o = void 0, _(a.selection), u = 0, n(S(e.innerHTML, i)), y();
205
+ }, A = (t) => {
206
+ for (; t.parentElement && t.parentElement !== e && !t.parentElement.matches(T + ",blockquote,ul,ol");) {
207
+ let e = t.parentElement, n = e.cloneNode(!1);
208
+ for (; t.nextSibling;) n.appendChild(t.nextSibling);
209
+ e.after(t, n), e.hasChildNodes() || e.remove(), n.hasChildNodes() || n.parentNode?.removeChild(n);
210
+ }
211
+ }, j = (e, t) => {
212
+ let n = i.createComment("end"), r = i.createComment("start"), a = e.cloneRange();
213
+ a.collapse(!1), a.insertNode(n), e.collapse(!0), e.insertNode(r), A(r), A(n);
214
+ let o = i.createRange();
215
+ o.setStartAfter(r), o.setEndBefore(n), t(o);
216
+ let s = i.createRange();
217
+ s.setStartAfter(r), s.setEndBefore(n), r.remove(), n.remove(), m(s);
218
+ }, M = (e) => e.replaceWith(...e.childNodes), N = (e) => {
219
+ let t = e.parentElement, n = t.cloneNode(!1);
220
+ for (; e.nextSibling;) n.appendChild(e.nextSibling);
221
+ t.after(e, n), t.hasChildNodes() || t.remove(), n.hasChildNodes() || n.parentNode?.removeChild(n);
222
+ }, P = (t, n, r, a) => {
223
+ j(t, (t) => {
224
+ for (let r of [...e.querySelectorAll(n)]) t.intersectsNode(r) && M(r);
225
+ if (!r) {
226
+ let r = i.createTreeWalker(e, NodeFilter.SHOW_TEXT), o = [], s;
227
+ for (; s = r.nextNode();) s.textContent && t.intersectsNode(s) && o.push(s);
228
+ for (let e of o) {
229
+ let t = i.createElement(n);
230
+ for (let [e, n] of Object.entries(a ?? {})) t.setAttribute(e, n);
231
+ e.replaceWith(t), t.appendChild(e);
232
+ }
233
+ }
234
+ });
235
+ }, F = (t) => {
236
+ if (!(t in w)) return;
237
+ E(), u = 0;
238
+ let n = p();
239
+ if (n.collapsed) {
240
+ o ||= new Set(Object.keys(w).filter((e) => d(n.startContainer)?.closest(w[e]))), o.has(t) ? o.delete(t) : o.add(t), a = n.cloneRange(), e.focus({ preventScroll: !0 }), y();
241
+ return;
242
+ }
243
+ let r = !!d(n.startContainer)?.closest(w[t]) && !!d(n.endContainer)?.closest(w[t]);
244
+ o = void 0, P(n, w[t], r), C();
245
+ }, I = (t) => {
246
+ E(), o = void 0;
247
+ let n = p(), r = n.collapsed, a = [...e.querySelectorAll(T)].filter((e) => n.intersectsNode(e));
248
+ if (n.collapsed) {
249
+ let t = d(n.startContainer)?.closest(T);
250
+ a = t && e.contains(t) ? [t] : [];
251
+ }
252
+ if (!a.length) {
253
+ let e = i.createElement("p");
254
+ e.appendChild(i.createElement("br")), n.insertNode(e), a = [e];
255
+ }
256
+ let s = i.createComment("block-start"), c = i.createComment("block-end"), l = n.cloneRange();
257
+ l.collapse(!1), l.insertNode(c), n.collapse(!0), n.insertNode(s);
258
+ let u;
259
+ for (let e of a) if (e.isConnected) {
260
+ if (t === "bullet" || t === "ordered") {
261
+ let n = t === "bullet" ? "ul" : "ol";
262
+ if (e.localName === "li") {
263
+ let t = e.parentElement;
264
+ if (t.localName !== n) {
265
+ let e = i.createElement(n);
266
+ e.append(...t.childNodes), t.replaceWith(e), u = e;
267
+ } else u = t;
268
+ } else {
269
+ u?.nextSibling !== e && (u = i.createElement(n), e.before(u));
270
+ let t = i.createElement("li");
271
+ t.append(...e.childNodes), u.appendChild(t), e.remove();
272
+ }
273
+ } else {
274
+ let n = i.createElement(t === "h1" || t === "h2" ? t : t === "code" ? "pre" : "p");
275
+ if (n.append(...e.childNodes), e.localName === "li" && N(e), e.replaceWith(n), t === "quote") {
276
+ let e = i.createElement("blockquote");
277
+ n.replaceWith(e), e.appendChild(n);
278
+ } else n.parentElement?.localName === "blockquote" && N(n);
279
+ }
280
+ }
281
+ let f = i.createRange();
282
+ f.setStartBefore(s), f.setEndBefore(c), s.remove(), c.remove(), r && f.collapse(!0), m(f), C();
283
+ }, L = (t, n = !1) => {
284
+ E();
285
+ let r = p();
286
+ r.deleteContents();
287
+ let a = o ? d(r.startContainer)?.closest("a") : void 0, s = a && e.contains(a) ? a.cloneNode(!1) : void 0, c = i.createComment("caret");
288
+ r.insertNode(c), o && A(c);
289
+ let l = i.createDocumentFragment(), u = t.replace(/\r\n?/g, "\n").split("\n"), f;
290
+ for (let e = 0; e < u.length; e++) {
291
+ if (e && (f = i.createElement("br"), l.appendChild(f)), !u[e]) continue;
292
+ let t = i.createTextNode(u[e]), n = t;
293
+ for (let e of o ?? []) {
294
+ let t = i.createElement(w[e]);
295
+ t.appendChild(n), n = t;
296
+ }
297
+ if (s) {
298
+ let e = s.cloneNode(!1);
299
+ e.appendChild(n), n = e;
300
+ }
301
+ l.appendChild(n), f = t;
302
+ }
303
+ c.before(l);
304
+ let h = i.createRange();
305
+ f ? (h.setStartAfter(f), h.collapse(!0)) : (h.setStartBefore(c), h.collapse(!0)), c.remove(), m(h), C(n);
306
+ }, R = (e) => {
307
+ E();
308
+ let t = p();
309
+ t.deleteContents();
310
+ let n = d(t.startContainer)?.closest(T);
311
+ if (e || n?.localName === "pre") {
312
+ L("\n");
313
+ return;
314
+ }
315
+ if (!n) {
316
+ let e = i.createElement("p");
317
+ e.appendChild(i.createElement("br")), t.insertNode(e), t.selectNodeContents(e), t.collapse(!0), m(t), C();
318
+ return;
319
+ }
320
+ if (n.localName === "li" && !n.textContent?.trim()) {
321
+ I("paragraph");
322
+ return;
323
+ }
324
+ let r = t.cloneRange();
325
+ r.setEnd(n, n.childNodes.length);
326
+ let a = /^h[1-6]$/.test(n.localName) && !r.toString() ? "p" : n.localName, o = i.createElement(a);
327
+ o.appendChild(r.extractContents()), !n.textContent && !n.querySelector("br") && n.appendChild(i.createElement("br")), !o.textContent && !o.querySelector("br") && o.appendChild(i.createElement("br")), n.after(o);
328
+ let s = i.createRange();
329
+ s.selectNodeContents(o), s.collapse(!0), m(s), C();
330
+ }, z = (t) => {
331
+ let n = p(), r = d(n.startContainer)?.closest("li");
332
+ if (!r || !e.contains(r)) return !1;
333
+ E();
334
+ let a = r.parentElement;
335
+ if (t) {
336
+ let e = a.parentElement;
337
+ if (e?.localName !== "li") return I("paragraph"), !0;
338
+ e.after(r), a.children.length || a.remove();
339
+ } else {
340
+ let e = r.previousElementSibling;
341
+ if (!e) return !0;
342
+ let t = e.lastElementChild;
343
+ t?.localName !== a.localName && (t = i.createElement(a.localName), e.appendChild(t)), t.appendChild(r);
344
+ }
345
+ return m(n), C(), !0;
346
+ }, B = (e) => {
347
+ if (e.isComposing || s) return;
348
+ let t = e.ctrlKey || e.metaKey;
349
+ if (t && !e.altKey) {
350
+ let t = e.key.toLowerCase();
351
+ if (t === "z" || t === "y") {
352
+ e.preventDefault(), e.stopPropagation(), k(t === "y" || e.shiftKey ? 1 : -1);
353
+ return;
354
+ }
355
+ let n = t === "b" ? "bold" : t === "i" ? "italic" : t === "`" ? "code" : t === "x" && e.shiftKey ? "strikethrough" : void 0;
356
+ if (n) {
357
+ e.preventDefault(), e.stopPropagation(), F(n);
358
+ return;
359
+ }
360
+ }
361
+ e.key === "Enter" && !t && !e.altKey && (e.preventDefault(), e.stopPropagation(), R(e.shiftKey)), e.key === "Tab" && !t && !e.altKey && z(e.shiftKey) && (e.preventDefault(), e.stopPropagation()), /^(Arrow|Home|End)/.test(e.key) && (o = void 0, u = 0);
362
+ }, V = (e) => {
363
+ if (!(s || e.isComposing)) {
364
+ if (E(), e.inputType === "historyUndo" || e.inputType === "historyRedo") e.preventDefault(), k(e.inputType === "historyUndo" ? -1 : 1);
365
+ else if (e.inputType.startsWith("format")) {
366
+ e.preventDefault();
367
+ let t = {
368
+ formatBold: "bold",
369
+ formatItalic: "italic",
370
+ formatStrikeThrough: "strikethrough"
371
+ }[e.inputType];
372
+ t && F(t);
373
+ } else e.inputType === "insertParagraph" || e.inputType === "insertLineBreak" ? (e.preventDefault(), R(e.inputType === "insertLineBreak")) : e.inputType === "insertText" && o && e.data && (e.preventDefault(), L(e.data, !0));
374
+ }
375
+ }, H = () => {
376
+ s || (D(), C(!0));
377
+ }, U = () => {
378
+ let t = i.getSelection();
379
+ t?.rangeCount && f(t.getRangeAt(0)) && (a = t.getRangeAt(0).cloneRange(), c[l]?.html === e.innerHTML && (c[l].selection = g()), y());
380
+ }, W = {
381
+ keydown: B,
382
+ beforeinput: V,
383
+ input: H,
384
+ pointerdown: () => {
385
+ o = void 0, u = 0;
386
+ },
387
+ paste: (e) => {
388
+ e.preventDefault(), e.stopPropagation(), o = void 0;
389
+ let t = e.clipboardData?.getData("text/plain");
390
+ t && L(t);
391
+ },
392
+ drop: (e) => {
393
+ e.preventDefault(), o = void 0;
394
+ let t = e.dataTransfer?.getData("text/plain");
395
+ t && L(t);
396
+ },
397
+ compositionstart: () => {
398
+ E(), s = !0;
399
+ },
400
+ compositionend: () => {
401
+ s = !1, D(), C();
402
+ }
403
+ };
404
+ for (let [t, n] of Object.entries(W)) e.addEventListener(t, n);
405
+ return i.addEventListener("selectionchange", U), O(t), {
406
+ setHtml: O,
407
+ format: F,
408
+ block: I,
409
+ captureSelection: () => {
410
+ a = p();
411
+ },
412
+ link: (t) => {
413
+ if (!b(t)) return !1;
414
+ E();
415
+ let n = p();
416
+ if (o = void 0, n.collapsed) {
417
+ let r = d(n.startContainer)?.closest("a");
418
+ if (r && e.contains(r)) r.setAttribute("href", t);
419
+ else {
420
+ let e = i.createElement("a");
421
+ e.setAttribute("href", t), e.setAttribute("rel", "noopener noreferrer"), e.textContent = t, n.insertNode(e), n.selectNodeContents(e), n.collapse(!1), m(n);
422
+ }
423
+ } else P(n, "a", !1, {
424
+ href: t,
425
+ rel: "noopener noreferrer"
426
+ });
427
+ return C(), !0;
428
+ },
429
+ destroy: () => {
430
+ for (let [t, n] of Object.entries(W)) e.removeEventListener(t, n);
431
+ i.removeEventListener("selectionchange", U), a = void 0, c = [];
432
+ }
433
+ };
434
+ }
435
+ //#endregion
436
+ //#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/bold.svg?raw
437
+ var D = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l32 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c70.7 0 128-57.3 128-128 0-46.5-24.8-87.3-62-109.7 18.7-22.3 30-51 30-82.3 0-70.7-57.3-128-128-128L32 32zM288 160c0 35.3-28.7 64-64 64l-96 0 0-128 96 0c35.3 0 64 28.7 64 64zM128 416l0-128 128 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-128 0z\"/></svg>", O = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0-133.3 320 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0 133.3-320-64 0c-17.7 0-32-14.3-32-32z\"/></svg>", k = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M96 157.5C96 88.2 152.2 32 221.5 32L368 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L221.5 96c-34 0-61.5 27.5-61.5 61.5 0 31 23.1 57.2 53.9 61l44.1 5.5 222 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l83.1 0C103 204.6 96 181.8 96 157.5zM349.2 336l65.5 0c.9 6.1 1.4 12.2 1.4 18.5 0 69.3-56.2 125.5-125.5 125.5L144 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l146.5 0c34 0 61.5-27.5 61.5-61.5 0-6.4-1-12.7-2.8-18.5z\"/></svg>", A = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M360.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm64.6 136.1c-12.5 12.5-12.5 32.8 0 45.3l73.4 73.4-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0zm-274.7 0c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 150.6 182.6c12.5-12.5 12.5-32.8 0-45.3z\"/></svg>", j = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 64C0 46.3 14.3 32 32 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 112 224 0 0-112-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 320 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-144-224 0 0 144 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-320-16 0C14.3 96 0 81.7 0 64z\"/></svg>", M = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l64 0 0 320-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-352c0-17.7-14.3-32-32-32L32 32z\"/></svg>", N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M48 64c0-17.7 14.3-32 32-32l171 0c60.2 0 109 48.8 109 109 0 43.8-26.2 83.3-66.4 100.4l-139.1 59C119 315.4 96 350.2 96 388.7l0 27.3 224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32l0-59.3c0-64.2 38.4-122.2 97.5-147.3l139.1-59c16.6-7.1 27.4-23.4 27.4-41.4 0-24.9-20.2-45-45-45L80 96C62.3 96 48 81.7 48 64z\"/></svg>", P = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M48 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM48 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM96 256a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"/></svg>", F = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 72C0 58.8 10.7 48 24 48l48 0c13.3 0 24 10.7 24 24l0 104 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-80-24 0C10.7 96 0 85.3 0 72zM30.4 301.2C41.8 292.6 55.7 288 70 288l4.9 0c33.7 0 61.1 27.4 61.1 61.1 0 19.6-9.4 37.9-25.2 49.4l-24 17.5 33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-90.7 0C13.1 464 0 450.9 0 434.7 0 425.3 4.5 416.5 12.1 411l70.5-51.3c3.4-2.5 5.4-6.4 5.4-10.6 0-7.2-5.9-13.1-13.1-13.1L70 336c-3.9 0-7.7 1.3-10.8 3.6L38.4 355.2c-10.6 8-25.6 5.8-33.6-4.8S-1 324.8 9.6 316.8l20.8-15.6zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"/></svg>", I = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64L0 216zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136z\"/></svg>", L = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM154.2 295.6c8.6-10.1 7.5-25.2-2.6-33.8s-25.2-7.5-33.8 2.6l-48 56c-7.7 9-7.7 22.2 0 31.2l48 56c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8l-34.6-40.4 34.6-40.4zm112-31.2c-8.6-10.1-23.8-11.2-33.8-2.6s-11.2 23.8-2.6 33.8l34.6 40.4-34.6 40.4c-8.6 10.1-7.5 25.2 2.6 33.8s25.2 7.5 33.8-2.6l48-56c7.7-9 7.7-22.2 0-31.2l-48-56z\"/></svg>", R = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z\"/></svg>";
438
+ //#endregion
439
+ //#region src/rich-text/toolbar.tsx
440
+ function z({ engine: e, selection: t, text: n, showLink: r, onLink: o }) {
441
+ let s = (e, t, n, r, o) => /* @__PURE__ */ i(d, {
442
+ size: "compact",
443
+ className: "rv-rich-text-editor__command",
444
+ "aria-label": e,
445
+ title: e,
446
+ pressed: n,
447
+ onMouseDown: (e) => e.preventDefault(),
448
+ onPressedChange: r,
449
+ children: [/* @__PURE__ */ i(a, { svg: t }), o && /* @__PURE__ */ i(a, {
450
+ svg: o,
451
+ className: "rv-svg-icon rv-rich-text-editor__level"
452
+ })]
453
+ }), f = (n, r, i, a) => s(n, r, t.block === i, () => e()?.block(t.block === i ? "paragraph" : i), a);
454
+ return /* @__PURE__ */ i(c, {
455
+ className: "rv-rich-text-editor__toolbar",
456
+ label: n.formatting,
457
+ children: [
458
+ /* @__PURE__ */ i(l, {
459
+ label: n.inlineFormatting,
460
+ children: [
461
+ s(n.bold, D, t.formats.includes("bold"), () => e()?.format("bold")),
462
+ s(n.italic, O, t.formats.includes("italic"), () => e()?.format("italic")),
463
+ s(n.strike, k, t.formats.includes("strikethrough"), () => e()?.format("strikethrough")),
464
+ s(n.code, A, t.formats.includes("code"), () => e()?.format("code"))
465
+ ]
466
+ }),
467
+ /* @__PURE__ */ i(u, {}),
468
+ /* @__PURE__ */ i(l, {
469
+ label: n.headings,
470
+ children: [f(n.heading1, j, "h1", M), f(n.heading2, j, "h2", N)]
471
+ }),
472
+ /* @__PURE__ */ i(u, {}),
473
+ /* @__PURE__ */ i(l, {
474
+ label: n.structure,
475
+ children: [
476
+ f(n.bullets, P, "bullet"),
477
+ f(n.numberedList, F, "ordered"),
478
+ f(n.quote, I, "quote"),
479
+ f(n.codeBlock, L, "code")
480
+ ]
481
+ }),
482
+ /* @__PURE__ */ i(u, {}),
483
+ /* @__PURE__ */ i(l, {
484
+ label: n.links,
485
+ children: s(n.link, R, r || t.link, o)
486
+ })
487
+ ]
488
+ });
489
+ }
490
+ //#endregion
491
+ //#region src/rich-text/translations.ts
492
+ var B = {
493
+ visual: "Visual",
494
+ source: "HTML",
495
+ label: "Rich text",
496
+ unsafeLink: "Use an HTTP, HTTPS, mailto or relative link.",
497
+ requiredValue: "Enter a value.",
498
+ tooLong: "The value exceeds the maximum length.",
499
+ link: "Add link",
500
+ linkUrl: "Link URL",
501
+ popupLabel: "Edit rich text",
502
+ formatting: "Text formatting",
503
+ inlineFormatting: "Inline formatting",
504
+ headings: "Headings",
505
+ structure: "Lists and blocks",
506
+ links: "Links",
507
+ bold: "Bold",
508
+ italic: "Italic",
509
+ strike: "Strike",
510
+ code: "Code",
511
+ heading1: "H1",
512
+ heading2: "H2",
513
+ bullets: "Bullets",
514
+ numberedList: "Numbered list",
515
+ quote: "Quote",
516
+ codeBlock: "Code block"
517
+ }, V = /* @__PURE__ */ new Map();
518
+ function H(e) {
519
+ let t = V.get(e);
520
+ if (t) return t;
521
+ let n = (e) => e.nodeType === 3 ? { text: e.textContent ?? "" } : {
522
+ tag: e.localName,
523
+ attrs: Object.fromEntries([...e.attributes].map((e) => [e.name, e.value])),
524
+ children: [...e.childNodes].map(n)
525
+ }, r = [...x(e).childNodes].map(n);
526
+ return e.length <= 5e4 && (V.size >= 100 && V.delete(V.keys().next().value), V.set(e, r)), r;
527
+ }
528
+ //#endregion
529
+ //#region src/rich-text/index.tsx
530
+ function U(a) {
531
+ let c = {
532
+ ...B,
533
+ ...a.text
534
+ }, l = n(() => S(a.value), [a.value]), [u, d] = t(l), g = n(() => S(u), [u]), [_, v] = t("visual"), [y, b] = t(""), [x, w] = t(C), [T, D] = t(""), [O, k] = t(!1), A = r(!1), j = r(null), M = r(), N = r(u);
535
+ N.current = u, e(() => {
536
+ if (j.current) return M.current = E(j.current, N.current, (e) => {
537
+ A.current = !0, N.current = e, d(e), b("");
538
+ }, w), () => {
539
+ M.current?.destroy(), M.current = void 0;
540
+ };
541
+ }, []);
542
+ let P = (e) => a.required && !e ? "requiredValue" : a.maxLength !== void 0 && e.length > a.maxLength ? "tooLong" : void 0, F = () => {
543
+ let e = S(N.current), t = P(e);
544
+ return t ? (b(c[t]), !1) : (a.onApply(e), !0);
545
+ };
546
+ m(() => !A.current || N.current === l || F(), a.autoApply !== !1);
547
+ let I = !!P(g);
548
+ return /* @__PURE__ */ i("div", {
549
+ class: "rv-rich-text-editor",
550
+ onKeyDown: (e) => {
551
+ (e.ctrlKey || e.metaKey) && e.key === "Enter" && !e.isComposing && (e.preventDefault(), e.stopPropagation(), F());
552
+ },
553
+ children: [
554
+ /* @__PURE__ */ i(p, {
555
+ value: _,
556
+ ariaLabel: c.label,
557
+ options: [{
558
+ value: "visual",
559
+ label: c.visual
560
+ }, {
561
+ value: "source",
562
+ label: c.source
563
+ }],
564
+ onChange: (e) => {
565
+ if (e === "visual") {
566
+ let e = S(N.current);
567
+ N.current = e, d(e), M.current?.setHtml(e);
568
+ } else M.current?.captureSelection();
569
+ v(e), b("");
570
+ }
571
+ }),
572
+ _ === "visual" && /* @__PURE__ */ i(z, {
573
+ engine: () => M.current,
574
+ selection: x,
575
+ text: c,
576
+ showLink: O,
577
+ onLink: () => {
578
+ M.current?.captureSelection(), k(!O);
579
+ }
580
+ }),
581
+ O && _ === "visual" && /* @__PURE__ */ i("div", {
582
+ class: "rv-rich-text-editor__link",
583
+ children: [/* @__PURE__ */ i(s, {
584
+ "aria-label": c.linkUrl,
585
+ value: T,
586
+ onInput: (e) => D(e.currentTarget.value)
587
+ }), /* @__PURE__ */ i(f, {
588
+ onMouseDown: (e) => e.preventDefault(),
589
+ onClick: () => {
590
+ M.current?.link(T) ? (k(!1), b("")) : b(c.unsafeLink);
591
+ },
592
+ children: c.link
593
+ })]
594
+ }),
595
+ /* @__PURE__ */ i("div", {
596
+ ref: j,
597
+ hidden: _ !== "visual",
598
+ class: "rv-rich-text-editor__visual",
599
+ role: "textbox",
600
+ "aria-label": c.label,
601
+ "aria-multiline": "true",
602
+ "aria-invalid": I || void 0,
603
+ contentEditable: !0,
604
+ onClick: (e) => {
605
+ e.target.closest("a") && e.preventDefault();
606
+ }
607
+ }),
608
+ _ === "source" && /* @__PURE__ */ i(o, {
609
+ class: "rv-rich-text-editor__source",
610
+ "aria-label": c.source,
611
+ "aria-invalid": I || void 0,
612
+ value: u,
613
+ onInput: (e) => {
614
+ A.current = !0, N.current = e.currentTarget.value, d(e.currentTarget.value), b("");
615
+ }
616
+ }),
617
+ y && /* @__PURE__ */ i("p", {
618
+ class: "rv-editor-error",
619
+ role: "alert",
620
+ children: y
621
+ }),
622
+ /* @__PURE__ */ i(h, {
623
+ showConfirm: a.showActions ?? a.autoApply === !1,
624
+ text: a.actions,
625
+ disabled: I,
626
+ cancel: a.onCancel,
627
+ apply: F,
628
+ clear: a.required ? void 0 : () => {
629
+ A.current = !0, N.current = "", d(""), M.current?.setHtml(""), b(""), a.autoApply !== !1 && F();
630
+ }
631
+ })
632
+ ]
633
+ });
634
+ }
635
+ //#endregion
636
+ export { S as a, b as i, H as n, B as r, U as t };
@@ -0,0 +1,4 @@
1
+ //#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/rotate-right.svg?raw
2
+ var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M488 192l-144 0c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l46.7-46.7c-75.3-58.6-184.3-53.3-253.5 15.9-75 75-75 196.5 0 271.5s196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c94.3-94.3 243.7-99.6 344.3-16.2L471 7c6.9-6.9 17.2-8.9 26.2-5.2S512 14.3 512 24l0 144c0 13.3-10.7 24-24 24z\"/></svg>";
3
+ //#endregion
4
+ export { e as t };
package/_form.scss CHANGED
@@ -86,7 +86,7 @@ select.rv-control {
86
86
  background-size: 5px 5px;
87
87
  }
88
88
  select.rv-control[multiple] { background-image: none; padding-inline-end: 10px; }
89
- .rv-control--compact { --rv-control-height: 30px; --rv-control-padding: 5px 8px; --rv-control-radius: var(--rv-ui-radius, 6px); font-size: 12px; }
89
+ .rv-control--compact { --rv-control-font-size: 12px; --rv-control-height: 30px; --rv-control-padding: 5px 8px; --rv-control-radius: var(--rv-ui-radius, 6px); font-size: 12px; }
90
90
  select.rv-control--compact { padding-inline-end: 28px; }
91
91
  .rv-radio { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--rv-ui-accent); }
92
92
  .rv-radio:focus-visible { outline: 2px solid var(--rv-ui-accent); outline-offset: 2px; }