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