@forgedevstack/ink 1.1.8 → 1.1.9
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 +9 -0
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +845 -830
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +96 -82
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +82 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +65 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +35 -34
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +39 -55
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
- package/dist/components/InkEditor/components/index.d.ts +4 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkTabs/InkTabs.cjs +1 -0
- package/dist/components/InkTabs/InkTabs.d.ts +4 -0
- package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
- package/dist/components/InkTabs/InkTabs.js +104 -0
- package/dist/components/InkTabs/index.d.ts +2 -0
- package/dist/components/InkTabs/index.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.js +317 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +72 -0
- package/dist/components/InkWorkspace/index.d.ts +4 -0
- package/dist/components/InkWorkspace/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/constants/collab.const.cjs +1 -0
- package/dist/constants/collab.const.d.ts +20 -0
- package/dist/constants/collab.const.d.ts.map +1 -0
- package/dist/constants/collab.const.js +54 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.js +42 -37
- package/dist/constants/workspace.const.cjs +1 -0
- package/dist/constants/workspace.const.d.ts +24 -0
- package/dist/constants/workspace.const.d.ts.map +1 -0
- package/dist/constants/workspace.const.js +23 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useInkCollaboration.cjs +1 -0
- package/dist/hooks/useInkCollaboration.d.ts +4 -0
- package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
- package/dist/hooks/useInkCollaboration.js +86 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +150 -135
- package/dist/plugins/theme/inkTheme.cjs +1 -1
- package/dist/plugins/theme/inkTheme.js +19 -22
- package/dist/styles.css +1 -1
- package/dist/types/collab.types.d.ts +55 -0
- package/dist/types/collab.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +4 -0
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/workspace.types.d.ts +54 -0
- package/dist/types/workspace.types.d.ts.map +1 -0
- package/dist/utils/collab.utils.cjs +1 -0
- package/dist/utils/collab.utils.d.ts +5 -0
- package/dist/utils/collab.utils.d.ts.map +1 -0
- package/dist/utils/collab.utils.js +32 -0
- package/dist/utils/collab.utils.test.d.ts +2 -0
- package/dist/utils/collab.utils.test.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ink.brand.test.d.ts +2 -0
- package/dist/utils/ink.brand.test.d.ts.map +1 -0
- package/dist/utils/workspace.utils.cjs +1 -0
- package/dist/utils/workspace.utils.d.ts +5 -0
- package/dist/utils/workspace.utils.d.ts.map +1 -0
- package/dist/utils/workspace.utils.js +26 -0
- package/dist/utils/workspace.utils.test.d.ts +2 -0
- package/dist/utils/workspace.utils.test.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,191 +1,196 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { INK_MIN_HEIGHT as
|
|
4
|
-
import { EMPTY_STRING as
|
|
5
|
-
import { TOOLBAR_OPTION_FONT_DROPDOWN as
|
|
6
|
-
import { TOOLBAR_SHOW_CONTROL_LABEL as
|
|
7
|
-
import { INK_DEFAULT_COLOR_MODE as
|
|
8
|
-
import { KEY_TAB as
|
|
9
|
-
import { FONT_VALUE_SYSTEM as
|
|
10
|
-
import { LIST_VALUE_BULLET as
|
|
11
|
-
import { FIND_REPLACE_FOCUS_FIND as
|
|
12
|
-
import { BLOCK_DROP_POSITION_BEFORE as
|
|
13
|
-
import { INK_PLACEHOLDER_DEFAULT as
|
|
14
|
-
import { INK_AI_DEMO_PROVIDER_ID as
|
|
1
|
+
import { jsxs as B, jsx as r, Fragment as dl } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as D, useState as c, useEffect as S } from "react";
|
|
3
|
+
import { INK_MIN_HEIGHT as Tl, NUMBER_ZERO as p, NUMBER_ONE as Cn, INK_DEFAULT_TEXT_COLOR as fl, INK_DEFAULT_HIGHLIGHT_COLOR as El, INK_TABLE_COL_RESIZE_EDGE_PX as Nn } from "../../constants/numbers.js";
|
|
4
|
+
import { EMPTY_STRING as M, INK_TOOLBAR_MORE_TITLE as In, CONTEXT_MENU_LABEL_GRAPH_BAR as ml, CONTEXT_MENU_ID_GRAPH_BAR as pl, CONTEXT_MENU_LABEL_GRAPH_LINE as Ll, CONTEXT_MENU_ID_GRAPH_LINE as Ol, CONTEXT_MENU_LABEL_GRAPH_PIE as Cl, CONTEXT_MENU_ID_GRAPH_PIE as Nl, CONTEXT_MENU_LABEL_GRAPH_EDIT as Il, CONTEXT_MENU_ID_GRAPH_EDIT as Al, CONTEXT_MENU_LABEL_GRAPH_COLORS as hl, CONTEXT_MENU_ID_GRAPH_COLORS as gl, CONTEXT_MENU_LABEL_GRAPH_AI as Rl, CONTEXT_MENU_ID_GRAPH_AI as bl, INK_FOOTER_WORDS_LABEL as Sl, INK_FOOTER_DOT as Bl, INK_FOOTER_CHARS_LABEL as Dl, INK_FOOTER_LINE_LABEL as Ml, INK_FOOTER_COL_LABEL as Hl, INK_FOOTER_SYNCED_LABEL as kl, INK_FULLSCREEN_EXIT_TITLE as Pl, INK_FULLSCREEN_TITLE as Ul, INK_OUTLINE_TOGGLE_TITLE as vl, INK_HTML_SOURCE_TITLE as wl, INK_HTML_SOURCE_LABEL as Kl, INK_CODE_LABEL as Fl, INK_AI_PILL_LABEL as ut, INK_TITLES_DEFAULT_TEXT as An, INK_LINK_PROMPT as yl, INK_LINK_PROMPT_DEFAULT as xl } from "../../constants/generals.const.js";
|
|
5
|
+
import { TOOLBAR_OPTION_FONT_DROPDOWN as hn, TOOLBAR_OPTION_LIST_DROPDOWN as gn, TOOLBAR_OPTION_CHECKLIST as Re, TOOLBAR_OPTION_TITLES as Rn, TOOLBAR_OPTION_EXCEL as bn, TOOLBAR_OPTION_GRAPH as Sn, TOOLBAR_OPTION_THEME as Bn, TOOLBAR_OPTION_FULLSCREEN as Dn, TOOLBAR_OPTION_OUTLINE as Mn, TOOLBAR_OPTION_HTML_SOURCE as Hn, TOOLBAR_OPTION_SIGNATURE as kn, TOOLBAR_OPTION_FIND_REPLACE as Pn, TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN as Un, TOOLBAR_OPTION_HORIZONTAL_RULE as vn } from "../../constants/toolbar.const.js";
|
|
6
|
+
import { TOOLBAR_SHOW_CONTROL_LABEL as Xl, TOOLBAR_SHOW_CONTROL_ARIA_LABEL as Gl, AGENT_BAR_PLACEHOLDER as Wl, CONTEXT_MENU_LABEL_SHOW_TOOLBAR as Vl, CONTEXT_MENU_ID_SHOW_TOOLBAR as Yl, TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE as zl, TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE as $l, TOOLBAR_CONTEXT_MENU_LABEL_HIDE as ql, TOOLBAR_CONTEXT_MENU_ID_HIDE as jl, TOOLBAR_OPTION_HINTS as O, TOOLBAR_OPTION_DIVIDER as wn } from "../../constants/toolbarMenu.const.js";
|
|
7
|
+
import { INK_DEFAULT_COLOR_MODE as Zl, COLOR_MODE_SYSTEM as Ql } from "../../constants/colorMode.const.js";
|
|
8
|
+
import { KEY_TAB as Jl, KEY_ENTER as ei, KEY_ESCAPE as ti, KEY_K as ni, KEY_Z as oi } from "../../constants/keyboard.const.js";
|
|
9
|
+
import { FONT_VALUE_SYSTEM as ri, INK_FONT_OPTIONS as li, FONT_DROPDOWN_TITLE as ii } from "../../constants/fonts.const.js";
|
|
10
|
+
import { LIST_VALUE_BULLET as ci, INK_LIST_OPTIONS as si, LIST_DROPDOWN_TITLE as ai } from "../../constants/lists.const.js";
|
|
11
|
+
import { FIND_REPLACE_FOCUS_FIND as be, INK_FIND_REPLACE_OPTIONS as ui, FIND_REPLACE_DROPDOWN_TITLE as _i, FIND_REPLACE_FOCUS_REPLACE as di, FIND_REPLACE_VALUE_REPLACE as Ti } from "../../constants/findReplaceMenu.const.js";
|
|
12
|
+
import { BLOCK_DROP_POSITION_BEFORE as fi, DIR_LTR as Ei, DIR_RTL as mi } from "../../constants/blocks.const.js";
|
|
13
|
+
import { INK_PLACEHOLDER_DEFAULT as pi, INK_DEFAULT_VARIANT as Li, INK_DEFAULT_CHROME as Oi, INK_DEFAULT_AUTHOR as Ci, INK_TABLE_DEFAULT_ROWS as Ni, INK_TABLE_DEFAULT_COLS as Ii, INK_DEFAULT_FEATURES as Ai, INK_CHROME_TOOLBAR as hi, INK_DEFAULT_TOOLBAR as gi, INK_VARIANT_DOCUMENT as Kn, INK_CLASS_TOOLBAR_SHOW as Ri, INK_CLASS_TOOLBAR as bi, INK_CLASS_TOOLBAR_MEASURE as Si, INK_CLASS_TOOLBAR_ROW as Bi, INK_ATTR_MORE as Di, INK_CLASS_TOOLBAR_OVERFLOW as Mi, INK_CLASS_TOOLBAR_HINT as Hi, INK_CLASS_SHELL as ki, INK_CLASS_BODY as Pi, INK_CLASS_CONTENT as Fn, INK_CLASS_CONTENT_HIDDEN as Ui, INK_CLASS_FOOTER as vi, INK_CLASS_FOOTER_META as wi, INK_CLASS_TABLE_RESIZE as Te, INK_CLASS_DIVIDER as Ki, INK_HEADING_OPTIONS as Fi, INK_CLASS_BUTTON_WIDE as yn, INK_CLASS_BUTTON_LABEL as xn, INK_BUTTON_CONFIG as _t, INK_CLASS_AI_PILL as Xn, INK_CLASS_AI_PILL_INSTALLED as yi, INK_CLASS_AI_PILL_DOT as xi, INK_ATTR_GRAPH as Xi, INK_CLASS_BLOCK_ACTIVE as Gi, INK_ATTR_GRAPH_POINTS as Gn, INK_ATTR_GRAPH_COLORS as Wi, INK_CHECKLIST_HTML as Wn, INK_CALLOUT_HTML as Vi, INK_FORMAT_BLOCK_PRE as Yi, INK_FORMAT_BLOCK_QUOTE as zi, INK_FORMAT_BLOCK_P as $i, INK_FORMAT_BLOCK_H3 as qi, INK_FORMAT_BLOCK_H2 as ji, INK_FORMAT_BLOCK_H1 as Zi, INK_CLASS_ROOT as Qi } from "../../constants/defaults.const.js";
|
|
14
|
+
import { INK_AI_DEMO_PROVIDER_ID as Ji } from "../../constants/aiModels.const.js";
|
|
15
15
|
import "../../constants/openai.const.js";
|
|
16
|
-
import { INK_DEFAULT_ICONS as
|
|
17
|
-
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as
|
|
18
|
-
import { TABLE_CELL_SELECTOR as
|
|
19
|
-
import { cn as
|
|
20
|
-
import { applyTypoAutoFix as
|
|
21
|
-
import { createInkId as
|
|
22
|
-
import { getColumnResizeIndex as
|
|
23
|
-
import { getBlockElement as
|
|
24
|
-
import { createTrackChange as
|
|
25
|
-
import { removeCommentMark as
|
|
26
|
-
import { InkHistoryStack as
|
|
27
|
-
import { extractSlashQuery as
|
|
28
|
-
import { countWords as
|
|
29
|
-
import { collectOutlineItems as
|
|
30
|
-
import { resolveInkPremium as
|
|
31
|
-
import { extractClipboardHtml as
|
|
32
|
-
import { readInkMemory as
|
|
33
|
-
import { replaceInHtml as
|
|
34
|
-
import { withPreservedSelection as
|
|
35
|
-
import { readToolbarItems as
|
|
36
|
-
import { TITLE_STYLE_DEFAULT as
|
|
37
|
-
import { buildTitleHtml as
|
|
38
|
-
import { excelGridToTableHtml as
|
|
39
|
-
import { GRAPH_SAMPLE as
|
|
40
|
-
import { parseGraphColors as
|
|
41
|
-
import { THEME_DEFAULT as
|
|
42
|
-
import { applyInkTheme as
|
|
43
|
-
import { inkPlugins as
|
|
44
|
-
import { useToolbarOverflow as
|
|
45
|
-
import { Button as
|
|
46
|
-
import { ContextMenu as
|
|
47
|
-
import { insertImage as
|
|
48
|
-
import { inkAi as
|
|
16
|
+
import { INK_DEFAULT_ICONS as Vn } from "../../constants/defaultIcons.js";
|
|
17
|
+
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as ec, CONTEXT_MENU_ID_TABLE_ROW_ABOVE as tc, CONTEXT_MENU_LABEL_TABLE_ROW_BELOW as nc, CONTEXT_MENU_ID_TABLE_ROW_BELOW as oc, CONTEXT_MENU_LABEL_TABLE_COL_LEFT as rc, CONTEXT_MENU_ID_TABLE_COL_LEFT as lc, CONTEXT_MENU_LABEL_TABLE_COL_RIGHT as ic, CONTEXT_MENU_ID_TABLE_COL_RIGHT as cc, CONTEXT_MENU_LABEL_TABLE_DELETE_ROW as sc, CONTEXT_MENU_ID_TABLE_DELETE_ROW as ac, CONTEXT_MENU_LABEL_TABLE_DELETE_COL as uc, CONTEXT_MENU_ID_TABLE_DELETE_COL as _c, CONTEXT_MENU_LABEL_TABLE_HEADER as dc, CONTEXT_MENU_ID_TABLE_HEADER as Tc, CONTEXT_MENU_LABEL_BOLD as fc, CONTEXT_MENU_ID_BOLD as Ec, CONTEXT_MENU_LABEL_ITALIC as mc, CONTEXT_MENU_ID_ITALIC as pc, CONTEXT_MENU_LABEL_UNDERLINE as Lc, CONTEXT_MENU_ID_UNDERLINE as Oc, CONTEXT_MENU_LABEL_STRIKE as Cc, CONTEXT_MENU_ID_STRIKE as Nc, CONTEXT_MENU_LABEL_HEADING as Ic, CONTEXT_MENU_ID_HEADING as Ac, CONTEXT_MENU_LABEL_BULLET as hc, CONTEXT_MENU_ID_BULLET as gc, CONTEXT_MENU_LABEL_ORDERED as Rc, CONTEXT_MENU_ID_ORDERED as bc, CONTEXT_MENU_LABEL_LINK as Sc, CONTEXT_MENU_ID_LINK as Bc, CONTEXT_MENU_LABEL_CLEAR as Dc, CONTEXT_MENU_ID_CLEAR as Mc, CONTEXT_MENU_LABEL_FIND as Hc, CONTEXT_MENU_ID_FIND as kc, CONTEXT_MENU_LABEL_SIGNATURE as Pc, CONTEXT_MENU_ID_SIGNATURE as Uc, CONTEXT_MENU_LABEL_COMMENT as vc, CONTEXT_MENU_ID_COMMENT as wc } from "../../constants/contextMenu.const.js";
|
|
18
|
+
import { TABLE_CELL_SELECTOR as Yn, TABLE_TAG as dt } from "../../constants/table.const.js";
|
|
19
|
+
import { cn as Kc } from "../../utils/cn.utils.js";
|
|
20
|
+
import { applyTypoAutoFix as Fc } from "../../utils/typo.utils.js";
|
|
21
|
+
import { createInkId as zn } from "../../utils/id.utils.js";
|
|
22
|
+
import { getColumnResizeIndex as $n, getTableCellFromSelection as qn, setTableColumnWidth as yc, buildTableHtml as xc, insertTableRow as jn, insertTableColumn as Zn, deleteTableRow as Xc, deleteTableColumn as Gc, toggleTableHeaderRow as Wc } from "../../utils/table.utils.js";
|
|
23
|
+
import { getBlockElement as fe, clearBlockDragClasses as Tt, markActiveBlock as Qn, markDraggingBlock as Vc, moveBlock as Yc, resolveDropPosition as Jn, reorderBlockBefore as zc, reorderBlockAfter as $c, markDropTarget as eo } from "../../utils/blocks.utils.js";
|
|
24
|
+
import { createTrackChange as ft, rejectTrackChangeInHtml as qc, acceptTrackChangeInHtml as jc, wrapInsertHtml as to, wrapDeleteHtml as Zc } from "../../utils/trackChanges.utils.js";
|
|
25
|
+
import { removeCommentMark as Qc, wrapSelectionAsComment as Jc, createCommentThread as es } from "../../utils/comments.utils.js";
|
|
26
|
+
import { InkHistoryStack as Et } from "../../utils/history.utils.js";
|
|
27
|
+
import { extractSlashQuery as ts, filterSlashCommands as ns } from "../../utils/slash.utils.js";
|
|
28
|
+
import { countWords as os } from "../../utils/words.utils.js";
|
|
29
|
+
import { collectOutlineItems as ee, scrollOutlineHeading as rs, getCaretLineCol as no } from "../../utils/outline.utils.js";
|
|
30
|
+
import { resolveInkPremium as ls, hasInkPremiumFeature as Ee, themeTokensToStyle as is } from "../../utils/premium.utils.js";
|
|
31
|
+
import { extractClipboardHtml as cs, sanitizePastedHtml as ss, extractClipboardText as as } from "../../utils/paste.utils.js";
|
|
32
|
+
import { readInkMemory as us, writeInkMemory as _s } from "../../utils/memory.utils.js";
|
|
33
|
+
import { replaceInHtml as ds } from "../../utils/findReplace.utils.js";
|
|
34
|
+
import { withPreservedSelection as mt, captureSelectionInRoot as Ts, restoreSelectionInRoot as fs } from "../../utils/selection.utils.js";
|
|
35
|
+
import { readToolbarItems as Es, readToolbarHidden as ms, listCustomizableToolbarOptions as ps, writeToolbarHidden as Ls, buildVisibleToolbarItems as Os, writeToolbarItems as Cs } from "../../utils/toolbarStorage.utils.js";
|
|
36
|
+
import { TITLE_STYLE_DEFAULT as Ns } from "../../plugins/titles/titles.const.js";
|
|
37
|
+
import { buildTitleHtml as oo } from "../../plugins/titles/titles.utils.js";
|
|
38
|
+
import { excelGridToTableHtml as Is, createEmptyExcelGrid as As } from "../../plugins/excel/excel.utils.js";
|
|
39
|
+
import { GRAPH_SAMPLE as Se, GRAPH_KIND_DEFAULT as ro } from "../../plugins/graph/graph.const.js";
|
|
40
|
+
import { parseGraphColors as lo, replaceGraphBlock as io, getGraphBlock as hs, buildGraphHtml as gs, parseGraphPoints as co } from "../../plugins/graph/graph.utils.js";
|
|
41
|
+
import { THEME_DEFAULT as Rs } from "../../plugins/theme/theme.const.js";
|
|
42
|
+
import { applyInkTheme as bs } from "../../plugins/theme/inkTheme.js";
|
|
43
|
+
import { inkPlugins as me } from "../../plugins/host/inkPlugins.js";
|
|
44
|
+
import { useToolbarOverflow as Ss } from "../../hooks/useToolbarOverflow.js";
|
|
45
|
+
import { Button as Bs } from "../../common-components/Button/Button.js";
|
|
46
|
+
import { ContextMenu as so } from "../../common-components/ContextMenu/ContextMenu.js";
|
|
47
|
+
import { insertImage as pt, insertHTML as A, setTextColor as Ds, setHighlightColor as Ms, getActiveFormats as Hs, queryCommandValue as ks, detectListType as Ps, tryConvertMarkdownListPrefix as Us, execCommand as h, insertLink as vs, applyFontFamily as ws, applyListType as Ks, clearFormatDeep as Fs, setBlockDirection as ao, fileToDataUrl as ys } from "./helpers/format.utils.js";
|
|
48
|
+
import { inkAi as xs } from "../../plugins/ai/aiPlugin.js";
|
|
49
49
|
import { ToolbarButton as N } from "./components/ToolbarButton/ToolbarButton.js";
|
|
50
|
-
import { ToolbarDropdown as
|
|
51
|
-
import { ToolbarColorPicker as
|
|
52
|
-
import { CommentsPanel as
|
|
53
|
-
import { AiPanel as
|
|
54
|
-
import { AiAutocomplete as
|
|
55
|
-
import { AI_AUTOCOMPLETE_DEBOUNCE_MS as
|
|
56
|
-
import { getTextBeforeCaret as
|
|
57
|
-
import { BlockHandles as
|
|
58
|
-
import { BLOCK_HANDLES_DRAG_MIME as
|
|
59
|
-
import { InlineToolbar as
|
|
60
|
-
import { INLINE_TOOLBAR_EDGE_PADDING_PX as
|
|
61
|
-
import { selectionIsInsideElement as
|
|
62
|
-
import { SlashMenu as
|
|
63
|
-
import { OutlineRail as
|
|
64
|
-
import { TrackChangesBar as
|
|
65
|
-
import { SignPad as
|
|
66
|
-
import { FindReplace as
|
|
67
|
-
import { ToolbarCustomize as
|
|
68
|
-
import { HtmlSourcePanel as
|
|
69
|
-
import { TableSizePicker as
|
|
70
|
-
import { TitleGallery as
|
|
71
|
-
import { ExcelSheetPanel as
|
|
72
|
-
import { GraphPicker as
|
|
73
|
-
import { GraphEditModal as
|
|
74
|
-
import { ThemePicker as
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
50
|
+
import { ToolbarDropdown as Be } from "./components/ToolbarDropdown/ToolbarDropdown.js";
|
|
51
|
+
import { ToolbarColorPicker as uo } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
|
|
52
|
+
import { CommentsPanel as Xs } from "./components/CommentsPanel/CommentsPanel.js";
|
|
53
|
+
import { AiPanel as Gs } from "./components/AiPanel/AiPanel.js";
|
|
54
|
+
import { AiAutocomplete as Ws } from "./components/AiAutocomplete/AiAutocomplete.js";
|
|
55
|
+
import { AI_AUTOCOMPLETE_DEBOUNCE_MS as Vs, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT as Ys } from "./components/AiAutocomplete/AiAutocomplete.const.js";
|
|
56
|
+
import { getTextBeforeCaret as zs, getCaretPositionInRoot as _o } from "./components/AiAutocomplete/AiAutocomplete.utils.js";
|
|
57
|
+
import { BlockHandles as $s } from "./components/BlockHandles/BlockHandles.js";
|
|
58
|
+
import { BLOCK_HANDLES_DRAG_MIME as qs, BLOCK_HANDLES_DRAG_PAYLOAD as js, BLOCK_HANDLES_DRAG_EFFECT_MOVE as To } from "./components/BlockHandles/BlockHandles.const.js";
|
|
59
|
+
import { InlineToolbar as Zs } from "./components/InlineToolbar/InlineToolbar.js";
|
|
60
|
+
import { INLINE_TOOLBAR_EDGE_PADDING_PX as Qs, INLINE_TOOLBAR_ESTIMATED_WIDTH_PX as Js, INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX as ea, INLINE_TOOLBAR_GAP_PX as ta } from "./components/InlineToolbar/InlineToolbar.const.js";
|
|
61
|
+
import { selectionIsInsideElement as na, clampInlineToolbarPosition as oa } from "./components/InlineToolbar/InlineToolbar.utils.js";
|
|
62
|
+
import { SlashMenu as ra } from "./components/SlashMenu/SlashMenu.js";
|
|
63
|
+
import { OutlineRail as la } from "./components/OutlineRail/OutlineRail.js";
|
|
64
|
+
import { TrackChangesBar as ia } from "./components/TrackChangesBar/TrackChangesBar.js";
|
|
65
|
+
import { SignPad as ca } from "./components/SignPad/SignPad.js";
|
|
66
|
+
import { FindReplace as sa } from "./components/FindReplace/FindReplace.js";
|
|
67
|
+
import { ToolbarCustomize as aa } from "./components/ToolbarCustomize/ToolbarCustomize.js";
|
|
68
|
+
import { HtmlSourcePanel as ua } from "./components/HtmlSourcePanel/HtmlSourcePanel.js";
|
|
69
|
+
import { TableSizePicker as _a } from "./components/TableSizePicker/TableSizePicker.js";
|
|
70
|
+
import { TitleGallery as da } from "./components/TitleGallery/TitleGallery.js";
|
|
71
|
+
import { ExcelSheetPanel as Ta } from "./components/ExcelSheetPanel/ExcelSheetPanel.js";
|
|
72
|
+
import { GraphPicker as fa } from "./components/GraphPicker/GraphPicker.js";
|
|
73
|
+
import { GraphEditModal as Ea } from "./components/GraphEditModal/GraphEditModal.js";
|
|
74
|
+
import { ThemePicker as ma } from "./components/ThemePicker/ThemePicker.js";
|
|
75
|
+
import { PresenceStack as pa } from "./components/PresenceStack/PresenceStack.js";
|
|
76
|
+
import { RemoteCursors as La } from "./components/RemoteCursors/RemoteCursors.js";
|
|
77
|
+
const Lt = () => {
|
|
78
|
+
const H = window.getSelection();
|
|
79
|
+
if (!H || H.rangeCount === p) return "";
|
|
80
|
+
const g = H.getRangeAt(p), k = document.createElement("div");
|
|
81
|
+
return k.appendChild(g.cloneContents()), k.innerHTML;
|
|
82
|
+
}, I = (H) => {
|
|
83
|
+
H == null || H.focus({ preventScroll: !0 });
|
|
84
|
+
}, Xu = (H) => {
|
|
85
|
+
var Ln;
|
|
84
86
|
const {
|
|
85
87
|
value: g,
|
|
86
|
-
defaultValue:
|
|
87
|
-
onChange:
|
|
88
|
-
placeholder:
|
|
88
|
+
defaultValue: k = "",
|
|
89
|
+
onChange: P,
|
|
90
|
+
placeholder: Ot = pi,
|
|
89
91
|
disabled: i = !1,
|
|
90
92
|
readOnly: s = !1,
|
|
91
|
-
minHeight:
|
|
92
|
-
maxHeight:
|
|
93
|
-
toolbar:
|
|
94
|
-
className:
|
|
95
|
-
testId:
|
|
96
|
-
allowImagePaste:
|
|
97
|
-
showCharCount:
|
|
98
|
-
charCountMax:
|
|
99
|
-
typoAutoFix:
|
|
100
|
-
variant:
|
|
101
|
-
chrome:
|
|
102
|
-
colorMode:
|
|
103
|
-
features:
|
|
104
|
-
author:
|
|
105
|
-
trackChanges:
|
|
106
|
-
onTrackChangesChange:
|
|
107
|
-
trackChangesEnabled:
|
|
108
|
-
onTrackChangesEnabledChange:
|
|
109
|
-
comments:
|
|
110
|
-
onCommentsChange:
|
|
111
|
-
showCommentsPanel:
|
|
112
|
-
onShowCommentsPanelChange:
|
|
113
|
-
ai:
|
|
114
|
-
slashCommands:
|
|
115
|
-
tableRows:
|
|
116
|
-
tableCols:
|
|
117
|
-
premium:
|
|
118
|
-
theme:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
93
|
+
minHeight: De = Tl,
|
|
94
|
+
maxHeight: Me,
|
|
95
|
+
toolbar: fo,
|
|
96
|
+
className: Eo = "",
|
|
97
|
+
testId: mo,
|
|
98
|
+
allowImagePaste: Ct = !0,
|
|
99
|
+
showCharCount: Nt = !1,
|
|
100
|
+
charCountMax: It,
|
|
101
|
+
typoAutoFix: po = !0,
|
|
102
|
+
variant: pe = Li,
|
|
103
|
+
chrome: Lo = Oi,
|
|
104
|
+
colorMode: At = Zl,
|
|
105
|
+
features: Oo,
|
|
106
|
+
author: X = Ci,
|
|
107
|
+
trackChanges: te,
|
|
108
|
+
onTrackChangesChange: He,
|
|
109
|
+
trackChangesEnabled: Le,
|
|
110
|
+
onTrackChangesEnabledChange: ke,
|
|
111
|
+
comments: ne,
|
|
112
|
+
onCommentsChange: Pe,
|
|
113
|
+
showCommentsPanel: oe,
|
|
114
|
+
onShowCommentsPanelChange: Ue,
|
|
115
|
+
ai: f,
|
|
116
|
+
slashCommands: Co,
|
|
117
|
+
tableRows: No = Ni,
|
|
118
|
+
tableCols: Io = Ii,
|
|
119
|
+
premium: Ao,
|
|
120
|
+
theme: ho,
|
|
121
|
+
themeId: ht,
|
|
122
|
+
onThemeChange: ve,
|
|
123
|
+
icons: gt,
|
|
124
|
+
pasteMode: go = "plain",
|
|
125
|
+
onImageUpload: Rt,
|
|
126
|
+
wysiwyg: Ro = !1,
|
|
127
|
+
keepInMemory: G = !1,
|
|
128
|
+
memoryKey: W,
|
|
129
|
+
onToolbarChange: we,
|
|
130
|
+
toolbarHidden: V,
|
|
131
|
+
onToolbarHiddenChange: Ke,
|
|
132
|
+
showOutline: bo,
|
|
133
|
+
onOutlineChange: Fe,
|
|
134
|
+
collaboration: R,
|
|
135
|
+
style: So,
|
|
136
|
+
...Bo
|
|
137
|
+
} = H, Oe = fo ?? (pe === Kn ? hi : gi), a = { ...Ai, ...Oo }, Y = ls(Ao), Do = Ee(Y, "icons"), Mo = Ee(Y, "theme"), Ho = Ee(Y, "richPaste"), ko = Ee(Y, "imageUpload"), Po = Ee(Y, "wysiwyg") && Ro, E = Do && gt ? { ...Vn, ...gt } : Vn, Uo = Mo ? is(ho) : {}, vo = Ho && go === "rich", o = D(null), Ce = D(null), re = D(new Et(g ?? k)), z = D(null), F = D(null), Ne = D(M), [ye, wo] = c(/* @__PURE__ */ new Set()), [Ko, bt] = c("p"), [Fo, yo] = c(p), [xo, Xo] = c(p), [Go, St] = c(Cn), [Wo, Bt] = c(Cn), [Vo, $] = c([]), [Yo, zo] = c(p), [$o, xe] = c(M), [qo, jo] = c(fl), [Zo, Qo] = c(El), [q, Dt] = c(Le ?? !1), [Jo, Mt] = c(te ?? []), [er, Ht] = c(ne ?? []), [tr, kt] = c(oe ?? !1), [Pt, le] = c(!!(f != null && f.enabled && f.openOnInit)), [Ie, nr] = c(!1), Ut = D(!1), [v, ie] = c({
|
|
133
138
|
visible: !1,
|
|
134
139
|
suggestion: "",
|
|
135
140
|
top: p,
|
|
136
141
|
left: p
|
|
137
|
-
}),
|
|
142
|
+
}), ce = D(null), j = D(p), [vt, or] = c(""), [rr, lr] = c(0), [ir, wt] = c(!1), [cr, Ae] = c([]), [Kt, sr] = c({ top: 0, left: 0 }), [Ft, Xe] = c(!1), [Ge, he] = c(!1), [se, yt] = c(!1), [xt, Xt] = c(M), [ar, ur] = c(be), [_r, dr] = c(ri), [Tr, Gt] = c(ci), [fr, Er] = c(be), [We, Ve] = c({ open: !1, x: p, y: p }), [mr, Wt] = c(!1), [Ye, ze] = c({
|
|
138
143
|
open: !1,
|
|
139
144
|
x: p,
|
|
140
145
|
y: p
|
|
141
|
-
}), [
|
|
146
|
+
}), [$e, Z] = c({
|
|
142
147
|
open: !1,
|
|
143
148
|
top: p,
|
|
144
149
|
left: p
|
|
145
|
-
}), [
|
|
146
|
-
() =>
|
|
147
|
-
), [
|
|
148
|
-
() =>
|
|
149
|
-
), [
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
|
|
150
|
+
}), [Q, Vt] = c(
|
|
151
|
+
() => Es(G, W) ?? Oe
|
|
152
|
+
), [pr, Yt] = c(() => V !== void 0 ? V : ms(G, W) ?? !1), [Lr, zt] = c(!1), $t = D(!0), Or = Oe.join(","), w = te ?? Jo, ae = ne ?? er, qe = oe ?? tr, qt = Co ?? a.slash, [je, Cr] = c(
|
|
153
|
+
() => bo ?? pe === Kn
|
|
154
|
+
), [jt, m] = c(M), [Nr, Ir] = c(!1), J = D(null), [Ar, Ze] = c(!1), [hr, gr] = c("values"), [Rr, br] = c(Se), [Sr, Br] = c(() => lo(null)), [Dr, Mr] = c(ht || Rs), Zt = ht ?? Dr, [Qt, Hr] = c(!1), kr = !!(a.outline && je), y = Ss(Q.length), Jt = V ?? pr, en = Oe, Pr = ps(en), Qe = At === Ql ? void 0 : At, Je = !!(a.ai && (f != null && f.enabled) && f.autocomplete !== !1 && !i && !s), et = () => {
|
|
155
|
+
ce.current !== null && (window.clearTimeout(ce.current), ce.current = null);
|
|
156
|
+
}, U = () => {
|
|
157
|
+
et(), j.current += 1, ie(
|
|
153
158
|
(e) => e.visible || e.suggestion ? { visible: !1, suggestion: "", top: p, left: p } : e
|
|
154
159
|
);
|
|
155
|
-
},
|
|
156
|
-
if (!
|
|
157
|
-
|
|
160
|
+
}, Ur = () => {
|
|
161
|
+
if (!Je || Ie || !o.current) {
|
|
162
|
+
U();
|
|
158
163
|
return;
|
|
159
164
|
}
|
|
160
165
|
const e = window.getSelection();
|
|
161
166
|
if (!e || !e.isCollapsed) {
|
|
162
|
-
|
|
167
|
+
U();
|
|
163
168
|
return;
|
|
164
169
|
}
|
|
165
|
-
|
|
170
|
+
et(), ie(
|
|
166
171
|
(n) => n.visible || n.suggestion ? { ...n, visible: !1, suggestion: "" } : n
|
|
167
172
|
);
|
|
168
|
-
const t = (
|
|
169
|
-
|
|
170
|
-
if (
|
|
173
|
+
const t = (f == null ? void 0 : f.providerId) || Ji;
|
|
174
|
+
ce.current = window.setTimeout(() => {
|
|
175
|
+
if (ce.current = null, !o.current || Ut.current) return;
|
|
171
176
|
const n = window.getSelection();
|
|
172
177
|
if (!n || !n.isCollapsed) return;
|
|
173
|
-
const l =
|
|
178
|
+
const l = zs(o.current), u = _o(o.current);
|
|
174
179
|
if (!l.trim() || !u) return;
|
|
175
|
-
const T =
|
|
176
|
-
|
|
180
|
+
const T = j.current + 1;
|
|
181
|
+
j.current = T;
|
|
177
182
|
const L = o.current.innerHTML;
|
|
178
|
-
|
|
183
|
+
xs.runProvider(t, {
|
|
179
184
|
capability: "autocomplete",
|
|
180
185
|
html: L,
|
|
181
186
|
prompt: l,
|
|
182
|
-
modelId:
|
|
183
|
-
}).then((
|
|
184
|
-
var
|
|
185
|
-
if (T !==
|
|
186
|
-
const C = ((
|
|
187
|
+
modelId: f == null ? void 0 : f.modelId
|
|
188
|
+
}).then((_) => {
|
|
189
|
+
var de;
|
|
190
|
+
if (T !== j.current) return;
|
|
191
|
+
const C = ((de = _.text) == null ? void 0 : de.trim()) || "";
|
|
187
192
|
if (!C) {
|
|
188
|
-
|
|
193
|
+
ie({
|
|
189
194
|
visible: !1,
|
|
190
195
|
suggestion: "",
|
|
191
196
|
top: p,
|
|
@@ -193,322 +198,322 @@ const mt = () => {
|
|
|
193
198
|
});
|
|
194
199
|
return;
|
|
195
200
|
}
|
|
196
|
-
const
|
|
197
|
-
|
|
201
|
+
const ge = o.current && _o(o.current) || u;
|
|
202
|
+
ie({
|
|
198
203
|
visible: !0,
|
|
199
204
|
suggestion: C,
|
|
200
|
-
top:
|
|
201
|
-
left:
|
|
205
|
+
top: ge.top,
|
|
206
|
+
left: ge.left
|
|
202
207
|
});
|
|
203
208
|
}).catch(() => {
|
|
204
|
-
T ===
|
|
209
|
+
T === j.current && ie({
|
|
205
210
|
visible: !1,
|
|
206
211
|
suggestion: "",
|
|
207
212
|
top: p,
|
|
208
213
|
left: p
|
|
209
214
|
});
|
|
210
215
|
});
|
|
211
|
-
},
|
|
216
|
+
}, Vs);
|
|
212
217
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}, []),
|
|
216
|
-
|
|
217
|
-
}, [
|
|
218
|
-
|
|
219
|
-
}, [
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
|
|
223
|
-
}, [
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
|
|
227
|
-
}, [
|
|
228
|
-
if (
|
|
229
|
-
|
|
218
|
+
S(() => () => {
|
|
219
|
+
et(), j.current += 1;
|
|
220
|
+
}, []), S(() => {
|
|
221
|
+
Ut.current = Ie, Ie && U();
|
|
222
|
+
}, [Ie]), S(() => {
|
|
223
|
+
Le !== void 0 && Dt(Le);
|
|
224
|
+
}, [Le]), S(() => {
|
|
225
|
+
te && Mt(te);
|
|
226
|
+
}, [te]), S(() => {
|
|
227
|
+
ne && Ht(ne);
|
|
228
|
+
}, [ne]), S(() => {
|
|
229
|
+
oe !== void 0 && kt(oe);
|
|
230
|
+
}, [oe]), S(() => {
|
|
231
|
+
V !== void 0 && Yt(V);
|
|
232
|
+
}, [V]), S(() => {
|
|
233
|
+
if ($t.current) {
|
|
234
|
+
$t.current = !1;
|
|
230
235
|
return;
|
|
231
236
|
}
|
|
232
|
-
|
|
233
|
-
}, [
|
|
234
|
-
if (!o.current || g === void 0 || g ===
|
|
237
|
+
Vt(Oe);
|
|
238
|
+
}, [Or]), S(() => {
|
|
239
|
+
if (!o.current || g === void 0 || g === z.current) return;
|
|
235
240
|
if (o.current.innerHTML === g) {
|
|
236
|
-
|
|
241
|
+
z.current = g;
|
|
237
242
|
return;
|
|
238
243
|
}
|
|
239
244
|
const e = document.activeElement === o.current;
|
|
240
|
-
|
|
245
|
+
mt(e ? o.current : null, () => {
|
|
241
246
|
o.current && (o.current.innerHTML = g);
|
|
242
|
-
}),
|
|
243
|
-
}, [g]),
|
|
247
|
+
}), z.current = g;
|
|
248
|
+
}, [g]), S(() => {
|
|
244
249
|
if (!o.current) return;
|
|
245
|
-
const e =
|
|
250
|
+
const e = G ? us(W) : "";
|
|
246
251
|
if (e) {
|
|
247
|
-
o.current.innerHTML = e,
|
|
252
|
+
o.current.innerHTML = e, z.current = e, re.current = new Et(e), P == null || P(e), a.outline && $(ee(o.current));
|
|
248
253
|
return;
|
|
249
254
|
}
|
|
250
255
|
if (g !== void 0) {
|
|
251
|
-
a.outline &&
|
|
256
|
+
a.outline && $(ee(o.current));
|
|
252
257
|
return;
|
|
253
258
|
}
|
|
254
|
-
|
|
255
|
-
}, []),
|
|
259
|
+
k && (o.current.innerHTML = k, z.current = k, re.current = new Et(k), P == null || P(k), a.outline && $(ee(o.current)));
|
|
260
|
+
}, []), S(() => {
|
|
256
261
|
const e = () => {
|
|
257
|
-
|
|
262
|
+
Hr(document.fullscreenElement === Ce.current);
|
|
258
263
|
};
|
|
259
264
|
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
260
265
|
}, []);
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
const n = o.current.textContent ??
|
|
264
|
-
|
|
266
|
+
const tt = (e) => {
|
|
267
|
+
if (re.current.push(e), z.current = e, P == null || P(e), G && _s(e, W), Nt && o.current) {
|
|
268
|
+
const n = o.current.textContent ?? M;
|
|
269
|
+
yo(n.length), Xo(os(n));
|
|
265
270
|
}
|
|
266
|
-
a.outline &&
|
|
267
|
-
const t =
|
|
268
|
-
|
|
269
|
-
},
|
|
270
|
-
o.current && (
|
|
271
|
+
a.outline && $(ee(o.current));
|
|
272
|
+
const t = no(o.current);
|
|
273
|
+
St(t.line), Bt(t.col);
|
|
274
|
+
}, K = (e) => {
|
|
275
|
+
o.current && (mt(o.current, () => {
|
|
271
276
|
o.current && (o.current.innerHTML = e);
|
|
272
|
-
}),
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
if (e ===
|
|
277
|
+
}), tt(e));
|
|
278
|
+
}, nt = (e) => {
|
|
279
|
+
Yt(e), Ke == null || Ke(e), Ls(e, G, W);
|
|
280
|
+
}, vr = (e) => {
|
|
281
|
+
Vt(e), we == null || we(e), Cs(e, G, W);
|
|
282
|
+
}, wr = (e, t) => {
|
|
283
|
+
if (e === wn) return;
|
|
279
284
|
const n = new Set(
|
|
280
|
-
|
|
285
|
+
Q.filter((l) => l !== wn)
|
|
281
286
|
);
|
|
282
|
-
t ? n.add(e) : n.delete(e),
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
},
|
|
287
|
+
t ? n.add(e) : n.delete(e), vr(Os(en, n));
|
|
288
|
+
}, ue = (e) => {
|
|
289
|
+
Mt(e), He == null || He(e);
|
|
290
|
+
}, ot = (e) => {
|
|
291
|
+
Ht(e), Pe == null || Pe(e);
|
|
292
|
+
}, rt = (e) => {
|
|
293
|
+
kt(e), Ue == null || Ue(e);
|
|
294
|
+
}, Kr = (e) => {
|
|
295
|
+
Dt(e), ke == null || ke(e);
|
|
296
|
+
}, Fr = () => {
|
|
292
297
|
if (i || s) {
|
|
293
|
-
|
|
298
|
+
Z((u) => u.open ? { ...u, open: !1 } : u);
|
|
294
299
|
return;
|
|
295
300
|
}
|
|
296
301
|
const e = window.getSelection();
|
|
297
|
-
if (!e || e.isCollapsed || e.rangeCount === 0 || !
|
|
298
|
-
|
|
302
|
+
if (!e || e.isCollapsed || e.rangeCount === 0 || !na(e, o.current)) {
|
|
303
|
+
Z((u) => u.open ? { ...u, open: !1 } : u);
|
|
299
304
|
return;
|
|
300
305
|
}
|
|
301
306
|
const n = e.getRangeAt(0).getBoundingClientRect();
|
|
302
307
|
if (n.width === 0 && n.height === 0) {
|
|
303
|
-
|
|
308
|
+
Z((u) => u.open ? { ...u, open: !1 } : u);
|
|
304
309
|
return;
|
|
305
310
|
}
|
|
306
|
-
const l =
|
|
311
|
+
const l = oa({
|
|
307
312
|
selectionRect: n,
|
|
308
|
-
toolbarWidth:
|
|
309
|
-
toolbarHeight:
|
|
313
|
+
toolbarWidth: Js,
|
|
314
|
+
toolbarHeight: ea,
|
|
310
315
|
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
311
|
-
gap:
|
|
312
|
-
edgePadding:
|
|
316
|
+
gap: ta,
|
|
317
|
+
edgePadding: Qs
|
|
313
318
|
});
|
|
314
|
-
|
|
315
|
-
},
|
|
319
|
+
Z({ open: !0, top: l.top, left: l.left });
|
|
320
|
+
}, _e = () => {
|
|
316
321
|
var L;
|
|
317
|
-
|
|
318
|
-
const e =
|
|
319
|
-
e &&
|
|
322
|
+
wo(Hs());
|
|
323
|
+
const e = ks("formatBlock");
|
|
324
|
+
e && bt(e.toLowerCase().replace(/[<>]/g, "")), Gt(Ps()), or(Lt());
|
|
320
325
|
const t = (L = window.getSelection()) == null ? void 0 : L.toString().trim();
|
|
321
|
-
t && (
|
|
322
|
-
const n =
|
|
323
|
-
if (
|
|
324
|
-
const l = window.getSelection(), u = (l == null ? void 0 : l.anchorNode) ?? null, T =
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
|
|
326
|
+
t && (Ne.current = t), Fr();
|
|
327
|
+
const n = no(o.current);
|
|
328
|
+
if (St(n.line), Bt(n.col), a.outline && $(ee(o.current)), !o.current || !a.blocks) return;
|
|
329
|
+
const l = window.getSelection(), u = (l == null ? void 0 : l.anchorNode) ?? null, T = fe(u, o.current);
|
|
330
|
+
if (Qn(o.current, T), T) {
|
|
331
|
+
const _ = o.current.getBoundingClientRect(), C = T.getBoundingClientRect();
|
|
332
|
+
lr(C.top - _.top + o.current.scrollTop), wt(!0);
|
|
328
333
|
} else
|
|
329
|
-
|
|
330
|
-
},
|
|
334
|
+
wt(!1);
|
|
335
|
+
}, d = () => {
|
|
331
336
|
var t, n, l;
|
|
332
337
|
if (!o.current) return;
|
|
333
338
|
let e = o.current.innerHTML;
|
|
334
|
-
if (
|
|
339
|
+
if (q && a.trackChanges) {
|
|
335
340
|
const u = window.getSelection();
|
|
336
341
|
if (u && !u.isCollapsed) {
|
|
337
|
-
const T =
|
|
342
|
+
const T = Lt();
|
|
338
343
|
if (T) {
|
|
339
|
-
const L =
|
|
340
|
-
|
|
344
|
+
const L = ft("delete", T, X);
|
|
345
|
+
ue([...w, L]), yr(L.id), e = o.current.innerHTML;
|
|
341
346
|
}
|
|
342
347
|
}
|
|
343
348
|
}
|
|
344
|
-
if (
|
|
345
|
-
const u = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", T =
|
|
349
|
+
if (tt(e), _e(), qt && o.current) {
|
|
350
|
+
const u = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", T = ts(u);
|
|
346
351
|
if (T !== null) {
|
|
347
|
-
|
|
352
|
+
xe(T), Ae(ns(T));
|
|
348
353
|
const L = (l = window.getSelection()) == null ? void 0 : l.getRangeAt(0);
|
|
349
354
|
if (L && o.current) {
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
top:
|
|
353
|
-
left:
|
|
355
|
+
const _ = L.getBoundingClientRect(), C = o.current.getBoundingClientRect();
|
|
356
|
+
sr({
|
|
357
|
+
top: _.bottom - C.top + 8,
|
|
358
|
+
left: _.left - C.left
|
|
354
359
|
});
|
|
355
360
|
}
|
|
356
361
|
} else
|
|
357
|
-
|
|
362
|
+
xe(M), Ae([]);
|
|
358
363
|
}
|
|
359
|
-
|
|
364
|
+
Je ? Ur() : U();
|
|
360
365
|
};
|
|
361
|
-
|
|
366
|
+
S(() => {
|
|
362
367
|
const e = o.current;
|
|
363
368
|
if (!e || i || s || !a.table) return;
|
|
364
369
|
const t = (l) => {
|
|
365
370
|
const u = l.target;
|
|
366
371
|
if (!(u instanceof Element)) return;
|
|
367
|
-
const T = u.closest(
|
|
372
|
+
const T = u.closest(Yn);
|
|
368
373
|
if (!T || !e.contains(T)) return;
|
|
369
|
-
const L = T.closest(
|
|
374
|
+
const L = T.closest(dt);
|
|
370
375
|
if (!L) return;
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
376
|
+
const _ = $n(l.clientX, T, Nn);
|
|
377
|
+
if (_ === null) return;
|
|
373
378
|
l.preventDefault();
|
|
374
|
-
const C = l.clientX,
|
|
375
|
-
L.classList.add(
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
},
|
|
379
|
-
L.classList.remove(
|
|
379
|
+
const C = l.clientX, ge = T.getBoundingClientRect().width;
|
|
380
|
+
L.classList.add(Te);
|
|
381
|
+
const de = (_l) => {
|
|
382
|
+
yc(L, _, ge + (_l.clientX - C));
|
|
383
|
+
}, On = () => {
|
|
384
|
+
L.classList.remove(Te), document.removeEventListener("pointermove", de), document.removeEventListener("pointerup", On), d();
|
|
380
385
|
};
|
|
381
|
-
document.addEventListener("pointermove",
|
|
386
|
+
document.addEventListener("pointermove", de), document.addEventListener("pointerup", On);
|
|
382
387
|
}, n = (l) => {
|
|
383
388
|
const u = l.target;
|
|
384
389
|
if (!(u instanceof Element)) return;
|
|
385
|
-
const T = u.closest(
|
|
386
|
-
if (e.querySelectorAll(
|
|
387
|
-
C.classList.contains(
|
|
390
|
+
const T = u.closest(Yn);
|
|
391
|
+
if (e.querySelectorAll(dt).forEach((C) => {
|
|
392
|
+
C.classList.contains(Te) || C.classList.remove(Te);
|
|
388
393
|
}), !T || !e.contains(T)) return;
|
|
389
|
-
const
|
|
390
|
-
|
|
394
|
+
const _ = T.closest(dt);
|
|
395
|
+
_ && $n(l.clientX, T, Nn) !== null && _.classList.add(Te);
|
|
391
396
|
};
|
|
392
397
|
return e.addEventListener("pointerdown", t), e.addEventListener("pointermove", n), () => {
|
|
393
398
|
e.removeEventListener("pointerdown", t), e.removeEventListener("pointermove", n);
|
|
394
399
|
};
|
|
395
400
|
}, [i, s, a.table]);
|
|
396
|
-
const
|
|
397
|
-
const e =
|
|
401
|
+
const tn = () => {
|
|
402
|
+
const e = v.suggestion;
|
|
398
403
|
if (!e) {
|
|
399
|
-
|
|
404
|
+
U();
|
|
400
405
|
return;
|
|
401
406
|
}
|
|
402
|
-
I(o.current), h(
|
|
403
|
-
},
|
|
407
|
+
I(o.current), h(Ys, e), U(), d();
|
|
408
|
+
}, yr = (e) => {
|
|
404
409
|
const t = window.getSelection();
|
|
405
410
|
if (!t || t.rangeCount === 0) return;
|
|
406
|
-
const n =
|
|
407
|
-
n && A(
|
|
408
|
-
},
|
|
409
|
-
if (!o.current || !
|
|
410
|
-
const e = o.current.innerHTML, t =
|
|
411
|
-
t.html !== e && (
|
|
411
|
+
const n = Lt();
|
|
412
|
+
n && A(Zc(n, e));
|
|
413
|
+
}, xr = () => {
|
|
414
|
+
if (!o.current || !po || !a.typoAutoFix || i || s) return;
|
|
415
|
+
const e = o.current.innerHTML, t = Fc(e);
|
|
416
|
+
t.html !== e && (mt(o.current, () => {
|
|
412
417
|
o.current && (o.current.innerHTML = t.html);
|
|
413
|
-
}),
|
|
414
|
-
},
|
|
418
|
+
}), tt(t.html));
|
|
419
|
+
}, b = (e) => {
|
|
415
420
|
if (i || s) return;
|
|
416
421
|
if (I(o.current), e === "clearFormat") {
|
|
417
|
-
|
|
422
|
+
Fs(), d();
|
|
418
423
|
return;
|
|
419
424
|
}
|
|
420
425
|
if (e === "directionLtr" && o.current) {
|
|
421
|
-
|
|
426
|
+
ao(o.current, Ei), d();
|
|
422
427
|
return;
|
|
423
428
|
}
|
|
424
429
|
if (e === "directionRtl" && o.current) {
|
|
425
|
-
|
|
430
|
+
ao(o.current, mi), d();
|
|
426
431
|
return;
|
|
427
432
|
}
|
|
428
|
-
if (e ===
|
|
429
|
-
A(
|
|
433
|
+
if (e === Re) {
|
|
434
|
+
A(Wn), d();
|
|
430
435
|
return;
|
|
431
436
|
}
|
|
432
|
-
const t =
|
|
433
|
-
t && (t.value ? h(t.command, t.value) : h(t.command),
|
|
434
|
-
},
|
|
435
|
-
i || s || (I(o.current), h("formatBlock", e),
|
|
436
|
-
},
|
|
437
|
-
i || s || (I(o.current),
|
|
438
|
-
},
|
|
439
|
-
i || s || (I(o.current),
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
},
|
|
437
|
+
const t = _t[e];
|
|
438
|
+
t && (t.value ? h(t.command, t.value) : h(t.command), d());
|
|
439
|
+
}, Xr = (e) => {
|
|
440
|
+
i || s || (I(o.current), h("formatBlock", e), bt(e), d());
|
|
441
|
+
}, Gr = (e) => {
|
|
442
|
+
i || s || (I(o.current), ws(e), dr(e), d());
|
|
443
|
+
}, Wr = (e) => {
|
|
444
|
+
i || s || (I(o.current), Ks(e), Gt(e), d());
|
|
445
|
+
}, nn = (e) => {
|
|
446
|
+
ur(e), Er(e), he(!0);
|
|
447
|
+
}, Vr = (e) => {
|
|
443
448
|
if (i || s) return;
|
|
444
|
-
|
|
445
|
-
},
|
|
449
|
+
nn(e === Ti ? di : be);
|
|
450
|
+
}, lt = () => {
|
|
446
451
|
var l;
|
|
447
452
|
if (i || s) return;
|
|
448
|
-
const e =
|
|
449
|
-
n && (I(o.current),
|
|
450
|
-
},
|
|
451
|
-
i || s || (I(o.current), A(e),
|
|
452
|
-
},
|
|
453
|
+
const e = Ts(o.current), t = ((l = window.getSelection()) == null ? void 0 : l.toString().trim()) || Ne.current, n = window.prompt(yl, xl);
|
|
454
|
+
n && (I(o.current), fs(o.current, e), vs(n, t), d());
|
|
455
|
+
}, it = (e) => {
|
|
456
|
+
i || s || (I(o.current), A(e), d());
|
|
457
|
+
}, Yr = (e) => {
|
|
453
458
|
var n;
|
|
454
|
-
const t = ((n = window.getSelection()) == null ? void 0 : n.toString().trim()) ||
|
|
455
|
-
|
|
456
|
-
},
|
|
459
|
+
const t = ((n = window.getSelection()) == null ? void 0 : n.toString().trim()) || Ne.current;
|
|
460
|
+
it(oo(e, t || An));
|
|
461
|
+
}, on = async (e) => ko && Rt ? Rt(e) : ys(e), rn = async () => {
|
|
457
462
|
if (i || s) return;
|
|
458
463
|
const e = document.createElement("input");
|
|
459
464
|
e.type = "file", e.accept = "image/*", e.onchange = async () => {
|
|
460
465
|
var l;
|
|
461
466
|
const t = (l = e.files) == null ? void 0 : l[0];
|
|
462
467
|
if (!t) return;
|
|
463
|
-
const n = await
|
|
464
|
-
I(o.current),
|
|
468
|
+
const n = await on(t);
|
|
469
|
+
I(o.current), pt(n, t.name), d();
|
|
465
470
|
}, e.click();
|
|
466
|
-
},
|
|
471
|
+
}, ln = (e = No, t = Io) => {
|
|
467
472
|
if (i || s || !a.table) return;
|
|
468
473
|
I(o.current);
|
|
469
|
-
const n =
|
|
470
|
-
if (
|
|
471
|
-
const l =
|
|
472
|
-
|
|
474
|
+
const n = xc(e, t);
|
|
475
|
+
if (q && a.trackChanges) {
|
|
476
|
+
const l = ft("insert", n, X);
|
|
477
|
+
ue([...w, l]), A(to(n, l.id));
|
|
473
478
|
} else
|
|
474
479
|
A(n);
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
const e =
|
|
480
|
+
d();
|
|
481
|
+
}, cn = () => {
|
|
482
|
+
const e = re.current.undo();
|
|
478
483
|
if (e === null || !o.current) {
|
|
479
|
-
h("undo"),
|
|
484
|
+
h("undo"), d();
|
|
480
485
|
return;
|
|
481
486
|
}
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
const e =
|
|
487
|
+
K(e);
|
|
488
|
+
}, sn = () => {
|
|
489
|
+
const e = re.current.redo();
|
|
485
490
|
if (e === null || !o.current) {
|
|
486
|
-
h("redo"),
|
|
491
|
+
h("redo"), d();
|
|
487
492
|
return;
|
|
488
493
|
}
|
|
489
|
-
|
|
490
|
-
},
|
|
494
|
+
K(e);
|
|
495
|
+
}, zr = (e) => {
|
|
491
496
|
if (i || s) return;
|
|
492
|
-
e.preventDefault(),
|
|
493
|
-
const t = a.graph ?
|
|
494
|
-
|
|
495
|
-
},
|
|
496
|
-
const t =
|
|
497
|
+
e.preventDefault(), ze((n) => n.open ? { ...n, open: !1 } : n);
|
|
498
|
+
const t = a.graph ? hs(e.target) : null;
|
|
499
|
+
J.current = t, Ir(!!t), Wt(!!(a.table && qn())), Ve({ open: !0, x: e.clientX, y: e.clientY });
|
|
500
|
+
}, ct = (e) => {
|
|
501
|
+
const t = J.current;
|
|
497
502
|
if (!t) return;
|
|
498
|
-
const n =
|
|
499
|
-
|
|
500
|
-
},
|
|
501
|
-
const t =
|
|
503
|
+
const n = co(t.getAttribute(Gn));
|
|
504
|
+
io(t, e, n.length ? n : Se), J.current = null, d();
|
|
505
|
+
}, an = (e) => {
|
|
506
|
+
const t = J.current;
|
|
502
507
|
if (!t) return;
|
|
503
|
-
const n =
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
const n =
|
|
508
|
+
const n = co(t.getAttribute(Gn));
|
|
509
|
+
br(n.length ? n : Se), Br(lo(t.getAttribute(Wi))), gr(e), Ze(!0);
|
|
510
|
+
}, $r = (e, t) => {
|
|
511
|
+
const n = J.current;
|
|
507
512
|
if (!n) return;
|
|
508
|
-
const l = n.getAttribute(
|
|
509
|
-
|
|
510
|
-
},
|
|
511
|
-
const e =
|
|
513
|
+
const l = n.getAttribute(Xi) ?? ro;
|
|
514
|
+
io(n, l, e, t), Ze(!1), d();
|
|
515
|
+
}, un = () => {
|
|
516
|
+
const e = Ce.current;
|
|
512
517
|
if (!(!e || !a.fullscreen)) {
|
|
513
518
|
if (document.fullscreenElement) {
|
|
514
519
|
document.exitFullscreen();
|
|
@@ -516,264 +521,264 @@ const mt = () => {
|
|
|
516
521
|
}
|
|
517
522
|
e.requestFullscreen();
|
|
518
523
|
}
|
|
519
|
-
},
|
|
520
|
-
const e =
|
|
524
|
+
}, qr = () => {
|
|
525
|
+
const e = J.current;
|
|
521
526
|
if (e) {
|
|
522
527
|
const t = document.createRange();
|
|
523
528
|
t.selectNodeContents(e);
|
|
524
529
|
const n = window.getSelection();
|
|
525
530
|
n == null || n.removeAllRanges(), n == null || n.addRange(t);
|
|
526
531
|
}
|
|
527
|
-
|
|
528
|
-
},
|
|
529
|
-
const e =
|
|
530
|
-
|
|
531
|
-
},
|
|
532
|
-
i || s || (e.preventDefault(),
|
|
533
|
-
},
|
|
532
|
+
le(!0);
|
|
533
|
+
}, _n = () => {
|
|
534
|
+
const e = !je;
|
|
535
|
+
Cr(e), e && o.current && $(ee(o.current)), Fe == null || Fe(e);
|
|
536
|
+
}, jr = (e) => {
|
|
537
|
+
i || s || (e.preventDefault(), Ve((t) => t.open ? { ...t, open: !1 } : t), ze({ open: !0, x: e.clientX, y: e.clientY }));
|
|
538
|
+
}, dn = () => {
|
|
534
539
|
if (i || s || !a.comments) return;
|
|
535
540
|
const e = window.prompt("Comment:");
|
|
536
541
|
if (!(e != null && e.trim())) return;
|
|
537
|
-
const t =
|
|
538
|
-
if (I(o.current), !
|
|
539
|
-
const l =
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
+
const t = zn("hl");
|
|
543
|
+
if (I(o.current), !Jc(t)) return;
|
|
544
|
+
const l = es(X, e.trim(), t);
|
|
545
|
+
ot([l, ...ae]), rt(!0), d();
|
|
546
|
+
}, Zr = [
|
|
542
547
|
{
|
|
543
|
-
id:
|
|
544
|
-
label:
|
|
545
|
-
onSelect: () =>
|
|
548
|
+
id: $l,
|
|
549
|
+
label: zl,
|
|
550
|
+
onSelect: () => zt(!0)
|
|
546
551
|
},
|
|
547
552
|
{
|
|
548
|
-
id:
|
|
549
|
-
label:
|
|
550
|
-
onSelect: () =>
|
|
553
|
+
id: jl,
|
|
554
|
+
label: ql,
|
|
555
|
+
onSelect: () => nt(!0)
|
|
551
556
|
}
|
|
552
|
-
],
|
|
553
|
-
const t =
|
|
554
|
-
!t || !a.table || e(t) &&
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
id: Zi,
|
|
558
|
-
label: ji,
|
|
559
|
-
onSelect: () => y((e) => Yn(e, "before"))
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
id: Ji,
|
|
563
|
-
label: Qi,
|
|
564
|
-
onSelect: () => y((e) => Yn(e, "after"))
|
|
565
|
-
},
|
|
557
|
+
], x = (e) => {
|
|
558
|
+
const t = qn();
|
|
559
|
+
!t || !a.table || e(t) && d();
|
|
560
|
+
}, Qr = a.table && mr ? [
|
|
566
561
|
{
|
|
567
562
|
id: tc,
|
|
568
563
|
label: ec,
|
|
569
|
-
onSelect: () =>
|
|
564
|
+
onSelect: () => x((e) => jn(e, "before"))
|
|
570
565
|
},
|
|
571
566
|
{
|
|
572
567
|
id: oc,
|
|
573
568
|
label: nc,
|
|
574
|
-
onSelect: () =>
|
|
569
|
+
onSelect: () => x((e) => jn(e, "after"))
|
|
575
570
|
},
|
|
576
571
|
{
|
|
577
572
|
id: lc,
|
|
578
573
|
label: rc,
|
|
579
|
-
onSelect: () =>
|
|
574
|
+
onSelect: () => x((e) => Zn(e, "before"))
|
|
580
575
|
},
|
|
581
576
|
{
|
|
582
577
|
id: cc,
|
|
583
578
|
label: ic,
|
|
584
|
-
onSelect: () =>
|
|
579
|
+
onSelect: () => x((e) => Zn(e, "after"))
|
|
585
580
|
},
|
|
586
581
|
{
|
|
587
582
|
id: ac,
|
|
588
583
|
label: sc,
|
|
589
|
-
onSelect: () =>
|
|
584
|
+
onSelect: () => x((e) => Xc(e))
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
id: _c,
|
|
588
|
+
label: uc,
|
|
589
|
+
onSelect: () => x((e) => Gc(e))
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
id: Tc,
|
|
593
|
+
label: dc,
|
|
594
|
+
onSelect: () => x((e) => Wc(e))
|
|
590
595
|
}
|
|
591
|
-
] : [],
|
|
592
|
-
...a.graph &&
|
|
593
|
-
{
|
|
594
|
-
id: Tl,
|
|
595
|
-
label: dl,
|
|
596
|
-
onSelect: () => lt("bar")
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
id: fl,
|
|
600
|
-
label: El,
|
|
601
|
-
onSelect: () => lt("line")
|
|
602
|
-
},
|
|
596
|
+
] : [], Jr = [
|
|
597
|
+
...a.graph && Nr ? [
|
|
603
598
|
{
|
|
604
599
|
id: pl,
|
|
605
600
|
label: ml,
|
|
606
|
-
onSelect: () =>
|
|
601
|
+
onSelect: () => ct("bar")
|
|
607
602
|
},
|
|
608
603
|
{
|
|
609
604
|
id: Ol,
|
|
610
605
|
label: Ll,
|
|
611
|
-
onSelect: () =>
|
|
606
|
+
onSelect: () => ct("line")
|
|
612
607
|
},
|
|
613
608
|
{
|
|
614
609
|
id: Nl,
|
|
615
610
|
label: Cl,
|
|
616
|
-
onSelect: () =>
|
|
611
|
+
onSelect: () => ct("pie")
|
|
617
612
|
},
|
|
618
613
|
{
|
|
619
614
|
id: Al,
|
|
620
615
|
label: Il,
|
|
621
|
-
onSelect:
|
|
616
|
+
onSelect: () => an("values")
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
id: gl,
|
|
620
|
+
label: hl,
|
|
621
|
+
onSelect: () => an("colors")
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
id: bl,
|
|
625
|
+
label: Rl,
|
|
626
|
+
onSelect: qr
|
|
622
627
|
}
|
|
623
628
|
] : [],
|
|
624
|
-
|
|
629
|
+
...Qr,
|
|
625
630
|
{
|
|
626
|
-
id:
|
|
627
|
-
label:
|
|
628
|
-
onSelect: () =>
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
id: Tc,
|
|
632
|
-
label: dc,
|
|
633
|
-
onSelect: () => R("italic")
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
id: fc,
|
|
637
|
-
label: Ec,
|
|
638
|
-
onSelect: () => R("underline")
|
|
631
|
+
id: Ec,
|
|
632
|
+
label: fc,
|
|
633
|
+
onSelect: () => b("bold")
|
|
639
634
|
},
|
|
640
635
|
{
|
|
641
636
|
id: pc,
|
|
642
637
|
label: mc,
|
|
643
|
-
onSelect: () =>
|
|
638
|
+
onSelect: () => b("italic")
|
|
644
639
|
},
|
|
645
640
|
{
|
|
646
641
|
id: Oc,
|
|
647
642
|
label: Lc,
|
|
648
|
-
onSelect: () =>
|
|
643
|
+
onSelect: () => b("underline")
|
|
649
644
|
},
|
|
650
645
|
{
|
|
651
646
|
id: Nc,
|
|
652
647
|
label: Cc,
|
|
653
|
-
onSelect: () =>
|
|
648
|
+
onSelect: () => b("strikethrough")
|
|
654
649
|
},
|
|
655
650
|
{
|
|
656
651
|
id: Ac,
|
|
657
652
|
label: Ic,
|
|
658
|
-
onSelect: () =>
|
|
653
|
+
onSelect: () => b("heading2")
|
|
659
654
|
},
|
|
660
655
|
{
|
|
661
656
|
id: gc,
|
|
662
657
|
label: hc,
|
|
663
|
-
onSelect: () =>
|
|
658
|
+
onSelect: () => b("bulletList")
|
|
664
659
|
},
|
|
665
660
|
{
|
|
666
661
|
id: bc,
|
|
667
662
|
label: Rc,
|
|
668
|
-
onSelect: () =>
|
|
663
|
+
onSelect: () => b("orderedList")
|
|
669
664
|
},
|
|
670
665
|
{
|
|
671
666
|
id: Bc,
|
|
672
667
|
label: Sc,
|
|
673
|
-
|
|
674
|
-
onSelect: () => Ae(!0)
|
|
668
|
+
onSelect: () => lt()
|
|
675
669
|
},
|
|
676
670
|
{
|
|
677
671
|
id: Mc,
|
|
678
672
|
label: Dc,
|
|
679
|
-
|
|
680
|
-
onSelect: () => ye(!0)
|
|
673
|
+
onSelect: () => b("clearFormat")
|
|
681
674
|
},
|
|
682
675
|
{
|
|
683
676
|
id: kc,
|
|
684
677
|
label: Hc,
|
|
678
|
+
disabled: !a.findReplace,
|
|
679
|
+
onSelect: () => he(!0)
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
id: Uc,
|
|
683
|
+
label: Pc,
|
|
684
|
+
disabled: !a.signature,
|
|
685
|
+
onSelect: () => Xe(!0)
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
id: wc,
|
|
689
|
+
label: vc,
|
|
685
690
|
disabled: !a.comments,
|
|
686
|
-
onSelect: () =>
|
|
691
|
+
onSelect: () => dn()
|
|
687
692
|
},
|
|
688
|
-
...
|
|
693
|
+
...Jt ? [
|
|
689
694
|
{
|
|
690
|
-
id:
|
|
691
|
-
label:
|
|
692
|
-
onSelect: () =>
|
|
695
|
+
id: Yl,
|
|
696
|
+
label: Vl,
|
|
697
|
+
onSelect: () => nt(!1)
|
|
693
698
|
}
|
|
694
699
|
] : []
|
|
695
|
-
],
|
|
700
|
+
], Tn = (e) => {
|
|
696
701
|
if (!o.current) return;
|
|
697
|
-
const t =
|
|
698
|
-
|
|
699
|
-
|
|
702
|
+
const t = jc(o.current.innerHTML, e);
|
|
703
|
+
K(t), ue(
|
|
704
|
+
w.map((n) => n.id === e ? { ...n, accepted: !0 } : n)
|
|
700
705
|
);
|
|
701
|
-
},
|
|
706
|
+
}, fn = (e) => {
|
|
702
707
|
if (!o.current) return;
|
|
703
|
-
const t =
|
|
704
|
-
|
|
705
|
-
|
|
708
|
+
const t = qc(o.current.innerHTML, e);
|
|
709
|
+
K(t), ue(
|
|
710
|
+
w.map((n) => n.id === e ? { ...n, rejected: !0 } : n)
|
|
706
711
|
);
|
|
707
|
-
},
|
|
708
|
-
const t = await
|
|
709
|
-
if (
|
|
710
|
-
const l =
|
|
711
|
-
|
|
712
|
+
}, En = async (e) => {
|
|
713
|
+
const t = await on(e), n = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
|
|
714
|
+
if (q && a.trackChanges) {
|
|
715
|
+
const l = ft("insert", n, X);
|
|
716
|
+
ue([...w, l]), A(to(n, l.id));
|
|
712
717
|
} else
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
},
|
|
718
|
+
pt(t);
|
|
719
|
+
d();
|
|
720
|
+
}, el = async (e) => {
|
|
716
721
|
if (i || s) return;
|
|
717
722
|
const t = e.clipboardData;
|
|
718
723
|
if (!t) return;
|
|
719
|
-
if (
|
|
720
|
-
const l =
|
|
724
|
+
if (vo) {
|
|
725
|
+
const l = cs(t);
|
|
721
726
|
if (l) {
|
|
722
727
|
e.preventDefault();
|
|
723
|
-
const T =
|
|
724
|
-
T && (A(T),
|
|
728
|
+
const T = ss(l);
|
|
729
|
+
T && (A(T), d());
|
|
725
730
|
const L = t.items;
|
|
726
|
-
if (
|
|
727
|
-
for (const
|
|
728
|
-
if (!
|
|
729
|
-
const C =
|
|
730
|
-
C && await
|
|
731
|
+
if (Ct && L)
|
|
732
|
+
for (const _ of Array.from(L)) {
|
|
733
|
+
if (!_.type.startsWith("image/")) continue;
|
|
734
|
+
const C = _.getAsFile();
|
|
735
|
+
C && await En(C);
|
|
731
736
|
}
|
|
732
737
|
return;
|
|
733
738
|
}
|
|
734
|
-
const u =
|
|
739
|
+
const u = as(t);
|
|
735
740
|
if (u) {
|
|
736
|
-
e.preventDefault(), A(u.replace(/\n/g, "<br />")),
|
|
741
|
+
e.preventDefault(), A(u.replace(/\n/g, "<br />")), d();
|
|
737
742
|
return;
|
|
738
743
|
}
|
|
739
744
|
}
|
|
740
|
-
if (!
|
|
745
|
+
if (!Ct) return;
|
|
741
746
|
const n = t.items;
|
|
742
747
|
if (n)
|
|
743
748
|
for (const l of Array.from(n)) {
|
|
744
749
|
if (!l.type.startsWith("image/")) continue;
|
|
745
750
|
e.preventDefault();
|
|
746
751
|
const u = l.getAsFile();
|
|
747
|
-
u && await
|
|
752
|
+
u && await En(u);
|
|
748
753
|
}
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
},
|
|
752
|
-
if (e.key ===
|
|
753
|
-
e.preventDefault(),
|
|
754
|
+
}, tl = (e) => {
|
|
755
|
+
b(e);
|
|
756
|
+
}, nl = (e) => {
|
|
757
|
+
if (e.key === Jl && v.visible && v.suggestion) {
|
|
758
|
+
e.preventDefault(), tn();
|
|
754
759
|
return;
|
|
755
760
|
}
|
|
756
|
-
if (e.key ===
|
|
757
|
-
|
|
761
|
+
if (e.key === ei) {
|
|
762
|
+
U();
|
|
758
763
|
return;
|
|
759
764
|
}
|
|
760
|
-
if (
|
|
761
|
-
|
|
765
|
+
if (Us(e.nativeEvent)) {
|
|
766
|
+
d();
|
|
762
767
|
return;
|
|
763
768
|
}
|
|
764
|
-
if (e.key ===
|
|
765
|
-
if (
|
|
766
|
-
e.preventDefault(),
|
|
769
|
+
if (e.key === ti) {
|
|
770
|
+
if (v.visible) {
|
|
771
|
+
e.preventDefault(), U();
|
|
767
772
|
return;
|
|
768
773
|
}
|
|
769
|
-
|
|
774
|
+
Ae([]), Z((t) => t.open ? { ...t, open: !1 } : t);
|
|
770
775
|
}
|
|
771
|
-
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() ===
|
|
772
|
-
e.preventDefault(), a.ai && (
|
|
776
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === ni) {
|
|
777
|
+
e.preventDefault(), a.ai && (f != null && f.enabled) && le(!0);
|
|
773
778
|
return;
|
|
774
779
|
}
|
|
775
|
-
(e.metaKey || e.ctrlKey) && e.key ===
|
|
776
|
-
},
|
|
780
|
+
(e.metaKey || e.ctrlKey) && e.key === oi && (e.preventDefault(), e.shiftKey ? sn() : cn());
|
|
781
|
+
}, ol = (e) => {
|
|
777
782
|
var n;
|
|
778
783
|
I(o.current);
|
|
779
784
|
const t = window.getSelection();
|
|
@@ -781,18 +786,18 @@ const mt = () => {
|
|
|
781
786
|
const u = t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/, " ");
|
|
782
787
|
t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent = u);
|
|
783
788
|
}
|
|
784
|
-
switch (
|
|
789
|
+
switch (xe(M), Ae([]), e.insert) {
|
|
785
790
|
case "heading1":
|
|
786
|
-
h("formatBlock",
|
|
791
|
+
h("formatBlock", Zi);
|
|
787
792
|
break;
|
|
788
793
|
case "heading2":
|
|
789
|
-
h("formatBlock",
|
|
794
|
+
h("formatBlock", ji);
|
|
790
795
|
break;
|
|
791
796
|
case "heading3":
|
|
792
|
-
h("formatBlock",
|
|
797
|
+
h("formatBlock", qi);
|
|
793
798
|
break;
|
|
794
799
|
case "paragraph":
|
|
795
|
-
h("formatBlock",
|
|
800
|
+
h("formatBlock", $i);
|
|
796
801
|
break;
|
|
797
802
|
case "bulletList":
|
|
798
803
|
h("insertUnorderedList");
|
|
@@ -801,130 +806,130 @@ const mt = () => {
|
|
|
801
806
|
h("insertOrderedList");
|
|
802
807
|
break;
|
|
803
808
|
case "checklist":
|
|
804
|
-
A(
|
|
809
|
+
A(Wn);
|
|
805
810
|
break;
|
|
806
811
|
case "quote":
|
|
807
|
-
h("formatBlock",
|
|
812
|
+
h("formatBlock", zi);
|
|
808
813
|
break;
|
|
809
814
|
case "code":
|
|
810
|
-
h("formatBlock",
|
|
815
|
+
h("formatBlock", Yi);
|
|
811
816
|
break;
|
|
812
817
|
case "callout":
|
|
813
|
-
A(
|
|
818
|
+
A(Vi);
|
|
814
819
|
break;
|
|
815
820
|
case "table":
|
|
816
|
-
|
|
821
|
+
ln();
|
|
817
822
|
return;
|
|
818
823
|
case "image":
|
|
819
|
-
|
|
824
|
+
rn();
|
|
820
825
|
return;
|
|
821
826
|
case "ai":
|
|
822
|
-
|
|
827
|
+
le(!0);
|
|
823
828
|
break;
|
|
824
829
|
case "titles":
|
|
825
|
-
A(
|
|
830
|
+
A(oo(Ns, Ne.current || An));
|
|
826
831
|
break;
|
|
827
832
|
case "excel":
|
|
828
|
-
A(
|
|
833
|
+
A(Is(As()));
|
|
829
834
|
break;
|
|
830
835
|
case "graph":
|
|
831
|
-
A(
|
|
836
|
+
A(gs(ro, Se));
|
|
832
837
|
break;
|
|
833
838
|
}
|
|
834
|
-
|
|
835
|
-
},
|
|
839
|
+
d();
|
|
840
|
+
}, mn = (e) => {
|
|
836
841
|
if (!o.current) return;
|
|
837
|
-
const t = window.getSelection(), n =
|
|
838
|
-
n &&
|
|
839
|
-
},
|
|
842
|
+
const t = window.getSelection(), n = fe((t == null ? void 0 : t.anchorNode) ?? null, o.current);
|
|
843
|
+
n && Yc(n, e) && (d(), _e());
|
|
844
|
+
}, rl = (e) => {
|
|
840
845
|
if (!o.current) return;
|
|
841
|
-
const t = window.getSelection(), n =
|
|
846
|
+
const t = window.getSelection(), n = fe((t == null ? void 0 : t.anchorNode) ?? null, o.current), l = o.current.querySelector(`.${Gi}`), u = n ?? (l instanceof HTMLElement ? l : null);
|
|
842
847
|
if (!u) {
|
|
843
848
|
e.preventDefault();
|
|
844
849
|
return;
|
|
845
850
|
}
|
|
846
|
-
|
|
847
|
-
},
|
|
848
|
-
if (!o.current || !
|
|
849
|
-
e.preventDefault(), e.dataTransfer.dropEffect =
|
|
850
|
-
const t =
|
|
851
|
-
if (!t || t ===
|
|
852
|
-
|
|
851
|
+
F.current = u, Tt(o.current), Qn(o.current, u), Vc(u), e.dataTransfer.setData(qs, js), e.dataTransfer.effectAllowed = To;
|
|
852
|
+
}, ll = (e) => {
|
|
853
|
+
if (!o.current || !F.current) return;
|
|
854
|
+
e.preventDefault(), e.dataTransfer.dropEffect = To;
|
|
855
|
+
const t = fe(e.target, o.current);
|
|
856
|
+
if (!t || t === F.current) {
|
|
857
|
+
eo(o.current, null, null);
|
|
853
858
|
return;
|
|
854
859
|
}
|
|
855
|
-
const n =
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
if (!o.current || !
|
|
860
|
+
const n = Jn(e.clientY, t);
|
|
861
|
+
eo(o.current, t, n);
|
|
862
|
+
}, il = (e) => {
|
|
863
|
+
if (!o.current || !F.current) return;
|
|
859
864
|
e.preventDefault();
|
|
860
|
-
const t =
|
|
861
|
-
t && t !== n && (
|
|
862
|
-
},
|
|
863
|
-
o.current &&
|
|
864
|
-
},
|
|
865
|
+
const t = fe(e.target, o.current), n = F.current;
|
|
866
|
+
t && t !== n && (Jn(e.clientY, t) === fi ? zc(n, t) : $c(n, t)) && (d(), _e()), Tt(o.current), F.current = null;
|
|
867
|
+
}, cl = () => {
|
|
868
|
+
o.current && Tt(o.current), F.current = null;
|
|
869
|
+
}, st = (e, t) => {
|
|
865
870
|
var l, u, T, L;
|
|
866
871
|
if (e === "divider")
|
|
867
|
-
return /* @__PURE__ */ r("span", { className:
|
|
872
|
+
return /* @__PURE__ */ r("span", { className: Ki }, `divider-${t}`);
|
|
868
873
|
if (e === "headingDropdown")
|
|
869
874
|
return /* @__PURE__ */ r(
|
|
870
|
-
|
|
875
|
+
Be,
|
|
871
876
|
{
|
|
872
877
|
title: "Heading",
|
|
873
|
-
options:
|
|
874
|
-
value:
|
|
878
|
+
options: Fi,
|
|
879
|
+
value: Ko || "p",
|
|
875
880
|
disabled: i || s,
|
|
876
|
-
onChange:
|
|
881
|
+
onChange: Xr
|
|
877
882
|
},
|
|
878
883
|
"heading"
|
|
879
884
|
);
|
|
880
|
-
if (e ===
|
|
885
|
+
if (e === hn)
|
|
881
886
|
return /* @__PURE__ */ r(
|
|
882
|
-
|
|
887
|
+
Be,
|
|
883
888
|
{
|
|
884
|
-
title:
|
|
885
|
-
options:
|
|
886
|
-
value:
|
|
889
|
+
title: ii,
|
|
890
|
+
options: li,
|
|
891
|
+
value: _r,
|
|
887
892
|
disabled: i || s,
|
|
888
|
-
onChange:
|
|
893
|
+
onChange: Gr
|
|
889
894
|
},
|
|
890
|
-
|
|
895
|
+
hn
|
|
891
896
|
);
|
|
892
|
-
if (e ===
|
|
897
|
+
if (e === gn)
|
|
893
898
|
return /* @__PURE__ */ r(
|
|
894
|
-
|
|
899
|
+
Be,
|
|
895
900
|
{
|
|
896
|
-
title:
|
|
897
|
-
options:
|
|
898
|
-
value:
|
|
901
|
+
title: ai,
|
|
902
|
+
options: si,
|
|
903
|
+
value: Tr,
|
|
899
904
|
disabled: i || s,
|
|
900
|
-
onChange:
|
|
905
|
+
onChange: Wr
|
|
901
906
|
},
|
|
902
|
-
|
|
907
|
+
gn
|
|
903
908
|
);
|
|
904
909
|
if (e === "textColor")
|
|
905
910
|
return /* @__PURE__ */ r(
|
|
906
|
-
|
|
911
|
+
uo,
|
|
907
912
|
{
|
|
908
913
|
title: "Text color",
|
|
909
914
|
type: "text",
|
|
910
|
-
value:
|
|
915
|
+
value: qo,
|
|
911
916
|
disabled: i || s,
|
|
912
|
-
onChange: (
|
|
913
|
-
I(o.current),
|
|
917
|
+
onChange: (_) => {
|
|
918
|
+
I(o.current), Ds(_), jo(_), d();
|
|
914
919
|
}
|
|
915
920
|
},
|
|
916
921
|
"textColor"
|
|
917
922
|
);
|
|
918
923
|
if (e === "highlightColor")
|
|
919
924
|
return /* @__PURE__ */ r(
|
|
920
|
-
|
|
925
|
+
uo,
|
|
921
926
|
{
|
|
922
927
|
title: "Highlight color",
|
|
923
928
|
type: "highlight",
|
|
924
|
-
value:
|
|
929
|
+
value: Zo,
|
|
925
930
|
disabled: i || s,
|
|
926
|
-
onChange: (
|
|
927
|
-
I(o.current),
|
|
931
|
+
onChange: (_) => {
|
|
932
|
+
I(o.current), Ms(_), Qo(_), d();
|
|
928
933
|
}
|
|
929
934
|
},
|
|
930
935
|
"highlightColor"
|
|
@@ -933,12 +938,12 @@ const mt = () => {
|
|
|
933
938
|
return /* @__PURE__ */ r(
|
|
934
939
|
N,
|
|
935
940
|
{
|
|
936
|
-
icon:
|
|
941
|
+
icon: E.link,
|
|
937
942
|
title: "Insert link",
|
|
938
943
|
hint: O.link,
|
|
939
944
|
onHint: m,
|
|
940
945
|
disabled: i || s,
|
|
941
|
-
onClick:
|
|
946
|
+
onClick: lt
|
|
942
947
|
},
|
|
943
948
|
"link"
|
|
944
949
|
);
|
|
@@ -948,210 +953,210 @@ const mt = () => {
|
|
|
948
953
|
{
|
|
949
954
|
hint: O.image,
|
|
950
955
|
onHint: m,
|
|
951
|
-
icon:
|
|
956
|
+
icon: E.image,
|
|
952
957
|
title: "Insert image",
|
|
953
958
|
disabled: i || s,
|
|
954
959
|
onClick: () => {
|
|
955
|
-
|
|
960
|
+
rn();
|
|
956
961
|
}
|
|
957
962
|
},
|
|
958
963
|
"image"
|
|
959
964
|
);
|
|
960
|
-
if (e ===
|
|
965
|
+
if (e === Re)
|
|
961
966
|
return /* @__PURE__ */ r(
|
|
962
967
|
N,
|
|
963
968
|
{
|
|
964
|
-
icon:
|
|
969
|
+
icon: E.checklist,
|
|
965
970
|
title: "Checklist",
|
|
966
971
|
hint: O.checklist,
|
|
967
972
|
onHint: m,
|
|
968
973
|
disabled: i || s,
|
|
969
|
-
onClick: () =>
|
|
974
|
+
onClick: () => b(Re)
|
|
970
975
|
},
|
|
971
|
-
|
|
976
|
+
Re
|
|
972
977
|
);
|
|
973
978
|
if (e === "table")
|
|
974
979
|
return a.table ? /* @__PURE__ */ r(
|
|
975
|
-
|
|
980
|
+
_a,
|
|
976
981
|
{
|
|
977
|
-
icon:
|
|
982
|
+
icon: E.table,
|
|
978
983
|
disabled: i || s,
|
|
979
|
-
onSelect:
|
|
984
|
+
onSelect: ln
|
|
980
985
|
},
|
|
981
986
|
"table"
|
|
982
987
|
) : null;
|
|
983
|
-
if (e ===
|
|
988
|
+
if (e === Rn)
|
|
984
989
|
return a.titles ? /* @__PURE__ */ r(
|
|
985
|
-
|
|
990
|
+
da,
|
|
986
991
|
{
|
|
987
|
-
icon:
|
|
992
|
+
icon: E.titles,
|
|
988
993
|
disabled: i || s,
|
|
989
|
-
pluginColor: (l =
|
|
994
|
+
pluginColor: (l = me.get("titles")) == null ? void 0 : l.color,
|
|
990
995
|
hint: O.titles,
|
|
991
996
|
onHint: m,
|
|
992
|
-
onSelect:
|
|
997
|
+
onSelect: Yr
|
|
993
998
|
},
|
|
994
|
-
|
|
999
|
+
Rn
|
|
995
1000
|
) : null;
|
|
996
|
-
if (e ===
|
|
1001
|
+
if (e === bn)
|
|
997
1002
|
return a.excel ? /* @__PURE__ */ r(
|
|
998
|
-
|
|
1003
|
+
Ta,
|
|
999
1004
|
{
|
|
1000
|
-
icon:
|
|
1005
|
+
icon: E.excel,
|
|
1001
1006
|
disabled: i || s,
|
|
1002
|
-
pluginColor: (u =
|
|
1007
|
+
pluginColor: (u = me.get("excel")) == null ? void 0 : u.color,
|
|
1003
1008
|
hint: O.excel,
|
|
1004
1009
|
onHint: m,
|
|
1005
|
-
onInsert:
|
|
1010
|
+
onInsert: it
|
|
1006
1011
|
},
|
|
1007
|
-
|
|
1012
|
+
bn
|
|
1008
1013
|
) : null;
|
|
1009
|
-
if (e ===
|
|
1014
|
+
if (e === Sn)
|
|
1010
1015
|
return a.graph ? /* @__PURE__ */ r(
|
|
1011
|
-
|
|
1016
|
+
fa,
|
|
1012
1017
|
{
|
|
1013
|
-
icon:
|
|
1018
|
+
icon: E.graph,
|
|
1014
1019
|
disabled: i || s,
|
|
1015
|
-
pluginColor: (T =
|
|
1020
|
+
pluginColor: (T = me.get("graph")) == null ? void 0 : T.color,
|
|
1016
1021
|
hint: O.graph,
|
|
1017
1022
|
onHint: m,
|
|
1018
|
-
onInsert:
|
|
1023
|
+
onInsert: it
|
|
1019
1024
|
},
|
|
1020
|
-
|
|
1025
|
+
Sn
|
|
1021
1026
|
) : null;
|
|
1022
|
-
if (e ===
|
|
1027
|
+
if (e === Bn)
|
|
1023
1028
|
return a.theme ? /* @__PURE__ */ r(
|
|
1024
|
-
|
|
1029
|
+
ma,
|
|
1025
1030
|
{
|
|
1026
|
-
icon:
|
|
1031
|
+
icon: E.theme,
|
|
1027
1032
|
disabled: i,
|
|
1028
|
-
pluginColor: (L =
|
|
1033
|
+
pluginColor: (L = me.get("theme")) == null ? void 0 : L.color,
|
|
1029
1034
|
hint: O.theme,
|
|
1030
1035
|
onHint: m,
|
|
1031
|
-
value:
|
|
1032
|
-
onChange: (
|
|
1033
|
-
|
|
1036
|
+
value: Zt,
|
|
1037
|
+
onChange: (_) => {
|
|
1038
|
+
Mr(_), ve == null || ve(_), bs(Ce.current, _);
|
|
1034
1039
|
}
|
|
1035
1040
|
},
|
|
1036
|
-
|
|
1041
|
+
Bn
|
|
1037
1042
|
) : null;
|
|
1038
|
-
if (e ===
|
|
1043
|
+
if (e === Dn)
|
|
1039
1044
|
return a.fullscreen ? /* @__PURE__ */ r(
|
|
1040
1045
|
N,
|
|
1041
1046
|
{
|
|
1042
|
-
icon:
|
|
1043
|
-
title:
|
|
1047
|
+
icon: E.fullscreen,
|
|
1048
|
+
title: Qt ? Pl : Ul,
|
|
1044
1049
|
hint: O.fullscreen,
|
|
1045
1050
|
onHint: m,
|
|
1046
|
-
active:
|
|
1051
|
+
active: Qt,
|
|
1047
1052
|
disabled: i,
|
|
1048
|
-
onClick:
|
|
1053
|
+
onClick: un
|
|
1049
1054
|
},
|
|
1050
|
-
|
|
1055
|
+
Dn
|
|
1051
1056
|
) : null;
|
|
1052
|
-
if (e ===
|
|
1057
|
+
if (e === Mn)
|
|
1053
1058
|
return a.outline ? /* @__PURE__ */ r(
|
|
1054
1059
|
N,
|
|
1055
1060
|
{
|
|
1056
|
-
icon:
|
|
1057
|
-
title:
|
|
1061
|
+
icon: E.outline,
|
|
1062
|
+
title: vl,
|
|
1058
1063
|
hint: O.outline,
|
|
1059
1064
|
onHint: m,
|
|
1060
|
-
active:
|
|
1065
|
+
active: je,
|
|
1061
1066
|
disabled: i,
|
|
1062
|
-
onClick:
|
|
1067
|
+
onClick: _n
|
|
1063
1068
|
},
|
|
1064
|
-
|
|
1069
|
+
Mn
|
|
1065
1070
|
) : null;
|
|
1066
|
-
if (e ===
|
|
1071
|
+
if (e === Hn)
|
|
1067
1072
|
return a.htmlSource ? /* @__PURE__ */ r(
|
|
1068
1073
|
N,
|
|
1069
1074
|
{
|
|
1070
|
-
className:
|
|
1071
|
-
icon: /* @__PURE__ */ r("span", { className:
|
|
1072
|
-
title:
|
|
1075
|
+
className: yn,
|
|
1076
|
+
icon: /* @__PURE__ */ r("span", { className: xn, children: Kl }),
|
|
1077
|
+
title: wl,
|
|
1073
1078
|
hint: O.htmlSource,
|
|
1074
1079
|
onHint: m,
|
|
1075
|
-
active:
|
|
1080
|
+
active: se,
|
|
1076
1081
|
disabled: i,
|
|
1077
1082
|
onClick: () => {
|
|
1078
|
-
var
|
|
1079
|
-
if (
|
|
1080
|
-
s ||
|
|
1083
|
+
var _;
|
|
1084
|
+
if (se) {
|
|
1085
|
+
s || K(xt), yt(!1);
|
|
1081
1086
|
return;
|
|
1082
1087
|
}
|
|
1083
|
-
|
|
1088
|
+
Xt(((_ = o.current) == null ? void 0 : _.innerHTML) ?? g ?? M), yt(!0);
|
|
1084
1089
|
}
|
|
1085
1090
|
},
|
|
1086
|
-
|
|
1091
|
+
Hn
|
|
1087
1092
|
) : null;
|
|
1088
|
-
if (e ===
|
|
1093
|
+
if (e === kn)
|
|
1089
1094
|
return a.signature ? /* @__PURE__ */ r(
|
|
1090
1095
|
N,
|
|
1091
1096
|
{
|
|
1092
|
-
icon:
|
|
1097
|
+
icon: E.signature,
|
|
1093
1098
|
title: "Sign pad",
|
|
1094
1099
|
hint: O.signature,
|
|
1095
1100
|
onHint: m,
|
|
1096
|
-
active:
|
|
1101
|
+
active: Ft,
|
|
1097
1102
|
disabled: i || s,
|
|
1098
|
-
onClick: () =>
|
|
1103
|
+
onClick: () => Xe(!0)
|
|
1099
1104
|
},
|
|
1100
|
-
|
|
1105
|
+
kn
|
|
1101
1106
|
) : null;
|
|
1102
|
-
if (e ===
|
|
1107
|
+
if (e === Pn)
|
|
1103
1108
|
return a.findReplace ? /* @__PURE__ */ r(
|
|
1104
1109
|
N,
|
|
1105
1110
|
{
|
|
1106
|
-
icon:
|
|
1111
|
+
icon: E.findReplace,
|
|
1107
1112
|
title: "Find and replace",
|
|
1108
1113
|
hint: O.findReplace,
|
|
1109
1114
|
onHint: m,
|
|
1110
|
-
active:
|
|
1115
|
+
active: Ge,
|
|
1111
1116
|
disabled: i || s,
|
|
1112
1117
|
onClick: () => {
|
|
1113
|
-
|
|
1118
|
+
Ge ? he(!1) : nn(be);
|
|
1114
1119
|
}
|
|
1115
1120
|
},
|
|
1116
|
-
|
|
1121
|
+
Pn
|
|
1117
1122
|
) : null;
|
|
1118
|
-
if (e ===
|
|
1123
|
+
if (e === Un)
|
|
1119
1124
|
return a.findReplace ? /* @__PURE__ */ r(
|
|
1120
|
-
|
|
1125
|
+
Be,
|
|
1121
1126
|
{
|
|
1122
|
-
title:
|
|
1123
|
-
options:
|
|
1124
|
-
value:
|
|
1127
|
+
title: _i,
|
|
1128
|
+
options: ui,
|
|
1129
|
+
value: fr,
|
|
1125
1130
|
disabled: i || s,
|
|
1126
|
-
onChange:
|
|
1131
|
+
onChange: Vr
|
|
1127
1132
|
},
|
|
1128
|
-
|
|
1133
|
+
Un
|
|
1129
1134
|
) : null;
|
|
1130
|
-
if (e ===
|
|
1135
|
+
if (e === vn)
|
|
1131
1136
|
return a.horizontalRule ? /* @__PURE__ */ r(
|
|
1132
1137
|
N,
|
|
1133
1138
|
{
|
|
1134
|
-
icon:
|
|
1139
|
+
icon: E.horizontalRule,
|
|
1135
1140
|
title: "Horizontal rule",
|
|
1136
1141
|
hint: O.horizontalRule,
|
|
1137
1142
|
onHint: m,
|
|
1138
1143
|
disabled: i || s,
|
|
1139
1144
|
onClick: () => {
|
|
1140
|
-
I(o.current), A("<hr />"),
|
|
1145
|
+
I(o.current), A("<hr />"), d();
|
|
1141
1146
|
}
|
|
1142
1147
|
},
|
|
1143
|
-
|
|
1148
|
+
vn
|
|
1144
1149
|
) : null;
|
|
1145
1150
|
if (e === "undo")
|
|
1146
1151
|
return /* @__PURE__ */ r(
|
|
1147
1152
|
N,
|
|
1148
1153
|
{
|
|
1149
|
-
icon:
|
|
1154
|
+
icon: E.undo,
|
|
1150
1155
|
title: "Undo",
|
|
1151
1156
|
hint: O.undo,
|
|
1152
1157
|
onHint: m,
|
|
1153
1158
|
disabled: i || s,
|
|
1154
|
-
onClick:
|
|
1159
|
+
onClick: cn
|
|
1155
1160
|
},
|
|
1156
1161
|
"undo"
|
|
1157
1162
|
);
|
|
@@ -1159,12 +1164,12 @@ const mt = () => {
|
|
|
1159
1164
|
return /* @__PURE__ */ r(
|
|
1160
1165
|
N,
|
|
1161
1166
|
{
|
|
1162
|
-
icon:
|
|
1167
|
+
icon: E.redo,
|
|
1163
1168
|
title: "Redo",
|
|
1164
1169
|
hint: O.redo,
|
|
1165
1170
|
onHint: m,
|
|
1166
1171
|
disabled: i || s,
|
|
1167
|
-
onClick:
|
|
1172
|
+
onClick: sn
|
|
1168
1173
|
},
|
|
1169
1174
|
"redo"
|
|
1170
1175
|
);
|
|
@@ -1172,13 +1177,13 @@ const mt = () => {
|
|
|
1172
1177
|
return a.trackChanges ? /* @__PURE__ */ r(
|
|
1173
1178
|
N,
|
|
1174
1179
|
{
|
|
1175
|
-
icon:
|
|
1180
|
+
icon: E.trackChanges,
|
|
1176
1181
|
title: "Track changes",
|
|
1177
1182
|
hint: O.trackChanges,
|
|
1178
1183
|
onHint: m,
|
|
1179
|
-
active:
|
|
1184
|
+
active: q,
|
|
1180
1185
|
disabled: i || s,
|
|
1181
|
-
onClick: () =>
|
|
1186
|
+
onClick: () => Kr(!q)
|
|
1182
1187
|
},
|
|
1183
1188
|
"trackChanges"
|
|
1184
1189
|
) : null;
|
|
@@ -1186,343 +1191,353 @@ const mt = () => {
|
|
|
1186
1191
|
return a.comments ? /* @__PURE__ */ r(
|
|
1187
1192
|
N,
|
|
1188
1193
|
{
|
|
1189
|
-
icon:
|
|
1194
|
+
icon: E.comments,
|
|
1190
1195
|
title: "Comments",
|
|
1191
1196
|
hint: O.comments,
|
|
1192
1197
|
onHint: m,
|
|
1193
|
-
active:
|
|
1198
|
+
active: qe,
|
|
1194
1199
|
disabled: i || s,
|
|
1195
1200
|
onClick: () => {
|
|
1196
|
-
|
|
1201
|
+
qe ? rt(!1) : dn();
|
|
1197
1202
|
}
|
|
1198
1203
|
},
|
|
1199
1204
|
"comments"
|
|
1200
1205
|
) : null;
|
|
1201
1206
|
if (e === "code") {
|
|
1202
|
-
const
|
|
1207
|
+
const _ = _t.code;
|
|
1203
1208
|
return /* @__PURE__ */ r(
|
|
1204
1209
|
N,
|
|
1205
1210
|
{
|
|
1206
|
-
className:
|
|
1207
|
-
icon: /* @__PURE__ */
|
|
1208
|
-
|
|
1209
|
-
/* @__PURE__ */ r("span", { className:
|
|
1211
|
+
className: yn,
|
|
1212
|
+
icon: /* @__PURE__ */ B(dl, { children: [
|
|
1213
|
+
E.code,
|
|
1214
|
+
/* @__PURE__ */ r("span", { className: xn, children: Fl })
|
|
1210
1215
|
] }),
|
|
1211
|
-
title:
|
|
1216
|
+
title: _.title,
|
|
1212
1217
|
hint: O.code,
|
|
1213
1218
|
onHint: m,
|
|
1214
|
-
active:
|
|
1219
|
+
active: ye.has(e),
|
|
1215
1220
|
disabled: i || s,
|
|
1216
|
-
onClick: () =>
|
|
1221
|
+
onClick: () => b(e)
|
|
1217
1222
|
},
|
|
1218
1223
|
"code"
|
|
1219
1224
|
);
|
|
1220
1225
|
}
|
|
1221
1226
|
if (e === "ai") {
|
|
1222
|
-
if (!a.ai || !(
|
|
1223
|
-
const
|
|
1224
|
-
return /* @__PURE__ */
|
|
1227
|
+
if (!a.ai || !(f != null && f.enabled)) return null;
|
|
1228
|
+
const _ = me.get("ai");
|
|
1229
|
+
return /* @__PURE__ */ B(
|
|
1225
1230
|
"button",
|
|
1226
1231
|
{
|
|
1227
1232
|
type: "button",
|
|
1228
|
-
className:
|
|
1229
|
-
title:
|
|
1230
|
-
style:
|
|
1231
|
-
"aria-label":
|
|
1232
|
-
"aria-pressed":
|
|
1233
|
+
className: _ ? `${Xn} ${yi}` : Xn,
|
|
1234
|
+
title: ut,
|
|
1235
|
+
style: _ ? { "--ink-plugin-color": _.color } : void 0,
|
|
1236
|
+
"aria-label": ut,
|
|
1237
|
+
"aria-pressed": Pt,
|
|
1233
1238
|
disabled: i || s,
|
|
1234
1239
|
onMouseEnter: () => m(O.ai),
|
|
1235
|
-
onMouseLeave: () => m(
|
|
1240
|
+
onMouseLeave: () => m(M),
|
|
1236
1241
|
onMouseDown: (C) => {
|
|
1237
1242
|
C.preventDefault();
|
|
1238
1243
|
},
|
|
1239
|
-
onClick: () =>
|
|
1244
|
+
onClick: () => le((C) => !C),
|
|
1240
1245
|
children: [
|
|
1241
|
-
/* @__PURE__ */ r("span", { className:
|
|
1242
|
-
|
|
1246
|
+
/* @__PURE__ */ r("span", { className: xi, "aria-hidden": "true" }),
|
|
1247
|
+
ut
|
|
1243
1248
|
]
|
|
1244
1249
|
},
|
|
1245
1250
|
"ai"
|
|
1246
1251
|
);
|
|
1247
1252
|
}
|
|
1248
|
-
const n =
|
|
1253
|
+
const n = _t[e];
|
|
1249
1254
|
return n ? /* @__PURE__ */ r(
|
|
1250
1255
|
N,
|
|
1251
1256
|
{
|
|
1252
|
-
icon:
|
|
1257
|
+
icon: E[e] ?? e.slice(0, 1).toUpperCase(),
|
|
1253
1258
|
title: n.title,
|
|
1254
1259
|
hint: O[e],
|
|
1255
1260
|
onHint: m,
|
|
1256
|
-
active:
|
|
1261
|
+
active: ye.has(e),
|
|
1257
1262
|
disabled: i || s,
|
|
1258
|
-
onClick: () =>
|
|
1263
|
+
onClick: () => b(e)
|
|
1259
1264
|
},
|
|
1260
1265
|
e
|
|
1261
1266
|
) : null;
|
|
1262
|
-
},
|
|
1263
|
-
return /* @__PURE__ */
|
|
1267
|
+
}, pn = typeof De == "number" ? `${De}px` : De, sl = typeof Me == "number" ? `${Me}px` : Me, al = !!(f != null && f.enabled && Pt), ul = Q.slice(p, y.fitCount), at = Q.slice(y.fitCount);
|
|
1268
|
+
return /* @__PURE__ */ B(
|
|
1264
1269
|
"div",
|
|
1265
1270
|
{
|
|
1266
|
-
ref:
|
|
1267
|
-
className:
|
|
1268
|
-
"data-testid":
|
|
1271
|
+
ref: Ce,
|
|
1272
|
+
className: Kc(Qi, Eo),
|
|
1273
|
+
"data-testid": mo,
|
|
1269
1274
|
"data-disabled": i || void 0,
|
|
1270
|
-
"data-variant":
|
|
1271
|
-
"data-chrome":
|
|
1272
|
-
"data-color-mode":
|
|
1273
|
-
"data-
|
|
1274
|
-
"data-
|
|
1275
|
-
|
|
1276
|
-
...
|
|
1275
|
+
"data-variant": pe,
|
|
1276
|
+
"data-chrome": Lo,
|
|
1277
|
+
"data-color-mode": Qe,
|
|
1278
|
+
"data-ink-theme": Zt,
|
|
1279
|
+
"data-premium": Y.active || void 0,
|
|
1280
|
+
"data-wysiwyg": Po || void 0,
|
|
1281
|
+
style: { ...Uo, ...So },
|
|
1282
|
+
...Bo,
|
|
1277
1283
|
children: [
|
|
1278
|
-
|
|
1279
|
-
|
|
1284
|
+
Jt ? /* @__PURE__ */ r("div", { className: Ri, children: /* @__PURE__ */ r(
|
|
1285
|
+
Bs,
|
|
1280
1286
|
{
|
|
1281
1287
|
type: "button",
|
|
1282
|
-
"aria-label":
|
|
1283
|
-
onClick: () =>
|
|
1284
|
-
children:
|
|
1288
|
+
"aria-label": Gl,
|
|
1289
|
+
onClick: () => nt(!1),
|
|
1290
|
+
children: Xl
|
|
1285
1291
|
}
|
|
1286
|
-
) }) : /* @__PURE__ */
|
|
1292
|
+
) }) : /* @__PURE__ */ B(
|
|
1287
1293
|
"div",
|
|
1288
1294
|
{
|
|
1289
|
-
className:
|
|
1295
|
+
className: bi,
|
|
1290
1296
|
role: "toolbar",
|
|
1291
1297
|
"aria-label": "Ink formatting toolbar",
|
|
1292
|
-
onContextMenu:
|
|
1293
|
-
onDoubleClick:
|
|
1298
|
+
onContextMenu: jr,
|
|
1299
|
+
onDoubleClick: un,
|
|
1294
1300
|
onMouseOver: (e) => {
|
|
1295
1301
|
const t = e.target.closest("button");
|
|
1296
1302
|
if (!(t instanceof HTMLElement)) return;
|
|
1297
|
-
const n = t.getAttribute("title") || t.getAttribute("aria-label") ||
|
|
1303
|
+
const n = t.getAttribute("title") || t.getAttribute("aria-label") || M;
|
|
1298
1304
|
n && m(n);
|
|
1299
1305
|
},
|
|
1300
|
-
onMouseLeave: () => m(
|
|
1306
|
+
onMouseLeave: () => m(M),
|
|
1301
1307
|
children: [
|
|
1302
|
-
/* @__PURE__ */ r("div", { className:
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
|
|
1305
|
-
|
|
1308
|
+
/* @__PURE__ */ r("div", { className: Si, ref: y.measureRef, "aria-hidden": !0, children: Q.map(st) }),
|
|
1309
|
+
/* @__PURE__ */ B("div", { className: Bi, ref: y.rowRef, children: [
|
|
1310
|
+
ul.map(st),
|
|
1311
|
+
R != null && R.collaborators && R.showPresenceStack !== !1 ? /* @__PURE__ */ r(
|
|
1312
|
+
pa,
|
|
1313
|
+
{
|
|
1314
|
+
collaborators: R.collaborators,
|
|
1315
|
+
maxAvatars: R.maxAvatars || 4,
|
|
1316
|
+
onFollow: R.onFollow
|
|
1317
|
+
}
|
|
1318
|
+
) : null,
|
|
1319
|
+
at.length > p ? /* @__PURE__ */ r("span", { [Di]: "", children: /* @__PURE__ */ r(
|
|
1306
1320
|
N,
|
|
1307
1321
|
{
|
|
1308
1322
|
icon: "⋯",
|
|
1309
|
-
title:
|
|
1310
|
-
hint:
|
|
1323
|
+
title: In,
|
|
1324
|
+
hint: In,
|
|
1311
1325
|
onHint: m,
|
|
1312
|
-
active:
|
|
1326
|
+
active: y.overflowOpen,
|
|
1313
1327
|
disabled: i,
|
|
1314
|
-
onClick: () =>
|
|
1328
|
+
onClick: () => y.setOverflowOpen((e) => !e)
|
|
1315
1329
|
}
|
|
1316
1330
|
) }) : null
|
|
1317
1331
|
] }),
|
|
1318
|
-
|
|
1319
|
-
|
|
1332
|
+
y.overflowOpen && at.length > p ? /* @__PURE__ */ r("div", { className: Mi, children: at.map(st) }) : null,
|
|
1333
|
+
jt ? /* @__PURE__ */ r("p", { className: Hi, children: jt }) : null
|
|
1320
1334
|
]
|
|
1321
1335
|
}
|
|
1322
1336
|
),
|
|
1323
1337
|
/* @__PURE__ */ r(
|
|
1324
|
-
|
|
1338
|
+
aa,
|
|
1325
1339
|
{
|
|
1326
|
-
open:
|
|
1327
|
-
options:
|
|
1328
|
-
visibleItems:
|
|
1329
|
-
onToggle:
|
|
1330
|
-
onClose: () =>
|
|
1340
|
+
open: Lr,
|
|
1341
|
+
options: Pr,
|
|
1342
|
+
visibleItems: Q,
|
|
1343
|
+
onToggle: wr,
|
|
1344
|
+
onClose: () => zt(!1)
|
|
1331
1345
|
}
|
|
1332
1346
|
),
|
|
1333
1347
|
/* @__PURE__ */ r(
|
|
1334
|
-
|
|
1348
|
+
Ea,
|
|
1335
1349
|
{
|
|
1336
|
-
open:
|
|
1337
|
-
mode:
|
|
1338
|
-
points:
|
|
1339
|
-
colors:
|
|
1340
|
-
onClose: () =>
|
|
1341
|
-
onApply:
|
|
1350
|
+
open: Ar,
|
|
1351
|
+
mode: hr,
|
|
1352
|
+
points: Rr,
|
|
1353
|
+
colors: Sr,
|
|
1354
|
+
onClose: () => Ze(!1),
|
|
1355
|
+
onApply: $r
|
|
1342
1356
|
}
|
|
1343
1357
|
),
|
|
1344
1358
|
/* @__PURE__ */ r(
|
|
1345
|
-
|
|
1359
|
+
ca,
|
|
1346
1360
|
{
|
|
1347
|
-
open:
|
|
1348
|
-
onClose: () =>
|
|
1361
|
+
open: Ft,
|
|
1362
|
+
onClose: () => Xe(!1),
|
|
1349
1363
|
onConfirm: (e) => {
|
|
1350
|
-
I(o.current),
|
|
1364
|
+
I(o.current), pt(e), d();
|
|
1351
1365
|
}
|
|
1352
1366
|
}
|
|
1353
1367
|
),
|
|
1354
1368
|
/* @__PURE__ */ r(
|
|
1355
|
-
|
|
1369
|
+
sa,
|
|
1356
1370
|
{
|
|
1357
|
-
open:
|
|
1358
|
-
focusField:
|
|
1359
|
-
onClose: () =>
|
|
1371
|
+
open: Ge,
|
|
1372
|
+
focusField: ar,
|
|
1373
|
+
onClose: () => he(!1),
|
|
1360
1374
|
onReplace: (e, t, n) => {
|
|
1361
1375
|
if (!o.current) return;
|
|
1362
|
-
const l =
|
|
1363
|
-
|
|
1376
|
+
const l = ds(o.current.innerHTML, e, t, n);
|
|
1377
|
+
K(l);
|
|
1364
1378
|
}
|
|
1365
1379
|
}
|
|
1366
1380
|
),
|
|
1367
|
-
|
|
1368
|
-
|
|
1381
|
+
q && a.trackChanges ? /* @__PURE__ */ r(
|
|
1382
|
+
ia,
|
|
1369
1383
|
{
|
|
1370
|
-
changes:
|
|
1371
|
-
onAccept:
|
|
1372
|
-
onReject:
|
|
1373
|
-
onAcceptAll: () =>
|
|
1374
|
-
onRejectAll: () =>
|
|
1384
|
+
changes: w,
|
|
1385
|
+
onAccept: Tn,
|
|
1386
|
+
onReject: fn,
|
|
1387
|
+
onAcceptAll: () => w.forEach((e) => Tn(e.id)),
|
|
1388
|
+
onRejectAll: () => w.forEach((e) => fn(e.id))
|
|
1375
1389
|
}
|
|
1376
1390
|
) : null,
|
|
1377
|
-
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
|
|
1380
|
-
|
|
1391
|
+
pe === "agent" ? /* @__PURE__ */ r("div", { className: "Ink-Editor__agent-bar", role: "status", children: Wl }) : null,
|
|
1392
|
+
/* @__PURE__ */ B("div", { className: ki, children: [
|
|
1393
|
+
kr ? /* @__PURE__ */ r(
|
|
1394
|
+
la,
|
|
1381
1395
|
{
|
|
1382
|
-
items:
|
|
1383
|
-
activeIndex:
|
|
1384
|
-
onHide:
|
|
1396
|
+
items: Vo,
|
|
1397
|
+
activeIndex: Yo,
|
|
1398
|
+
onHide: _n,
|
|
1385
1399
|
onSelect: (e) => {
|
|
1386
|
-
o.current && (
|
|
1400
|
+
o.current && (rs(o.current, e), zo(e));
|
|
1387
1401
|
}
|
|
1388
1402
|
}
|
|
1389
1403
|
) : null,
|
|
1390
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ B("div", { className: Pi, children: [
|
|
1391
1405
|
a.blocks ? /* @__PURE__ */ r(
|
|
1392
|
-
|
|
1406
|
+
$s,
|
|
1393
1407
|
{
|
|
1394
|
-
visible:
|
|
1395
|
-
top:
|
|
1396
|
-
onMoveUp: () =>
|
|
1397
|
-
onMoveDown: () =>
|
|
1398
|
-
onDragStart:
|
|
1408
|
+
visible: ir && !i && !s,
|
|
1409
|
+
top: rr,
|
|
1410
|
+
onMoveUp: () => mn("up"),
|
|
1411
|
+
onMoveDown: () => mn("down"),
|
|
1412
|
+
onDragStart: rl
|
|
1399
1413
|
}
|
|
1400
1414
|
) : null,
|
|
1415
|
+
R != null && R.collaborators && R.showRemoteCursors !== !1 ? /* @__PURE__ */ r(La, { collaborators: R.collaborators }) : null,
|
|
1401
1416
|
/* @__PURE__ */ r(
|
|
1402
1417
|
"div",
|
|
1403
1418
|
{
|
|
1404
1419
|
ref: o,
|
|
1405
|
-
className:
|
|
1406
|
-
contentEditable: !i && !s && !
|
|
1420
|
+
className: se ? `${Fn} ${Ui}` : Fn,
|
|
1421
|
+
contentEditable: !i && !s && !se,
|
|
1407
1422
|
role: "textbox",
|
|
1408
1423
|
"aria-multiline": "true",
|
|
1409
|
-
"aria-placeholder":
|
|
1410
|
-
"data-placeholder":
|
|
1424
|
+
"aria-placeholder": Ot,
|
|
1425
|
+
"data-placeholder": Ot,
|
|
1411
1426
|
suppressContentEditableWarning: !0,
|
|
1412
|
-
style: { minHeight:
|
|
1413
|
-
onInput:
|
|
1414
|
-
onBlur:
|
|
1415
|
-
onKeyUp:
|
|
1416
|
-
onKeyDown:
|
|
1417
|
-
onMouseUp:
|
|
1418
|
-
onContextMenu:
|
|
1419
|
-
onDragOver:
|
|
1420
|
-
onDrop:
|
|
1421
|
-
onDragEnd:
|
|
1427
|
+
style: { minHeight: pn, maxHeight: sl },
|
|
1428
|
+
onInput: d,
|
|
1429
|
+
onBlur: xr,
|
|
1430
|
+
onKeyUp: _e,
|
|
1431
|
+
onKeyDown: nl,
|
|
1432
|
+
onMouseUp: _e,
|
|
1433
|
+
onContextMenu: zr,
|
|
1434
|
+
onDragOver: ll,
|
|
1435
|
+
onDrop: il,
|
|
1436
|
+
onDragEnd: cl,
|
|
1422
1437
|
onPaste: (e) => {
|
|
1423
|
-
|
|
1438
|
+
el(e);
|
|
1424
1439
|
}
|
|
1425
1440
|
}
|
|
1426
1441
|
),
|
|
1427
|
-
|
|
1428
|
-
|
|
1442
|
+
se ? /* @__PURE__ */ r(
|
|
1443
|
+
ua,
|
|
1429
1444
|
{
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1445
|
+
value: xt,
|
|
1446
|
+
onChange: Xt,
|
|
1432
1447
|
disabled: i || s,
|
|
1433
|
-
minHeight:
|
|
1448
|
+
minHeight: pn
|
|
1434
1449
|
}
|
|
1435
1450
|
) : null,
|
|
1436
|
-
|
|
1437
|
-
|
|
1451
|
+
qt ? /* @__PURE__ */ r(
|
|
1452
|
+
ra,
|
|
1438
1453
|
{
|
|
1439
|
-
items:
|
|
1440
|
-
top:
|
|
1441
|
-
left:
|
|
1442
|
-
query:
|
|
1443
|
-
onSelect:
|
|
1454
|
+
items: cr,
|
|
1455
|
+
top: Kt.top,
|
|
1456
|
+
left: Kt.left,
|
|
1457
|
+
query: $o,
|
|
1458
|
+
onSelect: ol
|
|
1444
1459
|
}
|
|
1445
1460
|
) : null,
|
|
1446
|
-
|
|
1447
|
-
|
|
1461
|
+
Je ? /* @__PURE__ */ r(
|
|
1462
|
+
Ws,
|
|
1448
1463
|
{
|
|
1449
|
-
suggestion:
|
|
1450
|
-
position: { top:
|
|
1451
|
-
visible:
|
|
1452
|
-
onAccept:
|
|
1453
|
-
onDismiss:
|
|
1464
|
+
suggestion: v.suggestion,
|
|
1465
|
+
position: { top: v.top, left: v.left },
|
|
1466
|
+
visible: v.visible,
|
|
1467
|
+
onAccept: tn,
|
|
1468
|
+
onDismiss: U
|
|
1454
1469
|
}
|
|
1455
1470
|
) : null,
|
|
1456
1471
|
/* @__PURE__ */ r(
|
|
1457
|
-
|
|
1472
|
+
Zs,
|
|
1458
1473
|
{
|
|
1459
|
-
open:
|
|
1460
|
-
top:
|
|
1461
|
-
left:
|
|
1474
|
+
open: $e.open,
|
|
1475
|
+
top: $e.top,
|
|
1476
|
+
left: $e.left,
|
|
1462
1477
|
icons: {
|
|
1463
|
-
bold:
|
|
1464
|
-
italic:
|
|
1465
|
-
underline:
|
|
1466
|
-
code:
|
|
1467
|
-
link:
|
|
1468
|
-
clearFormat:
|
|
1478
|
+
bold: E.bold,
|
|
1479
|
+
italic: E.italic,
|
|
1480
|
+
underline: E.underline,
|
|
1481
|
+
code: E.code,
|
|
1482
|
+
link: E.link,
|
|
1483
|
+
clearFormat: E.clearFormat
|
|
1469
1484
|
},
|
|
1470
|
-
activeFormats:
|
|
1485
|
+
activeFormats: ye,
|
|
1471
1486
|
disabled: i || s,
|
|
1472
|
-
onFormat:
|
|
1473
|
-
onLink:
|
|
1474
|
-
onClose: () =>
|
|
1487
|
+
onFormat: tl,
|
|
1488
|
+
onLink: lt,
|
|
1489
|
+
onClose: () => Z((e) => ({ ...e, open: !1 }))
|
|
1475
1490
|
}
|
|
1476
1491
|
),
|
|
1477
1492
|
/* @__PURE__ */ r(
|
|
1478
|
-
|
|
1493
|
+
so,
|
|
1479
1494
|
{
|
|
1480
|
-
open:
|
|
1481
|
-
x:
|
|
1482
|
-
y:
|
|
1483
|
-
items:
|
|
1484
|
-
colorMode:
|
|
1495
|
+
open: We.open,
|
|
1496
|
+
x: We.x,
|
|
1497
|
+
y: We.y,
|
|
1498
|
+
items: Jr,
|
|
1499
|
+
colorMode: Qe,
|
|
1485
1500
|
onClose: () => {
|
|
1486
|
-
|
|
1501
|
+
Wt(!1), Ve((e) => ({ ...e, open: !1 }));
|
|
1487
1502
|
}
|
|
1488
1503
|
}
|
|
1489
1504
|
),
|
|
1490
1505
|
/* @__PURE__ */ r(
|
|
1491
|
-
|
|
1506
|
+
so,
|
|
1492
1507
|
{
|
|
1493
|
-
open:
|
|
1494
|
-
x:
|
|
1495
|
-
y:
|
|
1496
|
-
items:
|
|
1497
|
-
colorMode:
|
|
1498
|
-
onClose: () =>
|
|
1508
|
+
open: Ye.open,
|
|
1509
|
+
x: Ye.x,
|
|
1510
|
+
y: Ye.y,
|
|
1511
|
+
items: Zr,
|
|
1512
|
+
colorMode: Qe,
|
|
1513
|
+
onClose: () => ze((e) => ({ ...e, open: !1 }))
|
|
1499
1514
|
}
|
|
1500
1515
|
)
|
|
1501
1516
|
] }),
|
|
1502
|
-
|
|
1503
|
-
|
|
1517
|
+
qe && a.comments ? /* @__PURE__ */ r(
|
|
1518
|
+
Xs,
|
|
1504
1519
|
{
|
|
1505
|
-
comments:
|
|
1506
|
-
author:
|
|
1507
|
-
onClose: () =>
|
|
1520
|
+
comments: ae,
|
|
1521
|
+
author: X,
|
|
1522
|
+
onClose: () => rt(!1),
|
|
1508
1523
|
onResolve: (e) => {
|
|
1509
|
-
const t =
|
|
1510
|
-
|
|
1511
|
-
|
|
1524
|
+
const t = ae.find((n) => n.id === e);
|
|
1525
|
+
ot(
|
|
1526
|
+
ae.map(
|
|
1512
1527
|
(n) => n.id === e ? { ...n, resolved: !0 } : n
|
|
1513
1528
|
)
|
|
1514
|
-
), t && o.current &&
|
|
1529
|
+
), t && o.current && K(Qc(o.current.innerHTML, t.highlightId));
|
|
1515
1530
|
},
|
|
1516
1531
|
onAddReply: (e, t) => {
|
|
1517
|
-
|
|
1518
|
-
|
|
1532
|
+
ot(
|
|
1533
|
+
ae.map(
|
|
1519
1534
|
(n) => n.id === e ? {
|
|
1520
1535
|
...n,
|
|
1521
1536
|
replies: [
|
|
1522
1537
|
...n.replies,
|
|
1523
1538
|
{
|
|
1524
|
-
id:
|
|
1525
|
-
author:
|
|
1539
|
+
id: zn("reply"),
|
|
1540
|
+
author: X,
|
|
1526
1541
|
body: t,
|
|
1527
1542
|
timestamp: Date.now()
|
|
1528
1543
|
}
|
|
@@ -1533,50 +1548,50 @@ const mt = () => {
|
|
|
1533
1548
|
}
|
|
1534
1549
|
}
|
|
1535
1550
|
) : null,
|
|
1536
|
-
|
|
1537
|
-
|
|
1551
|
+
al && f ? /* @__PURE__ */ r(
|
|
1552
|
+
Gs,
|
|
1538
1553
|
{
|
|
1539
|
-
config:
|
|
1540
|
-
documentHtml: ((
|
|
1541
|
-
selectionHtml:
|
|
1542
|
-
onBusyChange:
|
|
1543
|
-
onClose: () =>
|
|
1554
|
+
config: f,
|
|
1555
|
+
documentHtml: ((Ln = o.current) == null ? void 0 : Ln.innerHTML) ?? g ?? "",
|
|
1556
|
+
selectionHtml: vt,
|
|
1557
|
+
onBusyChange: nr,
|
|
1558
|
+
onClose: () => le(!1),
|
|
1544
1559
|
onApplyHtml: (e) => {
|
|
1545
|
-
if (I(o.current),
|
|
1560
|
+
if (I(o.current), vt)
|
|
1546
1561
|
A(e);
|
|
1547
1562
|
else {
|
|
1548
|
-
|
|
1563
|
+
K(e);
|
|
1549
1564
|
return;
|
|
1550
1565
|
}
|
|
1551
|
-
|
|
1566
|
+
d();
|
|
1552
1567
|
}
|
|
1553
1568
|
}
|
|
1554
1569
|
) : null
|
|
1555
1570
|
] }),
|
|
1556
|
-
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
|
|
1571
|
+
Nt ? /* @__PURE__ */ B("div", { className: vi, children: [
|
|
1572
|
+
/* @__PURE__ */ B("span", { children: [
|
|
1573
|
+
xo,
|
|
1559
1574
|
" ",
|
|
1560
|
-
|
|
1575
|
+
Sl,
|
|
1561
1576
|
" ",
|
|
1562
|
-
|
|
1577
|
+
Bl,
|
|
1563
1578
|
" ",
|
|
1564
|
-
|
|
1565
|
-
|
|
1579
|
+
Fo,
|
|
1580
|
+
It ? ` / ${It}` : "",
|
|
1566
1581
|
" ",
|
|
1567
|
-
|
|
1582
|
+
Dl
|
|
1568
1583
|
] }),
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
|
|
1584
|
+
/* @__PURE__ */ B("span", { className: wi, children: [
|
|
1585
|
+
/* @__PURE__ */ B("span", { children: [
|
|
1586
|
+
Ml,
|
|
1572
1587
|
" ",
|
|
1573
|
-
|
|
1588
|
+
Go,
|
|
1574
1589
|
", ",
|
|
1575
|
-
|
|
1590
|
+
Hl,
|
|
1576
1591
|
" ",
|
|
1577
|
-
|
|
1592
|
+
Wo
|
|
1578
1593
|
] }),
|
|
1579
|
-
/* @__PURE__ */ r("span", { className: "Ink-Editor__footer-sync", children:
|
|
1594
|
+
/* @__PURE__ */ r("span", { className: "Ink-Editor__footer-sync", children: kl })
|
|
1580
1595
|
] })
|
|
1581
1596
|
] }) : null
|
|
1582
1597
|
]
|
|
@@ -1584,5 +1599,5 @@ const mt = () => {
|
|
|
1584
1599
|
);
|
|
1585
1600
|
};
|
|
1586
1601
|
export {
|
|
1587
|
-
|
|
1602
|
+
Xu as InkEditor
|
|
1588
1603
|
};
|