@forgedevstack/ink 1.1.7 → 1.1.9
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 +40 -0
- package/README.md +9 -1
- package/bin/ink.const.mjs +26 -0
- package/bin/ink.mjs +58 -0
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +1193 -834
- package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +223 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
- package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -1
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +17 -12
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -1
- 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 +82 -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 +65 -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/TableSizePicker/TableSizePicker.cjs +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +96 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +65 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
- package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
- package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
- package/dist/components/InkEditor/components/index.d.ts +18 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
- package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
- package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.js +72 -72
- package/dist/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 +317 -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 +72 -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/colorMode.const.cjs +1 -1
- package/dist/constants/colorMode.const.d.ts +1 -1
- package/dist/constants/colorMode.const.d.ts.map +1 -1
- package/dist/constants/colorMode.const.js +4 -4
- package/dist/constants/contextMenu.const.cjs +1 -1
- package/dist/constants/contextMenu.const.d.ts +2 -0
- package/dist/constants/contextMenu.const.d.ts.map +1 -1
- package/dist/constants/contextMenu.const.js +17 -15
- package/dist/constants/defaultIcons.cjs +1 -1
- package/dist/constants/defaultIcons.d.ts.map +1 -1
- package/dist/constants/defaultIcons.js +20 -13
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts +48 -0
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +201 -102
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +48 -0
- package/dist/constants/generals.const.d.ts.map +1 -1
- package/dist/constants/generals.const.js +71 -28
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.d.ts +14 -0
- package/dist/constants/numbers.d.ts.map +1 -1
- package/dist/constants/numbers.js +47 -28
- package/dist/constants/plugins.const.cjs +1 -0
- package/dist/constants/plugins.const.d.ts +13 -0
- package/dist/constants/plugins.const.d.ts.map +1 -0
- package/dist/constants/plugins.const.js +45 -0
- package/dist/constants/table.const.cjs +1 -1
- package/dist/constants/table.const.d.ts +4 -0
- package/dist/constants/table.const.d.ts.map +1 -1
- package/dist/constants/table.const.js +10 -6
- package/dist/constants/toolbar.const.cjs +1 -1
- package/dist/constants/toolbar.const.d.ts +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 +2 -0
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
- package/dist/constants/toolbarMenu.const.js +80 -19
- 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 +4 -0
- package/dist/hooks/index.d.ts.map +1 -0
- 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 +86 -0
- package/dist/hooks/useToolbarOverflow.cjs +1 -0
- package/dist/hooks/useToolbarOverflow.d.ts +8 -0
- package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
- package/dist/hooks/useToolbarOverflow.js +29 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +150 -104
- package/dist/plugins/excel/excel.utils.cjs +1 -0
- package/dist/plugins/excel/excel.utils.d.ts +13 -0
- package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
- package/dist/plugins/excel/excel.utils.js +40 -0
- package/dist/plugins/excel/index.d.ts +3 -0
- package/dist/plugins/excel/index.d.ts.map +1 -0
- package/dist/plugins/graph/graph.const.cjs +1 -0
- package/dist/plugins/graph/graph.const.d.ts +14 -0
- package/dist/plugins/graph/graph.const.d.ts.map +1 -0
- package/dist/plugins/graph/graph.const.js +24 -0
- package/dist/plugins/graph/graph.types.d.ts +7 -0
- package/dist/plugins/graph/graph.types.d.ts.map +1 -0
- package/dist/plugins/graph/graph.utils.cjs +1 -0
- package/dist/plugins/graph/graph.utils.d.ts +11 -0
- package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
- package/dist/plugins/graph/graph.utils.js +76 -0
- package/dist/plugins/graph/index.d.ts +4 -0
- package/dist/plugins/graph/index.d.ts.map +1 -0
- package/dist/plugins/host/index.d.ts +2 -0
- package/dist/plugins/host/index.d.ts.map +1 -0
- package/dist/plugins/host/inkPlugins.cjs +1 -0
- package/dist/plugins/host/inkPlugins.d.ts +16 -0
- package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
- package/dist/plugins/host/inkPlugins.js +20 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/theme/index.d.ts +4 -0
- package/dist/plugins/theme/index.d.ts.map +1 -0
- package/dist/plugins/theme/inkTheme.cjs +1 -0
- package/dist/plugins/theme/inkTheme.d.ts +5 -0
- package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
- package/dist/plugins/theme/inkTheme.js +27 -0
- package/dist/plugins/theme/theme.const.cjs +1 -0
- package/dist/plugins/theme/theme.const.d.ts +9 -0
- package/dist/plugins/theme/theme.const.d.ts.map +1 -0
- package/dist/plugins/theme/theme.const.js +15 -0
- package/dist/plugins/theme/theme.types.d.ts +12 -0
- package/dist/plugins/theme/theme.types.d.ts.map +1 -0
- package/dist/plugins/titles/index.d.ts +4 -0
- package/dist/plugins/titles/index.d.ts.map +1 -0
- package/dist/plugins/titles/titles.const.cjs +1 -0
- package/dist/plugins/titles/titles.const.d.ts +4 -0
- package/dist/plugins/titles/titles.const.d.ts.map +1 -0
- package/dist/plugins/titles/titles.const.js +15 -0
- package/dist/plugins/titles/titles.types.d.ts +2 -0
- package/dist/plugins/titles/titles.types.d.ts.map +1 -0
- package/dist/plugins/titles/titles.utils.cjs +1 -0
- package/dist/plugins/titles/titles.utils.d.ts +3 -0
- package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
- package/dist/plugins/titles/titles.utils.js +14 -0
- package/dist/styles.css +1 -1
- package/dist/types/collab.types.d.ts +55 -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 +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +10 -2
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/plugin.types.d.ts +8 -0
- package/dist/types/plugin.types.d.ts.map +1 -0
- package/dist/types/premium.types.d.ts +1 -1
- package/dist/types/premium.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/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 +32 -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/index.d.ts +3 -1
- 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/outline.utils.cjs +1 -1
- package/dist/utils/outline.utils.d.ts.map +1 -1
- package/dist/utils/outline.utils.js +32 -32
- package/dist/utils/table.utils.cjs +1 -1
- package/dist/utils/table.utils.d.ts +4 -0
- package/dist/utils/table.utils.d.ts.map +1 -1
- package/dist/utils/table.utils.js +84 -45
- package/dist/utils/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 +7 -1
|
@@ -1,28 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { EMPTY_STRING as N } from "../../../../constants/generals.const.js";
|
|
3
|
+
import { INK_CLASS_TOOL_WRAP as _, INK_CLASS_PLUGIN_PIP as I } from "../../../../constants/defaults.const.js";
|
|
2
4
|
import "../../../../constants/openai.const.js";
|
|
3
5
|
import "../../../../utils/paste.utils.js";
|
|
4
|
-
import { Button as
|
|
6
|
+
import { Button as L } from "../../../../common-components/Button/Button.js";
|
|
5
7
|
import "react";
|
|
6
8
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const x = (a) => {
|
|
10
|
+
const {
|
|
11
|
+
icon: l,
|
|
12
|
+
title: e,
|
|
13
|
+
hint: i,
|
|
14
|
+
onHint: o,
|
|
15
|
+
pluginColor: r,
|
|
16
|
+
active: s = !1,
|
|
17
|
+
onClick: n,
|
|
18
|
+
disabled: m = !1,
|
|
19
|
+
className: p
|
|
20
|
+
} = a, c = (d) => {
|
|
21
|
+
d.preventDefault();
|
|
22
|
+
}, u = i || e;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
"span",
|
|
11
25
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
className: _,
|
|
27
|
+
onMouseEnter: () => o == null ? void 0 : o(u),
|
|
28
|
+
onMouseLeave: () => o == null ? void 0 : o(N),
|
|
29
|
+
children: /* @__PURE__ */ f(
|
|
30
|
+
L,
|
|
31
|
+
{
|
|
32
|
+
title: e,
|
|
33
|
+
"aria-label": e,
|
|
34
|
+
"aria-pressed": s,
|
|
35
|
+
disabled: m,
|
|
36
|
+
active: s,
|
|
37
|
+
className: p,
|
|
38
|
+
onMouseDown: c,
|
|
39
|
+
onClick: n,
|
|
40
|
+
children: [
|
|
41
|
+
l,
|
|
42
|
+
r ? /* @__PURE__ */ t("span", { className: I, style: { background: r }, "aria-hidden": !0 }) : null
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
23
46
|
}
|
|
24
47
|
);
|
|
25
48
|
};
|
|
26
49
|
export {
|
|
27
|
-
|
|
50
|
+
x as ToolbarButton
|
|
28
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),c=require("../../../../constants/numbers.cjs"),u=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const D=require("./ToolbarDropdown.utils.cjs"),K=()=>t.jsx("svg",{className:n.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:t.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),P=R=>{const{options:d,value:L,onChange:b,title:_,disabled:f=!1}=R,[i,l]=r.useState(!1),[E,w]=r.useState({top:c.NUMBER_ZERO,left:c.NUMBER_ZERO,minWidth:c.NUMBER_ZERO}),m=r.useRef(null),N=r.useRef(null),T=r.useRef(null),S=d.find(e=>e.value===L)??d[c.NUMBER_ZERO],I=(S==null?void 0:S.label)??u.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{w(D.getToolbarDropdownMenuPosition(N.current))};e();const o=s=>{var p,C;const v=s.target;(p=m.current)!=null&&p.contains(v)||(C=T.current)!=null&&C.contains(v)||l(!1)},a=s=>{s.key===x.KEY_ESCAPE&&l(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]);const M=e=>{e.preventDefault()},h=()=>{f||l(e=>!e)};return t.jsxs("div",{className:n.INK_CLASS_STYLE_DD,ref:m,children:[t.jsxs("button",{ref:N,type:"button",className:n.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:f,onMouseDown:M,onClick:h,children:[t.jsx("span",{children:I}),t.jsx(K,{})]}),i?O.createPortal(t.jsx("div",{ref:T,className:`${n.INK_CLASS_STYLE_MENU} ${n.INK_CLASS_STYLE_MENU_PORTAL} ${n.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===L,a=`${n.INK_CLASS_STYLE_OPTION}${o?`${u.SPACE_STRING}${n.INK_CLASS_STYLE_OPTION_SEL}`:u.EMPTY_STRING}`;return t.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),b(e.value),l(!1)},children:[o?t.jsx("span",{className:n.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:u.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolbarDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAmB9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAU9D,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6GpD,CAAC"}
|
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as C, useRef as
|
|
3
|
-
import { createPortal as
|
|
2
|
+
import { useState as C, useRef as _, useEffect as K } from "react";
|
|
3
|
+
import { createPortal as M } from "react-dom";
|
|
4
4
|
import { NUMBER_ZERO as l } from "../../../../constants/numbers.js";
|
|
5
|
-
import { EMPTY_STRING as w, SPACE_STRING as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { EMPTY_STRING as w, SPACE_STRING as R, INK_STYLE_CHECK as A } from "../../../../constants/generals.const.js";
|
|
6
|
+
import { COLOR_MODE_LIGHT as D } from "../../../../constants/colorMode.const.js";
|
|
7
|
+
import { KEY_ESCAPE as Y } from "../../../../constants/keyboard.const.js";
|
|
8
|
+
import { INK_CLASS_STYLE_DD as O, INK_CLASS_STYLE_TRIGGER as P, INK_CLASS_STYLE_MENU as y, INK_CLASS_STYLE_MENU_PORTAL as x, INK_CLASS_STYLE_MENU_FORCED as $, INK_CLASS_STYLE_OPTION as k, INK_CLASS_STYLE_OPTION_SEL as G, INK_CLASS_STYLE_CHECK as H, INK_CLASS_STYLE_CHEV as U } from "../../../../constants/defaults.const.js";
|
|
8
9
|
import "../../../../constants/openai.const.js";
|
|
9
10
|
import "../../../../utils/paste.utils.js";
|
|
10
11
|
import { getToolbarDropdownMenuPosition as W } from "./ToolbarDropdown.utils.js";
|
|
11
|
-
const
|
|
12
|
-
const { options: a, value: E, onChange:
|
|
12
|
+
const j = () => /* @__PURE__ */ n("svg", { className: U, viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2 3.5L5 6.5L8 3.5", stroke: "currentColor", strokeWidth: "1.4", fill: "none" }) }), re = (h) => {
|
|
13
|
+
const { options: a, value: E, onChange: I, title: c, disabled: S = !1 } = h, [r, s] = C(!1), [d, b] = C({
|
|
13
14
|
top: l,
|
|
14
15
|
left: l,
|
|
15
16
|
minWidth: l
|
|
16
|
-
}),
|
|
17
|
+
}), f = _(null), L = _(null), p = _(null), u = a.find((e) => e.value === E) ?? a[l], g = (u == null ? void 0 : u.label) ?? w;
|
|
17
18
|
return K(() => {
|
|
18
19
|
if (!r) return;
|
|
19
20
|
const e = () => {
|
|
20
|
-
|
|
21
|
+
b(W(L.current));
|
|
21
22
|
};
|
|
22
23
|
e();
|
|
23
24
|
const o = (t) => {
|
|
24
25
|
var N, T;
|
|
25
26
|
const v = t.target;
|
|
26
|
-
(N =
|
|
27
|
+
(N = f.current) != null && N.contains(v) || (T = p.current) != null && T.contains(v) || s(!1);
|
|
27
28
|
}, i = (t) => {
|
|
28
|
-
t.key ===
|
|
29
|
+
t.key === Y && s(!1);
|
|
29
30
|
};
|
|
30
31
|
return document.addEventListener("mousedown", o), document.addEventListener("keydown", i), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
31
32
|
document.removeEventListener("mousedown", o), document.removeEventListener("keydown", i), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
32
33
|
};
|
|
33
|
-
}, [r]), /* @__PURE__ */ m("div", { className:
|
|
34
|
+
}, [r]), /* @__PURE__ */ m("div", { className: O, ref: f, children: [
|
|
34
35
|
/* @__PURE__ */ m(
|
|
35
36
|
"button",
|
|
36
37
|
{
|
|
37
|
-
ref:
|
|
38
|
+
ref: L,
|
|
38
39
|
type: "button",
|
|
39
|
-
className:
|
|
40
|
+
className: P,
|
|
40
41
|
title: c,
|
|
41
42
|
"aria-label": c,
|
|
42
43
|
"aria-haspopup": "listbox",
|
|
@@ -49,22 +50,23 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
|
|
|
49
50
|
S || s((e) => !e);
|
|
50
51
|
},
|
|
51
52
|
children: [
|
|
52
|
-
/* @__PURE__ */ n("span", { children:
|
|
53
|
-
/* @__PURE__ */ n(
|
|
53
|
+
/* @__PURE__ */ n("span", { children: g }),
|
|
54
|
+
/* @__PURE__ */ n(j, {})
|
|
54
55
|
]
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
r ?
|
|
58
|
+
r ? M(
|
|
58
59
|
/* @__PURE__ */ n(
|
|
59
60
|
"div",
|
|
60
61
|
{
|
|
61
|
-
ref:
|
|
62
|
-
className: `${y} ${x}`,
|
|
62
|
+
ref: p,
|
|
63
|
+
className: `${y} ${x} ${$}`,
|
|
64
|
+
"data-color-mode": D,
|
|
63
65
|
role: "listbox",
|
|
64
66
|
"aria-label": c,
|
|
65
67
|
style: { top: d.top, left: d.left, minWidth: d.minWidth },
|
|
66
68
|
children: a.map((e) => {
|
|
67
|
-
const o = e.value === E, i = `${
|
|
69
|
+
const o = e.value === E, i = `${k}${o ? `${R}${G}` : w}`;
|
|
68
70
|
return /* @__PURE__ */ m(
|
|
69
71
|
"button",
|
|
70
72
|
{
|
|
@@ -73,10 +75,10 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
|
|
|
73
75
|
"aria-selected": o,
|
|
74
76
|
className: i,
|
|
75
77
|
onMouseDown: (t) => {
|
|
76
|
-
t.preventDefault(),
|
|
78
|
+
t.preventDefault(), I(e.value), s(!1);
|
|
77
79
|
},
|
|
78
80
|
children: [
|
|
79
|
-
o ? /* @__PURE__ */ n("span", { className:
|
|
81
|
+
o ? /* @__PURE__ */ n("span", { className: H, "aria-hidden": "true", children: A }) : null,
|
|
80
82
|
e.label
|
|
81
83
|
]
|
|
82
84
|
},
|
|
@@ -90,5 +92,5 @@ const H = () => /* @__PURE__ */ n("svg", { className: G, viewBox: "0 0 10 10", "
|
|
|
90
92
|
] });
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
re as ToolbarDropdown
|
|
94
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const c=(E,o=_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX)=>{if(!E)return{top:_.NUMBER_ZERO,left:_.NUMBER_ZERO,minWidth:_.INK_STYLE_MENU_MIN_WIDTH_PX};const t=E.getBoundingClientRect(),r=window.innerWidth,N=window.innerHeight,e=Math.max(t.width,_.INK_STYLE_MENU_MIN_WIDTH_PX),M=Math.max(_.INK_STYLE_MENU_EDGE_PX,r-e-_.INK_STYLE_MENU_EDGE_PX),T=Math.min(Math.max(t.left,_.INK_STYLE_MENU_EDGE_PX),M),n=o>_.NUMBER_ZERO?o:_.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX,i=t.bottom+_.INK_STYLE_MENU_GAP_PX,I=t.top-n-_.INK_STYLE_MENU_GAP_PX;return{top:i+n>N-_.INK_STYLE_MENU_EDGE_PX?Math.max(_.INK_STYLE_MENU_EDGE_PX,I):i,left:T,minWidth:e}};exports.getToolbarDropdownMenuPosition=c;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ToolbarDropdownMenuPosition } from './ToolbarDropdown.types';
|
|
2
|
-
export declare const getToolbarDropdownMenuPosition: (trigger: HTMLElement | null) => ToolbarDropdownMenuPosition;
|
|
2
|
+
export declare const getToolbarDropdownMenuPosition: (trigger: HTMLElement | null, estimatedHeight?: number) => ToolbarDropdownMenuPosition;
|
|
3
3
|
//# sourceMappingURL=ToolbarDropdown.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarDropdown.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,eAAO,MAAM,8BAA8B,GACzC,SAAS,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ToolbarDropdown.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,eAAO,MAAM,8BAA8B,GACzC,SAAS,WAAW,GAAG,IAAI,EAC3B,wBAAoD,KACnD,2BAkBF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { INK_STYLE_MENU_MIN_WIDTH_PX as
|
|
1
|
+
import { INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as E, INK_STYLE_MENU_MIN_WIDTH_PX as p, NUMBER_ZERO as n, INK_STYLE_MENU_EDGE_PX as t, INK_STYLE_MENU_GAP_PX as c } from "../../../../constants/numbers.js";
|
|
2
2
|
import "../../../../constants/openai.const.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
return { top:
|
|
10
|
-
const o =
|
|
11
|
-
return { top:
|
|
7
|
+
const P = (i, e = E) => {
|
|
8
|
+
if (!i)
|
|
9
|
+
return { top: n, left: n, minWidth: p };
|
|
10
|
+
const o = i.getBoundingClientRect(), M = window.innerWidth, h = window.innerHeight, _ = Math.max(o.width, p), a = Math.max(t, M - _ - t), s = Math.min(Math.max(o.left, t), a), r = e > n ? e : E, m = o.bottom + c, N = o.top - r - c;
|
|
11
|
+
return { top: m + r > h - t ? Math.max(t, N) : m, left: s, minWidth: _ };
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
P as getToolbarDropdownMenuPosition
|
|
15
15
|
};
|
|
@@ -16,4 +16,22 @@ export { SignPad } from './SignPad';
|
|
|
16
16
|
export { FindReplace } from './FindReplace';
|
|
17
17
|
export { ToolbarCustomize } from './ToolbarCustomize';
|
|
18
18
|
export type { ToolbarCustomizeProps } from './ToolbarCustomize';
|
|
19
|
+
export { HtmlSourcePanel } from './HtmlSourcePanel';
|
|
20
|
+
export type { HtmlSourcePanelProps } from './HtmlSourcePanel';
|
|
21
|
+
export { TableSizePicker } from './TableSizePicker';
|
|
22
|
+
export type { TableSizePickerProps } from './TableSizePicker';
|
|
23
|
+
export { TitleGallery } from './TitleGallery';
|
|
24
|
+
export type { TitleGalleryProps } from './TitleGallery';
|
|
25
|
+
export { ExcelSheetPanel } from './ExcelSheetPanel';
|
|
26
|
+
export type { ExcelSheetPanelProps } from './ExcelSheetPanel';
|
|
27
|
+
export { GraphPicker } from './GraphPicker';
|
|
28
|
+
export type { GraphPickerProps } from './GraphPicker';
|
|
29
|
+
export { GraphEditModal } from './GraphEditModal';
|
|
30
|
+
export type { GraphEditModalProps, GraphEditMode } from './GraphEditModal';
|
|
31
|
+
export { ThemePicker } from './ThemePicker';
|
|
32
|
+
export type { ThemePickerProps } from './ThemePicker';
|
|
33
|
+
export { PresenceStack } from './PresenceStack';
|
|
34
|
+
export type { PresenceStackProps } from './PresenceStack';
|
|
35
|
+
export { RemoteCursors } from './RemoteCursors';
|
|
36
|
+
export type { RemoteCursorsProps } from './RemoteCursors';
|
|
19
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/numbers.cjs"),l=require("../../../constants/fonts.const.cjs"),r=require("../../../constants/lists.const.cjs"),
|
|
2
|
-
`)return!1;t.preventDefault();const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/numbers.cjs"),l=require("../../../constants/fonts.const.cjs"),r=require("../../../constants/lists.const.cjs"),R=require("../../../constants/blocks.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");const p=require("../../../utils/blocks.utils.cjs");require("../../../utils/paste.utils.cjs");require("react");require("react-dom");const M="color",y="background-color",g="background",A="color",d="style",I=1,U=3,D="removeFormat",S="insertUnorderedList",m="insertOrderedList",h="superscript",P="subscript",H="styleWithCSS",i=(t,e)=>document.execCommand(t,!1,e),c=t=>document.queryCommandState(t),B=t=>document.queryCommandValue(t),w="http://",f="https://",Y="mailto:",b="&",q="<",F=">",k=""",v=t=>t.replace(/&/g,b).replace(/</g,q).replace(/>/g,F).replace(/"/g,k),W=(t,e="")=>{if(!t)return!1;const o=t.startsWith(w)||t.startsWith(f)||t.startsWith(Y)?t:`${f}${t}`,n=window.getSelection();return(!n||n.isCollapsed)&&e?i("insertHTML",`<a href="${o}">${v(e)}</a>`):i("createLink",o)},x=t=>i("foreColor",t),K=t=>i("hiliteColor",t),C=t=>i("insertHTML",t),V=(t,e="")=>{const o=e.replace(/"/g,""");return C(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`)},Z=t=>new Promise((e,o)=>{const n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=o,n.readAsDataURL(t)}),G=()=>{const t=new Set;return c("bold")&&t.add("bold"),c("italic")&&t.add("italic"),c("underline")&&t.add("underline"),c("strikeThrough")&&t.add("strikethrough"),c(S)&&t.add("bulletList"),c(m)&&t.add("orderedList"),c(h)&&t.add("superscript"),c(P)&&t.add("subscript"),t},O=t=>{t.style.removeProperty(M),t.style.removeProperty(y),t.style.removeProperty(g),t.hasAttribute(A)&&t.removeAttribute(A);const e=t.getAttribute(d);e!==null&&!e.trim()&&t.removeAttribute(d)},N=()=>{const t=window.getSelection();if(!t||t.rangeCount===a.NUMBER_ZERO)return;const o=t.getRangeAt(a.NUMBER_ZERO).commonAncestorContainer,n=o.nodeType===I?o:o.parentElement;n&&(n instanceof HTMLElement&&t.containsNode(n,!0)&&O(n),n.querySelectorAll("*").forEach(s=>{s instanceof HTMLElement&&t.containsNode(s,!0)&&O(s)}))},$=()=>{const t=i(D);return N(),t},j=t=>{const e=l.FONT_FAMILY_BY_VALUE[t]??t;if(i(H,"true"),t===l.FONT_VALUE_SYSTEM){const o=window.getSelection();if(!o||o.rangeCount===a.NUMBER_ZERO||o.isCollapsed)return i(l.FONT_COMMAND_NAME,e);const n=o.getRangeAt(a.NUMBER_ZERO),s=document.createElement("span");s.style.setProperty(l.FONT_STYLE_PROPERTY,e);try{return n.surroundContents(s),!0}catch{return i(l.FONT_COMMAND_NAME,e)}}return i(l.FONT_COMMAND_NAME,t)},Q=t=>{t.classList.remove(r.LIST_CLASS_DASH,r.LIST_CLASS_ALPHA),t.style.removeProperty("list-style-type")},X=t=>{t===r.LIST_VALUE_BULLET||t===r.LIST_VALUE_DASH?i(S):i(m);const e=window.getSelection();let n=(e==null?void 0:e.anchorNode)??null,s=null;for(;n;){if(n instanceof HTMLElement&&(n.tagName===r.LIST_TAG_UL||n.tagName===r.LIST_TAG_OL)){s=n;break}n=n.parentNode}return s&&(Q(s),t===r.LIST_VALUE_BULLET?s.style.listStyleType=r.LIST_STYLE_DISC:t===r.LIST_VALUE_DASH?s.classList.add(r.LIST_CLASS_DASH):t===r.LIST_VALUE_NUMBERS?s.style.listStyleType=r.LIST_STYLE_DECIMAL:t===r.LIST_VALUE_LETTERS&&(s.classList.add(r.LIST_CLASS_ALPHA),s.style.listStyleType=r.LIST_STYLE_LOWER_ALPHA)),!0},z=()=>{const t=window.getSelection();let e=(t==null?void 0:t.anchorNode)??null;for(;e;){if(e instanceof HTMLElement){if(e.tagName===r.LIST_TAG_UL)return e.classList.contains(r.LIST_CLASS_DASH)?r.LIST_VALUE_DASH:r.LIST_VALUE_BULLET;if(e.tagName===r.LIST_TAG_OL)return e.classList.contains(r.LIST_CLASS_ALPHA)||e.style.listStyleType===r.LIST_STYLE_LOWER_ALPHA?r.LIST_VALUE_LETTERS:r.LIST_VALUE_NUMBERS}e=e.parentNode}return r.LIST_VALUE_BULLET},J=(t,e)=>{const o=window.getSelection(),n=p.getBlockElement((o==null?void 0:o.anchorNode)??null,t);return n?(n.setAttribute(R.DIR_ATTRIBUTE,e),!0):!1},tt=t=>{if(t.key!==r.LIST_MARKDOWN_SPACE)return!1;const e=window.getSelection();if(!e||!e.isCollapsed||e.rangeCount===a.NUMBER_ZERO)return!1;const o=e.anchorNode;if(!o||o.nodeType!==U)return!1;const n=o.textContent??"",s=e.anchorOffset,T=n.slice(a.NUMBER_ZERO,s),E=T.endsWith(r.LIST_MARKDOWN_DASH)?r.LIST_MARKDOWN_DASH:T.endsWith(r.LIST_MARKDOWN_STAR)?r.LIST_MARKDOWN_STAR:null;if(!E)return!1;const L=s-E.length;if(L<a.NUMBER_ZERO)return!1;const u=L>a.NUMBER_ZERO?T[L-1]:"";if(u&&u!==`
|
|
2
|
+
`)return!1;t.preventDefault();const _=e.getRangeAt(a.NUMBER_ZERO);return _.setStart(o,L),_.setEnd(o,s),_.deleteContents(),i(S),!0};exports.applyFontFamily=j;exports.applyListType=X;exports.clearFormatDeep=$;exports.detectListType=z;exports.execCommand=i;exports.fileToDataUrl=Z;exports.getActiveFormats=G;exports.insertHTML=C;exports.insertImage=V;exports.insertLink=W;exports.queryCommandState=c;exports.queryCommandValue=B;exports.setBlockDirection=J;exports.setHighlightColor=K;exports.setTextColor=x;exports.stripSelectionColors=N;exports.tryConvertMarkdownListPrefix=tt;
|
|
@@ -3,7 +3,7 @@ import { DIR_LTR, DIR_RTL } from '../../../constants';
|
|
|
3
3
|
export declare const execCommand: (command: string, value?: string) => boolean;
|
|
4
4
|
export declare const queryCommandState: (command: string) => boolean;
|
|
5
5
|
export declare const queryCommandValue: (command: string) => string;
|
|
6
|
-
export declare const insertLink: (url: string) => boolean;
|
|
6
|
+
export declare const insertLink: (url: string, fallbackText?: string) => boolean;
|
|
7
7
|
export declare const setTextColor: (color: string) => boolean;
|
|
8
8
|
export declare const setHighlightColor: (color: string) => boolean;
|
|
9
9
|
export declare const insertHTML: (html: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,OAAO,EACP,OAAO,EAqBR,MAAM,oBAAoB,CAAC;AAiB5B,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OACjB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,OACf,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACf,CAAC;
|
|
1
|
+
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InkEditor/helpers/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,OAAO,EACP,OAAO,EAqBR,MAAM,oBAAoB,CAAC;AAiB5B,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OACjB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,OACf,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACf,CAAC;AAiBtC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,qBAAiB,KAAG,OAa3D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAA0C,CAAC;AAExF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,OAA4C,CAAC;AAE/F,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAA0C,CAAC;AAErF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,YAAQ,KAAG,OAGnD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,OAAO,CAAC,MAAM,CAMrD,CAAC;AAEL,eAAO,MAAM,gBAAgB,QAAO,GAAG,CAAC,MAAM,CAW7C,CAAC;AAeF,eAAO,MAAM,oBAAoB,QAAO,IAkBvC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAIlC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,KAAG,OAmBnD,CAAC;AAOF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,OAgCjD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,MAsBjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,WAAW,EACjB,WAAW,OAAO,OAAO,GAAG,OAAO,OAAO,KACzC,OAMF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,OAAO,aAAa,KAAG,OA4BnE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,OAUxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,aAAa,KAAG,OA6BnD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NUMBER_ZERO as i } from "../../../constants/numbers.js";
|
|
2
|
-
import { FONT_VALUE_SYSTEM as
|
|
3
|
-
import { LIST_TAG_UL as N, LIST_CLASS_DASH as
|
|
2
|
+
import { FONT_VALUE_SYSTEM as P, FONT_FAMILY_BY_VALUE as w, FONT_COMMAND_NAME as d, FONT_STYLE_PROPERTY as U } from "../../../constants/fonts.const.js";
|
|
3
|
+
import { LIST_TAG_UL as N, LIST_CLASS_DASH as _, LIST_VALUE_DASH as u, LIST_VALUE_BULLET as l, LIST_TAG_OL as R, LIST_CLASS_ALPHA as f, LIST_STYLE_LOWER_ALPHA as M, LIST_VALUE_LETTERS as I, LIST_VALUE_NUMBERS as h, LIST_MARKDOWN_SPACE as Y, LIST_MARKDOWN_DASH as E, LIST_MARKDOWN_STAR as A, LIST_STYLE_DISC as H, LIST_STYLE_DECIMAL as b } from "../../../constants/lists.const.js";
|
|
4
4
|
import { DIR_ATTRIBUTE as k } from "../../../constants/blocks.const.js";
|
|
5
5
|
import "../../../constants/openai.const.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
@@ -8,112 +8,112 @@ import { getBlockElement as F } from "../../../utils/blocks.utils.js";
|
|
|
8
8
|
import "../../../utils/paste.utils.js";
|
|
9
9
|
import "react";
|
|
10
10
|
import "react-dom";
|
|
11
|
-
const
|
|
11
|
+
const v = "color", B = "background-color", W = "background", C = "color", y = "style", x = 1, K = 3, q = "removeFormat", S = "insertUnorderedList", D = "insertOrderedList", $ = "superscript", G = "subscript", V = "styleWithCSS", s = (t, e) => document.execCommand(t, !1, e), c = (t) => document.queryCommandState(t), _t = (t) => document.queryCommandValue(t), Q = "http://", O = "https://", X = "mailto:", Z = "&", j = "<", z = ">", J = """, tt = (t) => t.replace(/&/g, Z).replace(/</g, j).replace(/>/g, z).replace(/"/g, J), ft = (t, e = "") => {
|
|
12
12
|
if (!t) return !1;
|
|
13
|
-
const
|
|
14
|
-
return s("
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
},
|
|
13
|
+
const n = t.startsWith(Q) || t.startsWith(O) || t.startsWith(X) ? t : `${O}${t}`, r = window.getSelection();
|
|
14
|
+
return (!r || r.isCollapsed) && e ? s("insertHTML", `<a href="${n}">${tt(e)}</a>`) : s("createLink", n);
|
|
15
|
+
}, St = (t) => s("foreColor", t), mt = (t) => s("hiliteColor", t), et = (t) => s("insertHTML", t), pt = (t, e = "") => {
|
|
16
|
+
const n = e.replace(/"/g, """);
|
|
17
|
+
return et(`<img src="${t}" alt="${n}" style="max-width:100%;height:auto;" />`);
|
|
18
|
+
}, Et = (t) => new Promise((e, n) => {
|
|
19
19
|
const r = new FileReader();
|
|
20
|
-
r.onload = () => e(String(r.result)), r.onerror =
|
|
21
|
-
}),
|
|
20
|
+
r.onload = () => e(String(r.result)), r.onerror = n, r.readAsDataURL(t);
|
|
21
|
+
}), At = () => {
|
|
22
22
|
const t = /* @__PURE__ */ new Set();
|
|
23
|
-
return c("bold") && t.add("bold"), c("italic") && t.add("italic"), c("underline") && t.add("underline"), c("strikeThrough") && t.add("strikethrough"), c(
|
|
23
|
+
return c("bold") && t.add("bold"), c("italic") && t.add("italic"), c("underline") && t.add("underline"), c("strikeThrough") && t.add("strikethrough"), c(S) && t.add("bulletList"), c(D) && t.add("orderedList"), c($) && t.add("superscript"), c(G) && t.add("subscript"), t;
|
|
24
24
|
}, g = (t) => {
|
|
25
|
-
t.style.removeProperty(
|
|
26
|
-
const e = t.getAttribute(
|
|
27
|
-
e !== null && !e.trim() && t.removeAttribute(
|
|
28
|
-
},
|
|
25
|
+
t.style.removeProperty(v), t.style.removeProperty(B), t.style.removeProperty(W), t.hasAttribute(C) && t.removeAttribute(C);
|
|
26
|
+
const e = t.getAttribute(y);
|
|
27
|
+
e !== null && !e.trim() && t.removeAttribute(y);
|
|
28
|
+
}, rt = () => {
|
|
29
29
|
const t = window.getSelection();
|
|
30
30
|
if (!t || t.rangeCount === i) return;
|
|
31
|
-
const
|
|
32
|
-
r && (r instanceof HTMLElement && t.containsNode(r, !0) && g(r), r.querySelectorAll("*").forEach((
|
|
33
|
-
|
|
31
|
+
const n = t.getRangeAt(i).commonAncestorContainer, r = n.nodeType === x ? n : n.parentElement;
|
|
32
|
+
r && (r instanceof HTMLElement && t.containsNode(r, !0) && g(r), r.querySelectorAll("*").forEach((o) => {
|
|
33
|
+
o instanceof HTMLElement && t.containsNode(o, !0) && g(o);
|
|
34
34
|
}));
|
|
35
|
-
},
|
|
35
|
+
}, Ct = () => {
|
|
36
36
|
const t = s(q);
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
const e =
|
|
40
|
-
if (s(
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
return s(
|
|
44
|
-
const r =
|
|
45
|
-
|
|
37
|
+
return rt(), t;
|
|
38
|
+
}, yt = (t) => {
|
|
39
|
+
const e = w[t] ?? t;
|
|
40
|
+
if (s(V, "true"), t === P) {
|
|
41
|
+
const n = window.getSelection();
|
|
42
|
+
if (!n || n.rangeCount === i || n.isCollapsed)
|
|
43
|
+
return s(d, e);
|
|
44
|
+
const r = n.getRangeAt(i), o = document.createElement("span");
|
|
45
|
+
o.style.setProperty(U, e);
|
|
46
46
|
try {
|
|
47
|
-
return r.surroundContents(
|
|
47
|
+
return r.surroundContents(o), !0;
|
|
48
48
|
} catch {
|
|
49
|
-
return s(
|
|
49
|
+
return s(d, e);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return s(
|
|
53
|
-
},
|
|
54
|
-
t.classList.remove(
|
|
55
|
-
},
|
|
56
|
-
s(t === l || t === u ?
|
|
52
|
+
return s(d, t);
|
|
53
|
+
}, nt = (t) => {
|
|
54
|
+
t.classList.remove(_, f), t.style.removeProperty("list-style-type");
|
|
55
|
+
}, Ot = (t) => {
|
|
56
|
+
s(t === l || t === u ? S : D);
|
|
57
57
|
const e = window.getSelection();
|
|
58
|
-
let r = (e == null ? void 0 : e.anchorNode) ?? null,
|
|
58
|
+
let r = (e == null ? void 0 : e.anchorNode) ?? null, o = null;
|
|
59
59
|
for (; r; ) {
|
|
60
|
-
if (r instanceof HTMLElement && (r.tagName === N || r.tagName ===
|
|
61
|
-
|
|
60
|
+
if (r instanceof HTMLElement && (r.tagName === N || r.tagName === R)) {
|
|
61
|
+
o = r;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
r = r.parentNode;
|
|
65
65
|
}
|
|
66
|
-
return
|
|
67
|
-
},
|
|
66
|
+
return o && (nt(o), t === l ? o.style.listStyleType = H : t === u ? o.classList.add(_) : t === h ? o.style.listStyleType = b : t === I && (o.classList.add(f), o.style.listStyleType = M)), !0;
|
|
67
|
+
}, gt = () => {
|
|
68
68
|
const t = window.getSelection();
|
|
69
69
|
let e = (t == null ? void 0 : t.anchorNode) ?? null;
|
|
70
70
|
for (; e; ) {
|
|
71
71
|
if (e instanceof HTMLElement) {
|
|
72
72
|
if (e.tagName === N)
|
|
73
|
-
return e.classList.contains(
|
|
74
|
-
if (e.tagName ===
|
|
75
|
-
return e.classList.contains(
|
|
73
|
+
return e.classList.contains(_) ? u : l;
|
|
74
|
+
if (e.tagName === R)
|
|
75
|
+
return e.classList.contains(f) || e.style.listStyleType === M ? I : h;
|
|
76
76
|
}
|
|
77
77
|
e = e.parentNode;
|
|
78
78
|
}
|
|
79
79
|
return l;
|
|
80
|
-
},
|
|
81
|
-
const
|
|
80
|
+
}, Nt = (t, e) => {
|
|
81
|
+
const n = window.getSelection(), r = F((n == null ? void 0 : n.anchorNode) ?? null, t);
|
|
82
82
|
return r ? (r.setAttribute(k, e), !0) : !1;
|
|
83
|
-
},
|
|
84
|
-
if (t.key !==
|
|
83
|
+
}, Rt = (t) => {
|
|
84
|
+
if (t.key !== Y) return !1;
|
|
85
85
|
const e = window.getSelection();
|
|
86
86
|
if (!e || !e.isCollapsed || e.rangeCount === i)
|
|
87
87
|
return !1;
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
90
|
-
const r =
|
|
91
|
-
if (!
|
|
92
|
-
const a =
|
|
88
|
+
const n = e.anchorNode;
|
|
89
|
+
if (!n || n.nodeType !== K) return !1;
|
|
90
|
+
const r = n.textContent ?? "", o = e.anchorOffset, T = r.slice(i, o), m = T.endsWith(E) ? E : T.endsWith(A) ? A : null;
|
|
91
|
+
if (!m) return !1;
|
|
92
|
+
const a = o - m.length;
|
|
93
93
|
if (a < i) return !1;
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
94
|
+
const p = a > i ? T[a - 1] : "";
|
|
95
|
+
if (p && p !== `
|
|
96
96
|
`) return !1;
|
|
97
97
|
t.preventDefault();
|
|
98
|
-
const
|
|
99
|
-
return
|
|
98
|
+
const L = e.getRangeAt(i);
|
|
99
|
+
return L.setStart(n, a), L.setEnd(n, o), L.deleteContents(), s(S), !0;
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
yt as applyFontFamily,
|
|
103
|
+
Ot as applyListType,
|
|
104
|
+
Ct as clearFormatDeep,
|
|
105
|
+
gt as detectListType,
|
|
106
106
|
s as execCommand,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
Et as fileToDataUrl,
|
|
108
|
+
At as getActiveFormats,
|
|
109
|
+
et as insertHTML,
|
|
110
|
+
pt as insertImage,
|
|
111
|
+
ft as insertLink,
|
|
112
112
|
c as queryCommandState,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
_t as queryCommandValue,
|
|
114
|
+
Nt as setBlockDirection,
|
|
115
|
+
mt as setHighlightColor,
|
|
116
|
+
St as setTextColor,
|
|
117
|
+
rt as stripSelectionColors,
|
|
118
|
+
Rt as tryConvertMarkdownListPrefix
|
|
119
119
|
};
|
|
@@ -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"}
|