@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.
Files changed (213) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +9 -1
  3. package/bin/ink.const.mjs +26 -0
  4. package/bin/ink.mjs +58 -0
  5. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  6. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  7. package/dist/components/InkEditor/InkEditor.js +1178 -834
  8. package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
  9. package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
  10. package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
  11. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
  12. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
  13. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
  14. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +209 -0
  15. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
  16. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
  17. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
  18. package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
  19. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
  20. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
  21. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
  22. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
  23. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
  24. package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
  25. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
  26. package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
  28. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
  29. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
  31. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
  32. package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
  33. package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
  34. package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
  35. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
  36. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
  37. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
  38. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
  39. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
  40. package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
  41. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
  42. package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
  43. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -1
  44. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -1
  45. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +17 -12
  46. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +1 -0
  47. package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -1
  48. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -0
  49. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
  50. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
  51. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
  52. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
  53. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
  54. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
  55. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +95 -0
  56. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
  57. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
  58. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
  59. package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
  60. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
  61. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
  62. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
  63. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +81 -0
  64. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
  65. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
  66. package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
  67. package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
  68. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
  69. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
  70. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
  71. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
  72. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
  73. package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
  74. package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
  75. package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
  76. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
  77. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
  78. package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -18
  79. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  80. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
  81. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +25 -23
  82. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -1
  83. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +1 -1
  84. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -1
  85. package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +7 -7
  86. package/dist/components/InkEditor/components/index.d.ts +14 -0
  87. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  88. package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
  89. package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
  90. package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
  91. package/dist/components/InkEditor/helpers/format.utils.js +72 -72
  92. package/dist/constants/colorMode.const.cjs +1 -1
  93. package/dist/constants/colorMode.const.d.ts +1 -1
  94. package/dist/constants/colorMode.const.d.ts.map +1 -1
  95. package/dist/constants/colorMode.const.js +4 -4
  96. package/dist/constants/contextMenu.const.cjs +1 -1
  97. package/dist/constants/contextMenu.const.d.ts +2 -0
  98. package/dist/constants/contextMenu.const.d.ts.map +1 -1
  99. package/dist/constants/contextMenu.const.js +17 -15
  100. package/dist/constants/defaultIcons.cjs +1 -1
  101. package/dist/constants/defaultIcons.d.ts.map +1 -1
  102. package/dist/constants/defaultIcons.js +20 -13
  103. package/dist/constants/defaults.const.cjs +1 -1
  104. package/dist/constants/defaults.const.d.ts +48 -0
  105. package/dist/constants/defaults.const.d.ts.map +1 -1
  106. package/dist/constants/defaults.const.js +201 -102
  107. package/dist/constants/generals.const.cjs +1 -1
  108. package/dist/constants/generals.const.d.ts +48 -0
  109. package/dist/constants/generals.const.d.ts.map +1 -1
  110. package/dist/constants/generals.const.js +71 -28
  111. package/dist/constants/index.d.ts +1 -0
  112. package/dist/constants/index.d.ts.map +1 -1
  113. package/dist/constants/numbers.cjs +1 -1
  114. package/dist/constants/numbers.d.ts +14 -0
  115. package/dist/constants/numbers.d.ts.map +1 -1
  116. package/dist/constants/numbers.js +44 -30
  117. package/dist/constants/plugins.const.cjs +1 -0
  118. package/dist/constants/plugins.const.d.ts +13 -0
  119. package/dist/constants/plugins.const.d.ts.map +1 -0
  120. package/dist/constants/plugins.const.js +45 -0
  121. package/dist/constants/table.const.cjs +1 -1
  122. package/dist/constants/table.const.d.ts +4 -0
  123. package/dist/constants/table.const.d.ts.map +1 -1
  124. package/dist/constants/table.const.js +10 -6
  125. package/dist/constants/toolbar.const.cjs +1 -1
  126. package/dist/constants/toolbar.const.d.ts +7 -0
  127. package/dist/constants/toolbar.const.d.ts.map +1 -1
  128. package/dist/constants/toolbar.const.js +16 -9
  129. package/dist/constants/toolbarMenu.const.cjs +1 -1
  130. package/dist/constants/toolbarMenu.const.d.ts +2 -0
  131. package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
  132. package/dist/constants/toolbarMenu.const.js +80 -19
  133. package/dist/hooks/index.d.ts +2 -0
  134. package/dist/hooks/index.d.ts.map +1 -0
  135. package/dist/hooks/useToolbarOverflow.cjs +1 -0
  136. package/dist/hooks/useToolbarOverflow.d.ts +8 -0
  137. package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
  138. package/dist/hooks/useToolbarOverflow.js +29 -0
  139. package/dist/index.cjs +1 -1
  140. package/dist/index.d.ts +5 -2
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +117 -86
  143. package/dist/plugins/excel/excel.utils.cjs +1 -0
  144. package/dist/plugins/excel/excel.utils.d.ts +13 -0
  145. package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
  146. package/dist/plugins/excel/excel.utils.js +40 -0
  147. package/dist/plugins/excel/index.d.ts +3 -0
  148. package/dist/plugins/excel/index.d.ts.map +1 -0
  149. package/dist/plugins/graph/graph.const.cjs +1 -0
  150. package/dist/plugins/graph/graph.const.d.ts +14 -0
  151. package/dist/plugins/graph/graph.const.d.ts.map +1 -0
  152. package/dist/plugins/graph/graph.const.js +24 -0
  153. package/dist/plugins/graph/graph.types.d.ts +7 -0
  154. package/dist/plugins/graph/graph.types.d.ts.map +1 -0
  155. package/dist/plugins/graph/graph.utils.cjs +1 -0
  156. package/dist/plugins/graph/graph.utils.d.ts +11 -0
  157. package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
  158. package/dist/plugins/graph/graph.utils.js +76 -0
  159. package/dist/plugins/graph/index.d.ts +4 -0
  160. package/dist/plugins/graph/index.d.ts.map +1 -0
  161. package/dist/plugins/host/index.d.ts +2 -0
  162. package/dist/plugins/host/index.d.ts.map +1 -0
  163. package/dist/plugins/host/inkPlugins.cjs +1 -0
  164. package/dist/plugins/host/inkPlugins.d.ts +16 -0
  165. package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
  166. package/dist/plugins/host/inkPlugins.js +20 -0
  167. package/dist/plugins/index.d.ts +5 -0
  168. package/dist/plugins/index.d.ts.map +1 -0
  169. package/dist/plugins/theme/index.d.ts +4 -0
  170. package/dist/plugins/theme/index.d.ts.map +1 -0
  171. package/dist/plugins/theme/inkTheme.cjs +1 -0
  172. package/dist/plugins/theme/inkTheme.d.ts +5 -0
  173. package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
  174. package/dist/plugins/theme/inkTheme.js +30 -0
  175. package/dist/plugins/theme/theme.const.cjs +1 -0
  176. package/dist/plugins/theme/theme.const.d.ts +9 -0
  177. package/dist/plugins/theme/theme.const.d.ts.map +1 -0
  178. package/dist/plugins/theme/theme.const.js +15 -0
  179. package/dist/plugins/theme/theme.types.d.ts +12 -0
  180. package/dist/plugins/theme/theme.types.d.ts.map +1 -0
  181. package/dist/plugins/titles/index.d.ts +4 -0
  182. package/dist/plugins/titles/index.d.ts.map +1 -0
  183. package/dist/plugins/titles/titles.const.cjs +1 -0
  184. package/dist/plugins/titles/titles.const.d.ts +4 -0
  185. package/dist/plugins/titles/titles.const.d.ts.map +1 -0
  186. package/dist/plugins/titles/titles.const.js +15 -0
  187. package/dist/plugins/titles/titles.types.d.ts +2 -0
  188. package/dist/plugins/titles/titles.types.d.ts.map +1 -0
  189. package/dist/plugins/titles/titles.utils.cjs +1 -0
  190. package/dist/plugins/titles/titles.utils.d.ts +3 -0
  191. package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
  192. package/dist/plugins/titles/titles.utils.js +14 -0
  193. package/dist/styles.css +1 -1
  194. package/dist/types/features.types.d.ts +1 -1
  195. package/dist/types/features.types.d.ts.map +1 -1
  196. package/dist/types/index.d.ts +1 -0
  197. package/dist/types/index.d.ts.map +1 -1
  198. package/dist/types/ink.types.d.ts +6 -2
  199. package/dist/types/ink.types.d.ts.map +1 -1
  200. package/dist/types/plugin.types.d.ts +8 -0
  201. package/dist/types/plugin.types.d.ts.map +1 -0
  202. package/dist/types/premium.types.d.ts +1 -1
  203. package/dist/types/premium.types.d.ts.map +1 -1
  204. package/dist/utils/index.d.ts +1 -1
  205. package/dist/utils/index.d.ts.map +1 -1
  206. package/dist/utils/outline.utils.cjs +1 -1
  207. package/dist/utils/outline.utils.d.ts.map +1 -1
  208. package/dist/utils/outline.utils.js +32 -32
  209. package/dist/utils/table.utils.cjs +1 -1
  210. package/dist/utils/table.utils.d.ts +4 -0
  211. package/dist/utils/table.utils.d.ts.map +1 -1
  212. package/dist/utils/table.utils.js +84 -45
  213. 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,4 @@
