@revolist/ui 4.0.1-rc → 4.0.2-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/_chunks/calendar-CpaUK7w1.js +248 -0
- package/_chunks/chart-frame-BC99KjGa.js +127 -0
- package/_chunks/choice-chips-Cs4D-3nH.js +110 -0
- package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-BBMFmUNA.js} +41 -41
- package/_chunks/color-picker-D90Jg-M8.js +138 -0
- package/_chunks/compat.module-DDB2pm9O.js +229 -0
- package/_chunks/component-YDcfoOLz.js +859 -0
- package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-ztgmsG7H.js} +29 -29
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/{controls-NEL5tDaz.js → controls-DIum-E66.js} +192 -192
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-BJSzu79z.js} +21 -21
- package/_chunks/date-time-BxPJusp9.js +770 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-Bblyah10.js} +1 -1
- package/_chunks/dialog.parts-DBqo3Qwb.js +134 -0
- package/_chunks/{dropdown-CkGQBm1Q.js → dropdown-voWqmwAe.js} +102 -102
- package/_chunks/duration-87U2EoMS.js +271 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-D3JdS8l3.js} +8 -8
- package/_chunks/framework-mount-C-Zwm44H.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/mount-DZe_6VtR.js +90 -0
- package/_chunks/native.view-ByyZ1CT5.js +32 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-BeIadZuL.js} +89 -89
- package/_chunks/picker-DpP7iQLA.js +122 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-Ca8ZBty3.js} +10 -10
- package/_chunks/reorder-list-Cc3KmfAN.js +59 -0
- package/_chunks/request-trail-IdNiFvKH.js +347 -0
- package/_chunks/{rich-text-2Rla349o.js → rich-text-BzI1DyfF.js} +167 -167
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +16 -16
- package/ai/components.d.ts +1 -1
- package/ai/index.js +2 -2
- package/ai/request-trail.d.ts +1 -1
- package/ai/translation-context.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +87 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/index.js +25 -25
- package/avatar/index.view.d.ts +1 -1
- package/brush-range/component.d.ts +1 -1
- package/brush-range/component.js +30 -30
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +3 -3
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +35 -35
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +35 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +19 -19
- package/control-presentation.js +18 -18
- package/controls.d.ts +4 -4
- package/controls.js +1 -1
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup.d.ts +1 -1
- package/core/editor-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +2 -2
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +1 -1
- package/date-time/types.d.ts +1 -1
- package/dialog/dialog-action-footer.view.d.ts +1 -1
- package/dialog/dialog.dom.js +52 -52
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +1 -1
- package/distribution-chart/bar-chart.js +6 -6
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +1 -1
- package/dropdown/content.js +83 -82
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/index.js +1 -1
- package/dropdown/lookup-field.d.ts +1 -1
- package/dropdown/lookup-field.js +41 -41
- package/dropdown/popup.d.ts +1 -1
- package/dropdown/popup.js +17 -16
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +1 -1
- package/editor-layout/index.js +27 -27
- package/field-configurator.d.ts +1 -1
- package/field-configurator.js +93 -93
- package/field-reorder.hook.js +32 -32
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -1
- package/filter-controls.js +31 -31
- package/form-controls/index.js +20 -20
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +44 -44
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/control-tooltip.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.js +99 -98
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +19 -19
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +11 -11
- package/native-control.js +12 -12
- package/native.js +39 -39
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +1 -2
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +1 -1
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +1 -1
- package/preact.js +14 -14
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +1 -1
- package/react.js +19 -19
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +88 -88
- package/rich-text/index.d.ts +1 -1
- package/rich-text/index.js +1 -1
- package/rich-text/toolbar.d.ts +1 -1
- package/search-input/index.js +12 -12
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +13 -13
- package/surfaces.js +34 -34
- package/svelte.js +2 -2
- package/switch/index.js +15 -15
- package/time-grid.d.ts +1 -1
- package/time-grid.js +58 -58
- package/timeline-track/component.d.ts +1 -1
- package/timeline-track/index.js +75 -75
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +116 -116
- package/vue.js +121 -121
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-picker-BRv-__AM.js +0 -138
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { $convertFromMarkdownString as
|
|
10
|
-
import { $createParagraphNode as
|
|
11
|
-
import { $createHeadingNode as
|
|
12
|
-
import { $isListNode as
|
|
13
|
-
import { $isLinkNode as
|
|
14
|
-
import { $createCodeNode as
|
|
15
|
-
import { $setBlocksType as
|
|
16
|
-
import { createEmptyHistoryState as
|
|
1
|
+
import { c as e, i as t, t as n } from "./hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t as r } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { SvgIcon as i } from "../icons/icon.js";
|
|
4
|
+
import { Input as a, TextArea as o } from "../native-control.js";
|
|
5
|
+
import { F as s, I as c, L as l, R as u, n as d } from "./controls-DIum-E66.js";
|
|
6
|
+
import { SegmentedSwitch as f } from "../segmented-switch/index.js";
|
|
7
|
+
import { n as ee } from "./editor-commit-Bq3wSgvr.js";
|
|
8
|
+
import { EditorActions as te } from "../editor-actions.js";
|
|
9
|
+
import { $convertFromMarkdownString as p, $convertToMarkdownString as m, HIGHLIGHT as h, TRANSFORMERS as g, registerMarkdownShortcuts as _ } from "@lexical/markdown";
|
|
10
|
+
import { $createParagraphNode as v, $getRoot as y, $getSelection as b, $isElementNode as x, $isRangeSelection as S, $isTextNode as C, $setSelection as w, COMMAND_PRIORITY_HIGH as T, FORMAT_TEXT_COMMAND as E, PASTE_COMMAND as D, createEditor as O } from "lexical";
|
|
11
|
+
import { $createHeadingNode as k, $createQuoteNode as ne, $isHeadingNode as A, $isQuoteNode as j, HeadingNode as M, QuoteNode as N, registerRichText as re } from "@lexical/rich-text";
|
|
12
|
+
import { $isListNode as P, INSERT_ORDERED_LIST_COMMAND as ie, INSERT_UNORDERED_LIST_COMMAND as ae, ListItemNode as F, ListNode as I, REMOVE_LIST_COMMAND as L, registerList as oe } from "@lexical/list";
|
|
13
|
+
import { $isLinkNode as R, $toggleLink as se, LinkNode as z } from "@lexical/link";
|
|
14
|
+
import { $createCodeNode as ce, $isCodeNode as B, CodeNode as V } from "@lexical/code";
|
|
15
|
+
import { $setBlocksType as le } from "@lexical/selection";
|
|
16
|
+
import { createEmptyHistoryState as H, registerHistory as U } from "@lexical/history";
|
|
17
17
|
//#region src/rich-text/syntax.ts
|
|
18
|
-
var W =
|
|
18
|
+
var W = g.filter((e) => e !== h);
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rich-text/model.ts
|
|
21
21
|
function G(e) {
|
|
@@ -41,10 +41,10 @@ var q = {
|
|
|
41
41
|
block: null,
|
|
42
42
|
link: !1
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
let e =
|
|
46
|
-
if (!
|
|
47
|
-
let t = e.anchor.getNode(), n = [t, ...t.getParents()], r = n.find((e) =>
|
|
44
|
+
function J() {
|
|
45
|
+
let e = b();
|
|
46
|
+
if (!S(e)) return q;
|
|
47
|
+
let t = e.anchor.getNode(), n = [t, ...t.getParents()], r = n.find((e) => A(e) || j(e) || B(e) || P(e));
|
|
48
48
|
return {
|
|
49
49
|
formats: [
|
|
50
50
|
"bold",
|
|
@@ -52,20 +52,20 @@ function de() {
|
|
|
52
52
|
"strikethrough",
|
|
53
53
|
"code"
|
|
54
54
|
].filter((t) => e.hasFormat(t)),
|
|
55
|
-
block:
|
|
56
|
-
link: n.some(
|
|
55
|
+
block: A(r) ? r.getTag() : P(r) ? r.getListType() === "number" ? "ordered" : "bullet" : j(r) ? "quote" : B(r) ? "code" : "paragraph",
|
|
56
|
+
link: n.some(R)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
let i =
|
|
59
|
+
function ue(e, t, n, r = () => {}) {
|
|
60
|
+
let i = O({
|
|
61
61
|
namespace: "RevoMarkdown",
|
|
62
62
|
nodes: [
|
|
63
|
-
|
|
63
|
+
M,
|
|
64
|
+
N,
|
|
64
65
|
I,
|
|
66
|
+
F,
|
|
65
67
|
z,
|
|
66
|
-
|
|
67
|
-
V,
|
|
68
|
-
U
|
|
68
|
+
V
|
|
69
69
|
],
|
|
70
70
|
onError: (e) => {
|
|
71
71
|
throw e;
|
|
@@ -79,131 +79,131 @@ function fe(e, t, n, r = () => {}) {
|
|
|
79
79
|
});
|
|
80
80
|
i.setRootElement(e);
|
|
81
81
|
let a = [
|
|
82
|
-
i.registerCommand(
|
|
82
|
+
i.registerCommand(E, (e) => ![
|
|
83
83
|
"bold",
|
|
84
84
|
"italic",
|
|
85
85
|
"strikethrough",
|
|
86
86
|
"code"
|
|
87
|
-
].includes(e),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
].includes(e), T),
|
|
88
|
+
re(i),
|
|
89
|
+
oe(i),
|
|
90
|
+
U(i, H(), 300),
|
|
91
|
+
_(i, W)
|
|
92
92
|
];
|
|
93
|
-
a.push(i.registerCommand(
|
|
93
|
+
a.push(i.registerCommand(D, (e) => {
|
|
94
94
|
if (!e || !("clipboardData" in e) || !e.clipboardData) return !1;
|
|
95
95
|
let t = e.clipboardData.getData("text/plain");
|
|
96
96
|
e.preventDefault();
|
|
97
|
-
let n =
|
|
98
|
-
return
|
|
99
|
-
},
|
|
97
|
+
let n = b();
|
|
98
|
+
return S(n) && n.insertRawText(t), !0;
|
|
99
|
+
}, T));
|
|
100
100
|
let o = null, s = (e) => i.update(() => {
|
|
101
|
-
|
|
101
|
+
p(e, W);
|
|
102
102
|
}, {
|
|
103
103
|
tag: "markdown-source",
|
|
104
104
|
discrete: !0
|
|
105
105
|
});
|
|
106
106
|
return s(t), a.push(i.registerUpdateListener(({ editorState: e, dirtyElements: t, dirtyLeaves: i, tags: a }) => {
|
|
107
|
-
e.read(() => r(
|
|
108
|
-
let e =
|
|
107
|
+
e.read(() => r(J())), !(a.has("markdown-source") || !t.size && !i.size) && e.read(() => {
|
|
108
|
+
let e = y().getAllTextNodes().some((e) => {
|
|
109
109
|
let t = e.getParent();
|
|
110
|
-
return
|
|
110
|
+
return R(t) && !K(t.getURL());
|
|
111
111
|
});
|
|
112
|
-
n(
|
|
112
|
+
n(m(W), e);
|
|
113
113
|
});
|
|
114
114
|
})), {
|
|
115
115
|
editor: i,
|
|
116
116
|
setMarkdown: s,
|
|
117
117
|
format: (e) => {
|
|
118
|
-
i.dispatchCommand(
|
|
118
|
+
i.dispatchCommand(E, e), i.focus();
|
|
119
119
|
},
|
|
120
120
|
block: (e) => {
|
|
121
|
-
e === "paragraph" && i.dispatchCommand(
|
|
121
|
+
e === "paragraph" && i.dispatchCommand(L, void 0), e === "bullet" || e === "ordered" ? i.dispatchCommand(e === "bullet" ? ae : ie, void 0) : i.update(() => le(b(), () => e === "paragraph" ? v() : e === "code" ? ce() : e === "quote" ? ne() : k(e))), i.focus();
|
|
122
122
|
},
|
|
123
123
|
captureSelection: () => i.getEditorState().read(() => {
|
|
124
|
-
o =
|
|
124
|
+
o = b()?.clone() ?? null;
|
|
125
125
|
}),
|
|
126
126
|
link: (e) => K(e) ? (i.update(() => {
|
|
127
|
-
o &&
|
|
127
|
+
o && w(o.clone()), se(e, { rel: "noopener noreferrer" });
|
|
128
128
|
}), i.focus(), !0) : !1,
|
|
129
129
|
destroy: () => {
|
|
130
130
|
a.forEach((e) => e()), i.setRootElement(null);
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
let t =
|
|
134
|
+
function Y(e) {
|
|
135
|
+
let t = O({
|
|
136
136
|
namespace: "RevoMarkdownValidation",
|
|
137
137
|
nodes: [
|
|
138
|
-
|
|
138
|
+
M,
|
|
139
|
+
N,
|
|
139
140
|
I,
|
|
141
|
+
F,
|
|
140
142
|
z,
|
|
141
|
-
|
|
142
|
-
V,
|
|
143
|
-
U
|
|
143
|
+
V
|
|
144
144
|
],
|
|
145
145
|
onError: (e) => {
|
|
146
146
|
throw e;
|
|
147
147
|
}
|
|
148
148
|
}), n = !1;
|
|
149
149
|
return t.update(() => {
|
|
150
|
-
|
|
150
|
+
p(e, W), n = y().getAllTextNodes().some((e) => {
|
|
151
151
|
let t = e.getParent();
|
|
152
|
-
return
|
|
152
|
+
return R(t) && !K(t.getURL());
|
|
153
153
|
});
|
|
154
154
|
}, { discrete: !0 }), n;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/bold.svg?raw
|
|
158
|
-
var
|
|
158
|
+
var de = "<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>", fe = "<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>", pe = "<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>", me = "<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>", X = "<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>", he = "<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>", ge = "<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>", _e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"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>", ve = "<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>", ye = "<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>", be = "<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>", xe = "<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>";
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/rich-text/toolbar.tsx
|
|
161
|
-
function
|
|
162
|
-
let
|
|
161
|
+
function Se({ engine: e, selection: t, text: n, showLink: a, onLink: o }) {
|
|
162
|
+
let d = (e, t, n, a, o) => /* @__PURE__ */ r(s, {
|
|
163
163
|
size: "compact",
|
|
164
164
|
className: "rv-markdown-editor__command",
|
|
165
|
-
"aria-label":
|
|
166
|
-
title:
|
|
167
|
-
pressed:
|
|
165
|
+
"aria-label": e,
|
|
166
|
+
title: e,
|
|
167
|
+
pressed: n,
|
|
168
168
|
onMouseDown: (e) => e.preventDefault(),
|
|
169
169
|
onPressedChange: a,
|
|
170
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ r(i, { svg: t }), o && /* @__PURE__ */ r(i, {
|
|
171
171
|
svg: o,
|
|
172
172
|
className: "rv-svg-icon rv-markdown-editor__level"
|
|
173
173
|
})]
|
|
174
|
-
}),
|
|
175
|
-
return /* @__PURE__ */
|
|
174
|
+
}), f = (n, r, i, a) => d(n, r, t.block === i, () => e()?.block(t.block === i ? "paragraph" : i), a);
|
|
175
|
+
return /* @__PURE__ */ r(c, {
|
|
176
176
|
className: "rv-markdown-editor__toolbar",
|
|
177
|
-
label:
|
|
177
|
+
label: n.formatting,
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
label:
|
|
179
|
+
/* @__PURE__ */ r(l, {
|
|
180
|
+
label: n.inlineFormatting,
|
|
181
181
|
children: [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
d(n.bold, de, t.formats.includes("bold"), () => e()?.format("bold")),
|
|
183
|
+
d(n.italic, fe, t.formats.includes("italic"), () => e()?.format("italic")),
|
|
184
|
+
d(n.strike, pe, t.formats.includes("strikethrough"), () => e()?.format("strikethrough")),
|
|
185
|
+
d(n.code, me, t.formats.includes("code"), () => e()?.format("code"))
|
|
186
186
|
]
|
|
187
187
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
label:
|
|
191
|
-
children: [
|
|
188
|
+
/* @__PURE__ */ r(u, {}),
|
|
189
|
+
/* @__PURE__ */ r(l, {
|
|
190
|
+
label: n.headings,
|
|
191
|
+
children: [f(n.heading1, X, "h1", he), f(n.heading2, X, "h2", ge)]
|
|
192
192
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
label:
|
|
193
|
+
/* @__PURE__ */ r(u, {}),
|
|
194
|
+
/* @__PURE__ */ r(l, {
|
|
195
|
+
label: n.structure,
|
|
196
196
|
children: [
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
f(n.bullets, _e, "bullet"),
|
|
198
|
+
f(n.numberedList, ve, "ordered"),
|
|
199
|
+
f(n.quote, ye, "quote"),
|
|
200
|
+
f(n.codeBlock, be, "code")
|
|
201
201
|
]
|
|
202
202
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
label:
|
|
206
|
-
children:
|
|
203
|
+
/* @__PURE__ */ r(u, {}),
|
|
204
|
+
/* @__PURE__ */ r(l, {
|
|
205
|
+
label: n.links,
|
|
206
|
+
children: d(n.link, xe, a || t.link, o)
|
|
207
207
|
})
|
|
208
208
|
]
|
|
209
209
|
});
|
|
@@ -246,7 +246,7 @@ var Z = {
|
|
|
246
246
|
highlight: "Highlight",
|
|
247
247
|
extensions: "Extensions",
|
|
248
248
|
indentedCode: "Indented code"
|
|
249
|
-
},
|
|
249
|
+
}, Ce = {
|
|
250
250
|
Images: "images",
|
|
251
251
|
Tables: "tables",
|
|
252
252
|
HTML: "html",
|
|
@@ -259,32 +259,32 @@ var Z = {
|
|
|
259
259
|
"Indented code": "indentedCode"
|
|
260
260
|
};
|
|
261
261
|
function Q(e, t) {
|
|
262
|
-
return e.map((e) => t[
|
|
262
|
+
return e.map((e) => t[Ce[e]] ?? e).join(", ");
|
|
263
263
|
}
|
|
264
264
|
//#endregion
|
|
265
265
|
//#region src/rich-text/render-model.ts
|
|
266
266
|
var $ = /* @__PURE__ */ new Map();
|
|
267
|
-
function
|
|
267
|
+
function we(e) {
|
|
268
268
|
let t = $.get(e);
|
|
269
269
|
if (t) return t;
|
|
270
270
|
let n;
|
|
271
271
|
if (G(e).length) n = [{ text: e }];
|
|
272
272
|
else {
|
|
273
|
-
let t =
|
|
273
|
+
let t = O({
|
|
274
274
|
namespace: "RevoMarkdownRenderer",
|
|
275
275
|
nodes: [
|
|
276
|
-
|
|
276
|
+
M,
|
|
277
|
+
N,
|
|
277
278
|
I,
|
|
279
|
+
F,
|
|
278
280
|
z,
|
|
279
|
-
|
|
280
|
-
V,
|
|
281
|
-
U
|
|
281
|
+
V
|
|
282
282
|
],
|
|
283
283
|
onError: (e) => {
|
|
284
284
|
throw e;
|
|
285
285
|
}
|
|
286
286
|
}), r = (e) => {
|
|
287
|
-
if (
|
|
287
|
+
if (C(e)) {
|
|
288
288
|
let t = { text: e.getTextContent() };
|
|
289
289
|
for (let [n, r] of [
|
|
290
290
|
["code", "code"],
|
|
@@ -298,8 +298,8 @@ function Te(e) {
|
|
|
298
298
|
return t;
|
|
299
299
|
}
|
|
300
300
|
if (e.getType() === "linebreak") return { tag: "br" };
|
|
301
|
-
let t =
|
|
302
|
-
if (
|
|
301
|
+
let t = x(e) ? e.getChildren().map(r) : [{ text: e.getTextContent() }];
|
|
302
|
+
if (R(e)) return K(e.getURL()) ? {
|
|
303
303
|
tag: "a",
|
|
304
304
|
attrs: {
|
|
305
305
|
href: e.getURL(),
|
|
@@ -310,11 +310,11 @@ function Te(e) {
|
|
|
310
310
|
tag: "span",
|
|
311
311
|
children: t
|
|
312
312
|
};
|
|
313
|
-
if (
|
|
313
|
+
if (A(e)) return {
|
|
314
314
|
tag: e.getTag(),
|
|
315
315
|
children: t
|
|
316
316
|
};
|
|
317
|
-
if (
|
|
317
|
+
if (P(e)) return {
|
|
318
318
|
tag: e.getListType() === "number" ? "ol" : "ul",
|
|
319
319
|
attrs: e.getListType() === "number" ? { start: e.getStart() } : void 0,
|
|
320
320
|
children: t
|
|
@@ -346,132 +346,132 @@ function Te(e) {
|
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
348
|
t.update(() => {
|
|
349
|
-
|
|
350
|
-
}, { discrete: !0 }), n = t.getEditorState().read(() =>
|
|
349
|
+
p(e, W);
|
|
350
|
+
}, { discrete: !0 }), n = t.getEditorState().read(() => y().getChildren().map(r));
|
|
351
351
|
}
|
|
352
352
|
return e.length <= 5e4 && ($.size >= 100 && $.delete($.keys().next().value), $.set(e, n)), n;
|
|
353
353
|
}
|
|
354
354
|
//#endregion
|
|
355
355
|
//#region src/rich-text/index.tsx
|
|
356
|
-
function
|
|
357
|
-
let
|
|
356
|
+
function Te(i) {
|
|
357
|
+
let s = {
|
|
358
358
|
...Z,
|
|
359
|
-
...
|
|
360
|
-
}, [
|
|
361
|
-
|
|
362
|
-
if (
|
|
363
|
-
|
|
364
|
-
},
|
|
365
|
-
|
|
359
|
+
...i.text
|
|
360
|
+
}, [c, l] = t(i.value), [u] = t(() => !G(i.value).length && !Y(i.value)), [p, m] = t(u ? "visual" : "source"), [h, g] = t(""), [_, v] = t(q), [y, b] = t(""), [x, S] = t(!1), C = n(!1), w = n(null), T = n(), E = n(c);
|
|
361
|
+
E.current = c, e(() => {
|
|
362
|
+
if (w.current) return T.current = ue(w.current, u ? i.value : "", (e, t) => {
|
|
363
|
+
C.current = !0, E.current = e, l(e), g(t ? s.unsafeLink : "");
|
|
364
|
+
}, v), () => {
|
|
365
|
+
T.current?.destroy(), T.current = void 0;
|
|
366
366
|
};
|
|
367
367
|
}, []);
|
|
368
|
-
let
|
|
369
|
-
let
|
|
370
|
-
return
|
|
368
|
+
let D = () => {
|
|
369
|
+
let e = C.current ? E.current : i.value;
|
|
370
|
+
return Y(e) ? (g(s.unsafeLink), !1) : i.required && !e.trim() ? (g(s.requiredValue), !1) : i.maxLength !== void 0 && e.length > i.maxLength ? (g(s.tooLong), !1) : (i.onApply(e), !0);
|
|
371
371
|
};
|
|
372
|
-
|
|
373
|
-
let
|
|
374
|
-
return /* @__PURE__ */
|
|
372
|
+
ee(() => !C.current || E.current === i.value || D(), i.autoApply !== !1);
|
|
373
|
+
let O = G(c), k = h === s.unsafeLink || !!i.required && !c.trim() || i.maxLength !== void 0 && c.length > i.maxLength;
|
|
374
|
+
return /* @__PURE__ */ r("div", {
|
|
375
375
|
class: "rv-markdown-editor",
|
|
376
376
|
onKeyDown: (e) => {
|
|
377
|
-
(e.ctrlKey || e.metaKey) && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(),
|
|
377
|
+
(e.ctrlKey || e.metaKey) && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), D());
|
|
378
378
|
},
|
|
379
379
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
value:
|
|
382
|
-
ariaLabel:
|
|
380
|
+
/* @__PURE__ */ r(f, {
|
|
381
|
+
value: p,
|
|
382
|
+
ariaLabel: s.label,
|
|
383
383
|
options: [{
|
|
384
384
|
value: "visual",
|
|
385
|
-
label:
|
|
385
|
+
label: s.visual
|
|
386
386
|
}, {
|
|
387
387
|
value: "source",
|
|
388
|
-
label:
|
|
388
|
+
label: s.source
|
|
389
389
|
}],
|
|
390
390
|
onChange: (e) => {
|
|
391
391
|
if (e === "visual") {
|
|
392
|
-
if (
|
|
393
|
-
|
|
392
|
+
if (O.length) {
|
|
393
|
+
g(`${s.unsupported} ${Q(O, s)}`);
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
396
|
-
if (
|
|
397
|
-
|
|
396
|
+
if (Y(c)) {
|
|
397
|
+
g(s.unsafeLink);
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
|
-
|
|
400
|
+
T.current?.setMarkdown(c);
|
|
401
401
|
}
|
|
402
|
-
|
|
402
|
+
m(e), g("");
|
|
403
403
|
}
|
|
404
404
|
}),
|
|
405
|
-
|
|
406
|
-
engine: () =>
|
|
407
|
-
selection:
|
|
408
|
-
text:
|
|
409
|
-
showLink:
|
|
405
|
+
p === "visual" && /* @__PURE__ */ r(Se, {
|
|
406
|
+
engine: () => T.current,
|
|
407
|
+
selection: _,
|
|
408
|
+
text: s,
|
|
409
|
+
showLink: x,
|
|
410
410
|
onLink: () => {
|
|
411
|
-
|
|
411
|
+
T.current?.captureSelection(), S(!x);
|
|
412
412
|
}
|
|
413
413
|
}),
|
|
414
|
-
|
|
414
|
+
x && p === "visual" && /* @__PURE__ */ r("div", {
|
|
415
415
|
class: "rv-markdown-editor__link",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
417
|
-
"aria-label":
|
|
418
|
-
value:
|
|
419
|
-
onInput: (e) =>
|
|
420
|
-
}), /* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ r(a, {
|
|
417
|
+
"aria-label": s.linkUrl,
|
|
418
|
+
value: y,
|
|
419
|
+
onInput: (e) => b(e.currentTarget.value)
|
|
420
|
+
}), /* @__PURE__ */ r(d, {
|
|
421
421
|
onMouseDown: (e) => e.preventDefault(),
|
|
422
422
|
onClick: () => {
|
|
423
|
-
|
|
423
|
+
T.current?.link(y) ? (S(!1), g("")) : g(s.unsafeLink);
|
|
424
424
|
},
|
|
425
|
-
children:
|
|
425
|
+
children: s.link
|
|
426
426
|
})]
|
|
427
427
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
ref:
|
|
430
|
-
hidden:
|
|
428
|
+
/* @__PURE__ */ r("div", {
|
|
429
|
+
ref: w,
|
|
430
|
+
hidden: p !== "visual",
|
|
431
431
|
class: "rv-markdown-editor__visual",
|
|
432
432
|
role: "textbox",
|
|
433
|
-
"aria-label":
|
|
433
|
+
"aria-label": s.label,
|
|
434
434
|
"aria-multiline": "true",
|
|
435
|
-
"aria-invalid":
|
|
435
|
+
"aria-invalid": k || void 0,
|
|
436
436
|
contentEditable: !0,
|
|
437
437
|
onClick: (e) => {
|
|
438
438
|
e.target.closest("a") && e.preventDefault();
|
|
439
439
|
}
|
|
440
440
|
}),
|
|
441
|
-
|
|
441
|
+
p === "source" && /* @__PURE__ */ r(o, {
|
|
442
442
|
class: "rv-markdown-editor__source",
|
|
443
|
-
"aria-label":
|
|
444
|
-
"aria-invalid":
|
|
445
|
-
value:
|
|
443
|
+
"aria-label": s.source,
|
|
444
|
+
"aria-invalid": k || void 0,
|
|
445
|
+
value: c,
|
|
446
446
|
onInput: (e) => {
|
|
447
|
-
|
|
447
|
+
C.current = !0, E.current = e.currentTarget.value, l(e.currentTarget.value), g("");
|
|
448
448
|
}
|
|
449
449
|
}),
|
|
450
|
-
|
|
450
|
+
O.length > 0 && p === "source" && /* @__PURE__ */ r("p", {
|
|
451
451
|
role: "status",
|
|
452
452
|
children: [
|
|
453
|
-
|
|
453
|
+
s.unsupported,
|
|
454
454
|
" ",
|
|
455
|
-
Q(
|
|
455
|
+
Q(O, s)
|
|
456
456
|
]
|
|
457
457
|
}),
|
|
458
|
-
|
|
458
|
+
h && /* @__PURE__ */ r("p", {
|
|
459
459
|
class: "rv-editor-error",
|
|
460
460
|
role: "alert",
|
|
461
|
-
children:
|
|
461
|
+
children: h
|
|
462
462
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
showConfirm:
|
|
465
|
-
text:
|
|
466
|
-
disabled:
|
|
467
|
-
cancel:
|
|
468
|
-
apply:
|
|
469
|
-
clear:
|
|
470
|
-
|
|
463
|
+
/* @__PURE__ */ r(te, {
|
|
464
|
+
showConfirm: i.showActions ?? i.autoApply === !1,
|
|
465
|
+
text: i.actions,
|
|
466
|
+
disabled: k,
|
|
467
|
+
cancel: i.onCancel,
|
|
468
|
+
apply: D,
|
|
469
|
+
clear: i.required ? void 0 : () => {
|
|
470
|
+
C.current = !0, E.current = "", l(""), T.current?.setMarkdown(""), g(""), i.autoApply !== !1 && D();
|
|
471
471
|
}
|
|
472
472
|
})
|
|
473
473
|
]
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
//#endregion
|
|
477
|
-
export { G as a, K as i,
|
|
477
|
+
export { G as a, K as i, we as n, Z as r, Te as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-present Jason Miller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|