eddyter 1.4.1 → 1.4.2

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.
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext as B } from "@lexical/react/LexicalComposerContext";
3
3
  import { $getNodeByKey as b } from "lexical";
4
4
  import { useState as E, useEffect as N } from "react";
5
- import { w as y, x as k, y as I, F as x, z as T, G as W } from "./index-DEq8XY_W.js";
5
+ import { x as y, y as k, z as I, F as x, G as T, H as W } from "./index-TGGbJHQ1.js";
6
6
  function $(e, t) {
7
7
  const c = e.split(".").pop()?.toLowerCase();
8
8
  return c === "pdf" || t.startsWith("data:application/pdf") ? "pdf" : c === "docx" || t.startsWith("data:application/vnd.openxmlformats") && e.toLowerCase().endsWith(".docx") ? "docx" : c === "xlsx" || c === "xls" || t.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml") || t.startsWith("data:application/vnd.ms-excel") ? "xlsx" : null;
@@ -16,15 +16,15 @@ function z(e, t) {
16
16
  return;
17
17
  }
18
18
  let l = !1;
19
- return d === "pdf" ? import("./generatePdfThumbnail-DPyHgUN3.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
19
+ return d === "pdf" ? import("./generatePdfThumbnail-CJxW0G8e.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
20
20
  l || n(o);
21
21
  }).catch(() => {
22
22
  l || n(null);
23
- }) : d === "docx" ? import("./generateDocxThumbnail-DMHM2faY.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
23
+ }) : d === "docx" ? import("./generateDocxThumbnail-BeH7SNAr.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
24
24
  l || n(o);
25
25
  }).catch(() => {
26
26
  l || n(null);
27
- }) : d === "xlsx" && import("./generateXlsxThumbnail-DUT9G8ak.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
27
+ }) : d === "xlsx" && import("./generateXlsxThumbnail-DyRikb2K.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
28
28
  l || n(o);
29
29
  }).catch(() => {
30
30
  l || n(null);
@@ -120,7 +120,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
120
120
  className: "cteditor-w-full cteditor-h-full cteditor-object-cover"
121
121
  }
122
122
  ) : /* @__PURE__ */ r("div", { className: "*:cteditor-size-8", children: C(t) }) }),
