@revolist/ui 4.0.3-rc → 4.0.3

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 (314) hide show
  1. package/MIGRATION.md +36 -0
  2. package/OWNERSHIP.md +32 -32
  3. package/README.md +136 -78
  4. package/_button.scss +6 -2
  5. package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
  6. package/_chunks/calculator-CDWOuAcp.js +4 -0
  7. package/_chunks/{calendar-xpZ0v3xf.js → calendar-CgXQgkga.js} +19 -19
  8. package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
  9. package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
  10. package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
  11. package/_chunks/choice-chips-SkllS5Kl.js +126 -0
  12. package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
  13. package/_chunks/color-picker-BpCTuIdm.js +143 -0
  14. package/_chunks/{component-C_T2VN5u.js → component-CfeHXgIw.js} +279 -264
  15. package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
  16. package/_chunks/configurator-actions-DnStE6Yl.js +155 -0
  17. package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
  18. package/_chunks/{control-AHKXD5Eu.js → control-Dcrjsunl.js} +42 -17
  19. package/_chunks/controls-B_6NJarZ.js +650 -0
  20. package/_chunks/{date-control-DrVFX13g.js → date-control-C4h4m75W.js} +1 -1
  21. package/_chunks/{date-time-qIhp5vaX.js → date-time-CTOSbzb0.js} +317 -278
  22. package/_chunks/dialog.parts-3w5FR06n.js +131 -0
  23. package/_chunks/{duration-CL68Em0o.js → duration-Bf2OS1V5.js} +5 -5
  24. package/_chunks/editor-popup-ByU7qiub.js +82 -0
  25. package/_chunks/field-configurator-D5dZRhDe.js +288 -0
  26. package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
  27. package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
  28. package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
  29. package/_chunks/minus-BOAR3A1C.js +4 -0
  30. package/_chunks/mount-BRdcG60g.js +267 -0
  31. package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
  32. package/_chunks/native-control-B_fVA5bL.js +649 -0
  33. package/_chunks/{number-input-BKwA5FnM.js → number-input-CmM6_2vR.js} +7 -7
  34. package/_chunks/{picker-h1P5RUgp.js → picker-DTqET-2W.js} +2 -2
  35. package/_chunks/plus-CbGRkIGl.js +4 -0
  36. package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
  37. package/_chunks/{popup-CT2uD3go.js → popup-C35Isk7p.js} +115 -104
  38. package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-C-6wcb9U.js} +1 -1
  39. package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-DIl1gkV6.js} +1 -1
  40. package/_chunks/request-trail-DrhdpWiH.js +762 -0
  41. package/_chunks/rich-text-BnilBbhU.js +842 -0
  42. package/_chunks/rotate-left-BF6G883o.js +4 -0
  43. package/_chunks/selection-list-tooltips-C5oMJe26.js +42 -0
  44. package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
  45. package/_chunks/tooltip-D4xkio5G.js +54 -0
  46. package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
  47. package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
  48. package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
  49. package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
  50. package/_dialog.scss +57 -22
  51. package/_form.scss +71 -21
  52. package/_legend.scss +25 -7
  53. package/_shared/data-query/index.d.ts +2 -2
  54. package/_shared/data-query/load-options.d.ts +2 -2
  55. package/_variables.scss +34 -32
  56. package/_view-switcher.scss +6 -0
  57. package/activity-message.d.ts +1 -1
  58. package/ai/_chat.scss +35 -3
  59. package/ai/_style.scss +76 -16
  60. package/ai/chat.d.ts +3 -1
  61. package/ai/components.d.ts +16 -3
  62. package/ai/index.d.ts +1 -0
  63. package/ai/index.js +3 -3
  64. package/ai/mount.d.ts +30 -6
  65. package/ai/request-trail.d.ts +9 -3
  66. package/ai/results/_style.scss +83 -0
  67. package/ai/results/index.d.ts +11 -0
  68. package/ai/results/metrics.d.ts +5 -0
  69. package/ai/results/table.d.ts +5 -0
  70. package/ai/results/text.d.ts +5 -0
  71. package/ai/results/types.d.ts +29 -0
  72. package/ai/transcript.d.ts +2 -0
  73. package/ai/translations.d.ts +1 -1
  74. package/angular/angular.d.ts +1 -1
  75. package/angular/angular.js +13 -7
  76. package/assignee/assignee.scss +28 -6
  77. package/assignee/index.js +2 -2
  78. package/avatar/avatar.style.scss +23 -6
  79. package/avatar/index.d.ts +25 -2
  80. package/avatar/index.js +33 -32
  81. package/badge.d.ts +1 -1
  82. package/badge.view.d.ts +8 -0
  83. package/brush-range/_brush-range.scss +55 -49
  84. package/brush-range/component.d.ts +1 -3
  85. package/brush-range/component.js +27 -27
  86. package/buttons/delete-button.style.scss +6 -2
  87. package/buttons/remove-button.d.ts +1 -1
  88. package/buttons/remove-button.style.scss +1 -1
  89. package/buttons/svg-button.d.ts +1 -1
  90. package/buttons/svg-button.js +16 -16
  91. package/calendar/_calendar.scss +21 -25
  92. package/calendar/calendar.js +1 -1
  93. package/calendar/header.js +1 -2
  94. package/calendar/index.js +2 -2
  95. package/cell-input.scss +3 -7
  96. package/cell-visuals/badge.style.scss +6 -3
  97. package/cell-visuals/bar-chart.style.scss +2 -1
  98. package/cell-visuals/column-type.style.css +12 -0
  99. package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
  100. package/cell-visuals/progress-line.style.scss +1 -4
  101. package/cell-visuals/sparkline.style.scss +2 -1
  102. package/cell-visuals/timeline.style.css +4 -2
  103. package/checkbox/checkbox.scss +6 -24
  104. package/choice-chips/index.d.ts +3 -1
  105. package/choice-chips/index.js +1 -1
  106. package/color-palette/color-palette.js +1 -1
  107. package/color-palette/color-palette.style.scss +88 -25
  108. package/color-palette/color-picker.js +2 -2
  109. package/color-palette/color-picker.style.scss +23 -10
  110. package/color-palette/common-palettes.d.ts +1 -1
  111. package/color-palette/common-palettes.js +1 -1
  112. package/color-palette/native.d.ts +15 -2
  113. package/component-catalog.d.ts +9 -7
  114. package/configurator-actions.d.ts +67 -0
  115. package/configurator-actions.js +1 -0
  116. package/configurator-aggregation-list.d.ts +14 -0
  117. package/configurator-aggregation-list.js +63 -0
  118. package/configurator-drop-zone.d.ts +39 -0
  119. package/configurator-drop-zone.js +66 -0
  120. package/configurator-field-icon.d.ts +10 -0
  121. package/configurator-field-icon.js +1 -0
  122. package/configurator-focus.d.ts +4 -0
  123. package/configurator-focus.js +39 -0
  124. package/configurator-sections.d.ts +42 -0
  125. package/configurator-sections.js +71 -0
  126. package/control-presentation.d.ts +8 -2
  127. package/control-presentation.js +25 -20
  128. package/controls.d.ts +12 -2
  129. package/controls.js +4 -3
  130. package/core/editor-popup-position.d.ts +6 -2
  131. package/core/editor-popup.d.ts +4 -0
  132. package/core/editor-popup.js +1 -1
  133. package/core/popover-controller.d.ts +35 -0
  134. package/core/popup-ownership.d.ts +2 -0
  135. package/core/selection-list-tooltips.d.ts +2 -0
  136. package/core/title-tooltip.d.ts +2 -0
  137. package/core/tooltip-session.d.ts +29 -0
  138. package/core/tooltip-surface.d.ts +13 -0
  139. package/core/tooltip-text.d.ts +6 -0
  140. package/core/tooltip.d.ts +35 -0
  141. package/core/top-layer-popup.d.ts +4 -0
  142. package/core/top-layer-popup.js +1 -23
  143. package/date-time/attach.d.ts +1 -1
  144. package/date-time/date-control.d.ts +1 -1
  145. package/date-time/field.d.ts +3 -2
  146. package/date-time/index.js +1 -1
  147. package/date-time/style.scss +239 -36
  148. package/date-time/time-selection.d.ts +3 -1
  149. package/date-time/types.d.ts +5 -1
  150. package/dialog/dialog-action-footer.d.ts +17 -2
  151. package/dialog/dialog.dom.d.ts +15 -2
  152. package/dialog/dialog.dom.js +9 -9
  153. package/dialog/dialog.parts.d.ts +1 -1
  154. package/dialog/dialog.parts.js +1 -1
  155. package/distribution-chart/_distribution-chart.scss +113 -77
  156. package/distribution-chart/area-chart.js +1 -1
  157. package/distribution-chart/bar-chart.js +1 -1
  158. package/distribution-chart/chart-frame.d.ts +1 -1
  159. package/distribution-chart/index.d.ts +1 -1
  160. package/distribution-chart/line-chart.js +1 -1
  161. package/dropdown/content.js +1 -1
  162. package/dropdown/control.js +1 -1
  163. package/dropdown/dropdown.types.d.ts +1 -1
  164. package/dropdown/editor-dropdown.style.scss +19 -9
  165. package/dropdown/index.js +2 -2
  166. package/dropdown/lookup-field.d.ts +5 -0
  167. package/dropdown/lookup-field.js +2 -1
  168. package/dropdown/popup.d.ts +2 -2
  169. package/dropdown/popup.js +1 -1
  170. package/duration/index.js +1 -1
  171. package/editor-actions.js +1 -1
  172. package/editor-layout/index.d.ts +4 -4
  173. package/editor-layout/index.js +39 -34
  174. package/editor-layout/style.scss +82 -18
  175. package/field-configurator.d.ts +39 -1
  176. package/field-configurator.js +4 -170
  177. package/field-expansion.d.ts +9 -0
  178. package/filter/filters/slider/_single-slider.scss +57 -38
  179. package/filter/filters/slider/_slider.scss +41 -33
  180. package/filter/filters/slider/control.js +2 -0
  181. package/filter/filters/slider/runtime.js +49 -22
  182. package/filter/filters/slider/single.js +1 -1
  183. package/filter-badge.js +1 -1
  184. package/filter-controls.d.ts +0 -1
  185. package/filter-controls.js +5 -6
  186. package/form-controls/index.d.ts +10 -2
  187. package/form-controls/index.js +7 -7
  188. package/form-controls/presentation.d.ts +1 -1
  189. package/form-controls/presentation.js +12 -12
  190. package/formatting/index.d.ts +1 -1
  191. package/formatting/index.js +22 -21
  192. package/formatting/styles.scss +14 -57
  193. package/framework.js +227 -224
  194. package/history-controls.js +27 -1
  195. package/icon-toolbar.d.ts +62 -0
  196. package/icon-toolbar.js +1 -0
  197. package/icons/icon.d.ts +1 -1
  198. package/legend.d.ts +1 -1
  199. package/masked-input/index.js +1 -1
  200. package/native-control.d.ts +1 -2
  201. package/native-control.js +1 -1
  202. package/native-controls.d.ts +54 -2
  203. package/native-styles.css +1 -1
  204. package/native-styles.scss +6 -2
  205. package/native.d.ts +3 -3
  206. package/native.js +46 -43
  207. package/number-input/index.d.ts +1 -1
  208. package/number-input/index.js +1 -1
  209. package/package.json +71 -2
  210. package/pagination.js +11 -11
  211. package/pdf-viewer/header.d.ts +1 -1
  212. package/pdf-viewer/index.d.ts +2 -2
  213. package/pdf-viewer/index.js +1 -1
  214. package/pdf-viewer/search-bar.d.ts +1 -1
  215. package/pdf-viewer/status.d.ts +1 -1
  216. package/pdf-viewer/style.scss +203 -42
  217. package/pickers.d.ts +5 -1
  218. package/preact-mount.js +1 -1
  219. package/preact.d.ts +13 -10
  220. package/preact.js +109 -64
  221. package/progress/_bar.scss +9 -3
  222. package/progress/_circular.scss +2 -1
  223. package/rating-choice.js +1 -1
  224. package/react-adapter.d.ts +4 -2
  225. package/react-control.d.ts +2 -0
  226. package/react-control.js +2 -2
  227. package/react.d.ts +7 -8
  228. package/react.js +67 -66
  229. package/reorder-list.d.ts +1 -1
  230. package/reorder-list.js +1 -1
  231. package/reorder-list.scss +59 -17
  232. package/resource-picker/resource-picker-popup.js +1 -1
  233. package/resource-picker/resource-picker.js +74 -72
  234. package/resource-picker/resource-picker.scss +62 -34
  235. package/rich-text/engine.d.ts +1 -0
  236. package/rich-text/format-html.d.ts +2 -0
  237. package/rich-text/index.d.ts +4 -0
  238. package/rich-text/index.js +1 -1
  239. package/rich-text/model.d.ts +2 -0
  240. package/rich-text/style.scss +293 -44
  241. package/rich-text/syntax.d.ts +5 -0
  242. package/rich-text/toolbar.d.ts +1 -1
  243. package/rich-text/translations.d.ts +2 -0
  244. package/search-input/index.js +1 -1
  245. package/search-input/native.d.ts +21 -2
  246. package/select.d.ts +3 -1
  247. package/select.js +1 -1
  248. package/selection-list.d.ts +1 -0
  249. package/selection-list.js +3 -1
  250. package/status-feedback/exit-snapshot.js +4 -4
  251. package/status-feedback/popover.js +4 -4
  252. package/status-feedback/status-feedback.scss +124 -35
  253. package/styles/_activity-message.scss +24 -7
  254. package/styles/_alert.scss +78 -17
  255. package/styles/_cell-editor-frame.scss +11 -0
  256. package/styles/_compositions.scss +400 -80
  257. package/styles/_control.scss +30 -8
  258. package/styles/_disclosure.scss +15 -5
  259. package/styles/_editor-counter.scss +16 -6
  260. package/styles/_editor-slider.scss +8 -4
  261. package/styles/_field-configurator.scss +321 -23
  262. package/styles/_fields-grid.scss +49 -0
  263. package/styles/_filter-controls.scss +10 -2
  264. package/styles/_icon-action.scss +48 -15
  265. package/styles/_loading.scss +12 -3
  266. package/styles/_motion.scss +32 -9
  267. package/styles/_palette.scss +0 -24
  268. package/styles/_primitives.scss +369 -110
  269. package/styles/_theme.scss +130 -86
  270. package/styles/_thresholds.scss +28 -25
  271. package/styles/_time-grid.scss +8 -3
  272. package/styles/_tokens.scss +6 -1
  273. package/styles/configurator-actions.scss +241 -0
  274. package/styles/pagination.css +213 -0
  275. package/styles/{legacy-rating.css → rating.css} +8 -3
  276. package/styles.css +1 -1
  277. package/styles.scss +3 -5
  278. package/surfaces.d.ts +38 -2
  279. package/surfaces.js +37 -134
  280. package/svelte/UiComponent.svelte +44 -11
  281. package/svelte.d.ts +1 -1
  282. package/svelte.js +3 -3
  283. package/switch/index.js +15 -14
  284. package/time-grid.d.ts +0 -1
  285. package/time-grid.js +38 -37
  286. package/timeline-track/_style.scss +96 -24
  287. package/timeline-track/index.js +2 -2
  288. package/ui.css +1 -1
  289. package/view-switcher.d.ts +23 -0
  290. package/vue.d.ts +29 -32
  291. package/vue.js +116 -121
  292. package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
  293. package/_chunks/choice-chips-CHQTUdLs.js +0 -110
  294. package/_chunks/color-picker-CudqPYZo.js +0 -138
  295. package/_chunks/control-tooltip-uscKfAnV.js +0 -100
  296. package/_chunks/controls-DsNi8V8I.js +0 -630
  297. package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
  298. package/_chunks/editor-popup-WDdtVDNA.js +0 -81
  299. package/_chunks/history-controls-B3u3INEK.js +0 -27
  300. package/_chunks/mount-DQ1cpppK.js +0 -257
  301. package/_chunks/native-control-C_yok8_-.js +0 -605
  302. package/_chunks/request-trail-DSlFix6i.js +0 -618
  303. package/_chunks/rich-text-CH7gIqOS.js +0 -636
  304. package/avatar/index.view.d.ts +0 -25
  305. package/color-palette/native.view.d.ts +0 -15
  306. package/control-presentation.view.d.ts +0 -8
  307. package/dialog/dialog-action-footer.view.d.ts +0 -20
  308. package/dialog/dialog.dom.view.d.ts +0 -15
  309. package/form-controls/index.view.d.ts +0 -10
  310. package/formatting/control-tooltip.d.ts +0 -27
  311. package/native-controls.view.d.ts +0 -54
  312. package/search-input/native.view.d.ts +0 -21
  313. package/styles/legacy-pagination.css +0 -112
  314. package/surfaces.view.d.ts +0 -63
