@forgedevstack/ink 1.1.6 → 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 +57 -1
- package/README.md +9 -1
- package/bin/ink.const.mjs +26 -0
- package/bin/ink.mjs +58 -0
- package/dist/common-components/icons/BulletListIcon.cjs +1 -0
- package/dist/common-components/icons/BulletListIcon.d.ts +3 -0
- package/dist/common-components/icons/BulletListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/BulletListIcon.js +11 -0
- package/dist/common-components/icons/ChecklistIcon.cjs +1 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts +3 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ChecklistIcon.js +10 -0
- package/dist/common-components/icons/ImageToolIcon.cjs +1 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts +3 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ImageToolIcon.js +10 -0
- package/dist/common-components/icons/LinkToolIcon.cjs +1 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts +3 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/LinkToolIcon.js +9 -0
- package/dist/common-components/icons/OrderedListIcon.cjs +1 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts +3 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/OrderedListIcon.js +9 -0
- package/dist/common-components/icons/QuoteIcon.cjs +1 -0
- package/dist/common-components/icons/QuoteIcon.d.ts +3 -0
- package/dist/common-components/icons/QuoteIcon.d.ts.map +1 -0
- package/dist/common-components/icons/QuoteIcon.js +6 -0
- package/dist/common-components/icons/TableToolIcon.cjs +1 -0
- package/dist/common-components/icons/TableToolIcon.d.ts +3 -0
- package/dist/common-components/icons/TableToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/TableToolIcon.js +9 -0
- package/dist/common-components/icons/index.d.ts +7 -0
- package/dist/common-components/icons/index.d.ts.map +1 -1
- package/dist/common-components/index.d.ts +1 -1
- package/dist/common-components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +1230 -778
- 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 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts +4 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +36 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +8 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts +3 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts.map +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +62 -17
- package/dist/components/InkEditor/components/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 -17
- 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 +93 -18
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts +6 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +3 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +15 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts +2 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/components/InkEditor/components/index.d.ts +16 -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 +35 -18
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts +95 -1
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +323 -57
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +90 -0
- package/dist/constants/generals.const.d.ts.map +1 -1
- package/dist/constants/generals.const.js +75 -4
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/keyboard.const.cjs +1 -1
- package/dist/constants/keyboard.const.d.ts +1 -0
- package/dist/constants/keyboard.const.d.ts.map +1 -1
- package/dist/constants/keyboard.const.js +2 -1
- package/dist/constants/lists.const.cjs +1 -1
- package/dist/constants/lists.const.d.ts +1 -0
- package/dist/constants/lists.const.d.ts.map +1 -1
- package/dist/constants/lists.const.js +10 -9
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.d.ts +19 -1
- package/dist/constants/numbers.d.ts.map +1 -1
- package/dist/constants/numbers.js +46 -27
- 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/premium.const.cjs +1 -1
- package/dist/constants/premium.const.d.ts.map +1 -1
- package/dist/constants/premium.const.js +10 -9
- package/dist/constants/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 +8 -0
- package/dist/constants/toolbar.const.d.ts.map +1 -1
- package/dist/constants/toolbar.const.js +16 -8
- 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 -18
- 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 +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -93
- 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 +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +15 -2
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/outline.types.d.ts +6 -0
- package/dist/types/outline.types.d.ts.map +1 -0
- package/dist/types/plugin.types.d.ts +8 -0
- package/dist/types/plugin.types.d.ts.map +1 -0
- package/dist/types/premium.types.d.ts +2 -2
- package/dist/types/premium.types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/outline.utils.cjs +1 -0
- package/dist/utils/outline.utils.d.ts +8 -0
- package/dist/utils/outline.utils.d.ts.map +1 -0
- package/dist/utils/outline.utils.js +49 -0
- package/dist/utils/slash.utils.cjs +1 -1
- package/dist/utils/slash.utils.d.ts +5 -0
- package/dist/utils/slash.utils.d.ts.map +1 -1
- package/dist/utils/slash.utils.js +24 -7
- package/dist/utils/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/dist/utils/words.utils.cjs +1 -0
- package/dist/utils/words.utils.d.ts +2 -0
- package/dist/utils/words.utils.d.ts.map +1 -0
- package/dist/utils/words.utils.js +14 -0
- package/package.json +7 -1
|
@@ -1,1136 +1,1588 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { INK_MIN_HEIGHT as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { jsxs as 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";
|
|
14
15
|
import "../../constants/openai.const.js";
|
|
15
|
-
import { INK_DEFAULT_ICONS as
|
|
16
|
-
import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as
|
|
17
|
-
import {
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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;
|
|
63
84
|
const {
|
|
64
|
-
value:
|
|
65
|
-
defaultValue:
|
|
66
|
-
onChange:
|
|
67
|
-
placeholder:
|
|
68
|
-
disabled:
|
|
69
|
-
readOnly:
|
|
70
|
-
minHeight:
|
|
71
|
-
maxHeight:
|
|
72
|
-
toolbar:
|
|
73
|
-
className:
|
|
74
|
-
testId:
|
|
75
|
-
allowImagePaste:
|
|
76
|
-
showCharCount:
|
|
77
|
-
charCountMax:
|
|
78
|
-
typoAutoFix:
|
|
79
|
-
variant:
|
|
80
|
-
chrome:
|
|
81
|
-
colorMode:
|
|
82
|
-
features:
|
|
83
|
-
author:
|
|
84
|
-
trackChanges:
|
|
85
|
-
onTrackChangesChange:
|
|
86
|
-
trackChangesEnabled:
|
|
87
|
-
onTrackChangesEnabledChange:
|
|
88
|
-
comments:
|
|
89
|
-
onCommentsChange:
|
|
90
|
-
showCommentsPanel:
|
|
91
|
-
onShowCommentsPanelChange:
|
|
92
|
-
ai:
|
|
93
|
-
slashCommands:
|
|
94
|
-
tableRows:
|
|
95
|
-
tableCols:
|
|
96
|
-
premium:
|
|
97
|
-
theme:
|
|
98
|
-
icons:
|
|
99
|
-
pasteMode:
|
|
100
|
-
onImageUpload:
|
|
101
|
-
wysiwyg:
|
|
102
|
-
keepInMemory:
|
|
103
|
-
memoryKey:
|
|
104
|
-
onToolbarChange:
|
|
105
|
-
toolbarHidden:
|
|
106
|
-
onToolbarHiddenChange:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
85
|
+
value: g,
|
|
86
|
+
defaultValue: H = "",
|
|
87
|
+
onChange: k,
|
|
88
|
+
placeholder: pt = Ti,
|
|
89
|
+
disabled: i = !1,
|
|
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({
|
|
110
133
|
visible: !1,
|
|
111
134
|
suggestion: "",
|
|
112
|
-
top:
|
|
113
|
-
left:
|
|
114
|
-
}),
|
|
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({
|
|
115
138
|
open: !1,
|
|
116
|
-
x:
|
|
117
|
-
y:
|
|
118
|
-
}), [
|
|
139
|
+
x: p,
|
|
140
|
+
y: p
|
|
141
|
+
}), [Ye, j] = c({
|
|
119
142
|
open: !1,
|
|
120
|
-
top:
|
|
121
|
-
left:
|
|
122
|
-
}), [
|
|
123
|
-
() =>
|
|
124
|
-
), [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
129
154
|
);
|
|
130
|
-
},
|
|
131
|
-
if (!
|
|
132
|
-
|
|
155
|
+
}, Mr = () => {
|
|
156
|
+
if (!Ze || Ne || !o.current) {
|
|
157
|
+
P();
|
|
133
158
|
return;
|
|
134
159
|
}
|
|
135
160
|
const e = window.getSelection();
|
|
136
161
|
if (!e || !e.isCollapsed) {
|
|
137
|
-
|
|
162
|
+
P();
|
|
138
163
|
return;
|
|
139
164
|
}
|
|
140
|
-
|
|
141
|
-
(
|
|
165
|
+
Qe(), le(
|
|
166
|
+
(n) => n.visible || n.suggestion ? { ...n, visible: !1, suggestion: "" } : n
|
|
142
167
|
);
|
|
143
|
-
const t = (
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
148
|
-
const
|
|
149
|
-
if (!
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
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, {
|
|
154
179
|
capability: "autocomplete",
|
|
155
|
-
html:
|
|
156
|
-
prompt:
|
|
157
|
-
modelId:
|
|
158
|
-
}).then((
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
163
|
-
|
|
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({
|
|
164
189
|
visible: !1,
|
|
165
190
|
suggestion: "",
|
|
166
|
-
top:
|
|
167
|
-
left:
|
|
191
|
+
top: p,
|
|
192
|
+
left: p
|
|
168
193
|
});
|
|
169
194
|
return;
|
|
170
195
|
}
|
|
171
|
-
const
|
|
172
|
-
|
|
196
|
+
const he = o.current && co(o.current) || u;
|
|
197
|
+
le({
|
|
173
198
|
visible: !0,
|
|
174
|
-
suggestion:
|
|
175
|
-
top:
|
|
176
|
-
left:
|
|
199
|
+
suggestion: C,
|
|
200
|
+
top: he.top,
|
|
201
|
+
left: he.left
|
|
177
202
|
});
|
|
178
203
|
}).catch(() => {
|
|
179
|
-
|
|
204
|
+
T === q.current && le({
|
|
180
205
|
visible: !1,
|
|
181
206
|
suggestion: "",
|
|
182
|
-
top:
|
|
183
|
-
left:
|
|
207
|
+
top: p,
|
|
208
|
+
left: p
|
|
184
209
|
});
|
|
185
210
|
});
|
|
186
|
-
},
|
|
211
|
+
}, xs);
|
|
187
212
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}, []),
|
|
191
|
-
|
|
192
|
-
}, [
|
|
193
|
-
|
|
194
|
-
}, [
|
|
195
|
-
|
|
196
|
-
}, [
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
-
if (
|
|
204
|
-
|
|
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;
|
|
205
230
|
return;
|
|
206
231
|
}
|
|
207
|
-
|
|
208
|
-
}, [
|
|
209
|
-
if (!
|
|
210
|
-
if (
|
|
211
|
-
|
|
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;
|
|
212
237
|
return;
|
|
213
238
|
}
|
|
214
|
-
const e = document.activeElement ===
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}),
|
|
218
|
-
}, [
|
|
219
|
-
if (!
|
|
220
|
-
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) : "";
|
|
221
246
|
if (e) {
|
|
222
|
-
|
|
247
|
+
o.current.innerHTML = e, Y.current = e, oe.current = new Tt(e), k == null || k(e), a.outline && z(J(o.current));
|
|
223
248
|
return;
|
|
224
249
|
}
|
|
225
|
-
|
|
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);
|
|
226
260
|
}, []);
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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));
|
|
265
|
+
}
|
|
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)
|
|
242
281
|
);
|
|
243
|
-
t ?
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
if (
|
|
254
|
-
|
|
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);
|
|
255
294
|
return;
|
|
256
295
|
}
|
|
257
296
|
const e = window.getSelection();
|
|
258
|
-
if (!e || e.isCollapsed || e.rangeCount === 0 || !
|
|
259
|
-
|
|
297
|
+
if (!e || e.isCollapsed || e.rangeCount === 0 || !Qs(e, o.current)) {
|
|
298
|
+
j((u) => u.open ? { ...u, open: !1 } : u);
|
|
260
299
|
return;
|
|
261
300
|
}
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
|
|
301
|
+
const n = e.getRangeAt(0).getBoundingClientRect();
|
|
302
|
+
if (n.width === 0 && n.height === 0) {
|
|
303
|
+
j((u) => u.open ? { ...u, open: !1 } : u);
|
|
265
304
|
return;
|
|
266
305
|
}
|
|
267
|
-
const
|
|
268
|
-
selectionRect:
|
|
269
|
-
toolbarWidth:
|
|
270
|
-
toolbarHeight:
|
|
306
|
+
const l = Js({
|
|
307
|
+
selectionRect: n,
|
|
308
|
+
toolbarWidth: qs,
|
|
309
|
+
toolbarHeight: js,
|
|
271
310
|
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
272
|
-
gap:
|
|
273
|
-
edgePadding:
|
|
311
|
+
gap: Zs,
|
|
312
|
+
edgePadding: $s
|
|
274
313
|
});
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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);
|
|
284
328
|
} else
|
|
285
|
-
|
|
286
|
-
},
|
|
287
|
-
var t,
|
|
288
|
-
if (!
|
|
289
|
-
let e =
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
|
|
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();
|
|
338
|
+
if (T) {
|
|
339
|
+
const L = dt("delete", T, x);
|
|
340
|
+
ae([...v, L]), vr(L.id), e = o.current.innerHTML;
|
|
297
341
|
}
|
|
298
342
|
}
|
|
299
343
|
}
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
top:
|
|
309
|
-
left:
|
|
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);
|
|
346
|
+
if (T !== null) {
|
|
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
|
|
310
354
|
});
|
|
311
355
|
}
|
|
312
356
|
} else
|
|
313
|
-
|
|
357
|
+
Fe(D), Ie([]);
|
|
314
358
|
}
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
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;
|
|
318
398
|
if (!e) {
|
|
319
|
-
|
|
399
|
+
P();
|
|
320
400
|
return;
|
|
321
401
|
}
|
|
322
|
-
|
|
323
|
-
},
|
|
402
|
+
I(o.current), h(Xs, e), P(), _();
|
|
403
|
+
}, vr = (e) => {
|
|
324
404
|
const t = window.getSelection();
|
|
325
405
|
if (!t || t.rangeCount === 0) return;
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
},
|
|
329
|
-
if (!
|
|
330
|
-
const e =
|
|
331
|
-
t.html !== e && (
|
|
332
|
-
|
|
333
|
-
}),
|
|
334
|
-
},
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
|
|
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(), _();
|
|
338
418
|
return;
|
|
339
419
|
}
|
|
340
|
-
if (e === "directionLtr" &&
|
|
341
|
-
|
|
420
|
+
if (e === "directionLtr" && o.current) {
|
|
421
|
+
lo(o.current, _i), _();
|
|
342
422
|
return;
|
|
343
423
|
}
|
|
344
|
-
if (e === "directionRtl" &&
|
|
345
|
-
|
|
424
|
+
if (e === "directionRtl" && o.current) {
|
|
425
|
+
lo(o.current, di), _();
|
|
346
426
|
return;
|
|
347
427
|
}
|
|
348
|
-
if (e ===
|
|
349
|
-
|
|
428
|
+
if (e === ge) {
|
|
429
|
+
A(yn), _();
|
|
350
430
|
return;
|
|
351
431
|
}
|
|
352
|
-
const t =
|
|
353
|
-
t && (t.value ?
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
if (
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
e
|
|
369
|
-
|
|
370
|
-
|
|
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;
|
|
371
458
|
const e = document.createElement("input");
|
|
372
459
|
e.type = "file", e.accept = "image/*", e.onchange = async () => {
|
|
373
|
-
var
|
|
374
|
-
const t = (
|
|
460
|
+
var l;
|
|
461
|
+
const t = (l = e.files) == null ? void 0 : l[0];
|
|
375
462
|
if (!t) return;
|
|
376
|
-
const
|
|
377
|
-
|
|
463
|
+
const n = await Jt(t);
|
|
464
|
+
I(o.current), ft(n, t.name), _();
|
|
378
465
|
}, e.click();
|
|
379
|
-
},
|
|
380
|
-
if (
|
|
381
|
-
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
const
|
|
385
|
-
|
|
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));
|
|
386
473
|
} else
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
},
|
|
390
|
-
const e =
|
|
391
|
-
if (e === null || !
|
|
392
|
-
|
|
474
|
+
A(n);
|
|
475
|
+
_();
|
|
476
|
+
}, nn = () => {
|
|
477
|
+
const e = oe.current.undo();
|
|
478
|
+
if (e === null || !o.current) {
|
|
479
|
+
h("undo"), _();
|
|
393
480
|
return;
|
|
394
481
|
}
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
const e =
|
|
398
|
-
if (e === null || !
|
|
399
|
-
|
|
482
|
+
w(e);
|
|
483
|
+
}, on = () => {
|
|
484
|
+
const e = oe.current.redo();
|
|
485
|
+
if (e === null || !o.current) {
|
|
486
|
+
h("redo"), _();
|
|
400
487
|
return;
|
|
401
488
|
}
|
|
402
|
-
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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;
|
|
409
535
|
const e = window.prompt("Comment:");
|
|
410
536
|
if (!(e != null && e.trim())) return;
|
|
411
|
-
const t =
|
|
412
|
-
if (
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
},
|
|
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 = [
|
|
416
542
|
{
|
|
417
|
-
id:
|
|
418
|
-
label:
|
|
419
|
-
onSelect: () =>
|
|
543
|
+
id: Wl,
|
|
544
|
+
label: Gl,
|
|
545
|
+
onSelect: () => Wt(!0)
|
|
420
546
|
},
|
|
421
547
|
{
|
|
422
|
-
id:
|
|
423
|
-
label:
|
|
424
|
-
onSelect: () =>
|
|
548
|
+
id: Yl,
|
|
549
|
+
label: Vl,
|
|
550
|
+
onSelect: () => et(!0)
|
|
425
551
|
}
|
|
426
|
-
],
|
|
427
|
-
const t =
|
|
428
|
-
!t || !
|
|
429
|
-
},
|
|
430
|
-
|
|
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
|
+
},
|
|
581
|
+
{
|
|
582
|
+
id: cc,
|
|
583
|
+
label: ic,
|
|
584
|
+
onSelect: () => y((e) => Fc(e))
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
id: ac,
|
|
588
|
+
label: sc,
|
|
589
|
+
onSelect: () => y((e) => yc(e))
|
|
590
|
+
}
|
|
591
|
+
] : [], qr = [
|
|
592
|
+
...a.graph && pr ? [
|
|
431
593
|
{
|
|
432
|
-
id:
|
|
433
|
-
label:
|
|
434
|
-
onSelect: () =>
|
|
594
|
+
id: Tl,
|
|
595
|
+
label: dl,
|
|
596
|
+
onSelect: () => lt("bar")
|
|
435
597
|
},
|
|
436
598
|
{
|
|
437
|
-
id:
|
|
438
|
-
label:
|
|
439
|
-
onSelect: () =>
|
|
599
|
+
id: fl,
|
|
600
|
+
label: El,
|
|
601
|
+
onSelect: () => lt("line")
|
|
440
602
|
},
|
|
441
603
|
{
|
|
442
|
-
id:
|
|
443
|
-
label:
|
|
444
|
-
onSelect: () =>
|
|
604
|
+
id: pl,
|
|
605
|
+
label: ml,
|
|
606
|
+
onSelect: () => lt("pie")
|
|
445
607
|
},
|
|
446
608
|
{
|
|
447
|
-
id:
|
|
448
|
-
label:
|
|
449
|
-
onSelect: () =>
|
|
609
|
+
id: Ol,
|
|
610
|
+
label: Ll,
|
|
611
|
+
onSelect: () => rn("values")
|
|
450
612
|
},
|
|
451
613
|
{
|
|
452
|
-
id:
|
|
453
|
-
label:
|
|
454
|
-
onSelect: () =>
|
|
614
|
+
id: Nl,
|
|
615
|
+
label: Cl,
|
|
616
|
+
onSelect: () => rn("colors")
|
|
455
617
|
},
|
|
456
618
|
{
|
|
457
|
-
id:
|
|
458
|
-
label:
|
|
459
|
-
onSelect:
|
|
619
|
+
id: Al,
|
|
620
|
+
label: Il,
|
|
621
|
+
onSelect: Vr
|
|
460
622
|
}
|
|
461
623
|
] : [],
|
|
624
|
+
...$r,
|
|
462
625
|
{
|
|
463
|
-
id:
|
|
464
|
-
label:
|
|
465
|
-
onSelect: () =>
|
|
626
|
+
id: _c,
|
|
627
|
+
label: uc,
|
|
628
|
+
onSelect: () => R("bold")
|
|
466
629
|
},
|
|
467
630
|
{
|
|
468
|
-
id:
|
|
469
|
-
label:
|
|
470
|
-
onSelect: () =>
|
|
631
|
+
id: Tc,
|
|
632
|
+
label: dc,
|
|
633
|
+
onSelect: () => R("italic")
|
|
471
634
|
},
|
|
472
635
|
{
|
|
473
|
-
id:
|
|
474
|
-
label:
|
|
475
|
-
onSelect: () =>
|
|
636
|
+
id: fc,
|
|
637
|
+
label: Ec,
|
|
638
|
+
onSelect: () => R("underline")
|
|
476
639
|
},
|
|
477
640
|
{
|
|
478
|
-
id:
|
|
479
|
-
label:
|
|
480
|
-
onSelect: () =>
|
|
641
|
+
id: pc,
|
|
642
|
+
label: mc,
|
|
643
|
+
onSelect: () => R("strikethrough")
|
|
481
644
|
},
|
|
482
645
|
{
|
|
483
|
-
id:
|
|
484
|
-
label:
|
|
485
|
-
onSelect: () =>
|
|
646
|
+
id: Oc,
|
|
647
|
+
label: Lc,
|
|
648
|
+
onSelect: () => R("heading2")
|
|
486
649
|
},
|
|
487
650
|
{
|
|
488
|
-
id:
|
|
489
|
-
label:
|
|
490
|
-
onSelect: () =>
|
|
651
|
+
id: Nc,
|
|
652
|
+
label: Cc,
|
|
653
|
+
onSelect: () => R("bulletList")
|
|
491
654
|
},
|
|
492
655
|
{
|
|
493
|
-
id:
|
|
494
|
-
label:
|
|
495
|
-
onSelect: () =>
|
|
656
|
+
id: Ac,
|
|
657
|
+
label: Ic,
|
|
658
|
+
onSelect: () => R("orderedList")
|
|
496
659
|
},
|
|
497
660
|
{
|
|
498
|
-
id:
|
|
499
|
-
label:
|
|
500
|
-
onSelect: () =>
|
|
661
|
+
id: gc,
|
|
662
|
+
label: hc,
|
|
663
|
+
onSelect: () => ot()
|
|
501
664
|
},
|
|
502
665
|
{
|
|
503
|
-
id:
|
|
504
|
-
label:
|
|
505
|
-
onSelect: () =>
|
|
666
|
+
id: bc,
|
|
667
|
+
label: Rc,
|
|
668
|
+
onSelect: () => R("clearFormat")
|
|
506
669
|
},
|
|
507
670
|
{
|
|
508
|
-
id:
|
|
509
|
-
label:
|
|
510
|
-
disabled: !
|
|
511
|
-
onSelect: () =>
|
|
671
|
+
id: Bc,
|
|
672
|
+
label: Sc,
|
|
673
|
+
disabled: !a.findReplace,
|
|
674
|
+
onSelect: () => Ae(!0)
|
|
512
675
|
},
|
|
513
676
|
{
|
|
514
|
-
id:
|
|
515
|
-
label:
|
|
516
|
-
disabled: !
|
|
517
|
-
onSelect: () =>
|
|
677
|
+
id: Mc,
|
|
678
|
+
label: Dc,
|
|
679
|
+
disabled: !a.signature,
|
|
680
|
+
onSelect: () => ye(!0)
|
|
518
681
|
},
|
|
519
682
|
{
|
|
520
|
-
id:
|
|
521
|
-
label:
|
|
522
|
-
disabled: !
|
|
523
|
-
onSelect: () =>
|
|
683
|
+
id: kc,
|
|
684
|
+
label: Hc,
|
|
685
|
+
disabled: !a.comments,
|
|
686
|
+
onSelect: () => sn()
|
|
524
687
|
},
|
|
525
|
-
...
|
|
688
|
+
...qt ? [
|
|
526
689
|
{
|
|
527
|
-
id:
|
|
528
|
-
label:
|
|
529
|
-
onSelect: () =>
|
|
690
|
+
id: Xl,
|
|
691
|
+
label: xl,
|
|
692
|
+
onSelect: () => et(!1)
|
|
530
693
|
}
|
|
531
694
|
] : []
|
|
532
|
-
],
|
|
533
|
-
if (!
|
|
534
|
-
const t =
|
|
535
|
-
|
|
536
|
-
|
|
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)
|
|
537
700
|
);
|
|
538
|
-
},
|
|
539
|
-
if (!
|
|
540
|
-
const t =
|
|
541
|
-
|
|
542
|
-
|
|
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)
|
|
543
706
|
);
|
|
544
|
-
},
|
|
545
|
-
const t = await
|
|
546
|
-
if (
|
|
547
|
-
const
|
|
548
|
-
|
|
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));
|
|
549
712
|
} else
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
},
|
|
553
|
-
if (
|
|
713
|
+
ft(t);
|
|
714
|
+
_();
|
|
715
|
+
}, jr = async (e) => {
|
|
716
|
+
if (i || s) return;
|
|
554
717
|
const t = e.clipboardData;
|
|
555
718
|
if (!t) return;
|
|
556
|
-
if (
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
719
|
+
if (Ho) {
|
|
720
|
+
const l = os(t);
|
|
721
|
+
if (l) {
|
|
559
722
|
e.preventDefault();
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
for (const
|
|
565
|
-
if (!
|
|
566
|
-
const
|
|
567
|
-
|
|
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);
|
|
568
731
|
}
|
|
569
732
|
return;
|
|
570
733
|
}
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
e.preventDefault(),
|
|
734
|
+
const u = ls(t);
|
|
735
|
+
if (u) {
|
|
736
|
+
e.preventDefault(), A(u.replace(/\n/g, "<br />")), _();
|
|
574
737
|
return;
|
|
575
738
|
}
|
|
576
739
|
}
|
|
577
|
-
if (!
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
for (const
|
|
581
|
-
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;
|
|
582
745
|
e.preventDefault();
|
|
583
|
-
const
|
|
584
|
-
|
|
746
|
+
const u = l.getAsFile();
|
|
747
|
+
u && await _n(u);
|
|
585
748
|
}
|
|
586
|
-
},
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
if (e.key ===
|
|
590
|
-
e.preventDefault(),
|
|
749
|
+
}, Zr = (e) => {
|
|
750
|
+
R(e);
|
|
751
|
+
}, Qr = (e) => {
|
|
752
|
+
if (e.key === ql && U.visible && U.suggestion) {
|
|
753
|
+
e.preventDefault(), Zt();
|
|
591
754
|
return;
|
|
592
755
|
}
|
|
593
|
-
if (e.key ===
|
|
594
|
-
|
|
756
|
+
if (e.key === jl) {
|
|
757
|
+
P();
|
|
595
758
|
return;
|
|
596
759
|
}
|
|
597
|
-
if (
|
|
598
|
-
|
|
760
|
+
if (Ms(e.nativeEvent)) {
|
|
761
|
+
_();
|
|
599
762
|
return;
|
|
600
763
|
}
|
|
601
|
-
if (e.key ===
|
|
602
|
-
if (
|
|
603
|
-
e.preventDefault(),
|
|
764
|
+
if (e.key === Zl) {
|
|
765
|
+
if (U.visible) {
|
|
766
|
+
e.preventDefault(), P();
|
|
604
767
|
return;
|
|
605
768
|
}
|
|
606
|
-
|
|
769
|
+
Ie([]), j((t) => t.open ? { ...t, open: !1 } : t);
|
|
770
|
+
}
|
|
771
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === Ql) {
|
|
772
|
+
e.preventDefault(), a.ai && (E != null && E.enabled) && re(!0);
|
|
773
|
+
return;
|
|
607
774
|
}
|
|
608
|
-
(e.metaKey || e.ctrlKey) && e.key ===
|
|
609
|
-
},
|
|
610
|
-
var
|
|
611
|
-
|
|
775
|
+
(e.metaKey || e.ctrlKey) && e.key === Jl && (e.preventDefault(), e.shiftKey ? on() : nn());
|
|
776
|
+
}, Jr = (e) => {
|
|
777
|
+
var n;
|
|
778
|
+
I(o.current);
|
|
612
779
|
const t = window.getSelection();
|
|
613
|
-
if ((
|
|
614
|
-
const
|
|
615
|
-
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);
|
|
616
783
|
}
|
|
617
|
-
switch (
|
|
784
|
+
switch (Fe(D), Ie([]), e.insert) {
|
|
618
785
|
case "heading1":
|
|
619
|
-
|
|
786
|
+
h("formatBlock", zi);
|
|
620
787
|
break;
|
|
621
788
|
case "heading2":
|
|
622
|
-
|
|
789
|
+
h("formatBlock", Yi);
|
|
790
|
+
break;
|
|
791
|
+
case "heading3":
|
|
792
|
+
h("formatBlock", Vi);
|
|
793
|
+
break;
|
|
794
|
+
case "paragraph":
|
|
795
|
+
h("formatBlock", Wi);
|
|
623
796
|
break;
|
|
624
797
|
case "bulletList":
|
|
625
|
-
|
|
798
|
+
h("insertUnorderedList");
|
|
626
799
|
break;
|
|
627
800
|
case "orderedList":
|
|
628
|
-
|
|
801
|
+
h("insertOrderedList");
|
|
802
|
+
break;
|
|
803
|
+
case "checklist":
|
|
804
|
+
A(yn);
|
|
805
|
+
break;
|
|
806
|
+
case "quote":
|
|
807
|
+
h("formatBlock", Gi);
|
|
808
|
+
break;
|
|
809
|
+
case "code":
|
|
810
|
+
h("formatBlock", Xi);
|
|
811
|
+
break;
|
|
812
|
+
case "callout":
|
|
813
|
+
A(xi);
|
|
629
814
|
break;
|
|
630
815
|
case "table":
|
|
631
|
-
|
|
816
|
+
tn();
|
|
817
|
+
return;
|
|
818
|
+
case "image":
|
|
819
|
+
en();
|
|
632
820
|
return;
|
|
633
821
|
case "ai":
|
|
634
|
-
|
|
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));
|
|
635
832
|
break;
|
|
636
833
|
}
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
if (!
|
|
640
|
-
const t = window.getSelection(),
|
|
641
|
-
|
|
642
|
-
},
|
|
643
|
-
if (!
|
|
644
|
-
const t = window.getSelection(),
|
|
645
|
-
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) {
|
|
646
843
|
e.preventDefault();
|
|
647
844
|
return;
|
|
648
845
|
}
|
|
649
|
-
|
|
650
|
-
},
|
|
651
|
-
if (!
|
|
652
|
-
e.preventDefault(), e.dataTransfer.dropEffect =
|
|
653
|
-
const t =
|
|
654
|
-
if (!t || t ===
|
|
655
|
-
|
|
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);
|
|
656
853
|
return;
|
|
657
854
|
}
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
},
|
|
661
|
-
if (!
|
|
855
|
+
const n = qn(e.clientY, t);
|
|
856
|
+
jn(o.current, t, n);
|
|
857
|
+
}, nl = (e) => {
|
|
858
|
+
if (!o.current || !K.current) return;
|
|
662
859
|
e.preventDefault();
|
|
663
|
-
const t =
|
|
664
|
-
t && t !==
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
},
|
|
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;
|
|
668
866
|
if (e === "divider")
|
|
669
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ r("span", { className: Pi }, `divider-${t}`);
|
|
670
868
|
if (e === "headingDropdown")
|
|
671
|
-
return /* @__PURE__ */
|
|
672
|
-
|
|
869
|
+
return /* @__PURE__ */ r(
|
|
870
|
+
Se,
|
|
673
871
|
{
|
|
674
872
|
title: "Heading",
|
|
675
|
-
options:
|
|
676
|
-
value:
|
|
677
|
-
disabled:
|
|
678
|
-
onChange:
|
|
873
|
+
options: Ui,
|
|
874
|
+
value: Po || "p",
|
|
875
|
+
disabled: i || s,
|
|
876
|
+
onChange: Kr
|
|
679
877
|
},
|
|
680
878
|
"heading"
|
|
681
879
|
);
|
|
682
|
-
if (e ===
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
-
|
|
880
|
+
if (e === Cn)
|
|
881
|
+
return /* @__PURE__ */ r(
|
|
882
|
+
Se,
|
|
685
883
|
{
|
|
686
|
-
title:
|
|
687
|
-
options:
|
|
688
|
-
value:
|
|
689
|
-
disabled:
|
|
690
|
-
onChange:
|
|
884
|
+
title: ni,
|
|
885
|
+
options: ti,
|
|
886
|
+
value: cr,
|
|
887
|
+
disabled: i || s,
|
|
888
|
+
onChange: Fr
|
|
691
889
|
},
|
|
692
|
-
|
|
890
|
+
Cn
|
|
693
891
|
);
|
|
694
|
-
if (e ===
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
|
|
892
|
+
if (e === Nn)
|
|
893
|
+
return /* @__PURE__ */ r(
|
|
894
|
+
Se,
|
|
697
895
|
{
|
|
698
|
-
title:
|
|
699
|
-
options:
|
|
700
|
-
value:
|
|
701
|
-
disabled:
|
|
702
|
-
onChange:
|
|
896
|
+
title: li,
|
|
897
|
+
options: ri,
|
|
898
|
+
value: ar,
|
|
899
|
+
disabled: i || s,
|
|
900
|
+
onChange: yr
|
|
703
901
|
},
|
|
704
|
-
|
|
902
|
+
Nn
|
|
705
903
|
);
|
|
706
904
|
if (e === "textColor")
|
|
707
|
-
return /* @__PURE__ */
|
|
708
|
-
|
|
905
|
+
return /* @__PURE__ */ r(
|
|
906
|
+
io,
|
|
709
907
|
{
|
|
710
908
|
title: "Text color",
|
|
711
909
|
type: "text",
|
|
712
|
-
value:
|
|
713
|
-
disabled:
|
|
714
|
-
onChange: (
|
|
715
|
-
|
|
910
|
+
value: Vo,
|
|
911
|
+
disabled: i || s,
|
|
912
|
+
onChange: (d) => {
|
|
913
|
+
I(o.current), Rs(d), Yo(d), _();
|
|
716
914
|
}
|
|
717
915
|
},
|
|
718
916
|
"textColor"
|
|
719
917
|
);
|
|
720
918
|
if (e === "highlightColor")
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
919
|
+
return /* @__PURE__ */ r(
|
|
920
|
+
io,
|
|
723
921
|
{
|
|
724
922
|
title: "Highlight color",
|
|
725
923
|
type: "highlight",
|
|
726
|
-
value:
|
|
727
|
-
disabled:
|
|
728
|
-
onChange: (
|
|
729
|
-
|
|
924
|
+
value: zo,
|
|
925
|
+
disabled: i || s,
|
|
926
|
+
onChange: (d) => {
|
|
927
|
+
I(o.current), bs(d), $o(d), _();
|
|
730
928
|
}
|
|
731
929
|
},
|
|
732
930
|
"highlightColor"
|
|
733
931
|
);
|
|
734
932
|
if (e === "link")
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
|
|
933
|
+
return /* @__PURE__ */ r(
|
|
934
|
+
N,
|
|
737
935
|
{
|
|
738
|
-
icon:
|
|
936
|
+
icon: f.link,
|
|
739
937
|
title: "Insert link",
|
|
740
|
-
|
|
741
|
-
|
|
938
|
+
hint: O.link,
|
|
939
|
+
onHint: m,
|
|
940
|
+
disabled: i || s,
|
|
941
|
+
onClick: ot
|
|
742
942
|
},
|
|
743
943
|
"link"
|
|
744
944
|
);
|
|
745
945
|
if (e === "image")
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
|
|
946
|
+
return /* @__PURE__ */ r(
|
|
947
|
+
N,
|
|
748
948
|
{
|
|
749
|
-
|
|
949
|
+
hint: O.image,
|
|
950
|
+
onHint: m,
|
|
951
|
+
icon: f.image,
|
|
750
952
|
title: "Insert image",
|
|
751
|
-
disabled:
|
|
953
|
+
disabled: i || s,
|
|
752
954
|
onClick: () => {
|
|
753
|
-
|
|
955
|
+
en();
|
|
754
956
|
}
|
|
755
957
|
},
|
|
756
958
|
"image"
|
|
757
959
|
);
|
|
960
|
+
if (e === ge)
|
|
961
|
+
return /* @__PURE__ */ r(
|
|
962
|
+
N,
|
|
963
|
+
{
|
|
964
|
+
icon: f.checklist,
|
|
965
|
+
title: "Checklist",
|
|
966
|
+
hint: O.checklist,
|
|
967
|
+
onHint: m,
|
|
968
|
+
disabled: i || s,
|
|
969
|
+
onClick: () => R(ge)
|
|
970
|
+
},
|
|
971
|
+
ge
|
|
972
|
+
);
|
|
758
973
|
if (e === "table")
|
|
759
|
-
return
|
|
760
|
-
|
|
974
|
+
return a.table ? /* @__PURE__ */ r(
|
|
975
|
+
ca,
|
|
761
976
|
{
|
|
762
|
-
icon:
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
onClick: Ot
|
|
977
|
+
icon: f.table,
|
|
978
|
+
disabled: i || s,
|
|
979
|
+
onSelect: tn
|
|
766
980
|
},
|
|
767
981
|
"table"
|
|
768
982
|
) : null;
|
|
769
|
-
if (e ===
|
|
770
|
-
return
|
|
771
|
-
|
|
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,
|
|
772
1012
|
{
|
|
773
|
-
icon:
|
|
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,
|
|
1055
|
+
{
|
|
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,
|
|
774
1093
|
title: "Sign pad",
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
1094
|
+
hint: O.signature,
|
|
1095
|
+
onHint: m,
|
|
1096
|
+
active: vt,
|
|
1097
|
+
disabled: i || s,
|
|
1098
|
+
onClick: () => ye(!0)
|
|
778
1099
|
},
|
|
779
|
-
|
|
1100
|
+
Bn
|
|
780
1101
|
) : null;
|
|
781
|
-
if (e ===
|
|
782
|
-
return
|
|
783
|
-
|
|
1102
|
+
if (e === Dn)
|
|
1103
|
+
return a.findReplace ? /* @__PURE__ */ r(
|
|
1104
|
+
N,
|
|
784
1105
|
{
|
|
785
|
-
icon:
|
|
1106
|
+
icon: f.findReplace,
|
|
786
1107
|
title: "Find and replace",
|
|
787
|
-
|
|
788
|
-
|
|
1108
|
+
hint: O.findReplace,
|
|
1109
|
+
onHint: m,
|
|
1110
|
+
active: xe,
|
|
1111
|
+
disabled: i || s,
|
|
789
1112
|
onClick: () => {
|
|
790
|
-
|
|
1113
|
+
xe ? Ae(!1) : Qt(Re);
|
|
791
1114
|
}
|
|
792
1115
|
},
|
|
793
|
-
|
|
1116
|
+
Dn
|
|
794
1117
|
) : null;
|
|
795
|
-
if (e ===
|
|
796
|
-
return
|
|
797
|
-
|
|
1118
|
+
if (e === Mn)
|
|
1119
|
+
return a.findReplace ? /* @__PURE__ */ r(
|
|
1120
|
+
Se,
|
|
798
1121
|
{
|
|
799
|
-
title:
|
|
800
|
-
options:
|
|
801
|
-
value:
|
|
802
|
-
disabled:
|
|
803
|
-
onChange:
|
|
1122
|
+
title: ci,
|
|
1123
|
+
options: ii,
|
|
1124
|
+
value: ur,
|
|
1125
|
+
disabled: i || s,
|
|
1126
|
+
onChange: xr
|
|
804
1127
|
},
|
|
805
|
-
|
|
1128
|
+
Mn
|
|
806
1129
|
) : null;
|
|
807
|
-
if (e ===
|
|
808
|
-
return
|
|
809
|
-
|
|
1130
|
+
if (e === Hn)
|
|
1131
|
+
return a.horizontalRule ? /* @__PURE__ */ r(
|
|
1132
|
+
N,
|
|
810
1133
|
{
|
|
811
|
-
icon:
|
|
1134
|
+
icon: f.horizontalRule,
|
|
812
1135
|
title: "Horizontal rule",
|
|
813
|
-
|
|
1136
|
+
hint: O.horizontalRule,
|
|
1137
|
+
onHint: m,
|
|
1138
|
+
disabled: i || s,
|
|
814
1139
|
onClick: () => {
|
|
815
|
-
|
|
1140
|
+
I(o.current), A("<hr />"), _();
|
|
816
1141
|
}
|
|
817
1142
|
},
|
|
818
|
-
|
|
1143
|
+
Hn
|
|
819
1144
|
) : null;
|
|
820
1145
|
if (e === "undo")
|
|
821
|
-
return /* @__PURE__ */
|
|
822
|
-
|
|
1146
|
+
return /* @__PURE__ */ r(
|
|
1147
|
+
N,
|
|
823
1148
|
{
|
|
824
|
-
icon:
|
|
1149
|
+
icon: f.undo,
|
|
825
1150
|
title: "Undo",
|
|
826
|
-
|
|
827
|
-
|
|
1151
|
+
hint: O.undo,
|
|
1152
|
+
onHint: m,
|
|
1153
|
+
disabled: i || s,
|
|
1154
|
+
onClick: nn
|
|
828
1155
|
},
|
|
829
1156
|
"undo"
|
|
830
1157
|
);
|
|
831
1158
|
if (e === "redo")
|
|
832
|
-
return /* @__PURE__ */
|
|
833
|
-
|
|
1159
|
+
return /* @__PURE__ */ r(
|
|
1160
|
+
N,
|
|
834
1161
|
{
|
|
835
|
-
icon:
|
|
1162
|
+
icon: f.redo,
|
|
836
1163
|
title: "Redo",
|
|
837
|
-
|
|
838
|
-
|
|
1164
|
+
hint: O.redo,
|
|
1165
|
+
onHint: m,
|
|
1166
|
+
disabled: i || s,
|
|
1167
|
+
onClick: on
|
|
839
1168
|
},
|
|
840
1169
|
"redo"
|
|
841
1170
|
);
|
|
842
1171
|
if (e === "trackChanges")
|
|
843
|
-
return
|
|
844
|
-
|
|
1172
|
+
return a.trackChanges ? /* @__PURE__ */ r(
|
|
1173
|
+
N,
|
|
845
1174
|
{
|
|
846
|
-
icon:
|
|
1175
|
+
icon: f.trackChanges,
|
|
847
1176
|
title: "Track changes",
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1177
|
+
hint: O.trackChanges,
|
|
1178
|
+
onHint: m,
|
|
1179
|
+
active: $,
|
|
1180
|
+
disabled: i || s,
|
|
1181
|
+
onClick: () => Pr(!$)
|
|
851
1182
|
},
|
|
852
1183
|
"trackChanges"
|
|
853
1184
|
) : null;
|
|
854
1185
|
if (e === "comments")
|
|
855
|
-
return
|
|
856
|
-
|
|
1186
|
+
return a.comments ? /* @__PURE__ */ r(
|
|
1187
|
+
N,
|
|
857
1188
|
{
|
|
858
|
-
icon:
|
|
1189
|
+
icon: f.comments,
|
|
859
1190
|
title: "Comments",
|
|
860
|
-
|
|
861
|
-
|
|
1191
|
+
hint: O.comments,
|
|
1192
|
+
onHint: m,
|
|
1193
|
+
active: ze,
|
|
1194
|
+
disabled: i || s,
|
|
862
1195
|
onClick: () => {
|
|
863
|
-
|
|
1196
|
+
ze ? nt(!1) : sn();
|
|
864
1197
|
}
|
|
865
1198
|
},
|
|
866
1199
|
"comments"
|
|
867
1200
|
) : null;
|
|
868
|
-
if (e === "
|
|
869
|
-
|
|
870
|
-
|
|
1201
|
+
if (e === "code") {
|
|
1202
|
+
const d = at.code;
|
|
1203
|
+
return /* @__PURE__ */ r(
|
|
1204
|
+
N,
|
|
1205
|
+
{
|
|
1206
|
+
className: vn,
|
|
1207
|
+
icon: /* @__PURE__ */ S(sl, { children: [
|
|
1208
|
+
f.code,
|
|
1209
|
+
/* @__PURE__ */ r("span", { className: wn, children: Ul })
|
|
1210
|
+
] }),
|
|
1211
|
+
title: d.title,
|
|
1212
|
+
hint: O.code,
|
|
1213
|
+
onHint: m,
|
|
1214
|
+
active: Ke.has(e),
|
|
1215
|
+
disabled: i || s,
|
|
1216
|
+
onClick: () => R(e)
|
|
1217
|
+
},
|
|
1218
|
+
"code"
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
1221
|
+
if (e === "ai") {
|
|
1222
|
+
if (!a.ai || !(E != null && E.enabled)) return null;
|
|
1223
|
+
const d = fe.get("ai");
|
|
1224
|
+
return /* @__PURE__ */ S(
|
|
1225
|
+
"button",
|
|
871
1226
|
{
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1227
|
+
type: "button",
|
|
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();
|
|
1238
|
+
},
|
|
1239
|
+
onClick: () => re((C) => !C),
|
|
1240
|
+
children: [
|
|
1241
|
+
/* @__PURE__ */ r("span", { className: wi, "aria-hidden": "true" }),
|
|
1242
|
+
st
|
|
1243
|
+
]
|
|
877
1244
|
},
|
|
878
1245
|
"ai"
|
|
879
1246
|
);
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1247
|
+
}
|
|
1248
|
+
const n = at[e];
|
|
1249
|
+
return n ? /* @__PURE__ */ r(
|
|
1250
|
+
N,
|
|
883
1251
|
{
|
|
884
|
-
icon:
|
|
885
|
-
title:
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
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)
|
|
889
1259
|
},
|
|
890
1260
|
e
|
|
891
1261
|
) : null;
|
|
892
|
-
},
|
|
893
|
-
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(
|
|
894
1264
|
"div",
|
|
895
1265
|
{
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
"data-
|
|
899
|
-
"data-
|
|
900
|
-
"data-
|
|
901
|
-
"data-
|
|
902
|
-
"data-
|
|
903
|
-
"data-
|
|
904
|
-
|
|
905
|
-
...
|
|
1266
|
+
ref: Oe,
|
|
1267
|
+
className: Pc($i, uo),
|
|
1268
|
+
"data-testid": _o,
|
|
1269
|
+
"data-disabled": i || void 0,
|
|
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,
|
|
906
1277
|
children: [
|
|
907
|
-
|
|
908
|
-
|
|
1278
|
+
qt ? /* @__PURE__ */ r("div", { className: Ii, children: /* @__PURE__ */ r(
|
|
1279
|
+
gs,
|
|
909
1280
|
{
|
|
910
1281
|
type: "button",
|
|
911
|
-
"aria-label":
|
|
912
|
-
onClick: () =>
|
|
913
|
-
children:
|
|
1282
|
+
"aria-label": Fl,
|
|
1283
|
+
onClick: () => et(!1),
|
|
1284
|
+
children: Kl
|
|
914
1285
|
}
|
|
915
|
-
) }) : /* @__PURE__ */
|
|
1286
|
+
) }) : /* @__PURE__ */ S(
|
|
916
1287
|
"div",
|
|
917
1288
|
{
|
|
918
|
-
className:
|
|
1289
|
+
className: Ai,
|
|
919
1290
|
role: "toolbar",
|
|
920
1291
|
"aria-label": "Ink formatting toolbar",
|
|
921
|
-
onContextMenu:
|
|
922
|
-
|
|
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)
|
|
923
1331
|
}
|
|
924
1332
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
|
|
1333
|
+
/* @__PURE__ */ r(
|
|
1334
|
+
_a,
|
|
927
1335
|
{
|
|
928
|
-
open:
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
onClose: () =>
|
|
1336
|
+
open: Or,
|
|
1337
|
+
mode: Cr,
|
|
1338
|
+
points: Ir,
|
|
1339
|
+
colors: hr,
|
|
1340
|
+
onClose: () => qe(!1),
|
|
1341
|
+
onApply: Wr
|
|
933
1342
|
}
|
|
934
1343
|
),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
|
|
1344
|
+
/* @__PURE__ */ r(
|
|
1345
|
+
oa,
|
|
937
1346
|
{
|
|
938
|
-
open:
|
|
939
|
-
onClose: () =>
|
|
1347
|
+
open: vt,
|
|
1348
|
+
onClose: () => ye(!1),
|
|
940
1349
|
onConfirm: (e) => {
|
|
941
|
-
|
|
1350
|
+
I(o.current), ft(e), _();
|
|
942
1351
|
}
|
|
943
1352
|
}
|
|
944
1353
|
),
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
|
|
1354
|
+
/* @__PURE__ */ r(
|
|
1355
|
+
ra,
|
|
947
1356
|
{
|
|
948
|
-
open:
|
|
949
|
-
focusField:
|
|
950
|
-
onClose: () =>
|
|
951
|
-
onReplace: (e, t,
|
|
952
|
-
if (!
|
|
953
|
-
const
|
|
954
|
-
|
|
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);
|
|
955
1364
|
}
|
|
956
1365
|
}
|
|
957
1366
|
),
|
|
958
|
-
|
|
959
|
-
|
|
1367
|
+
$ && a.trackChanges ? /* @__PURE__ */ r(
|
|
1368
|
+
na,
|
|
960
1369
|
{
|
|
961
|
-
changes:
|
|
962
|
-
onAccept:
|
|
963
|
-
onReject:
|
|
964
|
-
onAcceptAll: () =>
|
|
965
|
-
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))
|
|
966
1375
|
}
|
|
967
1376
|
) : null,
|
|
968
|
-
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
|
|
972
|
-
|
|
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,
|
|
1381
|
+
{
|
|
1382
|
+
items: xo,
|
|
1383
|
+
activeIndex: Xo,
|
|
1384
|
+
onHide: cn,
|
|
1385
|
+
onSelect: (e) => {
|
|
1386
|
+
o.current && (es(o.current, e), Go(e));
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
) : null,
|
|
1390
|
+
/* @__PURE__ */ S("div", { className: Di, children: [
|
|
1391
|
+
a.blocks ? /* @__PURE__ */ r(
|
|
1392
|
+
Ws,
|
|
973
1393
|
{
|
|
974
|
-
visible:
|
|
975
|
-
top:
|
|
976
|
-
onMoveUp: () =>
|
|
977
|
-
onMoveDown: () =>
|
|
978
|
-
onDragStart:
|
|
1394
|
+
visible: nr && !i && !s,
|
|
1395
|
+
top: er,
|
|
1396
|
+
onMoveUp: () => dn("up"),
|
|
1397
|
+
onMoveDown: () => dn("down"),
|
|
1398
|
+
onDragStart: el
|
|
979
1399
|
}
|
|
980
1400
|
) : null,
|
|
981
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ r(
|
|
982
1402
|
"div",
|
|
983
1403
|
{
|
|
984
|
-
ref:
|
|
985
|
-
className:
|
|
986
|
-
contentEditable: !
|
|
1404
|
+
ref: o,
|
|
1405
|
+
className: ce ? `${Un} ${Mi}` : Un,
|
|
1406
|
+
contentEditable: !i && !s && !ce,
|
|
987
1407
|
role: "textbox",
|
|
988
1408
|
"aria-multiline": "true",
|
|
989
|
-
"aria-placeholder":
|
|
990
|
-
"data-placeholder":
|
|
1409
|
+
"aria-placeholder": pt,
|
|
1410
|
+
"data-placeholder": pt,
|
|
991
1411
|
suppressContentEditableWarning: !0,
|
|
992
|
-
style: { minHeight:
|
|
993
|
-
onInput:
|
|
994
|
-
onBlur:
|
|
995
|
-
onKeyUp:
|
|
996
|
-
onKeyDown:
|
|
997
|
-
onMouseUp:
|
|
998
|
-
onContextMenu:
|
|
999
|
-
onDragOver:
|
|
1000
|
-
onDrop:
|
|
1001
|
-
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,
|
|
1002
1422
|
onPaste: (e) => {
|
|
1003
|
-
|
|
1423
|
+
jr(e);
|
|
1004
1424
|
}
|
|
1005
1425
|
}
|
|
1006
1426
|
),
|
|
1007
|
-
|
|
1008
|
-
|
|
1427
|
+
ce ? /* @__PURE__ */ r(
|
|
1428
|
+
ia,
|
|
1009
1429
|
{
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1430
|
+
value: Kt,
|
|
1431
|
+
onChange: Ft,
|
|
1432
|
+
disabled: i || s,
|
|
1433
|
+
minHeight: Tn
|
|
1014
1434
|
}
|
|
1015
1435
|
) : null,
|
|
1016
|
-
|
|
1017
|
-
|
|
1436
|
+
Yt ? /* @__PURE__ */ r(
|
|
1437
|
+
ea,
|
|
1018
1438
|
{
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1439
|
+
items: or,
|
|
1440
|
+
top: Ut.top,
|
|
1441
|
+
left: Ut.left,
|
|
1442
|
+
query: Wo,
|
|
1443
|
+
onSelect: Jr
|
|
1024
1444
|
}
|
|
1025
1445
|
) : null,
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
|
|
1446
|
+
Ze ? /* @__PURE__ */ r(
|
|
1447
|
+
ys,
|
|
1028
1448
|
{
|
|
1029
|
-
|
|
1030
|
-
top:
|
|
1031
|
-
|
|
1449
|
+
suggestion: U.suggestion,
|
|
1450
|
+
position: { top: U.top, left: U.left },
|
|
1451
|
+
visible: U.visible,
|
|
1452
|
+
onAccept: Zt,
|
|
1453
|
+
onDismiss: P
|
|
1454
|
+
}
|
|
1455
|
+
) : null,
|
|
1456
|
+
/* @__PURE__ */ r(
|
|
1457
|
+
zs,
|
|
1458
|
+
{
|
|
1459
|
+
open: Ye.open,
|
|
1460
|
+
top: Ye.top,
|
|
1461
|
+
left: Ye.left,
|
|
1032
1462
|
icons: {
|
|
1033
|
-
bold:
|
|
1034
|
-
italic:
|
|
1035
|
-
underline:
|
|
1036
|
-
code:
|
|
1037
|
-
link:
|
|
1038
|
-
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
|
|
1039
1469
|
},
|
|
1040
|
-
activeFormats:
|
|
1041
|
-
disabled:
|
|
1042
|
-
onFormat:
|
|
1043
|
-
onLink:
|
|
1044
|
-
onClose: () =>
|
|
1470
|
+
activeFormats: Ke,
|
|
1471
|
+
disabled: i || s,
|
|
1472
|
+
onFormat: Zr,
|
|
1473
|
+
onLink: ot,
|
|
1474
|
+
onClose: () => j((e) => ({ ...e, open: !1 }))
|
|
1045
1475
|
}
|
|
1046
1476
|
),
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
|
|
1477
|
+
/* @__PURE__ */ r(
|
|
1478
|
+
ro,
|
|
1049
1479
|
{
|
|
1050
|
-
open:
|
|
1051
|
-
x:
|
|
1052
|
-
y:
|
|
1053
|
-
items:
|
|
1054
|
-
colorMode:
|
|
1480
|
+
open: Xe.open,
|
|
1481
|
+
x: Xe.x,
|
|
1482
|
+
y: Xe.y,
|
|
1483
|
+
items: qr,
|
|
1484
|
+
colorMode: je,
|
|
1055
1485
|
onClose: () => {
|
|
1056
|
-
|
|
1486
|
+
xt(!1), Ge((e) => ({ ...e, open: !1 }));
|
|
1057
1487
|
}
|
|
1058
1488
|
}
|
|
1059
1489
|
),
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
|
|
1490
|
+
/* @__PURE__ */ r(
|
|
1491
|
+
ro,
|
|
1062
1492
|
{
|
|
1063
|
-
open:
|
|
1064
|
-
x:
|
|
1065
|
-
y:
|
|
1066
|
-
items:
|
|
1067
|
-
colorMode:
|
|
1068
|
-
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 }))
|
|
1069
1499
|
}
|
|
1070
1500
|
)
|
|
1071
1501
|
] }),
|
|
1072
|
-
|
|
1073
|
-
|
|
1502
|
+
ze && a.comments ? /* @__PURE__ */ r(
|
|
1503
|
+
Ks,
|
|
1074
1504
|
{
|
|
1075
|
-
comments:
|
|
1076
|
-
author:
|
|
1077
|
-
onClose: () =>
|
|
1505
|
+
comments: se,
|
|
1506
|
+
author: x,
|
|
1507
|
+
onClose: () => nt(!1),
|
|
1078
1508
|
onResolve: (e) => {
|
|
1079
|
-
const t =
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
(
|
|
1509
|
+
const t = se.find((n) => n.id === e);
|
|
1510
|
+
tt(
|
|
1511
|
+
se.map(
|
|
1512
|
+
(n) => n.id === e ? { ...n, resolved: !0 } : n
|
|
1083
1513
|
)
|
|
1084
|
-
), t &&
|
|
1514
|
+
), t && o.current && w($c(o.current.innerHTML, t.highlightId));
|
|
1085
1515
|
},
|
|
1086
1516
|
onAddReply: (e, t) => {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
(
|
|
1090
|
-
...
|
|
1517
|
+
tt(
|
|
1518
|
+
se.map(
|
|
1519
|
+
(n) => n.id === e ? {
|
|
1520
|
+
...n,
|
|
1091
1521
|
replies: [
|
|
1092
|
-
...
|
|
1522
|
+
...n.replies,
|
|
1093
1523
|
{
|
|
1094
|
-
id:
|
|
1095
|
-
author:
|
|
1524
|
+
id: Gn("reply"),
|
|
1525
|
+
author: x,
|
|
1096
1526
|
body: t,
|
|
1097
1527
|
timestamp: Date.now()
|
|
1098
1528
|
}
|
|
1099
1529
|
]
|
|
1100
|
-
} :
|
|
1530
|
+
} : n
|
|
1101
1531
|
)
|
|
1102
1532
|
);
|
|
1103
1533
|
}
|
|
1104
1534
|
}
|
|
1105
1535
|
) : null,
|
|
1106
|
-
|
|
1107
|
-
|
|
1536
|
+
ll && E ? /* @__PURE__ */ r(
|
|
1537
|
+
Fs,
|
|
1108
1538
|
{
|
|
1109
|
-
config:
|
|
1110
|
-
documentHtml: ((
|
|
1111
|
-
selectionHtml:
|
|
1112
|
-
onBusyChange:
|
|
1113
|
-
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),
|
|
1114
1544
|
onApplyHtml: (e) => {
|
|
1115
|
-
if (
|
|
1116
|
-
|
|
1545
|
+
if (I(o.current), kt)
|
|
1546
|
+
A(e);
|
|
1117
1547
|
else {
|
|
1118
|
-
|
|
1548
|
+
w(e);
|
|
1119
1549
|
return;
|
|
1120
1550
|
}
|
|
1121
|
-
|
|
1551
|
+
_();
|
|
1122
1552
|
}
|
|
1123
1553
|
}
|
|
1124
1554
|
) : null
|
|
1125
1555
|
] }),
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1556
|
+
Ot ? /* @__PURE__ */ S("div", { className: Hi, children: [
|
|
1557
|
+
/* @__PURE__ */ S("span", { children: [
|
|
1558
|
+
wo,
|
|
1559
|
+
" ",
|
|
1560
|
+
hl,
|
|
1561
|
+
" ",
|
|
1562
|
+
gl,
|
|
1563
|
+
" ",
|
|
1564
|
+
Uo,
|
|
1565
|
+
Ct ? ` / ${Ct}` : "",
|
|
1566
|
+
" ",
|
|
1567
|
+
Rl
|
|
1568
|
+
] }),
|
|
1569
|
+
/* @__PURE__ */ S("span", { className: ki, children: [
|
|
1570
|
+
/* @__PURE__ */ S("span", { children: [
|
|
1571
|
+
bl,
|
|
1572
|
+
" ",
|
|
1573
|
+
Fo,
|
|
1574
|
+
", ",
|
|
1575
|
+
Sl,
|
|
1576
|
+
" ",
|
|
1577
|
+
yo
|
|
1578
|
+
] }),
|
|
1579
|
+
/* @__PURE__ */ r("span", { className: "Ink-Editor__footer-sync", children: Bl })
|
|
1580
|
+
] })
|
|
1129
1581
|
] }) : null
|
|
1130
1582
|
]
|
|
1131
1583
|
}
|
|
1132
1584
|
);
|
|
1133
1585
|
};
|
|
1134
1586
|
export {
|
|
1135
|
-
|
|
1587
|
+
Pu as InkEditor
|
|
1136
1588
|
};
|