eddyter 1.3.73 → 1.3.75

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 (29) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +478 -478
  3. package/dist/EddyterIcon.svg +24 -24
  4. package/dist/{ImageResizer-FrE13F54.js → ImageResizer-o0eMm1Mg.js} +56 -50
  5. package/dist/api/ai/aiAgentService.d.ts +22 -1
  6. package/dist/api/config/endpoints.d.ts +3 -0
  7. package/dist/assets/style.css +1 -1
  8. package/dist/{babel-CCPWkrf4.js → babel-B9hn44Wo.js} +726 -1302
  9. package/dist/components/VideoView/index.d.ts +3 -1
  10. package/dist/constants.d.ts +2 -1
  11. package/dist/{estree-CxUPh9wa.js → estree-CocPn_Md.js} +529 -917
  12. package/dist/hooks/useBlockFormat.d.ts +1 -0
  13. package/dist/{html-CmniStvG.js → html-CxCicOef.js} +350 -589
  14. package/dist/{html2pdf.bundle-CQue4YDW.js → html2pdf.bundle-CVq-OpZt.js} +2778 -3797
  15. package/dist/{html2pdf.bundle.min-BEj2NT3U.js → html2pdf.bundle.min-BxzIoi3T.js} +3405 -5221
  16. package/dist/{index-CX3cfSUQ.js → index-CtPRZTab.js} +27 -18
  17. package/dist/index-Cuv9ugJL.js +381 -0
  18. package/dist/{index-CfRDm1jv.js → index-DxEP36zG.js} +12228 -12186
  19. package/dist/{index-BO5ICrpG.js → index-eRyVFO7x.js} +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/{markdown-B0mEGGfQ.js → markdown-BUjgWFLu.js} +578 -1015
  22. package/dist/nodes/GeneratingImageNode.d.ts +30 -0
  23. package/dist/nodes/VideoNode.d.ts +10 -3
  24. package/dist/{postcss-B0bxXf7u.js → postcss-CGIcwj_g.js} +615 -1065
  25. package/dist/{standalone-DmuJV5rn.js → standalone-C0qguT38.js} +350 -596
  26. package/dist/{typescript-DZlC_9M8.js → typescript-BM7wk6k-.js} +1114 -1806
  27. package/dist/ui/Icons.d.ts +2 -1
  28. package/package.json +149 -152
  29. package/dist/index-Buj5fA92.js +0 -274
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as s, Fragment as it } from "react/jsx-runtime";
2
- import { I as nt } from "./ImageResizer-FrE13F54.js";
2
+ import { I as nt } from "./ImageResizer-o0eMm1Mg.js";
3
3
  import { CodeNode as xe } from "@lexical/code";
4
4
  import { LinkNode as Ce } from "@lexical/link";
5
5
  import { AutoFocusPlugin as ct } from "@lexical/react/LexicalAutoFocusPlugin";
@@ -16,7 +16,7 @@ import { useLexicalNodeSelection as lt } from "@lexical/react/useLexicalNodeSele
16
16
  import { mergeRegister as mt } from "@lexical/utils";
17
17
  import { RootNode as Re, TextNode as Pe, LineBreakNode as De, ParagraphNode as Se, $getSelection as O, $isNodeSelection as L, $isParagraphNode as Z, $setSelection as ee, $isRangeSelection as ut, SELECTION_CHANGE_COMMAND as gt, COMMAND_PRIORITY_LOW as v, CLICK_COMMAND as ft, DRAGSTART_COMMAND as pt, KEY_DELETE_COMMAND as ht, KEY_BACKSPACE_COMMAND as bt, KEY_ENTER_COMMAND as yt, KEY_ESCAPE_COMMAND as xt, createCommand as Ct, $getNodeByKey as _ } from "lexical";
18
18
  import { useRef as z, useState as p, useEffect as te, useLayoutEffect as Nt, useCallback as x, Suspense as wt } from "react";