@@ -1,636 +0,0 @@
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 };
@@ -1,25 +0,0 @@
1
- import { h } from '../_vendor/preact/src/index';
2
- export { AVATAR_CELL_BACKGROUNDS } from '../color-palette/common-palettes';
3
- export type AvatarTemplateOptions = {
4
- ariaLabel?: string;
5
- className?: string;
6
- index?: number;
7
- initials?: string;
8
- key?: string | number;
9
- label?: string;
10
- rectangular?: boolean;
11
- size?: number;
12
- style?: Record<string, string | number | null | undefined>;
13
- value?: unknown;
14
- };
15
- /** Shared Preact avatar, including image-error fallback. */
16
- export declare function AvatarElement({ options }: {
17
- options?: AvatarTemplateOptions;
18
- }): h.JSX.Element;
19
- export declare function createAvatarElement(document: Document, options?: AvatarTemplateOptions): HTMLSpanElement;
20
- export declare function getAvatarCellBackground(index?: number): "linear-gradient(135deg, #7dd3fc, #2563eb)" | "linear-gradient(135deg, #facc15, #b45309)" | "linear-gradient(135deg, #f9a8d4, #be185d)" | "linear-gradient(135deg, #a5b4fc, #4f46e5)" | "linear-gradient(135deg, #86efac, #15803d)" | "linear-gradient(135deg, #fda4af, #be123c)" | "linear-gradient(135deg, #c4b5fd, #7c3aed)" | "linear-gradient(135deg, #fdba74, #c2410c)";
21
- export declare function getAvatarInitials(value: unknown): string;
22
- export declare function getAvatarIndex(value: unknown): number;
23
- export declare function avatarTemplate(h: any, options?: AvatarTemplateOptions): any;
24
- /** Shared avatar-and-label presentation; resource/row lookup stays with consumers. */
25
- export declare function avatarWithTextTemplate(h: any, options?: AvatarTemplateOptions): any;