@forgedevstack/ink 1.1.4 → 1.1.6
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/CHANGELOG.md +13 -0
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +354 -353
- package/dist/constants/toolbarMenu.const.cjs +1 -1
- package/dist/constants/toolbarMenu.const.d.ts +1 -0
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
- package/dist/constants/toolbarMenu.const.js +16 -15
- package/dist/plugins/ai/demoProvider.cjs +1 -1
- package/dist/plugins/ai/demoProvider.d.ts.map +1 -1
- package/dist/plugins/ai/demoProvider.js +37 -22
- package/dist/styles.css +1 -1
- package/dist/types/features.types.d.ts +1 -1
- package/dist/types/features.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsxs as ce, jsx as
|
|
1
|
+
import { jsxs as ce, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as S, useState as a, useEffect as I } from "react";
|
|
3
3
|
import { INK_MIN_HEIGHT as bo, INK_DEFAULT_TEXT_COLOR as Ro, INK_DEFAULT_HIGHLIGHT_COLOR as Do, NUMBER_ZERO as _ } from "../../constants/numbers.js";
|
|
4
|
-
import { TOOLBAR_OPTION_FONT_DROPDOWN as
|
|
5
|
-
import { TOOLBAR_SHOW_CONTROL_LABEL as Bo, TOOLBAR_SHOW_CONTROL_ARIA_LABEL as So,
|
|
6
|
-
import { INK_DEFAULT_COLOR_MODE as
|
|
7
|
-
import { KEY_TAB as
|
|
8
|
-
import { FONT_VALUE_SYSTEM as
|
|
9
|
-
import { LIST_VALUE_BULLET as
|
|
10
|
-
import { FIND_REPLACE_FOCUS_FIND as se, INK_FIND_REPLACE_OPTIONS as
|
|
11
|
-
import { BLOCK_DROP_POSITION_BEFORE as
|
|
12
|
-
import { INK_PLACEHOLDER_DEFAULT as
|
|
13
|
-
import { INK_AI_DEMO_PROVIDER_ID as
|
|
4
|
+
import { TOOLBAR_OPTION_FONT_DROPDOWN as Mt, TOOLBAR_OPTION_LIST_DROPDOWN as kt, TOOLBAR_OPTION_SIGNATURE as Ut, TOOLBAR_OPTION_FIND_REPLACE as Ht, TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN as wt, TOOLBAR_OPTION_HORIZONTAL_RULE as Pt } from "../../constants/toolbar.const.js";
|
|
5
|
+
import { TOOLBAR_SHOW_CONTROL_LABEL as Bo, TOOLBAR_SHOW_CONTROL_ARIA_LABEL as So, AGENT_BAR_PLACEHOLDER as Mo, CONTEXT_MENU_LABEL_SHOW_TOOLBAR as ko, CONTEXT_MENU_ID_SHOW_TOOLBAR as Uo, TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE as Ho, TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE as wo, TOOLBAR_CONTEXT_MENU_LABEL_HIDE as Po, TOOLBAR_CONTEXT_MENU_ID_HIDE as yo, TOOLBAR_OPTION_DIVIDER as yt } from "../../constants/toolbarMenu.const.js";
|
|
6
|
+
import { INK_DEFAULT_COLOR_MODE as Fo, COLOR_MODE_SYSTEM as vo } from "../../constants/colorMode.const.js";
|
|
7
|
+
import { KEY_TAB as xo, KEY_ENTER as Xo, KEY_ESCAPE as Ko, KEY_Z as Wo } from "../../constants/keyboard.const.js";
|
|
8
|
+
import { FONT_VALUE_SYSTEM as Vo, INK_FONT_OPTIONS as Go, FONT_DROPDOWN_TITLE as Yo } from "../../constants/fonts.const.js";
|
|
9
|
+
import { LIST_VALUE_BULLET as zo, INK_LIST_OPTIONS as jo, LIST_DROPDOWN_TITLE as $o } from "../../constants/lists.const.js";
|
|
10
|
+
import { FIND_REPLACE_FOCUS_FIND as se, INK_FIND_REPLACE_OPTIONS as qo, FIND_REPLACE_DROPDOWN_TITLE as Zo, FIND_REPLACE_FOCUS_REPLACE as Qo, FIND_REPLACE_VALUE_REPLACE as Jo } from "../../constants/findReplaceMenu.const.js";
|
|
11
|
+
import { BLOCK_DROP_POSITION_BEFORE as er, DIR_LTR as tr, DIR_RTL as nr } from "../../constants/blocks.const.js";
|
|
12
|
+
import { INK_PLACEHOLDER_DEFAULT as or, INK_DEFAULT_TOOLBAR as rr, INK_DEFAULT_VARIANT as lr, INK_DEFAULT_CHROME as ir, INK_DEFAULT_AUTHOR as cr, INK_TABLE_DEFAULT_ROWS as sr, INK_TABLE_DEFAULT_COLS as ar, INK_DEFAULT_FEATURES as ur, INK_CLASS_TOOLBAR_SHOW as dr, INK_CLASS_TOOLBAR as fr, INK_CLASS_SHELL as mr, INK_CLASS_BODY as _r, INK_CLASS_CONTENT as Tr, INK_CLASS_FOOTER as Er, INK_CLASS_DIVIDER as pr, INK_HEADING_OPTIONS as Cr, INK_BUTTON_CONFIG as Ft, INK_CLASS_BLOCK_ACTIVE as Lr, INK_CLASS_ROOT as Or } from "../../constants/defaults.const.js";
|
|
13
|
+
import { INK_AI_DEMO_PROVIDER_ID as Nr } from "../../constants/aiModels.const.js";
|
|
14
14
|
import "../../constants/openai.const.js";
|
|
15
|
-
import { INK_DEFAULT_ICONS as
|
|
16
|
-
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as
|
|
17
|
-
import { cn as
|
|
18
|
-
import { applyTypoAutoFix as
|
|
19
|
-
import { createInkId as
|
|
20
|
-
import { getTableCellFromSelection as
|
|
21
|
-
import { getBlockElement as ee, clearBlockDragClasses as Pe, markActiveBlock as
|
|
22
|
-
import { createTrackChange as ye, rejectTrackChangeInHtml as
|
|
23
|
-
import { removeCommentMark as
|
|
15
|
+
import { INK_DEFAULT_ICONS as vt } from "../../constants/defaultIcons.js";
|
|
16
|
+
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as Ir, CONTEXT_MENU_ID_TABLE_ROW_ABOVE as gr, CONTEXT_MENU_LABEL_TABLE_ROW_BELOW as hr, CONTEXT_MENU_ID_TABLE_ROW_BELOW as Ar, CONTEXT_MENU_LABEL_TABLE_COL_LEFT as br, CONTEXT_MENU_ID_TABLE_COL_LEFT as Rr, CONTEXT_MENU_LABEL_TABLE_COL_RIGHT as Dr, CONTEXT_MENU_ID_TABLE_COL_RIGHT as Br, CONTEXT_MENU_LABEL_TABLE_DELETE_ROW as Sr, CONTEXT_MENU_ID_TABLE_DELETE_ROW as Mr, CONTEXT_MENU_LABEL_TABLE_DELETE_COL as kr, CONTEXT_MENU_ID_TABLE_DELETE_COL as Ur, CONTEXT_MENU_LABEL_BOLD as Hr, CONTEXT_MENU_ID_BOLD as wr, CONTEXT_MENU_LABEL_ITALIC as Pr, CONTEXT_MENU_ID_ITALIC as yr, CONTEXT_MENU_LABEL_UNDERLINE as Fr, CONTEXT_MENU_ID_UNDERLINE as vr, CONTEXT_MENU_LABEL_STRIKE as xr, CONTEXT_MENU_ID_STRIKE as Xr, CONTEXT_MENU_LABEL_HEADING as Kr, CONTEXT_MENU_ID_HEADING as Wr, CONTEXT_MENU_LABEL_BULLET as Vr, CONTEXT_MENU_ID_BULLET as Gr, CONTEXT_MENU_LABEL_ORDERED as Yr, CONTEXT_MENU_ID_ORDERED as zr, CONTEXT_MENU_LABEL_LINK as jr, CONTEXT_MENU_ID_LINK as $r, CONTEXT_MENU_LABEL_CLEAR as qr, CONTEXT_MENU_ID_CLEAR as Zr, CONTEXT_MENU_LABEL_FIND as Qr, CONTEXT_MENU_ID_FIND as Jr, CONTEXT_MENU_LABEL_SIGNATURE as el, CONTEXT_MENU_ID_SIGNATURE as tl, CONTEXT_MENU_LABEL_COMMENT as nl, CONTEXT_MENU_ID_COMMENT as ol } from "../../constants/contextMenu.const.js";
|
|
17
|
+
import { cn as rl } from "../../utils/cn.utils.js";
|
|
18
|
+
import { applyTypoAutoFix as ll } from "../../utils/typo.utils.js";
|
|
19
|
+
import { createInkId as xt } from "../../utils/id.utils.js";
|
|
20
|
+
import { getTableCellFromSelection as Xt, buildTableHtml as il, insertTableRow as Kt, insertTableColumn as Wt, deleteTableRow as cl, deleteTableColumn as sl } from "../../utils/table.utils.js";
|
|
21
|
+
import { getBlockElement as ee, clearBlockDragClasses as Pe, markActiveBlock as Vt, markDraggingBlock as al, moveBlock as ul, resolveDropPosition as Gt, reorderBlockBefore as dl, reorderBlockAfter as fl, markDropTarget as Yt } from "../../utils/blocks.utils.js";
|
|
22
|
+
import { createTrackChange as ye, rejectTrackChangeInHtml as ml, acceptTrackChangeInHtml as _l, wrapInsertHtml as zt, wrapDeleteHtml as Tl } from "../../utils/trackChanges.utils.js";
|
|
23
|
+
import { removeCommentMark as El, wrapSelectionAsComment as pl, createCommentThread as Cl } from "../../utils/comments.utils.js";
|
|
24
24
|
import { InkHistoryStack as Fe } from "../../utils/history.utils.js";
|
|
25
|
-
import { extractSlashQuery as
|
|
26
|
-
import { resolveInkPremium as
|
|
27
|
-
import { extractClipboardHtml as
|
|
28
|
-
import { readInkMemory as
|
|
29
|
-
import { replaceInHtml as
|
|
25
|
+
import { extractSlashQuery as Ll, filterSlashCommands as Ol } from "../../utils/slash.utils.js";
|
|
26
|
+
import { resolveInkPremium as Nl, hasInkPremiumFeature as te, themeTokensToStyle as Il } from "../../utils/premium.utils.js";
|
|
27
|
+
import { extractClipboardHtml as gl, sanitizePastedHtml as hl, extractClipboardText as Al } from "../../utils/paste.utils.js";
|
|
28
|
+
import { readInkMemory as bl, writeInkMemory as Rl } from "../../utils/memory.utils.js";
|
|
29
|
+
import { replaceInHtml as Dl } from "../../utils/findReplace.utils.js";
|
|
30
30
|
import { withPreservedSelection as ve } from "../../utils/selection.utils.js";
|
|
31
|
-
import { readToolbarItems as
|
|
31
|
+
import { readToolbarItems as Bl, readToolbarHidden as Sl, listCustomizableToolbarOptions as Ml, writeToolbarHidden as kl, buildVisibleToolbarItems as Ul, writeToolbarItems as Hl } from "../../utils/toolbarStorage.utils.js";
|
|
32
32
|
import { Button as wl } from "../../common-components/Button/Button.js";
|
|
33
|
-
import { ContextMenu as
|
|
34
|
-
import { insertImage as xe, insertHTML as M, setTextColor as
|
|
35
|
-
import { inkAi as
|
|
33
|
+
import { ContextMenu as jt } from "../../common-components/ContextMenu/ContextMenu.js";
|
|
34
|
+
import { insertImage as xe, insertHTML as M, setTextColor as Pl, setHighlightColor as yl, getActiveFormats as Fl, queryCommandValue as vl, detectListType as xl, tryConvertMarkdownListPrefix as Xl, execCommand as L, insertLink as Kl, applyFontFamily as Wl, applyListType as Vl, clearFormatDeep as Gl, setBlockDirection as $t, fileToDataUrl as Yl } from "./helpers/format.utils.js";
|
|
35
|
+
import { inkAi as zl } from "../../plugins/ai/aiPlugin.js";
|
|
36
36
|
import { ToolbarButton as C } from "./components/ToolbarButton/ToolbarButton.js";
|
|
37
37
|
import { ToolbarDropdown as ae } from "./components/ToolbarDropdown/ToolbarDropdown.js";
|
|
38
|
-
import { ToolbarColorPicker as
|
|
39
|
-
import { CommentsPanel as
|
|
40
|
-
import { AiPanel as
|
|
41
|
-
import { AiAutocomplete as
|
|
42
|
-
import { AI_AUTOCOMPLETE_DEBOUNCE_MS as
|
|
43
|
-
import { getTextBeforeCaret as
|
|
44
|
-
import { BlockHandles as
|
|
45
|
-
import { BLOCK_HANDLES_DRAG_MIME as
|
|
46
|
-
import { InlineToolbar as
|
|
47
|
-
import { INLINE_TOOLBAR_EDGE_PADDING_PX as
|
|
48
|
-
import { selectionIsInsideElement as
|
|
49
|
-
import { SlashMenu as
|
|
50
|
-
import { TrackChangesBar as
|
|
51
|
-
import { SignPad as
|
|
52
|
-
import { FindReplace as
|
|
53
|
-
import { ToolbarCustomize as
|
|
38
|
+
import { ToolbarColorPicker as qt } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
|
|
39
|
+
import { CommentsPanel as jl } from "./components/CommentsPanel/CommentsPanel.js";
|
|
40
|
+
import { AiPanel as $l } from "./components/AiPanel/AiPanel.js";
|
|
41
|
+
import { AiAutocomplete as ql } from "./components/AiAutocomplete/AiAutocomplete.js";
|
|
42
|
+
import { AI_AUTOCOMPLETE_DEBOUNCE_MS as Zl, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT as Ql } from "./components/AiAutocomplete/AiAutocomplete.const.js";
|
|
43
|
+
import { getTextBeforeCaret as Jl, getCaretPositionInRoot as Zt } from "./components/AiAutocomplete/AiAutocomplete.utils.js";
|
|
44
|
+
import { BlockHandles as ei } from "./components/BlockHandles/BlockHandles.js";
|
|
45
|
+
import { BLOCK_HANDLES_DRAG_MIME as ti, BLOCK_HANDLES_DRAG_PAYLOAD as ni, BLOCK_HANDLES_DRAG_EFFECT_MOVE as Qt } from "./components/BlockHandles/BlockHandles.const.js";
|
|
46
|
+
import { InlineToolbar as oi } from "./components/InlineToolbar/InlineToolbar.js";
|
|
47
|
+
import { INLINE_TOOLBAR_EDGE_PADDING_PX as ri, INLINE_TOOLBAR_ESTIMATED_WIDTH_PX as li, INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX as ii, INLINE_TOOLBAR_GAP_PX as ci } from "./components/InlineToolbar/InlineToolbar.const.js";
|
|
48
|
+
import { selectionIsInsideElement as si, clampInlineToolbarPosition as ai } from "./components/InlineToolbar/InlineToolbar.utils.js";
|
|
49
|
+
import { SlashMenu as ui } from "./components/SlashMenu/SlashMenu.js";
|
|
50
|
+
import { TrackChangesBar as di } from "./components/TrackChangesBar/TrackChangesBar.js";
|
|
51
|
+
import { SignPad as fi } from "./components/SignPad/SignPad.js";
|
|
52
|
+
import { FindReplace as mi } from "./components/FindReplace/FindReplace.js";
|
|
53
|
+
import { ToolbarCustomize as _i } from "./components/ToolbarCustomize/ToolbarCustomize.js";
|
|
54
54
|
const Xe = () => {
|
|
55
55
|
const g = window.getSelection();
|
|
56
56
|
if (!g || g.rangeCount === _) return "";
|
|
@@ -58,29 +58,29 @@ const Xe = () => {
|
|
|
58
58
|
return h.appendChild(p.cloneContents()), h.innerHTML;
|
|
59
59
|
}, T = (g) => {
|
|
60
60
|
g == null || g.focus({ preventScroll: !0 });
|
|
61
|
-
},
|
|
62
|
-
var
|
|
61
|
+
}, Tc = (g) => {
|
|
62
|
+
var Dt;
|
|
63
63
|
const {
|
|
64
64
|
value: p,
|
|
65
65
|
defaultValue: h = "",
|
|
66
66
|
onChange: A,
|
|
67
|
-
placeholder: Ke =
|
|
67
|
+
placeholder: Ke = or,
|
|
68
68
|
disabled: l = !1,
|
|
69
69
|
readOnly: i = !1,
|
|
70
70
|
minHeight: ue = bo,
|
|
71
71
|
maxHeight: de,
|
|
72
|
-
toolbar: ne =
|
|
73
|
-
className:
|
|
74
|
-
testId:
|
|
72
|
+
toolbar: ne = rr,
|
|
73
|
+
className: Jt = "",
|
|
74
|
+
testId: en,
|
|
75
75
|
allowImagePaste: We = !0,
|
|
76
76
|
showCharCount: Ve = !1,
|
|
77
77
|
charCountMax: Ge,
|
|
78
|
-
typoAutoFix:
|
|
79
|
-
variant:
|
|
80
|
-
chrome: nn =
|
|
81
|
-
colorMode:
|
|
78
|
+
typoAutoFix: tn = !0,
|
|
79
|
+
variant: Ye = lr,
|
|
80
|
+
chrome: nn = ir,
|
|
81
|
+
colorMode: ze = Fo,
|
|
82
82
|
features: on,
|
|
83
|
-
author:
|
|
83
|
+
author: w = cr,
|
|
84
84
|
trackChanges: G,
|
|
85
85
|
onTrackChangesChange: fe,
|
|
86
86
|
trackChangesEnabled: oe,
|
|
@@ -91,13 +91,13 @@ const Xe = () => {
|
|
|
91
91
|
onShowCommentsPanelChange: Te,
|
|
92
92
|
ai: f,
|
|
93
93
|
slashCommands: rn,
|
|
94
|
-
tableRows: ln =
|
|
95
|
-
tableCols: cn =
|
|
94
|
+
tableRows: ln = sr,
|
|
95
|
+
tableCols: cn = ar,
|
|
96
96
|
premium: sn,
|
|
97
97
|
theme: an,
|
|
98
|
-
icons:
|
|
98
|
+
icons: je,
|
|
99
99
|
pasteMode: un = "plain",
|
|
100
|
-
onImageUpload:
|
|
100
|
+
onImageUpload: $e,
|
|
101
101
|
wysiwyg: dn = !1,
|
|
102
102
|
keepInMemory: P = !1,
|
|
103
103
|
memoryKey: y,
|
|
@@ -106,12 +106,12 @@ const Xe = () => {
|
|
|
106
106
|
onToolbarHiddenChange: pe,
|
|
107
107
|
style: fn,
|
|
108
108
|
...mn
|
|
109
|
-
} = g, d = { ...
|
|
109
|
+
} = g, d = { ...ur, ...on }, v = Nl(sn), _n = te(v, "icons"), Tn = te(v, "theme"), En = te(v, "richPaste"), pn = te(v, "imageUpload"), Cn = te(v, "wysiwyg") && dn, m = _n && je ? { ...vt, ...je } : vt, Ln = Tn ? Il(an) : {}, On = En && un === "rich", n = S(null), j = S(new Fe(p ?? h)), x = S(null), k = S(null), [qe, Nn] = a(/* @__PURE__ */ new Set()), [In, Ze] = a("p"), [gn, hn] = a(0), [An, bn] = a(Ro), [Rn, Dn] = a(Do), [X, Qe] = a(oe ?? !1), [Bn, Je] = a(G ?? []), [Sn, et] = a(Y ?? []), [Mn, tt] = a(z ?? !1), [nt, Ce] = a(!!(f != null && f.enabled && f.openOnInit)), [re, kn] = a(!1), ot = S(!1), [R, $] = a({
|
|
110
110
|
visible: !1,
|
|
111
111
|
suggestion: "",
|
|
112
112
|
top: _,
|
|
113
113
|
left: _
|
|
114
|
-
}), q = S(null), K = S(_), [
|
|
114
|
+
}), q = S(null), K = S(_), [rt, Un] = a(""), [Hn, wn] = a(0), [Pn, lt] = a(!1), [yn, le] = a([]), [it, Fn] = a({ top: 0, left: 0 }), [ct, Le] = a(!1), [Oe, ie] = a(!1), [vn, xn] = a(se), [Xn, Kn] = a(Vo), [Wn, st] = a(zo), [Vn, Gn] = a(se), [Ne, Ie] = a({ open: !1, x: _, y: _ }), [Yn, at] = a(!1), [ge, he] = a({
|
|
115
115
|
open: !1,
|
|
116
116
|
x: _,
|
|
117
117
|
y: _
|
|
@@ -119,9 +119,9 @@ const Xe = () => {
|
|
|
119
119
|
open: !1,
|
|
120
120
|
top: _,
|
|
121
121
|
left: _
|
|
122
|
-
}), [be,
|
|
123
|
-
() =>
|
|
124
|
-
), [zn,
|
|
122
|
+
}), [be, ut] = a(
|
|
123
|
+
() => Bl(P, y) ?? ne
|
|
124
|
+
), [zn, dt] = a(() => F !== void 0 ? F : Sl(P, y) ?? !1), [jn, ft] = a(!1), mt = S(!0), $n = ne.join(","), D = G ?? Bn, Z = Y ?? Sn, Re = z ?? Mn, _t = rn ?? d.slash, Tt = F ?? zn, Et = ne, qn = Ml(Et), De = ze === vo ? void 0 : ze, Be = !!(d.ai && (f != null && f.enabled) && f.autocomplete !== !1 && !l && !i), Se = () => {
|
|
125
125
|
q.current !== null && (window.clearTimeout(q.current), q.current = null);
|
|
126
126
|
}, b = () => {
|
|
127
127
|
Se(), K.current += 1, $(
|
|
@@ -140,25 +140,25 @@ const Xe = () => {
|
|
|
140
140
|
Se(), $(
|
|
141
141
|
(o) => o.visible || o.suggestion ? { ...o, visible: !1, suggestion: "" } : o
|
|
142
142
|
);
|
|
143
|
-
const t = (f == null ? void 0 : f.providerId) ||
|
|
143
|
+
const t = (f == null ? void 0 : f.providerId) || Nr;
|
|
144
144
|
q.current = window.setTimeout(() => {
|
|
145
|
-
if (q.current = null, !n.current ||
|
|
145
|
+
if (q.current = null, !n.current || ot.current) return;
|
|
146
146
|
const o = window.getSelection();
|
|
147
147
|
if (!o || !o.isCollapsed) return;
|
|
148
|
-
const r =
|
|
149
|
-
if (!r.trim() || !
|
|
148
|
+
const r = Jl(n.current), s = Zt(n.current);
|
|
149
|
+
if (!r.trim() || !s) return;
|
|
150
150
|
const E = K.current + 1;
|
|
151
151
|
K.current = E;
|
|
152
152
|
const N = n.current.innerHTML;
|
|
153
|
-
|
|
153
|
+
zl.runProvider(t, {
|
|
154
154
|
capability: "autocomplete",
|
|
155
155
|
html: N,
|
|
156
156
|
prompt: r,
|
|
157
157
|
modelId: f == null ? void 0 : f.modelId
|
|
158
|
-
}).then((
|
|
159
|
-
var
|
|
158
|
+
}).then((H) => {
|
|
159
|
+
var St;
|
|
160
160
|
if (E !== K.current) return;
|
|
161
|
-
const B = ((
|
|
161
|
+
const B = ((St = H.text) == null ? void 0 : St.trim()) || "";
|
|
162
162
|
if (!B) {
|
|
163
163
|
$({
|
|
164
164
|
visible: !1,
|
|
@@ -168,12 +168,12 @@ const Xe = () => {
|
|
|
168
168
|
});
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const Bt = n.current && Zt(n.current) || s;
|
|
172
172
|
$({
|
|
173
173
|
visible: !0,
|
|
174
174
|
suggestion: B,
|
|
175
|
-
top:
|
|
176
|
-
left:
|
|
175
|
+
top: Bt.top,
|
|
176
|
+
left: Bt.left
|
|
177
177
|
});
|
|
178
178
|
}).catch(() => {
|
|
179
179
|
E === K.current && $({
|
|
@@ -183,28 +183,28 @@ const Xe = () => {
|
|
|
183
183
|
left: _
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
|
-
},
|
|
186
|
+
}, Zl);
|
|
187
187
|
};
|
|
188
188
|
I(() => () => {
|
|
189
189
|
Se(), K.current += 1;
|
|
190
190
|
}, []), I(() => {
|
|
191
|
-
|
|
191
|
+
ot.current = re, re && b();
|
|
192
192
|
}, [re]), I(() => {
|
|
193
|
-
oe !== void 0 &&
|
|
193
|
+
oe !== void 0 && Qe(oe);
|
|
194
194
|
}, [oe]), I(() => {
|
|
195
|
-
G &&
|
|
195
|
+
G && Je(G);
|
|
196
196
|
}, [G]), I(() => {
|
|
197
|
-
Y &&
|
|
197
|
+
Y && et(Y);
|
|
198
198
|
}, [Y]), I(() => {
|
|
199
|
-
z !== void 0 &&
|
|
199
|
+
z !== void 0 && tt(z);
|
|
200
200
|
}, [z]), I(() => {
|
|
201
|
-
F !== void 0 &&
|
|
201
|
+
F !== void 0 && dt(F);
|
|
202
202
|
}, [F]), I(() => {
|
|
203
|
-
if (
|
|
204
|
-
|
|
203
|
+
if (mt.current) {
|
|
204
|
+
mt.current = !1;
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
|
|
207
|
+
ut(ne);
|
|
208
208
|
}, [$n]), I(() => {
|
|
209
209
|
if (!n.current || p === void 0 || p === x.current) return;
|
|
210
210
|
if (n.current.innerHTML === p) {
|
|
@@ -217,7 +217,7 @@ const Xe = () => {
|
|
|
217
217
|
}), x.current = p;
|
|
218
218
|
}, [p]), I(() => {
|
|
219
219
|
if (!n.current) return;
|
|
220
|
-
const e = P ?
|
|
220
|
+
const e = P ? bl(y) : "";
|
|
221
221
|
if (e) {
|
|
222
222
|
n.current.innerHTML = e, x.current = e, j.current = new Fe(e), A == null || A(e);
|
|
223
223
|
return;
|
|
@@ -226,174 +226,174 @@ const Xe = () => {
|
|
|
226
226
|
}, []);
|
|
227
227
|
const Me = (e) => {
|
|
228
228
|
var t;
|
|
229
|
-
j.current.push(e), x.current = e, A == null || A(e), P &&
|
|
229
|
+
j.current.push(e), x.current = e, A == null || A(e), P && Rl(e, y), Ve && n.current && hn(((t = n.current.textContent) == null ? void 0 : t.length) ?? 0);
|
|
230
230
|
}, U = (e) => {
|
|
231
231
|
n.current && (ve(n.current, () => {
|
|
232
232
|
n.current && (n.current.innerHTML = e);
|
|
233
233
|
}), Me(e));
|
|
234
234
|
}, ke = (e) => {
|
|
235
|
-
|
|
235
|
+
dt(e), pe == null || pe(e), kl(e, P, y);
|
|
236
236
|
}, Qn = (e) => {
|
|
237
|
-
|
|
237
|
+
ut(e), Ee == null || Ee(e), Hl(e, P, y);
|
|
238
238
|
}, Jn = (e, t) => {
|
|
239
|
-
if (e ===
|
|
239
|
+
if (e === yt) return;
|
|
240
240
|
const o = new Set(
|
|
241
|
-
be.filter((r) => r !==
|
|
241
|
+
be.filter((r) => r !== yt)
|
|
242
242
|
);
|
|
243
|
-
t ? o.add(e) : o.delete(e), Qn(
|
|
243
|
+
t ? o.add(e) : o.delete(e), Qn(Ul(Et, o));
|
|
244
244
|
}, Q = (e) => {
|
|
245
|
-
|
|
245
|
+
Je(e), fe == null || fe(e);
|
|
246
246
|
}, Ue = (e) => {
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
|
|
247
|
+
et(e), _e == null || _e(e);
|
|
248
|
+
}, He = (e) => {
|
|
249
|
+
tt(e), Te == null || Te(e);
|
|
250
250
|
}, eo = (e) => {
|
|
251
|
-
|
|
251
|
+
Qe(e), me == null || me(e);
|
|
252
252
|
}, to = () => {
|
|
253
253
|
if (l || i) {
|
|
254
|
-
W((
|
|
254
|
+
W((s) => s.open ? { ...s, open: !1 } : s);
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
const e = window.getSelection();
|
|
258
|
-
if (!e || e.isCollapsed || e.rangeCount === 0 || !
|
|
259
|
-
W((
|
|
258
|
+
if (!e || e.isCollapsed || e.rangeCount === 0 || !si(e, n.current)) {
|
|
259
|
+
W((s) => s.open ? { ...s, open: !1 } : s);
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
const o = e.getRangeAt(0).getBoundingClientRect();
|
|
263
263
|
if (o.width === 0 && o.height === 0) {
|
|
264
|
-
W((
|
|
264
|
+
W((s) => s.open ? { ...s, open: !1 } : s);
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
const r =
|
|
267
|
+
const r = ai({
|
|
268
268
|
selectionRect: o,
|
|
269
|
-
toolbarWidth:
|
|
270
|
-
toolbarHeight:
|
|
269
|
+
toolbarWidth: li,
|
|
270
|
+
toolbarHeight: ii,
|
|
271
271
|
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
272
|
-
gap:
|
|
273
|
-
edgePadding:
|
|
272
|
+
gap: ci,
|
|
273
|
+
edgePadding: ri
|
|
274
274
|
});
|
|
275
275
|
W({ open: !0, top: r.top, left: r.left });
|
|
276
276
|
}, J = () => {
|
|
277
|
-
Nn(
|
|
278
|
-
const e =
|
|
279
|
-
if (e &&
|
|
277
|
+
Nn(Fl());
|
|
278
|
+
const e = vl("formatBlock");
|
|
279
|
+
if (e && Ze(e.toLowerCase().replace(/[<>]/g, "")), st(xl()), Un(Xe()), to(), !n.current || !d.blocks) return;
|
|
280
280
|
const t = window.getSelection(), o = (t == null ? void 0 : t.anchorNode) ?? null, r = ee(o, n.current);
|
|
281
|
-
if (
|
|
282
|
-
const
|
|
283
|
-
|
|
281
|
+
if (Vt(n.current, r), r) {
|
|
282
|
+
const s = n.current.getBoundingClientRect(), E = r.getBoundingClientRect();
|
|
283
|
+
wn(E.top - s.top + n.current.scrollTop), lt(!0);
|
|
284
284
|
} else
|
|
285
|
-
|
|
285
|
+
lt(!1);
|
|
286
286
|
}, u = () => {
|
|
287
287
|
var t, o, r;
|
|
288
288
|
if (!n.current) return;
|
|
289
289
|
let e = n.current.innerHTML;
|
|
290
290
|
if (X && d.trackChanges) {
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
291
|
+
const s = window.getSelection();
|
|
292
|
+
if (s && !s.isCollapsed) {
|
|
293
293
|
const E = Xe();
|
|
294
294
|
if (E) {
|
|
295
|
-
const N = ye("delete", E,
|
|
295
|
+
const N = ye("delete", E, w);
|
|
296
296
|
Q([...D, N]), no(N.id), e = n.current.innerHTML;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
if (Me(e), J(),
|
|
301
|
-
const
|
|
300
|
+
if (Me(e), J(), _t && n.current) {
|
|
301
|
+
const s = ((o = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : o.textContent) ?? "", E = Ll(s);
|
|
302
302
|
if (E !== null) {
|
|
303
|
-
le(
|
|
303
|
+
le(Ol(E));
|
|
304
304
|
const N = (r = window.getSelection()) == null ? void 0 : r.getRangeAt(0);
|
|
305
305
|
if (N && n.current) {
|
|
306
|
-
const
|
|
306
|
+
const H = N.getBoundingClientRect(), B = n.current.getBoundingClientRect();
|
|
307
307
|
Fn({
|
|
308
|
-
top:
|
|
309
|
-
left:
|
|
308
|
+
top: H.bottom - B.top + 8,
|
|
309
|
+
left: H.left - B.left
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
} else
|
|
313
313
|
le([]);
|
|
314
314
|
}
|
|
315
315
|
Be ? Zn() : b();
|
|
316
|
-
},
|
|
316
|
+
}, pt = () => {
|
|
317
317
|
const e = R.suggestion;
|
|
318
318
|
if (!e) {
|
|
319
319
|
b();
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
T(n.current), L(
|
|
322
|
+
T(n.current), L(Ql, e), b(), u();
|
|
323
323
|
}, no = (e) => {
|
|
324
324
|
const t = window.getSelection();
|
|
325
325
|
if (!t || t.rangeCount === 0) return;
|
|
326
326
|
const o = Xe();
|
|
327
|
-
o && M(
|
|
327
|
+
o && M(Tl(o, e));
|
|
328
328
|
}, oo = () => {
|
|
329
|
-
if (!n.current || !
|
|
330
|
-
const e = n.current.innerHTML, t =
|
|
329
|
+
if (!n.current || !tn || !d.typoAutoFix || l || i) return;
|
|
330
|
+
const e = n.current.innerHTML, t = ll(e);
|
|
331
331
|
t.html !== e && (ve(n.current, () => {
|
|
332
332
|
n.current && (n.current.innerHTML = t.html);
|
|
333
333
|
}), Me(t.html));
|
|
334
334
|
}, O = (e) => {
|
|
335
335
|
if (l || i) return;
|
|
336
336
|
if (T(n.current), e === "clearFormat") {
|
|
337
|
-
|
|
337
|
+
Gl(), u();
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
340
|
if (e === "directionLtr" && n.current) {
|
|
341
|
-
|
|
341
|
+
$t(n.current, tr), u();
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
344
|
if (e === "directionRtl" && n.current) {
|
|
345
|
-
|
|
345
|
+
$t(n.current, nr), u();
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
if (e === "superscript" || e === "subscript") {
|
|
349
349
|
L(e), u();
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
|
-
const t =
|
|
352
|
+
const t = Ft[e];
|
|
353
353
|
t && (t.value ? L(t.command, t.value) : L(t.command), u());
|
|
354
354
|
}, ro = (e) => {
|
|
355
|
-
l || i || (T(n.current), L("formatBlock", e),
|
|
355
|
+
l || i || (T(n.current), L("formatBlock", e), Ze(e), u());
|
|
356
356
|
}, lo = (e) => {
|
|
357
|
-
l || i || (T(n.current),
|
|
357
|
+
l || i || (T(n.current), Wl(e), Kn(e), u());
|
|
358
358
|
}, io = (e) => {
|
|
359
|
-
l || i || (T(n.current),
|
|
360
|
-
},
|
|
359
|
+
l || i || (T(n.current), Vl(e), st(e), u());
|
|
360
|
+
}, Ct = (e) => {
|
|
361
361
|
xn(e), Gn(e), ie(!0);
|
|
362
362
|
}, co = (e) => {
|
|
363
363
|
if (l || i) return;
|
|
364
|
-
|
|
365
|
-
},
|
|
364
|
+
Ct(e === Jo ? Qo : se);
|
|
365
|
+
}, we = () => {
|
|
366
366
|
if (l || i) return;
|
|
367
367
|
const e = window.prompt("Enter URL:", "https://");
|
|
368
|
-
e && (T(n.current),
|
|
369
|
-
},
|
|
368
|
+
e && (T(n.current), Kl(e), u());
|
|
369
|
+
}, Lt = async (e) => pn && $e ? $e(e) : Yl(e), so = async () => {
|
|
370
370
|
if (l || i) return;
|
|
371
371
|
const e = document.createElement("input");
|
|
372
372
|
e.type = "file", e.accept = "image/*", e.onchange = async () => {
|
|
373
373
|
var r;
|
|
374
374
|
const t = (r = e.files) == null ? void 0 : r[0];
|
|
375
375
|
if (!t) return;
|
|
376
|
-
const o = await
|
|
376
|
+
const o = await Lt(t);
|
|
377
377
|
T(n.current), xe(o, t.name), u();
|
|
378
378
|
}, e.click();
|
|
379
|
-
},
|
|
379
|
+
}, Ot = () => {
|
|
380
380
|
if (l || i || !d.table) return;
|
|
381
381
|
T(n.current);
|
|
382
|
-
const e =
|
|
382
|
+
const e = il(ln, cn);
|
|
383
383
|
if (X && d.trackChanges) {
|
|
384
|
-
const t = ye("insert", e,
|
|
385
|
-
Q([...D, t]), M(
|
|
384
|
+
const t = ye("insert", e, w);
|
|
385
|
+
Q([...D, t]), M(zt(e, t.id));
|
|
386
386
|
} else
|
|
387
387
|
M(e);
|
|
388
388
|
u();
|
|
389
|
-
},
|
|
389
|
+
}, Nt = () => {
|
|
390
390
|
const e = j.current.undo();
|
|
391
391
|
if (e === null || !n.current) {
|
|
392
392
|
L("undo"), u();
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
395
|
U(e);
|
|
396
|
-
},
|
|
396
|
+
}, It = () => {
|
|
397
397
|
const e = j.current.redo();
|
|
398
398
|
if (e === null || !n.current) {
|
|
399
399
|
L("redo"), u();
|
|
@@ -401,151 +401,151 @@ const Xe = () => {
|
|
|
401
401
|
}
|
|
402
402
|
U(e);
|
|
403
403
|
}, ao = (e) => {
|
|
404
|
-
l || i || (e.preventDefault(), he((t) => t.open ? { ...t, open: !1 } : t),
|
|
404
|
+
l || i || (e.preventDefault(), he((t) => t.open ? { ...t, open: !1 } : t), at(!!(d.table && Xt())), Ie({ open: !0, x: e.clientX, y: e.clientY }));
|
|
405
405
|
}, uo = (e) => {
|
|
406
406
|
l || i || (e.preventDefault(), Ie((t) => t.open ? { ...t, open: !1 } : t), he({ open: !0, x: e.clientX, y: e.clientY }));
|
|
407
|
-
},
|
|
407
|
+
}, gt = () => {
|
|
408
408
|
if (l || i || !d.comments) return;
|
|
409
409
|
const e = window.prompt("Comment:");
|
|
410
410
|
if (!(e != null && e.trim())) return;
|
|
411
|
-
const t =
|
|
412
|
-
if (T(n.current), !
|
|
413
|
-
const r =
|
|
414
|
-
Ue([r, ...Z]),
|
|
411
|
+
const t = xt("hl");
|
|
412
|
+
if (T(n.current), !pl(t)) return;
|
|
413
|
+
const r = Cl(w, e.trim(), t);
|
|
414
|
+
Ue([r, ...Z]), He(!0), u();
|
|
415
415
|
}, fo = [
|
|
416
416
|
{
|
|
417
417
|
id: wo,
|
|
418
|
-
label:
|
|
419
|
-
onSelect: () =>
|
|
418
|
+
label: Ho,
|
|
419
|
+
onSelect: () => ft(!0)
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
|
-
id:
|
|
423
|
-
label:
|
|
422
|
+
id: yo,
|
|
423
|
+
label: Po,
|
|
424
424
|
onSelect: () => ke(!0)
|
|
425
425
|
}
|
|
426
426
|
], V = (e) => {
|
|
427
|
-
const t =
|
|
427
|
+
const t = Xt();
|
|
428
428
|
!t || !d.table || e(t) && u();
|
|
429
429
|
}, mo = [
|
|
430
430
|
...d.table && Yn ? [
|
|
431
431
|
{
|
|
432
|
-
id:
|
|
433
|
-
label:
|
|
434
|
-
onSelect: () => V((e) =>
|
|
432
|
+
id: gr,
|
|
433
|
+
label: Ir,
|
|
434
|
+
onSelect: () => V((e) => Kt(e, "before"))
|
|
435
435
|
},
|
|
436
436
|
{
|
|
437
|
-
id:
|
|
438
|
-
label:
|
|
439
|
-
onSelect: () => V((e) =>
|
|
437
|
+
id: Ar,
|
|
438
|
+
label: hr,
|
|
439
|
+
onSelect: () => V((e) => Kt(e, "after"))
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
|
-
id:
|
|
443
|
-
label:
|
|
444
|
-
onSelect: () => V((e) =>
|
|
442
|
+
id: Rr,
|
|
443
|
+
label: br,
|
|
444
|
+
onSelect: () => V((e) => Wt(e, "before"))
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
|
-
id:
|
|
448
|
-
label:
|
|
449
|
-
onSelect: () => V((e) =>
|
|
447
|
+
id: Br,
|
|
448
|
+
label: Dr,
|
|
449
|
+
onSelect: () => V((e) => Wt(e, "after"))
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
|
-
id:
|
|
453
|
-
label:
|
|
454
|
-
onSelect: () => V((e) =>
|
|
452
|
+
id: Mr,
|
|
453
|
+
label: Sr,
|
|
454
|
+
onSelect: () => V((e) => cl(e))
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
|
-
id:
|
|
458
|
-
label:
|
|
459
|
-
onSelect: () => V((e) =>
|
|
457
|
+
id: Ur,
|
|
458
|
+
label: kr,
|
|
459
|
+
onSelect: () => V((e) => sl(e))
|
|
460
460
|
}
|
|
461
461
|
] : [],
|
|
462
462
|
{
|
|
463
463
|
id: wr,
|
|
464
|
-
label:
|
|
464
|
+
label: Hr,
|
|
465
465
|
onSelect: () => O("bold")
|
|
466
466
|
},
|
|
467
467
|
{
|
|
468
|
-
id:
|
|
469
|
-
label:
|
|
468
|
+
id: yr,
|
|
469
|
+
label: Pr,
|
|
470
470
|
onSelect: () => O("italic")
|
|
471
471
|
},
|
|
472
472
|
{
|
|
473
|
-
id:
|
|
474
|
-
label:
|
|
473
|
+
id: vr,
|
|
474
|
+
label: Fr,
|
|
475
475
|
onSelect: () => O("underline")
|
|
476
476
|
},
|
|
477
477
|
{
|
|
478
|
-
id:
|
|
479
|
-
label:
|
|
478
|
+
id: Xr,
|
|
479
|
+
label: xr,
|
|
480
480
|
onSelect: () => O("strikethrough")
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
|
-
id:
|
|
484
|
-
label:
|
|
483
|
+
id: Wr,
|
|
484
|
+
label: Kr,
|
|
485
485
|
onSelect: () => O("heading2")
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
|
-
id:
|
|
489
|
-
label:
|
|
488
|
+
id: Gr,
|
|
489
|
+
label: Vr,
|
|
490
490
|
onSelect: () => O("bulletList")
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
|
-
id:
|
|
494
|
-
label:
|
|
493
|
+
id: zr,
|
|
494
|
+
label: Yr,
|
|
495
495
|
onSelect: () => O("orderedList")
|
|
496
496
|
},
|
|
497
497
|
{
|
|
498
|
-
id:
|
|
499
|
-
label:
|
|
500
|
-
onSelect: () =>
|
|
498
|
+
id: $r,
|
|
499
|
+
label: jr,
|
|
500
|
+
onSelect: () => we()
|
|
501
501
|
},
|
|
502
502
|
{
|
|
503
|
-
id:
|
|
504
|
-
label:
|
|
503
|
+
id: Zr,
|
|
504
|
+
label: qr,
|
|
505
505
|
onSelect: () => O("clearFormat")
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
|
-
id:
|
|
509
|
-
label:
|
|
508
|
+
id: Jr,
|
|
509
|
+
label: Qr,
|
|
510
510
|
disabled: !d.findReplace,
|
|
511
511
|
onSelect: () => ie(!0)
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
|
-
id:
|
|
515
|
-
label:
|
|
514
|
+
id: tl,
|
|
515
|
+
label: el,
|
|
516
516
|
disabled: !d.signature,
|
|
517
517
|
onSelect: () => Le(!0)
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
|
-
id:
|
|
521
|
-
label:
|
|
520
|
+
id: ol,
|
|
521
|
+
label: nl,
|
|
522
522
|
disabled: !d.comments,
|
|
523
|
-
onSelect: () =>
|
|
523
|
+
onSelect: () => gt()
|
|
524
524
|
},
|
|
525
|
-
...
|
|
525
|
+
...Tt ? [
|
|
526
526
|
{
|
|
527
|
-
id:
|
|
528
|
-
label:
|
|
527
|
+
id: Uo,
|
|
528
|
+
label: ko,
|
|
529
529
|
onSelect: () => ke(!1)
|
|
530
530
|
}
|
|
531
531
|
] : []
|
|
532
|
-
],
|
|
532
|
+
], ht = (e) => {
|
|
533
533
|
if (!n.current) return;
|
|
534
|
-
const t =
|
|
534
|
+
const t = _l(n.current.innerHTML, e);
|
|
535
535
|
U(t), Q(
|
|
536
536
|
D.map((o) => o.id === e ? { ...o, accepted: !0 } : o)
|
|
537
537
|
);
|
|
538
|
-
},
|
|
538
|
+
}, At = (e) => {
|
|
539
539
|
if (!n.current) return;
|
|
540
|
-
const t =
|
|
540
|
+
const t = ml(n.current.innerHTML, e);
|
|
541
541
|
U(t), Q(
|
|
542
542
|
D.map((o) => o.id === e ? { ...o, rejected: !0 } : o)
|
|
543
543
|
);
|
|
544
|
-
},
|
|
545
|
-
const t = await
|
|
544
|
+
}, bt = async (e) => {
|
|
545
|
+
const t = await Lt(e), o = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
|
|
546
546
|
if (X && d.trackChanges) {
|
|
547
|
-
const r = ye("insert", o,
|
|
548
|
-
Q([...D, r]), M(
|
|
547
|
+
const r = ye("insert", o, w);
|
|
548
|
+
Q([...D, r]), M(zt(o, r.id));
|
|
549
549
|
} else
|
|
550
550
|
xe(t);
|
|
551
551
|
u();
|
|
@@ -554,23 +554,23 @@ const Xe = () => {
|
|
|
554
554
|
const t = e.clipboardData;
|
|
555
555
|
if (!t) return;
|
|
556
556
|
if (On) {
|
|
557
|
-
const r =
|
|
557
|
+
const r = gl(t);
|
|
558
558
|
if (r) {
|
|
559
559
|
e.preventDefault();
|
|
560
|
-
const E =
|
|
560
|
+
const E = hl(r);
|
|
561
561
|
E && (M(E), u());
|
|
562
562
|
const N = t.items;
|
|
563
563
|
if (We && N)
|
|
564
|
-
for (const
|
|
565
|
-
if (!
|
|
566
|
-
const B =
|
|
567
|
-
B && await
|
|
564
|
+
for (const H of Array.from(N)) {
|
|
565
|
+
if (!H.type.startsWith("image/")) continue;
|
|
566
|
+
const B = H.getAsFile();
|
|
567
|
+
B && await bt(B);
|
|
568
568
|
}
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
e.preventDefault(), M(
|
|
571
|
+
const s = Al(t);
|
|
572
|
+
if (s) {
|
|
573
|
+
e.preventDefault(), M(s.replace(/\n/g, "<br />")), u();
|
|
574
574
|
return;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
@@ -580,39 +580,39 @@ const Xe = () => {
|
|
|
580
580
|
for (const r of Array.from(o)) {
|
|
581
581
|
if (!r.type.startsWith("image/")) continue;
|
|
582
582
|
e.preventDefault();
|
|
583
|
-
const
|
|
584
|
-
|
|
583
|
+
const s = r.getAsFile();
|
|
584
|
+
s && await bt(s);
|
|
585
585
|
}
|
|
586
586
|
}, To = (e) => {
|
|
587
587
|
O(e);
|
|
588
588
|
}, Eo = (e) => {
|
|
589
|
-
if (e.key ===
|
|
590
|
-
e.preventDefault(),
|
|
589
|
+
if (e.key === xo && R.visible && R.suggestion) {
|
|
590
|
+
e.preventDefault(), pt();
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
if (e.key ===
|
|
593
|
+
if (e.key === Xo) {
|
|
594
594
|
b();
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
|
-
if (
|
|
597
|
+
if (Xl(e.nativeEvent)) {
|
|
598
598
|
u();
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
if (e.key ===
|
|
601
|
+
if (e.key === Ko) {
|
|
602
602
|
if (R.visible) {
|
|
603
603
|
e.preventDefault(), b();
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
le([]), W((t) => t.open ? { ...t, open: !1 } : t);
|
|
607
607
|
}
|
|
608
|
-
(e.metaKey || e.ctrlKey) && e.key ===
|
|
608
|
+
(e.metaKey || e.ctrlKey) && e.key === Wo && (e.preventDefault(), e.shiftKey ? It() : Nt());
|
|
609
609
|
}, po = (e) => {
|
|
610
610
|
var o;
|
|
611
611
|
T(n.current);
|
|
612
612
|
const t = window.getSelection();
|
|
613
613
|
if ((o = t == null ? void 0 : t.anchorNode) != null && o.textContent) {
|
|
614
|
-
const
|
|
615
|
-
t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent =
|
|
614
|
+
const s = t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/, " ");
|
|
615
|
+
t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent = s);
|
|
616
616
|
}
|
|
617
617
|
switch (le([]), e.insert) {
|
|
618
618
|
case "heading1":
|
|
@@ -628,122 +628,122 @@ const Xe = () => {
|
|
|
628
628
|
L("insertOrderedList");
|
|
629
629
|
break;
|
|
630
630
|
case "table":
|
|
631
|
-
|
|
631
|
+
Ot();
|
|
632
632
|
return;
|
|
633
633
|
case "ai":
|
|
634
634
|
Ce(!0);
|
|
635
635
|
break;
|
|
636
636
|
}
|
|
637
637
|
u();
|
|
638
|
-
},
|
|
638
|
+
}, Rt = (e) => {
|
|
639
639
|
if (!n.current) return;
|
|
640
640
|
const t = window.getSelection(), o = ee((t == null ? void 0 : t.anchorNode) ?? null, n.current);
|
|
641
|
-
o &&
|
|
641
|
+
o && ul(o, e) && (u(), J());
|
|
642
642
|
}, Co = (e) => {
|
|
643
643
|
if (!n.current) return;
|
|
644
|
-
const t = window.getSelection(), o = ee((t == null ? void 0 : t.anchorNode) ?? null, n.current), r = n.current.querySelector(`.${
|
|
645
|
-
if (!
|
|
644
|
+
const t = window.getSelection(), o = ee((t == null ? void 0 : t.anchorNode) ?? null, n.current), r = n.current.querySelector(`.${Lr}`), s = o ?? (r instanceof HTMLElement ? r : null);
|
|
645
|
+
if (!s) {
|
|
646
646
|
e.preventDefault();
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
k.current =
|
|
649
|
+
k.current = s, Pe(n.current), Vt(n.current, s), al(s), e.dataTransfer.setData(ti, ni), e.dataTransfer.effectAllowed = Qt;
|
|
650
650
|
}, Lo = (e) => {
|
|
651
651
|
if (!n.current || !k.current) return;
|
|
652
|
-
e.preventDefault(), e.dataTransfer.dropEffect =
|
|
652
|
+
e.preventDefault(), e.dataTransfer.dropEffect = Qt;
|
|
653
653
|
const t = ee(e.target, n.current);
|
|
654
654
|
if (!t || t === k.current) {
|
|
655
|
-
|
|
655
|
+
Yt(n.current, null, null);
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
658
|
-
const o =
|
|
659
|
-
|
|
658
|
+
const o = Gt(e.clientY, t);
|
|
659
|
+
Yt(n.current, t, o);
|
|
660
660
|
}, Oo = (e) => {
|
|
661
661
|
if (!n.current || !k.current) return;
|
|
662
662
|
e.preventDefault();
|
|
663
663
|
const t = ee(e.target, n.current), o = k.current;
|
|
664
|
-
t && t !== o && (
|
|
664
|
+
t && t !== o && (Gt(e.clientY, t) === er ? dl(o, t) : fl(o, t)) && (u(), J()), Pe(n.current), k.current = null;
|
|
665
665
|
}, No = () => {
|
|
666
666
|
n.current && Pe(n.current), k.current = null;
|
|
667
667
|
}, Io = (e, t) => {
|
|
668
668
|
if (e === "divider")
|
|
669
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ c("span", { className: pr }, `divider-${t}`);
|
|
670
670
|
if (e === "headingDropdown")
|
|
671
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ c(
|
|
672
672
|
ae,
|
|
673
673
|
{
|
|
674
674
|
title: "Heading",
|
|
675
|
-
options:
|
|
675
|
+
options: Cr,
|
|
676
676
|
value: In || "p",
|
|
677
677
|
disabled: l || i,
|
|
678
678
|
onChange: ro
|
|
679
679
|
},
|
|
680
680
|
"heading"
|
|
681
681
|
);
|
|
682
|
-
if (e ===
|
|
683
|
-
return /* @__PURE__ */
|
|
682
|
+
if (e === Mt)
|
|
683
|
+
return /* @__PURE__ */ c(
|
|
684
684
|
ae,
|
|
685
685
|
{
|
|
686
|
-
title:
|
|
687
|
-
options:
|
|
686
|
+
title: Yo,
|
|
687
|
+
options: Go,
|
|
688
688
|
value: Xn,
|
|
689
689
|
disabled: l || i,
|
|
690
690
|
onChange: lo
|
|
691
691
|
},
|
|
692
|
-
|
|
692
|
+
Mt
|
|
693
693
|
);
|
|
694
|
-
if (e ===
|
|
695
|
-
return /* @__PURE__ */
|
|
694
|
+
if (e === kt)
|
|
695
|
+
return /* @__PURE__ */ c(
|
|
696
696
|
ae,
|
|
697
697
|
{
|
|
698
|
-
title:
|
|
699
|
-
options:
|
|
698
|
+
title: $o,
|
|
699
|
+
options: jo,
|
|
700
700
|
value: Wn,
|
|
701
701
|
disabled: l || i,
|
|
702
702
|
onChange: io
|
|
703
703
|
},
|
|
704
|
-
|
|
704
|
+
kt
|
|
705
705
|
);
|
|
706
706
|
if (e === "textColor")
|
|
707
|
-
return /* @__PURE__ */
|
|
708
|
-
|
|
707
|
+
return /* @__PURE__ */ c(
|
|
708
|
+
qt,
|
|
709
709
|
{
|
|
710
710
|
title: "Text color",
|
|
711
711
|
type: "text",
|
|
712
712
|
value: An,
|
|
713
713
|
disabled: l || i,
|
|
714
714
|
onChange: (r) => {
|
|
715
|
-
T(n.current),
|
|
715
|
+
T(n.current), Pl(r), bn(r), u();
|
|
716
716
|
}
|
|
717
717
|
},
|
|
718
718
|
"textColor"
|
|
719
719
|
);
|
|
720
720
|
if (e === "highlightColor")
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
721
|
+
return /* @__PURE__ */ c(
|
|
722
|
+
qt,
|
|
723
723
|
{
|
|
724
724
|
title: "Highlight color",
|
|
725
725
|
type: "highlight",
|
|
726
726
|
value: Rn,
|
|
727
727
|
disabled: l || i,
|
|
728
728
|
onChange: (r) => {
|
|
729
|
-
T(n.current),
|
|
729
|
+
T(n.current), yl(r), Dn(r), u();
|
|
730
730
|
}
|
|
731
731
|
},
|
|
732
732
|
"highlightColor"
|
|
733
733
|
);
|
|
734
734
|
if (e === "link")
|
|
735
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ c(
|
|
736
736
|
C,
|
|
737
737
|
{
|
|
738
738
|
icon: m.link,
|
|
739
739
|
title: "Insert link",
|
|
740
740
|
disabled: l || i,
|
|
741
|
-
onClick:
|
|
741
|
+
onClick: we
|
|
742
742
|
},
|
|
743
743
|
"link"
|
|
744
744
|
);
|
|
745
745
|
if (e === "image")
|
|
746
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ c(
|
|
747
747
|
C,
|
|
748
748
|
{
|
|
749
749
|
icon: m.image,
|
|
@@ -756,30 +756,30 @@ const Xe = () => {
|
|
|
756
756
|
"image"
|
|
757
757
|
);
|
|
758
758
|
if (e === "table")
|
|
759
|
-
return d.table ? /* @__PURE__ */
|
|
759
|
+
return d.table ? /* @__PURE__ */ c(
|
|
760
760
|
C,
|
|
761
761
|
{
|
|
762
762
|
icon: m.table,
|
|
763
763
|
title: "Insert table",
|
|
764
764
|
disabled: l || i,
|
|
765
|
-
onClick:
|
|
765
|
+
onClick: Ot
|
|
766
766
|
},
|
|
767
767
|
"table"
|
|
768
768
|
) : null;
|
|
769
|
-
if (e ===
|
|
770
|
-
return d.signature ? /* @__PURE__ */
|
|
769
|
+
if (e === Ut)
|
|
770
|
+
return d.signature ? /* @__PURE__ */ c(
|
|
771
771
|
C,
|
|
772
772
|
{
|
|
773
773
|
icon: m.signature,
|
|
774
774
|
title: "Sign pad",
|
|
775
|
-
active:
|
|
775
|
+
active: ct,
|
|
776
776
|
disabled: l || i,
|
|
777
777
|
onClick: () => Le(!0)
|
|
778
778
|
},
|
|
779
|
-
|
|
779
|
+
Ut
|
|
780
780
|
) : null;
|
|
781
|
-
if (e ===
|
|
782
|
-
return d.findReplace ? /* @__PURE__ */
|
|
781
|
+
if (e === Ht)
|
|
782
|
+
return d.findReplace ? /* @__PURE__ */ c(
|
|
783
783
|
C,
|
|
784
784
|
{
|
|
785
785
|
icon: m.findReplace,
|
|
@@ -787,25 +787,25 @@ const Xe = () => {
|
|
|
787
787
|
active: Oe,
|
|
788
788
|
disabled: l || i,
|
|
789
789
|
onClick: () => {
|
|
790
|
-
Oe ? ie(!1) :
|
|
790
|
+
Oe ? ie(!1) : Ct(se);
|
|
791
791
|
}
|
|
792
792
|
},
|
|
793
|
-
|
|
793
|
+
Ht
|
|
794
794
|
) : null;
|
|
795
795
|
if (e === wt)
|
|
796
|
-
return d.findReplace ? /* @__PURE__ */
|
|
796
|
+
return d.findReplace ? /* @__PURE__ */ c(
|
|
797
797
|
ae,
|
|
798
798
|
{
|
|
799
|
-
title:
|
|
800
|
-
options:
|
|
799
|
+
title: Zo,
|
|
800
|
+
options: qo,
|
|
801
801
|
value: Vn,
|
|
802
802
|
disabled: l || i,
|
|
803
803
|
onChange: co
|
|
804
804
|
},
|
|
805
805
|
wt
|
|
806
806
|
) : null;
|
|
807
|
-
if (e ===
|
|
808
|
-
return d.horizontalRule ? /* @__PURE__ */
|
|
807
|
+
if (e === Pt)
|
|
808
|
+
return d.horizontalRule ? /* @__PURE__ */ c(
|
|
809
809
|
C,
|
|
810
810
|
{
|
|
811
811
|
icon: m.horizontalRule,
|
|
@@ -815,32 +815,32 @@ const Xe = () => {
|
|
|
815
815
|
T(n.current), M("<hr />"), u();
|
|
816
816
|
}
|
|
817
817
|
},
|
|
818
|
-
|
|
818
|
+
Pt
|
|
819
819
|
) : null;
|
|
820
820
|
if (e === "undo")
|
|
821
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ c(
|
|
822
822
|
C,
|
|
823
823
|
{
|
|
824
824
|
icon: m.undo,
|
|
825
825
|
title: "Undo",
|
|
826
826
|
disabled: l || i,
|
|
827
|
-
onClick:
|
|
827
|
+
onClick: Nt
|
|
828
828
|
},
|
|
829
829
|
"undo"
|
|
830
830
|
);
|
|
831
831
|
if (e === "redo")
|
|
832
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ c(
|
|
833
833
|
C,
|
|
834
834
|
{
|
|
835
835
|
icon: m.redo,
|
|
836
836
|
title: "Redo",
|
|
837
837
|
disabled: l || i,
|
|
838
|
-
onClick:
|
|
838
|
+
onClick: It
|
|
839
839
|
},
|
|
840
840
|
"redo"
|
|
841
841
|
);
|
|
842
842
|
if (e === "trackChanges")
|
|
843
|
-
return d.trackChanges ? /* @__PURE__ */
|
|
843
|
+
return d.trackChanges ? /* @__PURE__ */ c(
|
|
844
844
|
C,
|
|
845
845
|
{
|
|
846
846
|
icon: m.trackChanges,
|
|
@@ -852,7 +852,7 @@ const Xe = () => {
|
|
|
852
852
|
"trackChanges"
|
|
853
853
|
) : null;
|
|
854
854
|
if (e === "comments")
|
|
855
|
-
return d.comments ? /* @__PURE__ */
|
|
855
|
+
return d.comments ? /* @__PURE__ */ c(
|
|
856
856
|
C,
|
|
857
857
|
{
|
|
858
858
|
icon: m.comments,
|
|
@@ -860,43 +860,43 @@ const Xe = () => {
|
|
|
860
860
|
active: Re,
|
|
861
861
|
disabled: l || i,
|
|
862
862
|
onClick: () => {
|
|
863
|
-
Re ?
|
|
863
|
+
Re ? He(!1) : gt();
|
|
864
864
|
}
|
|
865
865
|
},
|
|
866
866
|
"comments"
|
|
867
867
|
) : null;
|
|
868
868
|
if (e === "ai")
|
|
869
|
-
return !d.ai || !(f != null && f.enabled) ? null : /* @__PURE__ */
|
|
869
|
+
return !d.ai || !(f != null && f.enabled) ? null : /* @__PURE__ */ c(
|
|
870
870
|
C,
|
|
871
871
|
{
|
|
872
872
|
icon: m.ai,
|
|
873
873
|
title: "Ink AI",
|
|
874
|
-
active:
|
|
874
|
+
active: nt,
|
|
875
875
|
disabled: l || i,
|
|
876
876
|
onClick: () => Ce((r) => !r)
|
|
877
877
|
},
|
|
878
878
|
"ai"
|
|
879
879
|
);
|
|
880
|
-
const o =
|
|
881
|
-
return o ? /* @__PURE__ */
|
|
880
|
+
const o = Ft[e];
|
|
881
|
+
return o ? /* @__PURE__ */ c(
|
|
882
882
|
C,
|
|
883
883
|
{
|
|
884
884
|
icon: m[e] ?? e.slice(0, 1).toUpperCase(),
|
|
885
885
|
title: o.title,
|
|
886
|
-
active:
|
|
886
|
+
active: qe.has(e),
|
|
887
887
|
disabled: l || i,
|
|
888
888
|
onClick: () => O(e)
|
|
889
889
|
},
|
|
890
890
|
e
|
|
891
891
|
) : null;
|
|
892
|
-
}, go = typeof ue == "number" ? `${ue}px` : ue, ho = typeof de == "number" ? `${de}px` : de, Ao = !!(f != null && f.enabled &&
|
|
892
|
+
}, go = typeof ue == "number" ? `${ue}px` : ue, ho = typeof de == "number" ? `${de}px` : de, Ao = !!(f != null && f.enabled && nt);
|
|
893
893
|
return /* @__PURE__ */ ce(
|
|
894
894
|
"div",
|
|
895
895
|
{
|
|
896
|
-
className:
|
|
897
|
-
"data-testid":
|
|
896
|
+
className: rl(Or, Jt),
|
|
897
|
+
"data-testid": en,
|
|
898
898
|
"data-disabled": l || void 0,
|
|
899
|
-
"data-variant":
|
|
899
|
+
"data-variant": Ye,
|
|
900
900
|
"data-chrome": nn,
|
|
901
901
|
"data-color-mode": De,
|
|
902
902
|
"data-premium": v.active || void 0,
|
|
@@ -904,7 +904,7 @@ const Xe = () => {
|
|
|
904
904
|
style: { ...Ln, ...fn },
|
|
905
905
|
...mn,
|
|
906
906
|
children: [
|
|
907
|
-
|
|
907
|
+
Tt ? /* @__PURE__ */ c("div", { className: dr, children: /* @__PURE__ */ c(
|
|
908
908
|
wl,
|
|
909
909
|
{
|
|
910
910
|
type: "button",
|
|
@@ -912,76 +912,77 @@ const Xe = () => {
|
|
|
912
912
|
onClick: () => ke(!1),
|
|
913
913
|
children: Bo
|
|
914
914
|
}
|
|
915
|
-
) }) : /* @__PURE__ */
|
|
915
|
+
) }) : /* @__PURE__ */ c(
|
|
916
916
|
"div",
|
|
917
917
|
{
|
|
918
|
-
className:
|
|
918
|
+
className: fr,
|
|
919
919
|
role: "toolbar",
|
|
920
920
|
"aria-label": "Ink formatting toolbar",
|
|
921
921
|
onContextMenu: uo,
|
|
922
922
|
children: be.map(Io)
|
|
923
923
|
}
|
|
924
924
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
|
|
925
|
+
/* @__PURE__ */ c(
|
|
926
|
+
_i,
|
|
927
927
|
{
|
|
928
928
|
open: jn,
|
|
929
929
|
options: qn,
|
|
930
930
|
visibleItems: be,
|
|
931
931
|
onToggle: Jn,
|
|
932
|
-
onClose: () =>
|
|
932
|
+
onClose: () => ft(!1)
|
|
933
933
|
}
|
|
934
934
|
),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
|
|
935
|
+
/* @__PURE__ */ c(
|
|
936
|
+
fi,
|
|
937
937
|
{
|
|
938
|
-
open:
|
|
938
|
+
open: ct,
|
|
939
939
|
onClose: () => Le(!1),
|
|
940
940
|
onConfirm: (e) => {
|
|
941
941
|
T(n.current), xe(e), u();
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
944
|
),
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
|
|
945
|
+
/* @__PURE__ */ c(
|
|
946
|
+
mi,
|
|
947
947
|
{
|
|
948
948
|
open: Oe,
|
|
949
949
|
focusField: vn,
|
|
950
950
|
onClose: () => ie(!1),
|
|
951
951
|
onReplace: (e, t, o) => {
|
|
952
952
|
if (!n.current) return;
|
|
953
|
-
const r =
|
|
953
|
+
const r = Dl(n.current.innerHTML, e, t, o);
|
|
954
954
|
U(r);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
|
-
X && d.trackChanges ? /* @__PURE__ */
|
|
959
|
-
|
|
958
|
+
X && d.trackChanges ? /* @__PURE__ */ c(
|
|
959
|
+
di,
|
|
960
960
|
{
|
|
961
961
|
changes: D,
|
|
962
|
-
onAccept:
|
|
963
|
-
onReject:
|
|
964
|
-
onAcceptAll: () => D.forEach((e) =>
|
|
965
|
-
onRejectAll: () => D.forEach((e) =>
|
|
962
|
+
onAccept: ht,
|
|
963
|
+
onReject: At,
|
|
964
|
+
onAcceptAll: () => D.forEach((e) => ht(e.id)),
|
|
965
|
+
onRejectAll: () => D.forEach((e) => At(e.id))
|
|
966
966
|
}
|
|
967
967
|
) : null,
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
Ye === "agent" ? /* @__PURE__ */ c("div", { className: "Ink-Editor__agent-bar", role: "status", children: Mo }) : null,
|
|
969
|
+
/* @__PURE__ */ ce("div", { className: mr, children: [
|
|
970
|
+
/* @__PURE__ */ ce("div", { className: _r, children: [
|
|
971
|
+
d.blocks ? /* @__PURE__ */ c(
|
|
972
|
+
ei,
|
|
972
973
|
{
|
|
973
974
|
visible: Pn && !l && !i,
|
|
974
|
-
top:
|
|
975
|
-
onMoveUp: () =>
|
|
976
|
-
onMoveDown: () =>
|
|
975
|
+
top: Hn,
|
|
976
|
+
onMoveUp: () => Rt("up"),
|
|
977
|
+
onMoveDown: () => Rt("down"),
|
|
977
978
|
onDragStart: Co
|
|
978
979
|
}
|
|
979
980
|
) : null,
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ c(
|
|
981
982
|
"div",
|
|
982
983
|
{
|
|
983
984
|
ref: n,
|
|
984
|
-
className:
|
|
985
|
+
className: Tr,
|
|
985
986
|
contentEditable: !l && !i,
|
|
986
987
|
role: "textbox",
|
|
987
988
|
"aria-multiline": "true",
|
|
@@ -1003,27 +1004,27 @@ const Xe = () => {
|
|
|
1003
1004
|
}
|
|
1004
1005
|
}
|
|
1005
1006
|
),
|
|
1006
|
-
|
|
1007
|
-
|
|
1007
|
+
_t ? /* @__PURE__ */ c(
|
|
1008
|
+
ui,
|
|
1008
1009
|
{
|
|
1009
1010
|
items: yn,
|
|
1010
|
-
top:
|
|
1011
|
-
left:
|
|
1011
|
+
top: it.top,
|
|
1012
|
+
left: it.left,
|
|
1012
1013
|
onSelect: po
|
|
1013
1014
|
}
|
|
1014
1015
|
) : null,
|
|
1015
|
-
Be ? /* @__PURE__ */
|
|
1016
|
-
|
|
1016
|
+
Be ? /* @__PURE__ */ c(
|
|
1017
|
+
ql,
|
|
1017
1018
|
{
|
|
1018
1019
|
suggestion: R.suggestion,
|
|
1019
1020
|
position: { top: R.top, left: R.left },
|
|
1020
1021
|
visible: R.visible,
|
|
1021
|
-
onAccept:
|
|
1022
|
+
onAccept: pt,
|
|
1022
1023
|
onDismiss: b
|
|
1023
1024
|
}
|
|
1024
1025
|
) : null,
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
|
|
1026
|
+
/* @__PURE__ */ c(
|
|
1027
|
+
oi,
|
|
1027
1028
|
{
|
|
1028
1029
|
open: Ae.open,
|
|
1029
1030
|
top: Ae.top,
|
|
@@ -1036,15 +1037,15 @@ const Xe = () => {
|
|
|
1036
1037
|
link: m.link,
|
|
1037
1038
|
clearFormat: m.clearFormat
|
|
1038
1039
|
},
|
|
1039
|
-
activeFormats:
|
|
1040
|
+
activeFormats: qe,
|
|
1040
1041
|
disabled: l || i,
|
|
1041
1042
|
onFormat: To,
|
|
1042
|
-
onLink:
|
|
1043
|
+
onLink: we,
|
|
1043
1044
|
onClose: () => W((e) => ({ ...e, open: !1 }))
|
|
1044
1045
|
}
|
|
1045
1046
|
),
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
|
|
1047
|
+
/* @__PURE__ */ c(
|
|
1048
|
+
jt,
|
|
1048
1049
|
{
|
|
1049
1050
|
open: Ne.open,
|
|
1050
1051
|
x: Ne.x,
|
|
@@ -1052,12 +1053,12 @@ const Xe = () => {
|
|
|
1052
1053
|
items: mo,
|
|
1053
1054
|
colorMode: De,
|
|
1054
1055
|
onClose: () => {
|
|
1055
|
-
|
|
1056
|
+
at(!1), Ie((e) => ({ ...e, open: !1 }));
|
|
1056
1057
|
}
|
|
1057
1058
|
}
|
|
1058
1059
|
),
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
1060
|
+
/* @__PURE__ */ c(
|
|
1061
|
+
jt,
|
|
1061
1062
|
{
|
|
1062
1063
|
open: ge.open,
|
|
1063
1064
|
x: ge.x,
|
|
@@ -1068,19 +1069,19 @@ const Xe = () => {
|
|
|
1068
1069
|
}
|
|
1069
1070
|
)
|
|
1070
1071
|
] }),
|
|
1071
|
-
Re && d.comments ? /* @__PURE__ */
|
|
1072
|
-
|
|
1072
|
+
Re && d.comments ? /* @__PURE__ */ c(
|
|
1073
|
+
jl,
|
|
1073
1074
|
{
|
|
1074
1075
|
comments: Z,
|
|
1075
|
-
author:
|
|
1076
|
-
onClose: () =>
|
|
1076
|
+
author: w,
|
|
1077
|
+
onClose: () => He(!1),
|
|
1077
1078
|
onResolve: (e) => {
|
|
1078
1079
|
const t = Z.find((o) => o.id === e);
|
|
1079
1080
|
Ue(
|
|
1080
1081
|
Z.map(
|
|
1081
1082
|
(o) => o.id === e ? { ...o, resolved: !0 } : o
|
|
1082
1083
|
)
|
|
1083
|
-
), t && n.current && U(
|
|
1084
|
+
), t && n.current && U(El(n.current.innerHTML, t.highlightId));
|
|
1084
1085
|
},
|
|
1085
1086
|
onAddReply: (e, t) => {
|
|
1086
1087
|
Ue(
|
|
@@ -1090,8 +1091,8 @@ const Xe = () => {
|
|
|
1090
1091
|
replies: [
|
|
1091
1092
|
...o.replies,
|
|
1092
1093
|
{
|
|
1093
|
-
id:
|
|
1094
|
-
author:
|
|
1094
|
+
id: xt("reply"),
|
|
1095
|
+
author: w,
|
|
1095
1096
|
body: t,
|
|
1096
1097
|
timestamp: Date.now()
|
|
1097
1098
|
}
|
|
@@ -1102,16 +1103,16 @@ const Xe = () => {
|
|
|
1102
1103
|
}
|
|
1103
1104
|
}
|
|
1104
1105
|
) : null,
|
|
1105
|
-
Ao && f ? /* @__PURE__ */
|
|
1106
|
-
|
|
1106
|
+
Ao && f ? /* @__PURE__ */ c(
|
|
1107
|
+
$l,
|
|
1107
1108
|
{
|
|
1108
1109
|
config: f,
|
|
1109
|
-
documentHtml: ((
|
|
1110
|
-
selectionHtml:
|
|
1110
|
+
documentHtml: ((Dt = n.current) == null ? void 0 : Dt.innerHTML) ?? p ?? "",
|
|
1111
|
+
selectionHtml: rt,
|
|
1111
1112
|
onBusyChange: kn,
|
|
1112
1113
|
onClose: () => Ce(!1),
|
|
1113
1114
|
onApplyHtml: (e) => {
|
|
1114
|
-
if (T(n.current),
|
|
1115
|
+
if (T(n.current), rt)
|
|
1115
1116
|
M(e);
|
|
1116
1117
|
else {
|
|
1117
1118
|
U(e);
|
|
@@ -1122,7 +1123,7 @@ const Xe = () => {
|
|
|
1122
1123
|
}
|
|
1123
1124
|
) : null
|
|
1124
1125
|
] }),
|
|
1125
|
-
Ve ? /* @__PURE__ */ ce("div", { className:
|
|
1126
|
+
Ve ? /* @__PURE__ */ ce("div", { className: Er, children: [
|
|
1126
1127
|
gn,
|
|
1127
1128
|
Ge ? ` / ${Ge}` : ""
|
|
1128
1129
|
] }) : null
|
|
@@ -1131,5 +1132,5 @@ const Xe = () => {
|
|
|
1131
1132
|
);
|
|
1132
1133
|
};
|
|
1133
1134
|
export {
|
|
1134
|
-
|
|
1135
|
+
Tc as InkEditor
|
|
1135
1136
|
};
|