@forgedevstack/ink 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/common-components/Box/Box.cjs +1 -1
- package/dist/common-components/Box/Box.js +7 -6
- package/dist/common-components/Button/Button.cjs +1 -1
- package/dist/common-components/Button/Button.js +9 -8
- package/dist/common-components/Canvas/Canvas.cjs +1 -1
- package/dist/common-components/Canvas/Canvas.js +3 -2
- package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/common-components/ContextMenu/ContextMenu.js +3 -2
- package/dist/common-components/Field/Field.cjs +1 -1
- package/dist/common-components/Field/Field.js +11 -10
- package/dist/common-components/icons/GripIcon.cjs +1 -1
- package/dist/common-components/icons/GripIcon.js +3 -2
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +1308 -1028
- package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.js +13 -12
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.cjs +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.cjs +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts +20 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.const.js +25 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts +4 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.js +61 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts +11 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.cjs +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts +19 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.js +30 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts +2 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/AiSelectionBubble.utils.test.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts +4 -0
- package/dist/components/InkEditor/components/AiSelectionBubble/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +7 -6
- package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.cjs +1 -1
- package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts +2 -0
- package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/CommentsPanel/CommentsPanel.js +16 -15
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +84 -97
- package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
- package/dist/components/InkEditor/components/FindReplace/FindReplace.js +21 -20
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -1
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +17 -16
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -1
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +3 -2
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -1
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +7 -6
- package/dist/components/InkEditor/components/ImageFrame/ImageFrame.cjs +1 -0
- package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts +8 -0
- package/dist/components/InkEditor/components/ImageFrame/ImageFrame.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ImageFrame/ImageFrame.js +54 -0
- package/dist/components/InkEditor/components/ImageFrame/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ImageFrame/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -1
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +11 -10
- package/dist/components/InkEditor/components/MentionMenu/MentionMenu.cjs +1 -0
- package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts +16 -0
- package/dist/components/InkEditor/components/MentionMenu/MentionMenu.d.ts.map +1 -0
- package/dist/components/InkEditor/components/MentionMenu/MentionMenu.js +21 -0
- package/dist/components/InkEditor/components/MentionMenu/index.d.ts +3 -0
- package/dist/components/InkEditor/components/MentionMenu/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +11 -10
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -1
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +3 -2
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -1
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +6 -5
- package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/InkEditor/components/SignPad/SignPad.js +7 -6
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +7 -6
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -1
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +8 -7
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +38 -38
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +56 -39
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -1
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +3 -2
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +13 -12
- package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +9 -8
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +9 -8
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +9 -8
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +19 -18
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +6 -5
- package/dist/components/InkEditor/components/VersionHistory/VersionHistory.cjs +1 -0
- package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts +11 -0
- package/dist/components/InkEditor/components/VersionHistory/VersionHistory.d.ts.map +1 -0
- package/dist/components/InkEditor/components/VersionHistory/VersionHistory.js +22 -0
- package/dist/components/InkEditor/components/VersionHistory/index.d.ts +3 -0
- package/dist/components/InkEditor/components/VersionHistory/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/index.d.ts +7 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.cjs +3 -2
- package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -0
- package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.js +106 -84
- package/dist/components/InkEditor/helpers/index.d.ts +1 -1
- package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
- package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -1
- package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -1
- package/dist/components/InkWorkspace/InkWorkspace.js +136 -144
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -1
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +8 -7
- package/dist/constants/contextMenu.const.cjs +1 -1
- package/dist/constants/contextMenu.const.d.ts +8 -0
- package/dist/constants/contextMenu.const.d.ts.map +1 -1
- package/dist/constants/contextMenu.const.js +30 -22
- package/dist/constants/defaultIcons.cjs +1 -1
- package/dist/constants/defaultIcons.js +6 -5
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +150 -138
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.js +28 -27
- package/dist/constants/toolbar.const.cjs +1 -1
- package/dist/constants/toolbar.const.d.ts +7 -0
- package/dist/constants/toolbar.const.d.ts.map +1 -1
- package/dist/constants/toolbar.const.js +16 -9
- package/dist/constants/toolbarMenu.const.cjs +1 -1
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
- package/dist/constants/toolbarMenu.const.js +25 -11
- package/dist/hooks/useInkCollaboration.cjs +1 -1
- package/dist/hooks/useInkCollaboration.js +15 -14
- package/dist/hooks/useToolbarOverflow.cjs +1 -1
- package/dist/hooks/useToolbarOverflow.js +12 -11
- package/dist/index.cjs +1 -1
- package/dist/index.js +145 -144
- package/dist/plugins/ai/demoProvider.cjs +1 -1
- package/dist/plugins/ai/demoProvider.js +3 -2
- package/dist/plugins/ai/index.cjs +1 -1
- package/dist/plugins/ai/index.js +25 -24
- package/dist/plugins/excel/excel.utils.cjs +1 -1
- package/dist/plugins/excel/excel.utils.js +17 -16
- package/dist/plugins/graph/graph.utils.cjs +1 -1
- package/dist/plugins/graph/graph.utils.js +7 -6
- package/dist/plugins/theme/inkTheme.cjs +1 -1
- package/dist/plugins/theme/inkTheme.js +22 -19
- package/dist/plugins/titles/titles.const.cjs +1 -1
- package/dist/plugins/titles/titles.const.js +9 -8
- package/dist/plugins/titles/titles.utils.cjs +1 -1
- package/dist/plugins/titles/titles.utils.js +3 -2
- package/dist/styles.css +1 -1
- package/dist/types/collab.types.d.ts +0 -1
- package/dist/types/collab.types.d.ts.map +1 -1
- package/dist/types/features.types.d.ts +1 -1
- package/dist/types/features.types.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +1 -3
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/utils/blocks.utils.cjs +1 -1
- package/dist/utils/blocks.utils.js +19 -18
- package/dist/utils/collab.utils.cjs +1 -1
- package/dist/utils/collab.utils.js +7 -6
- package/dist/utils/comments.utils.cjs +1 -1
- package/dist/utils/comments.utils.d.ts +4 -0
- package/dist/utils/comments.utils.d.ts.map +1 -1
- package/dist/utils/comments.utils.js +26 -18
- package/dist/utils/comments.utils.test.d.ts +2 -0
- package/dist/utils/comments.utils.test.d.ts.map +1 -0
- package/dist/utils/exportDocument.utils.cjs +2 -0
- package/dist/utils/exportDocument.utils.d.ts +16 -0
- package/dist/utils/exportDocument.utils.d.ts.map +1 -0
- package/dist/utils/exportDocument.utils.js +85 -0
- package/dist/utils/exportDocument.utils.test.d.ts +2 -0
- package/dist/utils/exportDocument.utils.test.d.ts.map +1 -0
- package/dist/utils/formatPainter.utils.cjs +1 -0
- package/dist/utils/formatPainter.utils.d.ts +11 -0
- package/dist/utils/formatPainter.utils.d.ts.map +1 -0
- package/dist/utils/formatPainter.utils.js +20 -0
- package/dist/utils/formatPainter.utils.test.d.ts +2 -0
- package/dist/utils/formatPainter.utils.test.d.ts.map +1 -0
- package/dist/utils/history.utils.cjs +1 -1
- package/dist/utils/history.utils.js +3 -2
- package/dist/utils/image.utils.cjs +1 -0
- package/dist/utils/image.utils.d.ts +14 -0
- package/dist/utils/image.utils.d.ts.map +1 -0
- package/dist/utils/image.utils.js +33 -0
- package/dist/utils/image.utils.test.d.ts +2 -0
- package/dist/utils/image.utils.test.d.ts.map +1 -0
- package/dist/utils/index.d.ts +10 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/license.utils.cjs +1 -1
- package/dist/utils/license.utils.js +8 -7
- package/dist/utils/markdown.utils.cjs +11 -0
- package/dist/utils/markdown.utils.d.ts +7 -0
- package/dist/utils/markdown.utils.d.ts.map +1 -0
- package/dist/utils/markdown.utils.js +87 -0
- package/dist/utils/markdown.utils.test.d.ts +2 -0
- package/dist/utils/markdown.utils.test.d.ts.map +1 -0
- package/dist/utils/mentions.utils.cjs +1 -0
- package/dist/utils/mentions.utils.d.ts +13 -0
- package/dist/utils/mentions.utils.d.ts.map +1 -0
- package/dist/utils/mentions.utils.js +23 -0
- package/dist/utils/mentions.utils.test.d.ts +2 -0
- package/dist/utils/mentions.utils.test.d.ts.map +1 -0
- package/dist/utils/outline.utils.cjs +1 -1
- package/dist/utils/outline.utils.js +9 -8
- package/dist/utils/paste.utils.cjs +1 -1
- package/dist/utils/paste.utils.d.ts +2 -0
- package/dist/utils/paste.utils.d.ts.map +1 -1
- package/dist/utils/paste.utils.js +53 -19
- package/dist/utils/paste.utils.test.d.ts +2 -0
- package/dist/utils/paste.utils.test.d.ts.map +1 -0
- package/dist/utils/premium.utils.cjs +1 -1
- package/dist/utils/premium.utils.js +12 -11
- package/dist/utils/selection.utils.cjs +1 -1
- package/dist/utils/selection.utils.js +3 -2
- package/dist/utils/slash.utils.cjs +1 -1
- package/dist/utils/slash.utils.js +10 -9
- package/dist/utils/table.utils.cjs +1 -1
- package/dist/utils/table.utils.d.ts +8 -0
- package/dist/utils/table.utils.d.ts.map +1 -1
- package/dist/utils/table.utils.js +78 -54
- package/dist/utils/toolbarStorage.utils.cjs +1 -1
- package/dist/utils/toolbarStorage.utils.js +15 -14
- package/dist/utils/trackChanges.utils.cjs +1 -1
- package/dist/utils/trackChanges.utils.js +9 -8
- package/dist/utils/typo.utils.cjs +1 -1
- package/dist/utils/typo.utils.js +8 -7
- package/dist/utils/versions.utils.cjs +1 -0
- package/dist/utils/versions.utils.d.ts +11 -0
- package/dist/utils/versions.utils.d.ts.map +1 -0
- package/dist/utils/versions.utils.js +36 -0
- package/dist/utils/versions.utils.test.d.ts +2 -0
- package/dist/utils/versions.utils.test.d.ts.map +1 -0
- package/dist/utils/words.utils.cjs +1 -1
- package/dist/utils/words.utils.js +3 -2
- package/package.json +1 -1
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +0 -3
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +0 -1
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +0 -1
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +0 -13
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +0 -1
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +0 -39
|
@@ -1,138 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { NUMBER_ZERO as
|
|
5
|
-
import { INK_EXCEL_TITLE as
|
|
1
|
+
import { jsxs as _, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useRef as L, useEffect as j, Fragment as x } from "react";
|
|
3
|
+
import { createPortal as z } from "react-dom";
|
|
4
|
+
import { NUMBER_ZERO as i, NUMBER_ONE as m, INK_EXCEL_SHEET_MAX_ROWS as q, INK_EXCEL_SHEET_MAX_COLS as Z, INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX as J } from "../../../../constants/numbers.js";
|
|
5
|
+
import { INK_EXCEL_TITLE as v, INK_EXCEL_ADD_ROW as Q, INK_EXCEL_ADD_COL as ee, INK_EXCEL_REMOVE_ROW as te, INK_EXCEL_REMOVE_COL as ne, INK_EXCEL_CLEAR as oe, INK_EXCEL_IMPORT as re, INK_EXCEL_INSERT as le } from "../../../../constants/generals.const.js";
|
|
6
6
|
import { COLOR_MODE_LIGHT as se } from "../../../../constants/colorMode.const.js";
|
|
7
|
-
import { KEY_ESCAPE as
|
|
8
|
-
import { INK_CLASS_STYLE_DD as
|
|
7
|
+
import { KEY_ESCAPE as Ee } from "../../../../constants/keyboard.const.js";
|
|
8
|
+
import { INK_CLASS_STYLE_DD as ie, INK_CLASS_STYLE_MENU as ae, INK_CLASS_STYLE_MENU_PORTAL as ce, INK_CLASS_STYLE_MENU_FORCED as _e, INK_CLASS_EXCEL_PANEL as ue, INK_CLASS_EXCEL_TITLE as me, INK_CLASS_EXCEL_GRID as de, INK_CLASS_EXCEL_CORNER as Ce, EXCEL_COL_LETTERS as Le, INK_CLASS_EXCEL_HEAD as b, INK_CLASS_EXCEL_COL_HOVER as O, INK_CLASS_EXCEL_ROW_HOVER as g, INK_CLASS_EXCEL_CELL as pe, INK_CLASS_EXCEL_ACTIONS as fe, INK_CLASS_EXCEL_INSERT as Ne } from "../../../../constants/defaults.const.js";
|
|
9
9
|
import "../../../../constants/openai.const.js";
|
|
10
10
|
import "../../../../utils/paste.utils.js";
|
|
11
|
-
import
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
12
|
+
import { createEmptyExcelGrid as I, setExcelCell as Se, addExcelRow as ve, addExcelCol as Re, removeExcelRow as Ae, removeExcelCol as he, clearExcelGrid as Te, excelGridToTableHtml as Ke, CSV_ACCEPT as De, parseCsvText as Me } from "../../../../plugins/excel/excel.utils.js";
|
|
12
13
|
import { getToolbarDropdownMenuPosition as we } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
13
14
|
import { ToolbarButton as Xe } from "../ToolbarButton/ToolbarButton.js";
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
const { icon: y, disabled:
|
|
15
|
+
const Be = ($) => {
|
|
16
|
+
var w;
|
|
17
|
+
const { icon: y, disabled: R = !1, hint: H, onHint: P, pluginColor: G, onInsert: F } = $, [p, d] = u(!1), [o, s] = u(I), [A, f] = u(null), [h, N] = u(null), [T, U] = u({ top: i, left: i }), K = L(null), D = L(null), S = L(null), M = L(null), C = ((w = o[i]) == null ? void 0 : w.length) ?? m, k = o.length < q, V = C < Z, Y = o.length > m, B = C > m;
|
|
17
18
|
j(() => {
|
|
18
|
-
if (!
|
|
19
|
+
if (!p) return;
|
|
19
20
|
const e = () => {
|
|
20
|
-
var
|
|
21
|
-
const
|
|
21
|
+
var c;
|
|
22
|
+
const l = (c = S.current) == null ? void 0 : c.getBoundingClientRect().height, a = we(
|
|
22
23
|
D.current,
|
|
23
|
-
|
|
24
|
+
l && l > i ? l : J
|
|
24
25
|
);
|
|
25
|
-
U({ top:
|
|
26
|
+
U({ top: a.top, left: a.left });
|
|
26
27
|
};
|
|
27
28
|
e();
|
|
28
|
-
const t = window.requestAnimationFrame(e),
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
(
|
|
32
|
-
},
|
|
33
|
-
|
|
29
|
+
const t = window.requestAnimationFrame(e), E = (l) => {
|
|
30
|
+
var c, X;
|
|
31
|
+
const a = l.target;
|
|
32
|
+
(c = K.current) != null && c.contains(a) || (X = S.current) != null && X.contains(a) || d(!1);
|
|
33
|
+
}, r = (l) => {
|
|
34
|
+
l.key === Ee && d(!1);
|
|
34
35
|
};
|
|
35
|
-
return document.addEventListener("mousedown",
|
|
36
|
-
window.cancelAnimationFrame(t), document.removeEventListener("mousedown",
|
|
36
|
+
return document.addEventListener("mousedown", E), document.addEventListener("keydown", r), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
37
|
+
window.cancelAnimationFrame(t), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", r), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
+
}, [p, o.length, C]);
|
|
39
40
|
const W = (e) => {
|
|
40
|
-
var
|
|
41
|
-
const t = (
|
|
41
|
+
var r;
|
|
42
|
+
const t = (r = e.target.files) == null ? void 0 : r[i];
|
|
42
43
|
if (!t) return;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
s(
|
|
46
|
-
},
|
|
44
|
+
const E = new FileReader();
|
|
45
|
+
E.onload = () => {
|
|
46
|
+
s(Me(String(E.result)));
|
|
47
|
+
}, E.readAsText(t);
|
|
47
48
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ _("div", { className: ie, ref: K, children: [
|
|
49
50
|
/* @__PURE__ */ n("div", { ref: D, children: /* @__PURE__ */ n(
|
|
50
51
|
Xe,
|
|
51
52
|
{
|
|
52
53
|
icon: y,
|
|
53
|
-
title:
|
|
54
|
+
title: v,
|
|
54
55
|
hint: H,
|
|
55
56
|
onHint: P,
|
|
56
57
|
pluginColor: G,
|
|
57
|
-
disabled:
|
|
58
|
+
disabled: R,
|
|
58
59
|
onClick: () => {
|
|
59
|
-
|
|
60
|
+
R || (s(I()), d((e) => !e));
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
) }),
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
p ? z(
|
|
65
|
+
/* @__PURE__ */ _(
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
67
|
-
ref:
|
|
68
|
-
className: `${ae} ${ce} ${
|
|
68
|
+
ref: S,
|
|
69
|
+
className: `${ae} ${ce} ${_e} ${ue}`,
|
|
69
70
|
"data-color-mode": se,
|
|
70
71
|
role: "dialog",
|
|
71
|
-
"aria-label":
|
|
72
|
+
"aria-label": v,
|
|
72
73
|
style: { top: T.top, left: T.left },
|
|
73
74
|
children: [
|
|
74
|
-
/* @__PURE__ */ n("div", { className: me, children:
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ n("div", { className: me, children: v }),
|
|
76
|
+
/* @__PURE__ */ _(
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
+
className: de,
|
|
79
80
|
style: {
|
|
80
|
-
gridTemplateColumns: `2rem repeat(${
|
|
81
|
+
gridTemplateColumns: `2rem repeat(${C}, minmax(0, 1fr))`
|
|
81
82
|
},
|
|
82
83
|
onMouseLeave: () => {
|
|
83
|
-
|
|
84
|
+
f(null), N(null);
|
|
84
85
|
},
|
|
85
86
|
children: [
|
|
86
|
-
/* @__PURE__ */ n("span", { className:
|
|
87
|
-
(o[
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
/* @__PURE__ */ n("span", { className: Ce }),
|
|
88
|
+
(o[i] ?? []).map((e, t) => /* @__PURE__ */ n(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
className: `${b}${A === t ? ` ${O}` : ""}`,
|
|
92
|
+
onMouseEnter: () => f(t),
|
|
93
|
+
children: Le[t] ?? t + m
|
|
94
|
+
},
|
|
95
|
+
`h-${t}`
|
|
96
|
+
)),
|
|
97
|
+
o.map((e, t) => /* @__PURE__ */ _(x, { children: [
|
|
98
|
+
/* @__PURE__ */ n(
|
|
90
99
|
"span",
|
|
91
100
|
{
|
|
92
|
-
className: `${b}${
|
|
93
|
-
onMouseEnter: () =>
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
className: `${b}${h === t ? ` ${g}` : ""}`,
|
|
102
|
+
onMouseEnter: () => N(t),
|
|
103
|
+
children: t + m
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
e.map((E, r) => /* @__PURE__ */ n(
|
|
107
|
+
"input",
|
|
108
|
+
{
|
|
109
|
+
className: `${pe}${A === r ? ` ${O}` : ""}${h === t ? ` ${g}` : ""}`,
|
|
110
|
+
value: E,
|
|
111
|
+
onMouseEnter: () => {
|
|
112
|
+
f(r), N(t);
|
|
113
|
+
},
|
|
114
|
+
onChange: (l) => s(Se(o, t, r, l.target.value))
|
|
96
115
|
},
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
})
|
|
100
|
-
o.map((e, t) => {
|
|
101
|
-
const l = f !== null && t <= f;
|
|
102
|
-
return /* @__PURE__ */ m(z, { children: [
|
|
103
|
-
/* @__PURE__ */ n(
|
|
104
|
-
"span",
|
|
105
|
-
{
|
|
106
|
-
className: `${b}${l ? ` ${g}` : ""}`,
|
|
107
|
-
onMouseEnter: () => _(t),
|
|
108
|
-
onMouseMove: () => _(t),
|
|
109
|
-
children: t + d
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
e.map((i, r) => {
|
|
113
|
-
const E = p !== null && r <= p, a = f !== null && t <= f;
|
|
114
|
-
return /* @__PURE__ */ n(
|
|
115
|
-
"input",
|
|
116
|
-
{
|
|
117
|
-
className: `${pe}${E ? ` ${O}` : ""}${a ? ` ${g}` : ""}`,
|
|
118
|
-
value: i,
|
|
119
|
-
onMouseEnter: () => {
|
|
120
|
-
u(r), _(t);
|
|
121
|
-
},
|
|
122
|
-
onMouseMove: () => {
|
|
123
|
-
u(r), _(t);
|
|
124
|
-
},
|
|
125
|
-
onChange: (S) => s(Se(o, t, r, S.target.value))
|
|
126
|
-
},
|
|
127
|
-
`${t}-${r}`
|
|
128
|
-
);
|
|
129
|
-
})
|
|
130
|
-
] }, `row-${t}`);
|
|
131
|
-
})
|
|
116
|
+
`${t}-${r}`
|
|
117
|
+
))
|
|
118
|
+
] }, `row-${t}`))
|
|
132
119
|
]
|
|
133
120
|
}
|
|
134
121
|
),
|
|
135
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ _("div", { className: fe, children: [
|
|
136
123
|
/* @__PURE__ */ n(
|
|
137
124
|
"button",
|
|
138
125
|
{
|
|
@@ -141,7 +128,7 @@ const Ye = (I) => {
|
|
|
141
128
|
onMouseDown: (e) => {
|
|
142
129
|
e.preventDefault(), s(ve(o));
|
|
143
130
|
},
|
|
144
|
-
children:
|
|
131
|
+
children: Q
|
|
145
132
|
}
|
|
146
133
|
),
|
|
147
134
|
/* @__PURE__ */ n(
|
|
@@ -161,7 +148,7 @@ const Ye = (I) => {
|
|
|
161
148
|
type: "button",
|
|
162
149
|
disabled: !Y,
|
|
163
150
|
onMouseDown: (e) => {
|
|
164
|
-
e.preventDefault(), s(
|
|
151
|
+
e.preventDefault(), s(Ae(o));
|
|
165
152
|
},
|
|
166
153
|
children: te
|
|
167
154
|
}
|
|
@@ -172,7 +159,7 @@ const Ye = (I) => {
|
|
|
172
159
|
type: "button",
|
|
173
160
|
disabled: !B,
|
|
174
161
|
onMouseDown: (e) => {
|
|
175
|
-
e.preventDefault(), s(
|
|
162
|
+
e.preventDefault(), s(he(o));
|
|
176
163
|
},
|
|
177
164
|
children: ne
|
|
178
165
|
}
|
|
@@ -182,7 +169,7 @@ const Ye = (I) => {
|
|
|
182
169
|
{
|
|
183
170
|
type: "button",
|
|
184
171
|
onMouseDown: (e) => {
|
|
185
|
-
e.preventDefault(), s(
|
|
172
|
+
e.preventDefault(), s(Te(o));
|
|
186
173
|
},
|
|
187
174
|
children: oe
|
|
188
175
|
}
|
|
@@ -193,7 +180,7 @@ const Ye = (I) => {
|
|
|
193
180
|
type: "button",
|
|
194
181
|
onMouseDown: (e) => {
|
|
195
182
|
var t;
|
|
196
|
-
e.preventDefault(), (t =
|
|
183
|
+
e.preventDefault(), (t = M.current) == null || t.click();
|
|
197
184
|
},
|
|
198
185
|
children: re
|
|
199
186
|
}
|
|
@@ -204,13 +191,13 @@ const Ye = (I) => {
|
|
|
204
191
|
type: "button",
|
|
205
192
|
className: Ne,
|
|
206
193
|
onMouseDown: (e) => {
|
|
207
|
-
e.preventDefault(), F(
|
|
194
|
+
e.preventDefault(), F(Ke(o)), d(!1);
|
|
208
195
|
},
|
|
209
196
|
children: le
|
|
210
197
|
}
|
|
211
198
|
)
|
|
212
199
|
] }),
|
|
213
|
-
/* @__PURE__ */ n("input", { ref:
|
|
200
|
+
/* @__PURE__ */ n("input", { ref: M, type: "file", accept: De, hidden: !0, onChange: W })
|
|
214
201
|
]
|
|
215
202
|
}
|
|
216
203
|
),
|
|
@@ -219,5 +206,5 @@ const Ye = (I) => {
|
|
|
219
206
|
] });
|
|
220
207
|
};
|
|
221
208
|
export {
|
|
222
|
-
|
|
209
|
+
Be as ExcelSheetPanel
|
|
223
210
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),o=require("../../../../constants/generals.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),o=require("../../../../constants/generals.const.cjs"),r=require("../../../../constants/findReplaceMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const a=require("../../../../common-components/Button/Button.cjs"),u=require("../../../../common-components/Field/Field.cjs");require("react-dom");const e=require("./FindReplace.const.cjs"),p=L=>{const{open:F,onClose:C,onReplace:A,findLabel:D=e.FIND_REPLACE_DEFAULT_FIND,replaceLabel:N=e.FIND_REPLACE_DEFAULT_REPLACE,replaceOneLabel:R=e.FIND_REPLACE_DEFAULT_ONE,replaceAllLabel:d=e.FIND_REPLACE_DEFAULT_ALL,closeLabel:I=e.FIND_REPLACE_DEFAULT_CLOSE,title:c=e.FIND_REPLACE_DEFAULT_TITLE,focusField:s=r.FIND_REPLACE_FOCUS_FIND}=L,[l,S]=i.useState(o.EMPTY_STRING),[E,P]=i.useState(o.EMPTY_STRING);if(!F)return null;const _=(n,b)=>{n.preventDefault(),l&&A(l,E,b)};return t.jsxs("form",{className:e.FIND_REPLACE_CLASS,"aria-label":c,onSubmit:n=>_(n,!1),children:[t.jsx("p",{className:e.FIND_REPLACE_TITLE_CLASS,children:c}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:D,value:l,onChange:S,autoFocus:s===r.FIND_REPLACE_FOCUS_FIND}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:N,value:E,onChange:P,autoFocus:s===r.FIND_REPLACE_FOCUS_REPLACE}),t.jsxs("div",{className:e.FIND_REPLACE_ACTIONS_CLASS,children:[t.jsx(a.Button,{type:"button",onClick:C,children:I}),t.jsx(a.Button,{type:"submit",disabled:!l,children:R}),t.jsx(a.Button,{type:"button",active:!0,disabled:!l,onClick:n=>_(n,!0),children:d})]})]},s)};exports.FindReplace=p;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L } from "react";
|
|
3
3
|
import { EMPTY_STRING as n } from "../../../../constants/generals.const.js";
|
|
4
4
|
import { FIND_REPLACE_FOCUS_FIND as s, FIND_REPLACE_FOCUS_REPLACE as P } from "../../../../constants/findReplaceMenu.const.js";
|
|
5
5
|
import "../../../../constants/openai.const.js";
|
|
6
6
|
import "../../../../utils/paste.utils.js";
|
|
7
|
-
import
|
|
7
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
|
+
import { Button as r } from "../../../../common-components/Button/Button.js";
|
|
8
9
|
import { Field as c } from "../../../../common-components/Field/Field.js";
|
|
9
10
|
import "react-dom";
|
|
10
11
|
import { FIND_REPLACE_DEFAULT_FIND as S, FIND_REPLACE_DEFAULT_REPLACE as T, FIND_REPLACE_DEFAULT_ONE as h, FIND_REPLACE_DEFAULT_ALL as U, FIND_REPLACE_DEFAULT_CLOSE as O, FIND_REPLACE_DEFAULT_TITLE as v, FIND_REPLACE_CLASS as x, FIND_REPLACE_TITLE_CLASS as y, FIND_REPLACE_FIELD_CLASS as F, FIND_REPLACE_ACTIONS_CLASS as g } from "./FindReplace.const.js";
|
|
11
|
-
const
|
|
12
|
+
const K = (m) => {
|
|
12
13
|
const {
|
|
13
|
-
open:
|
|
14
|
-
onClose:
|
|
14
|
+
open: A,
|
|
15
|
+
onClose: C,
|
|
15
16
|
onReplace: p,
|
|
16
17
|
findLabel: D = S,
|
|
17
18
|
replaceLabel: N = T,
|
|
18
19
|
replaceOneLabel: u = h,
|
|
19
20
|
replaceAllLabel: I = U,
|
|
20
21
|
closeLabel: R = O,
|
|
21
|
-
title:
|
|
22
|
+
title: E = v,
|
|
22
23
|
focusField: o = s
|
|
23
|
-
} =
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
t.preventDefault(), l && p(l,
|
|
24
|
+
} = m, [l, d] = L(n), [a, b] = L(n);
|
|
25
|
+
if (!A) return null;
|
|
26
|
+
const i = (t, f) => {
|
|
27
|
+
t.preventDefault(), l && p(l, a, f);
|
|
27
28
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ _(
|
|
29
30
|
"form",
|
|
30
31
|
{
|
|
31
32
|
className: x,
|
|
32
|
-
"aria-label":
|
|
33
|
-
onSubmit: (t) =>
|
|
33
|
+
"aria-label": E,
|
|
34
|
+
onSubmit: (t) => i(t, !1),
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */ e("p", { className: y, children:
|
|
36
|
+
/* @__PURE__ */ e("p", { className: y, children: E }),
|
|
36
37
|
/* @__PURE__ */ e(
|
|
37
38
|
c,
|
|
38
39
|
{
|
|
@@ -48,15 +49,15 @@ const J = (A) => {
|
|
|
48
49
|
{
|
|
49
50
|
className: F,
|
|
50
51
|
label: N,
|
|
51
|
-
value:
|
|
52
|
+
value: a,
|
|
52
53
|
onChange: b,
|
|
53
54
|
autoFocus: o === P
|
|
54
55
|
}
|
|
55
56
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
-
/* @__PURE__ */ e(
|
|
57
|
+
/* @__PURE__ */ _("div", { className: g, children: [
|
|
58
|
+
/* @__PURE__ */ e(r, { type: "button", onClick: C, children: R }),
|
|
59
|
+
/* @__PURE__ */ e(r, { type: "submit", disabled: !l, children: u }),
|
|
60
|
+
/* @__PURE__ */ e(r, { type: "button", active: !0, disabled: !l, onClick: (t) => i(t, !0), children: I })
|
|
60
61
|
] })
|
|
61
62
|
]
|
|
62
63
|
},
|
|
@@ -64,5 +65,5 @@ const J = (A) => {
|
|
|
64
65
|
);
|
|
65
66
|
};
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
+
K as FindReplace
|
|
68
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),N=require("@forgedevstack/bear"),s=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const O=require("../../../../plugins/graph/graph.const.cjs"),C=()=>({label:"•",value:s.NUMBER_ONE}),G=j=>{const{open:p,mode:E,points:d,colors:n,onClose:R,onApply:P}=j,[m,_]=h.useState(d),[v,M]=h.useState(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]);h.useEffect(()=>{p&&(_(d),M(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]))},[p,d,n]);const b=E==="colors"?l.INK_GRAPH_COLORS_TITLE:l.INK_GRAPH_VALUES_TITLE;return e.jsx(N.Modal,{isOpen:p,onClose:R,title:b,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(N.Button,{variant:"outline",onClick:R,children:l.INK_GRAPH_CANCEL}),e.jsx(N.Button,{variant:"primary",onClick:()=>P(m,v),children:l.INK_GRAPH_APPLY})]}),children:E==="values"?e.jsxs("div",{className:"Ink-GraphModal",children:[m.map((r,a)=>e.jsxs("div",{className:"Ink-GraphModal__row",children:[e.jsx("input",{value:r.label,"aria-label":`Label ${a+s.NUMBER_ONE}`,onChange:o=>{const i=o.target.value;_(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),N=require("@forgedevstack/bear"),s=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react-dom");const O=require("../../../../plugins/graph/graph.const.cjs"),C=()=>({label:"•",value:s.NUMBER_ONE}),G=j=>{const{open:p,mode:E,points:d,colors:n,onClose:R,onApply:P}=j,[m,_]=h.useState(d),[v,M]=h.useState(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]);h.useEffect(()=>{p&&(_(d),M(n.length>s.NUMBER_ZERO?n:[...O.GRAPH_COLORS]))},[p,d,n]);const b=E==="colors"?l.INK_GRAPH_COLORS_TITLE:l.INK_GRAPH_VALUES_TITLE;return e.jsx(N.Modal,{isOpen:p,onClose:R,title:b,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(N.Button,{variant:"outline",onClick:R,children:l.INK_GRAPH_CANCEL}),e.jsx(N.Button,{variant:"primary",onClick:()=>P(m,v),children:l.INK_GRAPH_APPLY})]}),children:E==="values"?e.jsxs("div",{className:"Ink-GraphModal",children:[m.map((r,a)=>e.jsxs("div",{className:"Ink-GraphModal__row",children:[e.jsx("input",{value:r.label,"aria-label":`Label ${a+s.NUMBER_ONE}`,onChange:o=>{const i=o.target.value;_(u=>u.map((t,c)=>c===a?{...t,label:i}:t))}}),e.jsx("input",{type:"number",value:r.value,"aria-label":`Value ${a+s.NUMBER_ONE}`,onChange:o=>{const i=Number(o.target.value)||s.NUMBER_ZERO;_(u=>u.map((t,c)=>c===a?{...t,value:i}:t))}})]},`${r.label}-${a}`)),e.jsx(N.Button,{variant:"outline",size:"sm",onClick:()=>_(r=>[...r,C()]),children:l.INK_GRAPH_ADD_POINT})]}):e.jsx("div",{className:"Ink-GraphModal",children:v.map((r,a)=>e.jsxs("label",{className:"Ink-GraphModal__row",children:[e.jsx("span",{children:a+s.NUMBER_ONE}),e.jsx("input",{type:"color",value:r,onChange:o=>{const i=o.target.value||l.EMPTY_STRING;M(u=>u.map((t,c)=>c===a?i:t))}})]},`${r}-${a}`))})})};exports.GraphEditModal=G;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as m, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { useState as P, useEffect as b } from "react";
|
|
3
3
|
import { Modal as g, Button as h } from "@forgedevstack/bear";
|
|
4
|
-
import { NUMBER_ZERO as d, NUMBER_ONE as
|
|
4
|
+
import { NUMBER_ZERO as d, NUMBER_ONE as c } from "../../../../constants/numbers.js";
|
|
5
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
6
|
import "../../../../constants/openai.const.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
9
|
import "react-dom";
|
|
9
10
|
import { GRAPH_COLORS as G } from "../../../../plugins/graph/graph.const.js";
|
|
10
|
-
const $ = () => ({ label: "•", value:
|
|
11
|
+
const $ = () => ({ label: "•", value: c }), F = (R) => {
|
|
11
12
|
const { open: u, mode: v, points: _, colors: r, onClose: N, onApply: A } = R, [f, p] = P(_), [C, I] = P(
|
|
12
13
|
r.length > d ? r : [...G]
|
|
13
14
|
);
|
|
@@ -20,22 +21,22 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
|
20
21
|
onClose: N,
|
|
21
22
|
title: v === "colors" ? M : L,
|
|
22
23
|
size: "md",
|
|
23
|
-
footer: /* @__PURE__ */
|
|
24
|
+
footer: /* @__PURE__ */ m(E, { children: [
|
|
24
25
|
/* @__PURE__ */ l(h, { variant: "outline", onClick: N, children: T }),
|
|
25
26
|
/* @__PURE__ */ l(h, { variant: "primary", onClick: () => A(f, C), children: H })
|
|
26
27
|
] }),
|
|
27
|
-
children: v === "values" ? /* @__PURE__ */
|
|
28
|
-
f.map((e, a) => /* @__PURE__ */
|
|
28
|
+
children: v === "values" ? /* @__PURE__ */ m("div", { className: "Ink-GraphModal", children: [
|
|
29
|
+
f.map((e, a) => /* @__PURE__ */ m("div", { className: "Ink-GraphModal__row", children: [
|
|
29
30
|
/* @__PURE__ */ l(
|
|
30
31
|
"input",
|
|
31
32
|
{
|
|
32
33
|
value: e.label,
|
|
33
|
-
"aria-label": `Label ${a +
|
|
34
|
+
"aria-label": `Label ${a + c}`,
|
|
34
35
|
onChange: (t) => {
|
|
35
36
|
const n = t.target.value;
|
|
36
37
|
p(
|
|
37
|
-
(
|
|
38
|
-
(o,
|
|
38
|
+
(i) => i.map(
|
|
39
|
+
(o, s) => s === a ? { ...o, label: n } : o
|
|
39
40
|
)
|
|
40
41
|
);
|
|
41
42
|
}
|
|
@@ -46,12 +47,12 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
|
46
47
|
{
|
|
47
48
|
type: "number",
|
|
48
49
|
value: e.value,
|
|
49
|
-
"aria-label": `Value ${a +
|
|
50
|
+
"aria-label": `Value ${a + c}`,
|
|
50
51
|
onChange: (t) => {
|
|
51
52
|
const n = Number(t.target.value) || d;
|
|
52
53
|
p(
|
|
53
|
-
(
|
|
54
|
-
(o,
|
|
54
|
+
(i) => i.map(
|
|
55
|
+
(o, s) => s === a ? { ...o, value: n } : o
|
|
55
56
|
)
|
|
56
57
|
);
|
|
57
58
|
}
|
|
@@ -67,8 +68,8 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
|
67
68
|
children: O
|
|
68
69
|
}
|
|
69
70
|
)
|
|
70
|
-
] }) : /* @__PURE__ */ l("div", { className: "Ink-GraphModal", children: C.map((e, a) => /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */ l("span", { children: a +
|
|
71
|
+
] }) : /* @__PURE__ */ l("div", { className: "Ink-GraphModal", children: C.map((e, a) => /* @__PURE__ */ m("label", { className: "Ink-GraphModal__row", children: [
|
|
72
|
+
/* @__PURE__ */ l("span", { children: a + c }),
|
|
72
73
|
/* @__PURE__ */ l(
|
|
73
74
|
"input",
|
|
74
75
|
{
|
|
@@ -77,7 +78,7 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
|
77
78
|
onChange: (t) => {
|
|
78
79
|
const n = t.target.value || k;
|
|
79
80
|
I(
|
|
80
|
-
(
|
|
81
|
+
(i) => i.map((o, s) => s === a ? n : o)
|
|
81
82
|
);
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -87,5 +88,5 @@ const $ = () => ({ label: "•", value: m }), Y = (R) => {
|
|
|
87
88
|
);
|
|
88
89
|
};
|
|
89
90
|
export {
|
|
90
|
-
|
|
91
|
+
F as GraphEditModal
|
|
91
92
|
};
|
|
@@ -1 +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"),
|
|
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"),q=require("../../../../constants/colorMode.const.cjs"),D=require("../../../../constants/keyboard.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const s=require("../../../../plugins/graph/graph.const.cjs"),p=require("../../../../plugins/graph/graph.utils.cjs"),M=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),h=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=M.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===D.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(h.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":q.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;
|
|
@@ -8,11 +8,12 @@ import { KEY_ESCAPE as y } from "../../../../constants/keyboard.const.js";
|
|
|
8
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
9
|
import "../../../../constants/openai.const.js";
|
|
10
10
|
import "../../../../utils/paste.utils.js";
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
11
12
|
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
13
|
import { buildGraphHtml as v } from "../../../../plugins/graph/graph.utils.js";
|
|
13
14
|
import { getToolbarDropdownMenuPosition as x } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
14
15
|
import { ToolbarButton as V } from "../ToolbarButton/ToolbarButton.js";
|
|
15
|
-
const
|
|
16
|
+
const de = (R) => {
|
|
16
17
|
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
18
|
return G(() => {
|
|
18
19
|
if (!i) return;
|
|
@@ -94,5 +95,5 @@ const me = (R) => {
|
|
|
94
95
|
] });
|
|
95
96
|
};
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
+
de as GraphPicker
|
|
98
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("../../../../constants/generals.const.cjs"),o=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const c=e=>{const{value:r,onChange:t,disabled:a=!1,minHeight:n}=e,l=s=>{t(s.target.value)};return u.jsx("textarea",{className:o.INK_CLASS_SOURCE,"aria-label":i.INK_HTML_SOURCE_TITLE,value:r,disabled:a,spellCheck:!1,style:{minHeight:n},onChange:l})};exports.HtmlSourcePanel=c;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { INK_HTML_SOURCE_TITLE as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { INK_HTML_SOURCE_TITLE as n } from "../../../../constants/generals.const.js";
|
|
3
3
|
import { INK_CLASS_SOURCE as i } from "../../../../constants/defaults.const.js";
|
|
4
4
|
import "../../../../constants/openai.const.js";
|
|
5
5
|
import "../../../../utils/paste.utils.js";
|
|
6
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
6
7
|
import "react";
|
|
7
8
|
import "react-dom";
|
|
8
|
-
const
|
|
9
|
+
const d = (e) => {
|
|
9
10
|
const { value: a, onChange: t, disabled: o = !1, minHeight: r } = e;
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ m(
|
|
11
12
|
"textarea",
|
|
12
13
|
{
|
|
13
14
|
className: i,
|
|
14
|
-
"aria-label":
|
|
15
|
+
"aria-label": n,
|
|
15
16
|
value: a,
|
|
16
17
|
disabled: o,
|
|
17
18
|
spellCheck: !1,
|
|
@@ -23,5 +24,5 @@ const _ = (e) => {
|
|
|
23
24
|
);
|
|
24
25
|
};
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
d as HtmlSourcePanel
|
|
27
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../../utils/image.utils.cjs"),c=u=>{var i,r;const{image:a,onChange:l,onClose:s}=u,o=n=>{t.setImageAlign(a,n),l()};return e.jsxs("div",{className:"Ink-ImageFrame",role:"toolbar","aria-label":"Image",children:[e.jsxs("label",{children:["Width",e.jsx("input",{type:"range",min:t.IMAGE_WIDTH_MIN,max:t.IMAGE_WIDTH_MAX,defaultValue:a.clientWidth||t.IMAGE_WIDTH_DEFAULT,onChange:n=>{t.setImageWidth(a,Number(n.target.value)),l()}})]}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_LEFT),children:"Left"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_CENTER),children:"Center"}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>o(t.IMAGE_ALIGN_RIGHT),children:"Right"}),e.jsx("input",{"aria-label":"Alt text",defaultValue:a.alt,placeholder:"Alt text",onBlur:n=>{t.setImageAlt(a,n.target.value),l()}}),e.jsx("input",{"aria-label":"Caption",defaultValue:((r=(i=a.parentElement)==null?void 0:i.querySelector("figcaption"))==null?void 0:r.textContent)??"",placeholder:"Caption",onBlur:n=>{t.setImageCaption(a,n.target.value),l()}}),e.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:s,children:"Done"})]})};exports.ImageFrame=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageFrame.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ImageFrame/ImageFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAqD1C,CAAC"}
|