@forgedevstack/ink 1.1.1 → 1.1.2

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