@forgedevstack/ink 1.1.9 → 1.2.1
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,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as l, jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useRef as a, useEffect as B } from "react";
|
|
3
3
|
import { createPortal as O } from "react-dom";
|
|
4
4
|
import { INK_TABLE_PICKER_MAX as n, NUMBER_ONE as A } from "../../../../constants/numbers.js";
|
|
5
5
|
import { INK_TABLE_INSERT_TITLE as C, SPACE_STRING as $ } from "../../../../constants/generals.const.js";
|
|
@@ -8,50 +8,51 @@ import { KEY_ESCAPE as b } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_TABLE_PICKER as g, INK_CLASS_STYLE_MENU as h, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as D, INK_CLASS_TABLE_PICKER_GRID as Y, INK_CLASS_TABLE_PICKER_CELL as U, INK_CLASS_TABLE_PICKER_CELL_ON as x, INK_CLASS_TABLE_PICKER_LABEL as z } from "../../../../constants/defaults.const.js";
|
|
9
9
|
import "../../../../constants/openai.const.js";
|
|
10
10
|
import "../../../../utils/paste.utils.js";
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
11
12
|
import { getToolbarDropdownMenuPosition as G } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
12
13
|
import { ToolbarButton as H } from "../ToolbarButton/ToolbarButton.js";
|
|
13
|
-
import { TABLE_PICKER_INITIAL_HOVER as N, TABLE_PICKER_EMPTY_POSITION as j, TABLE_PICKER_TIMES_MARK as
|
|
14
|
-
const
|
|
15
|
-
const { icon:
|
|
14
|
+
import { TABLE_PICKER_INITIAL_HOVER as N, TABLE_PICKER_EMPTY_POSITION as j, TABLE_PICKER_TIMES_MARK as K } from "./TableSizePicker.const.js";
|
|
15
|
+
const ie = (R) => {
|
|
16
|
+
const { icon: v, disabled: L = !1, onSelect: w } = R, [c, s] = m(!1), [i, d] = m(N), [f, P] = m(j), u = a(null), I = a(null), p = a(null);
|
|
16
17
|
B(() => {
|
|
17
18
|
if (!c) return;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
P({ top:
|
|
19
|
+
const e = () => {
|
|
20
|
+
const o = G(I.current);
|
|
21
|
+
P({ top: o.top, left: o.left });
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
-
const t = (
|
|
24
|
-
var
|
|
25
|
-
const _ =
|
|
26
|
-
(
|
|
27
|
-
}, r = (
|
|
28
|
-
|
|
23
|
+
e();
|
|
24
|
+
const t = (o) => {
|
|
25
|
+
var S, T;
|
|
26
|
+
const _ = o.target;
|
|
27
|
+
(S = u.current) != null && S.contains(_) || (T = p.current) != null && T.contains(_) || s(!1);
|
|
28
|
+
}, r = (o) => {
|
|
29
|
+
o.key === b && s(!1);
|
|
29
30
|
};
|
|
30
|
-
return document.addEventListener("mousedown", t), document.addEventListener("keydown", r), window.addEventListener("resize",
|
|
31
|
-
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", r), window.removeEventListener("resize",
|
|
31
|
+
return document.addEventListener("mousedown", t), document.addEventListener("keydown", r), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
32
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", r), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
32
33
|
};
|
|
33
34
|
}, [c]);
|
|
34
|
-
const M = Array.from({ length: n * n }, (
|
|
35
|
-
const r = Math.floor(t / n) + A,
|
|
36
|
-
return { rows: r, cols:
|
|
35
|
+
const M = Array.from({ length: n * n }, (e, t) => {
|
|
36
|
+
const r = Math.floor(t / n) + A, o = t % n + A, _ = r <= i.rows && o <= i.cols;
|
|
37
|
+
return { rows: r, cols: o, isOn: _, key: `${r}-${o}` };
|
|
37
38
|
});
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ l("div", { className: g, ref: u, children: [
|
|
39
40
|
/* @__PURE__ */ E("div", { ref: I, children: /* @__PURE__ */ E(
|
|
40
41
|
H,
|
|
41
42
|
{
|
|
42
|
-
icon:
|
|
43
|
+
icon: v,
|
|
43
44
|
title: C,
|
|
44
|
-
disabled:
|
|
45
|
+
disabled: L,
|
|
45
46
|
onClick: () => {
|
|
46
|
-
|
|
47
|
+
L || (d(N), s((e) => !e));
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
) }),
|
|
50
|
-
c
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
c ? O(
|
|
52
|
+
/* @__PURE__ */ l(
|
|
52
53
|
"div",
|
|
53
54
|
{
|
|
54
|
-
ref:
|
|
55
|
+
ref: p,
|
|
55
56
|
className: `${h} ${k} ${D}`,
|
|
56
57
|
"data-color-mode": y,
|
|
57
58
|
role: "grid",
|
|
@@ -63,34 +64,33 @@ const so = (v) => {
|
|
|
63
64
|
{
|
|
64
65
|
className: Y,
|
|
65
66
|
style: { gridTemplateColumns: `repeat(${n}, 1fr)` },
|
|
66
|
-
children: M.map((
|
|
67
|
+
children: M.map((e) => /* @__PURE__ */ E(
|
|
67
68
|
"button",
|
|
68
69
|
{
|
|
69
70
|
type: "button",
|
|
70
|
-
className: `${U}${
|
|
71
|
-
"aria-label": `${
|
|
72
|
-
onMouseEnter: () =>
|
|
73
|
-
onMouseMove: () => m({ rows: o.rows, cols: o.cols }),
|
|
71
|
+
className: `${U}${e.isOn ? `${$}${x}` : ""}`,
|
|
72
|
+
"aria-label": `${e.rows}${K}${e.cols}`,
|
|
73
|
+
onMouseEnter: () => d({ rows: e.rows, cols: e.cols }),
|
|
74
74
|
onMouseDown: (t) => {
|
|
75
|
-
t.preventDefault(),
|
|
75
|
+
t.preventDefault(), w(e.rows, e.cols), s(!1);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
|
|
78
|
+
e.key
|
|
79
79
|
))
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ l("div", { className: z, children: [
|
|
83
83
|
i.rows,
|
|
84
|
-
|
|
84
|
+
K,
|
|
85
85
|
i.cols
|
|
86
86
|
] })
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
document.body
|
|
91
|
-
)
|
|
91
|
+
) : null
|
|
92
92
|
] });
|
|
93
93
|
};
|
|
94
94
|
export {
|
|
95
|
-
|
|
95
|
+
ie as TableSizePicker
|
|
96
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),y=require("react-dom"),L=require("../../../../constants/numbers.cjs"),T=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),I=require("../../../../constants/keyboard.const.cjs"),u=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const P=require("../../../../plugins/theme/theme.const.cjs");require("../../../../plugins/host/inkPlugins.cjs");const C=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),O=require("../ToolbarButton/ToolbarButton.cjs"),k=p=>{const{icon:b,disabled:c=!1,hint:q,onHint:w,pluginColor:S,value:M,onChange:R}=p,[i,r]=o.useState(!1),[l,N]=o.useState({top:L.NUMBER_ZERO,left:L.NUMBER_ZERO}),a=o.useRef(null),d=o.useRef(null),E=o.useRef(null);return o.useEffect(()=>{if(!i)return;const e=()=>{const t=C.getToolbarDropdownMenuPosition(d.current);N({top:t.top,left:t.left})};e();const s=t=>{var m,v;const f=t.target;(m=a.current)!=null&&m.contains(f)||(v=E.current)!=null&&v.contains(f)||r(!1)},_=t=>{t.key===I.KEY_ESCAPE&&r(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",_),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",_),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]),n.jsxs("div",{ref:a,children:[n.jsx("div",{ref:d,children:n.jsx(O.ToolbarButton,{icon:b,title:T.INK_THEME_TITLE,hint:q,onHint:w,pluginColor:S,disabled:c,onClick:()=>{c||r(e=>!e)}})}),i?y.createPortal(n.jsx("div",{ref:E,className:`${u.INK_CLASS_STYLE_MENU} ${u.INK_CLASS_STYLE_MENU_PORTAL} ${u.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":T.INK_THEME_TITLE,style:{top:l.top,left:l.left},children:P.INK_THEMES.map(e=>n.jsx("button",{type:"button",role:"option","aria-selected":e.id===M,className:"Ink-Editor__style-option",onMouseDown:s=>{s.preventDefault(),R(e.id),r(!1)},children:e.label},e.id))}),document.body):null]})};exports.ThemePicker=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ThemePicker/ThemePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ThemePicker/ThemePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAc7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAmF5C,CAAC"}
|
|
@@ -1,65 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as s, useEffect as I } from "react";
|
|
3
|
+
import { createPortal as P } from "react-dom";
|
|
4
|
+
import { NUMBER_ZERO as v } from "../../../../constants/numbers.js";
|
|
5
|
+
import { INK_THEME_TITLE as L } from "../../../../constants/generals.const.js";
|
|
6
|
+
import { COLOR_MODE_LIGHT as g } from "../../../../constants/colorMode.const.js";
|
|
7
|
+
import { KEY_ESCAPE as K } from "../../../../constants/keyboard.const.js";
|
|
8
|
+
import { INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as k, INK_CLASS_STYLE_MENU_FORCED as x } from "../../../../constants/defaults.const.js";
|
|
6
9
|
import "../../../../constants/openai.const.js";
|
|
7
10
|
import "../../../../utils/paste.utils.js";
|
|
8
|
-
import "
|
|
9
|
-
import { INK_THEMES as
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
12
|
+
import { INK_THEMES as A } from "../../../../plugins/theme/theme.const.js";
|
|
10
13
|
import "../../../../plugins/host/inkPlugins.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
const
|
|
14
|
-
const { icon:
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { getToolbarDropdownMenuPosition as D } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
15
|
+
import { ToolbarButton as h } from "../ToolbarButton/ToolbarButton.js";
|
|
16
|
+
const X = (w) => {
|
|
17
|
+
const { icon: S, disabled: l = !1, hint: T, onHint: N, pluginColor: M, value: b, onChange: C } = w, [i, t] = _(!1), [m, R] = _({ top: v, left: v }), d = s(null), c = s(null), a = s(null);
|
|
18
|
+
return I(() => {
|
|
19
|
+
if (!i) return;
|
|
20
|
+
const e = () => {
|
|
21
|
+
const o = D(c.current);
|
|
22
|
+
R({ top: o.top, left: o.left });
|
|
23
|
+
};
|
|
24
|
+
e();
|
|
25
|
+
const n = (o) => {
|
|
26
|
+
var p, E;
|
|
27
|
+
const u = o.target;
|
|
28
|
+
(p = d.current) != null && p.contains(u) || (E = a.current) != null && E.contains(u) || t(!1);
|
|
29
|
+
}, f = (o) => {
|
|
30
|
+
o.key === K && t(!1);
|
|
31
|
+
};
|
|
32
|
+
return document.addEventListener("mousedown", n), document.addEventListener("keydown", f), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
33
|
+
document.removeEventListener("mousedown", n), document.removeEventListener("keydown", f), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
34
|
+
};
|
|
35
|
+
}, [i]), /* @__PURE__ */ y("div", { ref: d, children: [
|
|
36
|
+
/* @__PURE__ */ r("div", { ref: c, children: /* @__PURE__ */ r(
|
|
37
|
+
h,
|
|
18
38
|
{
|
|
19
|
-
icon:
|
|
20
|
-
title:
|
|
21
|
-
hint:
|
|
22
|
-
onHint:
|
|
23
|
-
pluginColor:
|
|
24
|
-
disabled:
|
|
39
|
+
icon: S,
|
|
40
|
+
title: L,
|
|
41
|
+
hint: T,
|
|
42
|
+
onHint: N,
|
|
43
|
+
pluginColor: M,
|
|
44
|
+
disabled: l,
|
|
25
45
|
onClick: () => {
|
|
26
|
-
|
|
46
|
+
l || t((e) => !e);
|
|
27
47
|
}
|
|
28
48
|
}
|
|
29
49
|
) }),
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */
|
|
50
|
+
i ? P(
|
|
51
|
+
/* @__PURE__ */ r(
|
|
32
52
|
"div",
|
|
33
53
|
{
|
|
34
|
-
ref:
|
|
35
|
-
className: `${
|
|
36
|
-
"data-color-mode":
|
|
54
|
+
ref: a,
|
|
55
|
+
className: `${O} ${k} ${x}`,
|
|
56
|
+
"data-color-mode": g,
|
|
37
57
|
role: "listbox",
|
|
38
|
-
"aria-label":
|
|
39
|
-
style: { top:
|
|
40
|
-
children:
|
|
58
|
+
"aria-label": L,
|
|
59
|
+
style: { top: m.top, left: m.left },
|
|
60
|
+
children: A.map((e) => /* @__PURE__ */ r(
|
|
41
61
|
"button",
|
|
42
62
|
{
|
|
43
63
|
type: "button",
|
|
44
64
|
role: "option",
|
|
45
|
-
"aria-selected":
|
|
65
|
+
"aria-selected": e.id === b,
|
|
46
66
|
className: "Ink-Editor__style-option",
|
|
47
|
-
onMouseDown: (
|
|
48
|
-
|
|
67
|
+
onMouseDown: (n) => {
|
|
68
|
+
n.preventDefault(), C(e.id), t(!1);
|
|
49
69
|
},
|
|
50
|
-
|
|
51
|
-
t.preventDefault(), n(o.id), r(!1);
|
|
52
|
-
},
|
|
53
|
-
children: o.label
|
|
70
|
+
children: e.label
|
|
54
71
|
},
|
|
55
|
-
|
|
72
|
+
e.id
|
|
56
73
|
))
|
|
57
74
|
}
|
|
58
75
|
),
|
|
59
76
|
document.body
|
|
60
|
-
)
|
|
77
|
+
) : null
|
|
61
78
|
] });
|
|
62
79
|
};
|
|
63
80
|
export {
|
|
64
|
-
|
|
81
|
+
X as ThemePicker
|
|
65
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),C=require("react-dom"),f=require("../../../../constants/numbers.cjs"),m=require("../../../../constants/generals.const.cjs"),K=require("../../../../constants/colorMode.const.cjs"),A=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const I=require("../../../../plugins/titles/titles.const.cjs"),M=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),x=require("../ToolbarButton/ToolbarButton.cjs"),g=N=>{const{icon:v,disabled:c=!1,hint:R,onHint:p,pluginColor:b,onSelect:w}=N,[l,s]=r.useState(!1),[u,q]=r.useState({top:f.NUMBER_ZERO,left:f.NUMBER_ZERO}),a=r.useRef(null),_=r.useRef(null),d=r.useRef(null);return r.useEffect(()=>{if(!l)return;const e=()=>{const o=M.getToolbarDropdownMenuPosition(_.current);q({top:o.top,left:o.left})};e();const i=o=>{var T,S;const L=o.target;(T=a.current)!=null&&T.contains(L)||(S=d.current)!=null&&S.contains(L)||s(!1)},E=o=>{o.key===A.KEY_ESCAPE&&s(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",E),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",E),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[l]),n.jsxs("div",{className:t.INK_CLASS_TITLE_GALLERY,ref:a,children:[n.jsx("div",{ref:_,children:n.jsx(x.ToolbarButton,{icon:v,title:m.INK_TITLES_TITLE,hint:R,onHint:p,pluginColor:b,disabled:c,onClick:()=>{c||s(e=>!e)}})}),l?C.createPortal(n.jsx("div",{ref:d,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL} ${t.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":K.COLOR_MODE_LIGHT,role:"listbox","aria-label":m.INK_TITLES_TITLE,style:{top:u.top,left:u.left},children:n.jsx("div",{className:t.INK_CLASS_TITLE_GRID,children:I.TITLE_STYLE_IDS.map(e=>n.jsx("button",{type:"button",className:t.INK_CLASS_TITLE_CELL,"aria-label":e,onMouseDown:i=>{i.preventDefault(),w(e),s(!1)},children:n.jsx("span",{className:`${t.INK_CLASS_TITLE} ${t.INK_CLASS_TITLE}--${e}`,children:I.TITLE_PREVIEW_TEXT})},e))})}),document.body):null]})};exports.TitleGallery=g;
|
|
@@ -8,10 +8,11 @@ import { KEY_ESCAPE as h } from "../../../../constants/keyboard.const.js";
|
|
|
8
8
|
import { INK_CLASS_TITLE_GALLERY as D, INK_CLASS_STYLE_MENU as O, INK_CLASS_STYLE_MENU_PORTAL as g, INK_CLASS_STYLE_MENU_FORCED as Y, INK_CLASS_TITLE_GRID as $, INK_CLASS_TITLE_CELL as x, INK_CLASS_TITLE as S } from "../../../../constants/defaults.const.js";
|
|
9
9
|
import "../../../../constants/openai.const.js";
|
|
10
10
|
import "../../../../utils/paste.utils.js";
|
|
11
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
11
12
|
import { TITLE_STYLE_IDS as y, TITLE_PREVIEW_TEXT as k } from "../../../../plugins/titles/titles.const.js";
|
|
12
13
|
import { getToolbarDropdownMenuPosition as G } from "../ToolbarDropdown/ToolbarDropdown.utils.js";
|
|
13
14
|
import { ToolbarButton as U } from "../ToolbarButton/ToolbarButton.js";
|
|
14
|
-
const
|
|
15
|
+
const te = (v) => {
|
|
15
16
|
const { icon: I, disabled: l = !1, hint: N, onHint: w, pluginColor: C, onSelect: R } = v, [i, n] = _(!1), [m, A] = _({ top: p, left: p }), a = s(null), c = s(null), E = s(null);
|
|
16
17
|
return b(() => {
|
|
17
18
|
if (!i) return;
|
|
@@ -75,5 +76,5 @@ const oe = (v) => {
|
|
|
75
76
|
] });
|
|
76
77
|
};
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
te as TitleGallery
|
|
79
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const N=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const S=a=>{const{icon:u,title:r,hint:l,onHint:e,pluginColor:t,active:o=!1,onClick:i,disabled:c=!1,className:d}=a,q=b=>{b.preventDefault()},_=l||r;return s.jsx("span",{className:n.INK_CLASS_TOOL_WRAP,onMouseEnter:()=>e==null?void 0:e(_),onMouseLeave:()=>e==null?void 0:e(p.EMPTY_STRING),children:s.jsxs(N.Button,{title:r,"aria-label":r,"aria-pressed":o,disabled:c,active:o,className:d,onMouseDown:q,onClick:i,children:[u,t?s.jsx("span",{className:n.INK_CLASS_PLUGIN_PIP,style:{background:t},"aria-hidden":!0}):null]})})};exports.ToolbarButton=S;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { EMPTY_STRING as N } from "../../../../constants/generals.const.js";
|
|
3
3
|
import { INK_CLASS_TOOL_WRAP as _, INK_CLASS_PLUGIN_PIP 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 { Button as L } from "../../../../common-components/Button/Button.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import "react-dom";
|
|
9
|
-
const
|
|
10
|
+
const A = (a) => {
|
|
10
11
|
const {
|
|
11
|
-
icon:
|
|
12
|
+
icon: i,
|
|
12
13
|
title: e,
|
|
13
|
-
hint:
|
|
14
|
+
hint: l,
|
|
14
15
|
onHint: o,
|
|
15
16
|
pluginColor: r,
|
|
16
|
-
active:
|
|
17
|
+
active: t = !1,
|
|
17
18
|
onClick: n,
|
|
18
19
|
disabled: m = !1,
|
|
19
20
|
className: p
|
|
20
21
|
} = a, c = (d) => {
|
|
21
22
|
d.preventDefault();
|
|
22
|
-
}, u =
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
}, u = l || e;
|
|
24
|
+
return /* @__PURE__ */ s(
|
|
24
25
|
"span",
|
|
25
26
|
{
|
|
26
27
|
className: _,
|
|
@@ -31,15 +32,15 @@ const x = (a) => {
|
|
|
31
32
|
{
|
|
32
33
|
title: e,
|
|
33
34
|
"aria-label": e,
|
|
34
|
-
"aria-pressed":
|
|
35
|
+
"aria-pressed": t,
|
|
35
36
|
disabled: m,
|
|
36
|
-
active:
|
|
37
|
+
active: t,
|
|
37
38
|
className: p,
|
|
38
39
|
onMouseDown: c,
|
|
39
40
|
onClick: n,
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
-
r ? /* @__PURE__ */
|
|
42
|
+
i,
|
|
43
|
+
r ? /* @__PURE__ */ s("span", { className: I, style: { background: r }, "aria-hidden": !0 }) : null
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
)
|
|
@@ -47,5 +48,5 @@ const x = (a) => {
|
|
|
47
48
|
);
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
A as ToolbarButton
|
|
51
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const u=a=>{const{value:t,onChange:s,title:l,disabled:i=!1,type:o="text"}=a,n=r=>{s(r.target.value)};return e.jsxs("label",{className:"Ink-Editor__color",title:l,"aria-label":l,children:[e.jsx("span",{className:"Ink-Editor__color-swatch",style:{background:t},"data-type":o}),e.jsx("input",{type:"color",value:t,disabled:i,onChange:n,list:`ink-colors-${o}`}),e.jsx("datalist",{id:`ink-colors-${o}`,children:c.INK_COLOR_SWATCHES.map(r=>e.jsx("option",{value:r},r))})]})};exports.ToolbarColorPicker=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=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 u=a=>{const{value:t,onChange:s,title:l,disabled:i=!1,type:o="text"}=a,n=r=>{s(r.target.value)};return e.jsxs("label",{className:"Ink-Editor__color",title:l,"aria-label":l,children:[e.jsx("span",{className:"Ink-Editor__color-swatch",style:{background:t},"data-type":o}),e.jsx("input",{type:"color",value:t,disabled:i,onChange:n,list:`ink-colors-${o}`}),e.jsx("datalist",{id:`ink-colors-${o}`,children:c.INK_COLOR_SWATCHES.map(r=>e.jsx("option",{value:r},r))})]})};exports.ToolbarColorPicker=u;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { INK_COLOR_SWATCHES as
|
|
2
|
+
import { INK_COLOR_SWATCHES as p } from "../../../../constants/defaults.const.js";
|
|
3
3
|
import "../../../../constants/openai.const.js";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
-
const { value: e, onChange:
|
|
9
|
-
return /* @__PURE__ */ s("label", { className: "Ink-Editor__color", title:
|
|
8
|
+
const _ = (l) => {
|
|
9
|
+
const { value: e, onChange: i, title: r, disabled: n = !1, type: a = "text" } = l;
|
|
10
|
+
return /* @__PURE__ */ s("label", { className: "Ink-Editor__color", title: r, "aria-label": r, children: [
|
|
10
11
|
/* @__PURE__ */ t("span", { className: "Ink-Editor__color-swatch", style: { background: e }, "data-type": a }),
|
|
11
12
|
/* @__PURE__ */ t(
|
|
12
13
|
"input",
|
|
13
14
|
{
|
|
14
15
|
type: "color",
|
|
15
16
|
value: e,
|
|
16
|
-
disabled:
|
|
17
|
+
disabled: n,
|
|
17
18
|
onChange: (o) => {
|
|
18
|
-
|
|
19
|
+
i(o.target.value);
|
|
19
20
|
},
|
|
20
21
|
list: `ink-colors-${a}`
|
|
21
22
|
}
|
|
22
23
|
),
|
|
23
|
-
/* @__PURE__ */ t("datalist", { id: `ink-colors-${a}`, children:
|
|
24
|
+
/* @__PURE__ */ t("datalist", { id: `ink-colors-${a}`, children: p.map((o) => /* @__PURE__ */ t("option", { value: o }, o)) })
|
|
24
25
|
] });
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
_ as ToolbarColorPicker
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),A=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const C=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const s=require("./ToolbarCustomize.const.cjs"),I=t=>{const{open:T,options:n,visibleItems:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),A=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const C=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const s=require("./ToolbarCustomize.const.cjs"),I=t=>{const{open:T,options:n,visibleItems:i,onToggle:O,onClose:a,title:l=s.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE,closeLabel:c=s.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE,listAriaLabel:o=s.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA}=t;if(!T)return null;const _=new Set(i);return e.jsxs("div",{className:s.TOOLBAR_CUSTOMIZE_CLASS,"aria-label":l,children:[e.jsx("p",{className:s.TOOLBAR_CUSTOMIZE_TITLE_CLASS,children:l}),e.jsx("ul",{className:s.TOOLBAR_CUSTOMIZE_LIST_CLASS,"aria-label":o,children:n.map(r=>{const L=_.has(r),S=A.TOOLBAR_OPTION_LABELS[r]??r;return e.jsx("li",{className:s.TOOLBAR_CUSTOMIZE_ITEM_CLASS,children:e.jsxs("label",{children:[e.jsx("input",{type:s.TOOLBAR_CUSTOMIZE_INPUT_TYPE,checked:L,onChange:u=>O(r,u.target.checked)}),e.jsx("span",{children:S})]})},r)})}),e.jsx("div",{className:s.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS,children:e.jsx(C.Button,{type:"button",onClick:a,children:c})})]})};exports.ToolbarCustomize=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const _="Ink-ToolbarCustomize",O="Ink-ToolbarCustomize__title",L="Ink-ToolbarCustomize__list",S="Ink-ToolbarCustomize__item",A="Ink-ToolbarCustomize__actions",I=T.TOOLBAR_CUSTOMIZE_TITLE,C=T.TOOLBAR_CUSTOMIZE_CLOSE_LABEL,E=T.TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL,o="checkbox";exports.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS=A;exports.TOOLBAR_CUSTOMIZE_CLASS=_;exports.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE=C;exports.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA=E;exports.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE=I;exports.TOOLBAR_CUSTOMIZE_INPUT_TYPE=o;exports.TOOLBAR_CUSTOMIZE_ITEM_CLASS=S;exports.TOOLBAR_CUSTOMIZE_LIST_CLASS=L;exports.TOOLBAR_CUSTOMIZE_TITLE_CLASS=O;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../../../constants/toolbarMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const _="Ink-ToolbarCustomize",O="Ink-ToolbarCustomize__title",L="Ink-ToolbarCustomize__list",S="Ink-ToolbarCustomize__item",A="Ink-ToolbarCustomize__actions",I=T.TOOLBAR_CUSTOMIZE_TITLE,C=T.TOOLBAR_CUSTOMIZE_CLOSE_LABEL,E=T.TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL,o="checkbox";exports.TOOLBAR_CUSTOMIZE_ACTIONS_CLASS=A;exports.TOOLBAR_CUSTOMIZE_CLASS=_;exports.TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE=C;exports.TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA=E;exports.TOOLBAR_CUSTOMIZE_DEFAULT_TITLE=I;exports.TOOLBAR_CUSTOMIZE_INPUT_TYPE=o;exports.TOOLBAR_CUSTOMIZE_ITEM_CLASS=S;exports.TOOLBAR_CUSTOMIZE_LIST_CLASS=L;exports.TOOLBAR_CUSTOMIZE_TITLE_CLASS=O;
|
|
@@ -2,17 +2,18 @@ import { TOOLBAR_CUSTOMIZE_LIST_ARIA_LABEL as T, TOOLBAR_CUSTOMIZE_TITLE as _, T
|
|
|
2
2
|
import "../../../../constants/openai.const.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
+
const E = "Ink-ToolbarCustomize", i = "Ink-ToolbarCustomize__title", s = "Ink-ToolbarCustomize__list", U = "Ink-ToolbarCustomize__item", n = "Ink-ToolbarCustomize__actions", m = _, r = O, B = T, R = "checkbox";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
n as TOOLBAR_CUSTOMIZE_ACTIONS_CLASS,
|
|
11
|
+
E as TOOLBAR_CUSTOMIZE_CLASS,
|
|
12
|
+
r as TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE,
|
|
13
|
+
B as TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA,
|
|
14
|
+
m as TOOLBAR_CUSTOMIZE_DEFAULT_TITLE,
|
|
15
|
+
R as TOOLBAR_CUSTOMIZE_INPUT_TYPE,
|
|
15
16
|
U as TOOLBAR_CUSTOMIZE_ITEM_CLASS,
|
|
16
17
|
s as TOOLBAR_CUSTOMIZE_LIST_CLASS,
|
|
17
|
-
|
|
18
|
+
i as TOOLBAR_CUSTOMIZE_TITLE_CLASS
|
|
18
19
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { TOOLBAR_OPTION_LABELS as m } from "../../../../constants/toolbarMenu.const.js";
|
|
3
3
|
import "../../../../constants/openai.const.js";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import { Button as C } from "../../../../common-components/Button/Button.js";
|
|
6
7
|
import "react";
|
|
7
8
|
import "react-dom";
|
|
8
|
-
import { TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA as I, TOOLBAR_CUSTOMIZE_DEFAULT_TITLE as E, TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE as
|
|
9
|
-
const
|
|
9
|
+
import { TOOLBAR_CUSTOMIZE_DEFAULT_LIST_ARIA as I, TOOLBAR_CUSTOMIZE_DEFAULT_TITLE as E, TOOLBAR_CUSTOMIZE_DEFAULT_CLOSE as p, TOOLBAR_CUSTOMIZE_CLASS as d, TOOLBAR_CUSTOMIZE_TITLE_CLASS as U, TOOLBAR_CUSTOMIZE_LIST_CLASS as h, TOOLBAR_CUSTOMIZE_ITEM_CLASS as B, TOOLBAR_CUSTOMIZE_INPUT_TYPE as R, TOOLBAR_CUSTOMIZE_ACTIONS_CLASS as b } from "./ToolbarCustomize.const.js";
|
|
10
|
+
const D = (O) => {
|
|
10
11
|
const {
|
|
11
12
|
open: t,
|
|
12
13
|
options: _,
|
|
@@ -14,16 +15,16 @@ const x = (r) => {
|
|
|
14
15
|
onToggle: i,
|
|
15
16
|
onClose: s,
|
|
16
17
|
title: T = E,
|
|
17
|
-
closeLabel: L =
|
|
18
|
+
closeLabel: L = p,
|
|
18
19
|
listAriaLabel: n = I
|
|
19
|
-
} =
|
|
20
|
+
} = O;
|
|
20
21
|
if (!t) return null;
|
|
21
22
|
const o = new Set(a);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ r("div", { className: d, "aria-label": T, children: [
|
|
23
24
|
/* @__PURE__ */ e("p", { className: U, children: T }),
|
|
24
25
|
/* @__PURE__ */ e("ul", { className: h, "aria-label": n, children: _.map((l) => {
|
|
25
26
|
const S = o.has(l), c = m[l] ?? l;
|
|
26
|
-
return /* @__PURE__ */ e("li", { className: B, children: /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ e("li", { className: B, children: /* @__PURE__ */ r("label", { children: [
|
|
27
28
|
/* @__PURE__ */ e(
|
|
28
29
|
"input",
|
|
29
30
|
{
|
|
@@ -39,5 +40,5 @@ const x = (r) => {
|
|
|
39
40
|
] });
|
|
40
41
|
};
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
D as ToolbarCustomize
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),O=require("react-dom"),u=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs"),g=require("../../../../constants/colorMode.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const D=require("./ToolbarDropdown.utils.cjs"),K=()=>t.jsx("svg",{className:n.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:t.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),P=R=>{const{options:d,value:L,onChange:b,title:_,disabled:f=!1}=R,[i,l]=r.useState(!1),[E,w]=r.useState({top:u.NUMBER_ZERO,left:u.NUMBER_ZERO,minWidth:u.NUMBER_ZERO}),m=r.useRef(null),N=r.useRef(null),T=r.useRef(null),S=d.find(e=>e.value===L)??d[u.NUMBER_ZERO],I=(S==null?void 0:S.label)??c.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{w(D.getToolbarDropdownMenuPosition(N.current))};e();const o=s=>{var p,C;const v=s.target;(p=m.current)!=null&&p.contains(v)||(C=T.current)!=null&&C.contains(v)||l(!1)},a=s=>{s.key===x.KEY_ESCAPE&&l(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",a),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i]);const M=e=>{e.preventDefault()},h=()=>{f||l(e=>!e)};return t.jsxs("div",{className:n.INK_CLASS_STYLE_DD,ref:m,children:[t.jsxs("button",{ref:N,type:"button",className:n.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:f,onMouseDown:M,onClick:h,children:[t.jsx("span",{children:I}),t.jsx(K,{})]}),i?O.createPortal(t.jsx("div",{ref:T,className:`${n.INK_CLASS_STYLE_MENU} ${n.INK_CLASS_STYLE_MENU_PORTAL} ${n.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":g.COLOR_MODE_LIGHT,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===L,a=`${n.INK_CLASS_STYLE_OPTION}${o?`${c.SPACE_STRING}${n.INK_CLASS_STYLE_OPTION_SEL}`:c.EMPTY_STRING}`;return t.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),b(e.value),l(!1)},children:[o?t.jsx("span",{className:n.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:c.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=P;
|