@forgedevstack/ink 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +28 -6
  2. package/README.md +77 -19
  3. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  4. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  5. package/dist/components/InkEditor/InkEditor.js +425 -351
  6. package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -0
  7. package/dist/components/InkEditor/components/FindReplace/FindReplace.const.cjs +1 -0
  8. package/dist/components/InkEditor/components/FindReplace/FindReplace.const.d.ts +11 -0
  9. package/dist/components/InkEditor/components/FindReplace/FindReplace.const.d.ts.map +1 -0
  10. package/dist/components/InkEditor/components/FindReplace/FindReplace.const.js +13 -0
  11. package/dist/components/InkEditor/components/FindReplace/FindReplace.d.ts +4 -0
  12. package/dist/components/InkEditor/components/FindReplace/FindReplace.d.ts.map +1 -0
  13. package/dist/components/InkEditor/components/FindReplace/FindReplace.js +49 -0
  14. package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts +12 -0
  15. package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts.map +1 -0
  16. package/dist/components/InkEditor/components/FindReplace/index.d.ts +3 -0
  17. package/dist/components/InkEditor/components/FindReplace/index.d.ts.map +1 -0
  18. package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -0
  19. package/dist/components/InkEditor/components/SignPad/SignPad.const.cjs +1 -0
  20. package/dist/components/InkEditor/components/SignPad/SignPad.const.d.ts +24 -0
  21. package/dist/components/InkEditor/components/SignPad/SignPad.const.d.ts.map +1 -0
  22. package/dist/components/InkEditor/components/SignPad/SignPad.const.js +18 -0
  23. package/dist/components/InkEditor/components/SignPad/SignPad.d.ts +4 -0
  24. package/dist/components/InkEditor/components/SignPad/SignPad.d.ts.map +1 -0
  25. package/dist/components/InkEditor/components/SignPad/SignPad.js +79 -0
  26. package/dist/components/InkEditor/components/SignPad/SignPad.types.d.ts +10 -0
  27. package/dist/components/InkEditor/components/SignPad/SignPad.types.d.ts.map +1 -0
  28. package/dist/components/InkEditor/components/SignPad/SignPad.utils.cjs +1 -0
  29. package/dist/components/InkEditor/components/SignPad/SignPad.utils.d.ts +6 -0
  30. package/dist/components/InkEditor/components/SignPad/SignPad.utils.d.ts.map +1 -0
  31. package/dist/components/InkEditor/components/SignPad/SignPad.utils.js +10 -0
  32. package/dist/components/InkEditor/components/SignPad/SignPad.utils.test.d.ts +2 -0
  33. package/dist/components/InkEditor/components/SignPad/SignPad.utils.test.d.ts.map +1 -0
  34. package/dist/components/InkEditor/components/SignPad/index.d.ts +3 -0
  35. package/dist/components/InkEditor/components/SignPad/index.d.ts.map +1 -0
  36. package/dist/components/InkEditor/components/index.d.ts +2 -0
  37. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  38. package/dist/constants/defaults.const.cjs +1 -1
  39. package/dist/constants/defaults.const.d.ts.map +1 -1
  40. package/dist/constants/defaults.const.js +46 -39
  41. package/dist/constants/generals.const.cjs +1 -0
  42. package/dist/constants/generals.const.d.ts +7 -0
  43. package/dist/constants/generals.const.d.ts.map +1 -0
  44. package/dist/constants/generals.const.js +6 -0
  45. package/dist/constants/index.d.ts +3 -1
  46. package/dist/constants/index.d.ts.map +1 -1
  47. package/dist/constants/numbers.cjs +1 -0
  48. package/dist/constants/numbers.d.ts +121 -0
  49. package/dist/constants/numbers.d.ts.map +1 -0
  50. package/dist/constants/numbers.js +18 -0
  51. package/dist/constants/premium.const.cjs +1 -1
  52. package/dist/constants/premium.const.d.ts.map +1 -1
  53. package/dist/constants/premium.const.js +3 -0
  54. package/dist/constants/toolbar.const.cjs +1 -0
  55. package/dist/constants/toolbar.const.d.ts +4 -0
  56. package/dist/constants/toolbar.const.d.ts.map +1 -0
  57. package/dist/constants/toolbar.const.js +6 -0
  58. package/dist/plugins/ai/demoProvider.cjs +1 -1
  59. package/dist/plugins/ai/demoProvider.js +1 -1
  60. package/dist/styles.css +51 -0
  61. package/dist/types/features.types.d.ts +1 -1
  62. package/dist/types/features.types.d.ts.map +1 -1
  63. package/dist/types/ink.types.d.ts +3 -1
  64. package/dist/types/ink.types.d.ts.map +1 -1
  65. package/dist/types/premium.types.d.ts +1 -1
  66. package/dist/types/premium.types.d.ts.map +1 -1
  67. package/dist/utils/comments.utils.cjs +1 -1
  68. package/dist/utils/comments.utils.js +1 -1
  69. package/dist/utils/findReplace.utils.cjs +1 -0
  70. package/dist/utils/findReplace.utils.d.ts +3 -0
  71. package/dist/utils/findReplace.utils.d.ts.map +1 -0
  72. package/dist/utils/findReplace.utils.js +26 -0
  73. package/dist/utils/history.utils.cjs +1 -1
  74. package/dist/utils/history.utils.js +1 -1
  75. package/dist/utils/index.d.ts +3 -0
  76. package/dist/utils/index.d.ts.map +1 -1
  77. package/dist/utils/ink.features.test.d.ts +2 -0
  78. package/dist/utils/ink.features.test.d.ts.map +1 -0
  79. package/dist/utils/memory.utils.cjs +1 -0
  80. package/dist/utils/memory.utils.d.ts +5 -0
  81. package/dist/utils/memory.utils.d.ts.map +1 -0
  82. package/dist/utils/memory.utils.js +22 -0
  83. package/dist/utils/slash.utils.cjs +1 -1
  84. package/dist/utils/slash.utils.js +1 -1
  85. package/dist/utils/storage.utils.cjs +1 -0
  86. package/dist/utils/storage.utils.d.ts +2 -0
  87. package/dist/utils/storage.utils.d.ts.map +1 -0
  88. package/dist/utils/storage.utils.js +4 -0
  89. package/dist/utils/table.utils.cjs +1 -1
  90. package/dist/utils/table.utils.js +1 -1
  91. package/package.json +3 -2
  92. package/dist/constants/numbers.const.cjs +0 -1
  93. package/dist/constants/numbers.const.d.ts +0 -18
  94. package/dist/constants/numbers.const.d.ts.map +0 -1
  95. package/dist/constants/numbers.const.js +0 -16
