eddyter 1.4.16 → 1.4.18

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 (45) hide show
  1. package/dist/AIChatPlugin-DsUPycjT.js +872 -0
  2. package/dist/CombinedAutocompletGrammarPlugin-BXOz6IRb.js +1778 -0
  3. package/dist/{CommentBubblePlugin-DZQW1ibY.js → CommentBubblePlugin-kiMehQkL.js} +5 -5
  4. package/dist/CommentPlugin-DIuM-Jao.js +154 -0
  5. package/dist/LazyCodeMirror-DdCIk-83.js +21374 -0
  6. package/dist/{LazySignatureCanvas-FKl1mD-T.js → LazySignatureCanvas-BtcxlSTW.js} +1 -1
  7. package/dist/NotePanelPlugin-FirMseLu.js +31 -0
  8. package/dist/TextEnhancePlugin-oXbL_F1i.js +199 -0
  9. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  10. package/dist/assets/style.css +1 -1
  11. package/dist/components/AiPlugin/commands.d.ts +4 -0
  12. package/dist/components/AiPlugin/index.d.ts +0 -4
  13. package/dist/components/CommentToggle/CommentToggle.d.ts +1 -0
  14. package/dist/components/ConfigurableEditorWithAuth.d.ts +2 -0
  15. package/dist/editor/components/FloatingToolbarManager.d.ts +2 -1
  16. package/dist/editor/components/ToolbarMount.d.ts +2 -1
  17. package/dist/{generateDocxThumbnail-DJlPLsdY.js → generateDocxThumbnail-RE7yNAXP.js} +7 -6
  18. package/dist/{generatePdfThumbnail-CfDAh39b.js → generatePdfThumbnail-CnldK2yE.js} +4 -4
  19. package/dist/{generateXlsxThumbnail-cRIT4Jyf.js → generateXlsxThumbnail-BpBB4ePK.js} +1 -1
  20. package/dist/{html2pdf.bundle.min-BW3dolOS.js → html2pdf.bundle.min-u-o_L5zA.js} +1 -1
  21. package/dist/{index-BEepnYCf.js → index-B4W_mfNI.js} +15 -15
  22. package/dist/{index-gjz4wieB.js → index-C8ZUqYRj.js} +56 -56
  23. package/dist/{index-W6_ogglw.js → index-CKRp6axU.js} +28 -28
  24. package/dist/{index-BydXFu_2.js → index-CL0adQ5R.js} +1 -1
  25. package/dist/{index-BDDjWwK4.js → index-CXyZgoBl.js} +16862 -21806
  26. package/dist/{index-BmfQcIrc.js → index-DZAvLKar.js} +118 -116
  27. package/dist/index-F2-F96Nx.js +720 -0
  28. package/dist/index.js +3 -3
  29. package/dist/marked.esm-Tjr8Gfse.js +1114 -0
  30. package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +1 -0
  31. package/dist/plugins/AIChatPlugin.commands.d.ts +7 -0
  32. package/dist/plugins/AIChatPlugin.d.ts +0 -7
  33. package/dist/plugins/CommentPlugin.commands.d.ts +5 -0
  34. package/dist/plugins/CommentPlugin.d.ts +0 -5
  35. package/dist/plugins/NotePanelPlugin.commands.d.ts +6 -0
  36. package/dist/plugins/NotePanelPlugin.d.ts +0 -6
  37. package/dist/plugins/TextEnhancePlugin.commands.d.ts +1 -0
  38. package/dist/plugins/TextEnhancePlugin.d.ts +0 -1
  39. package/dist/plugins/WordCountPlugin.d.ts +1 -0
  40. package/dist/sparkles-CTAYmQOE.js +17 -0
  41. package/dist/square-CupR-YWR.js +7 -0
  42. package/dist/types.d.ts +1 -0
  43. package/dist/useVoiceToText-U0yKgS5Q.js +153 -0
  44. package/package.json +5 -2
  45. package/dist/LazyCodeMirror-C1bW4mVF.js +0 -44822
