@forgedevstack/ink 1.1.8 → 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 +25 -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 +1301 -1006
- 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.js +14 -13
- 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 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +83 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +66 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/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 +7 -6
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +7 -6
- 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 +11 -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/InkTabs/InkTabs.cjs +1 -0
- package/dist/components/InkTabs/InkTabs.d.ts +4 -0
- package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
- package/dist/components/InkTabs/InkTabs.js +104 -0
- package/dist/components/InkTabs/index.d.ts +2 -0
- package/dist/components/InkTabs/index.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.js +309 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +73 -0
- package/dist/components/InkWorkspace/index.d.ts +4 -0
- package/dist/components/InkWorkspace/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/constants/collab.const.cjs +1 -0
- package/dist/constants/collab.const.d.ts +20 -0
- package/dist/constants/collab.const.d.ts.map +1 -0
- package/dist/constants/collab.const.js +54 -0
- package/dist/constants/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/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.js +43 -37
- 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/constants/workspace.const.cjs +1 -0
- package/dist/constants/workspace.const.d.ts +24 -0
- package/dist/constants/workspace.const.d.ts.map +1 -0
- package/dist/constants/workspace.const.js +23 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useInkCollaboration.cjs +1 -0
- package/dist/hooks/useInkCollaboration.d.ts +4 -0
- package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
- package/dist/hooks/useInkCollaboration.js +87 -0
- package/dist/hooks/useToolbarOverflow.cjs +1 -1
- package/dist/hooks/useToolbarOverflow.js +12 -11
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +151 -135
- 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/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 +54 -0
- package/dist/types/collab.types.d.ts.map +1 -0
- package/dist/types/features.types.d.ts +1 -1
- package/dist/types/features.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +3 -1
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/workspace.types.d.ts +54 -0
- package/dist/types/workspace.types.d.ts.map +1 -0
- package/dist/utils/blocks.utils.cjs +1 -1
- package/dist/utils/blocks.utils.js +19 -18
- package/dist/utils/collab.utils.cjs +1 -0
- package/dist/utils/collab.utils.d.ts +5 -0
- package/dist/utils/collab.utils.d.ts.map +1 -0
- package/dist/utils/collab.utils.js +33 -0
- package/dist/utils/collab.utils.test.d.ts +2 -0
- package/dist/utils/collab.utils.test.d.ts.map +1 -0
- package/dist/utils/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 +12 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ink.brand.test.d.ts +2 -0
- package/dist/utils/ink.brand.test.d.ts.map +1 -0
- package/dist/utils/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/dist/utils/workspace.utils.cjs +1 -0
- package/dist/utils/workspace.utils.d.ts +5 -0
- package/dist/utils/workspace.utils.d.ts.map +1 -0
- package/dist/utils/workspace.utils.js +26 -0
- package/dist/utils/workspace.utils.test.d.ts +2 -0
- package/dist/utils/workspace.utils.test.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { EMPTY_STRING as N } from "../../../../constants/generals.const.js";
|
|
3
3
|
import { INK_CLASS_TOOL_WRAP as _, INK_CLASS_PLUGIN_PIP as I } from "../../../../constants/defaults.const.js";
|
|
4
4
|
import "../../../../constants/openai.const.js";
|
|
5
5
|
import "../../../../utils/paste.utils.js";
|
|
6
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
6
7
|
import { Button as L } from "../../../../common-components/Button/Button.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import "react-dom";
|
|
9
|
-
const
|
|
10
|
+
const A = (a) => {
|
|
10
11
|
const {
|
|
11
|
-
icon:
|
|
12
|
+
icon: i,
|
|
12
13
|
title: e,
|
|
13
|
-
hint:
|
|
14
|
+
hint: l,
|
|
14
15
|
onHint: o,
|
|
15
16
|
pluginColor: r,
|
|
16
|
-
active:
|
|
17
|
+
active: t = !1,
|
|
17
18
|
onClick: n,
|
|
18
19
|
disabled: m = !1,
|
|
19
20
|
className: p
|
|
20
21
|
} = a, c = (d) => {
|
|
21
22
|
d.preventDefault();
|
|
22
|
-
}, u =
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
}, u = l || e;
|
|
24
|
+
return /* @__PURE__ */ s(
|
|
24
25
|
"span",
|
|
25
26
|
{
|
|
26
27
|
className: _,
|
|
@@ -31,15 +32,15 @@ const x = (a) => {
|
|
|
31
32
|
{
|
|
32
33
|
title: e,
|
|
33
34
|
"aria-label": e,
|
|
34
|
-
"aria-pressed":
|
|
35
|
+
"aria-pressed": t,
|
|
35
36
|
disabled: m,
|
|
36
|
-
active:
|
|
37
|
+
active: t,
|
|
37
38
|
className: p,
|
|
38
39
|
onMouseDown: c,
|
|
39
40
|
onClick: n,
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
-
r ? /* @__PURE__ */
|
|
42
|
+
i,
|
|
43
|
+
r ? /* @__PURE__ */ s("span", { className: I, style: { background: r }, "aria-hidden": !0 }) : null
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
)
|
|
@@ -47,5 +48,5 @@ const x = (a) => {
|
|
|
47
48
|
);
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
A as ToolbarButton
|
|
51
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const u=a=>{const{value:t,onChange:s,title:l,disabled:i=!1,type:o="text"}=a,n=r=>{s(r.target.value)};return e.jsxs("label",{className:"Ink-Editor__color",title:l,"aria-label":l,children:[e.jsx("span",{className:"Ink-Editor__color-swatch",style:{background:t},"data-type":o}),e.jsx("input",{type:"color",value:t,disabled:i,onChange:n,list:`ink-colors-${o}`}),e.jsx("datalist",{id:`ink-colors-${o}`,children:c.INK_COLOR_SWATCHES.map(r=>e.jsx("option",{value:r},r))})]})};exports.ToolbarColorPicker=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const u=a=>{const{value:t,onChange:s,title:l,disabled:i=!1,type:o="text"}=a,n=r=>{s(r.target.value)};return e.jsxs("label",{className:"Ink-Editor__color",title:l,"aria-label":l,children:[e.jsx("span",{className:"Ink-Editor__color-swatch",style:{background:t},"data-type":o}),e.jsx("input",{type:"color",value:t,disabled:i,onChange:n,list:`ink-colors-${o}`}),e.jsx("datalist",{id:`ink-colors-${o}`,children:c.INK_COLOR_SWATCHES.map(r=>e.jsx("option",{value:r},r))})]})};exports.ToolbarColorPicker=u;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { INK_COLOR_SWATCHES as
|
|
2
|
+
import { INK_COLOR_SWATCHES as p } from "../../../../constants/defaults.const.js";
|
|
3
3
|
import "../../../../constants/openai.const.js";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
-
const { value: e, onChange:
|
|
9
|
-
return /* @__PURE__ */ s("label", { className: "Ink-Editor__color", title:
|
|
8
|
+
const _ = (l) => {
|
|
9
|
+
const { value: e, onChange: i, title: r, disabled: n = !1, type: a = "text" } = l;
|
|
10
|
+
return /* @__PURE__ */ s("label", { className: "Ink-Editor__color", title: r, "aria-label": r, children: [
|
|
10
11
|
/* @__PURE__ */ t("span", { className: "Ink-Editor__color-swatch", style: { background: e }, "data-type": a }),
|
|
11
12
|
/* @__PURE__ */ t(
|
|
12
13
|
"input",
|
|
13
14
|
{
|
|
14
15
|
type: "color",
|
|
15
16
|
value: e,
|
|
16
|
-
disabled:
|
|
17
|
+
disabled: n,
|
|
17
18
|
onChange: (o) => {
|
|
18
|
-
|
|
19
|
+
i(o.target.value);
|
|
19
20
|
},
|
|
20
21
|
list: `ink-colors-${a}`
|
|
21
22
|
}
|
|
22
23
|
),
|
|
23
|
-
/* @__PURE__ */ t("datalist", { id: `ink-colors-${a}`, children:
|
|
24
|
+
/* @__PURE__ */ t("datalist", { id: `ink-colors-${a}`, children: p.map((o) => /* @__PURE__ */ t("option", { value: o }, o)) })
|
|
24
25
|
] });
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
_ as ToolbarColorPicker
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),A=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const C=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const s=require("./ToolbarCustomize.const.cjs"),I=t=>{const{open:T,options:n,visibleItems:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),A=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const C=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const s=require("./ToolbarCustomize.const.cjs"),I=t=>{const{open:T,options:n,visibleItems:i,onToggle:O,onClose:a,title:l=s.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE,closeLabel:c=s.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE,listAriaLabel:o=s.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA}=t;if(!T)return null;const _=new Set(i);return e.jsxs("div",{className:s.TOOLBAR_CUSTOMIZE_CLASS,"aria-label":l,children:[e.jsx("p",{className:s.TOOLBAR_CUSTOMIZE_TITLE_CLASS,children:l}),e.jsx("ul",{className:s.TOOLBAR_CUSTOMIZE_LIST_CLASS,"aria-label":o,children:n.map(r=>{const L=_.has(r),S=A.TOOLBAR_OPTION_LABELS[r]??r;return e.jsx("li",{className:s.TOOLBAR_CUSTOMIZE_ITEM_CLASS,children:e.jsxs("label",{children:[e.jsx("input",{type:s.TOOLBAR_CUSTOMIZE_INPUT_TYPE,checked:L,onChange:u=>O(r,u.target.checked)}),e.jsx("span",{children:S})]})},r)})}),e.jsx("div",{className:s.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS,children:e.jsx(C.Button,{type:"button",onClick:a,children:c})})]})};exports.ToolbarCustomize=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const _="Ink-ToolbarCustomize",O="Ink-ToolbarCustomize__title",L="Ink-ToolbarCustomize__list",S="Ink-ToolbarCustomize__item",A="Ink-ToolbarCustomize__actions",I=T.TOOLBAR_CUSTOMIZE_TITLE,C=T.TOOLBAR_CUSTOMIZE_CLOSE_LABEL,E=T.TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL,o="checkbox";exports.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS=A;exports.TOOLBAR_CUSTOMIZE_CLASS=_;exports.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE=C;exports.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA=E;exports.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE=I;exports.TOOLBAR_CUSTOMIZE_INPUT_TYPE=o;exports.TOOLBAR_CUSTOMIZE_ITEM_CLASS=S;exports.TOOLBAR_CUSTOMIZE_LIST_CLASS=L;exports.TOOLBAR_CUSTOMIZE_TITLE_CLASS=O;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const _="Ink-ToolbarCustomize",O="Ink-ToolbarCustomize__title",L="Ink-ToolbarCustomize__list",S="Ink-ToolbarCustomize__item",A="Ink-ToolbarCustomize__actions",I=T.TOOLBAR_CUSTOMIZE_TITLE,C=T.TOOLBAR_CUSTOMIZE_CLOSE_LABEL,E=T.TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL,o="checkbox";exports.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS=A;exports.TOOLBAR_CUSTOMIZE_CLASS=_;exports.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE=C;exports.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA=E;exports.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE=I;exports.TOOLBAR_CUSTOMIZE_INPUT_TYPE=o;exports.TOOLBAR_CUSTOMIZE_ITEM_CLASS=S;exports.TOOLBAR_CUSTOMIZE_LIST_CLASS=L;exports.TOOLBAR_CUSTOMIZE_TITLE_CLASS=O;
|
|
@@ -2,17 +2,18 @@ import { TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL as T, TOOLBAR_CUSTOMIZE_TITLE as _, T
|
|
|
2
2
|
import "../../../../constants/openai.const.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
+
const E = "Ink-ToolbarCustomize", i = "Ink-ToolbarCustomize__title", s = "Ink-ToolbarCustomize__list", U = "Ink-ToolbarCustomize__item", n = "Ink-ToolbarCustomize__actions", m = _, r = O, B = T, R = "checkbox";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
n as TOOLBAR_CUSTOMIZE_ACTIONS_CLASS,
|
|
11
|
+
E as TOOLBAR_CUSTOMIZE_CLASS,
|
|
12
|
+
r as TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE,
|
|
13
|
+
B as TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA,
|
|
14
|
+
m as TOOLBAR_CUSTOMIZE_DEFAULT_TITLE,
|
|
15
|
+
R as TOOLBAR_CUSTOMIZE_INPUT_TYPE,
|
|
15
16
|
U as TOOLBAR_CUSTOMIZE_ITEM_CLASS,
|
|
16
17
|
s as TOOLBAR_CUSTOMIZE_LIST_CLASS,
|
|
17
|
-
|
|
18
|
+
i as TOOLBAR_CUSTOMIZE_TITLE_CLASS
|
|
18
19
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { TOOLBAR_OPTION_LABELS as m } from "../../../../constants/toolbarMenu.const.js";
|
|
3
3
|
import "../../../../constants/openai.const.js";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import { Button as C } from "../../../../common-components/Button/Button.js";
|
|
6
7
|
import "react";
|
|
7
8
|
import "react-dom";
|
|
8
|
-
import { TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA as I, TOOLBAR_CUSTOMIZE_DEFAULT_TITLE as E, TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE as
|
|
9
|
-
const
|
|
9
|
+
import { TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA as I, TOOLBAR_CUSTOMIZE_DEFAULT_TITLE as E, TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE as p, TOOLBAR_CUSTOMIZE_CLASS as d, TOOLBAR_CUSTOMIZE_TITLE_CLASS as U, TOOLBAR_CUSTOMIZE_LIST_CLASS as h, TOOLBAR_CUSTOMIZE_ITEM_CLASS as B, TOOLBAR_CUSTOMIZE_INPUT_TYPE as R, TOOLBAR_CUSTOMIZE_ACTIONS_CLASS as b } from "./ToolbarCustomize.const.js";
|
|
10
|
+
const D = (O) => {
|
|
10
11
|
const {
|
|
11
12
|
open: t,
|
|
12
13
|
options: _,
|
|
@@ -14,16 +15,16 @@ const x = (r) => {
|
|
|
14
15
|
onToggle: i,
|
|
15
16
|
onClose: s,
|
|
16
17
|
title: T = E,
|
|
17
|
-
closeLabel: L =
|
|
18
|
+
closeLabel: L = p,
|
|
18
19
|
listAriaLabel: n = I
|
|
19
|
-
} =
|
|
20
|
+
} = O;
|
|
20
21
|
if (!t) return null;
|
|
21
22
|
const o = new Set(a);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ r("div", { className: d, "aria-label": T, children: [
|
|
23
24
|
/* @__PURE__ */ e("p", { className: U, children: T }),
|
|
24
25
|
/* @__PURE__ */ e("ul", { className: h, "aria-label": n, children: _.map((l) => {
|
|
25
26
|
const S = o.has(l), c = m[l] ?? l;
|
|
26
|
-
return /* @__PURE__ */ e("li", { className: B, children: /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ e("li", { className: B, children: /* @__PURE__ */ r("label", { children: [
|
|
27
28
|
/* @__PURE__ */ e(
|
|
28
29
|
"input",
|
|
29
30
|
{
|
|
@@ -39,5 +40,5 @@ const x = (r) => {
|
|
|
39
40
|
] });
|
|
40
41
|
};
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
D as ToolbarCustomize
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),u=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const D=require("./ToolbarDropdown.utils.cjs"),K=()=>t.jsx("svg",{className:n.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:t.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),P=R=>{const{options:d,value:L,onChange:b,title:_,disabled:f=!1}=R,[i,l]=r.useState(!1),[E,w]=r.useState({top:u.NUMBER_ZERO,left:u.NUMBER_ZERO,minWidth:u.NUMBER_ZERO}),m=r.useRef(null),N=r.useRef(null),T=r.useRef(null),S=d.find(e=>e.value===L)??d[u.NUMBER_ZERO],I=(S==null?void 0:S.label)??c.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{w(D.getToolbarDropdownMenuPosition(N.current))};e();const o=s=>{var p,C;const v=s.target;(p=m.current)!=null&&p.contains(v)||(C=T.current)!=null&&C.contains(v)||l(!1)},a=s=>{s.key===x.KEY_ESCAPE&&l(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]);const M=e=>{e.preventDefault()},h=()=>{f||l(e=>!e)};return t.jsxs("div",{className:n.INK_CLASS_STYLE_DD,ref:m,children:[t.jsxs("button",{ref:N,type:"button",className:n.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:f,onMouseDown:M,onClick:h,children:[t.jsx("span",{children:I}),t.jsx(K,{})]}),i?O.createPortal(t.jsx("div",{ref:T,className:`${n.INK_CLASS_STYLE_MENU} ${n.INK_CLASS_STYLE_MENU_PORTAL} ${n.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===L,a=`${n.INK_CLASS_STYLE_OPTION}${o?`${c.SPACE_STRING}${n.INK_CLASS_STYLE_OPTION_SEL}`:c.EMPTY_STRING}`;return t.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),b(e.value),l(!1)},children:[o?t.jsx("span",{className:n.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:c.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as C, useRef as _, useEffect as K } from "react";
|
|
3
3
|
import { createPortal as M } from "react-dom";
|
|
4
4
|
import { NUMBER_ZERO as l } from "../../../../constants/numbers.js";
|
|
@@ -8,25 +8,26 @@ import { KEY_ESCAPE as Y } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_STYLE_DD as O, INK_CLASS_STYLE_TRIGGER as P, INK_CLASS_STYLE_MENU as y, INK_CLASS_STYLE_MENU_PORTAL as x, INK_CLASS_STYLE_MENU_FORCED as $, INK_CLASS_STYLE_OPTION as k, INK_CLASS_STYLE_OPTION_SEL as G, INK_CLASS_STYLE_CHECK as H, INK_CLASS_STYLE_CHEV as U } from "../../../../constants/defaults.const.js";
|
|
9
9
|
import "../../../../constants/openai.const.js";
|
|
10
10
|
import "../../../../utils/paste.utils.js";
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
11
12
|
import { getToolbarDropdownMenuPosition as W } from "./ToolbarDropdown.utils.js";
|
|
12
|
-
const j = () => /* @__PURE__ */
|
|
13
|
+
const j = () => /* @__PURE__ */ t("svg", { className: U, viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { d: "M2 3.5L5 6.5L8 3.5", stroke: "currentColor", strokeWidth: "1.4", fill: "none" }) }), se = (h) => {
|
|
13
14
|
const { options: a, value: E, onChange: I, title: c, disabled: S = !1 } = h, [r, s] = C(!1), [d, b] = C({
|
|
14
15
|
top: l,
|
|
15
16
|
left: l,
|
|
16
17
|
minWidth: l
|
|
17
|
-
}), f = _(null),
|
|
18
|
+
}), f = _(null), p = _(null), L = _(null), u = a.find((e) => e.value === E) ?? a[l], g = (u == null ? void 0 : u.label) ?? w;
|
|
18
19
|
return K(() => {
|
|
19
20
|
if (!r) return;
|
|
20
21
|
const e = () => {
|
|
21
|
-
b(W(
|
|
22
|
+
b(W(p.current));
|
|
22
23
|
};
|
|
23
24
|
e();
|
|
24
|
-
const o = (
|
|
25
|
+
const o = (n) => {
|
|
25
26
|
var N, T;
|
|
26
|
-
const v =
|
|
27
|
-
(N = f.current) != null && N.contains(v) || (T =
|
|
28
|
-
}, i = (
|
|
29
|
-
|
|
27
|
+
const v = n.target;
|
|
28
|
+
(N = f.current) != null && N.contains(v) || (T = L.current) != null && T.contains(v) || s(!1);
|
|
29
|
+
}, i = (n) => {
|
|
30
|
+
n.key === Y && s(!1);
|
|
30
31
|
};
|
|
31
32
|
return document.addEventListener("mousedown", o), document.addEventListener("keydown", i), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
32
33
|
document.removeEventListener("mousedown", o), document.removeEventListener("keydown", i), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
@@ -35,7 +36,7 @@ const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "
|
|
|
35
36
|
/* @__PURE__ */ m(
|
|
36
37
|
"button",
|
|
37
38
|
{
|
|
38
|
-
ref:
|
|
39
|
+
ref: p,
|
|
39
40
|
type: "button",
|
|
40
41
|
className: P,
|
|
41
42
|
title: c,
|
|
@@ -50,16 +51,16 @@ const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "
|
|
|
50
51
|
S || s((e) => !e);
|
|
51
52
|
},
|
|
52
53
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ t("span", { children: g }),
|
|
55
|
+
/* @__PURE__ */ t(j, {})
|
|
55
56
|
]
|
|
56
57
|
}
|
|
57
58
|
),
|
|
58
59
|
r ? M(
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ t(
|
|
60
61
|
"div",
|
|
61
62
|
{
|
|
62
|
-
ref:
|
|
63
|
+
ref: L,
|
|
63
64
|
className: `${y} ${x} ${$}`,
|
|
64
65
|
"data-color-mode": D,
|
|
65
66
|
role: "listbox",
|
|
@@ -74,11 +75,11 @@ const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "
|
|
|
74
75
|
role: "option",
|
|
75
76
|
"aria-selected": o,
|
|
76
77
|
className: i,
|
|
77
|
-
onMouseDown: (
|
|
78
|
-
|
|
78
|
+
onMouseDown: (n) => {
|
|
79
|
+
n.preventDefault(), I(e.value), s(!1);
|
|
79
80
|
},
|
|
80
81
|
children: [
|
|
81
|
-
o ? /* @__PURE__ */
|
|
82
|
+
o ? /* @__PURE__ */ t("span", { className: H, "aria-hidden": "true", children: A }) : null,
|
|
82
83
|
e.label
|
|
83
84
|
]
|
|
84
85
|
},
|
|
@@ -92,5 +93,5 @@ const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "
|
|
|
92
93
|
] });
|
|
93
94
|
};
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
se as ToolbarDropdown
|
|
96
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const u=(E,e=_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX)=>{if(!E)return{top:_.NUMBER_ZERO,left:_.NUMBER_ZERO,minWidth:_.INK_STYLE_MENU_MIN_WIDTH_PX};const t=E.getBoundingClientRect(),r=window.innerWidth,N=window.innerHeight,o=Math.max(t.width,_.INK_STYLE_MENU_MIN_WIDTH_PX),M=Math.max(_.INK_STYLE_MENU_EDGE_PX,r-o-_.INK_STYLE_MENU_EDGE_PX),T=Math.min(Math.max(t.left,_.INK_STYLE_MENU_EDGE_PX),M),n=e>_.NUMBER_ZERO?e:_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX,i=t.bottom+_.INK_STYLE_MENU_GAP_PX,I=t.top-n-_.INK_STYLE_MENU_GAP_PX;return{top:i+n>N-_.INK_STYLE_MENU_EDGE_PX?Math.max(_.INK_STYLE_MENU_EDGE_PX,I):i,left:T,minWidth:o}};exports.getToolbarDropdownMenuPosition=u;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as
|
|
1
|
+
import { INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as p, INK_STYLE_MENU_MIN_WIDTH_PX as E, NUMBER_ZERO as n, INK_STYLE_MENU_EDGE_PX as t, INK_STYLE_MENU_GAP_PX as c } from "../../../../constants/numbers.js";
|
|
2
2
|
import "../../../../constants/openai.const.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
+
const u = (i, e = p) => {
|
|
8
9
|
if (!i)
|
|
9
|
-
return { top: n, left: n, minWidth:
|
|
10
|
-
const o = i.getBoundingClientRect(), M = window.innerWidth, h = window.innerHeight, _ = Math.max(o.width,
|
|
10
|
+
return { top: n, left: n, minWidth: E };
|
|
11
|
+
const o = i.getBoundingClientRect(), M = window.innerWidth, h = window.innerHeight, _ = Math.max(o.width, E), a = Math.max(t, M - _ - t), s = Math.min(Math.max(o.left, t), a), r = e > n ? e : p, m = o.bottom + c, N = o.top - r - c;
|
|
11
12
|
return { top: m + r > h - t ? Math.max(t, N) : m, left: s, minWidth: _ };
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
u as getToolbarDropdownMenuPosition
|
|
15
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=t=>{const{versions:n,onSave:o,onRestore:i,onCompare:r,onClose:a}=t;return s.jsxs("aside",{className:"Ink-Versions","aria-label":"Version history",children:[s.jsxs("div",{className:"Ink-Versions__header",children:[s.jsx("strong",{children:"Versions"}),s.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",onClick:o,children:"Save snapshot"}),s.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:a,children:"×"})]}),s.jsx("div",{className:"Ink-Versions__list",children:n.length===0?s.jsx("p",{className:"Ink-Versions__empty",children:"No snapshots yet."}):n.map(e=>s.jsxs("article",{className:"Ink-Versions__item",children:[s.jsx("strong",{children:e.name}),s.jsx("time",{children:new Date(e.savedAt).toLocaleString()}),s.jsxs("div",{className:"Ink-Versions__actions",children:[s.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>i(e),children:"Restore"}),s.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>r(e),children:"Compare"})]})]},e.id))})]})};exports.VersionHistory=l;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InkDocumentVersion } from '../../../../utils/versions.utils';
|
|
3
|
+
export interface VersionHistoryProps {
|
|
4
|
+
versions: InkDocumentVersion[];
|
|
5
|
+
onSave: () => void;
|
|
6
|
+
onRestore: (version: InkDocumentVersion) => void;
|
|
7
|
+
onCompare: (version: InkDocumentVersion) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const VersionHistory: FC<VersionHistoryProps>;
|
|
11
|
+
//# sourceMappingURL=VersionHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VersionHistory.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/VersionHistory/VersionHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAmClD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as e, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
const d = (o) => {
|
|
3
|
+
const { versions: s, onSave: i, onRestore: r, onCompare: a, onClose: l } = o;
|
|
4
|
+
return /* @__PURE__ */ e("aside", { className: "Ink-Versions", "aria-label": "Version history", children: [
|
|
5
|
+
/* @__PURE__ */ e("div", { className: "Ink-Versions__header", children: [
|
|
6
|
+
/* @__PURE__ */ n("strong", { children: "Versions" }),
|
|
7
|
+
/* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button Ink-Editor__button--active", onClick: i, children: "Save snapshot" }),
|
|
8
|
+
/* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: l, children: "×" })
|
|
9
|
+
] }),
|
|
10
|
+
/* @__PURE__ */ n("div", { className: "Ink-Versions__list", children: s.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Versions__empty", children: "No snapshots yet." }) : s.map((t) => /* @__PURE__ */ e("article", { className: "Ink-Versions__item", children: [
|
|
11
|
+
/* @__PURE__ */ n("strong", { children: t.name }),
|
|
12
|
+
/* @__PURE__ */ n("time", { children: new Date(t.savedAt).toLocaleString() }),
|
|
13
|
+
/* @__PURE__ */ e("div", { className: "Ink-Versions__actions", children: [
|
|
14
|
+
/* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: () => r(t), children: "Restore" }),
|
|
15
|
+
/* @__PURE__ */ n("button", { type: "button", className: "Ink-Editor__button", onClick: () => a(t), children: "Compare" })
|
|
16
|
+
] })
|
|
17
|
+
] }, t.id)) })
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
d as VersionHistory
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/VersionHistory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -3,6 +3,9 @@ export { ToolbarDropdown } from './ToolbarDropdown';
|
|
|
3
3
|
export { ToolbarColorPicker } from './ToolbarColorPicker';
|
|
4
4
|
export { CommentsPanel } from './CommentsPanel';
|
|
5
5
|
export { AiPanel } from './AiPanel';
|
|
6
|
+
export { AiSelectionBubble } from './AiSelectionBubble';
|
|
7
|
+
export { capabilityForSelectionAction, htmlFromAiResponse, optionsForSelectionAction, placeAiSelectionBubble, } from './AiSelectionBubble';
|
|
8
|
+
export type { AiSelectionBubbleProps } from './AiSelectionBubble';
|
|
6
9
|
export { AiAutocomplete, AI_AUTOCOMPLETE_DEBOUNCE_MS, AI_AUTOCOMPLETE_MAX_PREFIX_CHARS, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT, getTextBeforeCaret, getCaretPositionInRoot, } from './AiAutocomplete';
|
|
7
10
|
export type { AiAutocompleteProps, AiAutocompletePosition } from './AiAutocomplete';
|
|
8
11
|
export { BlockHandles, BLOCK_HANDLES_DRAG_EFFECT_MOVE, BLOCK_HANDLES_DRAG_MIME, BLOCK_HANDLES_DRAG_PAYLOAD, } from './BlockHandles';
|
|
@@ -12,6 +15,10 @@ export { SlashMenu } from './SlashMenu';
|
|
|
12
15
|
export { OutlineRail } from './OutlineRail';
|
|
13
16
|
export type { OutlineRailProps } from './OutlineRail';
|
|
14
17
|
export { TrackChangesBar } from './TrackChangesBar';
|
|
18
|
+
export { VersionHistory } from './VersionHistory';
|
|
19
|
+
export type { VersionHistoryProps } from './VersionHistory';
|
|
20
|
+
export { MentionMenu } from './MentionMenu';
|
|
21
|
+
export { ImageFrame } from './ImageFrame';
|
|
15
22
|
export { SignPad } from './SignPad';
|
|
16
23
|
export { FindReplace } from './FindReplace';
|
|
17
24
|
export { ToolbarCustomize } from './ToolbarCustomize';
|
|
@@ -30,4 +37,8 @@ export { GraphEditModal } from './GraphEditModal';
|
|
|
30
37
|
export type { GraphEditModalProps, GraphEditMode } from './GraphEditModal';
|
|
31
38
|
export { ThemePicker } from './ThemePicker';
|
|
32
39
|
export type { ThemePickerProps } from './ThemePicker';
|
|
40
|
+
export { PresenceStack } from './PresenceStack';
|
|
41
|
+
export type { PresenceStackProps } from './PresenceStack';
|
|
42
|
+
export { RemoteCursors } from './RemoteCursors';
|
|
43
|
+
export type { RemoteCursorsProps } from './RemoteCursors';
|
|
33
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB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AM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)return!1;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../constants/numbers.cjs"),S=require("../../../constants/fonts.const.cjs"),n=require("../../../constants/lists.const.cjs"),M=require("../../../constants/blocks.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");const y=require("../../../utils/blocks.utils.cjs");require("../../../utils/paste.utils.cjs");require("../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const g="color",I="background-color",U="background",E="color",A="style",D=1,O=3,h="removeFormat",d="insertUnorderedList",f="insertOrderedList",B="superscript",P="subscript",k="styleWithCSS",i=(e,t)=>document.execCommand(e,!1,t),l=e=>document.queryCommandState(e),w=e=>document.queryCommandValue(e),H="http://",m="https://",x="mailto:",v="&",b="<",q=">",F=""",Y=e=>e.replace(/&/g,v).replace(/</g,b).replace(/>/g,q).replace(/"/g,F),W=(e,t="")=>{if(!e)return!1;const r=e.startsWith(H)||e.startsWith(m)||e.startsWith(x)?e:`${m}${e}`,o=window.getSelection();return(!o||o.isCollapsed)&&t?i("insertHTML",`<a href="${r}">${Y(t)}</a>`):i("createLink",r)},K=e=>i("foreColor",e),Z=e=>i("hiliteColor",e),C=e=>i("insertHTML",e),V=(e,t="")=>{const r=t.replace(/"/g,""");return C(`<img src="${e}" alt="${r}" style="max-width:100%;height:auto;" />`)},G=e=>new Promise((t,r)=>{const o=new FileReader;o.onload=()=>t(String(o.result)),o.onerror=r,o.readAsDataURL(e)}),$=()=>{const e=new Set;return l("bold")&&e.add("bold"),l("italic")&&e.add("italic"),l("underline")&&e.add("underline"),l("strikeThrough")&&e.add("strikethrough"),l(d)&&e.add("bulletList"),l(f)&&e.add("orderedList"),l(B)&&e.add("superscript"),l(P)&&e.add("subscript"),e},R=e=>{e.style.removeProperty(g),e.style.removeProperty(I),e.style.removeProperty(U),e.hasAttribute(E)&&e.removeAttribute(E);const t=e.getAttribute(A);t!==null&&!t.trim()&&e.removeAttribute(A)},p=()=>{const e=window.getSelection();if(!e||e.rangeCount===c.NUMBER_ZERO)return;const r=e.getRangeAt(c.NUMBER_ZERO).commonAncestorContainer,o=r.nodeType===D?r:r.parentElement;o&&(o instanceof HTMLElement&&e.containsNode(o,!0)&&R(o),o.querySelectorAll("*").forEach(s=>{s instanceof HTMLElement&&e.containsNode(s,!0)&&R(s)}))},X=()=>{const e=i(h);return p(),e},j=e=>{const t=S.FONT_FAMILY_BY_VALUE[e]??e;if(i(k,"true"),e===S.FONT_VALUE_SYSTEM){const r=window.getSelection();if(!r||r.rangeCount===c.NUMBER_ZERO||r.isCollapsed)return i(S.FONT_COMMAND_NAME,t);const o=r.getRangeAt(c.NUMBER_ZERO),s=document.createElement("span");s.style.setProperty(S.FONT_STYLE_PROPERTY,t);try{return o.surroundContents(s),!0}catch{return i(S.FONT_COMMAND_NAME,t)}}return i(S.FONT_COMMAND_NAME,e)},Q=e=>{e.classList.remove(n.LIST_CLASS_DASH,n.LIST_CLASS_ALPHA),e.style.removeProperty("list-style-type")},z=e=>{e===n.LIST_VALUE_BULLET||e===n.LIST_VALUE_DASH?i(d):i(f);const t=window.getSelection();let o=(t==null?void 0:t.anchorNode)??null,s=null;for(;o;){if(o instanceof HTMLElement&&(o.tagName===n.LIST_TAG_UL||o.tagName===n.LIST_TAG_OL)){s=o;break}o=o.parentNode}return s&&(Q(s),e===n.LIST_VALUE_BULLET?s.style.listStyleType=n.LIST_STYLE_DISC:e===n.LIST_VALUE_DASH?s.classList.add(n.LIST_CLASS_DASH):e===n.LIST_VALUE_NUMBERS?s.style.listStyleType=n.LIST_STYLE_DECIMAL:e===n.LIST_VALUE_LETTERS&&(s.classList.add(n.LIST_CLASS_ALPHA),s.style.listStyleType=n.LIST_STYLE_LOWER_ALPHA)),!0},J=()=>{const e=window.getSelection();let t=(e==null?void 0:e.anchorNode)??null;for(;t;){if(t instanceof HTMLElement){if(t.tagName===n.LIST_TAG_UL)return t.classList.contains(n.LIST_CLASS_DASH)?n.LIST_VALUE_DASH:n.LIST_VALUE_BULLET;if(t.tagName===n.LIST_TAG_OL)return t.classList.contains(n.LIST_CLASS_ALPHA)||t.style.listStyleType===n.LIST_STYLE_LOWER_ALPHA?n.LIST_VALUE_LETTERS:n.LIST_VALUE_NUMBERS}t=t.parentNode}return n.LIST_VALUE_BULLET},ee=(e,t)=>{const r=window.getSelection(),o=y.getBlockElement((r==null?void 0:r.anchorNode)??null,e);return o?(o.setAttribute(M.DIR_ATTRIBUTE,t),!0):!1},te=[{prefix:"###",command:"formatBlock",value:"h3"},{prefix:"##",command:"formatBlock",value:"h2"},{prefix:"#",command:"formatBlock",value:"h1"},{prefix:">",command:"formatBlock",value:"blockquote"},{prefix:"1.",command:f}],re=e=>{if(e.key!==n.LIST_MARKDOWN_SPACE)return!1;const t=window.getSelection();if(!t||!t.isCollapsed||t.rangeCount===c.NUMBER_ZERO)return!1;const r=t.anchorNode;if(!r||r.nodeType!==O)return!1;const o=r.textContent??"",s=t.anchorOffset,T=o.slice(c.NUMBER_ZERO,s),a=te.find(N=>T.endsWith(N.prefix));if(!a)return!1;const _=s-a.prefix.length,u=_>c.NUMBER_ZERO?T[_-1]:"";if(u&&u!==`
|
|
2
|
+
`)return!1;e.preventDefault();const L=t.getRangeAt(c.NUMBER_ZERO);return L.setStart(r,_),L.setEnd(r,s),L.deleteContents(),a.value?i(a.command,a.value):i(a.command),!0},ne=e=>{if(e.key!==n.LIST_MARKDOWN_SPACE)return!1;const t=window.getSelection();if(!t||!t.isCollapsed||t.rangeCount===c.NUMBER_ZERO)return!1;const r=t.anchorNode;if(!r||r.nodeType!==O)return!1;const o=r.textContent??"",s=t.anchorOffset,T=o.slice(c.NUMBER_ZERO,s),a=T.endsWith(n.LIST_MARKDOWN_DASH)?n.LIST_MARKDOWN_DASH:T.endsWith(n.LIST_MARKDOWN_STAR)?n.LIST_MARKDOWN_STAR:null;if(!a)return!1;const _=s-a.length;if(_<c.NUMBER_ZERO)return!1;const u=_>c.NUMBER_ZERO?T[_-1]:"";if(u&&u!==`
|
|
3
|
+
`)return!1;e.preventDefault();const L=t.getRangeAt(c.NUMBER_ZERO);return L.setStart(r,_),L.setEnd(r,s),L.deleteContents(),i(d),!0};exports.applyFontFamily=j;exports.applyListType=z;exports.clearFormatDeep=X;exports.detectListType=J;exports.execCommand=i;exports.fileToDataUrl=G;exports.getActiveFormats=$;exports.insertHTML=C;exports.insertImage=V;exports.insertLink=W;exports.queryCommandState=l;exports.queryCommandValue=w;exports.setBlockDirection=ee;exports.setHighlightColor=Z;exports.setTextColor=K;exports.stripSelectionColors=p;exports.tryConvertMarkdownBlockPrefix=re;exports.tryConvertMarkdownListPrefix=ne;
|
|
@@ -16,6 +16,7 @@ export declare const applyFontFamily: (fontValue: string) => boolean;
|
|
|
16
16
|
export declare const applyListType: (listValue: string) => boolean;
|
|
17
17
|
export declare const detectListType: () => string;
|
|
18
18
|
export declare const setBlockDirection: (root: HTMLElement, direction: typeof DIR_LTR | typeof DIR_RTL) => boolean;
|
|
19
|
+
export declare const tryConvertMarkdownBlockPrefix: (event: KeyboardEvent) => boolean;
|
|
19
20
|
export declare const tryConvertMarkdownListPrefix: (event: KeyboardEvent) => boolean;
|
|
20
21
|
export declare const isSelectionInListItem: () => boolean;
|
|
21
22
|
export declare const applyFormat: (format: ToolbarOption) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,OAAO,EACP,OAAO,EAqBR,MAAM,oBAAoB,CAAC;AAiB5B,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OACjB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,OACf,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACf,CAAC;AAiBtC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,qBAAiB,KA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