@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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as l, jsxs as c, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useEffect as b } from "react";
|
|
3
|
+
import { Modal as g, Button as h } from "@forgedevstack/bear";
|
|
4
|
+
import { NUMBER_ZERO as d, NUMBER_ONE as m } from "../../../../constants/numbers.js";
|
|
5
|
+
import { INK_GRAPH_COLORS_TITLE as M, INK_GRAPH_VALUES_TITLE as L, INK_GRAPH_ADD_POINT as O, EMPTY_STRING as k, INK_GRAPH_CANCEL as T, INK_GRAPH_APPLY as H } from "../../../../constants/generals.const.js";
|
|
6
|
+
import "../../../../constants/openai.const.js";
|
|
7
|
+
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import { GRAPH_COLORS as G } from "../../../../plugins/graph/graph.const.js";
|
|
10
|
+
const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
11
|
+
const { open: u, mode: v, points: _, colors: r, onClose: N, onApply: A } = R, [f, p] = P(_), [C, I] = P(
|
|
12
|
+
r.length > d ? r : [...G]
|
|
13
|
+
);
|
|
14
|
+
return b(() => {
|
|
15
|
+
u && (p(_), I(r.length > d ? r : [...G]));
|
|
16
|
+
}, [u, _, r]), /* @__PURE__ */ l(
|
|
17
|
+
g,
|
|
18
|
+
{
|
|
19
|
+
isOpen: u,
|
|
20
|
+
onClose: N,
|
|
21
|
+
title: v === "colors" ? M : L,
|
|
22
|
+
size: "md",
|
|
23
|
+
footer: /* @__PURE__ */ c(E, { children: [
|
|
24
|
+
/* @__PURE__ */ l(h, { variant: "outline", onClick: N, children: T }),
|
|
25
|
+
/* @__PURE__ */ l(h, { variant: "primary", onClick: () => A(f, C), children: H })
|
|
26
|
+
] }),
|
|
27
|
+
children: v === "values" ? /* @__PURE__ */ c("div", { className: "Ink-GraphModal", children: [
|
|
28
|
+
f.map((e, a) => /* @__PURE__ */ c("div", { className: "Ink-GraphModal__row", children: [
|
|
29
|
+
/* @__PURE__ */ l(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
value: e.label,
|
|
33
|
+
"aria-label": `Label ${a + m}`,
|
|
34
|
+
onChange: (t) => {
|
|
35
|
+
const n = t.target.value;
|
|
36
|
+
p(
|
|
37
|
+
(s) => s.map(
|
|
38
|
+
(o, i) => i === a ? { ...o, label: n } : o
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ l(
|
|
45
|
+
"input",
|
|
46
|
+
{
|
|
47
|
+
type: "number",
|
|
48
|
+
value: e.value,
|
|
49
|
+
"aria-label": `Value ${a + m}`,
|
|
50
|
+
onChange: (t) => {
|
|
51
|
+
const n = Number(t.target.value) || d;
|
|
52
|
+
p(
|
|
53
|
+
(s) => s.map(
|
|
54
|
+
(o, i) => i === a ? { ...o, value: n } : o
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }, `${e.label}-${a}`)),
|
|
61
|
+
/* @__PURE__ */ l(
|
|
62
|
+
h,
|
|
63
|
+
{
|
|
64
|
+
variant: "outline",
|
|
65
|
+
size: "sm",
|
|
66
|
+
onClick: () => p((e) => [...e, $()]),
|
|
67
|
+
children: O
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] }) : /* @__PURE__ */ l("div", { className: "Ink-GraphModal", children: C.map((e, a) => /* @__PURE__ */ c("label", { className: "Ink-GraphModal__row", children: [
|
|
71
|
+
/* @__PURE__ */ l("span", { children: a + m }),
|
|
72
|
+
/* @__PURE__ */ l(
|
|
73
|
+
"input",
|
|
74
|
+
{
|
|
75
|
+
type: "color",
|
|
76
|
+
value: e,
|
|
77
|
+
onChange: (t) => {
|
|
78
|
+
const n = t.target.value || k;
|
|
79
|
+
I(
|
|
80
|
+
(s) => s.map((o, i) => i === a ? n : o)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }, `${e}-${a}`)) })
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
Y as GraphEditModal
|
|
91
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphColors, GraphPoint } from '../../../../plugins/graph';
|
|
2
|
+
export type GraphEditMode = 'values' | 'colors';
|
|
3
|
+
export type GraphEditModalProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
mode: GraphEditMode;
|
|
6
|
+
points: GraphPoint[];
|
|
7
|
+
colors: GraphColors;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onApply: (points: GraphPoint[], colors: GraphColors) => void;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=GraphEditModal.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphEditModal.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphEditModal/GraphEditModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphEditModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),K=require("react-dom"),A=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),D=require("../../../../constants/colorMode.const.cjs"),M=require("../../../../constants/keyboard.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const s=require("../../../../plugins/graph/graph.const.cjs"),p=require("../../../../plugins/graph/graph.utils.cjs"),h=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),q=require("../ToolbarButton/ToolbarButton.cjs"),g=N=>{const{icon:v,disabled:d=!1,hint:I,onHint:T,pluginColor:b,onInsert:w}=N,[c,i]=n.useState(!1),[l,G]=n.useState(s.GRAPH_KIND_DEFAULT),[_,H]=n.useState({top:A.NUMBER_ZERO,left:A.NUMBER_ZERO}),E=n.useRef(null),L=n.useRef(null),S=n.useRef(null);return n.useEffect(()=>{if(!c)return;const e=()=>{const r=h.getToolbarDropdownMenuPosition(L.current);H({top:r.top,left:r.left})};e();const u=r=>{var m,P;const R=r.target;(m=E.current)!=null&&m.contains(R)||(P=S.current)!=null&&P.contains(R)||i(!1)},f=r=>{r.key===M.KEY_ESCAPE&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",f),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",f),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[c]),t.jsxs("div",{className:o.INK_CLASS_STYLE_DD,ref:E,children:[t.jsx("div",{ref:L,children:t.jsx(q.ToolbarButton,{icon:v,title:a.INK_GRAPH_TITLE,hint:I,onHint:T,pluginColor:b,disabled:d,onClick:()=>{d||i(e=>!e)}})}),c?K.createPortal(t.jsxs("div",{ref:S,className:`${o.INK_CLASS_STYLE_MENU} ${o.INK_CLASS_STYLE_MENU_PORTAL} ${o.INK_CLASS_STYLE_MENU_FORCED} ${o.INK_CLASS_GRAPH_PANEL}`,"data-color-mode":D.COLOR_MODE_LIGHT,role:"dialog","aria-label":a.INK_GRAPH_TITLE,style:{top:_.top,left:_.left},children:[t.jsx("div",{className:o.INK_CLASS_GRAPH_TYPES,children:s.GRAPH_KINDS.map(e=>t.jsx("button",{type:"button","aria-pressed":e===l,onMouseDown:u=>{u.preventDefault(),G(e)},children:s.GRAPH_KIND_LABELS[e]},e))}),t.jsx("div",{className:o.INK_CLASS_GRAPH_PREVIEW,dangerouslySetInnerHTML:{__html:p.buildGraphHtml(l,s.GRAPH_SAMPLE)}}),t.jsx("button",{type:"button",onMouseDown:e=>{e.preventDefault(),w(p.buildGraphHtml(l,s.GRAPH_SAMPLE)),i(!1)},children:a.INK_GRAPH_INSERT})]}),document.body):null]})};exports.GraphPicker=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphPicker/GraphPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AA0B7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAiG5C,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsxs as S, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useRef as m, useEffect as G } from "react";
|
|
3
|
+
import { createPortal as M } from "react-dom";
|
|
4
|
+
import { NUMBER_ZERO as A } from "../../../../constants/numbers.js";
|
|
5
|
+
import { INK_GRAPH_TITLE as N, INK_GRAPH_INSERT as b } from "../../../../constants/generals.const.js";
|
|
6
|
+
import { COLOR_MODE_LIGHT as h } from "../../../../constants/colorMode.const.js";
|
|
7
|
+
import { KEY_ESCAPE as y } from "../../../../constants/keyboard.const.js";
|
|
8
|
+
import { INK_CLASS_STYLE_DD as g, INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as Y, INK_CLASS_GRAPH_PANEL as U, INK_CLASS_GRAPH_TYPES as $, INK_CLASS_GRAPH_PREVIEW as B } from "../../../../constants/defaults.const.js";
|
|
9
|
+
import "../../../../constants/openai.const.js";
|
|
10
|
+
import "../../../../utils/paste.utils.js";
|
|
11
|
+
import { GRAPH_KIND_DEFAULT as j, GRAPH_KINDS as z, GRAPH_KIND_LABELS as F, GRAPH_SAMPLE as P } from "../../../../plugins/graph/graph.const.js";
|
|
12
|
+
import { buildGraphHtml as v } from "../../../../plugins/graph/graph.utils.js";
|
|
13
|
+
import { getToolbarDropdownMenuPosition as x } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
14
|
+
import { ToolbarButton as V } from "../ToolbarButton/ToolbarButton.js";
|
|
15
|
+
const me = (R) => {
|
|
16
|
+
const { icon: I, disabled: d = !1, hint: w, onHint: K, pluginColor: T, onInsert: D } = R, [i, n] = l(!1), [s, H] = l(j), [a, C] = l({ top: A, left: A }), c = m(null), u = m(null), _ = m(null);
|
|
17
|
+
return G(() => {
|
|
18
|
+
if (!i) return;
|
|
19
|
+
const e = () => {
|
|
20
|
+
const t = x(u.current);
|
|
21
|
+
C({ top: t.top, left: t.left });
|
|
22
|
+
};
|
|
23
|
+
e();
|
|
24
|
+
const r = (t) => {
|
|
25
|
+
var E, L;
|
|
26
|
+
const p = t.target;
|
|
27
|
+
(E = c.current) != null && E.contains(p) || (L = _.current) != null && L.contains(p) || n(!1);
|
|
28
|
+
}, f = (t) => {
|
|
29
|
+
t.key === y && n(!1);
|
|
30
|
+
};
|
|
31
|
+
return document.addEventListener("mousedown", r), document.addEventListener("keydown", f), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
32
|
+
document.removeEventListener("mousedown", r), document.removeEventListener("keydown", f), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
33
|
+
};
|
|
34
|
+
}, [i]), /* @__PURE__ */ S("div", { className: g, ref: c, children: [
|
|
35
|
+
/* @__PURE__ */ o("div", { ref: u, children: /* @__PURE__ */ o(
|
|
36
|
+
V,
|
|
37
|
+
{
|
|
38
|
+
icon: I,
|
|
39
|
+
title: N,
|
|
40
|
+
hint: w,
|
|
41
|
+
onHint: K,
|
|
42
|
+
pluginColor: T,
|
|
43
|
+
disabled: d,
|
|
44
|
+
onClick: () => {
|
|
45
|
+
d || n((e) => !e);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
i ? M(
|
|
50
|
+
/* @__PURE__ */ S(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref: _,
|
|
54
|
+
className: `${O} ${k} ${Y} ${U}`,
|
|
55
|
+
"data-color-mode": h,
|
|
56
|
+
role: "dialog",
|
|
57
|
+
"aria-label": N,
|
|
58
|
+
style: { top: a.top, left: a.left },
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ o("div", { className: $, children: z.map((e) => /* @__PURE__ */ o(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
type: "button",
|
|
64
|
+
"aria-pressed": e === s,
|
|
65
|
+
onMouseDown: (r) => {
|
|
66
|
+
r.preventDefault(), H(e);
|
|
67
|
+
},
|
|
68
|
+
children: F[e]
|
|
69
|
+
},
|
|
70
|
+
e
|
|
71
|
+
)) }),
|
|
72
|
+
/* @__PURE__ */ o(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: B,
|
|
76
|
+
dangerouslySetInnerHTML: { __html: v(s, P) }
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ o(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
onMouseDown: (e) => {
|
|
84
|
+
e.preventDefault(), D(v(s, P)), n(!1);
|
|
85
|
+
},
|
|
86
|
+
children: b
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
document.body
|
|
93
|
+
) : null
|
|
94
|
+
] });
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
me as GraphPicker
|
|
98
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type GraphPickerProps = {
|
|
3
|
+
icon: ReactNode;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
hint?: string;
|
|
6
|
+
onHint?: (hint: string) => void;
|
|
7
|
+
pluginColor?: string;
|
|
8
|
+
onInsert: (html: string) => void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=GraphPicker.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphPicker.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphPicker/GraphPicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/GraphPicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("../../../../constants/generals.const.cjs"),i=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const c=e=>{const{value:r,onChange:t,disabled:a=!1,minHeight:n}=e,l=s=>{t(s.target.value)};return u.jsx("textarea",{className:i.INK_CLASS_SOURCE,"aria-label":o.INK_HTML_SOURCE_TITLE,value:r,disabled:a,spellCheck:!1,style:{minHeight:n},onChange:l})};exports.HtmlSourcePanel=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlSourcePanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkBpD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { INK_HTML_SOURCE_TITLE as m } from "../../../../constants/generals.const.js";
|
|
3
|
+
import { INK_CLASS_SOURCE as i } from "../../../../constants/defaults.const.js";
|
|
4
|
+
import "../../../../constants/openai.const.js";
|
|
5
|
+
import "../../../../utils/paste.utils.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const _ = (e) => {
|
|
9
|
+
const { value: a, onChange: t, disabled: o = !1, minHeight: r } = e;
|
|
10
|
+
return /* @__PURE__ */ n(
|
|
11
|
+
"textarea",
|
|
12
|
+
{
|
|
13
|
+
className: i,
|
|
14
|
+
"aria-label": m,
|
|
15
|
+
value: a,
|
|
16
|
+
disabled: o,
|
|
17
|
+
spellCheck: !1,
|
|
18
|
+
style: { minHeight: r },
|
|
19
|
+
onChange: (l) => {
|
|
20
|
+
t(l.target.value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
_ as HtmlSourcePanel
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlSourcePanel.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/HtmlSourcePanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -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"),i=require("../../../../constants/numbers.cjs"),e=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const L=t=>{const{items:_,activeIndex:I,onSelect:r,onHide:l}=t;return s.jsxs("aside",{className:e.INK_CLASS_OUTLINE,"aria-label":e.INK_OUTLINE_LABEL,children:[s.jsxs("div",{className:e.INK_CLASS_OUTLINE_LABEL,children:[e.INK_OUTLINE_LABEL,l?s.jsx("button",{type:"button",className:e.INK_CLASS_OUTLINE_TOGGLE,onClick:l,children:e.INK_OUTLINE_HIDE}):null]}),_.length===i.NUMBER_ZERO?s.jsx("p",{className:e.INK_CLASS_OUTLINE_ITEM,children:e.INK_OUTLINE_EMPTY}):null,_.map(n=>{const N=n.index===I;return s.jsxs("button",{type:"button",className:`${e.INK_CLASS_OUTLINE_ITEM} ${e.INK_CLASS_OUTLINE_ITEM}--h${n.level}${N?` ${e.INK_CLASS_OUTLINE_ITEM_ACTIVE}`:""}`,onClick:()=>r(n.index),children:[s.jsx("span",{className:`${e.INK_CLASS_OUTLINE_ITEM}-dot`,"aria-hidden":"true"}),n.text]},`${n.level}-${n.index}`)})]})};exports.OutlineRail=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutlineRail.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/OutlineRail/OutlineRail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OutlineRail.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/OutlineRail/OutlineRail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAiC5C,CAAC"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as t, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { NUMBER_ZERO as I } from "../../../../constants/numbers.js";
|
|
3
|
+
import { INK_OUTLINE_LABEL as r, INK_CLASS_OUTLINE as c, INK_CLASS_OUTLINE_LABEL as E, INK_OUTLINE_HIDE as L, INK_CLASS_OUTLINE_TOGGLE as d, INK_OUTLINE_EMPTY as m, INK_CLASS_OUTLINE_ITEM as n, INK_CLASS_OUTLINE_ITEM_ACTIVE as p } from "../../../../constants/defaults.const.js";
|
|
3
4
|
import "../../../../constants/openai.const.js";
|
|
4
5
|
import "../../../../utils/paste.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const x = (
|
|
8
|
-
const { items:
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const x = (N) => {
|
|
9
|
+
const { items: i, activeIndex: a, onSelect: s, onHide: o } = N;
|
|
10
|
+
return /* @__PURE__ */ t("aside", { className: c, "aria-label": r, children: [
|
|
11
|
+
/* @__PURE__ */ t("div", { className: E, children: [
|
|
12
|
+
r,
|
|
13
|
+
o ? /* @__PURE__ */ l("button", { type: "button", className: d, onClick: o, children: L }) : null
|
|
14
|
+
] }),
|
|
15
|
+
i.length === I ? /* @__PURE__ */ l("p", { className: n, children: m }) : null,
|
|
16
|
+
i.map((e) => {
|
|
17
|
+
const _ = e.index === a;
|
|
18
|
+
return /* @__PURE__ */ t(
|
|
14
19
|
"button",
|
|
15
20
|
{
|
|
16
21
|
type: "button",
|
|
17
|
-
className: `${
|
|
18
|
-
onClick: () =>
|
|
22
|
+
className: `${n} ${n}--h${e.level}${_ ? ` ${p}` : ""}`,
|
|
23
|
+
onClick: () => s(e.index),
|
|
19
24
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ l("span", { className: `${n}-dot`, "aria-hidden": "true" }),
|
|
21
26
|
e.text
|
|
22
27
|
]
|
|
23
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutlineRail.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/OutlineRail/OutlineRail.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"OutlineRail.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/OutlineRail/OutlineRail.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./PresenceStack.const.cjs"),r=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");const o=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");const S=require("../../../../utils/collab.utils.cjs"),A=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const E=require("../../../../constants/collab.const.cjs"),k=n=>n.avatarUrl?s.jsx("img",{src:n.avatarUrl,alt:n.name,className:"ink-presence-avatar-img"}):s.jsx("span",{className:"ink-presence-initials",children:S.getCollaboratorInitials(n.name)}),v=n=>{const{collaborators:i,maxAvatars:u=a.INK_PRESENCE_DEFAULT_MAX_AVATARS,onFollow:l,className:N=c.EMPTY_STRING}=n;if(!i||i.length===r.NUMBER_ZERO)return null;const R=i.slice(r.NUMBER_ZERO,u),t=Math.max(r.NUMBER_ZERO,i.length-u);return s.jsx("div",{className:o.cn("ink-presence-stack",N),role:"region","aria-label":a.COLLAB_ARIA_REGION,children:s.jsxs("div",{className:"ink-presence-avatars",children:[R.map(e=>{const _=e.status===E.INK_STATUS_IDLE,m=e.role||E.INK_ROLE_EDITOR,d=_?a.IDLE_LABEL_SUFFIX:c.EMPTY_STRING,I=`${e.name} (${m})${d}`;return s.jsxs(A.Button,{type:"button",className:"ink-presence-avatar-btn",style:{backgroundColor:e.color},title:I,onClick:()=>l==null?void 0:l(e),"aria-label":`${a.COLLAB_ARIA_LABEL_PREFIX}${e.name}`,children:[k(e),s.jsx("span",{className:o.cn("ink-presence-status-dot",_?"ink-presence-idle":"ink-presence-active")})]},e.id)}),t>r.NUMBER_ZERO&&s.jsxs("div",{className:"ink-presence-avatar-overflow",title:`${t} more collaborator${t>r.NUMBER_ONE?"s":c.EMPTY_STRING}`,"aria-label":`${t} more collaborator${t>r.NUMBER_ONE?"s":c.EMPTY_STRING}`,children:[a.PLUS_SIGN,t]})]})})};exports.PresenceStack=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../../../constants/numbers.cjs"),_=A.NUMBER_FOUR,L="+",E=" - Idle",I="Active collaborators",o="Collaborator ";exports.COLLAB_ARIA_LABEL_PREFIX=o;exports.COLLAB_ARIA_REGION=I;exports.IDLE_LABEL_SUFFIX=E;exports.INK_PRESENCE_DEFAULT_MAX_AVATARS=_;exports.PLUS_SIGN=L;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const INK_PRESENCE_DEFAULT_MAX_AVATARS = 4;
|
|
2
|
+
export declare const PLUS_SIGN = "+";
|
|
3
|
+
export declare const DEFAULT_INITIAL = "?";
|
|
4
|
+
export declare const IDLE_LABEL_SUFFIX = " - Idle";
|
|
5
|
+
export declare const COLLAB_ARIA_REGION = "Active collaborators";
|
|
6
|
+
export declare const COLLAB_ARIA_LABEL_PREFIX = "Collaborator ";
|
|
7
|
+
//# sourceMappingURL=PresenceStack.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenceStack.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/PresenceStack/PresenceStack.const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gCAAgC,IAAc,CAAC;AAC5D,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,wBAAwB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NUMBER_FOUR as o } from "../../../../constants/numbers.js";
|
|
2
|
+
const _ = o, L = "+", t = " - Idle", E = "Active collaborators", I = "Collaborator ";
|
|
3
|
+
export {
|
|
4
|
+
I as COLLAB_ARIA_LABEL_PREFIX,
|
|
5
|
+
E as COLLAB_ARIA_REGION,
|
|
6
|
+
t as IDLE_LABEL_SUFFIX,
|
|
7
|
+
_ as INK_PRESENCE_DEFAULT_MAX_AVATARS,
|
|
8
|
+
L as PLUS_SIGN
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenceStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/PresenceStack/PresenceStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAoChE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8DtD,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { getCollaboratorInitials as R } from "../../../../utils/collab.utils.js";
|
|
9
|
+
import { Button as S } from "../../../../common-components/Button/Button.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import { INK_STATUS_IDLE as h, INK_ROLE_EDITOR as C } from "../../../../constants/collab.const.js";
|
|
13
|
+
const $ = (t) => t.avatarUrl ? /* @__PURE__ */ i(
|
|
14
|
+
"img",
|
|
15
|
+
{
|
|
16
|
+
src: t.avatarUrl,
|
|
17
|
+
alt: t.name,
|
|
18
|
+
className: "ink-presence-avatar-img"
|
|
19
|
+
}
|
|
20
|
+
) : /* @__PURE__ */ i("span", { className: "ink-presence-initials", children: R(t.name) }), K = (t) => {
|
|
21
|
+
const {
|
|
22
|
+
collaborators: n,
|
|
23
|
+
maxAvatars: l = I,
|
|
24
|
+
onFollow: m,
|
|
25
|
+
className: N = a
|
|
26
|
+
} = t;
|
|
27
|
+
if (!n || n.length === s)
|
|
28
|
+
return null;
|
|
29
|
+
const E = n.slice(s, l), r = Math.max(s, n.length - l);
|
|
30
|
+
return /* @__PURE__ */ i(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: _("ink-presence-stack", N),
|
|
34
|
+
role: "region",
|
|
35
|
+
"aria-label": v,
|
|
36
|
+
children: /* @__PURE__ */ c("div", { className: "ink-presence-avatars", children: [
|
|
37
|
+
E.map((e) => {
|
|
38
|
+
const o = e.status === h, d = e.role || C, A = o ? L : a, u = `${e.name} (${d})${A}`;
|
|
39
|
+
return /* @__PURE__ */ c(
|
|
40
|
+
S,
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
className: "ink-presence-avatar-btn",
|
|
44
|
+
style: { backgroundColor: e.color },
|
|
45
|
+
title: u,
|
|
46
|
+
onClick: () => m == null ? void 0 : m(e),
|
|
47
|
+
"aria-label": `${f}${e.name}`,
|
|
48
|
+
children: [
|
|
49
|
+
$(e),
|
|
50
|
+
/* @__PURE__ */ i(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: _(
|
|
54
|
+
"ink-presence-status-dot",
|
|
55
|
+
o ? "ink-presence-idle" : "ink-presence-active"
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
e.id
|
|
62
|
+
);
|
|
63
|
+
}),
|
|
64
|
+
r > s && /* @__PURE__ */ c(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: "ink-presence-avatar-overflow",
|
|
68
|
+
title: `${r} more collaborator${r > p ? "s" : a}`,
|
|
69
|
+
"aria-label": `${r} more collaborator${r > p ? "s" : a}`,
|
|
70
|
+
children: [
|
|
71
|
+
k,
|
|
72
|
+
r
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] })
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
K as PresenceStack
|
|
82
|
+
};
|
|
@@ -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("react");require("react-dom");const T=({collaborators:c,className:u=l.EMPTY_STRING})=>{const n=(c||[]).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",u),"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"}
|