@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,119 +1,141 @@
|
|
|
1
|
-
import { NUMBER_ZERO as
|
|
2
|
-
import { FONT_VALUE_SYSTEM as
|
|
3
|
-
import {
|
|
4
|
-
import { DIR_ATTRIBUTE as
|
|
1
|
+
import { NUMBER_ZERO as c } from "../../../constants/numbers.js";
|
|
2
|
+
import { FONT_VALUE_SYSTEM as U, FONT_FAMILY_BY_VALUE as x, FONT_COMMAND_NAME as m, FONT_STYLE_PROPERTY as Y } from "../../../constants/fonts.const.js";
|
|
3
|
+
import { LIST_MARKDOWN_SPACE as h, LIST_MARKDOWN_DASH as A, LIST_MARKDOWN_STAR as C, LIST_TAG_UL as R, LIST_CLASS_DASH as _, LIST_VALUE_DASH as L, LIST_VALUE_BULLET as u, LIST_TAG_OL as M, LIST_CLASS_ALPHA as S, LIST_STYLE_LOWER_ALPHA as I, LIST_VALUE_LETTERS as D, LIST_VALUE_NUMBERS as P, LIST_STYLE_DISC as v, LIST_STYLE_DECIMAL as B } from "../../../constants/lists.const.js";
|
|
4
|
+
import { DIR_ATTRIBUTE as b } from "../../../constants/blocks.const.js";
|
|
5
5
|
import "../../../constants/openai.const.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
|
-
import { getBlockElement as
|
|
7
|
+
import { getBlockElement as H } from "../../../utils/blocks.utils.js";
|
|
8
8
|
import "../../../utils/paste.utils.js";
|
|
9
|
+
import "../../../utils/exportDocument.utils.js";
|
|
9
10
|
import "react";
|
|
10
11
|
import "react-dom";
|
|
11
|
-
const
|
|
12
|
+
const F = "color", W = "background-color", K = "background", g = "color", y = "style", q = 1, w = 3, $ = "removeFormat", p = "insertUnorderedList", E = "insertOrderedList", G = "superscript", V = "subscript", X = "styleWithCSS", s = (t, e) => document.execCommand(t, !1, e), l = (t) => document.queryCommandState(t), St = (t) => document.queryCommandValue(t), Q = "http://", O = "https://", Z = "mailto:", j = "&", z = "<", J = ">", tt = """, et = (t) => t.replace(/&/g, j).replace(/</g, z).replace(/>/g, J).replace(/"/g, tt), pt = (t, e = "") => {
|
|
12
13
|
if (!t) return !1;
|
|
13
|
-
const
|
|
14
|
-
return (!
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
}),
|
|
14
|
+
const o = t.startsWith(Q) || t.startsWith(O) || t.startsWith(Z) ? t : `${O}${t}`, n = window.getSelection();
|
|
15
|
+
return (!n || n.isCollapsed) && e ? s("insertHTML", `<a href="${o}">${et(e)}</a>`) : s("createLink", o);
|
|
16
|
+
}, Et = (t) => s("foreColor", t), At = (t) => s("hiliteColor", t), ot = (t) => s("insertHTML", t), Ct = (t, e = "") => {
|
|
17
|
+
const o = e.replace(/"/g, """);
|
|
18
|
+
return ot(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`);
|
|
19
|
+
}, gt = (t) => new Promise((e, o) => {
|
|
20
|
+
const n = new FileReader();
|
|
21
|
+
n.onload = () => e(String(n.result)), n.onerror = o, n.readAsDataURL(t);
|
|
22
|
+
}), yt = () => {
|
|
22
23
|
const t = /* @__PURE__ */ new Set();
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
t.style.removeProperty(
|
|
24
|
+
return l("bold") && t.add("bold"), l("italic") && t.add("italic"), l("underline") && t.add("underline"), l("strikeThrough") && t.add("strikethrough"), l(p) && t.add("bulletList"), l(E) && t.add("orderedList"), l(G) && t.add("superscript"), l(V) && t.add("subscript"), t;
|
|
25
|
+
}, N = (t) => {
|
|
26
|
+
t.style.removeProperty(F), t.style.removeProperty(W), t.style.removeProperty(K), t.hasAttribute(g) && t.removeAttribute(g);
|
|
26
27
|
const e = t.getAttribute(y);
|
|
27
28
|
e !== null && !e.trim() && t.removeAttribute(y);
|
|
28
|
-
},
|
|
29
|
+
}, nt = () => {
|
|
29
30
|
const t = window.getSelection();
|
|
30
|
-
if (!t || t.rangeCount ===
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
if (!t || t.rangeCount === c) return;
|
|
32
|
+
const o = t.getRangeAt(c).commonAncestorContainer, n = o.nodeType === q ? o : o.parentElement;
|
|
33
|
+
n && (n instanceof HTMLElement && t.containsNode(n, !0) && N(n), n.querySelectorAll("*").forEach((r) => {
|
|
34
|
+
r instanceof HTMLElement && t.containsNode(r, !0) && N(r);
|
|
34
35
|
}));
|
|
35
|
-
},
|
|
36
|
-
const t = s(
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
const e =
|
|
40
|
-
if (s(
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
return s(
|
|
44
|
-
const
|
|
45
|
-
|
|
36
|
+
}, Ot = () => {
|
|
37
|
+
const t = s($);
|
|
38
|
+
return nt(), t;
|
|
39
|
+
}, Nt = (t) => {
|
|
40
|
+
const e = x[t] ?? t;
|
|
41
|
+
if (s(X, "true"), t === U) {
|
|
42
|
+
const o = window.getSelection();
|
|
43
|
+
if (!o || o.rangeCount === c || o.isCollapsed)
|
|
44
|
+
return s(m, e);
|
|
45
|
+
const n = o.getRangeAt(c), r = document.createElement("span");
|
|
46
|
+
r.style.setProperty(Y, e);
|
|
46
47
|
try {
|
|
47
|
-
return
|
|
48
|
+
return n.surroundContents(r), !0;
|
|
48
49
|
} catch {
|
|
49
|
-
return s(
|
|
50
|
+
return s(m, e);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
return s(
|
|
53
|
-
},
|
|
54
|
-
t.classList.remove(_,
|
|
55
|
-
},
|
|
56
|
-
s(t ===
|
|
53
|
+
return s(m, t);
|
|
54
|
+
}, rt = (t) => {
|
|
55
|
+
t.classList.remove(_, S), t.style.removeProperty("list-style-type");
|
|
56
|
+
}, ht = (t) => {
|
|
57
|
+
s(t === u || t === L ? p : E);
|
|
57
58
|
const e = window.getSelection();
|
|
58
|
-
let
|
|
59
|
-
for (;
|
|
60
|
-
if (
|
|
61
|
-
|
|
59
|
+
let n = (e == null ? void 0 : e.anchorNode) ?? null, r = null;
|
|
60
|
+
for (; n; ) {
|
|
61
|
+
if (n instanceof HTMLElement && (n.tagName === R || n.tagName === M)) {
|
|
62
|
+
r = n;
|
|
62
63
|
break;
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
+
n = n.parentNode;
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
-
},
|
|
67
|
+
return r && (rt(r), t === u ? r.style.listStyleType = v : t === L ? r.classList.add(_) : t === P ? r.style.listStyleType = B : t === D && (r.classList.add(S), r.style.listStyleType = I)), !0;
|
|
68
|
+
}, Rt = () => {
|
|
68
69
|
const t = window.getSelection();
|
|
69
70
|
let e = (t == null ? void 0 : t.anchorNode) ?? null;
|
|
70
71
|
for (; e; ) {
|
|
71
72
|
if (e instanceof HTMLElement) {
|
|
72
|
-
if (e.tagName === N)
|
|
73
|
-
return e.classList.contains(_) ? u : l;
|
|
74
73
|
if (e.tagName === R)
|
|
75
|
-
return e.classList.contains(
|
|
74
|
+
return e.classList.contains(_) ? L : u;
|
|
75
|
+
if (e.tagName === M)
|
|
76
|
+
return e.classList.contains(S) || e.style.listStyleType === I ? D : P;
|
|
76
77
|
}
|
|
77
78
|
e = e.parentNode;
|
|
78
79
|
}
|
|
79
|
-
return
|
|
80
|
-
},
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
|
|
80
|
+
return u;
|
|
81
|
+
}, Mt = (t, e) => {
|
|
82
|
+
const o = window.getSelection(), n = H((o == null ? void 0 : o.anchorNode) ?? null, t);
|
|
83
|
+
return n ? (n.setAttribute(b, e), !0) : !1;
|
|
84
|
+
}, st = [
|
|
85
|
+
{ prefix: "###", command: "formatBlock", value: "h3" },
|
|
86
|
+
{ prefix: "##", command: "formatBlock", value: "h2" },
|
|
87
|
+
{ prefix: "#", command: "formatBlock", value: "h1" },
|
|
88
|
+
{ prefix: ">", command: "formatBlock", value: "blockquote" },
|
|
89
|
+
{ prefix: "1.", command: E }
|
|
90
|
+
], It = (t) => {
|
|
91
|
+
if (t.key !== h) return !1;
|
|
85
92
|
const e = window.getSelection();
|
|
86
|
-
if (!e || !e.isCollapsed || e.rangeCount ===
|
|
93
|
+
if (!e || !e.isCollapsed || e.rangeCount === c) return !1;
|
|
94
|
+
const o = e.anchorNode;
|
|
95
|
+
if (!o || o.nodeType !== w) return !1;
|
|
96
|
+
const n = o.textContent ?? "", r = e.anchorOffset, d = n.slice(c, r), i = st.find((k) => d.endsWith(k.prefix));
|
|
97
|
+
if (!i) return !1;
|
|
98
|
+
const a = r - i.prefix.length, T = a > c ? d[a - 1] : "";
|
|
99
|
+
if (T && T !== `
|
|
100
|
+
`) return !1;
|
|
101
|
+
t.preventDefault();
|
|
102
|
+
const f = e.getRangeAt(c);
|
|
103
|
+
return f.setStart(o, a), f.setEnd(o, r), f.deleteContents(), i.value ? s(i.command, i.value) : s(i.command), !0;
|
|
104
|
+
}, Dt = (t) => {
|
|
105
|
+
if (t.key !== h) return !1;
|
|
106
|
+
const e = window.getSelection();
|
|
107
|
+
if (!e || !e.isCollapsed || e.rangeCount === c)
|
|
87
108
|
return !1;
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
92
|
-
const a =
|
|
93
|
-
if (a <
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
109
|
+
const o = e.anchorNode;
|
|
110
|
+
if (!o || o.nodeType !== w) return !1;
|
|
111
|
+
const n = o.textContent ?? "", r = e.anchorOffset, d = n.slice(c, r), i = d.endsWith(A) ? A : d.endsWith(C) ? C : null;
|
|
112
|
+
if (!i) return !1;
|
|
113
|
+
const a = r - i.length;
|
|
114
|
+
if (a < c) return !1;
|
|
115
|
+
const T = a > c ? d[a - 1] : "";
|
|
116
|
+
if (T && T !== `
|
|
96
117
|
`) return !1;
|
|
97
118
|
t.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
return
|
|
119
|
+
const f = e.getRangeAt(c);
|
|
120
|
+
return f.setStart(o, a), f.setEnd(o, r), f.deleteContents(), s(p), !0;
|
|
100
121
|
};
|
|
101
122
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
123
|
+
Nt as applyFontFamily,
|
|
124
|
+
ht as applyListType,
|
|
125
|
+
Ot as clearFormatDeep,
|
|
126
|
+
Rt as detectListType,
|
|
106
127
|
s as execCommand,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
gt as fileToDataUrl,
|
|
129
|
+
yt as getActiveFormats,
|
|
130
|
+
ot as insertHTML,
|
|
131
|
+
Ct as insertImage,
|
|
132
|
+
pt as insertLink,
|
|
133
|
+
l as queryCommandState,
|
|
134
|
+
St as queryCommandValue,
|
|
135
|
+
Mt as setBlockDirection,
|
|
136
|
+
At as setHighlightColor,
|
|
137
|
+
Et as setTextColor,
|
|
138
|
+
nt as stripSelectionColors,
|
|
139
|
+
It as tryConvertMarkdownBlockPrefix,
|
|
140
|
+
Dt as tryConvertMarkdownListPrefix
|
|
119
141
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { execCommand, queryCommandState, queryCommandValue, insertLink, setTextColor, setHighlightColor, insertHTML, insertImage, fileToDataUrl, getActiveFormats, applyFormat, applyFontFamily, applyListType, detectListType, setBlockDirection, clearFormatDeep, stripSelectionColors, tryConvertMarkdownListPrefix, isSelectionInListItem, } from './format.utils';
|
|
1
|
+
export { execCommand, queryCommandState, queryCommandValue, insertLink, setTextColor, setHighlightColor, insertHTML, insertImage, fileToDataUrl, getActiveFormats, applyFormat, applyFontFamily, applyListType, detectListType, setBlockDirection, clearFormatDeep, stripSelectionColors, tryConvertMarkdownBlockPrefix, tryConvertMarkdownListPrefix, isSelectionInListItem, } from './format.utils';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),k=require("react"),v=({documents:o,activeDocumentId:b,onTabSelect:y,onTabClose:c,onTabAdd:d,onTabRename:s,className:j=""})=>{const[h,l]=k.useState(null),[a,u]=k.useState(""),p=(t,n,r)=>{r.stopPropagation(),s&&(l(t),u(n))},x=t=>{h===t&&a.trim()&&(s==null||s(t,a.trim())),l(null)},g=(t,n)=>{n.key==="Enter"?x(t):n.key==="Escape"&&l(null)};return i.jsxs("div",{className:`ink-tabs-container ${j}`.trim(),role:"tablist","aria-label":"Document tabs",children:[i.jsx("div",{className:"ink-tabs-scroll-area",children:o.map(t=>{const n=t.id===b,r=h===t.id;return i.jsxs("div",{role:"tab","aria-selected":n,tabIndex:n?0:-1,className:`ink-tab-item ${n?"ink-tab-active":""} ${t.isDirty?"ink-tab-dirty":""}`,onClick:()=>y(t.id),onDoubleClick:e=>p(t.id,t.title,e),title:t.title,children:[i.jsx("span",{className:"ink-tab-icon","aria-hidden":"true",children:t.icon||i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),r?i.jsx("input",{type:"text",className:"ink-tab-title-input",value:a,autoFocus:!0,onChange:e=>u(e.target.value),onBlur:()=>x(t.id),onKeyDown:e=>g(t.id,e),onClick:e=>e.stopPropagation()}):i.jsx("span",{className:"ink-tab-title",children:t.title||"Untitled"}),t.isDirty&&i.jsx("span",{className:"ink-tab-dirty-indicator",title:"Unsaved changes","aria-label":"Unsaved changes"}),c&&o.length>1&&i.jsx("button",{type:"button",className:"ink-tab-close-btn","aria-label":`Close ${t.title}`,onClick:e=>{e.stopPropagation(),c(t.id)},children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},t.id)})}),d&&i.jsx("button",{type:"button",className:"ink-tab-add-btn","aria-label":"New document",title:"New document",onClick:d,children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),i.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})};exports.InkTabs=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InkTabs.d.ts","sourceRoot":"","sources":["../../../src/components/InkTabs/InkTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA6H1C,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
const f = ({
|
|
4
|
+
documents: c,
|
|
5
|
+
activeDocumentId: y,
|
|
6
|
+
onTabSelect: g,
|
|
7
|
+
onTabClose: d,
|
|
8
|
+
onTabAdd: h,
|
|
9
|
+
onTabRename: a,
|
|
10
|
+
className: m = ""
|
|
11
|
+
}) => {
|
|
12
|
+
const [u, s] = b(null), [r, k] = b(""), v = (t, n, o) => {
|
|
13
|
+
o.stopPropagation(), a && (s(t), k(n));
|
|
14
|
+
}, p = (t) => {
|
|
15
|
+
u === t && r.trim() && (a == null || a(t, r.trim())), s(null);
|
|
16
|
+
}, x = (t, n) => {
|
|
17
|
+
n.key === "Enter" ? p(t) : n.key === "Escape" && s(null);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `ink-tabs-container ${m}`.trim(),
|
|
23
|
+
role: "tablist",
|
|
24
|
+
"aria-label": "Document tabs",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ i("div", { className: "ink-tabs-scroll-area", children: c.map((t) => {
|
|
27
|
+
const n = t.id === y, o = u === t.id;
|
|
28
|
+
return /* @__PURE__ */ l(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
role: "tab",
|
|
32
|
+
"aria-selected": n,
|
|
33
|
+
tabIndex: n ? 0 : -1,
|
|
34
|
+
className: `ink-tab-item ${n ? "ink-tab-active" : ""} ${t.isDirty ? "ink-tab-dirty" : ""}`,
|
|
35
|
+
onClick: () => g(t.id),
|
|
36
|
+
onDoubleClick: (e) => v(t.id, t.title, e),
|
|
37
|
+
title: t.title,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ i("span", { className: "ink-tab-icon", "aria-hidden": "true", children: t.icon || /* @__PURE__ */ l("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
40
|
+
/* @__PURE__ */ i("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
41
|
+
/* @__PURE__ */ i("polyline", { points: "14 2 14 8 20 8" })
|
|
42
|
+
] }) }),
|
|
43
|
+
o ? /* @__PURE__ */ i(
|
|
44
|
+
"input",
|
|
45
|
+
{
|
|
46
|
+
type: "text",
|
|
47
|
+
className: "ink-tab-title-input",
|
|
48
|
+
value: r,
|
|
49
|
+
autoFocus: !0,
|
|
50
|
+
onChange: (e) => k(e.target.value),
|
|
51
|
+
onBlur: () => p(t.id),
|
|
52
|
+
onKeyDown: (e) => x(t.id, e),
|
|
53
|
+
onClick: (e) => e.stopPropagation()
|
|
54
|
+
}
|
|
55
|
+
) : /* @__PURE__ */ i("span", { className: "ink-tab-title", children: t.title || "Untitled" }),
|
|
56
|
+
t.isDirty && /* @__PURE__ */ i(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: "ink-tab-dirty-indicator",
|
|
60
|
+
title: "Unsaved changes",
|
|
61
|
+
"aria-label": "Unsaved changes"
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
d && c.length > 1 && /* @__PURE__ */ i(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
type: "button",
|
|
68
|
+
className: "ink-tab-close-btn",
|
|
69
|
+
"aria-label": `Close ${t.title}`,
|
|
70
|
+
onClick: (e) => {
|
|
71
|
+
e.stopPropagation(), d(t.id);
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ l("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
74
|
+
/* @__PURE__ */ i("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
75
|
+
/* @__PURE__ */ i("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
76
|
+
] })
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
t.id
|
|
82
|
+
);
|
|
83
|
+
}) }),
|
|
84
|
+
h && /* @__PURE__ */ i(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "button",
|
|
88
|
+
className: "ink-tab-add-btn",
|
|
89
|
+
"aria-label": "New document",
|
|
90
|
+
title: "New document",
|
|
91
|
+
onClick: h,
|
|
92
|
+
children: /* @__PURE__ */ l("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
93
|
+
/* @__PURE__ */ i("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
94
|
+
/* @__PURE__ */ i("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
95
|
+
] })
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
f as InkTabs
|
|
104
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InkTabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),H=require("../InkTabs/InkTabs.cjs"),j=require("../InkEditor/InkEditor.cjs"),f=require("../InkEditor/components/PresenceStack/PresenceStack.cjs"),X=require("./hooks/useInkWorkspace.cjs"),t=require("./components/WorkspaceIcons.cjs"),P=require("../../constants/numbers.cjs"),A=require("../../constants/generals.const.cjs");require("../../constants/openai.const.cjs");const d=require("../../utils/cn.utils.cjs");require("../../utils/paste.utils.cjs");require("../../utils/exportDocument.utils.cjs");const i=require("../../common-components/Button/Button.cjs");require("react");require("react-dom");const n=require("../../constants/workspace.const.cjs"),G=p=>{const{documents:E,activeDocumentId:O,onActiveDocumentChange:T,onDocumentChange:r,onDocumentDelete:N,onDocumentRename:b,onDocumentSave:u,folders:S=[],onFolderCreate:K,onFolderDelete:m,collaboration:o,editorProps:C={},className:W=A.EMPTY_STRING,style:D}=p,{sidebarOpen:k,setSidebarOpen:v,splitMode:_,setSplitMode:I,setSecondaryDocId:w,searchQuery:y,setSearchQuery:B,editingDocId:g,editTitle:q,setEditTitle:M,activeDocument:l,secondaryDocument:c,filteredDocs:F,handleCreateDocument:R,handleStartRename:x,handleSaveRename:h,handleCancelRename:U}=X.useInkWorkspace(p);return e.jsxs("div",{className:d.cn("ink-workspace-root",W),style:D,"data-split-mode":_,children:[e.jsxs("header",{className:"ink-workspace-header",children:[e.jsxs("div",{className:"ink-workspace-header-left",children:[e.jsx(i.Button,{type:"button",className:"ink-workspace-toggle-btn",onClick:()=>v(!k),title:k?n.INK_WORKSPACE_HIDE_EXPLORER_TITLE:n.INK_WORKSPACE_SHOW_EXPLORER_TITLE,"aria-label":k?n.INK_WORKSPACE_HIDE_EXPLORER_TITLE:n.INK_WORKSPACE_SHOW_EXPLORER_TITLE,children:e.jsx(t.SidebarToggleIcon,{})}),e.jsx("span",{className:"ink-workspace-title",children:n.INK_WORKSPACE_TITLE}),e.jsxs("span",{className:"ink-workspace-count",children:["(",E.length," ",n.INK_WORKSPACE_DOCS_SUFFIX,")"]})]}),e.jsxs("div",{className:"ink-workspace-header-right",children:[e.jsxs("div",{className:"ink-workspace-split-controls",role:"group","aria-label":n.INK_WORKSPACE_SPLIT_VIEW_LABEL,children:[e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_NONE&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_NONE),title:n.INK_WORKSPACE_SINGLE_VIEW_TITLE,children:e.jsx(t.SingleViewIcon,{})}),e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_VERTICAL&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_VERTICAL),title:n.INK_WORKSPACE_SPLIT_SIDE_TITLE,children:e.jsx(t.SplitVerticalIcon,{})}),e.jsx(i.Button,{type:"button",className:d.cn("ink-workspace-icon-btn",_===n.INK_SPLIT_MODE_HORIZONTAL&&"ink-active"),onClick:()=>I(n.INK_SPLIT_MODE_HORIZONTAL),title:n.INK_WORKSPACE_SPLIT_STACKED_TITLE,children:e.jsx(t.SplitHorizontalIcon,{})})]}),u&&l&&e.jsx(i.Button,{type:"button",className:"ink-workspace-icon-btn",onClick:()=>u(l.id),title:n.INK_WORKSPACE_SAVE_TITLE,"aria-label":n.INK_WORKSPACE_SAVE_TITLE,children:e.jsx(t.SaveDocIcon,{})}),(o==null?void 0:o.collaborators)&&e.jsx(f.PresenceStack,{collaborators:o.collaborators,maxAvatars:o.maxAvatars})]})]}),e.jsxs("div",{className:"ink-workspace-body",children:[k&&e.jsxs("aside",{className:"ink-workspace-sidebar","aria-label":n.INK_WORKSPACE_TITLE,children:[e.jsxs("div",{className:"ink-workspace-sidebar-toolbar",children:[e.jsx("input",{type:"text",className:"ink-workspace-search-input",placeholder:n.INK_WORKSPACE_SEARCH_PLACEHOLDER,value:y,onChange:s=>B(s.target.value)}),e.jsx(i.Button,{type:"button",className:"ink-workspace-new-doc-btn",onClick:R,title:n.INK_WORKSPACE_NEW_DOC_BUTTON,"aria-label":n.INK_WORKSPACE_NEW_DOC_BUTTON,children:n.INK_WORKSPACE_NEW_DOC_BUTTON}),K&&e.jsx(i.Button,{type:"button",className:"ink-workspace-icon-btn",onClick:()=>K(n.INK_WORKSPACE_NEW_FOLDER),title:n.INK_WORKSPACE_NEW_FOLDER,"aria-label":n.INK_WORKSPACE_NEW_FOLDER,children:e.jsx(t.NewFolderIcon,{})})]}),S.length>P.NUMBER_ZERO&&e.jsx("div",{className:"ink-workspace-folders-section",children:S.map(s=>e.jsxs("div",{className:"ink-workspace-folder-item",children:[e.jsx("span",{className:"ink-doc-icon",children:"📁"}),e.jsx("span",{className:"ink-doc-title",children:s.name}),m&&e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn ink-delete",onClick:()=>m(s.id),title:n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON,"aria-label":n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON,children:n.INK_WORKSPACE_CLOSE_FOLDER_BUTTON})]},s.id))}),e.jsx("div",{className:"ink-workspace-doc-list",role:"tree",children:F.map(s=>{const L=s.id===O,V=g===s.id;return e.jsxs("div",{role:"treeitem","aria-selected":L,className:d.cn("ink-workspace-doc-item",L&&"ink-doc-active"),onClick:()=>T(s.id),children:[e.jsx("span",{className:"ink-doc-icon",children:s.icon||e.jsx(t.FileDocumentIcon,{})}),V?e.jsx("input",{type:"text",className:"ink-doc-title-input",value:q,autoFocus:!0,onChange:a=>M(a.target.value),onBlur:()=>h(s.id),onKeyDown:a=>{a.key==="Enter"&&h(s.id),a.key==="Escape"&&U()},onClick:a=>a.stopPropagation()}):e.jsx("span",{className:"ink-doc-title",onDoubleClick:a=>x(s.id,s.title,a),children:s.title||n.INK_WORKSPACE_UNTITLED_FALLBACK}),s.isDirty&&e.jsx("span",{className:"ink-doc-dirty-dot"}),e.jsxs("div",{className:"ink-doc-actions",children:[e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn",onClick:a=>x(s.id,s.title,a),title:n.INK_WORKSPACE_RENAME_TITLE,"aria-label":n.INK_WORKSPACE_RENAME_TITLE,children:e.jsx(t.RenamePencilIcon,{})}),E.length>P.NUMBER_ONE&&N&&e.jsx(i.Button,{type:"button",className:"ink-doc-action-btn ink-delete",onClick:a=>{a.stopPropagation(),N(s.id)},title:n.INK_WORKSPACE_DELETE_TITLE,"aria-label":n.INK_WORKSPACE_DELETE_TITLE,children:e.jsx(t.CloseCrossIcon,{})})]})]},s.id)})})]}),e.jsxs("main",{className:d.cn("ink-workspace-main-area",`ink-split-${_}`),children:[e.jsxs("section",{className:"ink-workspace-pane ink-primary-pane",children:[e.jsx(H.InkTabs,{documents:E,activeDocumentId:O,onTabSelect:T,onTabClose:N,onTabAdd:R,onTabRename:b}),l&&e.jsx("div",{className:"ink-workspace-editor-wrapper",children:e.jsx(j.InkEditor,{value:l.content,onChange:s=>r==null?void 0:r(l.id,s),readOnly:l.readOnly,collaboration:o,...C},l.id)})]}),_!==n.INK_SPLIT_MODE_NONE&&e.jsxs("section",{className:"ink-workspace-pane ink-secondary-pane",children:[e.jsxs("div",{className:"ink-secondary-pane-header",children:[e.jsx("span",{className:"ink-secondary-pane-label",children:n.INK_WORKSPACE_SPLIT_VIEW_LABEL}),e.jsx("select",{className:"ink-secondary-pane-select",value:(c==null?void 0:c.id)||A.EMPTY_STRING,onChange:s=>w(s.target.value),"aria-label":n.INK_WORKSPACE_SPLIT_VIEW_LABEL,children:E.map(s=>e.jsx("option",{value:s.id,children:s.title},s.id))})]}),c&&e.jsx("div",{className:"ink-workspace-editor-wrapper",children:e.jsx(j.InkEditor,{value:c.content,onChange:s=>r==null?void 0:r(c.id,s),readOnly:c.readOnly,...C},`sec-${c.id}`)})]})]})]})]})};exports.InkWorkspace=G;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InkWorkspace.d.ts","sourceRoot":"","sources":["../../../src/components/InkWorkspace/InkWorkspace.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA2CjD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0SpD,CAAC"}
|