@@ -0,0 +1,4 @@
1
+ export declare const AI_REPHRASE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<unknown>;
2
+ export declare const AI_IMAGE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
3
+ export declare const AI_TRANSLATE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
4
+ export declare const AI_ADJUST_TONE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
@@ -1,6 +1,2 @@
1
- export declare const AI_REPHRASE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<unknown>;
2
- export declare const AI_IMAGE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
3
- export declare const AI_TRANSLATE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
4
- export declare const AI_ADJUST_TONE_COMMAND: import('../../../node_modules/lexical').LexicalCommand<string | undefined>;
5
1
  declare const AIRephrasePlugin: () => import("react/jsx-runtime").JSX.Element;
6
2
  export default AIRephrasePlugin;
@@ -3,6 +3,7 @@ interface CommentToggleProps {
3
3
  isOpen: boolean;
4
4
  onClick: () => void;
5
5
  commentCount?: number;
6
+ fitToPage?: boolean;
6
7
  }
7
8
  declare const _default: React.NamedExoticComponent<CommentToggleProps>;
8
9
  export default _default;
@@ -52,6 +52,8 @@ interface ConfigurableEditorWithAuthProps {
52
52
  toolbar?: ToolbarConfig;
53
53
  /** Additional class name for floating elements and portal container */
54
54
  floatingToolbarClassName?: string;
55
+ /** Whether to constrain the editor width and center it like a document page */
56
+ fitToPage?: boolean;
55
57
  }
56
58
  declare const ConfigurableEditorWithAuth: React.FC<ConfigurableEditorWithAuthProps>;
57
59
  export default ConfigurableEditorWithAuth;
@@ -6,6 +6,7 @@ interface FloatingToolbarManagerProps {
6
6
  topOffset?: number;
7
7
  zIndex?: number;
8
8
  floatingToolbarClassName?: string;
9
+ className?: string;
9
10
  }
