@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.
- package/MIGRATION.md +36 -0
- package/OWNERSHIP.md +32 -32
- package/README.md +136 -78
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-CgXQgkga.js} +19 -19
- package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
- package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/choice-chips-SkllS5Kl.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
- package/_chunks/color-picker-BpCTuIdm.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-CfeHXgIw.js} +279 -264
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
- package/_chunks/configurator-actions-DnStE6Yl.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/{control-AHKXD5Eu.js → control-Dcrjsunl.js} +42 -17
- package/_chunks/controls-B_6NJarZ.js +650 -0
- package/_chunks/{date-control-DrVFX13g.js → date-control-C4h4m75W.js} +1 -1
- package/_chunks/{date-time-qIhp5vaX.js → date-time-CTOSbzb0.js} +317 -278
- package/_chunks/dialog.parts-3w5FR06n.js +131 -0
- package/_chunks/{duration-CL68Em0o.js → duration-Bf2OS1V5.js} +5 -5
- package/_chunks/editor-popup-ByU7qiub.js +82 -0
- package/_chunks/field-configurator-D5dZRhDe.js +288 -0
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
- package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-BRdcG60g.js +267 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
- package/_chunks/native-control-B_fVA5bL.js +649 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-CmM6_2vR.js} +7 -7
- package/_chunks/{picker-h1P5RUgp.js → picker-DTqET-2W.js} +2 -2
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/{popup-CT2uD3go.js → popup-C35Isk7p.js} +115 -104
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-C-6wcb9U.js} +1 -1
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-DIl1gkV6.js} +1 -1
- package/_chunks/request-trail-DrhdpWiH.js +762 -0
- package/_chunks/rich-text-BnilBbhU.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/selection-list-tooltips-C5oMJe26.js +42 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/_dialog.scss +57 -22
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_shared/data-query/index.d.ts +2 -2
- package/_shared/data-query/load-options.d.ts +2 -2
- package/_variables.scss +34 -32
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +1 -1
- package/ai/_chat.scss +35 -3
- package/ai/_style.scss +76 -16
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +16 -3
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -6
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/_style.scss +83 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +2 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -7
- package/assignee/assignee.scss +28 -6
- package/assignee/index.js +2 -2
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +33 -32
- package/badge.d.ts +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +27 -27
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +16 -16
- package/calendar/_calendar.scss +21 -25
- package/calendar/calendar.js +1 -1
- package/calendar/header.js +1 -2
- package/calendar/index.js +2 -2
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/column-type.style.css +12 -0
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +6 -24
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +9 -7
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +63 -0
- package/configurator-drop-zone.d.ts +39 -0
- package/configurator-drop-zone.js +66 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +25 -20
- package/controls.d.ts +12 -2
- package/controls.js +4 -3
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/attach.d.ts +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +3 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +239 -36
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +9 -9
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.js +1 -1
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/dropdown.types.d.ts +1 -1
- package/dropdown/editor-dropdown.style.scss +19 -9
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- package/dropdown/lookup-field.js +2 -1
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +1 -1
- package/editor-layout/index.d.ts +4 -4
- package/editor-layout/index.js +39 -34
- package/editor-layout/style.scss +82 -18
- package/field-configurator.d.ts +39 -1
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.d.ts +0 -1
- package/filter-controls.js +5 -6
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +7 -7
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +12 -12
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +22 -21
- package/formatting/styles.scss +14 -57
- package/framework.js +227 -224
- package/history-controls.js +27 -1
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/legend.d.ts +1 -1
- package/masked-input/index.js +1 -1
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +46 -43
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +71 -2
- package/pagination.js +11 -11
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +1 -1
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +203 -42
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +13 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +4 -2
- package/react-control.d.ts +2 -0
- package/react-control.js +2 -2
- package/react.d.ts +7 -8
- package/react.js +67 -66
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-popup.js +1 -1
- package/resource-picker/resource-picker.js +74 -72
- package/resource-picker/resource-picker.scss +62 -34
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +293 -44
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/toolbar.d.ts +1 -1
- package/rich-text/translations.d.ts +2 -0
- package/search-input/index.js +1 -1
- package/search-input/native.d.ts +21 -2
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/popover.js +4 -4
- package/status-feedback/status-feedback.scss +124 -35
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +78 -17
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +400 -80
- package/styles/_control.scss +30 -8
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -4
- package/styles/_field-configurator.scss +321 -23
- package/styles/_fields-grid.scss +49 -0
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +369 -110
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/configurator-actions.scss +241 -0
- package/styles/pagination.css +213 -0
- package/styles/{legacy-rating.css → rating.css} +8 -3
- package/styles.css +1 -1
- package/styles.scss +3 -5
- package/surfaces.d.ts +38 -2
- package/surfaces.js +37 -134
- package/svelte/UiComponent.svelte +44 -11
- package/svelte.d.ts +1 -1
- package/svelte.js +3 -3
- package/switch/index.js +15 -14
- package/time-grid.d.ts +0 -1
- package/time-grid.js +38 -37
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/index.js +2 -2
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue.d.ts +29 -32
- package/vue.js +116 -121
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/controls-DsNi8V8I.js +0 -630
- package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -10
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- 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 };
|
package/avatar/index.view.d.ts
DELETED
|
@@ -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;
|