123
- /* @__PURE__ */ p("div", { className: "cteditor-flex cteditor-items-start cteditor-gap-2 cteditor-w-full", children: [
123
+ /* @__PURE__ */ p("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-w-full", children: [
124
124
  /* @__PURE__ */ p("div", { className: "cteditor-flex-1 cteditor-min-w-0", children: [
125
125
  /* @__PURE__ */ r("div", { className: "cteditor-font-medium cteditor-text-xs cteditor-text-foreground cteditor-truncate", children: t }),
126
126
  c && /* @__PURE__ */ r("div", { className: "cteditor-text-xs cteditor-text-muted-foreground", children: R(c) })
@@ -13,11 +13,11 @@ import { RichTextPlugin as gt } from "@lexical/react/LexicalRichTextPlugin";
13
13
  import { useLexicalEditable as mt } from "@lexical/react/useLexicalEditable";
14
14
  import { useLexicalNodeSelection as ht } from "@lexical/react/useLexicalNodeSelection";
15
15
  import { mergeRegister as pt } from "@lexical/utils";
16
- import { $getSelection as L, $isNodeSelection as h, $setSelection as O, 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 j, useCallback as x, useEffect as Dt } from "react";
18
- import { H as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt, y as It, L as Wt, i as Ot } from "./index-DEq8XY_W.js";
16
+ import { $getSelection as L, $isNodeSelection as h, $setSelection as O, 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 Rt, RootNode as kt, TextNode as yt, LineBreakNode as At, ParagraphNode as St, $getNodeByKey as y, $isParagraphNode as T } from "lexical";
17
+ import { useRef as P, useState as w, useCallback as x, useEffect as Dt } from "react";
18
+ import { J as v, W as Lt, k as Pt, A as Mt, l as _t, m as $t, T as zt, z as It, L as Wt, i as Ot } from "./index-TGGbJHQ1.js";
19
19
  function ie({
20
- src: w,
20
+ src: j,
21
21
  nodeKey: g,
22
22
  width: p,
23
23
  height: A,
@@ -29,7 +29,7 @@ function ie({
29
29
  controls: V = !0,
30
30
  position: n = "none"
31
31
  }) {
32
- const a = P(null), S = P(null), [l, d, C] = ht(g), [s, M] = j(!1), [o] = lt(), [y, H] = j(null), _ = P(null), K = mt(), D = x(
32
+ const a = P(null), S = P(null), [l, d, C] = ht(g), [s, M] = w(!1), [o] = lt(), [R, H] = w(null), _ = P(null), K = mt(), D = x(
33
33
  (t) => {
34
34
  const r = L();
35
35
  return l && h(r) && (t.preventDefault(), o.update(() => {
@@ -69,8 +69,8 @@ function ie({
69
69
  const c = e === a.current;
70
70
  let u = !1;
71
71
  if (!c && a.current) {
72
- const R = a.current.getBoundingClientRect();
73
- u = r.clientX >= R.left && r.clientX <= R.right && r.clientY >= R.top && r.clientY <= R.bottom;
72
+ const k = a.current.getBoundingClientRect();
73
+ u = r.clientX >= k.left && r.clientX <= k.right && r.clientY >= k.top && r.clientY <= k.bottom;
74
74
  }
75
75
  return c || u ? (r.shiftKey ? d(!l) : (C(), d(!0)), !0) : !1;
76
76
  },
@@ -109,7 +109,7 @@ function ie({
109
109
  ),
110
110
  o.registerCommand(Et, $, f),
111
111
  o.registerCommand(
112
- yt,
112
+ Rt,
113
113
  z,
114
114
  f
115
115
  )
@@ -131,21 +131,21 @@ function ie({
131
131
  ]);
132
132
  const X = () => {
133
133
  o.update(() => {
134
- const t = k(g);
134
+ const t = y(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 = k(g);
141
+ const e = y(g);
142
142
  v(e) && e.setWidthAndHeight(t, r);
143
143
  });
144
- }, U = () => {
144
+ }, J = () => {
145
145
  M(!0);
146
- }, q = (t) => {
146
+ }, U = (t) => {
147
147
  t.preventDefault(), t.stopPropagation(), o.update(() => {
148
- const r = k(g);
148
+ const r = y(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,14 +153,14 @@ function ie({
153
153
  });
154
154
  }, m = (t, r) => {
155
155
  t.preventDefault(), t.stopPropagation(), o.update(() => {
156
- const e = k(g);
156
+ const e = y(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
- }, J = x(
163
+ }, q = x(
164
164
  (t) => {
165
165
  if (s || t.target.closest("button"))
166
166
  return;
@@ -173,7 +173,7 @@ function ie({
173
173
  !e && !c || (t.stopPropagation(), t.shiftKey ? d(!l) : (C(), d(!0)));
174
174
  },
175
175
  [s, l, d, C]
176
- ), Q = l && h(y) && !s, W = (l || s) && K, Z = typeof p == "number" && typeof A == "number", tt = typeof p == "number" ? p : "auto", et = typeof A == "number" ? A : "auto";
176
+ ), Q = l && h(R) && !s, W = (l || s) && K, Z = typeof p == "number" && typeof A == "number", tt = typeof p == "number" ? p : "auto", et = typeof A == "number" ? A : "auto";
177
177
  return /* @__PURE__ */ N(rt, { children: [
178
178
  /* @__PURE__ */ N(
179
179
  "div",
@@ -207,16 +207,16 @@ function ie({
207
207
  position: "relative",
208
208
  display: "inline-block"
209
209
  })(),
210
- onClick: J,
210
+ onClick: q,
211
211
  children: [
212
212
  /* @__PURE__ */ i(
213
213
  "video",
214
214
  {
215
215
  ref: a,
216
- src: w,
216
+ src: j,
217
217
  controls: V,
218
218
  preload: "metadata",
219
- className: W ? `focused ${h(y) ? "draggable" : ""}` : void 0,
219
+ className: W ? `focused ${h(R) ? "draggable" : ""}` : void 0,
220
220
  style: Z ? {
221
221
  width: tt,
222
222
  height: et,
@@ -228,7 +228,7 @@ function ie({
228
228
  draggable: "false"
229
229
  }
230
230
  ),
231
- l && h(y) && /* @__PURE__ */ N("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: [
231
+ l && h(R) && /* @__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",
@@ -297,7 +297,7 @@ function ie({
297
297
  "button",
298
298
  {
299
299
  onClick: (t) => {
300
- t.stopPropagation(), q(t);
300
+ t.stopPropagation(), U(t);
301
301
  },
302
302
  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",
303
303
  "aria-label": "Delete video",
@@ -306,7 +306,7 @@ function ie({
306
306
  }
307
307
  )
308
308
  ] }),
309
- Y && h(y) && W && /* @__PURE__ */ i(
309
+ Y && h(R) && W && /* @__PURE__ */ i(
310
310
  it,
311
311
  {
312
312
  showCaption: E,
@@ -315,7 +315,7 @@ function ie({
315
315
  buttonRef: S,
316
316
  imageRef: a,
317
317
  maxWidth: B,
318
- onResizeStart: U,
318
+ onResizeStart: J,
319
319
  onResizeEnd: G,
320
320
  captionsEnabled: F
321
321
  }
@@ -337,8 +337,8 @@ function ie({
337
337
  {
338
338
  initialEditor: b,
339
339
  initialNodes: [
340
- Rt,
341
340
  kt,
341
+ yt,
342
342
  At,
343
343
  St,
344
344
  nt,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { K as a, M as r, N as t, O as s, P as o, Q as d, R as v, U as u, V as f, X as n, Y as l, Z as w } from "./index-DEq8XY_W.js";
1
+ import { M as a, N as r, O as t, P as s, Q as o, R as d, U as v, V as u, Y as f, Z as n, _ as l, a0 as w } from "./index-TGGbJHQ1.js";
2
2
  export {
3
3
  a as ConfigurableEditor,
4
4
  r as ConfigurableEditorWithAuth,
@@ -9,6 +9,8 @@ export type SerializedCustomHorizontalRuleNode = Spread<{
9
9
  strokeWidth?: number;
10
10
  }, SerializedLexicalNode>;
11
11
  export declare const INSERT_CUSTOM_HORIZONTAL_RULE_COMMAND: LexicalCommand<CustomHorizontalRulePayload>;
12
+ /** Opens the horizontal rule customization dialog (e.g. from slash menu). */
13
+ export declare const OPEN_HORIZONTAL_RULE_DIALOG_COMMAND: LexicalCommand<void>;
12
14
  export declare class CustomHorizontalRuleNode extends BaseHorizontalRuleNode {
13
15
  __color?: string;
14
16
  __strokeWidth?: number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Listens for OPEN_HORIZONTAL_RULE_DIALOG_COMMAND (e.g. from slash menu)
3
+ * and shows the same customization dialog as the toolbar Insert menu.
4
+ */
5
+ declare const OpenHorizontalRuleDialogPlugin: React.FC;
6
+ export default OpenHorizontalRuleDialogPlugin;
@@ -1,3 +1,4 @@
1
- export { $createCustomHorizontalRuleNode, $isCustomHorizontalRuleNode, CustomHorizontalRuleNode, type CustomHorizontalRulePayload, INSERT_CUSTOM_HORIZONTAL_RULE_COMMAND, type SerializedCustomHorizontalRuleNode, } from './CustomHorizontalRuleNode';
1
+ export { $createCustomHorizontalRuleNode, $isCustomHorizontalRuleNode, CustomHorizontalRuleNode, type CustomHorizontalRulePayload, INSERT_CUSTOM_HORIZONTAL_RULE_COMMAND, OPEN_HORIZONTAL_RULE_DIALOG_COMMAND, type SerializedCustomHorizontalRuleNode, } from './CustomHorizontalRuleNode';
2
2
  export { default as CustomHorizontalRulePlugin } from './CustomHorizontalRulePlugin';
3
3
  export { default as HorizontalRuleCustomizationDialog } from './HorizontalRuleCustomizationDialog';
4
+ export { default as OpenHorizontalRuleDialogPlugin } from './OpenHorizontalRuleDialogPlugin';
@@ -85,4 +85,5 @@ declare const LockIcon: () => import("react/jsx-runtime").JSX.Element;
85
85
  declare const AiSparkle: () => import("react/jsx-runtime").JSX.Element;
86
86
  declare const CodeSquare: () => import("react/jsx-runtime").JSX.Element;
87
87
  declare const InlineAutocomplete: () => import("react/jsx-runtime").JSX.Element;
88
- export { AddCommentIcon, AddImageIcon, AdjustToneIcon, AIChatIcon, AIIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignMiddleIcon, AlignRightIcon, AlignTopIcon, BoldIcon, BugIcon, BulletListIcon, ChartBarIcon, CheckBoxIcon, CheckIcon, ChevronDownIcon, CodeIcon, CompleteSentenceIcon, DisableIcon, EmojifyIcon, FaceSmileIcon, FileIcon, FixGrammarIcon, GenerateImageIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, HorizontalRuleIcon, HtmlViewIcon, ImageIcon, ItalicIcon, LinkIcon, LockIcon, MagicoonIcon, MakeLongerIcon, MakeShorterIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PauseCircleIcon, ParagraphIcon, PenLineIcon, PerspectiveIcon, PlayCircleIcon, PlusIcon, QuoteIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SimplifyIcon, SparkleIcon, StopCircleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, TableIcon, HighlighterIcon, LightbulbIcon, ClearFormattingIcon, CrossIcon, DownloadIcon, TrashIcon, ExternalLinkIcon, WrapTextLeftIcon, WrapTextRightIcon, AiSparkle, CodeSquare, InlineAutocomplete };
88
+ declare const OmegaIcon: () => import("react/jsx-runtime").JSX.Element;
89
+ export { AddCommentIcon, AddImageIcon, AdjustToneIcon, AIChatIcon, AIIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignMiddleIcon, AlignRightIcon, AlignTopIcon, BoldIcon, BugIcon, BulletListIcon, ChartBarIcon, CheckBoxIcon, CheckIcon, ChevronDownIcon, CodeIcon, CompleteSentenceIcon, DisableIcon, EmojifyIcon, FaceSmileIcon, FileIcon, FixGrammarIcon, GenerateImageIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, HorizontalRuleIcon, HtmlViewIcon, ImageIcon, ItalicIcon, LinkIcon, LockIcon, MagicoonIcon, MakeLongerIcon, MakeShorterIcon, MenuAltIcon, MessageEditIcon, MicrophoneIcon, NoteIcon, NumberListIcon, PauseCircleIcon, ParagraphIcon, PenLineIcon, PerspectiveIcon, PlayCircleIcon, PlusIcon, QuoteIcon, RecordingIcon, RedoIcon, SearchTextIcon, SearchTextIcon2, SendIcon, SignatureIcon, SimplifyIcon, SparkleIcon, StopCircleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TodoIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon, TableIcon, HighlighterIcon, LightbulbIcon, ClearFormattingIcon, CrossIcon, DownloadIcon, TrashIcon, ExternalLinkIcon, WrapTextLeftIcon, WrapTextRightIcon, AiSparkle, CodeSquare, InlineAutocomplete, OmegaIcon };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eddyter",
3
3
  "private": false,
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@9.0.0",
7
7
  "keywords": [