@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { IMAGE_WIDTH_DEFAULT as c, IMAGE_WIDTH_MAX as m, IMAGE_WIDTH_MIN as s, setImageWidth as p, setImageAlt as _, setImageCaption as d, setImageAlign as b, IMAGE_ALIGN_LEFT as g, IMAGE_ALIGN_CENTER as A, IMAGE_ALIGN_RIGHT as E } from "../../../../utils/image.utils.js";
|
|
3
|
+
const N = (u) => {
|
|
4
|
+
var o, i;
|
|
5
|
+
const { image: t, onChange: n, onClose: I } = u, l = (e) => {
|
|
6
|
+
b(t, e), n();
|
|
7
|
+
};
|
|
8
|
+
return /* @__PURE__ */ r("div", { className: "Ink-ImageFrame", role: "toolbar", "aria-label": "Image", children: [
|
|
9
|
+
/* @__PURE__ */ r("label", { children: [
|
|
10
|
+
"Width",
|
|
11
|
+
/* @__PURE__ */ a(
|
|
12
|
+
"input",
|
|
13
|
+
{
|
|
14
|
+
type: "range",
|
|
15
|
+
min: s,
|
|
16
|
+
max: m,
|
|
17
|
+
defaultValue: t.clientWidth || c,
|
|
18
|
+
onChange: (e) => {
|
|
19
|
+
p(t, Number(e.target.value)), n();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ a("button", { type: "button", className: "Ink-Editor__button", onClick: () => l(g), children: "Left" }),
|
|
25
|
+
/* @__PURE__ */ a("button", { type: "button", className: "Ink-Editor__button", onClick: () => l(A), children: "Center" }),
|
|
26
|
+
/* @__PURE__ */ a("button", { type: "button", className: "Ink-Editor__button", onClick: () => l(E), children: "Right" }),
|
|
27
|
+
/* @__PURE__ */ a(
|
|
28
|
+
"input",
|
|
29
|
+
{
|
|
30
|
+
"aria-label": "Alt text",
|
|
31
|
+
defaultValue: t.alt,
|
|
32
|
+
placeholder: "Alt text",
|
|
33
|
+
onBlur: (e) => {
|
|
34
|
+
_(t, e.target.value), n();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ a(
|
|
39
|
+
"input",
|
|
40
|
+
{
|
|
41
|
+
"aria-label": "Caption",
|
|
42
|
+
defaultValue: ((i = (o = t.parentElement) == null ? void 0 : o.querySelector("figcaption")) == null ? void 0 : i.textContent) ?? "",
|
|
43
|
+
placeholder: "Caption",
|
|
44
|
+
onBlur: (e) => {
|
|
45
|
+
d(t, e.target.value), n();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ a("button", { type: "button", className: "Ink-Editor__button", onClick: I, children: "Done" })
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
N as ImageFrame
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/ImageFrame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),a=require("react");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const E=require("../../../../common-components/Button/Button.cjs");require("react-dom");const I=require("./InlineToolbar.const.cjs"),d=R=>{const{open:A,top:B,left:C,icons:e,activeFormats:L,disabled:O=!1,onFormat:u,onLink:c,onClose:o}=R,r=a.useRef(null);if(a.useEffect(()=>{if(!A)return;const N=l=>{var t;const i=l.target;if(!(i instanceof Node)){o();return}(t=r.current)!=null&&t.contains(i)||o()},s=l=>{l.key===I.INLINE_TOOLBAR_KEY_ESCAPE&&o()};return window.addEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.addEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s),()=>{window.removeEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.removeEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s)}},[A,o]),!A)return null;const n=N=>{N.preventDefault()},T=N=>{u(N)};return _.jsxs("div",{ref:r,className:I.INLINE_TOOLBAR_CLASS,role:I.INLINE_TOOLBAR_ROLE,"aria-label":I.INLINE_TOOLBAR_ARIA_LABEL,style:{top:B,left:C},onPointerDown:N=>N.stopPropagation(),children:[_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_BOLD,"aria-label":I.INLINE_TOOLBAR_TITLE_BOLD,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_BOLD),children:e.bold}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-label":I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_ITALIC),children:e.italic}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-label":I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_UNDERLINE),children:e.underline}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CODE,"aria-label":I.INLINE_TOOLBAR_TITLE_CODE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CODE),children:e.code}),_.jsx("span",{className:I.INLINE_TOOLBAR_DIVIDER_CLASS,"aria-hidden":"true"}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_LINK,"aria-label":I.INLINE_TOOLBAR_TITLE_LINK,disabled:O,"data-action":I.INLINE_TOOLBAR_LINK_ID,onMouseDown:n,onClick:c,children:e.link}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CLEAR,"aria-label":I.INLINE_TOOLBAR_TITLE_CLEAR,disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CLEAR),children:e.clearFormat})]})};exports.InlineToolbar=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),a=require("react");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const E=require("../../../../common-components/Button/Button.cjs");require("react-dom");const I=require("./InlineToolbar.const.cjs"),d=R=>{const{open:A,top:B,left:C,icons:e,activeFormats:L,disabled:O=!1,onFormat:u,onLink:c,onClose:o}=R,r=a.useRef(null);if(a.useEffect(()=>{if(!A)return;const N=l=>{var t;const i=l.target;if(!(i instanceof Node)){o();return}(t=r.current)!=null&&t.contains(i)||o()},s=l=>{l.key===I.INLINE_TOOLBAR_KEY_ESCAPE&&o()};return window.addEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.addEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s),()=>{window.removeEventListener(I.INLINE_TOOLBAR_EVENT_POINTER_DOWN,N),window.removeEventListener(I.INLINE_TOOLBAR_EVENT_KEY_DOWN,s)}},[A,o]),!A)return null;const n=N=>{N.preventDefault()},T=N=>{u(N)};return _.jsxs("div",{ref:r,className:I.INLINE_TOOLBAR_CLASS,role:I.INLINE_TOOLBAR_ROLE,"aria-label":I.INLINE_TOOLBAR_ARIA_LABEL,style:{top:B,left:C},onPointerDown:N=>N.stopPropagation(),children:[_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_BOLD,"aria-label":I.INLINE_TOOLBAR_TITLE_BOLD,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_BOLD),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_BOLD),children:e.bold}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-label":I.INLINE_TOOLBAR_TITLE_ITALIC,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_ITALIC),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_ITALIC),children:e.italic}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-label":I.INLINE_TOOLBAR_TITLE_UNDERLINE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_UNDERLINE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_UNDERLINE),children:e.underline}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CODE,"aria-label":I.INLINE_TOOLBAR_TITLE_CODE,"aria-pressed":L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),active:L==null?void 0:L.has(I.INLINE_TOOLBAR_ACTION_CODE),disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CODE),children:e.code}),_.jsx("span",{className:I.INLINE_TOOLBAR_DIVIDER_CLASS,"aria-hidden":"true"}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_LINK,"aria-label":I.INLINE_TOOLBAR_TITLE_LINK,disabled:O,"data-action":I.INLINE_TOOLBAR_LINK_ID,onMouseDown:n,onClick:c,children:e.link}),_.jsx(E.Button,{className:I.INLINE_TOOLBAR_ITEM_CLASS,title:I.INLINE_TOOLBAR_TITLE_CLEAR,"aria-label":I.INLINE_TOOLBAR_TITLE_CLEAR,disabled:O,onMouseDown:n,onClick:()=>T(I.INLINE_TOOLBAR_ACTION_CLEAR),children:e.clearFormat})]})};exports.InlineToolbar=d;
|
|
@@ -2,14 +2,15 @@ import { jsxs as K, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as P, useEffect as g } from "react";
|
|
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 l } from "../../../../common-components/Button/Button.js";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
import { INLINE_TOOLBAR_EVENT_POINTER_DOWN as B, INLINE_TOOLBAR_EVENT_KEY_DOWN as u, INLINE_TOOLBAR_ARIA_LABEL as x, INLINE_TOOLBAR_ROLE as y, INLINE_TOOLBAR_CLASS as V, INLINE_TOOLBAR_TITLE_BOLD as C, INLINE_TOOLBAR_ITEM_CLASS as _, INLINE_TOOLBAR_ACTION_BOLD as E, INLINE_TOOLBAR_TITLE_ITALIC as
|
|
8
|
-
const
|
|
8
|
+
import { INLINE_TOOLBAR_EVENT_POINTER_DOWN as B, INLINE_TOOLBAR_EVENT_KEY_DOWN as u, INLINE_TOOLBAR_ARIA_LABEL as x, INLINE_TOOLBAR_ROLE as y, INLINE_TOOLBAR_CLASS as V, INLINE_TOOLBAR_TITLE_BOLD as C, INLINE_TOOLBAR_ITEM_CLASS as _, INLINE_TOOLBAR_ACTION_BOLD as E, INLINE_TOOLBAR_TITLE_ITALIC as p, INLINE_TOOLBAR_ACTION_ITALIC as s, INLINE_TOOLBAR_TITLE_UNDERLINE as D, INLINE_TOOLBAR_ACTION_UNDERLINE as t, INLINE_TOOLBAR_TITLE_CODE as f, INLINE_TOOLBAR_ACTION_CODE as T, INLINE_TOOLBAR_DIVIDER_CLASS as j, INLINE_TOOLBAR_LINK_ID as U, INLINE_TOOLBAR_TITLE_LINK as h, INLINE_TOOLBAR_TITLE_CLEAR as w, INLINE_TOOLBAR_KEY_ESCAPE as W, INLINE_TOOLBAR_ACTION_CLEAR as Y } from "./InlineToolbar.const.js";
|
|
9
|
+
const $ = (b) => {
|
|
9
10
|
const {
|
|
10
11
|
open: O,
|
|
11
|
-
top:
|
|
12
|
-
left:
|
|
12
|
+
top: m,
|
|
13
|
+
left: k,
|
|
13
14
|
icons: L,
|
|
14
15
|
activeFormats: e,
|
|
15
16
|
disabled: I = !1,
|
|
@@ -46,7 +47,7 @@ const Z = (b) => {
|
|
|
46
47
|
className: V,
|
|
47
48
|
role: y,
|
|
48
49
|
"aria-label": x,
|
|
49
|
-
style: { top:
|
|
50
|
+
style: { top: m, left: k },
|
|
50
51
|
onPointerDown: (n) => n.stopPropagation(),
|
|
51
52
|
children: [
|
|
52
53
|
/* @__PURE__ */ o(
|
|
@@ -67,8 +68,8 @@ const Z = (b) => {
|
|
|
67
68
|
l,
|
|
68
69
|
{
|
|
69
70
|
className: _,
|
|
70
|
-
title:
|
|
71
|
-
"aria-label":
|
|
71
|
+
title: p,
|
|
72
|
+
"aria-label": p,
|
|
72
73
|
"aria-pressed": e == null ? void 0 : e.has(s),
|
|
73
74
|
active: e == null ? void 0 : e.has(s),
|
|
74
75
|
disabled: I,
|
|
@@ -81,8 +82,8 @@ const Z = (b) => {
|
|
|
81
82
|
l,
|
|
82
83
|
{
|
|
83
84
|
className: _,
|
|
84
|
-
title:
|
|
85
|
-
"aria-label":
|
|
85
|
+
title: D,
|
|
86
|
+
"aria-label": D,
|
|
86
87
|
"aria-pressed": e == null ? void 0 : e.has(t),
|
|
87
88
|
active: e == null ? void 0 : e.has(t),
|
|
88
89
|
disabled: I,
|
|
@@ -136,5 +137,5 @@ const Z = (b) => {
|
|
|
136
137
|
);
|
|
137
138
|
};
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
$ as InlineToolbar
|
|
140
141
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=o=>{const{open:l,top:i,left:s,people:n,onSelect:u}=o;return!l||n.length===0?null:t.jsx("div",{className:"Ink-Mentions",style:{top:i,left:s},role:"listbox","aria-label":"Mention someone",children:n.map(e=>t.jsxs("button",{type:"button",className:"Ink-Mentions__item",onMouseDown:r=>r.preventDefault(),onClick:()=>u(e),children:["@",e.label]},e.id))})};exports.MentionMenu=a;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface MentionMenuProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
people: Array<{
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
10
|
+
onSelect: (person: {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const MentionMenu: FC<MentionMenuProps>;
|
|
16
|
+
//# sourceMappingURL=MentionMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/MentionMenu/MentionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAkB5C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
const m = (t) => {
|
|
3
|
+
const { open: o, top: l, left: i, people: n, onSelect: s } = t;
|
|
4
|
+
return !o || n.length === 0 ? null : /* @__PURE__ */ r("div", { className: "Ink-Mentions", style: { top: l, left: i }, role: "listbox", "aria-label": "Mention someone", children: n.map((e) => /* @__PURE__ */ c(
|
|
5
|
+
"button",
|
|
6
|
+
{
|
|
7
|
+
type: "button",
|
|
8
|
+
className: "Ink-Mentions__item",
|
|
9
|
+
onMouseDown: (a) => a.preventDefault(),
|
|
10
|
+
onClick: () => s(e),
|
|
11
|
+
children: [
|
|
12
|
+
"@",
|
|
13
|
+
e.label
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
e.id
|
|
17
|
+
)) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
m as MentionMenu
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/MentionMenu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),N=require("../../../../constants/numbers.cjs"),e=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 L=r=>{const{items:_,activeIndex:t,onSelect:I,onHide:l}=r;return s.jsxs("aside",{className:e.INK_CLASS_OUTLINE,"aria-label":e.INK_OUTLINE_LABEL,children:[s.jsxs("div",{className:e.INK_CLASS_OUTLINE_LABEL,children:[e.INK_OUTLINE_LABEL,l?s.jsx("button",{type:"button",className:e.INK_CLASS_OUTLINE_TOGGLE,onClick:l,children:e.INK_OUTLINE_HIDE}):null]}),_.length===N.NUMBER_ZERO?s.jsx("p",{className:e.INK_CLASS_OUTLINE_ITEM,children:e.INK_OUTLINE_EMPTY}):null,_.map(n=>{const i=n.index===t;return s.jsxs("button",{type:"button",className:`${e.INK_CLASS_OUTLINE_ITEM} ${e.INK_CLASS_OUTLINE_ITEM}--h${n.level}${i?` ${e.INK_CLASS_OUTLINE_ITEM_ACTIVE}`:""}`,onClick:()=>I(n.index),children:[s.jsx("span",{className:`${e.INK_CLASS_OUTLINE_ITEM}-dot`,"aria-hidden":"true"}),n.text]},`${n.level}-${n.index}`)})]})};exports.OutlineRail=L;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { NUMBER_ZERO as I } from "../../../../constants/numbers.js";
|
|
3
|
-
import { INK_OUTLINE_LABEL as r, INK_CLASS_OUTLINE as c, INK_CLASS_OUTLINE_LABEL as E, INK_OUTLINE_HIDE as L, INK_CLASS_OUTLINE_TOGGLE as d, INK_OUTLINE_EMPTY as m, INK_CLASS_OUTLINE_ITEM as
|
|
3
|
+
import { INK_OUTLINE_LABEL as r, INK_CLASS_OUTLINE as c, INK_CLASS_OUTLINE_LABEL as E, INK_OUTLINE_HIDE as L, INK_CLASS_OUTLINE_TOGGLE as d, INK_OUTLINE_EMPTY as m, INK_CLASS_OUTLINE_ITEM as t, INK_CLASS_OUTLINE_ITEM_ACTIVE as p } 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 C = (N) => {
|
|
9
10
|
const { items: i, activeIndex: a, onSelect: s, onHide: o } = N;
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ n("aside", { className: c, "aria-label": r, children: [
|
|
12
|
+
/* @__PURE__ */ n("div", { className: E, children: [
|
|
12
13
|
r,
|
|
13
14
|
o ? /* @__PURE__ */ l("button", { type: "button", className: d, onClick: o, children: L }) : null
|
|
14
15
|
] }),
|
|
15
|
-
i.length === I ? /* @__PURE__ */ l("p", { className:
|
|
16
|
+
i.length === I ? /* @__PURE__ */ l("p", { className: t, children: m }) : null,
|
|
16
17
|
i.map((e) => {
|
|
17
18
|
const _ = e.index === a;
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
19
20
|
"button",
|
|
20
21
|
{
|
|
21
22
|
type: "button",
|
|
22
|
-
className: `${
|
|
23
|
+
className: `${t} ${t}--h${e.level}${_ ? ` ${p}` : ""}`,
|
|
23
24
|
onClick: () => s(e.index),
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */ l("span", { className: `${
|
|
26
|
+
/* @__PURE__ */ l("span", { className: `${t}-dot`, "aria-hidden": "true" }),
|
|
26
27
|
e.text
|
|
27
28
|
]
|
|
28
29
|
},
|
|
@@ -32,5 +33,5 @@ const x = (N) => {
|
|
|
32
33
|
] });
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
C as OutlineRail
|
|
36
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./PresenceStack.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./PresenceStack.const.cjs"),t=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");const o=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const S=require("../../../../utils/collab.utils.cjs"),A=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const E=require("../../../../constants/collab.const.cjs"),k=n=>n.avatarUrl?s.jsx("img",{src:n.avatarUrl,alt:n.name,className:"ink-presence-avatar-img"}):s.jsx("span",{className:"ink-presence-initials",children:S.getCollaboratorInitials(n.name)}),v=n=>{const{collaborators:i,maxAvatars:u=a.INK_PRESENCE_DEFAULT_MAX_AVATARS,onFollow:l,className:N=c.EMPTY_STRING}=n;if(!i||i.length===t.NUMBER_ZERO)return null;const R=i.slice(t.NUMBER_ZERO,u),r=Math.max(t.NUMBER_ZERO,i.length-u);return s.jsx("div",{className:o.cn("ink-presence-stack",N),role:"region","aria-label":a.COLLAB_ARIA_REGION,children:s.jsxs("div",{className:"ink-presence-avatars",children:[R.map(e=>{const _=e.status===E.INK_STATUS_IDLE,m=e.role||E.INK_ROLE_EDITOR,d=_?a.IDLE_LABEL_SUFFIX:c.EMPTY_STRING,I=`${e.name} (${m})${d}`;return s.jsxs(A.Button,{type:"button",className:"ink-presence-avatar-btn",style:{backgroundColor:e.color},title:I,onClick:()=>l==null?void 0:l(e),"aria-label":`${a.COLLAB_ARIA_LABEL_PREFIX}${e.name}`,children:[k(e),s.jsx("span",{className:o.cn("ink-presence-status-dot",_?"ink-presence-idle":"ink-presence-active")})]},e.id)}),r>t.NUMBER_ZERO&&s.jsxs("div",{className:"ink-presence-avatar-overflow",title:`${r} more collaborator${r>t.NUMBER_ONE?"s":c.EMPTY_STRING}`,"aria-label":`${r} more collaborator${r>t.NUMBER_ONE?"s":c.EMPTY_STRING}`,children:[a.PLUS_SIGN,r]})]})})};exports.PresenceStack=v;
|
|
@@ -5,6 +5,7 @@ import { EMPTY_STRING as a } from "../../../../constants/generals.const.js";
|
|
|
5
5
|
import "../../../../constants/openai.const.js";
|
|
6
6
|
import { cn as _ } from "../../../../utils/cn.utils.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
9
|
import { getCollaboratorInitials as R } from "../../../../utils/collab.utils.js";
|
|
9
10
|
import { Button as S } from "../../../../common-components/Button/Button.js";
|
|
10
11
|
import "react";
|
|
@@ -17,7 +18,7 @@ const $ = (t) => t.avatarUrl ? /* @__PURE__ */ i(
|
|
|
17
18
|
alt: t.name,
|
|
18
19
|
className: "ink-presence-avatar-img"
|
|
19
20
|
}
|
|
20
|
-
) : /* @__PURE__ */ i("span", { className: "ink-presence-initials", children: R(t.name) }),
|
|
21
|
+
) : /* @__PURE__ */ i("span", { className: "ink-presence-initials", children: R(t.name) }), X = (t) => {
|
|
21
22
|
const {
|
|
22
23
|
collaborators: n,
|
|
23
24
|
maxAvatars: l = I,
|
|
@@ -78,5 +79,5 @@ const $ = (t) => t.avatarUrl ? /* @__PURE__ */ i(
|
|
|
78
79
|
);
|
|
79
80
|
};
|
|
80
81
|
export {
|
|
81
|
-
|
|
82
|
+
X as PresenceStack
|
|
82
83
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./RemoteCursors.const.cjs"),t=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");const m=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const T=({collaborators:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./RemoteCursors.const.cjs"),t=require("../../../../constants/numbers.cjs"),l=require("../../../../constants/generals.const.cjs");require("../../../../constants/openai.const.cjs");const m=require("../../../../utils/cn.utils.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const T=({collaborators:u,className:c=l.EMPTY_STRING})=>{const n=(u||[]).filter(e=>e.cursor&&(e.cursor.offset!==void 0||e.cursor.line!==void 0));return n.length===t.NUMBER_ZERO?null:s.jsx("div",{className:m.cn("ink-remote-cursors-layer",c),"aria-hidden":"true",children:n.map(e=>{var i,o;const _=((i=e.cursor)==null?void 0:i.line)??t.NUMBER_ONE,R=((o=e.cursor)==null?void 0:o.col)??t.NUMBER_ZERO,E=Math.max(r.REMOTE_CURSOR_MIN_TOP_PX,(_-t.NUMBER_ONE)*r.REMOTE_CURSOR_LINE_HEIGHT_PX+r.REMOTE_CURSOR_TOP_OFFSET_PX),O=Math.max(r.REMOTE_CURSOR_MIN_LEFT_PX,R*r.REMOTE_CURSOR_CHAR_WIDTH_PX+r.REMOTE_CURSOR_LEFT_OFFSET_PX);return s.jsxs("div",{className:"ink-remote-cursor-item",style:{top:`${E}px`,left:`${O}px`},children:[s.jsx("div",{className:"ink-remote-cursor-caret",style:{backgroundColor:e.color}}),s.jsx("div",{className:"ink-remote-cursor-tag",style:{backgroundColor:e.color},children:e.name})]},e.id)})})};exports.RemoteCursors=T;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { REMOTE_CURSOR_MIN_LEFT_PX as
|
|
2
|
+
import { REMOTE_CURSOR_MIN_LEFT_PX as p, REMOTE_CURSOR_CHAR_WIDTH_PX as T, REMOTE_CURSOR_LEFT_OFFSET_PX as d, REMOTE_CURSOR_MIN_TOP_PX as l, REMOTE_CURSOR_LINE_HEIGHT_PX as M, REMOTE_CURSOR_TOP_OFFSET_PX as f } from "./RemoteCursors.const.js";
|
|
3
3
|
import { NUMBER_ZERO as i, NUMBER_ONE as m } from "../../../../constants/numbers.js";
|
|
4
4
|
import { EMPTY_STRING as C } from "../../../../constants/generals.const.js";
|
|
5
5
|
import "../../../../constants/openai.const.js";
|
|
6
6
|
import { cn as N } from "../../../../utils/cn.utils.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
9
|
import "react";
|
|
9
10
|
import "react-dom";
|
|
10
|
-
const
|
|
11
|
+
const X = ({
|
|
11
12
|
collaborators: _,
|
|
12
13
|
className: n = C
|
|
13
14
|
}) => {
|
|
@@ -25,8 +26,8 @@ const I = ({
|
|
|
25
26
|
l,
|
|
26
27
|
(c - m) * M + f
|
|
27
28
|
), O = Math.max(
|
|
28
|
-
|
|
29
|
-
R *
|
|
29
|
+
p,
|
|
30
|
+
R * T + d
|
|
30
31
|
);
|
|
31
32
|
return /* @__PURE__ */ u(
|
|
32
33
|
"div",
|
|
@@ -61,5 +62,5 @@ const I = ({
|
|
|
61
62
|
);
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
X as RemoteCursors
|
|
65
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const S=require("../../../../common-components/Button/Button.cjs"),x=require("../../../../common-components/Canvas/Canvas.cjs");require("react-dom");const n=require("./SignPad.const.cjs"),f=require("./SignPad.utils.cjs"),G=P=>{const{open:u,onClose:d,onConfirm:I,clearLabel:D=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:L=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:E=n.SIGN_PAD_DEFAULT_CANCEL,title:A=n.SIGN_PAD_DEFAULT_TITLE}=P,r=l.useRef(null),s=l.useRef(!1),[C,_]=l.useState(!1);if(l.useEffect(()=>{if(!u){s.current=!1;return}const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),e.strokeStyle=n.SIGN_PAD_STROKE_STYLE,e.lineWidth=n.SIGN_PAD_LINE_WIDTH,e.lineCap="round",e.lineJoin="round",s.current=!1,_(!1))},[u]),!u)return null;const h=t=>{const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;s.current=!0,e.setPointerCapture(t.pointerId);const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.beginPath(),o.moveTo(c.x,c.y)},g=t=>{if(!s.current)return;const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.lineTo(c.x,c.y),o.stroke(),_(!0)},N=t=>{var e;s.current=!1,(e=r.current)==null||e.releasePointerCapture(t.pointerId)},R=()=>{const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),_(!1))},T=()=>{const t=r.current;!t||!C||(I(t.toDataURL(n.SIGN_PAD_MIME)),d())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":A,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:A}),i.jsx(x.Canvas,{canvasRef:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:h,onPointerMove:g,onPointerUp:N,onPointerLeave:N}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx(S.Button,{type:"button",onClick:R,children:D}),i.jsx(S.Button,{type:"button",onClick:d,children:E}),i.jsx(S.Button,{type:"button",active:!0,disabled:!C,onClick:T,children:L})]})]})};exports.SignPad=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),a=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const S=require("../../../../common-components/Button/Button.cjs"),x=require("../../../../common-components/Canvas/Canvas.cjs");require("react-dom");const n=require("./SignPad.const.cjs"),f=require("./SignPad.utils.cjs"),G=P=>{const{open:u,onClose:d,onConfirm:I,clearLabel:D=n.SIGN_PAD_DEFAULT_CLEAR,confirmLabel:L=n.SIGN_PAD_DEFAULT_CONFIRM,cancelLabel:E=n.SIGN_PAD_DEFAULT_CANCEL,title:A=n.SIGN_PAD_DEFAULT_TITLE}=P,r=l.useRef(null),s=l.useRef(!1),[C,_]=l.useState(!1);if(l.useEffect(()=>{if(!u){s.current=!1;return}const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),e.strokeStyle=n.SIGN_PAD_STROKE_STYLE,e.lineWidth=n.SIGN_PAD_LINE_WIDTH,e.lineCap="round",e.lineJoin="round",s.current=!1,_(!1))},[u]),!u)return null;const h=t=>{const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;s.current=!0,e.setPointerCapture(t.pointerId);const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.beginPath(),o.moveTo(c.x,c.y)},g=t=>{if(!s.current)return;const e=r.current,o=e==null?void 0:e.getContext("2d");if(!e||!o)return;const c=f.getCanvasPoint(e,t.clientX,t.clientY);o.lineTo(c.x,c.y),o.stroke(),_(!0)},N=t=>{var e;s.current=!1,(e=r.current)==null||e.releasePointerCapture(t.pointerId)},R=()=>{const t=r.current,e=t==null?void 0:t.getContext("2d");!t||!e||(e.fillStyle=n.SIGN_PAD_FILL_STYLE,e.fillRect(a.NUMBER_ZERO,a.NUMBER_ZERO,t.width,t.height),_(!1))},T=()=>{const t=r.current;!t||!C||(I(t.toDataURL(n.SIGN_PAD_MIME)),d())};return i.jsxs("div",{className:n.SIGN_PAD_CLASS,role:"dialog","aria-modal":"true","aria-label":A,children:[i.jsx("p",{className:n.SIGN_PAD_TITLE_CLASS,children:A}),i.jsx(x.Canvas,{canvasRef:r,className:n.SIGN_PAD_CANVAS_CLASS,width:n.SIGN_PAD_CANVAS_WIDTH,height:n.SIGN_PAD_CANVAS_HEIGHT,onPointerDown:h,onPointerMove:g,onPointerUp:N,onPointerLeave:N}),i.jsxs("div",{className:n.SIGN_PAD_ACTIONS_CLASS,children:[i.jsx(S.Button,{type:"button",onClick:R,children:D}),i.jsx(S.Button,{type:"button",onClick:d,children:E}),i.jsx(S.Button,{type:"button",active:!0,disabled:!C,onClick:T,children:L})]})]})};exports.SignPad=G;
|
|
@@ -3,17 +3,18 @@ import { useRef as C, useState as T, useEffect as G } from "react";
|
|
|
3
3
|
import { NUMBER_ZERO as c } from "../../../../constants/numbers.js";
|
|
4
4
|
import "../../../../constants/openai.const.js";
|
|
5
5
|
import "../../../../utils/paste.utils.js";
|
|
6
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
6
7
|
import { Button as _ } from "../../../../common-components/Button/Button.js";
|
|
7
8
|
import { Canvas as g } from "../../../../common-components/Canvas/Canvas.js";
|
|
8
9
|
import "react-dom";
|
|
9
10
|
import { SIGN_PAD_DEFAULT_TITLE as x, SIGN_PAD_DEFAULT_CLEAR as R, SIGN_PAD_DEFAULT_CONFIRM as b, SIGN_PAD_DEFAULT_CANCEL as w, SIGN_PAD_FILL_STYLE as m, SIGN_PAD_STROKE_STYLE as y, SIGN_PAD_LINE_WIDTH as k, SIGN_PAD_CLASS as U, SIGN_PAD_TITLE_CLASS as F, SIGN_PAD_CANVAS_HEIGHT as H, SIGN_PAD_CANVAS_WIDTH as M, SIGN_PAD_CANVAS_CLASS as v, SIGN_PAD_ACTIONS_CLASS as O, SIGN_PAD_MIME as Y } from "./SignPad.const.js";
|
|
10
11
|
import { getCanvasPoint as I } from "./SignPad.utils.js";
|
|
11
|
-
const
|
|
12
|
+
const et = (N) => {
|
|
12
13
|
const {
|
|
13
14
|
open: a,
|
|
14
15
|
onClose: u,
|
|
15
|
-
onConfirm:
|
|
16
|
-
clearLabel:
|
|
16
|
+
onConfirm: p,
|
|
17
|
+
clearLabel: D = R,
|
|
17
18
|
confirmLabel: P = b,
|
|
18
19
|
cancelLabel: h = w,
|
|
19
20
|
title: S = x
|
|
@@ -61,15 +62,15 @@ const tt = (N) => {
|
|
|
61
62
|
/* @__PURE__ */ l(_, { type: "button", onClick: () => {
|
|
62
63
|
const e = n.current, t = e == null ? void 0 : e.getContext("2d");
|
|
63
64
|
!e || !t || (t.fillStyle = m, t.fillRect(c, c, e.width, e.height), s(!1));
|
|
64
|
-
}, children:
|
|
65
|
+
}, children: D }),
|
|
65
66
|
/* @__PURE__ */ l(_, { type: "button", onClick: u, children: h }),
|
|
66
67
|
/* @__PURE__ */ l(_, { type: "button", active: !0, disabled: !f, onClick: () => {
|
|
67
68
|
const e = n.current;
|
|
68
|
-
!e || !f || (
|
|
69
|
+
!e || !f || (p(e.toDataURL(Y)), u());
|
|
69
70
|
}, children: P })
|
|
70
71
|
] })
|
|
71
72
|
] });
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
et as SignPad
|
|
75
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),S=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");const N=require("../../../../utils/slash.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const m=i=>{var t;const{items:l,top:h,left:d,query:c,onSelect:o}=i;if(l.length===S.NUMBER_ZERO)return null;const u=N.groupSlashCommands(l),I=(t=l[S.NUMBER_ZERO])==null?void 0:t.id;return s.jsxs("div",{className:"Ink-Slash",style:{top:h,left:d},role:"listbox","aria-label":n.SLASH_ARIA_LABEL,children:[s.jsxs("div",{className:"Ink-Slash__search","aria-hidden":"true",children:[n.SLASH_SEARCH_LABEL,a.SLASH_PREFIX,c?` ${c}`:""]}),u.map(r=>s.jsxs("div",{className:"Ink-Slash__group",children:[s.jsx("div",{className:"Ink-Slash__cat",children:r.category}),r.items.map(e=>{const _=e.id===I;return s.jsxs("button",{type:"button",role:"option","aria-selected":_,className:`Ink-Slash__item${_?" Ink-Slash__item--sel":""}`,onMouseDown:A=>{A.preventDefault(),o(e)},children:[s.jsx("span",{className:`Ink-Slash__mark${e.category===n.SLASH_CATEGORY_AI?`${a.SPACE_STRING}${n.INK_CLASS_SLASH_MARK_AI}`:""}`,children:e.mark}),s.jsxs("span",{className:"Ink-Slash__txt",children:[s.jsx("span",{className:"Ink-Slash__name",children:e.label}),s.jsx("span",{className:"Ink-Slash__desc",children:e.description})]}),s.jsx("span",{className:"Ink-Slash__key",children:_?a.SLASH_ENTER_SHORTCUT:e.shortcut})]},e.id)})]},r.category)),s.jsxs("div",{className:"Ink-Slash__hint",children:[a.SLASH_HINT_BEFORE,s.jsx("span",{className:"Ink-Slash__caret","aria-hidden":"true"}),a.SLASH_HINT_AFTER,s.jsx("kbd",{className:"Ink-Slash__key",children:a.SLASH_MOD_SHORTCUT}),a.SLASH_HINT_AI]})]})};exports.SlashMenu=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),S=require("../../../../constants/numbers.cjs"),a=require("../../../../constants/generals.const.cjs"),n=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");const N=require("../../../../utils/slash.utils.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const m=i=>{var t;const{items:l,top:h,left:d,query:c,onSelect:o}=i;if(l.length===S.NUMBER_ZERO)return null;const u=N.groupSlashCommands(l),I=(t=l[S.NUMBER_ZERO])==null?void 0:t.id;return s.jsxs("div",{className:"Ink-Slash",style:{top:h,left:d},role:"listbox","aria-label":n.SLASH_ARIA_LABEL,children:[s.jsxs("div",{className:"Ink-Slash__search","aria-hidden":"true",children:[n.SLASH_SEARCH_LABEL,a.SLASH_PREFIX,c?` ${c}`:""]}),u.map(r=>s.jsxs("div",{className:"Ink-Slash__group",children:[s.jsx("div",{className:"Ink-Slash__cat",children:r.category}),r.items.map(e=>{const _=e.id===I;return s.jsxs("button",{type:"button",role:"option","aria-selected":_,className:`Ink-Slash__item${_?" Ink-Slash__item--sel":""}`,onMouseDown:A=>{A.preventDefault(),o(e)},children:[s.jsx("span",{className:`Ink-Slash__mark${e.category===n.SLASH_CATEGORY_AI?`${a.SPACE_STRING}${n.INK_CLASS_SLASH_MARK_AI}`:""}`,children:e.mark}),s.jsxs("span",{className:"Ink-Slash__txt",children:[s.jsx("span",{className:"Ink-Slash__name",children:e.label}),s.jsx("span",{className:"Ink-Slash__desc",children:e.description})]}),s.jsx("span",{className:"Ink-Slash__key",children:_?a.SLASH_ENTER_SHORTCUT:e.shortcut})]},e.id)})]},r.category)),s.jsxs("div",{className:"Ink-Slash__hint",children:[a.SLASH_HINT_BEFORE,s.jsx("span",{className:"Ink-Slash__caret","aria-hidden":"true"}),a.SLASH_HINT_AFTER,s.jsx("kbd",{className:"Ink-Slash__key",children:a.SLASH_MOD_SHORTCUT}),a.SLASH_HINT_AI]})]})};exports.SlashMenu=m;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as e, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { NUMBER_ZERO as S } from "../../../../constants/numbers.js";
|
|
3
|
-
import { SLASH_PREFIX as
|
|
3
|
+
import { SLASH_PREFIX as I, SPACE_STRING as A, SLASH_ENTER_SHORTCUT as N, SLASH_HINT_BEFORE as k, SLASH_HINT_AFTER as H, SLASH_HINT_AI as L, SLASH_MOD_SHORTCUT as u } from "../../../../constants/generals.const.js";
|
|
4
4
|
import { SLASH_ARIA_LABEL as E, SLASH_SEARCH_LABEL as R, INK_CLASS_SLASH_MARK_AI as T, SLASH_CATEGORY_AI as f } from "../../../../constants/defaults.const.js";
|
|
5
5
|
import "../../../../constants/openai.const.js";
|
|
6
6
|
import { groupSlashCommands as y } from "../../../../utils/slash.utils.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
8
9
|
import "react";
|
|
9
10
|
import "react-dom";
|
|
10
|
-
const
|
|
11
|
+
const F = (c) => {
|
|
11
12
|
var t;
|
|
12
13
|
const { items: l, top: o, left: i, query: _, onSelect: h } = c;
|
|
13
14
|
if (l.length === S) return null;
|
|
@@ -15,7 +16,7 @@ const D = (c) => {
|
|
|
15
16
|
return /* @__PURE__ */ e("div", { className: "Ink-Slash", style: { top: o, left: i }, role: "listbox", "aria-label": E, children: [
|
|
16
17
|
/* @__PURE__ */ e("div", { className: "Ink-Slash__search", "aria-hidden": "true", children: [
|
|
17
18
|
R,
|
|
18
|
-
|
|
19
|
+
I,
|
|
19
20
|
_ ? ` ${_}` : ""
|
|
20
21
|
] }),
|
|
21
22
|
d.map((n) => /* @__PURE__ */ e("div", { className: "Ink-Slash__group", children: [
|
|
@@ -29,8 +30,8 @@ const D = (c) => {
|
|
|
29
30
|
role: "option",
|
|
30
31
|
"aria-selected": r,
|
|
31
32
|
className: `Ink-Slash__item${r ? " Ink-Slash__item--sel" : ""}`,
|
|
32
|
-
onMouseDown: (
|
|
33
|
-
|
|
33
|
+
onMouseDown: (p) => {
|
|
34
|
+
p.preventDefault(), h(a);
|
|
34
35
|
},
|
|
35
36
|
children: [
|
|
36
37
|
/* @__PURE__ */ s(
|
|
@@ -61,5 +62,5 @@ const D = (c) => {
|
|
|
61
62
|
] });
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
F as SlashMenu
|
|
65
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),v=require("react-dom"),_=require("../../../../constants/numbers.cjs"),L=require("../../../../constants/generals.const.cjs"),w=require("../../../../constants/colorMode.const.cjs"),B=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");const b=require("../ToolbarDropdown/ToolbarDropdown.utils.cjs"),O=require("../ToolbarButton/ToolbarButton.cjs"),c=require("./TableSizePicker.const.cjs"),p=C=>{const{icon:f,disabled:I=!1,onSelect:P}=C,[a,E]=s.useState(!1),[u,d]=s.useState(c.TABLE_PICKER_INITIAL_HOVER),[T,m]=s.useState(c.TABLE_PICKER_EMPTY_POSITION),A=s.useRef(null),S=s.useRef(null),R=s.useRef(null);s.useEffect(()=>{if(!a)return;const e=()=>{const o=b.getToolbarDropdownMenuPosition(S.current);m({top:o.top,left:o.left})};e();const r=o=>{var K,N;const l=o.target;(K=A.current)!=null&&K.contains(l)||(N=R.current)!=null&&N.contains(l)||E(!1)},i=o=>{o.key===B.KEY_ESCAPE&&E(!1)};return document.addEventListener("mousedown",r),document.addEventListener("keydown",i),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",i),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[a]);const M=Array.from({length:_.INK_TABLE_PICKER_MAX*_.INK_TABLE_PICKER_MAX},(e,r)=>{const i=Math.floor(r/_.INK_TABLE_PICKER_MAX)+_.NUMBER_ONE,o=r%_.INK_TABLE_PICKER_MAX+_.NUMBER_ONE,l=i<=u.rows&&o<=u.cols;return{rows:i,cols:o,isOn:l,key:`${i}-${o}`}});return n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER,ref:A,children:[n.jsx("div",{ref:S,children:n.jsx(O.ToolbarButton,{icon:f,title:L.INK_TABLE_INSERT_TITLE,disabled:I,onClick:()=>{I||(d(c.TABLE_PICKER_INITIAL_HOVER),E(e=>!e))}})}),a?v.createPortal(n.jsxs("div",{ref:R,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL} ${t.INK_CLASS_STYLE_MENU_FORCED}`,"data-color-mode":w.COLOR_MODE_LIGHT,role:"grid","aria-label":L.INK_TABLE_INSERT_TITLE,style:{top:T.top,left:T.left},children:[n.jsx("div",{className:t.INK_CLASS_TABLE_PICKER_GRID,style:{gridTemplateColumns:`repeat(${_.INK_TABLE_PICKER_MAX}, 1fr)`},children:M.map(e=>n.jsx("button",{type:"button",className:`${t.INK_CLASS_TABLE_PICKER_CELL}${e.isOn?`${L.SPACE_STRING}${t.INK_CLASS_TABLE_PICKER_CELL_ON}`:""}`,"aria-label":`${e.rows}${c.TABLE_PICKER_TIMES_MARK}${e.cols}`,onMouseEnter:()=>d({rows:e.rows,cols:e.cols}),onMouseDown:r=>{r.preventDefault(),P(e.rows,e.cols),E(!1)}},e.key))}),n.jsxs("div",{className:t.INK_CLASS_TABLE_PICKER_LABEL,children:[u.rows,c.TABLE_PICKER_TIMES_MARK,u.cols]})]}),document.body):null]})};exports.TableSizePicker=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("../../../../utils/exportDocument.utils.cjs");require("react");require("react-dom");const e={rows:E.NUMBER_ONE,cols:E.NUMBER_ONE},_={top:E.NUMBER_ZERO,left:E.NUMBER_ZERO},r=" × ";exports.TABLE_PICKER_EMPTY_POSITION=_;exports.TABLE_PICKER_INITIAL_HOVER=e;exports.TABLE_PICKER_TIMES_MARK=r;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { NUMBER_ONE as o, NUMBER_ZERO as
|
|
1
|
+
import { NUMBER_ONE as o, NUMBER_ZERO as t } from "../../../../constants/numbers.js";
|
|
2
2
|
import "../../../../constants/openai.const.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../../utils/paste.utils.js";
|
|
5
|
+
import "../../../../utils/exportDocument.utils.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react-dom";
|
|
7
|
-
const
|
|
8
|
+
const i = {
|
|
8
9
|
rows: o,
|
|
9
10
|
cols: o
|
|
10
11
|
}, T = {
|
|
11
|
-
top:
|
|
12
|
-
left:
|
|
13
|
-
},
|
|
12
|
+
top: t,
|
|
13
|
+
left: t
|
|
14
|
+
}, s = " × ";
|
|
14
15
|
export {
|
|
15
16
|
T as TABLE_PICKER_EMPTY_POSITION,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
i as TABLE_PICKER_INITIAL_HOVER,
|
|
18
|
+
s as TABLE_PICKER_TIMES_MARK
|
|
18
19
|
};
|