1
+ import { FC } from 'react';
2
+ import { TitleGalleryProps } from './TitleGallery.types';
3
+ export declare const TitleGallery: FC<TitleGalleryProps>;
4
+ //# sourceMappingURL=TitleGallery.d.ts.map
@@ -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,3 @@
1
+ export { TitleGallery } from './TitleGallery';
2
+ export type { TitleGalleryProps } from './TitleGallery.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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 l=require("react/jsx-runtime");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const c=require("../../../../common-components/Button/Button.cjs");require("react");require("react-dom");const b=o=>{const{icon:r,title:e,active:t=!1,onClick:n,disabled:s=!1,className:i}=o,u=a=>{a.preventDefault()};return l.jsx(c.Button,{title:e,"aria-label":e,"aria-pressed":t,disabled:s,active:t,className:i,onMouseDown:u,onClick:n,children:r})};exports.ToolbarButton=b;
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;AAG5D,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAqBhD,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 l } from "react/jsx-runtime";
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 p } from "../../../../common-components/Button/Button.js";
6
+ import { Button as L } from "../../../../common-components/Button/Button.js";
5
7
  import "react";
6
8
  import "react-dom";
7
- const w = (e) => {
8
- const { icon: r, title: o, active: t = !1, onClick: s, disabled: i = !1, className: n } = e;
9
- return /* @__PURE__ */ l(
10
- p,
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
- title: o,
13
- "aria-label": o,
14
- "aria-pressed": t,
15
- disabled: i,
16
- active: t,
17
- className: n,
18
- onMouseDown: (a) => {
19
- a.preventDefault();
20
- },
21
- onClick: s,
22
- children: r
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
- w as ToolbarButton
50
+ x as ToolbarButton
28
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),g=require("react-dom"),u=require("../../../../constants/numbers.cjs"),c=require("../../../../constants/generals.const.cjs"),x=require("../../../../constants/keyboard.const.cjs"),t=require("../../../../constants/defaults.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const K=require("./ToolbarDropdown.utils.cjs"),P=()=>n.jsx("svg",{className:t.INK_CLASS_STYLE_CHEV,viewBox:"0 0 10 10","aria-hidden":"true",children:n.jsx("path",{d:"M2 3.5L5 6.5L8 3.5",stroke:"currentColor",strokeWidth:"1.4",fill:"none"})}),D=R=>{const{options:d,value:f,onChange:w,title:_,disabled:L=!1}=R,[i,l]=r.useState(!1),[E,C]=r.useState({top:u.NUMBER_ZERO,left:u.NUMBER_ZERO,minWidth:u.NUMBER_ZERO}),m=r.useRef(null),v=r.useRef(null),N=r.useRef(null),S=d.find(e=>e.value===f)??d[u.NUMBER_ZERO],h=(S==null?void 0:S.label)??c.EMPTY_STRING;r.useEffect(()=>{if(!i)return;const e=()=>{C(K.getToolbarDropdownMenuPosition(v.current))};e();const o=s=>{var p,b;const T=s.target;(p=m.current)!=null&&p.contains(T)||(b=N.current)!=null&&b.contains(T)||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 I=e=>{e.preventDefault()},M=()=>{L||l(e=>!e)};return n.jsxs("div",{className:t.INK_CLASS_STYLE_DD,ref:m,children:[n.jsxs("button",{ref:v,type:"button",className:t.INK_CLASS_STYLE_TRIGGER,title:_,"aria-label":_,"aria-haspopup":"listbox","aria-expanded":i,disabled:L,onMouseDown:I,onClick:M,children:[n.jsx("span",{children:h}),n.jsx(P,{})]}),i?g.createPortal(n.jsx("div",{ref:N,className:`${t.INK_CLASS_STYLE_MENU} ${t.INK_CLASS_STYLE_MENU_PORTAL}`,role:"listbox","aria-label":_,style:{top:E.top,left:E.left,minWidth:E.minWidth},children:d.map(e=>{const o=e.value===f,a=`${t.INK_CLASS_STYLE_OPTION}${o?`${c.SPACE_STRING}${t.INK_CLASS_STYLE_OPTION_SEL}`:c.EMPTY_STRING}`;return n.jsxs("button",{type:"button",role:"option","aria-selected":o,className:a,onMouseDown:s=>{s.preventDefault(),w(e.value),l(!1)},children:[o?n.jsx("span",{className:t.INK_CLASS_STYLE_CHECK,"aria-hidden":"true",children:c.INK_STYLE_CHECK}):null,e.label]},e.value)})}),document.body):null]})};exports.ToolbarDropdown=D;
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;AAiB9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAU9D,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4GpD,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 f, useEffect as K } from "react";
3
- import { createPortal as A } from "react-dom";
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 M, INK_STYLE_CHECK as P } from "../../../../constants/generals.const.js";
6
- import { KEY_ESCAPE as R } from "../../../../constants/keyboard.const.js";
7
- import { INK_CLASS_STYLE_DD as Y, INK_CLASS_STYLE_TRIGGER as D, INK_CLASS_STYLE_MENU as y, INK_CLASS_STYLE_MENU_PORTAL as x, INK_CLASS_STYLE_OPTION as O, INK_CLASS_STYLE_OPTION_SEL as k, INK_CLASS_STYLE_CHECK as $, INK_CLASS_STYLE_CHEV as G } from "../../../../constants/defaults.const.js";
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 H = () => /* @__PURE__ */ n("svg", { className: G, 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" }) }), oe = (h) => {
12
- const { options: a, value: E, onChange: b, title: c, disabled: S = !1 } = h, [r, s] = C(!1), [d, g] = C({
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
- }), _ = f(null), p = f(null), L = f(null), u = a.find((e) => e.value === E) ?? a[l], I = (u == null ? void 0 : u.label) ?? w;
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
- g(W(p.current));
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 = _.current) != null && N.contains(v) || (T = L.current) != null && T.contains(v) || s(!1);
27
+ (N = f.current) != null && N.contains(v) || (T = p.current) != null && T.contains(v) || s(!1);
27
28
  }, i = (t) => {
28
- t.key === R && s(!1);
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: Y, ref: _, children: [
34
+ }, [r]), /* @__PURE__ */ m("div", { className: O, ref: f, children: [
34
35
  /* @__PURE__ */ m(
35
36
  "button",
36
37
  {
37
- ref: p,
38
+ ref: L,
38
39
  type: "button",
39
- className: D,
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: I }),
53
- /* @__PURE__ */ n(H, {})
53
+ /* @__PURE__ */ n("span", { children: g }),
54
+ /* @__PURE__ */ n(j, {})
54
55
  ]
55
56
  }
56
57
  ),