19
- import { a as vt, D as Et, b as kt, d as It, e as Rt, f as Pt, h as Dt, B as be, L as Ae, i as Le, u as St, $ as M, W as At, j as Lt, A as Mt, k as $t, l as Ot, T as _t, m as zt, S as Wt, E as jt, n as Kt, t as E, o as Bt, p as Tt, C as Ft } from "./index-CfRDm1jv.js";
19
+ import { a as vt, D as Et, b as kt, d as It, e as Rt, f as Pt, h as Dt, B as be, L as Ae, i as Le, u as St, $ as M, W as At, j as Lt, A as Mt, k as $t, l as Ot, T as _t, m as zt, S as Wt, E as jt, n as Kt, t as E, o as Bt, p as Tt, C as Ft } from "./index-DxEP36zG.js";
20
20
  const Gt = vt("Link2", [
21
21
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
22
22
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
@@ -419,8 +419,7 @@ function Nr({
419
419
  S.current && clearTimeout(S.current);
420
420
  }, []);
421
421
  const fe = async () => {
422
- if (!P.trim() || D)
423
- return;
422
+ if (!P.trim() || D) return;
424
423
  ae(!0);
425
424
  const e = E.loading("Refining image...", {
426
425
  description: "This may take 10-30 seconds. Please wait."
@@ -451,8 +450,7 @@ function Nr({
451
450
  if (R && R.trim()) {
452
451
  const G = R.trim();
453
452
  a(G) && d && d !== "Generated image" && d.trim() ? b = d.trim() : b = G;
454
- } else
455
- d && d !== "Generated image" && d.trim() && (b = d.trim());
453
+ } else d && d !== "Generated image" && d.trim() && (b = d.trim());
456
454
  b ? r = `${b} with ${n}` : r = n;
457
455
  const he = (await Bt({
458
456
  content: `Generate Image: ${r}`,
@@ -474,13 +472,12 @@ function Nr({
474
472
  description: r.message,
475
473
  duration: 8e3
476
474
  });
477
- } else
478
- r instanceof Ft ? E.error("Credits Issue", {
479
- description: r.message,
480
- duration: 8e3
481
- }) : E.error("Failed to refine image", {
482
- description: r instanceof Error ? r.message : "Unknown error. Please try again."
483
- });
475
+ } else r instanceof Ft ? E.error("Credits Issue", {
476
+ description: r.message,
477
+ duration: 8e3
478
+ }) : E.error("Failed to refine image", {
479
+ description: r instanceof Error ? r.message : "Unknown error. Please try again."
480
+ });
484
481
  } finally {
485
482
  ae(!1);
486
483
  }
@@ -504,12 +501,24 @@ function Nr({
504
501
  // Fill the floated container
505
502
  } : c === "full" ? {
506
503
  position: "relative",
507
- display: "inline-block"
508
- // Use inline-block to respect text-align: center from parent
509
- } : c === "inline-left" || c === "inline-center" || c === "inline-right" ? {
504
+ display: "block",
505
+ width: "fit-content",
506
+ margin: "0 auto"
507
+ } : c === "inline-left" ? {
510
508
  position: "relative",
511
- display: "inline-block"
512
- // Use inline-block to respect text-align from parent
509
+ display: "block",
510
+ width: "fit-content",
511
+ marginRight: "auto"
512
+ } : c === "inline-center" ? {
513
+ position: "relative",
514
+ display: "block",
515
+ width: "fit-content",
516
+ margin: "0 auto"
517
+ } : c === "inline-right" ? {
518
+ position: "relative",
519
+ display: "block",
520
+ width: "fit-content",
521
+ marginLeft: "auto"
513
522
  } : {
514
523
  position: "relative",
515
524
  display: "inline-block"
@@ -0,0 +1,381 @@
1
+ import { jsxs as x, Fragment as rt, jsx as i } from "react/jsx-runtime";
2
+ import { I as it } from "./ImageResizer-o0eMm1Mg.js";
3
+ import { CodeNode as ot } from "@lexical/code";
4
+ import { LinkNode as nt } from "@lexical/link";
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";
8
+ import { LexicalErrorBoundary as dt } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as st } from "@lexical/react/LexicalHistoryPlugin";
10
+ import { LexicalNestedComposer as ut } from "@lexical/react/LexicalNestedComposer";
11
+ import { OnChangePlugin as ft } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as gt } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { useLexicalEditable as mt } from "@lexical/react/useLexicalEditable";
14
+ import { useLexicalNodeSelection as ht } from "@lexical/react/useLexicalNodeSelection";
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 xt, KEY_DELETE_COMMAND as Nt, 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 j, useCallback as N, useEffect as Dt } from "react";
18
+ import { x as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt, r as It, L as Wt, i as Ot } from "./index-DxEP36zG.js";
19
+ function ie({
20
+ src: w,
21
+ nodeKey: g,
22
+ width: p,
23
+ height: A,
24
+ maxWidth: B,
25
+ resizable: Y,
26
+ showCaption: E,
27
+ caption: b,
28
+ captionsEnabled: F,
29
+ controls: V = !0,
30
+ position: n = "none"
31
+ }) {
32
+ const a = P(null), S = P(null), [l, d, C] = ht(g), [s, M] = j(!1), [o] = lt(), [R, H] = j(null), _ = P(null), K = mt(), D = N(
33
+ (t) => {
34
+ const r = L();
35
+ return l && h(r) && (t.preventDefault(), o.update(() => {
36
+ r.getNodes().forEach((c) => {
37
+ v(c) && c.remove();
38
+ });
39
+ })), !1;
40
+ },
41
+ [o, l]
42
+ ), $ = N(
43
+ (t) => {
44
+ const r = L(), e = S.current;
45
+ if (l && h(r) && r.getNodes().length === 1) {
46
+ if (E)
47
+ return O(null), t.preventDefault(), b.focus(), !0;
48
+ if (e !== null && e !== document.activeElement)
49
+ return t.preventDefault(), e.focus(), !0;
50
+ }
51
+ return !1;
52
+ },
53
+ [b, l, E]
54
+ ), z = N(
55
+ (t) => _.current === b || S.current === t.target ? (O(null), o.update(() => {
56
+ d(!0);
57
+ const r = o.getRootElement();
58
+ r !== null && r.focus();
59
+ }), !0) : !1,
60
+ [b, o, d]
61
+ ), I = N(
62
+ (t) => {
63
+ const r = t;
64
+ if (s)
65
+ return !0;
66
+ const e = r.target;
67
+ if (e.closest("button") && a.current && e.closest(".editor-image") === a.current.closest(".editor-image"))
68
+ return !0;
69
+ const c = e === a.current;
70
+ let u = !1;
71
+ if (!c && a.current) {
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
+ }
75
+ return c || u ? (r.shiftKey ? d(!l) : (C(), d(!0)), !0) : !1;
76
+ },
77
+ [s, l, d, C]
78
+ );
79
+ Dt(() => {
80
+ let t = !0;
81
+ const r = pt(
82
+ o.registerUpdateListener(({ editorState: e }) => {
83
+ t && H(e.read(() => L()));
84
+ }),
85
+ o.registerCommand(
86
+ bt,
87
+ (e, c) => (_.current = c, !1),
88
+ f
89
+ ),
90
+ o.registerCommand(
91
+ Ct,
92
+ I,
93
+ f
94
+ ),
95
+ o.registerCommand(
96
+ xt,
97
+ (e) => e.target === a.current ? (e.preventDefault(), !0) : !1,
98
+ f
99
+ ),
100
+ o.registerCommand(
101
+ Nt,
102
+ D,
103
+ f
104
+ ),
105
+ o.registerCommand(
106
+ vt,
107
+ D,
108
+ f
109
+ ),
110
+ o.registerCommand(Et, $, f),
111
+ o.registerCommand(
112
+ Rt,
113
+ z,
114
+ f
115
+ )
116
+ );
117
+ return () => {
118
+ t = !1, r();
119
+ };
120
+ }, [
121
+ C,
122
+ o,
123
+ s,
124
+ l,
125
+ g,
126
+ D,
127
+ $,
128
+ z,
129
+ I,
130
+ d
131
+ ]);
132
+ const X = () => {
133
+ o.update(() => {
134
+ const t = y(g);
135
+ v(t) && t.setShowCaption(!0);
136
+ });
137
+ }, G = (t, r) => {
138
+ setTimeout(() => {
139
+ M(!1);
140
+ }, 200), o.update(() => {
141
+ const e = y(g);
142
+ v(e) && e.setWidthAndHeight(t, r);
143
+ });
144
+ }, U = () => {
145
+ M(!0);
146
+ }, q = (t) => {
147
+ t.preventDefault(), t.stopPropagation(), o.update(() => {
148
+ const r = y(g);
149
+ if (v(r)) {
150
+ const e = r.getParent();
151
+ r.remove(), e && T(e) && e.getChildrenSize() === 0 && e.setFormat("left");
152
+ }
153
+ });
154
+ }, m = (t, r) => {
155
+ t.preventDefault(), t.stopPropagation(), o.update(() => {
156
+ const e = y(g);
157
+ if (v(e)) {
158
+ e.setPosition(r);
159
+ const c = e.getParent();
160
+ c && T(c) && (r === "left" ? c.setFormat("left") : r === "right" ? c.setFormat("right") : c.setFormat(""));
161
+ }
162
+ });
163
+ }, J = N(
164
+ (t) => {
165
+ if (s || t.target.closest("button"))
166
+ return;
167
+ const e = t.target === a.current;
168
+ let c = !1;
169
+ if (!e && a.current) {
170
+ const u = a.current.getBoundingClientRect();
171
+ c = t.clientX >= u.left && t.clientX <= u.right && t.clientY >= u.top && t.clientY <= u.bottom;
172
+ }
173
+ !e && !c || (t.stopPropagation(), t.shiftKey ? d(!l) : (C(), d(!0)));
174
+ },
175
+ [s, l, d, C]
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
+ return /* @__PURE__ */ x(rt, { children: [
178
+ /* @__PURE__ */ x(
179
+ "div",
180
+ {
181
+ draggable: Q,
182
+ style: n === "left" || n === "right" ? {
183
+ position: "relative",
184
+ display: "block",
185
+ width: "100%"
186
+ } : n === "full" ? {
187
+ position: "relative",
188
+ display: "block",
189
+ width: "fit-content",
190
+ margin: "0 auto"
191
+ } : n === "inline-left" ? {
192
+ position: "relative",
193
+ display: "block",
194
+ width: "fit-content",
195
+ marginRight: "auto"
196
+ } : n === "inline-center" ? {
197
+ position: "relative",
198
+ display: "block",
199
+ width: "fit-content",
200
+ margin: "0 auto"
201
+ } : n === "inline-right" ? {
202
+ position: "relative",
203
+ display: "block",
204
+ width: "fit-content",
205
+ marginLeft: "auto"
206
+ } : {
207
+ position: "relative",
208
+ display: "inline-block"
209
+ },
210
+ onClick: J,
211
+ children: [
212
+ /* @__PURE__ */ i(
213
+ "video",
214
+ {
215
+ ref: a,
216
+ src: w,
217
+ controls: V,
218
+ preload: "metadata",
219
+ className: W ? `focused ${h(R) ? "draggable" : ""}` : void 0,
220
+ style: Z ? {
221
+ width: tt,
222
+ height: et,
223
+ maxWidth: "100%"
224
+ } : {
225
+ maxWidth: "100%",
226
+ height: "auto"
227
+ },
228
+ draggable: "false"
229
+ }
230
+ ),
231
+ l && h(R) && /* @__PURE__ */ x("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: [
232
+ /* @__PURE__ */ x("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
+ /* @__PURE__ */ i(
234
+ "button",
235
+ {
236
+ onClick: (t) => m(t, "left"),
237
+ 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" : ""}`,
238
+ "aria-label": "Wrap text left",
239
+ title: "Wrap text left",
240
+ children: /* @__PURE__ */ i(Lt, {})
241
+ }
242
+ ),
243
+ /* @__PURE__ */ i(
244
+ "button",
245
+ {
246
+ onClick: (t) => m(t, "right"),
247
+ 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" : ""}`,
248
+ "aria-label": "Wrap text right",
249
+ title: "Wrap text right",
250
+ children: /* @__PURE__ */ i(Pt, {})
251
+ }
252
+ ),
253
+ /* @__PURE__ */ i("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
254
+ /* @__PURE__ */ i(
255
+ "button",
256
+ {
257
+ onClick: (t) => m(t, "inline-left"),
258
+ className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "inline-left" ? "cteditor-bg-accent" : ""}`,
259
+ "aria-label": "Align left",
260
+ title: "Align left (no text wrap)",
261
+ children: /* @__PURE__ */ i(Mt, {})
262
+ }
263
+ ),
264
+ /* @__PURE__ */ i(
265
+ "button",
266
+ {
267
+ onClick: (t) => m(t, "inline-center"),
268
+ className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "inline-center" || n === "full" ? "cteditor-bg-accent" : ""}`,
269
+ "aria-label": "Align center",
270
+ title: "Align center (no text wrap)",
271
+ children: /* @__PURE__ */ i(_t, {})
272
+ }
273
+ ),
274
+ /* @__PURE__ */ i(
275
+ "button",
276
+ {
277
+ onClick: (t) => m(t, "inline-right"),
278
+ className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${n === "inline-right" ? "cteditor-bg-accent" : ""}`,
279
+ "aria-label": "Align right",
280
+ title: "Align right (no text wrap)",
281
+ children: /* @__PURE__ */ i($t, {})
282
+ }
283
+ ),
284
+ /* @__PURE__ */ i("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
285
+ /* @__PURE__ */ i(
286
+ "button",
287
+ {
288
+ onClick: (t) => m(t, "none"),
289
+ 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" : ""}`,
290
+ "aria-label": "Inline",
291
+ title: "Inline with text",
292
+ children: /* @__PURE__ */ i(zt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
293
+ }
294
+ )
295
+ ] }),
296
+ /* @__PURE__ */ i(
297
+ "button",
298
+ {
299
+ onClick: (t) => {
300
+ t.stopPropagation(), q(t);
301
+ },
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
+ "aria-label": "Delete video",
304
+ title: "Delete video",
305
+ children: /* @__PURE__ */ i(It, { className: "cteditor-w-4 cteditor-h-4" })
306
+ }
307
+ )
308
+ ] }),
309
+ Y && h(R) && W && /* @__PURE__ */ i(
310
+ it,
311
+ {
312
+ showCaption: E,
313
+ setShowCaption: X,
314
+ editor: o,
315
+ buttonRef: S,
316
+ imageRef: a,
317
+ maxWidth: B,
318
+ onResizeStart: U,
319
+ onResizeEnd: G,
320
+ captionsEnabled: F
321
+ }
322
+ )
323
+ ]
324
+ }
325
+ ),
326
+ E && /* @__PURE__ */ i(
327
+ "div",
328
+ {
329
+ className: "image-caption-container",
330
+ style: {
331
+ width: typeof p == "number" ? `${p}px` : "100%",
332
+ maxWidth: "100%",
333
+ ...n === "inline-center" || n === "full" ? { margin: "0 auto" } : n === "inline-right" ? { marginLeft: "auto" } : n === "left" ? { float: "left", clear: "left" } : n === "right" ? { float: "right", clear: "right" } : {}
334
+ },
335
+ children: /* @__PURE__ */ x(
336
+ ut,
337
+ {
338
+ initialEditor: b,
339
+ initialNodes: [
340
+ kt,
341
+ yt,
342
+ At,
343
+ St,
344
+ nt,
345
+ ot
346
+ ],
347
+ children: [
348
+ /* @__PURE__ */ i(ct, {}),
349
+ /* @__PURE__ */ i(
350
+ gt,
351
+ {
352
+ contentEditable: /* @__PURE__ */ i(
353
+ at,
354
+ {
355
+ "aria-placeholder": "Enter a caption...",
356
+ placeholder: () => /* @__PURE__ */ i("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
357
+ className: "ImageNode__contentEditable"
358
+ }
359
+ ),
360
+ ErrorBoundary: dt
361
+ }
362
+ ),
363
+ /* @__PURE__ */ i(
364
+ ft,
365
+ {
366
+ onChange: () => {
367
+ }
368
+ }
369
+ ),
370
+ /* @__PURE__ */ i(st, {}),
371
+ /* @__PURE__ */ i(Wt, { namespace: Ot.namespace })
372
+ ]
373
+ }
374
+ )
375
+ }
376
+ )
377
+ ] });
378
+ }
379
+ export {
380
+ ie as default
381
+ };