@forgedevstack/ink 1.1.5 → 1.1.7

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