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