10
- export default function FloatingToolbarManager({ editorRef, children, mode, topOffset, zIndex, floatingToolbarClassName, }: FloatingToolbarManagerProps): import("react/jsx-runtime").JSX.Element;
11
+ export default function FloatingToolbarManager({ editorRef, children, mode, topOffset, zIndex, floatingToolbarClassName, className, }: FloatingToolbarManagerProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -4,6 +4,7 @@ interface ToolbarMountProps {
4
4
  children?: React.ReactNode;
5
5
  isFloating?: boolean;
6
6
  placeholderHeight?: number;
7
+ className?: string;
7
8
  }
8
- export default function ToolbarMount({ mountRef, children, isFloating, placeholderHeight, }: ToolbarMountProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function ToolbarMount({ mountRef, children, isFloating, placeholderHeight, className, }: ToolbarMountProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -1,5 +1,6 @@
1
- import { n as Tt, j as Se, Y as Ce, G as xe } from "./index-BDDjWwK4.js";
2
- import { h as Ee } from "./html2canvas.esm-BD_Vwvv8.js";
1
+ import { c as Tt, g as Se } from "./_commonjsHelpers-DaMA6jEr.js";
2
+ import { h as Ce } from "./html2canvas.esm-BD_Vwvv8.js";
3
+ import { a0 as xe, aC as Ee } from "./index-CXyZgoBl.js";
3
4
  function Ft(c) {
4
5
  throw new Error('Could not dynamically require "' + c + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
5
6
  }
@@ -5446,12 +5447,12 @@ async function Jr(c) {
5446
5447
  for (let i = 0; i < n.length; i++) o[i] = n.charCodeAt(i);
5447
5448
  return o;
5448
5449
  }
5449
- const e = `${Ce}${xe.project.proxyPdf}?url=${encodeURIComponent(c)}`, t = await fetch(e);
5450
+ const e = `${xe}${Ee.project.proxyPdf}?url=${encodeURIComponent(c)}`, t = await fetch(e);
5450
5451
  if (!t.ok) throw new Error(`File fetch failed: ${t.status}`);
5451
5452
  const r = await t.arrayBuffer();
5452
5453
  return new Uint8Array(r);
5453
5454
  }
5454
- async function en(c) {
5455
+ async function rn(c) {
5455
5456
  const e = await Jr(c), t = document.createElement("div");
5456
5457
  t.style.position = "fixed", t.style.left = "-9999px", t.style.top = "0", t.style.width = "624px", t.style.minHeight = "900px", t.style.overflow = "hidden", t.style.background = "#fff", t.style.zIndex = "99999", document.body.appendChild(t);
5457
5458
  const r = document.createElement("style");
@@ -5489,7 +5490,7 @@ async function en(c) {
5489
5490
  const k = d.getContext("2d");
5490
5491
  return k && (k.fillStyle = "#fff", k.fillRect(0, 0, Ct, xt)), d.toDataURL("image/png");
5491
5492
  }
5492
- const o = await Ee(n, {
5493
+ const o = await Ce(n, {
5493
5494
  scale: 1,
5494
5495
  useCORS: !0,
5495
5496
  logging: !1,
@@ -5516,5 +5517,5 @@ async function en(c) {
5516
5517
  }
5517
5518
  }
5518
5519
  export {
5519
- en as generateDocxThumbnail
5520
+ rn as generateDocxThumbnail
5520
5521
  };
@@ -1,7 +1,7 @@
1
- import { Y as u, G as b } from "./index-BDDjWwK4.js";
1
+ import { a0 as u, aC as C } from "./index-CXyZgoBl.js";
2
2
  const m = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174";
3
3
  let w = null;
4
- async function C() {
4
+ async function b() {
5
5
  if (w) return w;
6
6
  await new Promise((n, o) => {
7
7
  if (window.pdfjsLib) {
@@ -21,7 +21,7 @@ async function j(t) {
21
21
  for (let e = 0; e < i.length; e++) c[e] = i.charCodeAt(e);
22
22
  return c;
23
23
  }
24
- const n = `${u}${b.project.proxyPdf}?url=${encodeURIComponent(t)}`, o = await fetch(n);
24
+ const n = `${u}${C.project.proxyPdf}?url=${encodeURIComponent(t)}`, o = await fetch(n);
25
25
  if (!o.ok) throw new Error(`PDF fetch failed: ${o.status}`);
26
26
  const a = await o.arrayBuffer();
27
27
  return new Uint8Array(a);
@@ -29,7 +29,7 @@ async function j(t) {
29
29
  const p = 240, h = 176;
30
30
  async function D(t) {
31
31
  try {
32
- const n = await C(), o = await j(t), r = await (await n.getDocument({ data: o }).promise).getPage(1), i = r.getViewport({ scale: 1 }), c = p / i.width, e = r.getViewport({ scale: c }), s = document.createElement("canvas");
32
+ const n = await b(), o = await j(t), r = await (await n.getDocument({ data: o }).promise).getPage(1), i = r.getViewport({ scale: 1 }), c = p / i.width, e = r.getViewport({ scale: c }), s = document.createElement("canvas");
33
33
  s.width = e.width, s.height = e.height;
34
34
  const l = s.getContext("2d");
35
35
  if (!l) throw new Error("Could not get 2d context");
@@ -1,5 +1,5 @@
1
1
  import { h as Ci } from "./html2canvas.esm-BD_Vwvv8.js";
2
- import { Y as yi, G as Di } from "./index-BDDjWwK4.js";
2
+ import { a0 as yi, aC as Di } from "./index-CXyZgoBl.js";
3
3
  var In = 1252, Oi = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4], Zt = {
4
4
  /*::[*/
5
5
  0: 1252,
@@ -1,4 +1,4 @@
1
- import { n as Ka, j as $u } from "./index-BDDjWwK4.js";
1
+ import { c as Ka, g as $u } from "./_commonjsHelpers-DaMA6jEr.js";
2
2
  function tl(Qa, iu) {
3
3
  for (var jo = 0; jo < iu.length; jo++) {
4
4
  const qs = iu[jo];
@@ -1,11 +1,11 @@
1
- import { jsx as o, jsxs as j, Fragment as re } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as F, Fragment as re } from "react/jsx-runtime";
2
2
  import { $insertDataTransferForRichText as se } from "@lexical/clipboard";
3
3
  import { useLexicalComposerContext as ee } from "@lexical/react/LexicalComposerContext";
4
4
  import { mergeRegister as ce, $wrapNodeInElement as J } from "@lexical/utils";
5
5
  import { $isTableCellNode as ae } from "@lexical/table";
6
6
  import { $getNodeByKey as T, $createNodeSelection as G, $setSelection as H, $getSelection as S, $isNodeSelection as te, SELECTION_CHANGE_COMMAND as de, COMMAND_PRIORITY_LOW as ne, KEY_ENTER_COMMAND as le, $createParagraphNode as W, $isRootOrShadowRoot as V, PASTE_COMMAND as ue, $isRangeSelection as U, COMMAND_PRIORITY_CRITICAL as me } from "lexical";
7
7
  import { useState as M, useEffect as E, useCallback as _, useRef as Q } from "react";
8
- import { c as fe, E as k, L as pe, a as N, I as ge, C as he, W as be, b as ye, A as xe, d as Ee, e as Ce, f as ve, T as Ne, i as ke, $ as Z } from "./index-BDDjWwK4.js";
8
+ import { c as fe, aa as k, ab as pe, _ as N, ac as ge, ad as he, ae as be, af as ye, ag as xe, ah as Ee, ai as Ce, aj as ve, ak as Ne, al as ke, am as Z } from "./index-CXyZgoBl.js";
9
9
  import { createPortal as Ae } from "react-dom";
10
10
  const Pe = fe("Copy", [
11
11
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
@@ -30,8 +30,8 @@ function we({
30
30
  );
31
31
  if (R) {
32
32
  const v = R.getBoundingClientRect(), I = e.getBoundingClientRect(), X = y.getBoundingClientRect(), oe = v.left + v.width / 2, ie = I.width / 2;
33
- let F = v.top - I.height - 15, O = oe - ie;
34
- O < 10 && (O = 10), O + I.width > window.innerWidth - 10 && (O = window.innerWidth - I.width - 10), F < 10 && (F = v.bottom + 15), F -= X.top, O -= X.left, e.style.opacity = "1", e.style.transform = `translate(${O}px, ${F}px)`, r || (e.style.display = "flex", e.style.visibility = "visible", e.style.zIndex = "9999", l(!0));
33
+ let q = v.top - I.height - 15, O = oe - ie;
34
+ O < 10 && (O = 10), O + I.width > window.innerWidth - 10 && (O = window.innerWidth - I.width - 10), q < 10 && (q = v.bottom + 15), q -= X.top, O -= X.left, e.style.opacity = "1", e.style.transform = `translate(${O}px, ${q}px)`, r || (e.style.display = "flex", e.style.visibility = "visible", e.style.zIndex = "9999", l(!0));
35
35
  } else
36
36
  e.style.opacity = "0", e.style.visibility = "hidden";
37
37
  }, [c, n, y, r]), x = _(() => {
@@ -79,7 +79,7 @@ function we({
79
79
  const s = T(n);
80
80
  s instanceof k && typeof s.setAlignment == "function" && s.setAlignment(e);
81
81
  });
82
- }, q = (e) => {
82
+ }, j = (e) => {
83
83
  m(e), c.update(() => {
84
84
  const s = T(n);
85
85
  s instanceof k && typeof s.setPosition == "function" && s.setPosition(e);
@@ -104,7 +104,7 @@ function we({
104
104
  }, 100), () => {
105
105
  document.removeEventListener("mousedown", e);
106
106
  };
107
- }, [u, r]), /* @__PURE__ */ j(
107
+ }, [u, r]), /* @__PURE__ */ F(
108
108
  "div",
109
109
  {
110
110
  className: "floating-embed-menu cteditor-flex cteditor-gap-1 cteditor-z-10",
@@ -122,7 +122,7 @@ function we({
122
122
  transition: "opacity 0.15s ease-in-out"
123
123
  },
124
124
  children: [
125
- /* @__PURE__ */ j("div", { className: K, children: [
125
+ /* @__PURE__ */ F("div", { className: K, children: [
126
126
  /* @__PURE__ */ o(
127
127
  "button",
128
128
  {
@@ -170,7 +170,7 @@ function we({
170
170
  )
171
171
  ] }),
172
172
  /* @__PURE__ */ o("div", { className: "cteditor-w-px cteditor-h-6 cteditor-bg-border cteditor-flex-shrink-0" }),
173
- /* @__PURE__ */ j("div", { className: K, children: [
173
+ /* @__PURE__ */ F("div", { className: K, children: [
174
174
  /* @__PURE__ */ o(
175
175
  "button",
176
176
  {
@@ -180,7 +180,7 @@ function we({
180
180
  p === "left" && w
181
181
  ),
182
182
  onClick: (e) => {
183
- e.stopPropagation(), q(p === "left" ? "none" : "left");
183
+ e.stopPropagation(), j(p === "left" ? "none" : "left");
184
184
  },
185
185
  title: "Wrap text left (text beside card)",
186
186
  children: /* @__PURE__ */ o(be, {})
@@ -195,7 +195,7 @@ function we({
195
195
  p === "right" && w
196
196
  ),
197
197
  onClick: (e) => {
198
- e.stopPropagation(), q(p === "right" ? "none" : "right");
198
+ e.stopPropagation(), j(p === "right" ? "none" : "right");
199
199
  },
200
200
  title: "Wrap text right (text beside card)",
201
201
  children: /* @__PURE__ */ o(ye, {})
@@ -203,7 +203,7 @@ function we({
203
203
  )
204
204
  ] }),
205
205
  /* @__PURE__ */ o("div", { className: "cteditor-w-px cteditor-h-6 cteditor-bg-border cteditor-flex-shrink-0" }),
206
- /* @__PURE__ */ j("div", { className: K, children: [
206
+ /* @__PURE__ */ F("div", { className: K, children: [
207
207
  /* @__PURE__ */ o(
208
208
  "button",
209
209
  {
@@ -412,7 +412,7 @@ function Le(c, y) {
412
412
  return !1;
413
413
  }
414
414
  }
415
- const Fe = ({
415
+ const qe = ({
416
416
  floatingAnchorElem: c
417
417
  }) => {
418
418
  const y = c ?? (typeof document < "u" ? document.body : void 0), [n] = ee();
@@ -494,10 +494,10 @@ const Fe = ({
494
494
  x.forEach((z) => {
495
495
  C += z.textContent || "";
496
496
  });
497
- const $ = L.replace(C, "").trim(), q = !!h.body.querySelector(
497
+ const $ = L.replace(C, "").trim(), j = !!h.body.querySelector(
498
498
  "p,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,pre"
499
499
  );
500
- if ($.length === 0 && !q)
500
+ if ($.length === 0 && !j)
501
501
  return f.preventDefault(), n.update(
502
502
  () => {
503
503
  const z = S();
@@ -549,5 +549,5 @@ const Fe = ({
549
549
  ), [n]), /* @__PURE__ */ o(re, { children: /* @__PURE__ */ o(Re, { anchorElem: y }) });
550
550
  };
551
551
  export {
552
- Fe as default
552
+ qe as default
553
553
  };
@@ -3,8 +3,8 @@ import { I as it } from "./ImageResizer-BVwxL4Eh.js";
3
3
  import { CodeNode as ot } from "@lexical/code";
4
4
  import { LinkNode as nt } from "@lexical/link";
5
5
  import { AutoFocusPlugin as ct } from "@lexical/react/LexicalAutoFocusPlugin";
6
- import { useLexicalComposerContext as lt } from "@lexical/react/LexicalComposerContext";
7
- import { ContentEditable as at } from "@lexical/react/LexicalContentEditable";
6
+ import { useLexicalComposerContext as at } from "@lexical/react/LexicalComposerContext";
7
+ import { ContentEditable as lt } from "@lexical/react/LexicalContentEditable";
8
8
  import { LexicalErrorBoundary as dt } from "@lexical/react/LexicalErrorBoundary";
9
9
  import { HistoryPlugin as st } from "@lexical/react/LexicalHistoryPlugin";
10
10
  import { LexicalNestedComposer as ut } from "@lexical/react/LexicalNestedComposer";
@@ -13,36 +13,36 @@ import { RichTextPlugin as gt } from "@lexical/react/LexicalRichTextPlugin";
13
13
  import { useLexicalEditable as mt } from "@lexical/react/useLexicalEditable";
14
14
  import { useLexicalNodeSelection as pt } from "@lexical/react/useLexicalNodeSelection";
15
15
  import { mergeRegister as ht } from "@lexical/utils";
16
- import { $getSelection as P, $isNodeSelection as p, $setSelection as W, SELECTION_CHANGE_COMMAND as bt, COMMAND_PRIORITY_LOW as f, CLICK_COMMAND as Ct, DRAGSTART_COMMAND as Nt, KEY_DELETE_COMMAND as xt, KEY_BACKSPACE_COMMAND as vt, KEY_ENTER_COMMAND as Et, KEY_ESCAPE_COMMAND as yt, RootNode as Rt, TextNode as At, LineBreakNode as kt, ParagraphNode as St, $getNodeByKey as A, $isParagraphNode as T } from "lexical";
17
- import { useRef as L, useState as w, useCallback as x, useEffect as Dt } from "react";
18
- import { V as v, W as Pt, b as Lt, A as Mt, d as _t, e as $t, J as zt, T as It, O as Ot, P as Wt } from "./index-BDDjWwK4.js";
16
+ import { $getSelection as L, $isNodeSelection as p, $setSelection as W, SELECTION_CHANGE_COMMAND as bt, COMMAND_PRIORITY_LOW as f, CLICK_COMMAND as Ct, DRAGSTART_COMMAND as Nt, KEY_DELETE_COMMAND as xt, KEY_BACKSPACE_COMMAND as vt, KEY_ENTER_COMMAND as Et, KEY_ESCAPE_COMMAND as yt, RootNode as Rt, TextNode as kt, LineBreakNode as At, ParagraphNode as St, $getNodeByKey as k, $isParagraphNode as T } from "lexical";
17
+ import { useRef as P, useState as w, useCallback as x, useEffect as Dt } from "react";
18
+ import { aL as v, ae as Lt, af as Pt, ag as Mt, ah as _t, ai as $t, aE as It, ak as zt, aH as Ot, aI as Wt } from "./index-CXyZgoBl.js";
19
19
  function ie({
20
20
  src: j,
21
21
  nodeKey: g,
22
22
  width: h,
23
- height: k,
23
+ height: A,
24
24
  maxWidth: B,
25
25
  resizable: Y,
26
26
  showCaption: E,
27
27
  caption: b,
28
- captionsEnabled: V,
29
- controls: F = !0,
28
+ captionsEnabled: F,
29
+ controls: V = !0,
30
30
  position: n = "none"
31
31
  }) {
32
- const a = L(null), S = L(null), [l, d, C] = pt(g), [s, M] = w(!1), [o] = lt(), [y, H] = w(null), _ = L(null), K = mt(), D = x(
32
+ const l = P(null), S = P(null), [a, d, C] = pt(g), [s, M] = w(!1), [o] = at(), [y, H] = w(null), _ = P(null), K = mt(), D = x(
33
33
  (t) => {
34
- const r = P();
35
- return l && p(r) && (t.preventDefault(), o.update(() => {
34
+ const r = L();
35
+ return a && p(r) && (t.preventDefault(), o.update(() => {
36
36
  r.getNodes().forEach((c) => {
37
37
  v(c) && c.remove();
38
38
  });
39
39
  })), !1;
40
40
  },
41
- [o, l]
41
+ [o, a]
42
42
  ), $ = x(
43
43
  (t) => {
44
- const r = P(), e = S.current;
45
- if (l && p(r) && r.getNodes().length === 1) {
44
+ const r = L(), e = S.current;
45
+ if (a && p(r) && r.getNodes().length === 1) {
46
46
  if (E)
47
47
  return W(null), t.preventDefault(), b.focus(), !0;
48
48
  if (e !== null && e !== document.activeElement)
@@ -50,37 +50,37 @@ function ie({
50
50
  }
51
51
  return !1;
52
52
  },
53
- [b, l, E]
54
- ), z = x(
53
+ [b, a, E]
54
+ ), I = x(
55
55
  (t) => _.current === b || S.current === t.target ? (W(null), o.update(() => {
56
56
  d(!0);
57
57
  const r = o.getRootElement();
58
58
  r !== null && r.focus();
59
59
  }), !0) : !1,
60
60
  [b, o, d]
61
- ), I = x(
61
+ ), z = x(
62
62
  (t) => {
63
63
  const r = t;
64
64
  if (s)
65
65
  return !0;
66
66
  const e = r.target;
67
- if (e.closest("button") && a.current && e.closest(".editor-image") === a.current.closest(".editor-image"))
67
+ if (e.closest("button") && l.current && e.closest(".editor-image") === l.current.closest(".editor-image"))
68
68
  return !0;
69
- const c = e === a.current;
69
+ const c = e === l.current;
70
70
  let u = !1;
71
- if (!c && a.current) {
72
- const R = a.current.getBoundingClientRect();
71
+ if (!c && l.current) {
72
+ const R = l.current.getBoundingClientRect();
73
73
  u = r.clientX >= R.left && r.clientX <= R.right && r.clientY >= R.top && r.clientY <= R.bottom;
74
74
  }
75
- return c || u ? (r.shiftKey ? d(!l) : (C(), d(!0)), !0) : !1;
75
+ return c || u ? (r.shiftKey ? d(!a) : (C(), d(!0)), !0) : !1;
76
76
  },
77
- [s, l, d, C]
77
+ [s, a, d, C]
78
78
  );
79
79
  Dt(() => {
80
80
  let t = !0;
81
81
  const r = ht(
82
82
  o.registerUpdateListener(({ editorState: e }) => {
83
- t && H(e.read(() => P()));
83
+ t && H(e.read(() => L()));
84
84
  }),
85
85
  o.registerCommand(
86
86
  bt,
@@ -89,12 +89,12 @@ function ie({
89
89
  ),
90
90
  o.registerCommand(
91
91
  Ct,
92
- I,
92
+ z,
93
93
  f
94
94
  ),
95
95
  o.registerCommand(
96
96
  Nt,
97
- (e) => e.target === a.current ? (e.preventDefault(), !0) : !1,
97
+ (e) => e.target === l.current ? (e.preventDefault(), !0) : !1,
98
98
  f
99
99
  ),
100
100
  o.registerCommand(
@@ -110,7 +110,7 @@ function ie({
110
110
  o.registerCommand(Et, $, f),
111
111
  o.registerCommand(
112
112
  yt,
113
- z,
113
+ I,
114
114
  f
115
115
  )
116
116
  );
@@ -121,31 +121,31 @@ function ie({
121
121
  C,
122
122
  o,
123
123
  s,
124
- l,
124
+ a,
125
125
  g,
126
126
  D,
127
127
  $,
128
- z,
129
128
  I,
129
+ z,
130
130
  d
131
131
  ]);
132
132
  const X = () => {
133
133
  o.update(() => {
134
- const t = A(g);
134
+ const t = k(g);
135
135
  v(t) && t.setShowCaption(!0);
136
136
  });
137
137
  }, G = (t, r) => {
138
138
  setTimeout(() => {
139
139
  M(!1);
140
140
  }, 200), o.update(() => {
141
- const e = A(g);
141
+ const e = k(g);
142
142
  v(e) && e.setWidthAndHeight(t, r);
143
143
  });
144
- }, J = () => {
144
+ }, U = () => {
145
145
  M(!0);
146
- }, U = (t) => {
146
+ }, q = (t) => {
147
147
  t.preventDefault(), t.stopPropagation(), o.update(() => {
148
- const r = A(g);
148
+ const r = k(g);
149
149
  if (v(r)) {
150
150
  const e = r.getParent();
151
151
  r.remove(), e && T(e) && e.getChildrenSize() === 0 && e.setFormat("left");
@@ -153,27 +153,27 @@ function ie({
153
153
  });
154
154
  }, m = (t, r) => {
155
155
  t.preventDefault(), t.stopPropagation(), o.update(() => {
156
- const e = A(g);
156
+ const e = k(g);
157
157
  if (v(e)) {
158
158
  e.setPosition(r);
159
159
  const c = e.getParent();
160
160
  c && T(c) && (r === "left" ? c.setFormat("left") : r === "right" ? c.setFormat("right") : c.setFormat(""));
161
161
  }
162
162
  });
163
- }, q = x(
163
+ }, J = x(
164
164
  (t) => {
165
165
  if (s || t.target.closest("button"))
166
166
  return;
167
- const e = t.target === a.current;
167
+ const e = t.target === l.current;
168
168
  let c = !1;
169
- if (!e && a.current) {
170
- const u = a.current.getBoundingClientRect();
169
+ if (!e && l.current) {
170
+ const u = l.current.getBoundingClientRect();
171
171
  c = t.clientX >= u.left && t.clientX <= u.right && t.clientY >= u.top && t.clientY <= u.bottom;
172
172
  }
173
- !e && !c || (t.stopPropagation(), t.shiftKey ? d(!l) : (C(), d(!0)));
173
+ !e && !c || (t.stopPropagation(), t.shiftKey ? d(!a) : (C(), d(!0)));
174
174
  },
175
- [s, l, d, C]
176
- ), Q = l && p(y) && !s, O = (l || s) && K, Z = typeof h == "number" && typeof k == "number", tt = typeof h == "number" ? h : "auto", et = typeof k == "number" ? k : "auto";
175
+ [s, a, d, C]
176
+ ), Q = a && p(y) && !s, O = (a || s) && K, Z = typeof h == "number" && typeof A == "number", tt = typeof h == "number" ? h : "auto", et = typeof A == "number" ? A : "auto";
177
177
  return /* @__PURE__ */ N(rt, { children: [
178
178
  /* @__PURE__ */ N(
179
179
  "div",
@@ -207,14 +207,14 @@ function ie({
207
207
  position: "relative",
208
208
  display: "inline-block"
209
209
  },
210
- onClick: q,
210
+ onClick: J,
211
211
  children: [
212
212
  /* @__PURE__ */ i(
213
213
  "video",
214
214
  {
215
- ref: a,
215
+ ref: l,
216
216
  src: j,
217
- controls: F,
217
+ controls: V,
218
218
  preload: "metadata",
219
219
  className: O ? `focused ${p(y) ? "draggable" : ""}` : void 0,
220
220
  style: Z ? {
@@ -228,7 +228,7 @@ function ie({
228
228
  draggable: "false"
229
229
  }
230
230
  ),
231
- l && p(y) && /* @__PURE__ */ N("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: [
231
+ a && p(y) && /* @__PURE__ */ N("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: [
232
232
  /* @__PURE__ */ N("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-background/80 cteditor-rounded-md cteditor-shadow-md cteditor-border cteditor-border-border cteditor-p-0.5", children: [
233
233
  /* @__PURE__ */ i(
234
234
  "button",
@@ -238,7 +238,7 @@ function ie({
238
238
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "left" ? "cteditor-bg-accent" : ""}`,
239
239
  "aria-label": "Wrap text left",
240
240
  title: "Wrap text left",
241
- children: /* @__PURE__ */ i(Pt, {})
241
+ children: /* @__PURE__ */ i(Lt, {})
242
242
  }
243
243
  ),
244
244
  /* @__PURE__ */ i(
@@ -249,7 +249,7 @@ function ie({
249
249
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "right" ? "cteditor-bg-accent" : ""}`,
250
250
  "aria-label": "Wrap text right",
251
251
  title: "Wrap text right",
252
- children: /* @__PURE__ */ i(Lt, {})
252
+ children: /* @__PURE__ */ i(Pt, {})
253
253
  }
254
254
  ),
255
255
  /* @__PURE__ */ i("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
@@ -295,7 +295,7 @@ function ie({
295
295
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "none" ? "cteditor-bg-accent" : ""}`,
296
296
  "aria-label": "Inline",
297
297
  title: "Inline with text",
298
- children: /* @__PURE__ */ i(zt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
298
+ children: /* @__PURE__ */ i(It, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
299
299
  }
300
300
  )
301
301
  ] }),
@@ -304,12 +304,12 @@ function ie({
304
304
  {
305
305
  type: "button",
306
306
  onClick: (t) => {
307
- t.stopPropagation(), U(t);
307
+ t.stopPropagation(), q(t);
308
308
  },
309
309
  className: "cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
310
310
  "aria-label": "Delete video",
311
311
  title: "Delete video",
312
- children: /* @__PURE__ */ i(It, { className: "cteditor-w-4 cteditor-h-4" })
312
+ children: /* @__PURE__ */ i(zt, { className: "cteditor-w-4 cteditor-h-4" })
313
313
  }
314
314
  )
315
315
  ] }),
@@ -320,11 +320,11 @@ function ie({
320
320
  setShowCaption: X,
321
321
  editor: o,
322
322
  buttonRef: S,
323
- imageRef: a,
323
+ imageRef: l,
324
324
  maxWidth: B,
325
- onResizeStart: J,
325
+ onResizeStart: U,
326
326
  onResizeEnd: G,
327
- captionsEnabled: V
327
+ captionsEnabled: F
328
328
  }
329
329
  )
330
330
  ]
@@ -345,8 +345,8 @@ function ie({
345
345
  initialEditor: b,
346
346
  initialNodes: [
347
347
  Rt,
348
- At,
349
348
  kt,
349
+ At,
350
350
  St,
351
351
  nt,
352
352
  ot
@@ -357,7 +357,7 @@ function ie({
357
357
  gt,
358
358
  {
359
359
  contentEditable: /* @__PURE__ */ i(
360
- at,
360
+ lt,
361
361
  {
362
362
  "aria-placeholder": "Enter a caption...",
363
363
  placeholder: () => /* @__PURE__ */ i("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),