@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as i, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { INK_PRESENCE_DEFAULT_MAX_AVATARS as I, COLLAB_ARIA_REGION as v, IDLE_LABEL_SUFFIX as L, COLLAB_ARIA_LABEL_PREFIX as f, PLUS_SIGN as k } from "./PresenceStack.const.js";
|
|
3
|
+
import { NUMBER_ZERO as s, NUMBER_ONE as p } from "../../../../constants/numbers.js";
|
|
4
|
+
import { EMPTY_STRING as a } from "../../../../constants/generals.const.js";
|
|
5
|
+
import "../../../../constants/openai.const.js";
|
|
6
|
+
import { cn as _ } from "../../../../utils/cn.utils.js";
|
|
7
|
+
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
9
|
+
import { getCollaboratorInitials as R } from "../../../../utils/collab.utils.js";
|
|
10
|
+
import { Button as S } from "../../../../common-components/Button/Button.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-dom";
|
|
13
|
+
import { INK_STATUS_IDLE as h, INK_ROLE_EDITOR as C } from "../../../../constants/collab.const.js";
|
|
14
|
+
const $ = (t) => t.avatarUrl ? /* @__PURE__ */ i(
|
|
15
|
+
"img",
|
|
16
|
+
{
|
|
17
|
+
src: t.avatarUrl,
|
|
18
|
+
alt: t.name,
|
|
19
|
+
className: "ink-presence-avatar-img"
|
|
20
|
+
}
|
|
21
|
+
) : /* @__PURE__ */ i("span", { className: "ink-presence-initials", children: R(t.name) }), X = (t) => {
|
|
22
|
+
const {
|
|
23
|
+
collaborators: n,
|
|
24
|
+
maxAvatars: l = I,
|
|
25
|
+
onFollow: m,
|
|
26
|
+
className: N = a
|
|
27
|
+
} = t;
|
|
28
|
+
if (!n || n.length === s)
|
|
29
|
+
return null;
|
|
30
|
+
const E = n.slice(s, l), r = Math.max(s, n.length - l);
|
|
31
|
+
return /* @__PURE__ */ i(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: _("ink-presence-stack", N),
|
|
35
|
+
role: "region",
|
|
36
|
+
"aria-label": v,
|
|
37
|
+
children: /* @__PURE__ */ c("div", { className: "ink-presence-avatars", children: [
|
|
38
|
+
E.map((e) => {
|
|
39
|
+
const o = e.status === h, d = e.role || C, A = o ? L : a, u = `${e.name} (${d})${A}`;
|
|
40
|
+
return /* @__PURE__ */ c(
|
|
41
|
+
S,
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
className: "ink-presence-avatar-btn",
|
|
45
|
+
style: { backgroundColor: e.color },
|
|
46
|
+
title: u,
|
|
47
|
+
onClick: () => m == null ? void 0 : m(e),
|
|
48
|
+
"aria-label": `${f}${e.name}`,
|
|
49
|
+
children: [
|
|
50
|
+
$(e),
|
|
51
|
+
/* @__PURE__ */ i(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: _(
|
|
55
|
+
"ink-presence-status-dot",
|
|
56
|
+
o ? "ink-presence-idle" : "ink-presence-active"
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
e.id
|
|
63
|
+
);
|
|
64
|
+
}),
|
|
65
|
+
r > s && /* @__PURE__ */ c(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: "ink-presence-avatar-overflow",
|
|
69
|
+
title: `${r} more collaborator${r > p ? "s" : a}`,
|
|
70
|
+
"aria-label": `${r} more collaborator${r > p ? "s" : a}`,
|
|
71
|
+
children: [
|
|
72
|
+
k,
|
|
73
|
+
r
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
X as PresenceStack
|
|
83
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkCollaborator } from '../../../../types';
|
|
2
|
+
export interface PresenceStackProps {
|
|
3
|
+
collaborators: InkCollaborator[];
|
|
4
|
+
maxAvatars?: number;
|
|
5
|
+
onFollow?: (collaborator: InkCollaborator) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=PresenceStack.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenceStack.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/PresenceStack/PresenceStack.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/PresenceStack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./RemoteCursors.const.cjs"),t=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");const m=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const T=({collaborators:u,className:c=l.EMPTY_STRING})=>{const n=(u||[]).filter(e=>e.cursor&&(e.cursor.offset!==void 0||e.cursor.line!==void 0));return n.length===t.NUMBER_ZERO?null:s.jsx("div",{className:m.cn("ink-remote-cursors-layer",c),"aria-hidden":"true",children:n.map(e=>{var i,o;const _=((i=e.cursor)==null?void 0:i.line)??t.NUMBER_ONE,R=((o=e.cursor)==null?void 0:o.col)??t.NUMBER_ZERO,E=Math.max(r.REMOTE_CURSOR_MIN_TOP_PX,(_-t.NUMBER_ONE)*r.REMOTE_CURSOR_LINE_HEIGHT_PX+r.REMOTE_CURSOR_TOP_OFFSET_PX),O=Math.max(r.REMOTE_CURSOR_MIN_LEFT_PX,R*r.REMOTE_CURSOR_CHAR_WIDTH_PX+r.REMOTE_CURSOR_LEFT_OFFSET_PX);return s.jsxs("div",{className:"ink-remote-cursor-item",style:{top:`${E}px`,left:`${O}px`},children:[s.jsx("div",{className:"ink-remote-cursor-caret",style:{backgroundColor:e.color}}),s.jsx("div",{className:"ink-remote-cursor-tag",style:{backgroundColor:e.color},children:e.name})]},e.id)})})};exports.RemoteCursors=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs"),E=_.NUMBER_TWENTY_EIGHT,R=_.NUMBER_FOURTEEN,T=_.NUMBER_TWELVE,O=8.5,M=_.NUMBER_TWENTY_FOUR,S=_.NUMBER_SIXTEEN;exports.REMOTE_CURSOR_CHAR_WIDTH_PX=O;exports.REMOTE_CURSOR_LEFT_OFFSET_PX=M;exports.REMOTE_CURSOR_LINE_HEIGHT_PX=E;exports.REMOTE_CURSOR_MIN_LEFT_PX=S;exports.REMOTE_CURSOR_MIN_TOP_PX=T;exports.REMOTE_CURSOR_TOP_OFFSET_PX=R;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const REMOTE_CURSOR_LINE_HEIGHT_PX = 28;
|
|
2
|
+
export declare const REMOTE_CURSOR_TOP_OFFSET_PX = 14;
|
|
3
|
+
export declare const REMOTE_CURSOR_MIN_TOP_PX = 12;
|
|
4
|
+
export declare const REMOTE_CURSOR_CHAR_WIDTH_PX = 8.5;
|
|
5
|
+
export declare const REMOTE_CURSOR_LEFT_OFFSET_PX = 24;
|
|
6
|
+
export declare const REMOTE_CURSOR_MIN_LEFT_PX = 16;
|
|
7
|
+
//# sourceMappingURL=RemoteCursors.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoteCursors.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/RemoteCursors/RemoteCursors.const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,KAAsB,CAAC;AAChE,eAAO,MAAM,2BAA2B,KAAkB,CAAC;AAC3D,eAAO,MAAM,wBAAwB,KAAgB,CAAC;AACtD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,4BAA4B,KAAqB,CAAC;AAC/D,eAAO,MAAM,yBAAyB,KAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NUMBER_SIXTEEN as E, NUMBER_TWELVE as _, NUMBER_TWENTY_FOUR as R, NUMBER_TWENTY_EIGHT as T, NUMBER_FOURTEEN as O } from "../../../../constants/numbers.js";
|
|
2
|
+
const U = T, N = O, o = _, S = 8.5, t = R, F = E;
|
|
3
|
+
export {
|
|
4
|
+
S as REMOTE_CURSOR_CHAR_WIDTH_PX,
|
|
5
|
+
t as REMOTE_CURSOR_LEFT_OFFSET_PX,
|
|
6
|
+
U as REMOTE_CURSOR_LINE_HEIGHT_PX,
|
|
7
|
+
F as REMOTE_CURSOR_MIN_LEFT_PX,
|
|
8
|
+
o as REMOTE_CURSOR_MIN_TOP_PX,
|
|
9
|
+
N as REMOTE_CURSOR_TOP_OFFSET_PX
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoteCursors.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/RemoteCursors/RemoteCursors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAYhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuDtD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { REMOTE_CURSOR_MIN_LEFT_PX as p, REMOTE_CURSOR_CHAR_WIDTH_PX as T, REMOTE_CURSOR_LEFT_OFFSET_PX as d, REMOTE_CURSOR_MIN_TOP_PX as l, REMOTE_CURSOR_LINE_HEIGHT_PX as M, REMOTE_CURSOR_TOP_OFFSET_PX as f } from "./RemoteCursors.const.js";
|
|
3
|
+
import { NUMBER_ZERO as i, NUMBER_ONE as m } from "../../../../constants/numbers.js";
|
|
4
|
+
import { EMPTY_STRING as C } from "../../../../constants/generals.const.js";
|
|
5
|
+
import "../../../../constants/openai.const.js";
|
|
6
|
+
import { cn as N } from "../../../../utils/cn.utils.js";
|
|
7
|
+
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "react-dom";
|
|
11
|
+
const X = ({
|
|
12
|
+
collaborators: _,
|
|
13
|
+
className: n = C
|
|
14
|
+
}) => {
|
|
15
|
+
const o = (_ || []).filter(
|
|
16
|
+
(r) => r.cursor && (r.cursor.offset !== void 0 || r.cursor.line !== void 0)
|
|
17
|
+
);
|
|
18
|
+
return o.length === i ? null : /* @__PURE__ */ e(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: N("ink-remote-cursors-layer", n),
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: o.map((r) => {
|
|
24
|
+
var t, s;
|
|
25
|
+
const c = ((t = r.cursor) == null ? void 0 : t.line) ?? m, R = ((s = r.cursor) == null ? void 0 : s.col) ?? i, E = Math.max(
|
|
26
|
+
l,
|
|
27
|
+
(c - m) * M + f
|
|
28
|
+
), O = Math.max(
|
|
29
|
+
p,
|
|
30
|
+
R * T + d
|
|
31
|
+
);
|
|
32
|
+
return /* @__PURE__ */ u(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "ink-remote-cursor-item",
|
|
36
|
+
style: {
|
|
37
|
+
top: `${E}px`,
|
|
38
|
+
left: `${O}px`
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "ink-remote-cursor-caret",
|
|
45
|
+
style: { backgroundColor: r.color }
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: "ink-remote-cursor-tag",
|
|
52
|
+
style: { backgroundColor: r.color },
|
|
53
|
+
children: r.name
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
r.id
|
|
59
|
+
);
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
X as RemoteCursors
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoteCursors.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/RemoteCursors/RemoteCursors.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/RemoteCursors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const S=require("../../../../common-components/Button/Button.cjs"),x=require("../../../../common-components/Canvas/Canvas.cjs");require("react-dom");const n=require("./SignPad.const.cjs"),f=require("./SignPad.utils.cjs"),G=P=>{const{open:u,onClose:d,onConfirm:I,clearLabel:D=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:L=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:E=n.SIGN_PAD_DEFAULT_CANCEL,title:A=n.SIGN_PAD_DEFAULT_TITLE}=P,r=l.useRef(null),s=l.useRef(!1),[C,_]=l.useState(!1);if(l.useEffect(()=>{if(!u){s.current=!1;return}const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),e.strokeStyle=n.SIGN_PAD_STROKE_STYLE,e.lineWidth=n.SIGN_PAD_LINE_WIDTH,e.lineCap="round",e.lineJoin="round",s.current=!1,_(!1))},[u]),!u)return null;const h=t=>{const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;s.current=!0,e.setPointerCapture(t.pointerId);const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.beginPath(),o.moveTo(c.x,c.y)},g=t=>{if(!s.current)return;const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.lineTo(c.x,c.y),o.stroke(),_(!0)},N=t=>{var e;s.current=!1,(e=r.current)==null||e.releasePointerCapture(t.pointerId)},R=()=>{const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),_(!1))},T=()=>{const t=r.current;!t||!C||(I(t.toDataURL(n.SIGN_PAD_MIME)),d())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":A,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:A}),i.jsx(x.Canvas,{canvasRef:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:h,onPointerMove:g,onPointerUp:N,onPointerLeave:N}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx(S.Button,{type:"button",onClick:R,children:D}),i.jsx(S.Button,{type:"button",onClick:d,children:E}),i.jsx(S.Button,{type:"button",active:!0,disabled:!C,onClick:T,children:L})]})]})};exports.SignPad=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const S=require("../../../../common-components/Button/Button.cjs"),x=require("../../../../common-components/Canvas/Canvas.cjs");require("react-dom");const n=require("./SignPad.const.cjs"),f=require("./SignPad.utils.cjs"),G=P=>{const{open:u,onClose:d,onConfirm:I,clearLabel:D=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:L=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:E=n.SIGN_PAD_DEFAULT_CANCEL,title:A=n.SIGN_PAD_DEFAULT_TITLE}=P,r=l.useRef(null),s=l.useRef(!1),[C,_]=l.useState(!1);if(l.useEffect(()=>{if(!u){s.current=!1;return}const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),e.strokeStyle=n.SIGN_PAD_STROKE_STYLE,e.lineWidth=n.SIGN_PAD_LINE_WIDTH,e.lineCap="round",e.lineJoin="round",s.current=!1,_(!1))},[u]),!u)return null;const h=t=>{const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;s.current=!0,e.setPointerCapture(t.pointerId);const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.beginPath(),o.moveTo(c.x,c.y)},g=t=>{if(!s.current)return;const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.lineTo(c.x,c.y),o.stroke(),_(!0)},N=t=>{var e;s.current=!1,(e=r.current)==null||e.releasePointerCapture(t.pointerId)},R=()=>{const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),_(!1))},T=()=>{const t=r.current;!t||!C||(I(t.toDataURL(n.SIGN_PAD_MIME)),d())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":A,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:A}),i.jsx(x.Canvas,{canvasRef:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:h,onPointerMove:g,onPointerUp:N,onPointerLeave:N}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx(S.Button,{type:"button",onClick:R,children:D}),i.jsx(S.Button,{type:"button",onClick:d,children:E}),i.jsx(S.Button,{type:"button",active:!0,disabled:!C,onClick:T,children:L})]})]})};exports.SignPad=G;
|
|
@@ -3,17 +3,18 @@ import { useRef as C, useState as T, useEffect as G } from "react";
|
|
|
3
3
|
import { NUMBER_ZERO as c } from "../../../../constants/numbers.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 _ } from "../../../../common-components/Button/Button.js";
|
|
7
8
|
import { Canvas as g } from "../../../../common-components/Canvas/Canvas.js";
|
|
8
9
|
import "react-dom";
|
|
9
10
|
import { SIGN_PAD_DEFAULT_TITLE as x, SIGN_PAD_DEFAULT_CLEAR as R, SIGN_PAD_DEFAULT_CONFIRM as b, SIGN_PAD_DEFAULT_CANCEL as w, SIGN_PAD_FILL_STYLE as m, SIGN_PAD_STROKE_STYLE as y, SIGN_PAD_LINE_WIDTH as k, SIGN_PAD_CLASS as U, SIGN_PAD_TITLE_CLASS as F, SIGN_PAD_CANVAS_HEIGHT as H, SIGN_PAD_CANVAS_WIDTH as M, SIGN_PAD_CANVAS_CLASS as v, SIGN_PAD_ACTIONS_CLASS as O, SIGN_PAD_MIME as Y } from "./SignPad.const.js";
|
|
10
11
|
import { getCanvasPoint as I } from "./SignPad.utils.js";
|
|
11
|
-
const
|
|
12
|
+
const et = (N) => {
|
|
12
13
|
const {
|
|
13
14
|
open: a,
|
|
14
15
|
onClose: u,
|
|
15
|
-
onConfirm:
|
|
16
|
-
clearLabel:
|
|
16
|
+
onConfirm: p,
|
|
17
|
+
clearLabel: D = R,
|
|
17
18
|
confirmLabel: P = b,
|
|
18
19
|
cancelLabel: h = w,
|
|
19
20
|
title: S = x
|
|
@@ -61,15 +62,15 @@ const tt = (N) => {
|
|
|
61
62
|
/* @__PURE__ */ l(_, { type: "button", onClick: () => {
|
|
62
63
|
const e = n.current, t = e == null ? void 0 : e.getContext("2d");
|
|
63
64
|
!e || !t || (t.fillStyle = m, t.fillRect(c, c, e.width, e.height), s(!1));
|
|
64
|
-
}, children:
|
|
65
|
+
}, children: D }),
|
|
65
66
|
/* @__PURE__ */ l(_, { type: "button", onClick: u, children: h }),
|
|
66
67
|
/* @__PURE__ */ l(_, { type: "button", active: !0, disabled: !f, onClick: () => {
|
|
67
68
|
const e = n.current;
|
|
68
|
-
!e || !f || (
|
|
69
|
+
!e || !f || (p(e.toDataURL(Y)), u());
|
|
69
70
|
}, children: P })
|
|
70
71
|
] })
|
|
71
72
|
] });
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
et as SignPad
|
|
75
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),S=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");const N=require("../../../../utils/slash.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const m=i=>{var t;const{items:l,top:h,left:d,query:c,onSelect:o}=i;if(l.length===S.NUMBER_ZERO)return null;const u=N.groupSlashCommands(l),I=(t=l[S.NUMBER_ZERO])==null?void 0:t.id;return s.jsxs("div",{className:"Ink-Slash",style:{top:h,left:d},role:"listbox","aria-label":n.SLASH_ARIA_LABEL,children:[s.jsxs("div",{className:"Ink-Slash__search","aria-hidden":"true",children:[n.SLASH_SEARCH_LABEL,a.SLASH_PREFIX,c?` ${c}`:""]}),u.map(r=>s.jsxs("div",{className:"Ink-Slash__group",children:[s.jsx("div",{className:"Ink-Slash__cat",children:r.category}),r.items.map(e=>{const _=e.id===I;return s.jsxs("button",{type:"button",role:"option","aria-selected":_,className:`Ink-Slash__item${_?" Ink-Slash__item--sel":""}`,onMouseDown:A=>{A.preventDefault(),o(e)},children:[s.jsx("span",{className:`Ink-Slash__mark${e.category===n.SLASH_CATEGORY_AI?`${a.SPACE_STRING}${n.INK_CLASS_SLASH_MARK_AI}`:""}`,children:e.mark}),s.jsxs("span",{className:"Ink-Slash__txt",children:[s.jsx("span",{className:"Ink-Slash__name",children:e.label}),s.jsx("span",{className:"Ink-Slash__desc",children:e.description})]}),s.jsx("span",{className:"Ink-Slash__key",children:_?a.SLASH_ENTER_SHORTCUT:e.shortcut})]},e.id)})]},r.category)),s.jsxs("div",{className:"Ink-Slash__hint",children:[a.SLASH_HINT_BEFORE,s.jsx("span",{className:"Ink-Slash__caret","aria-hidden":"true"}),a.SLASH_HINT_AFTER,s.jsx("kbd",{className:"Ink-Slash__key",children:a.SLASH_MOD_SHORTCUT}),a.SLASH_HINT_AI]})]})};exports.SlashMenu=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),S=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");const N=require("../../../../utils/slash.utils.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const m=i=>{var t;const{items:l,top:h,left:d,query:c,onSelect:o}=i;if(l.length===S.NUMBER_ZERO)return null;const u=N.groupSlashCommands(l),I=(t=l[S.NUMBER_ZERO])==null?void 0:t.id;return s.jsxs("div",{className:"Ink-Slash",style:{top:h,left:d},role:"listbox","aria-label":n.SLASH_ARIA_LABEL,children:[s.jsxs("div",{className:"Ink-Slash__search","aria-hidden":"true",children:[n.SLASH_SEARCH_LABEL,a.SLASH_PREFIX,c?` ${c}`:""]}),u.map(r=>s.jsxs("div",{className:"Ink-Slash__group",children:[s.jsx("div",{className:"Ink-Slash__cat",children:r.category}),r.items.map(e=>{const _=e.id===I;return s.jsxs("button",{type:"button",role:"option","aria-selected":_,className:`Ink-Slash__item${_?" Ink-Slash__item--sel":""}`,onMouseDown:A=>{A.preventDefault(),o(e)},children:[s.jsx("span",{className:`Ink-Slash__mark${e.category===n.SLASH_CATEGORY_AI?`${a.SPACE_STRING}${n.INK_CLASS_SLASH_MARK_AI}`:""}`,children:e.mark}),s.jsxs("span",{className:"Ink-Slash__txt",children:[s.jsx("span",{className:"Ink-Slash__name",children:e.label}),s.jsx("span",{className:"Ink-Slash__desc",children:e.description})]}),s.jsx("span",{className:"Ink-Slash__key",children:_?a.SLASH_ENTER_SHORTCUT:e.shortcut})]},e.id)})]},r.category)),s.jsxs("div",{className:"Ink-Slash__hint",children:[a.SLASH_HINT_BEFORE,s.jsx("span",{className:"Ink-Slash__caret","aria-hidden":"true"}),a.SLASH_HINT_AFTER,s.jsx("kbd",{className:"Ink-Slash__key",children:a.SLASH_MOD_SHORTCUT}),a.SLASH_HINT_AI]})]})};exports.SlashMenu=m;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as e, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { NUMBER_ZERO as S } from "../../../../constants/numbers.js";
|
|
3
|
-
import { SLASH_PREFIX as
|
|
3
|
+
import { SLASH_PREFIX as I, SPACE_STRING as A, SLASH_ENTER_SHORTCUT as N, SLASH_HINT_BEFORE as k, SLASH_HINT_AFTER as H, SLASH_HINT_AI as L, SLASH_MOD_SHORTCUT as u } from "../../../../constants/generals.const.js";
|
|
4
4
|
import { SLASH_ARIA_LABEL as E, SLASH_SEARCH_LABEL as R, INK_CLASS_SLASH_MARK_AI as T, SLASH_CATEGORY_AI as f } from "../../../../constants/defaults.const.js";
|
|
5
5
|
import "../../../../constants/openai.const.js";
|
|
6
6
|
import { groupSlashCommands as y } from "../../../../utils/slash.utils.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
9
|
import "react";
|
|
9
10
|
import "react-dom";
|
|
10
|
-
const
|
|
11
|
+
const F = (c) => {
|
|
11
12
|
var t;
|
|
12
13
|
const { items: l, top: o, left: i, query: _, onSelect: h } = c;
|
|
13
14
|
if (l.length === S) return null;
|
|
@@ -15,7 +16,7 @@ const D = (c) => {
|
|
|
15
16
|
return /* @__PURE__ */ e("div", { className: "Ink-Slash", style: { top: o, left: i }, role: "listbox", "aria-label": E, children: [
|
|
16
17
|
/* @__PURE__ */ e("div", { className: "Ink-Slash__search", "aria-hidden": "true", children: [
|
|
17
18
|
R,
|
|
18
|
-
|
|
19
|
+
I,
|
|
19
20
|
_ ? ` ${_}` : ""
|
|
20
21
|
] }),
|
|
21
22
|
d.map((n) => /* @__PURE__ */ e("div", { className: "Ink-Slash__group", children: [
|
|
@@ -29,8 +30,8 @@ const D = (c) => {
|
|
|
29
30
|
role: "option",
|
|
30
31
|
"aria-selected": r,
|
|
31
32
|
className: `Ink-Slash__item${r ? " Ink-Slash__item--sel" : ""}`,
|
|
32
|
-
onMouseDown: (
|
|
33
|
-
|
|
33
|
+
onMouseDown: (p) => {
|
|
34
|
+
p.preventDefault(), h(a);
|
|
34
35
|
},
|
|
35
36
|
children: [
|
|
36
37
|
/* @__PURE__ */ s(
|
|
@@ -61,5 +62,5 @@ const D = (c) => {
|
|
|
61
62
|
] });
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
F as SlashMenu
|
|
65
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),v=require("react-dom"),_=require("../../../../constants/numbers.cjs"),L=require("../../../../constants/generals.const.cjs"),w=require("../../../../constants/colorMode.const.cjs"),B=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const b=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),O=require("../ToolbarButton/ToolbarButton.cjs"),c=require("./TableSizePicker.const.cjs"),p=C=>{const{icon:f,disabled:I=!1,onSelect:P}=C,[a,E]=s.useState(!1),[u,d]=s.useState(c.TABLE_PICKER_INITIAL_HOVER),[T,m]=s.useState(c.TABLE_PICKER_EMPTY_POSITION),A=s.useRef(null),S=s.useRef(null),R=s.useRef(null);s.useEffect(()=>{if(!a)return;const e=()=>{const o=b.getToolbarDropdownMenuPosition(S.current);m({top:o.top,left:o.left})};e();const r=o=>{var K,N;const l=o.target;(K=A.current)!=null&&K.contains(l)||(N=R.current)!=null&&N.contains(l)||E(!1)},i=o=>{o.key===B.KEY_ESCAPE&&E(!1)};return document.addEventListener("mousedown",r),document.addEventListener("keydown",i),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",i),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[a]);const M=Array.from({length:_.INK_TABLE_PICKER_MAX*_.INK_TABLE_PICKER_MAX},(e,r)=>{const i=Math.floor(r/_.INK_TABLE_PICKER_MAX)+_.NUMBER_ONE,o=r%_.INK_TABLE_PICKER_MAX+_.NUMBER_ONE,l=i<=u.rows&&o<=u.cols;return{rows:i,cols:o,isOn:l,key:`${i}-${o}`}});return n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER,ref:A,children:[n.jsx("div",{ref:S,children:n.jsx(O.ToolbarButton,{icon:f,title:L.INK_TABLE_INSERT_TITLE,disabled:I,onClick:()=>{I||(d(c.TABLE_PICKER_INITIAL_HOVER),E(e=>!e))}})}),a?v.createPortal(n.jsxs("div",{ref:R,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL} ${t.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":w.COLOR_MODE_LIGHT,role:"grid","aria-label":L.INK_TABLE_INSERT_TITLE,style:{top:T.top,left:T.left},children:[n.jsx("div",{className:t.INK_CLASS_TABLE_PICKER_GRID,style:{gridTemplateColumns:`repeat(${_.INK_TABLE_PICKER_MAX}, 1fr)`},children:M.map(e=>n.jsx("button",{type:"button",className:`${t.INK_CLASS_TABLE_PICKER_CELL}${e.isOn?`${L.SPACE_STRING}${t.INK_CLASS_TABLE_PICKER_CELL_ON}`:""}`,"aria-label":`${e.rows}${c.TABLE_PICKER_TIMES_MARK}${e.cols}`,onMouseEnter:()=>d({rows:e.rows,cols:e.cols}),onMouseDown:r=>{r.preventDefault(),P(e.rows,e.cols),E(!1)}},e.key))}),n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER_LABEL,children:[u.rows,c.TABLE_PICKER_TIMES_MARK,u.cols]})]}),document.body):null]})};exports.TableSizePicker=p;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),v=require("react-dom"),_=require("../../../../constants/numbers.cjs"),L=require("../../../../constants/generals.const.cjs"),w=require("../../../../constants/colorMode.const.cjs"),B=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const b=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),O=require("../ToolbarButton/ToolbarButton.cjs"),c=require("./TableSizePicker.const.cjs"),p=C=>{const{icon:f,disabled:I=!1,onSelect:P}=C,[a,E]=s.useState(!1),[u,d]=s.useState(c.TABLE_PICKER_INITIAL_HOVER),[T,m]=s.useState(c.TABLE_PICKER_EMPTY_POSITION),A=s.useRef(null),S=s.useRef(null),R=s.useRef(null);s.useEffect(()=>{if(!a)return;const e=()=>{const o=b.getToolbarDropdownMenuPosition(S.current);m({top:o.top,left:o.left})};e();const r=o=>{var K,N;const l=o.target;(K=A.current)!=null&&K.contains(l)||(N=R.current)!=null&&N.contains(l)||E(!1)},i=o=>{o.key===B.KEY_ESCAPE&&E(!1)};return document.addEventListener("mousedown",r),document.addEventListener("keydown",i),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",i),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[a]);const M=Array.from({length:_.INK_TABLE_PICKER_MAX*_.INK_TABLE_PICKER_MAX},(e,r)=>{const i=Math.floor(r/_.INK_TABLE_PICKER_MAX)+_.NUMBER_ONE,o=r%_.INK_TABLE_PICKER_MAX+_.NUMBER_ONE,l=i<=u.rows&&o<=u.cols;return{rows:i,cols:o,isOn:l,key:`${i}-${o}`}});return n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER,ref:A,children:[n.jsx("div",{ref:S,children:n.jsx(O.ToolbarButton,{icon:f,title:L.INK_TABLE_INSERT_TITLE,disabled:I,onClick:()=>{I||(d(c.TABLE_PICKER_INITIAL_HOVER),E(e=>!e))}})}),a?v.createPortal(n.jsxs("div",{ref:R,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL} ${t.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":w.COLOR_MODE_LIGHT,role:"grid","aria-label":L.INK_TABLE_INSERT_TITLE,style:{top:T.top,left:T.left},children:[n.jsx("div",{className:t.INK_CLASS_TABLE_PICKER_GRID,style:{gridTemplateColumns:`repeat(${_.INK_TABLE_PICKER_MAX}, 1fr)`},children:M.map(e=>n.jsx("button",{type:"button",className:`${t.INK_CLASS_TABLE_PICKER_CELL}${e.isOn?`${L.SPACE_STRING}${t.INK_CLASS_TABLE_PICKER_CELL_ON}`:""}`,"aria-label":`${e.rows}${c.TABLE_PICKER_TIMES_MARK}${e.cols}`,onMouseEnter:()=>d({rows:e.rows,cols:e.cols}),onMouseDown:r=>{r.preventDefault(),P(e.rows,e.cols),E(!1)}},e.key))}),n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER_LABEL,children:[u.rows,c.TABLE_PICKER_TIMES_MARK,u.cols]})]}),document.body):null]})};exports.TableSizePicker=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=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 E=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 e={rows:E.NUMBER_ONE,cols:E.NUMBER_ONE},_={top:E.NUMBER_ZERO,left:E.NUMBER_ZERO},r=" × ";exports.TABLE_PICKER_EMPTY_POSITION=_;exports.TABLE_PICKER_INITIAL_HOVER=e;exports.TABLE_PICKER_TIMES_MARK=r;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { NUMBER_ONE as o, NUMBER_ZERO as
|
|
1
|
+
import { NUMBER_ONE as o, NUMBER_ZERO as t } 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 i = {
|
|
8
9
|
rows: o,
|
|
9
10
|
cols: o
|
|
10
11
|
}, T = {
|
|
11
|
-
top:
|
|
12
|
-
left:
|
|
13
|
-
},
|
|
12
|
+
top: t,
|
|
13
|
+
left: t
|
|
14
|
+
}, s = " × ";
|
|
14
15
|
export {
|
|
15
16
|
T as TABLE_PICKER_EMPTY_POSITION,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
i as TABLE_PICKER_INITIAL_HOVER,
|
|
18
|
+
s as TABLE_PICKER_TIMES_MARK
|
|
18
19
|
};
|
|
@@ -8,11 +8,12 @@ import { KEY_ESCAPE as b } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_TABLE_PICKER as g, INK_CLASS_STYLE_MENU as h, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as D, INK_CLASS_TABLE_PICKER_GRID as Y, INK_CLASS_TABLE_PICKER_CELL as U, INK_CLASS_TABLE_PICKER_CELL_ON as x, INK_CLASS_TABLE_PICKER_LABEL as z } 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 G } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
12
13
|
import { ToolbarButton as H } from "../ToolbarButton/ToolbarButton.js";
|
|
13
14
|
import { TABLE_PICKER_INITIAL_HOVER as N, TABLE_PICKER_EMPTY_POSITION as j, TABLE_PICKER_TIMES_MARK as K } from "./TableSizePicker.const.js";
|
|
14
|
-
const
|
|
15
|
-
const { icon: v, disabled: L = !1, onSelect: w } = R, [c, s] = m(!1), [i, d] = m(N), [f, P] = m(j), u = a(null), I = a(null),
|
|
15
|
+
const ie = (R) => {
|
|
16
|
+
const { icon: v, disabled: L = !1, onSelect: w } = R, [c, s] = m(!1), [i, d] = m(N), [f, P] = m(j), u = a(null), I = a(null), p = a(null);
|
|
16
17
|
B(() => {
|
|
17
18
|
if (!c) return;
|
|
18
19
|
const e = () => {
|
|
@@ -21,9 +22,9 @@ const se = (R) => {
|
|
|
21
22
|
};
|
|
22
23
|
e();
|
|
23
24
|
const t = (o) => {
|
|
24
|
-
var
|
|
25
|
+
var S, T;
|
|
25
26
|
const _ = o.target;
|
|
26
|
-
(
|
|
27
|
+
(S = u.current) != null && S.contains(_) || (T = p.current) != null && T.contains(_) || s(!1);
|
|
27
28
|
}, r = (o) => {
|
|
28
29
|
o.key === b && s(!1);
|
|
29
30
|
};
|
|
@@ -51,7 +52,7 @@ const se = (R) => {
|
|
|
51
52
|
/* @__PURE__ */ l(
|
|
52
53
|
"div",
|
|
53
54
|
{
|
|
54
|
-
ref:
|
|
55
|
+
ref: p,
|
|
55
56
|
className: `${h} ${k} ${D}`,
|
|
56
57
|
"data-color-mode": y,
|
|
57
58
|
role: "grid",
|
|
@@ -91,5 +92,5 @@ const se = (R) => {
|
|
|
91
92
|
] });
|
|
92
93
|
};
|
|
93
94
|
export {
|
|
94
|
-
|
|
95
|
+
ie as TableSizePicker
|
|
95
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),y=require("react-dom"),L=require("../../../../constants/numbers.cjs"),T=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),I=require("../../../../constants/keyboard.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),y=require("react-dom"),L=require("../../../../constants/numbers.cjs"),T=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),I=require("../../../../constants/keyboard.const.cjs"),u=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const P=require("../../../../plugins/theme/theme.const.cjs");require("../../../../plugins/host/inkPlugins.cjs");const C=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),O=require("../ToolbarButton/ToolbarButton.cjs"),k=p=>{const{icon:b,disabled:c=!1,hint:q,onHint:w,pluginColor:S,value:M,onChange:R}=p,[i,r]=o.useState(!1),[l,N]=o.useState({top:L.NUMBER_ZERO,left:L.NUMBER_ZERO}),a=o.useRef(null),d=o.useRef(null),E=o.useRef(null);return o.useEffect(()=>{if(!i)return;const e=()=>{const t=C.getToolbarDropdownMenuPosition(d.current);N({top:t.top,left:t.left})};e();const s=t=>{var m,v;const f=t.target;(m=a.current)!=null&&m.contains(f)||(v=E.current)!=null&&v.contains(f)||r(!1)},_=t=>{t.key===I.KEY_ESCAPE&&r(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",_),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",_),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]),n.jsxs("div",{ref:a,children:[n.jsx("div",{ref:d,children:n.jsx(O.ToolbarButton,{icon:b,title:T.INK_THEME_TITLE,hint:q,onHint:w,pluginColor:S,disabled:c,onClick:()=>{c||r(e=>!e)}})}),i?y.createPortal(n.jsx("div",{ref:E,className:`${u.INK_CLASS_STYLE_MENU} ${u.INK_CLASS_STYLE_MENU_PORTAL} ${u.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":T.INK_THEME_TITLE,style:{top:l.top,left:l.left},children:P.INK_THEMES.map(e=>n.jsx("button",{type:"button",role:"option","aria-selected":e.id===M,className:"Ink-Editor__style-option",onMouseDown:s=>{s.preventDefault(),R(e.id),r(!1)},children:e.label},e.id))}),document.body):null]})};exports.ThemePicker=k;
|
|
@@ -8,12 +8,13 @@ import { KEY_ESCAPE as K } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as x } 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 { INK_THEMES as A } from "../../../../plugins/theme/theme.const.js";
|
|
12
13
|
import "../../../../plugins/host/inkPlugins.js";
|
|
13
14
|
import { getToolbarDropdownMenuPosition as D } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
14
15
|
import { ToolbarButton as h } from "../ToolbarButton/ToolbarButton.js";
|
|
15
|
-
const
|
|
16
|
-
const { icon: S, disabled: l = !1, hint: T, onHint: N, pluginColor: M, value: b, onChange: C } = w, [i, t] = _(!1), [
|
|
16
|
+
const X = (w) => {
|
|
17
|
+
const { icon: S, disabled: l = !1, hint: T, onHint: N, pluginColor: M, value: b, onChange: C } = w, [i, t] = _(!1), [m, R] = _({ top: v, left: v }), d = s(null), c = s(null), a = s(null);
|
|
17
18
|
return I(() => {
|
|
18
19
|
if (!i) return;
|
|
19
20
|
const e = () => {
|
|
@@ -24,14 +25,14 @@ const W = (w) => {
|
|
|
24
25
|
const n = (o) => {
|
|
25
26
|
var p, E;
|
|
26
27
|
const u = o.target;
|
|
27
|
-
(p =
|
|
28
|
+
(p = d.current) != null && p.contains(u) || (E = a.current) != null && E.contains(u) || t(!1);
|
|
28
29
|
}, f = (o) => {
|
|
29
30
|
o.key === K && t(!1);
|
|
30
31
|
};
|
|
31
32
|
return document.addEventListener("mousedown", n), document.addEventListener("keydown", f), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
32
33
|
document.removeEventListener("mousedown", n), document.removeEventListener("keydown", f), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
33
34
|
};
|
|
34
|
-
}, [i]), /* @__PURE__ */ y("div", { ref:
|
|
35
|
+
}, [i]), /* @__PURE__ */ y("div", { ref: d, children: [
|
|
35
36
|
/* @__PURE__ */ r("div", { ref: c, children: /* @__PURE__ */ r(
|
|
36
37
|
h,
|
|
37
38
|
{
|
|
@@ -55,7 +56,7 @@ const W = (w) => {
|
|
|
55
56
|
"data-color-mode": g,
|
|
56
57
|
role: "listbox",
|
|
57
58
|
"aria-label": L,
|
|
58
|
-
style: { top:
|
|
59
|
+
style: { top: m.top, left: m.left },
|
|
59
60
|
children: A.map((e) => /* @__PURE__ */ r(
|
|
60
61
|
"button",
|
|
61
62
|
{
|
|
@@ -77,5 +78,5 @@ const W = (w) => {
|
|
|
77
78
|
] });
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
X as ThemePicker
|
|
81
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),C=require("react-dom"),f=require("../../../../constants/numbers.cjs"),m=require("../../../../constants/generals.const.cjs"),K=require("../../../../constants/colorMode.const.cjs"),A=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const I=require("../../../../plugins/titles/titles.const.cjs"),M=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),x=require("../ToolbarButton/ToolbarButton.cjs"),g=N=>{const{icon:v,disabled:c=!1,hint:R,onHint:p,pluginColor:b,onSelect:w}=N,[l,s]=r.useState(!1),[u,q]=r.useState({top:f.NUMBER_ZERO,left:f.NUMBER_ZERO}),a=r.useRef(null),_=r.useRef(null),d=r.useRef(null);return r.useEffect(()=>{if(!l)return;const e=()=>{const o=M.getToolbarDropdownMenuPosition(_.current);q({top:o.top,left:o.left})};e();const i=o=>{var T,S;const L=o.target;(T=a.current)!=null&&T.contains(L)||(S=d.current)!=null&&S.contains(L)||s(!1)},E=o=>{o.key===A.KEY_ESCAPE&&s(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",E),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",E),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[l]),n.jsxs("div",{className:t.INK_CLASS_TITLE_GALLERY,ref:a,children:[n.jsx("div",{ref:_,children:n.jsx(x.ToolbarButton,{icon:v,title:m.INK_TITLES_TITLE,hint:R,onHint:p,pluginColor:b,disabled:c,onClick:()=>{c||s(e=>!e)}})}),l?C.createPortal(n.jsx("div",{ref:d,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL} ${t.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":K.COLOR_MODE_LIGHT,role:"listbox","aria-label":m.INK_TITLES_TITLE,style:{top:u.top,left:u.left},children:n.jsx("div",{className:t.INK_CLASS_TITLE_GRID,children:I.TITLE_STYLE_IDS.map(e=>n.jsx("button",{type:"button",className:t.INK_CLASS_TITLE_CELL,"aria-label":e,onMouseDown:i=>{i.preventDefault(),w(e),s(!1)},children:n.jsx("span",{className:`${t.INK_CLASS_TITLE} ${t.INK_CLASS_TITLE}--${e}`,children:I.TITLE_PREVIEW_TEXT})},e))})}),document.body):null]})};exports.TitleGallery=g;
|
|
@@ -8,10 +8,11 @@ import { KEY_ESCAPE as h } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_TITLE_GALLERY as D, INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as g, INK_CLASS_STYLE_MENU_FORCED as Y, INK_CLASS_TITLE_GRID as $, INK_CLASS_TITLE_CELL as x, INK_CLASS_TITLE as S } 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 { TITLE_STYLE_IDS as y, TITLE_PREVIEW_TEXT as k } from "../../../../plugins/titles/titles.const.js";
|
|
12
13
|
import { getToolbarDropdownMenuPosition as G } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
13
14
|
import { ToolbarButton as U } from "../ToolbarButton/ToolbarButton.js";
|
|
14
|
-
const
|
|
15
|
+
const te = (v) => {
|
|
15
16
|
const { icon: I, disabled: l = !1, hint: N, onHint: w, pluginColor: C, onSelect: R } = v, [i, n] = _(!1), [m, A] = _({ top: p, left: p }), a = s(null), c = s(null), E = s(null);
|
|
16
17
|
return b(() => {
|
|
17
18
|
if (!i) return;
|
|
@@ -75,5 +76,5 @@ const oe = (v) => {
|
|
|
75
76
|
] });
|
|
76
77
|
};
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
te as TitleGallery
|
|
79
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const N=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const S=a=>{const{icon:u,title:r,hint:l,onHint:e,pluginColor:t,active:o=!1,onClick:i,disabled:c=!1,className:d}=a,q=b=>{b.preventDefault()},_=l||r;return s.jsx("span",{className:n.INK_CLASS_TOOL_WRAP,onMouseEnter:()=>e==null?void 0:e(_),onMouseLeave:()=>e==null?void 0:e(p.EMPTY_STRING),children:s.jsxs(N.Button,{title:r,"aria-label":r,"aria-pressed":o,disabled:c,active:o,className:d,onMouseDown:q,onClick:i,children:[u,t?s.jsx("span",{className:n.INK_CLASS_PLUGIN_PIP,style:{background:t},"aria-hidden":!0}):null]})})};exports.ToolbarButton=S;
|