@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.
- package/CHANGELOG.md +21 -0
- package/dist/common-components/icons/BulletListIcon.cjs +1 -0
- package/dist/common-components/icons/BulletListIcon.d.ts +3 -0
- package/dist/common-components/icons/BulletListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/BulletListIcon.js +11 -0
- package/dist/common-components/icons/ChecklistIcon.cjs +1 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts +3 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ChecklistIcon.js +10 -0
- package/dist/common-components/icons/ImageToolIcon.cjs +1 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts +3 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ImageToolIcon.js +10 -0
- package/dist/common-components/icons/LinkToolIcon.cjs +1 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts +3 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/LinkToolIcon.js +9 -0
- package/dist/common-components/icons/OrderedListIcon.cjs +1 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts +3 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/OrderedListIcon.js +9 -0
- package/dist/common-components/icons/QuoteIcon.cjs +1 -0
- package/dist/common-components/icons/QuoteIcon.d.ts +3 -0
- package/dist/common-components/icons/QuoteIcon.d.ts.map +1 -0
- package/dist/common-components/icons/QuoteIcon.js +6 -0
- package/dist/common-components/icons/TableToolIcon.cjs +1 -0
- package/dist/common-components/icons/TableToolIcon.d.ts +3 -0
- package/dist/common-components/icons/TableToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/TableToolIcon.js +9 -0
- package/dist/common-components/icons/index.d.ts +7 -0
- package/dist/common-components/icons/index.d.ts.map +1 -1
- package/dist/common-components/index.d.ts +1 -1
- package/dist/common-components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +790 -682
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts +4 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +31 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +7 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts +3 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts.map +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +62 -17
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +10 -9
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +91 -18
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts +6 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +3 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +15 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts +2 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/components/InkEditor/components/index.d.ts +2 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/constants/defaultIcons.cjs +1 -1
- package/dist/constants/defaultIcons.d.ts.map +1 -1
- package/dist/constants/defaultIcons.js +27 -17
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts +47 -1
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +224 -57
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +42 -0
- package/dist/constants/generals.const.d.ts.map +1 -1
- package/dist/constants/generals.const.js +32 -4
- package/dist/constants/keyboard.const.cjs +1 -1
- package/dist/constants/keyboard.const.d.ts +1 -0
- package/dist/constants/keyboard.const.d.ts.map +1 -1
- package/dist/constants/keyboard.const.js +2 -1
- package/dist/constants/lists.const.cjs +1 -1
- package/dist/constants/lists.const.d.ts +1 -0
- package/dist/constants/lists.const.d.ts.map +1 -1
- package/dist/constants/lists.const.js +10 -9
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.d.ts +5 -1
- package/dist/constants/numbers.d.ts.map +1 -1
- package/dist/constants/numbers.js +24 -19
- package/dist/constants/premium.const.cjs +1 -1
- package/dist/constants/premium.const.d.ts.map +1 -1
- package/dist/constants/premium.const.js +10 -9
- package/dist/constants/toolbar.const.cjs +1 -1
- package/dist/constants/toolbar.const.d.ts +1 -0
- package/dist/constants/toolbar.const.d.ts.map +1 -1
- package/dist/constants/toolbar.const.js +12 -11
- package/dist/constants/toolbarMenu.const.cjs +1 -1
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
- package/dist/constants/toolbarMenu.const.js +12 -11
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -98
- package/dist/styles.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +11 -2
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/outline.types.d.ts +6 -0
- package/dist/types/outline.types.d.ts.map +1 -0
- package/dist/types/premium.types.d.ts +2 -2
- package/dist/types/premium.types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/outline.utils.cjs +1 -0
- package/dist/utils/outline.utils.d.ts +8 -0
- package/dist/utils/outline.utils.d.ts.map +1 -0
- package/dist/utils/outline.utils.js +49 -0
- package/dist/utils/slash.utils.cjs +1 -1
- package/dist/utils/slash.utils.d.ts +5 -0
- package/dist/utils/slash.utils.d.ts.map +1 -1
- package/dist/utils/slash.utils.js +24 -7
- package/dist/utils/words.utils.cjs +1 -0
- package/dist/utils/words.utils.d.ts +2 -0
- package/dist/utils/words.utils.d.ts.map +1 -0
- package/dist/utils/words.utils.js +14 -0
- package/package.json +1 -1
|
@@ -1,288 +1,300 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { INK_MIN_HEIGHT as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
16
|
-
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as
|
|
17
|
-
import { cn as
|
|
18
|
-
import { applyTypoAutoFix as
|
|
19
|
-
import { createInkId as
|
|
20
|
-
import { getTableCellFromSelection as
|
|
21
|
-
import { getBlockElement as
|
|
22
|
-
import { createTrackChange as
|
|
23
|
-
import { removeCommentMark as
|
|
24
|
-
import { InkHistoryStack as
|
|
25
|
-
import { extractSlashQuery as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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:
|
|
65
|
-
defaultValue:
|
|
66
|
-
onChange:
|
|
67
|
-
placeholder:
|
|
68
|
-
disabled:
|
|
69
|
-
readOnly:
|
|
70
|
-
minHeight:
|
|
71
|
-
maxHeight:
|
|
72
|
-
toolbar:
|
|
73
|
-
className:
|
|
74
|
-
testId:
|
|
75
|
-
allowImagePaste:
|
|
76
|
-
showCharCount:
|
|
77
|
-
charCountMax:
|
|
78
|
-
typoAutoFix:
|
|
79
|
-
variant:
|
|
80
|
-
chrome:
|
|
81
|
-
colorMode:
|
|
82
|
-
features:
|
|
83
|
-
author: w =
|
|
84
|
-
trackChanges:
|
|
85
|
-
onTrackChangesChange:
|
|
86
|
-
trackChangesEnabled:
|
|
87
|
-
onTrackChangesEnabledChange:
|
|
88
|
-
comments:
|
|
89
|
-
onCommentsChange:
|
|
90
|
-
showCommentsPanel:
|
|
91
|
-
onShowCommentsPanelChange:
|
|
92
|
-
ai:
|
|
93
|
-
slashCommands:
|
|
94
|
-
tableRows:
|
|
95
|
-
tableCols:
|
|
96
|
-
premium:
|
|
97
|
-
theme:
|
|
98
|
-
icons:
|
|
99
|
-
pasteMode:
|
|
100
|
-
onImageUpload:
|
|
101
|
-
wysiwyg:
|
|
102
|
-
keepInMemory:
|
|
103
|
-
memoryKey:
|
|
104
|
-
onToolbarChange:
|
|
105
|
-
toolbarHidden:
|
|
106
|
-
onToolbarHiddenChange:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
}),
|
|
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
|
-
}), [
|
|
121
|
+
x: f,
|
|
122
|
+
y: f
|
|
123
|
+
}), [Se, V] = a({
|
|
119
124
|
open: !1,
|
|
120
|
-
top:
|
|
121
|
-
left:
|
|
122
|
-
}), [
|
|
123
|
-
() =>
|
|
124
|
-
), [
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
(e) => e.visible || e.suggestion ? { visible: !1, suggestion: "", top:
|
|
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
|
-
},
|
|
131
|
-
if (!
|
|
132
|
-
|
|
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
|
-
|
|
142
|
+
R();
|
|
138
143
|
return;
|
|
139
144
|
}
|
|
140
|
-
|
|
145
|
+
we(), $(
|
|
141
146
|
(o) => o.visible || o.suggestion ? { ...o, visible: !1, suggestion: "" } : o
|
|
142
147
|
);
|
|
143
|
-
const t = (
|
|
144
|
-
|
|
145
|
-
if (
|
|
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 =
|
|
153
|
+
const r = Yi(n.current), s = _n(n.current);
|
|
149
154
|
if (!r.trim() || !s) return;
|
|
150
|
-
const
|
|
151
|
-
|
|
155
|
+
const T = W.current + 1;
|
|
156
|
+
W.current = T;
|
|
152
157
|
const N = n.current.innerHTML;
|
|
153
|
-
|
|
158
|
+
vi.runProvider(t, {
|
|
154
159
|
capability: "autocomplete",
|
|
155
160
|
html: N,
|
|
156
161
|
prompt: r,
|
|
157
|
-
modelId:
|
|
158
|
-
}).then((
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
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
|
|
176
|
+
const Kt = n.current && _n(n.current) || s;
|
|
172
177
|
$({
|
|
173
178
|
visible: !0,
|
|
174
|
-
suggestion:
|
|
175
|
-
top:
|
|
176
|
-
left:
|
|
179
|
+
suggestion: M,
|
|
180
|
+
top: Kt.top,
|
|
181
|
+
left: Kt.left
|
|
177
182
|
});
|
|
178
183
|
}).catch(() => {
|
|
179
|
-
|
|
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
|
-
},
|
|
191
|
+
}, Vi);
|
|
187
192
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}, []),
|
|
191
|
-
|
|
192
|
-
}, [
|
|
193
|
-
|
|
194
|
-
}, [
|
|
195
|
-
|
|
196
|
-
}, [
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
-
if (
|
|
204
|
-
|
|
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
|
-
|
|
208
|
-
}, [
|
|
209
|
-
if (!n.current ||
|
|
210
|
-
if (n.current.innerHTML ===
|
|
211
|
-
x.current =
|
|
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
|
-
|
|
216
|
-
n.current && (n.current.innerHTML =
|
|
217
|
-
}), x.current =
|
|
218
|
-
}, [
|
|
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 =
|
|
225
|
+
const e = y ? Ci(F) : "";
|
|
221
226
|
if (e) {
|
|
222
|
-
n.current.innerHTML = e, x.current = e,
|
|
227
|
+
n.current.innerHTML = e, x.current = e, q.current = new Ye(e), b == null || b(e);
|
|
223
228
|
return;
|
|
224
229
|
}
|
|
225
|
-
|
|
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
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
}),
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
if (e ===
|
|
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
|
-
|
|
251
|
+
Me.filter((r) => r !== jt)
|
|
242
252
|
);
|
|
243
|
-
t ? o.add(e) : o.delete(e),
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
if (
|
|
254
|
-
|
|
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 || !
|
|
259
|
-
|
|
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
|
-
|
|
274
|
+
V((s) => s.open ? { ...s, open: !1 } : s);
|
|
265
275
|
return;
|
|
266
276
|
}
|
|
267
|
-
const r =
|
|
277
|
+
const r = nc({
|
|
268
278
|
selectionRect: o,
|
|
269
|
-
toolbarWidth:
|
|
270
|
-
toolbarHeight:
|
|
279
|
+
toolbarWidth: Qi,
|
|
280
|
+
toolbarHeight: Ji,
|
|
271
281
|
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
272
|
-
gap:
|
|
273
|
-
edgePadding:
|
|
282
|
+
gap: ec,
|
|
283
|
+
edgePadding: Zi
|
|
274
284
|
});
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
const e =
|
|
279
|
-
|
|
280
|
-
const t =
|
|
281
|
-
if (
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
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
|
|
294
|
-
if (
|
|
295
|
-
const N =
|
|
296
|
-
|
|
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 (
|
|
301
|
-
const s = ((o = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : o.textContent) ?? "",
|
|
302
|
-
if (
|
|
303
|
-
|
|
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
|
|
307
|
-
|
|
308
|
-
top:
|
|
309
|
-
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
|
-
|
|
325
|
+
Ae(ue), se([]);
|
|
314
326
|
}
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
const e =
|
|
327
|
+
Pe ? Io() : R();
|
|
328
|
+
}, bt = () => {
|
|
329
|
+
const e = B.suggestion;
|
|
318
330
|
if (!e) {
|
|
319
|
-
|
|
331
|
+
R();
|
|
320
332
|
return;
|
|
321
333
|
}
|
|
322
|
-
|
|
323
|
-
},
|
|
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 =
|
|
327
|
-
o &&
|
|
328
|
-
},
|
|
329
|
-
if (!n.current || !
|
|
330
|
-
const e = n.current.innerHTML, t =
|
|
331
|
-
t.html !== e && (
|
|
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
|
-
}),
|
|
334
|
-
},
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
|
|
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
|
-
|
|
353
|
+
un(n.current, Ur), u();
|
|
342
354
|
return;
|
|
343
355
|
}
|
|
344
356
|
if (e === "directionRtl" && n.current) {
|
|
345
|
-
|
|
357
|
+
un(n.current, Hr), u();
|
|
346
358
|
return;
|
|
347
359
|
}
|
|
348
|
-
if (e ===
|
|
349
|
-
|
|
360
|
+
if (e === de) {
|
|
361
|
+
I($t), u();
|
|
350
362
|
return;
|
|
351
363
|
}
|
|
352
|
-
const t =
|
|
353
|
-
t && (t.value ?
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
if (
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
if (
|
|
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 && (
|
|
369
|
-
},
|
|
370
|
-
if (
|
|
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
|
|
377
|
-
|
|
388
|
+
const o = await Dt(t);
|
|
389
|
+
E(n.current), je(o, t.name), u();
|
|
378
390
|
}, e.click();
|
|
379
|
-
},
|
|
380
|
-
if (
|
|
381
|
-
|
|
382
|
-
const e =
|
|
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 =
|
|
385
|
-
|
|
396
|
+
const t = Ge("insert", e, w);
|
|
397
|
+
J([...S, t]), I(ln(e, t.id));
|
|
386
398
|
} else
|
|
387
|
-
|
|
399
|
+
I(e);
|
|
388
400
|
u();
|
|
389
|
-
},
|
|
390
|
-
const e =
|
|
401
|
+
}, Mt = () => {
|
|
402
|
+
const e = q.current.undo();
|
|
391
403
|
if (e === null || !n.current) {
|
|
392
|
-
|
|
404
|
+
p("undo"), u();
|
|
393
405
|
return;
|
|
394
406
|
}
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
const e =
|
|
407
|
+
H(e);
|
|
408
|
+
}, kt = () => {
|
|
409
|
+
const e = q.current.redo();
|
|
398
410
|
if (e === null || !n.current) {
|
|
399
|
-
|
|
411
|
+
p("redo"), u();
|
|
400
412
|
return;
|
|
401
413
|
}
|
|
402
|
-
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
},
|
|
408
|
-
if (
|
|
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 =
|
|
412
|
-
if (
|
|
413
|
-
const r =
|
|
414
|
-
|
|
415
|
-
},
|
|
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:
|
|
418
|
-
label:
|
|
419
|
-
onSelect: () =>
|
|
429
|
+
id: _r,
|
|
430
|
+
label: dr,
|
|
431
|
+
onSelect: () => Nt(!0)
|
|
420
432
|
},
|
|
421
433
|
{
|
|
422
|
-
id:
|
|
423
|
-
label:
|
|
424
|
-
onSelect: () =>
|
|
434
|
+
id: mr,
|
|
435
|
+
label: fr,
|
|
436
|
+
onSelect: () => Fe(!0)
|
|
425
437
|
}
|
|
426
|
-
],
|
|
427
|
-
const t =
|
|
438
|
+
], G = (e) => {
|
|
439
|
+
const t = Jt();
|
|
428
440
|
!t || !d.table || e(t) && u();
|
|
429
|
-
},
|
|
430
|
-
...d.table &&
|
|
441
|
+
}, wo = [
|
|
442
|
+
...d.table && po ? [
|
|
431
443
|
{
|
|
432
|
-
id:
|
|
433
|
-
label:
|
|
434
|
-
onSelect: () =>
|
|
444
|
+
id: ml,
|
|
445
|
+
label: fl,
|
|
446
|
+
onSelect: () => G((e) => en(e, "before"))
|
|
435
447
|
},
|
|
436
448
|
{
|
|
437
|
-
id:
|
|
438
|
-
label:
|
|
439
|
-
onSelect: () =>
|
|
449
|
+
id: El,
|
|
450
|
+
label: Tl,
|
|
451
|
+
onSelect: () => G((e) => en(e, "after"))
|
|
440
452
|
},
|
|
441
453
|
{
|
|
442
|
-
id:
|
|
443
|
-
label:
|
|
444
|
-
onSelect: () =>
|
|
454
|
+
id: Ol,
|
|
455
|
+
label: pl,
|
|
456
|
+
onSelect: () => G((e) => tn(e, "before"))
|
|
445
457
|
},
|
|
446
458
|
{
|
|
447
|
-
id:
|
|
448
|
-
label:
|
|
449
|
-
onSelect: () =>
|
|
459
|
+
id: Ll,
|
|
460
|
+
label: Cl,
|
|
461
|
+
onSelect: () => G((e) => tn(e, "after"))
|
|
450
462
|
},
|
|
451
463
|
{
|
|
452
|
-
id:
|
|
453
|
-
label:
|
|
454
|
-
onSelect: () =>
|
|
464
|
+
id: Il,
|
|
465
|
+
label: Nl,
|
|
466
|
+
onSelect: () => G((e) => Ql(e))
|
|
455
467
|
},
|
|
456
468
|
{
|
|
457
|
-
id:
|
|
458
|
-
label:
|
|
459
|
-
onSelect: () =>
|
|
469
|
+
id: hl,
|
|
470
|
+
label: Al,
|
|
471
|
+
onSelect: () => G((e) => Jl(e))
|
|
460
472
|
}
|
|
461
473
|
] : [],
|
|
462
474
|
{
|
|
463
|
-
id:
|
|
464
|
-
label:
|
|
465
|
-
onSelect: () =>
|
|
475
|
+
id: bl,
|
|
476
|
+
label: gl,
|
|
477
|
+
onSelect: () => L("bold")
|
|
466
478
|
},
|
|
467
479
|
{
|
|
468
|
-
id:
|
|
469
|
-
label:
|
|
470
|
-
onSelect: () =>
|
|
480
|
+
id: Dl,
|
|
481
|
+
label: Rl,
|
|
482
|
+
onSelect: () => L("italic")
|
|
471
483
|
},
|
|
472
484
|
{
|
|
473
|
-
id:
|
|
474
|
-
label:
|
|
475
|
-
onSelect: () =>
|
|
485
|
+
id: Sl,
|
|
486
|
+
label: Bl,
|
|
487
|
+
onSelect: () => L("underline")
|
|
476
488
|
},
|
|
477
489
|
{
|
|
478
|
-
id:
|
|
479
|
-
label:
|
|
480
|
-
onSelect: () =>
|
|
490
|
+
id: kl,
|
|
491
|
+
label: Ml,
|
|
492
|
+
onSelect: () => L("strikethrough")
|
|
481
493
|
},
|
|
482
494
|
{
|
|
483
|
-
id:
|
|
484
|
-
label:
|
|
485
|
-
onSelect: () =>
|
|
495
|
+
id: Hl,
|
|
496
|
+
label: Ul,
|
|
497
|
+
onSelect: () => L("heading2")
|
|
486
498
|
},
|
|
487
499
|
{
|
|
488
|
-
id:
|
|
489
|
-
label:
|
|
490
|
-
onSelect: () =>
|
|
500
|
+
id: wl,
|
|
501
|
+
label: Pl,
|
|
502
|
+
onSelect: () => L("bulletList")
|
|
491
503
|
},
|
|
492
504
|
{
|
|
493
|
-
id:
|
|
494
|
-
label:
|
|
495
|
-
onSelect: () =>
|
|
505
|
+
id: Fl,
|
|
506
|
+
label: yl,
|
|
507
|
+
onSelect: () => L("orderedList")
|
|
496
508
|
},
|
|
497
509
|
{
|
|
498
|
-
id:
|
|
499
|
-
label:
|
|
500
|
-
onSelect: () =>
|
|
510
|
+
id: vl,
|
|
511
|
+
label: Kl,
|
|
512
|
+
onSelect: () => xe()
|
|
501
513
|
},
|
|
502
514
|
{
|
|
503
|
-
id:
|
|
504
|
-
label:
|
|
505
|
-
onSelect: () =>
|
|
515
|
+
id: Xl,
|
|
516
|
+
label: xl,
|
|
517
|
+
onSelect: () => L("clearFormat")
|
|
506
518
|
},
|
|
507
519
|
{
|
|
508
|
-
id:
|
|
509
|
-
label:
|
|
520
|
+
id: Vl,
|
|
521
|
+
label: Wl,
|
|
510
522
|
disabled: !d.findReplace,
|
|
511
|
-
onSelect: () =>
|
|
523
|
+
onSelect: () => ae(!0)
|
|
512
524
|
},
|
|
513
525
|
{
|
|
514
|
-
id:
|
|
515
|
-
label:
|
|
526
|
+
id: Yl,
|
|
527
|
+
label: Gl,
|
|
516
528
|
disabled: !d.signature,
|
|
517
|
-
onSelect: () =>
|
|
529
|
+
onSelect: () => he(!0)
|
|
518
530
|
},
|
|
519
531
|
{
|
|
520
|
-
id:
|
|
521
|
-
label:
|
|
532
|
+
id: jl,
|
|
533
|
+
label: zl,
|
|
522
534
|
disabled: !d.comments,
|
|
523
|
-
onSelect: () =>
|
|
535
|
+
onSelect: () => Ut()
|
|
524
536
|
},
|
|
525
|
-
...
|
|
537
|
+
...ht ? [
|
|
526
538
|
{
|
|
527
|
-
id:
|
|
528
|
-
label:
|
|
529
|
-
onSelect: () =>
|
|
539
|
+
id: ur,
|
|
540
|
+
label: ar,
|
|
541
|
+
onSelect: () => Fe(!1)
|
|
530
542
|
}
|
|
531
543
|
] : []
|
|
532
|
-
],
|
|
544
|
+
], Ht = (e) => {
|
|
533
545
|
if (!n.current) return;
|
|
534
|
-
const t =
|
|
535
|
-
|
|
536
|
-
|
|
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
|
-
},
|
|
550
|
+
}, Pt = (e) => {
|
|
539
551
|
if (!n.current) return;
|
|
540
|
-
const t =
|
|
541
|
-
|
|
542
|
-
|
|
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
|
-
},
|
|
545
|
-
const t = await
|
|
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 =
|
|
548
|
-
|
|
559
|
+
const r = Ge("insert", o, w);
|
|
560
|
+
J([...S, r]), I(ln(o, r.id));
|
|
549
561
|
} else
|
|
550
|
-
|
|
562
|
+
je(t);
|
|
551
563
|
u();
|
|
552
|
-
},
|
|
553
|
-
if (
|
|
564
|
+
}, yo = async (e) => {
|
|
565
|
+
if (i || c) return;
|
|
554
566
|
const t = e.clipboardData;
|
|
555
567
|
if (!t) return;
|
|
556
|
-
if (
|
|
557
|
-
const r =
|
|
568
|
+
if (wn) {
|
|
569
|
+
const r = Ei(t);
|
|
558
570
|
if (r) {
|
|
559
571
|
e.preventDefault();
|
|
560
|
-
const
|
|
561
|
-
|
|
572
|
+
const T = pi(r);
|
|
573
|
+
T && (I(T), u());
|
|
562
574
|
const N = t.items;
|
|
563
|
-
if (
|
|
564
|
-
for (const
|
|
565
|
-
if (!
|
|
566
|
-
const
|
|
567
|
-
|
|
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 =
|
|
583
|
+
const s = Oi(t);
|
|
572
584
|
if (s) {
|
|
573
|
-
e.preventDefault(),
|
|
585
|
+
e.preventDefault(), I(s.replace(/\n/g, "<br />")), u();
|
|
574
586
|
return;
|
|
575
587
|
}
|
|
576
588
|
}
|
|
577
|
-
if (!
|
|
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
|
|
596
|
+
s && await wt(s);
|
|
585
597
|
}
|
|
586
|
-
},
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
if (e.key ===
|
|
590
|
-
e.preventDefault(),
|
|
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 ===
|
|
594
|
-
|
|
605
|
+
if (e.key === Or) {
|
|
606
|
+
R();
|
|
595
607
|
return;
|
|
596
608
|
}
|
|
597
|
-
if (
|
|
609
|
+
if (Hi(e.nativeEvent)) {
|
|
598
610
|
u();
|
|
599
611
|
return;
|
|
600
612
|
}
|
|
601
|
-
if (e.key ===
|
|
602
|
-
if (
|
|
603
|
-
e.preventDefault(),
|
|
613
|
+
if (e.key === Cr) {
|
|
614
|
+
if (B.visible) {
|
|
615
|
+
e.preventDefault(), R();
|
|
604
616
|
return;
|
|
605
617
|
}
|
|
606
|
-
|
|
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 ===
|
|
609
|
-
},
|
|
624
|
+
(e.metaKey || e.ctrlKey) && e.key === Nr && (e.preventDefault(), e.shiftKey ? kt() : Mt());
|
|
625
|
+
}, vo = (e) => {
|
|
610
626
|
var o;
|
|
611
|
-
|
|
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 (
|
|
633
|
+
switch (Ae(ue), se([]), e.insert) {
|
|
618
634
|
case "heading1":
|
|
619
|
-
|
|
635
|
+
p("formatBlock", ul);
|
|
620
636
|
break;
|
|
621
637
|
case "heading2":
|
|
622
|
-
|
|
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
|
-
|
|
647
|
+
p("insertUnorderedList");
|
|
626
648
|
break;
|
|
627
649
|
case "orderedList":
|
|
628
|
-
|
|
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
|
-
|
|
665
|
+
St();
|
|
666
|
+
return;
|
|
667
|
+
case "image":
|
|
668
|
+
Bt();
|
|
632
669
|
return;
|
|
633
670
|
case "ai":
|
|
634
|
-
|
|
671
|
+
ie(!0);
|
|
635
672
|
break;
|
|
636
673
|
}
|
|
637
674
|
u();
|
|
638
|
-
},
|
|
675
|
+
}, yt = (e) => {
|
|
639
676
|
if (!n.current) return;
|
|
640
|
-
const t = window.getSelection(), o =
|
|
641
|
-
o &&
|
|
642
|
-
},
|
|
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 =
|
|
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
|
-
|
|
650
|
-
},
|
|
651
|
-
if (!n.current || !
|
|
652
|
-
e.preventDefault(), e.dataTransfer.dropEffect =
|
|
653
|
-
const t =
|
|
654
|
-
if (!t || t ===
|
|
655
|
-
|
|
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 =
|
|
659
|
-
|
|
660
|
-
},
|
|
661
|
-
if (!n.current || !
|
|
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 =
|
|
664
|
-
t && t !== o && (
|
|
665
|
-
},
|
|
666
|
-
n.current &&
|
|
667
|
-
},
|
|
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__ */
|
|
706
|
+
return /* @__PURE__ */ l("span", { className: Zr }, `divider-${t}`);
|
|
670
707
|
if (e === "headingDropdown")
|
|
671
|
-
return /* @__PURE__ */
|
|
672
|
-
|
|
708
|
+
return /* @__PURE__ */ l(
|
|
709
|
+
fe,
|
|
673
710
|
{
|
|
674
711
|
title: "Heading",
|
|
675
|
-
options:
|
|
676
|
-
value:
|
|
677
|
-
disabled:
|
|
678
|
-
onChange:
|
|
712
|
+
options: Qr,
|
|
713
|
+
value: Fn || "p",
|
|
714
|
+
disabled: i || c,
|
|
715
|
+
onChange: Bo
|
|
679
716
|
},
|
|
680
717
|
"heading"
|
|
681
718
|
);
|
|
682
|
-
if (e ===
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
-
|
|
719
|
+
if (e === Xt)
|
|
720
|
+
return /* @__PURE__ */ l(
|
|
721
|
+
fe,
|
|
685
722
|
{
|
|
686
|
-
title:
|
|
687
|
-
options:
|
|
688
|
-
value:
|
|
689
|
-
disabled:
|
|
690
|
-
onChange:
|
|
723
|
+
title: hr,
|
|
724
|
+
options: Ar,
|
|
725
|
+
value: _o,
|
|
726
|
+
disabled: i || c,
|
|
727
|
+
onChange: So
|
|
691
728
|
},
|
|
692
|
-
|
|
729
|
+
Xt
|
|
693
730
|
);
|
|
694
|
-
if (e ===
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
|
|
731
|
+
if (e === Wt)
|
|
732
|
+
return /* @__PURE__ */ l(
|
|
733
|
+
fe,
|
|
697
734
|
{
|
|
698
|
-
title:
|
|
699
|
-
options:
|
|
700
|
-
value:
|
|
701
|
-
disabled:
|
|
702
|
-
onChange:
|
|
735
|
+
title: Rr,
|
|
736
|
+
options: br,
|
|
737
|
+
value: mo,
|
|
738
|
+
disabled: i || c,
|
|
739
|
+
onChange: Mo
|
|
703
740
|
},
|
|
704
|
-
|
|
741
|
+
Wt
|
|
705
742
|
);
|
|
706
743
|
if (e === "textColor")
|
|
707
|
-
return /* @__PURE__ */
|
|
708
|
-
|
|
744
|
+
return /* @__PURE__ */ l(
|
|
745
|
+
dn,
|
|
709
746
|
{
|
|
710
747
|
title: "Text color",
|
|
711
748
|
type: "text",
|
|
712
|
-
value:
|
|
713
|
-
disabled:
|
|
749
|
+
value: qn,
|
|
750
|
+
disabled: i || c,
|
|
714
751
|
onChange: (r) => {
|
|
715
|
-
|
|
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__ */
|
|
722
|
-
|
|
758
|
+
return /* @__PURE__ */ l(
|
|
759
|
+
dn,
|
|
723
760
|
{
|
|
724
761
|
title: "Highlight color",
|
|
725
762
|
type: "highlight",
|
|
726
|
-
value:
|
|
727
|
-
disabled:
|
|
763
|
+
value: Zn,
|
|
764
|
+
disabled: i || c,
|
|
728
765
|
onChange: (r) => {
|
|
729
|
-
|
|
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__ */
|
|
736
|
-
|
|
772
|
+
return /* @__PURE__ */ l(
|
|
773
|
+
O,
|
|
737
774
|
{
|
|
738
775
|
icon: m.link,
|
|
739
776
|
title: "Insert link",
|
|
740
|
-
disabled:
|
|
741
|
-
onClick:
|
|
777
|
+
disabled: i || c,
|
|
778
|
+
onClick: xe
|
|
742
779
|
},
|
|
743
780
|
"link"
|
|
744
781
|
);
|
|
745
782
|
if (e === "image")
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
|
|
783
|
+
return /* @__PURE__ */ l(
|
|
784
|
+
O,
|
|
748
785
|
{
|
|
749
786
|
icon: m.image,
|
|
750
787
|
title: "Insert image",
|
|
751
|
-
disabled:
|
|
788
|
+
disabled: i || c,
|
|
752
789
|
onClick: () => {
|
|
753
|
-
|
|
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__ */
|
|
760
|
-
|
|
807
|
+
return d.table ? /* @__PURE__ */ l(
|
|
808
|
+
O,
|
|
761
809
|
{
|
|
762
810
|
icon: m.table,
|
|
763
811
|
title: "Insert table",
|
|
764
|
-
disabled:
|
|
765
|
-
onClick:
|
|
812
|
+
disabled: i || c,
|
|
813
|
+
onClick: St
|
|
766
814
|
},
|
|
767
815
|
"table"
|
|
768
816
|
) : null;
|
|
769
|
-
if (e ===
|
|
770
|
-
return d.signature ? /* @__PURE__ */
|
|
771
|
-
|
|
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:
|
|
776
|
-
disabled:
|
|
777
|
-
onClick: () =>
|
|
823
|
+
active: Et,
|
|
824
|
+
disabled: i || c,
|
|
825
|
+
onClick: () => he(!0)
|
|
778
826
|
},
|
|
779
|
-
|
|
827
|
+
Vt
|
|
780
828
|
) : null;
|
|
781
|
-
if (e ===
|
|
782
|
-
return d.findReplace ? /* @__PURE__ */
|
|
783
|
-
|
|
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:
|
|
788
|
-
disabled:
|
|
835
|
+
active: ge,
|
|
836
|
+
disabled: i || c,
|
|
789
837
|
onClick: () => {
|
|
790
|
-
|
|
838
|
+
ge ? ae(!1) : Rt(_e);
|
|
791
839
|
}
|
|
792
840
|
},
|
|
793
|
-
|
|
841
|
+
Gt
|
|
794
842
|
) : null;
|
|
795
|
-
if (e ===
|
|
796
|
-
return d.findReplace ? /* @__PURE__ */
|
|
797
|
-
|
|
843
|
+
if (e === Yt)
|
|
844
|
+
return d.findReplace ? /* @__PURE__ */ l(
|
|
845
|
+
fe,
|
|
798
846
|
{
|
|
799
|
-
title:
|
|
800
|
-
options:
|
|
801
|
-
value:
|
|
802
|
-
disabled:
|
|
803
|
-
onChange:
|
|
847
|
+
title: Br,
|
|
848
|
+
options: Dr,
|
|
849
|
+
value: To,
|
|
850
|
+
disabled: i || c,
|
|
851
|
+
onChange: ko
|
|
804
852
|
},
|
|
805
|
-
|
|
853
|
+
Yt
|
|
806
854
|
) : null;
|
|
807
|
-
if (e ===
|
|
808
|
-
return d.horizontalRule ? /* @__PURE__ */
|
|
809
|
-
|
|
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:
|
|
861
|
+
disabled: i || c,
|
|
814
862
|
onClick: () => {
|
|
815
|
-
|
|
863
|
+
E(n.current), I("<hr />"), u();
|
|
816
864
|
}
|
|
817
865
|
},
|
|
818
|
-
|
|
866
|
+
zt
|
|
819
867
|
) : null;
|
|
820
868
|
if (e === "undo")
|
|
821
|
-
return /* @__PURE__ */
|
|
822
|
-
|
|
869
|
+
return /* @__PURE__ */ l(
|
|
870
|
+
O,
|
|
823
871
|
{
|
|
824
872
|
icon: m.undo,
|
|
825
873
|
title: "Undo",
|
|
826
|
-
disabled:
|
|
827
|
-
onClick:
|
|
874
|
+
disabled: i || c,
|
|
875
|
+
onClick: Mt
|
|
828
876
|
},
|
|
829
877
|
"undo"
|
|
830
878
|
);
|
|
831
879
|
if (e === "redo")
|
|
832
|
-
return /* @__PURE__ */
|
|
833
|
-
|
|
880
|
+
return /* @__PURE__ */ l(
|
|
881
|
+
O,
|
|
834
882
|
{
|
|
835
883
|
icon: m.redo,
|
|
836
884
|
title: "Redo",
|
|
837
|
-
disabled:
|
|
838
|
-
onClick:
|
|
885
|
+
disabled: i || c,
|
|
886
|
+
onClick: kt
|
|
839
887
|
},
|
|
840
888
|
"redo"
|
|
841
889
|
);
|
|
842
890
|
if (e === "trackChanges")
|
|
843
|
-
return d.trackChanges ? /* @__PURE__ */
|
|
844
|
-
|
|
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:
|
|
850
|
-
onClick: () =>
|
|
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__ */
|
|
856
|
-
|
|
903
|
+
return d.comments ? /* @__PURE__ */ l(
|
|
904
|
+
O,
|
|
857
905
|
{
|
|
858
906
|
icon: m.comments,
|
|
859
907
|
title: "Comments",
|
|
860
|
-
active:
|
|
861
|
-
disabled:
|
|
908
|
+
active: ke,
|
|
909
|
+
disabled: i || c,
|
|
862
910
|
onClick: () => {
|
|
863
|
-
|
|
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 || !(
|
|
870
|
-
|
|
935
|
+
return !d.ai || !(_ != null && _.enabled) ? null : /* @__PURE__ */ D(
|
|
936
|
+
"button",
|
|
871
937
|
{
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
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 =
|
|
881
|
-
return o ? /* @__PURE__ */
|
|
882
|
-
|
|
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:
|
|
887
|
-
disabled:
|
|
888
|
-
onClick: () =>
|
|
961
|
+
active: Ie.has(e),
|
|
962
|
+
disabled: i || c,
|
|
963
|
+
onClick: () => L(e)
|
|
889
964
|
},
|
|
890
965
|
e
|
|
891
966
|
) : null;
|
|
892
|
-
},
|
|
893
|
-
return /* @__PURE__ */
|
|
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:
|
|
897
|
-
"data-testid":
|
|
898
|
-
"data-disabled":
|
|
899
|
-
"data-variant":
|
|
900
|
-
"data-chrome":
|
|
901
|
-
"data-color-mode":
|
|
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":
|
|
904
|
-
style: { ...
|
|
905
|
-
...
|
|
978
|
+
"data-wysiwyg": Hn || void 0,
|
|
979
|
+
style: { ...Pn, ...Dn },
|
|
980
|
+
...Bn,
|
|
906
981
|
children: [
|
|
907
|
-
|
|
908
|
-
|
|
982
|
+
ht ? /* @__PURE__ */ l("div", { className: Vr, children: /* @__PURE__ */ l(
|
|
983
|
+
Di,
|
|
909
984
|
{
|
|
910
985
|
type: "button",
|
|
911
|
-
"aria-label":
|
|
912
|
-
onClick: () =>
|
|
913
|
-
children:
|
|
986
|
+
"aria-label": cr,
|
|
987
|
+
onClick: () => Fe(!1),
|
|
988
|
+
children: ir
|
|
914
989
|
}
|
|
915
|
-
) }) : /* @__PURE__ */
|
|
990
|
+
) }) : /* @__PURE__ */ l(
|
|
916
991
|
"div",
|
|
917
992
|
{
|
|
918
|
-
className:
|
|
993
|
+
className: Gr,
|
|
919
994
|
role: "toolbar",
|
|
920
995
|
"aria-label": "Ink formatting toolbar",
|
|
921
|
-
onContextMenu:
|
|
922
|
-
children:
|
|
996
|
+
onContextMenu: Ho,
|
|
997
|
+
children: Me.map(Go)
|
|
923
998
|
}
|
|
924
999
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
|
|
1000
|
+
/* @__PURE__ */ l(
|
|
1001
|
+
sc,
|
|
927
1002
|
{
|
|
928
|
-
open:
|
|
929
|
-
options:
|
|
930
|
-
visibleItems:
|
|
931
|
-
onToggle:
|
|
932
|
-
onClose: () =>
|
|
1003
|
+
open: Co,
|
|
1004
|
+
options: No,
|
|
1005
|
+
visibleItems: Me,
|
|
1006
|
+
onToggle: ho,
|
|
1007
|
+
onClose: () => Nt(!1)
|
|
933
1008
|
}
|
|
934
1009
|
),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
|
|
1010
|
+
/* @__PURE__ */ l(
|
|
1011
|
+
ic,
|
|
937
1012
|
{
|
|
938
|
-
open:
|
|
939
|
-
onClose: () =>
|
|
1013
|
+
open: Et,
|
|
1014
|
+
onClose: () => he(!1),
|
|
940
1015
|
onConfirm: (e) => {
|
|
941
|
-
|
|
1016
|
+
E(n.current), je(e), u();
|
|
942
1017
|
}
|
|
943
1018
|
}
|
|
944
1019
|
),
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
|
|
1020
|
+
/* @__PURE__ */ l(
|
|
1021
|
+
cc,
|
|
947
1022
|
{
|
|
948
|
-
open:
|
|
949
|
-
focusField:
|
|
950
|
-
onClose: () =>
|
|
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 =
|
|
954
|
-
|
|
1028
|
+
const r = Ni(n.current.innerHTML, e, t, o);
|
|
1029
|
+
H(r);
|
|
955
1030
|
}
|
|
956
1031
|
}
|
|
957
1032
|
),
|
|
958
|
-
X && d.trackChanges ? /* @__PURE__ */
|
|
959
|
-
|
|
1033
|
+
X && d.trackChanges ? /* @__PURE__ */ l(
|
|
1034
|
+
lc,
|
|
960
1035
|
{
|
|
961
|
-
changes:
|
|
962
|
-
onAccept:
|
|
963
|
-
onReject:
|
|
964
|
-
onAcceptAll: () =>
|
|
965
|
-
onRejectAll: () =>
|
|
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
|
-
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
|
|
972
|
-
|
|
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:
|
|
975
|
-
top:
|
|
976
|
-
onMoveUp: () =>
|
|
977
|
-
onMoveDown: () =>
|
|
978
|
-
onDragStart:
|
|
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__ */
|
|
1066
|
+
/* @__PURE__ */ l(
|
|
982
1067
|
"div",
|
|
983
1068
|
{
|
|
984
1069
|
ref: n,
|
|
985
|
-
className:
|
|
986
|
-
contentEditable: !
|
|
1070
|
+
className: jr,
|
|
1071
|
+
contentEditable: !i && !c,
|
|
987
1072
|
role: "textbox",
|
|
988
1073
|
"aria-multiline": "true",
|
|
989
|
-
"aria-placeholder":
|
|
990
|
-
"data-placeholder":
|
|
1074
|
+
"aria-placeholder": $e,
|
|
1075
|
+
"data-placeholder": $e,
|
|
991
1076
|
suppressContentEditableWarning: !0,
|
|
992
|
-
style: { minHeight:
|
|
1077
|
+
style: { minHeight: Yo, maxHeight: zo },
|
|
993
1078
|
onInput: u,
|
|
994
|
-
onBlur:
|
|
995
|
-
onKeyUp:
|
|
996
|
-
onKeyDown:
|
|
997
|
-
onMouseUp:
|
|
998
|
-
onContextMenu:
|
|
999
|
-
onDragOver:
|
|
1000
|
-
onDrop:
|
|
1001
|
-
onDragEnd:
|
|
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
|
-
|
|
1088
|
+
yo(e);
|
|
1004
1089
|
}
|
|
1005
1090
|
}
|
|
1006
1091
|
),
|
|
1007
|
-
|
|
1008
|
-
|
|
1092
|
+
At ? /* @__PURE__ */ l(
|
|
1093
|
+
oc,
|
|
1009
1094
|
{
|
|
1010
|
-
items:
|
|
1011
|
-
top:
|
|
1012
|
-
left:
|
|
1013
|
-
|
|
1095
|
+
items: co,
|
|
1096
|
+
top: Tt.top,
|
|
1097
|
+
left: Tt.left,
|
|
1098
|
+
query: jn,
|
|
1099
|
+
onSelect: vo
|
|
1014
1100
|
}
|
|
1015
1101
|
) : null,
|
|
1016
|
-
|
|
1017
|
-
|
|
1102
|
+
Pe ? /* @__PURE__ */ l(
|
|
1103
|
+
Wi,
|
|
1018
1104
|
{
|
|
1019
|
-
suggestion:
|
|
1020
|
-
position: { top:
|
|
1021
|
-
visible:
|
|
1022
|
-
onAccept:
|
|
1023
|
-
onDismiss:
|
|
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__ */
|
|
1027
|
-
|
|
1112
|
+
/* @__PURE__ */ l(
|
|
1113
|
+
$i,
|
|
1028
1114
|
{
|
|
1029
|
-
open:
|
|
1030
|
-
top:
|
|
1031
|
-
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:
|
|
1041
|
-
disabled:
|
|
1042
|
-
onFormat:
|
|
1043
|
-
onLink:
|
|
1044
|
-
onClose: () =>
|
|
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__ */
|
|
1048
|
-
|
|
1133
|
+
/* @__PURE__ */ l(
|
|
1134
|
+
an,
|
|
1049
1135
|
{
|
|
1050
|
-
open:
|
|
1051
|
-
x:
|
|
1052
|
-
y:
|
|
1053
|
-
items:
|
|
1054
|
-
colorMode:
|
|
1136
|
+
open: be.open,
|
|
1137
|
+
x: be.x,
|
|
1138
|
+
y: be.y,
|
|
1139
|
+
items: wo,
|
|
1140
|
+
colorMode: He,
|
|
1055
1141
|
onClose: () => {
|
|
1056
|
-
|
|
1142
|
+
Ot(!1), Re((e) => ({ ...e, open: !1 }));
|
|
1057
1143
|
}
|
|
1058
1144
|
}
|
|
1059
1145
|
),
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
|
|
1146
|
+
/* @__PURE__ */ l(
|
|
1147
|
+
an,
|
|
1062
1148
|
{
|
|
1063
|
-
open:
|
|
1064
|
-
x:
|
|
1065
|
-
y:
|
|
1066
|
-
items:
|
|
1067
|
-
colorMode:
|
|
1068
|
-
onClose: () =>
|
|
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
|
-
|
|
1073
|
-
|
|
1158
|
+
ke && d.comments ? /* @__PURE__ */ l(
|
|
1159
|
+
xi,
|
|
1074
1160
|
{
|
|
1075
|
-
comments:
|
|
1161
|
+
comments: Q,
|
|
1076
1162
|
author: w,
|
|
1077
|
-
onClose: () =>
|
|
1163
|
+
onClose: () => ve(!1),
|
|
1078
1164
|
onResolve: (e) => {
|
|
1079
|
-
const t =
|
|
1080
|
-
|
|
1081
|
-
|
|
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 &&
|
|
1170
|
+
), t && n.current && H(ci(n.current.innerHTML, t.highlightId));
|
|
1085
1171
|
},
|
|
1086
1172
|
onAddReply: (e, t) => {
|
|
1087
|
-
|
|
1088
|
-
|
|
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:
|
|
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
|
-
|
|
1107
|
-
|
|
1192
|
+
jo && _ ? /* @__PURE__ */ l(
|
|
1193
|
+
Xi,
|
|
1108
1194
|
{
|
|
1109
|
-
config:
|
|
1110
|
-
documentHtml: ((
|
|
1111
|
-
selectionHtml:
|
|
1112
|
-
onBusyChange:
|
|
1113
|
-
onClose: () =>
|
|
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 (
|
|
1116
|
-
|
|
1201
|
+
if (E(n.current), ft)
|
|
1202
|
+
I(e);
|
|
1117
1203
|
else {
|
|
1118
|
-
|
|
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
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
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
|
-
|
|
1243
|
+
fs as InkEditor
|
|
1136
1244
|
};
|