@@ -1,528 +1,602 @@
1
- import { jsxs as F, jsx as i } from "react/jsx-runtime";
2
- import { useRef as ye, useState as m, useEffect as y } from "react";
3
- import { INK_MIN_HEIGHT as Ot, INK_DEFAULT_TEXT_COLOR as Pt, INK_DEFAULT_HIGHLIGHT_COLOR as Ut } from "../../constants/numbers.const.js";
4
- import { INK_PLACEHOLDER_DEFAULT as Kt, INK_DEFAULT_TOOLBAR as Ft, INK_DEFAULT_VARIANT as Mt, INK_DEFAULT_AUTHOR as Vt, INK_TABLE_DEFAULT_ROWS as jt, INK_TABLE_DEFAULT_COLS as Wt, INK_DEFAULT_FEATURES as $t, INK_CLASS_TOOLBAR as Gt, INK_CLASS_SHELL as qt, INK_CLASS_BODY as zt, INK_CLASS_CONTENT as Xt, INK_CLASS_FOOTER as Qt, INK_CLASS_DIVIDER as Yt, INK_HEADING_OPTIONS as Jt, INK_BUTTON_CONFIG as Ne, INK_CLASS_ROOT as Zt } from "../../constants/defaults.const.js";
5
- import { INK_DEFAULT_ICONS as Se } from "../../constants/premium.const.js";
6
- import { cn as en } from "../../utils/cn.utils.js";
7
- import { applyTypoAutoFix as tn } from "../../utils/typo.utils.js";
8
- import { createInkId as ve } from "../../utils/id.utils.js";
9
- import { buildTableHtml as nn } from "../../utils/table.utils.js";
10
- import { getBlockElement as _e, moveBlock as on, markActiveBlock as rn } from "../../utils/blocks.utils.js";
11
- import { rejectTrackChangeInHtml as cn, acceptTrackChangeInHtml as sn, createTrackChange as Z, wrapInsertHtml as Ee, wrapDeleteHtml as an } from "../../utils/trackChanges.utils.js";
12
- import { removeCommentMark as ln, wrapSelectionAsComment as un, createCommentThread as mn } from "../../utils/comments.utils.js";
13
- import { InkHistoryStack as xe } from "../../utils/history.utils.js";
14
- import { extractSlashQuery as dn, filterSlashCommands as fn } from "../../utils/slash.utils.js";
15
- import { resolveInkPremium as hn, hasInkPremiumFeature as D, themeTokensToStyle as pn } from "../../utils/premium.utils.js";
16
- import { extractClipboardHtml as gn, sanitizePastedHtml as Cn, extractClipboardText as kn } from "../../utils/paste.utils.js";
17
- import { insertHTML as I, setTextColor as Tn, setHighlightColor as bn, getActiveFormats as In, queryCommandValue as wn, execCommand as g, insertLink as An, insertImage as Re, fileToDataUrl as Ln } from "./helpers/format.utils.js";
18
- import { ToolbarButton as C } from "./components/ToolbarButton/ToolbarButton.js";
19
- import { ToolbarDropdown as Hn } from "./components/ToolbarDropdown/ToolbarDropdown.js";
20
- import { ToolbarColorPicker as Be } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
21
- import { CommentsPanel as yn } from "./components/CommentsPanel/CommentsPanel.js";
22
- import { AiPanel as Nn } from "./components/AiPanel/AiPanel.js";
23
- import { BlockHandles as Sn } from "./components/BlockHandles/BlockHandles.js";
24
- import { SlashMenu as vn } from "./components/SlashMenu/SlashMenu.js";
25
- import { TrackChangesBar as _n } from "./components/TrackChangesBar/TrackChangesBar.js";
26
- const ee = () => {
1
+ import { jsxs as M, jsx as a } from "react/jsx-runtime";
2
+ import { useRef as Pe, useState as m, useEffect as _ } from "react";
3
+ import { INK_MIN_HEIGHT as Wt, INK_DEFAULT_TEXT_COLOR as $t, INK_DEFAULT_HIGHLIGHT_COLOR as zt } from "../../constants/numbers.js";
4
+ import { TOOLBAR_OPTION_SIGNATURE as xe, TOOLBAR_OPTION_FIND_REPLACE as Be, TOOLBAR_OPTION_HORIZONTAL_RULE as Ue } from "../../constants/toolbar.const.js";
5
+ import { INK_PLACEHOLDER_DEFAULT as qt, INK_DEFAULT_TOOLBAR as Xt, INK_DEFAULT_VARIANT as Qt, INK_DEFAULT_AUTHOR as Yt, INK_TABLE_DEFAULT_ROWS as Zt, INK_TABLE_DEFAULT_COLS as Jt, INK_DEFAULT_FEATURES as en, INK_CLASS_TOOLBAR as tn, INK_CLASS_SHELL as nn, INK_CLASS_BODY as rn, INK_CLASS_CONTENT as on, INK_CLASS_FOOTER as cn, INK_CLASS_DIVIDER as sn, INK_HEADING_OPTIONS as an, INK_BUTTON_CONFIG as De, INK_CLASS_ROOT as ln } from "../../constants/defaults.const.js";
6
+ import { INK_DEFAULT_ICONS as Fe } from "../../constants/premium.const.js";
7
+ import { cn as un } from "../../utils/cn.utils.js";
8
+ import { applyTypoAutoFix as mn } from "../../utils/typo.utils.js";
9
+ import { createInkId as Ke } from "../../utils/id.utils.js";
10
+ import { buildTableHtml as dn } from "../../utils/table.utils.js";
11
+ import { getBlockElement as Me, moveBlock as fn, markActiveBlock as pn } from "../../utils/blocks.utils.js";
12
+ import { createTrackChange as J, rejectTrackChangeInHtml as hn, acceptTrackChangeInHtml as gn, wrapInsertHtml as Ve, wrapDeleteHtml as Cn } from "../../utils/trackChanges.utils.js";
13
+ import { removeCommentMark as kn, wrapSelectionAsComment as Tn, createCommentThread as In } from "../../utils/comments.utils.js";
14
+ import { InkHistoryStack as ee } from "../../utils/history.utils.js";
15
+ import { extractSlashQuery as bn, filterSlashCommands as An } from "../../utils/slash.utils.js";
16
+ import { resolveInkPremium as Ln, hasInkPremiumFeature as U, themeTokensToStyle as wn } from "../../utils/premium.utils.js";
17
+ import { extractClipboardHtml as Hn, sanitizePastedHtml as yn, extractClipboardText as _n } from "../../utils/paste.utils.js";
18
+ import { readInkMemory as Nn, writeInkMemory as Sn } from "../../utils/memory.utils.js";
19
+ import { replaceInHtml as Rn } from "../../utils/findReplace.utils.js";
20
+ import { insertImage as te, insertHTML as A, setTextColor as vn, setHighlightColor as On, getActiveFormats as En, queryCommandValue as Pn, execCommand as k, insertLink as xn, fileToDataUrl as Bn } from "./helpers/format.utils.js";
21
+ import { ToolbarButton as h } from "./components/ToolbarButton/ToolbarButton.js";
22
+ import { ToolbarDropdown as Un } from "./components/ToolbarDropdown/ToolbarDropdown.js";
23
+ import { ToolbarColorPicker as je } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
24
+ import { CommentsPanel as Dn } from "./components/CommentsPanel/CommentsPanel.js";
25
+ import { AiPanel as Fn } from "./components/AiPanel/AiPanel.js";
26
+ import { BlockHandles as Kn } from "./components/BlockHandles/BlockHandles.js";
27
+ import { SlashMenu as Mn } from "./components/SlashMenu/SlashMenu.js";
28
+ import { TrackChangesBar as Vn } from "./components/TrackChangesBar/TrackChangesBar.js";
29
+ import { SignPad as jn } from "./components/SignPad/SignPad.js";
30
+ import { FindReplace as Gn } from "./components/FindReplace/FindReplace.js";
31
+ const ne = () => {
27
32
  const N = window.getSelection();
28
33
  if (!N || N.rangeCount === 0) return "";
29
- const h = N.getRangeAt(0), b = document.createElement("div");
30
- return b.appendChild(h.cloneContents()), b.innerHTML;
31
- }, no = (N) => {
32
- var He;
34
+ const g = N.getRangeAt(0), T = document.createElement("div");
35
+ return T.appendChild(g.cloneContents()), T.innerHTML;
36
+ }, br = (N) => {
37
+ var Ee;
33
38
  const {
34
- value: h,
35
- defaultValue: b = "",
36
- onChange: M,
37
- placeholder: te = Kt,
38
- disabled: s = !1,
39
- readOnly: a = !1,
40
- minHeight: V = Ot,
39
+ value: g,
40
+ defaultValue: T = "",
41
+ onChange: C,
42
+ placeholder: re = qt,
43
+ disabled: c = !1,
44
+ readOnly: i = !1,
45
+ minHeight: V = Wt,
41
46
  maxHeight: j,
42
- toolbar: De = Ft,
43
- className: Oe = "",
44
- testId: Pe,
45
- allowImagePaste: ne = !0,
46
- showCharCount: oe = !1,
47
- charCountMax: re,
48
- typoAutoFix: Ue = !0,
49
- variant: Ke = Mt,
50
- features: Fe,
51
- author: w = Vt,
47
+ toolbar: Ge = Xt,
48
+ className: We = "",
49
+ testId: $e,
50
+ allowImagePaste: oe = !0,
51
+ showCharCount: ce = !1,
52
+ charCountMax: ie,
53
+ typoAutoFix: ze = !0,
54
+ variant: qe = Qt,
55
+ features: Xe,
56
+ author: w = Yt,
52
57
  trackChanges: S,
53
- onTrackChangesChange: W,
54
- trackChangesEnabled: O,
55
- onTrackChangesEnabledChange: $,
56
- comments: v,
57
- onCommentsChange: G,
58
- showCommentsPanel: _,
59
- onShowCommentsPanelChange: q,
58
+ onTrackChangesChange: G,
59
+ trackChangesEnabled: D,
60
+ onTrackChangesEnabledChange: W,
61
+ comments: R,
62
+ onCommentsChange: $,
63
+ showCommentsPanel: v,
64
+ onShowCommentsPanelChange: z,
60
65
  ai: d,
61
- slashCommands: Me,
62
- tableRows: Ve = jt,
63
- tableCols: je = Wt,
64
- premium: We,
65
- theme: $e,
66
- icons: ce,
67
- pasteMode: Ge = "plain",
68
- onImageUpload: se,
69
- wysiwyg: qe = !1,
70
- style: ze,
71
- ...Xe
72
- } = N, u = { ...$t, ...Fe }, A = hn(We), Qe = D(A, "icons"), Ye = D(A, "theme"), Je = D(A, "richPaste"), Ze = D(A, "imageUpload"), et = D(A, "wysiwyg") && qe, p = Qe && ce ? { ...Se, ...ce } : Se, tt = Ye ? pn($e) : {}, nt = Je && Ge === "rich", o = ye(null), P = ye(new xe(h ?? b)), [ot, rt] = m(/* @__PURE__ */ new Set()), [ct, ae] = m("p"), [st, at] = m(0), [it, lt] = m(Pt), [ut, mt] = m(Ut), [L, ie] = m(O ?? !1), [dt, le] = m(S ?? []), [ft, ue] = m(v ?? []), [ht, me] = m(_ ?? !1), [de, z] = m(!!(d != null && d.enabled && d.openOnInit)), [fe, pt] = m(""), [gt, Ct] = m(0), [kt, he] = m(!1), [Tt, U] = m([]), [pe, bt] = m({ top: 0, left: 0 }), k = S ?? dt, E = v ?? ft, X = _ ?? ht, ge = Me ?? u.slash;
73
- y(() => {
74
- O !== void 0 && ie(O);
75
- }, [O]), y(() => {
76
- S && le(S);
77
- }, [S]), y(() => {
78
- v && ue(v);
79
- }, [v]), y(() => {
80
- _ !== void 0 && me(_);
81
- }, [_]), y(() => {
82
- !o.current || h === void 0 || o.current.innerHTML !== h && (o.current.innerHTML = h);
83
- }, [h]), y(() => {
84
- !o.current || h || !b || (o.current.innerHTML = b, P.current = new xe(b));
66
+ slashCommands: Qe,
67
+ tableRows: Ye = Zt,
68
+ tableCols: Ze = Jt,
69
+ premium: Je,
70
+ theme: et,
71
+ icons: se,
72
+ pasteMode: tt = "plain",
73
+ onImageUpload: ae,
74
+ wysiwyg: nt = !1,
75
+ keepInMemory: le = !1,
76
+ memoryKey: ue,
77
+ style: rt,
78
+ ...ot
79
+ } = N, u = { ...en, ...Xe }, H = Ln(Je), ct = U(H, "icons"), it = U(H, "theme"), st = U(H, "richPaste"), at = U(H, "imageUpload"), lt = U(H, "wysiwyg") && nt, f = ct && se ? { ...Fe, ...se } : Fe, ut = it ? wn(et) : {}, mt = st && tt === "rich", r = Pe(null), O = Pe(new ee(g ?? T)), [dt, ft] = m(/* @__PURE__ */ new Set()), [pt, me] = m("p"), [ht, gt] = m(0), [Ct, kt] = m($t), [Tt, It] = m(zt), [y, de] = m(D ?? !1), [bt, fe] = m(S ?? []), [At, pe] = m(R ?? []), [Lt, he] = m(v ?? !1), [ge, q] = m(!!(d != null && d.enabled && d.openOnInit)), [Ce, wt] = m(""), [Ht, yt] = m(0), [_t, ke] = m(!1), [Nt, F] = m([]), [Te, St] = m({ top: 0, left: 0 }), [Ie, be] = m(!1), [Ae, Le] = m(!1), I = S ?? bt, E = R ?? At, X = v ?? Lt, we = Qe ?? u.slash;
80
+ _(() => {
81
+ D !== void 0 && de(D);
82
+ }, [D]), _(() => {
83
+ S && fe(S);
84
+ }, [S]), _(() => {
85
+ R && pe(R);
86
+ }, [R]), _(() => {
87
+ v !== void 0 && he(v);
88
+ }, [v]), _(() => {
89
+ !r.current || g === void 0 || r.current.innerHTML !== g && (r.current.innerHTML = g);
90
+ }, [g]), _(() => {
91
+ if (!r.current) return;
92
+ const e = le ? Nn(ue) : "";
93
+ if (e) {
94
+ r.current.innerHTML = e, O.current = new ee(e), C == null || C(e);
95
+ return;
96
+ }
97
+ g === void 0 && T && (r.current.innerHTML = T, O.current = new ee(T), C == null || C(T));
85
98
  }, []);
86
99
  const Q = (e) => {
87
100
  var t;
88
- P.current.push(e), M == null || M(e), oe && o.current && at(((t = o.current.textContent) == null ? void 0 : t.length) ?? 0);
89
- }, H = (e) => {
90
- o.current && (o.current.innerHTML = e, Q(e));
91
- }, x = (e) => {
92
- le(e), W == null || W(e);
101
+ O.current.push(e), C == null || C(e), le && Sn(e, ue), ce && r.current && gt(((t = r.current.textContent) == null ? void 0 : t.length) ?? 0);
102
+ }, L = (e) => {
103
+ r.current && (r.current.innerHTML = e, Q(e));
104
+ }, P = (e) => {
105
+ fe(e), G == null || G(e);
93
106
  }, Y = (e) => {
94
- ue(e), G == null || G(e);
95
- }, J = (e) => {
96
- me(e), q == null || q(e);
97
- }, It = (e) => {
98
- ie(e), $ == null || $(e);
107
+ pe(e), $ == null || $(e);
108
+ }, Z = (e) => {
109
+ he(e), z == null || z(e);
110
+ }, Rt = (e) => {
111
+ de(e), W == null || W(e);
99
112
  }, K = () => {
100
- rt(In());
101
- const e = wn("formatBlock");
102
- if (e && ae(e.toLowerCase().replace(/[<>]/g, "")), pt(ee()), !o.current || !u.blocks) return;
103
- const t = window.getSelection(), n = (t == null ? void 0 : t.anchorNode) ?? null, r = _e(n, o.current);
104
- if (rn(o.current, r), r) {
105
- const c = o.current.getBoundingClientRect(), f = r.getBoundingClientRect();
106
- Ct(f.top - c.top + o.current.scrollTop), he(!0);
113
+ ft(En());
114
+ const e = Pn("formatBlock");
115
+ if (e && me(e.toLowerCase().replace(/[<>]/g, "")), wt(ne()), !r.current || !u.blocks) return;
116
+ const t = window.getSelection(), n = (t == null ? void 0 : t.anchorNode) ?? null, o = Me(n, r.current);
117
+ if (pn(r.current, o), o) {
118
+ const s = r.current.getBoundingClientRect(), p = o.getBoundingClientRect();
119
+ yt(p.top - s.top + r.current.scrollTop), ke(!0);
107
120
  } else
108
- he(!1);
121
+ ke(!1);
109
122
  }, l = () => {
110
- var t, n, r;
111
- if (!o.current) return;
112
- let e = o.current.innerHTML;
113
- if (L && u.trackChanges) {
114
- const c = window.getSelection();
115
- if (c && !c.isCollapsed) {
116
- const f = ee();
117
- if (f) {
118
- const T = Z("delete", f, w);
119
- x([...k, T]), wt(T.id), e = o.current.innerHTML;
123
+ var t, n, o;
124
+ if (!r.current) return;
125
+ let e = r.current.innerHTML;
126
+ if (y && u.trackChanges) {
127
+ const s = window.getSelection();
128
+ if (s && !s.isCollapsed) {
129
+ const p = ne();
130
+ if (p) {
131
+ const b = J("delete", p, w);
132
+ P([...I, b]), vt(b.id), e = r.current.innerHTML;
120
133
  }
121
134
  }
122
135
  }
123
- if (Q(e), K(), ge && o.current) {
124
- const c = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", f = dn(c);
125
- if (f !== null) {
126
- U(fn(f));
127
- const T = (r = window.getSelection()) == null ? void 0 : r.getRangeAt(0);
128
- if (T && o.current) {
129
- const R = T.getBoundingClientRect(), B = o.current.getBoundingClientRect();
130
- bt({
131
- top: R.bottom - B.top + 8,
132
- left: R.left - B.left
136
+ if (Q(e), K(), we && r.current) {
137
+ const s = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", p = bn(s);
138
+ if (p !== null) {
139
+ F(An(p));
140
+ const b = (o = window.getSelection()) == null ? void 0 : o.getRangeAt(0);
141
+ if (b && r.current) {
142
+ const x = b.getBoundingClientRect(), B = r.current.getBoundingClientRect();
143
+ St({
144
+ top: x.bottom - B.top + 8,
145
+ left: x.left - B.left
133
146
  });
134
147
  }
135
148
  } else
136
- U([]);
149
+ F([]);
137
150
  }
138
- }, wt = (e) => {
151
+ }, vt = (e) => {
139
152
  const t = window.getSelection();
140
153
  if (!t || t.rangeCount === 0) return;
141
- const n = ee();
142
- n && I(an(n, e));
143
- }, At = () => {
144
- if (!o.current || !Ue || !u.typoAutoFix || s || a) return;
145
- const e = o.current.innerHTML, t = tn(e);
146
- t.html !== e && (o.current.innerHTML = t.html, Q(t.html));
147
- }, Lt = (e) => {
154
+ const n = ne();
155
+ n && A(Cn(n, e));
156
+ }, Ot = () => {
157
+ if (!r.current || !ze || !u.typoAutoFix || c || i) return;
158
+ const e = r.current.innerHTML, t = mn(e);
159
+ t.html !== e && (r.current.innerHTML = t.html, Q(t.html));
160
+ }, Et = (e) => {
148
161
  var n;
149
- if (s || a) return;
150
- (n = o.current) == null || n.focus();
151
- const t = Ne[e];
152
- t && (t.value ? g(t.command, t.value) : g(t.command), l());
153
- }, Ht = (e) => {
162
+ if (c || i) return;
163
+ (n = r.current) == null || n.focus();
164
+ const t = De[e];
165
+ t && (t.value ? k(t.command, t.value) : k(t.command), l());
166
+ }, Pt = (e) => {
154
167
  var t;
155
- s || a || ((t = o.current) == null || t.focus(), g("formatBlock", e), ae(e), l());
156
- }, yt = () => {
168
+ c || i || ((t = r.current) == null || t.focus(), k("formatBlock", e), me(e), l());
169
+ }, xt = () => {
157
170
  var t;
158
- if (s || a) return;
171
+ if (c || i) return;
159
172
  const e = window.prompt("Enter URL:", "https://");
160
- e && ((t = o.current) == null || t.focus(), An(e), l());
161
- }, Ce = async (e) => Ze && se ? se(e) : Ln(e), Nt = async () => {
162
- if (s || a) return;
173
+ e && ((t = r.current) == null || t.focus(), xn(e), l());
174
+ }, He = async (e) => at && ae ? ae(e) : Bn(e), Bt = async () => {
175
+ if (c || i) return;
163
176
  const e = document.createElement("input");
164
177
  e.type = "file", e.accept = "image/*", e.onchange = async () => {
165
- var r, c;
166
- const t = (r = e.files) == null ? void 0 : r[0];
178
+ var o, s;
179
+ const t = (o = e.files) == null ? void 0 : o[0];
167
180
  if (!t) return;
168
- const n = await Ce(t);
169
- (c = o.current) == null || c.focus(), Re(n, t.name), l();
181
+ const n = await He(t);
182
+ (s = r.current) == null || s.focus(), te(n, t.name), l();
170
183
  }, e.click();
171
- }, ke = () => {
184
+ }, ye = () => {
172
185
  var t;
173
- if (s || a || !u.table) return;
174
- (t = o.current) == null || t.focus();
175
- const e = nn(Ve, je);
176
- if (L && u.trackChanges) {
177
- const n = Z("insert", e, w);
178
- x([...k, n]), I(Ee(e, n.id));
186
+ if (c || i || !u.table) return;
187
+ (t = r.current) == null || t.focus();
188
+ const e = dn(Ye, Ze);
189
+ if (y && u.trackChanges) {
190
+ const n = J("insert", e, w);
191
+ P([...I, n]), A(Ve(e, n.id));
179
192
  } else
180
- I(e);
193
+ A(e);
181
194
  l();
182
- }, Te = () => {
183
- const e = P.current.undo();
184
- if (e === null || !o.current) {
185
- g("undo"), l();
195
+ }, _e = () => {
196
+ const e = O.current.undo();
197
+ if (e === null || !r.current) {
198
+ k("undo"), l();
186
199
  return;
187
200
  }
188
- H(e);
189
- }, be = () => {
190
- const e = P.current.redo();
191
- if (e === null || !o.current) {
192
- g("redo"), l();
201
+ L(e);
202
+ }, Ne = () => {
203
+ const e = O.current.redo();
204
+ if (e === null || !r.current) {
205
+ k("redo"), l();
193
206
  return;
194
207
  }
195
- H(e);
196
- }, St = () => {
197
- var c;
198
- if (s || a || !u.comments) return;
208
+ L(e);
209
+ }, Ut = () => {
210
+ var s;
211
+ if (c || i || !u.comments) return;
199
212
  const e = window.prompt("Comment:");
200
213
  if (!(e != null && e.trim())) return;
201
- const t = ve("hl");
202
- if ((c = o.current) == null || c.focus(), !un(t)) return;
203
- const r = mn(w, e.trim(), t);
204
- Y([r, ...E]), J(!0), l();
205
- }, Ie = (e) => {
206
- if (!o.current) return;
207
- const t = sn(o.current.innerHTML, e);
208
- H(t), x(
209
- k.map((n) => n.id === e ? { ...n, accepted: !0 } : n)
214
+ const t = Ke("hl");
215
+ if ((s = r.current) == null || s.focus(), !Tn(t)) return;
216
+ const o = In(w, e.trim(), t);
217
+ Y([o, ...E]), Z(!0), l();
218
+ }, Se = (e) => {
219
+ if (!r.current) return;
220
+ const t = gn(r.current.innerHTML, e);
221
+ L(t), P(
222
+ I.map((n) => n.id === e ? { ...n, accepted: !0 } : n)
210
223
  );
211
- }, we = (e) => {
212
- if (!o.current) return;
213
- const t = cn(o.current.innerHTML, e);
214
- H(t), x(
215
- k.map((n) => n.id === e ? { ...n, rejected: !0 } : n)
224
+ }, Re = (e) => {
225
+ if (!r.current) return;
226
+ const t = hn(r.current.innerHTML, e);
227
+ L(t), P(
228
+ I.map((n) => n.id === e ? { ...n, rejected: !0 } : n)
216
229
  );
217
- }, Ae = async (e) => {
218
- const t = await Ce(e), n = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
219
- if (L && u.trackChanges) {
220
- const r = Z("insert", n, w);
221
- x([...k, r]), I(Ee(n, r.id));
230
+ }, ve = async (e) => {
231
+ const t = await He(e), n = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
232
+ if (y && u.trackChanges) {
233
+ const o = J("insert", n, w);
234
+ P([...I, o]), A(Ve(n, o.id));
222
235
  } else
223
- Re(t);
236
+ te(t);
224
237
  l();
225
- }, vt = async (e) => {
226
- if (s || a) return;
238
+ }, Dt = async (e) => {
239
+ if (c || i) return;
227
240
  const t = e.clipboardData;
228
241
  if (!t) return;
229
- if (nt) {
230
- const r = gn(t);
231
- if (r) {
242
+ if (mt) {
243
+ const o = Hn(t);
244
+ if (o) {
232
245
  e.preventDefault();
233
- const f = Cn(r);
234
- f && (I(f), l());
235
- const T = t.items;
236
- if (ne && T)
237
- for (const R of Array.from(T)) {
238
- if (!R.type.startsWith("image/")) continue;
239
- const B = R.getAsFile();
240
- B && await Ae(B);
246
+ const p = yn(o);
247
+ p && (A(p), l());
248
+ const b = t.items;
249
+ if (oe && b)
250
+ for (const x of Array.from(b)) {
251
+ if (!x.type.startsWith("image/")) continue;
252
+ const B = x.getAsFile();
253
+ B && await ve(B);
241
254
  }
242
255
  return;
243
256
  }
244
- const c = kn(t);
245
- if (c) {
246
- e.preventDefault(), I(c.replace(/\n/g, "<br />")), l();
257
+ const s = _n(t);
258
+ if (s) {
259
+ e.preventDefault(), A(s.replace(/\n/g, "<br />")), l();
247
260
  return;
248
261
  }
249
262
  }
250
- if (!ne) return;
263
+ if (!oe) return;
251
264
  const n = t.items;
252
265
  if (n)
253
- for (const r of Array.from(n)) {
254
- if (!r.type.startsWith("image/")) continue;
266
+ for (const o of Array.from(n)) {
267
+ if (!o.type.startsWith("image/")) continue;
255
268
  e.preventDefault();
256
- const c = r.getAsFile();
257
- c && await Ae(c);
269
+ const s = o.getAsFile();
270
+ s && await ve(s);
258
271
  }
259
- }, _t = (e) => {
260
- e.key === "Escape" && U([]), (e.metaKey || e.ctrlKey) && e.key === "z" && (e.preventDefault(), e.shiftKey ? be() : Te());
261
- }, Et = (e) => {
262
- var n, r;
263
- (n = o.current) == null || n.focus();
272
+ }, Ft = (e) => {
273
+ e.key === "Escape" && F([]), (e.metaKey || e.ctrlKey) && e.key === "z" && (e.preventDefault(), e.shiftKey ? Ne() : _e());
274
+ }, Kt = (e) => {
275
+ var n, o;
276
+ (n = r.current) == null || n.focus();
264
277
  const t = window.getSelection();
265
- if ((r = t == null ? void 0 : t.anchorNode) != null && r.textContent) {
266
- const f = t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/, " ");
267
- t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent = f);
278
+ if ((o = t == null ? void 0 : t.anchorNode) != null && o.textContent) {
279
+ const p = t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/, " ");
280
+ t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent = p);
268
281
  }
269
- switch (U([]), e.insert) {
282
+ switch (F([]), e.insert) {
270
283
  case "heading1":
271
- g("formatBlock", "h1");
284
+ k("formatBlock", "h1");
272
285
  break;
273
286
  case "heading2":
274
- g("formatBlock", "h2");
287
+ k("formatBlock", "h2");
275
288
  break;
276
289
  case "bulletList":
277
- g("insertUnorderedList");
290
+ k("insertUnorderedList");
278
291
  break;
279
292
  case "orderedList":
280
- g("insertOrderedList");
293
+ k("insertOrderedList");
281
294
  break;
282
295
  case "table":
283
- ke();
296
+ ye();
284
297
  return;
285
298
  case "ai":
286
- z(!0);
299
+ q(!0);
287
300
  break;
288
301
  }
289
302
  l();
290
- }, Le = (e) => {
291
- if (!o.current) return;
292
- const t = window.getSelection(), n = _e((t == null ? void 0 : t.anchorNode) ?? null, o.current);
293
- n && on(n, e) && (l(), K());
294
- }, xt = (e, t) => {
303
+ }, Oe = (e) => {
304
+ if (!r.current) return;
305
+ const t = window.getSelection(), n = Me((t == null ? void 0 : t.anchorNode) ?? null, r.current);
306
+ n && fn(n, e) && (l(), K());
307
+ }, Mt = (e, t) => {
295
308
  if (e === "divider")
296
- return /* @__PURE__ */ i("span", { className: Yt }, `divider-${t}`);
309
+ return /* @__PURE__ */ a("span", { className: sn }, `divider-${t}`);
297
310
  if (e === "headingDropdown")
298
- return /* @__PURE__ */ i(
299
- Hn,
311
+ return /* @__PURE__ */ a(
312
+ Un,
300
313
  {
301
314
  title: "Heading",
302
- options: Jt,
303
- value: ct || "p",
304
- disabled: s || a,
305
- onChange: Ht
315
+ options: an,
316
+ value: pt || "p",
317
+ disabled: c || i,
318
+ onChange: Pt
306
319
  },
307
320
  "heading"
308
321
  );
309
322
  if (e === "textColor")
310
- return /* @__PURE__ */ i(
311
- Be,
323
+ return /* @__PURE__ */ a(
324
+ je,
312
325
  {
313
326
  title: "Text color",
314
327
  type: "text",
315
- value: it,
316
- disabled: s || a,
317
- onChange: (r) => {
318
- var c;
319
- (c = o.current) == null || c.focus(), Tn(r), lt(r), l();
328
+ value: Ct,
329
+ disabled: c || i,
330
+ onChange: (o) => {
331
+ var s;
332
+ (s = r.current) == null || s.focus(), vn(o), kt(o), l();
320
333
  }
321
334
  },
322
335
  "textColor"
323
336
  );
324
337
  if (e === "highlightColor")
325
- return /* @__PURE__ */ i(
326
- Be,
338
+ return /* @__PURE__ */ a(
339
+ je,
327
340
  {
328
341
  title: "Highlight color",
329
342
  type: "highlight",
330
- value: ut,
331
- disabled: s || a,
332
- onChange: (r) => {
333
- var c;
334
- (c = o.current) == null || c.focus(), bn(r), mt(r), l();
343
+ value: Tt,
344
+ disabled: c || i,
345
+ onChange: (o) => {
346
+ var s;
347
+ (s = r.current) == null || s.focus(), On(o), It(o), l();
335
348
  }
336
349
  },
337
350
  "highlightColor"
338
351
  );
339
352
  if (e === "link")
340
- return /* @__PURE__ */ i(
341
- C,
353
+ return /* @__PURE__ */ a(
354
+ h,
342
355
  {
343
- icon: p.link,
356
+ icon: f.link,
344
357
  title: "Insert link",
345
- disabled: s || a,
346
- onClick: yt
358
+ disabled: c || i,
359
+ onClick: xt
347
360
  },
348
361
  "link"
349
362
  );
350
363
  if (e === "image")
351
- return /* @__PURE__ */ i(
352
- C,
364
+ return /* @__PURE__ */ a(
365
+ h,
353
366
  {
354
- icon: p.image,
367
+ icon: f.image,
355
368
  title: "Insert image",
356
- disabled: s || a,
369
+ disabled: c || i,
357
370
  onClick: () => {
358
- Nt();
371
+ Bt();
359
372
  }
360
373
  },
361
374
  "image"
362
375
  );
363
376
  if (e === "table")
364
- return u.table ? /* @__PURE__ */ i(
365
- C,
377
+ return u.table ? /* @__PURE__ */ a(
378
+ h,
366
379
  {
367
- icon: p.table,
380
+ icon: f.table,
368
381
  title: "Insert table",
369
- disabled: s || a,
370
- onClick: ke
382
+ disabled: c || i,
383
+ onClick: ye
371
384
  },
372
385
  "table"
373
386
  ) : null;
387
+ if (e === xe)
388
+ return u.signature ? /* @__PURE__ */ a(
389
+ h,
390
+ {
391
+ icon: f.signature,
392
+ title: "Sign pad",
393
+ active: Ie,
394
+ disabled: c || i,
395
+ onClick: () => be(!0)
396
+ },
397
+ xe
398
+ ) : null;
399
+ if (e === Be)
400
+ return u.findReplace ? /* @__PURE__ */ a(
401
+ h,
402
+ {
403
+ icon: f.findReplace,
404
+ title: "Find and replace",
405
+ active: Ae,
406
+ disabled: c || i,
407
+ onClick: () => Le((o) => !o)
408
+ },
409
+ Be
410
+ ) : null;
411
+ if (e === Ue)
412
+ return u.horizontalRule ? /* @__PURE__ */ a(
413
+ h,
414
+ {
415
+ icon: f.horizontalRule,
416
+ title: "Horizontal rule",
417
+ disabled: c || i,
418
+ onClick: () => {
419
+ var o;
420
+ (o = r.current) == null || o.focus(), A("<hr />"), l();
421
+ }
422
+ },
423
+ Ue
424
+ ) : null;
374
425
  if (e === "undo")
375
- return /* @__PURE__ */ i(
376
- C,
426
+ return /* @__PURE__ */ a(
427
+ h,
377
428
  {
378
- icon: p.undo,
429
+ icon: f.undo,
379
430
  title: "Undo",
380
- disabled: s || a,
381
- onClick: Te
431
+ disabled: c || i,
432
+ onClick: _e
382
433
  },
383
434
  "undo"
384
435
  );
385
436
  if (e === "redo")
386
- return /* @__PURE__ */ i(
387
- C,
437
+ return /* @__PURE__ */ a(
438
+ h,
388
439
  {
389
- icon: p.redo,
440
+ icon: f.redo,
390
441
  title: "Redo",
391
- disabled: s || a,
392
- onClick: be
442
+ disabled: c || i,
443
+ onClick: Ne
393
444
  },
394
445
  "redo"
395
446
  );
396
447
  if (e === "trackChanges")
397
- return u.trackChanges ? /* @__PURE__ */ i(
398
- C,
448
+ return u.trackChanges ? /* @__PURE__ */ a(
449
+ h,
399
450
  {
400
- icon: p.trackChanges,
451
+ icon: f.trackChanges,
401
452
  title: "Track changes",
402
- active: L,
403
- disabled: s || a,
404
- onClick: () => It(!L)
453
+ active: y,
454
+ disabled: c || i,
455
+ onClick: () => Rt(!y)
405
456
  },
406
457
  "trackChanges"
407
458
  ) : null;
408
459
  if (e === "comments")
409
- return u.comments ? /* @__PURE__ */ i(
410
- C,
460
+ return u.comments ? /* @__PURE__ */ a(
461
+ h,
411
462
  {
412
- icon: p.comments,
463
+ icon: f.comments,
413
464
  title: "Comments",
414
465
  active: X,
415
- disabled: s || a,
466
+ disabled: c || i,
416
467
  onClick: () => {
417
- X ? J(!1) : St();
468
+ X ? Z(!1) : Ut();
418
469
  }
419
470
  },
420
471
  "comments"
421
472
  ) : null;
422
473
  if (e === "ai")
423
- return !u.ai || !(d != null && d.enabled) ? null : /* @__PURE__ */ i(
424
- C,
474
+ return !u.ai || !(d != null && d.enabled) ? null : /* @__PURE__ */ a(
475
+ h,
425
476
  {
426
- icon: p.ai,
477
+ icon: f.ai,
427
478
  title: "Ink AI",
428
- active: de,
429
- disabled: s || a,
430
- onClick: () => z((r) => !r)
479
+ active: ge,
480
+ disabled: c || i,
481
+ onClick: () => q((o) => !o)
431
482
  },
432
483
  "ai"
433
484
  );
434
- const n = Ne[e];
435
- return n ? /* @__PURE__ */ i(
436
- C,
485
+ const n = De[e];
486
+ return n ? /* @__PURE__ */ a(
487
+ h,
437
488
  {
438
- icon: p[e] ?? e.slice(0, 1).toUpperCase(),
489
+ icon: f[e] ?? e.slice(0, 1).toUpperCase(),
439
490
  title: n.title,
440
- active: ot.has(e),
441
- disabled: s || a,
442
- onClick: () => Lt(e)
491
+ active: dt.has(e),
492
+ disabled: c || i,
493
+ onClick: () => Et(e)
443
494
  },
444
495
  e
445
496
  ) : null;
446
- }, Rt = typeof V == "number" ? `${V}px` : V, Bt = typeof j == "number" ? `${j}px` : j, Dt = !!(d != null && d.enabled && de);
447
- return /* @__PURE__ */ F(
497
+ }, Vt = typeof V == "number" ? `${V}px` : V, jt = typeof j == "number" ? `${j}px` : j, Gt = !!(d != null && d.enabled && ge);
498
+ return /* @__PURE__ */ M(
448
499
  "div",
449
500
  {
450
- className: en(Zt, Oe),
451
- "data-testid": Pe,
452
- "data-disabled": s || void 0,
453
- "data-variant": Ke,
454
- "data-premium": A.active || void 0,
455
- "data-wysiwyg": et || void 0,
456
- style: { ...tt, ...ze },
457
- ...Xe,
501
+ className: un(ln, We),
502
+ "data-testid": $e,
503
+ "data-disabled": c || void 0,
504
+ "data-variant": qe,
505
+ "data-premium": H.active || void 0,
506
+ "data-wysiwyg": lt || void 0,
507
+ style: { ...ut, ...rt },
508
+ ...ot,
458
509
  children: [
459
- /* @__PURE__ */ i("div", { className: Gt, role: "toolbar", "aria-label": "Ink formatting toolbar", children: De.map(xt) }),
460
- L && u.trackChanges ? /* @__PURE__ */ i(
461
- _n,
510
+ /* @__PURE__ */ a("div", { className: tn, role: "toolbar", "aria-label": "Ink formatting toolbar", children: Ge.map(Mt) }),
511
+ /* @__PURE__ */ a(
512
+ jn,
513
+ {
514
+ open: Ie,
515
+ onClose: () => be(!1),
516
+ onConfirm: (e) => {
517
+ var t;
518
+ (t = r.current) == null || t.focus(), te(e), l();
519
+ }
520
+ }
521
+ ),
522
+ /* @__PURE__ */ a(
523
+ Gn,
524
+ {
525
+ open: Ae,
526
+ onClose: () => Le(!1),
527
+ onReplace: (e, t, n) => {
528
+ if (!r.current) return;
529
+ const o = Rn(r.current.innerHTML, e, t, n);
530
+ L(o);
531
+ }
532
+ }
533
+ ),
534
+ y && u.trackChanges ? /* @__PURE__ */ a(
535
+ Vn,
462
536
  {
463
- changes: k,
464
- onAccept: Ie,
465
- onReject: we,
466
- onAcceptAll: () => k.forEach((e) => Ie(e.id)),
467
- onRejectAll: () => k.forEach((e) => we(e.id))
537
+ changes: I,
538
+ onAccept: Se,
539
+ onReject: Re,
540
+ onAcceptAll: () => I.forEach((e) => Se(e.id)),
541
+ onRejectAll: () => I.forEach((e) => Re(e.id))
468
542
  }
469
543
  ) : null,
470
- /* @__PURE__ */ F("div", { className: qt, children: [
471
- /* @__PURE__ */ F("div", { className: zt, children: [
472
- u.blocks ? /* @__PURE__ */ i(
473
- Sn,
544
+ /* @__PURE__ */ M("div", { className: nn, children: [
545
+ /* @__PURE__ */ M("div", { className: rn, children: [
546
+ u.blocks ? /* @__PURE__ */ a(
547
+ Kn,
474
548
  {
475
- visible: kt && !s && !a,
476
- top: gt,
477
- onMoveUp: () => Le("up"),
478
- onMoveDown: () => Le("down")
549
+ visible: _t && !c && !i,
550
+ top: Ht,
551
+ onMoveUp: () => Oe("up"),
552
+ onMoveDown: () => Oe("down")
479
553
  }
480
554
  ) : null,
481
- /* @__PURE__ */ i(
555
+ /* @__PURE__ */ a(
482
556
  "div",
483
557
  {
484
- ref: o,
485
- className: Xt,
486
- contentEditable: !s && !a,
558
+ ref: r,
559
+ className: on,
560
+ contentEditable: !c && !i,
487
561
  role: "textbox",
488
562
  "aria-multiline": "true",
489
- "aria-placeholder": te,
490
- "data-placeholder": te,
563
+ "aria-placeholder": re,
564
+ "data-placeholder": re,
491
565
  suppressContentEditableWarning: !0,
492
- style: { minHeight: Rt, maxHeight: Bt },
566
+ style: { minHeight: Vt, maxHeight: jt },
493
567
  onInput: l,
494
- onBlur: At,
568
+ onBlur: Ot,
495
569
  onKeyUp: K,
496
- onKeyDown: _t,
570
+ onKeyDown: Ft,
497
571
  onMouseUp: K,
498
572
  onPaste: (e) => {
499
- vt(e);
573
+ Dt(e);
500
574
  }
501
575
  }
502
576
  ),
503
- ge ? /* @__PURE__ */ i(
504
- vn,
577
+ we ? /* @__PURE__ */ a(
578
+ Mn,
505
579
  {
506
- items: Tt,
507
- top: pe.top,
508
- left: pe.left,
509
- onSelect: Et
580
+ items: Nt,
581
+ top: Te.top,
582
+ left: Te.left,
583
+ onSelect: Kt
510
584
  }
511
585
  ) : null
512
586
  ] }),
513
- X && u.comments ? /* @__PURE__ */ i(
514
- yn,
587
+ X && u.comments ? /* @__PURE__ */ a(
588
+ Dn,
515
589
  {
516
590
  comments: E,
517
591
  author: w,
518
- onClose: () => J(!1),
592
+ onClose: () => Z(!1),
519
593
  onResolve: (e) => {
520
594
  const t = E.find((n) => n.id === e);
521
595
  Y(
522
596
  E.map(
523
597
  (n) => n.id === e ? { ...n, resolved: !0 } : n
524
598
  )
525
- ), t && o.current && H(ln(o.current.innerHTML, t.highlightId));
599
+ ), t && r.current && L(kn(r.current.innerHTML, t.highlightId));
526
600
  },
527
601
  onAddReply: (e, t) => {
528
602
  Y(
@@ -532,7 +606,7 @@ const ee = () => {
532
606
  replies: [
533
607
  ...n.replies,
534
608
  {
535
- id: ve("reply"),
609
+ id: Ke("reply"),
536
610
  author: w,
537
611
  body: t,
538
612
  timestamp: Date.now()
@@ -544,19 +618,19 @@ const ee = () => {
544
618
  }
545
619
  }
546
620
  ) : null,
547
- Dt && d ? /* @__PURE__ */ i(
548
- Nn,
621
+ Gt && d ? /* @__PURE__ */ a(
622
+ Fn,
549
623
  {
550
624
  config: d,
551
- documentHtml: ((He = o.current) == null ? void 0 : He.innerHTML) ?? h ?? "",
552
- selectionHtml: fe,
553
- onClose: () => z(!1),
625
+ documentHtml: ((Ee = r.current) == null ? void 0 : Ee.innerHTML) ?? g ?? "",
626
+ selectionHtml: Ce,
627
+ onClose: () => q(!1),
554
628
  onApplyHtml: (e) => {
555
629
  var t;
556
- if ((t = o.current) == null || t.focus(), fe)
557
- I(e);
630
+ if ((t = r.current) == null || t.focus(), Ce)
631
+ A(e);
558
632
  else {
559
- H(e);
633
+ L(e);
560
634
  return;
561
635
  }
562
636
  l();
@@ -564,14 +638,14 @@ const ee = () => {
564
638
  }
565
639
  ) : null
566
640
  ] }),
567
- oe ? /* @__PURE__ */ F("div", { className: Qt, children: [
568
- st,
569
- re ? ` / ${re}` : ""
641
+ ce ? /* @__PURE__ */ M("div", { className: cn, children: [
642
+ ht,
643
+ ie ? ` / ${ie}` : ""
570
644
  ] }) : null
571
645
  ]
572
646
  }
573
647
  );
574
648
  };
575
649
  export {
576
- no as InkEditor
650
+ br as InkEditor
577
651
  };