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