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