57
- r ? A(
58
+ r ? M(
58
59
  /* @__PURE__ */ n(
59
60
  "div",
60
61
  {
61
- ref: L,
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 = `${O}${o ? `${M}${k}` : w}`;
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(), b(e.value), s(!1);
78
+ t.preventDefault(), I(e.value), s(!1);
77
79
  },
78
80
  children: [
79
- o ? /* @__PURE__ */ n("span", { className: $, "aria-hidden": "true", children: P }) : null,
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
- oe as ToolbarDropdown
95
+ re as ToolbarDropdown
94
96
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../constants/numbers.cjs");require("../../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const T=E=>{if(!E)return{top:t.NUMBER_ZERO,left:t.NUMBER_ZERO,minWidth:t.INK_STYLE_MENU_MIN_WIDTH_PX};const _=E.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight,e=Math.max(_.width,t.INK_STYLE_MENU_MIN_WIDTH_PX),r=Math.max(t.INK_STYLE_MENU_EDGE_PX,n-e-t.INK_STYLE_MENU_EDGE_PX),N=Math.min(Math.max(_.left,t.INK_STYLE_MENU_EDGE_PX),r),o=_.bottom+t.INK_STYLE_MENU_GAP_PX,M=_.top-t.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX-t.INK_STYLE_MENU_GAP_PX;return{top:o+t.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX>i-t.INK_STYLE_MENU_EDGE_PX?Math.max(t.INK_STYLE_MENU_EDGE_PX,M):o,left:N,minWidth:e}};exports.getToolbarDropdownMenuPosition=T;
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,KAC1B,2BAiBF,CAAC"}
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 _, NUMBER_ZERO as r, INK_STYLE_MENU_EDGE_PX as t, INK_STYLE_MENU_GAP_PX as m, INK_STYLE_MENU_ESTIMATED_HEIGHT_PX as E } from "../../../../constants/numbers.js";
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 l = (n) => {
8
- if (!n)
9
- return { top: r, left: r, minWidth: _ };
10
- const o = n.getBoundingClientRect(), p = window.innerWidth, M = window.innerHeight, i = Math.max(o.width, _), a = Math.max(t, p - i - t), c = Math.min(Math.max(o.left, t), a), e = o.bottom + m, h = o.top - E - m;
11
- return { top: e + E > M - t ? Math.max(t, h) : e, left: c, minWidth: i };
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
- l as getToolbarDropdownMenuPosition
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"),y=require("../../../constants/blocks.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");const M=require("../../../utils/blocks.utils.cjs");require("../../../utils/paste.utils.cjs");require("react");require("react-dom");const N="color",O="background-color",p="background",A="color",d="style",g=1,I=3,D="removeFormat",S="insertUnorderedList",m="insertOrderedList",U="superscript",h="subscript",B="styleWithCSS",i=(t,e)=>document.execCommand(t,!1,e),c=t=>document.queryCommandState(t),H=t=>document.queryCommandValue(t),P=t=>{if(!t)return!1;const e=t.startsWith("http://")||t.startsWith("https://")||t.startsWith("mailto:")?t:`https://${t}`;return i("createLink",e)},b=t=>i("foreColor",t),w=t=>i("hiliteColor",t),C=t=>i("insertHTML",t),F=(t,e="")=>{const o=e.replace(/"/g,"&quot;");return C(`<img src="${t}" alt="${o}" style="max-width:100%;height:auto;" />`)},k=t=>new Promise((e,o)=>{const n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=o,n.readAsDataURL(t)}),q=()=>{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(U)&&t.add("superscript"),c(h)&&t.add("subscript"),t},f=t=>{t.style.removeProperty(N),t.style.removeProperty(O),t.style.removeProperty(p),t.hasAttribute(A)&&t.removeAttribute(A);const e=t.getAttribute(d);e!==null&&!e.trim()&&t.removeAttribute(d)},R=()=>{const t=window.getSelection();if(!t||t.rangeCount===a.NUMBER_ZERO)return;const o=t.getRangeAt(a.NUMBER_ZERO).commonAncestorContainer,n=o.nodeType===g?o:o.parentElement;n&&(n instanceof HTMLElement&&t.containsNode(n,!0)&&f(n),n.querySelectorAll("*").forEach(s=>{s instanceof HTMLElement&&t.containsNode(s,!0)&&f(s)}))},Y=()=>{const t=i(D);return R(),t},v=t=>{const e=l.FONT_FAMILY_BY_VALUE[t]??t;if(i(B,"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)},W=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&&(W(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},V=()=>{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},Z=(t,e)=>{const o=window.getSelection(),n=M.getBlockElement((o==null?void 0:o.anchorNode)??null,t);return n?(n.setAttribute(y.DIR_ATTRIBUTE,e),!0):!1},K=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!==I)return!1;const n=o.textContent??"",s=e.anchorOffset,_=n.slice(a.NUMBER_ZERO,s),u=_.endsWith(r.LIST_MARKDOWN_DASH)?r.LIST_MARKDOWN_DASH:_.endsWith(r.LIST_MARKDOWN_STAR)?r.LIST_MARKDOWN_STAR:null;if(!u)return!1;const L=s-u.length;if(L<a.NUMBER_ZERO)return!1;const E=L>a.NUMBER_ZERO?_[L-1]:"";if(E&&E!==`
2
- `)return!1;t.preventDefault();const T=e.getRangeAt(a.NUMBER_ZERO);return T.setStart(o,L),T.setEnd(o,s),T.deleteContents(),i(S),!0};exports.applyFontFamily=v;exports.applyListType=x;exports.clearFormatDeep=Y;exports.detectListType=V;exports.execCommand=i;exports.fileToDataUrl=k;exports.getActiveFormats=q;exports.insertHTML=C;exports.insertImage=F;exports.insertLink=P;exports.queryCommandState=c;exports.queryCommandValue=H;exports.setBlockDirection=Z;exports.setHighlightColor=w;exports.setTextColor=b;exports.stripSelectionColors=R;exports.tryConvertMarkdownListPrefix=K;
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="&amp;",q="&lt;",F="&gt;",k="&quot;",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,"&quot;");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;AAEtC,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAOxC,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"}
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"}