eddyter 1.3.62 → 1.3.64

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 (36) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +493 -493
  3. package/dist/ImageResizer-CbtUYHip.js +199 -0
  4. package/dist/api/auth.d.ts +4 -2
  5. package/dist/assets/style.css +1 -0
  6. package/dist/{babel-B9hn44Wo.js → babel-CCPWkrf4.js} +1302 -726
  7. package/dist/components/LockedFeature/LockedFeature.d.ts +23 -0
  8. package/dist/components/LockedFeature/index.d.ts +2 -0
  9. package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +14 -0
  10. package/dist/components/VideoView/index.d.ts +13 -0
  11. package/dist/constants.d.ts +3 -1
  12. package/dist/editorConfig.d.ts +2 -3
  13. package/dist/{estree-CocPn_Md.js → estree-CxUPh9wa.js} +917 -529
  14. package/dist/{html-CxCicOef.js → html-CmniStvG.js} +589 -350
  15. package/dist/{html2pdf.bundle-DNyY_rJA.js → html2pdf.bundle-C1B1lr_T.js} +3796 -2777
  16. package/dist/{html2pdf.bundle.min-GfQzEXnM.js → html2pdf.bundle.min-kPviTsNx.js} +5223 -3407
  17. package/dist/index-BL8HWCRw.js +816 -0
  18. package/dist/index-BpsoOKOs.js +274 -0
  19. package/dist/{index-YHNm3bIK.js → index-DHKx5grA.js} +4 -4
  20. package/dist/{index-CIBuU2Zv.js → index-FZVNbwSO.js} +12356 -11290
  21. package/dist/index.js +3 -3
  22. package/dist/{markdown-BUjgWFLu.js → markdown-B0mEGGfQ.js} +1015 -578
  23. package/dist/nodes/UploadingVideoNode.d.ts +30 -0
  24. package/dist/nodes/VideoNode.d.ts +47 -0
  25. package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
  26. package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +1 -1
  27. package/dist/plugins/VideoPlugin.d.ts +17 -0
  28. package/dist/{postcss-CGIcwj_g.js → postcss-B0bxXf7u.js} +1065 -615
  29. package/dist/{standalone-C0qguT38.js → standalone-DmuJV5rn.js} +596 -350
  30. package/dist/types.d.ts +4 -6
  31. package/dist/{typescript-BM7wk6k-.js → typescript-DZlC_9M8.js} +1805 -1113
  32. package/dist/ui/Icons.d.ts +2 -1
  33. package/dist/utils/uploadManager.d.ts +17 -0
  34. package/package.json +151 -151
  35. package/dist/assets/index.css +0 -1
  36. package/dist/index-BoOSmKss.js +0 -985
@@ -0,0 +1,274 @@
1
+ import { jsxs as S, Fragment as w, jsx as i } from "react/jsx-runtime";
2
+ import { I as ee } from "./ImageResizer-CbtUYHip.js";
3
+ import { CodeNode as te } from "@lexical/code";
4
+ import { LinkNode as oe } from "@lexical/link";
5
+ import { AutoFocusPlugin as re } from "@lexical/react/LexicalAutoFocusPlugin";
6
+ import { useLexicalComposerContext as ie } from "@lexical/react/LexicalComposerContext";
7
+ import { ContentEditable as ne } from "@lexical/react/LexicalContentEditable";
8
+ import { LexicalErrorBoundary as se } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as ce } from "@lexical/react/LexicalHistoryPlugin";
10
+ import { LexicalNestedComposer as ae } from "@lexical/react/LexicalNestedComposer";
11
+ import { OnChangePlugin as le } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as de } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { useLexicalEditable as ue } from "@lexical/react/useLexicalEditable";
14
+ import { useLexicalNodeSelection as me } from "@lexical/react/useLexicalNodeSelection";
15
+ import { mergeRegister as fe } from "@lexical/utils";
16
+ import { $getSelection as M, $isNodeSelection as m, $setSelection as $, SELECTION_CHANGE_COMMAND as ge, COMMAND_PRIORITY_LOW as u, CLICK_COMMAND as pe, DRAGSTART_COMMAND as Ce, KEY_DELETE_COMMAND as Ee, KEY_BACKSPACE_COMMAND as he, KEY_ENTER_COMMAND as Ne, KEY_ESCAPE_COMMAND as be, RootNode as ve, TextNode as Re, LineBreakNode as xe, ParagraphNode as De, $getNodeByKey as _ } from "lexical";
17
+ import { useRef as A, useState as B, useCallback as E, useEffect as Se } from "react";
18
+ import { x as v, r as Me, L as _e, i as Ae } from "./index-FZVNbwSO.js";
19
+ function Ge({
20
+ src: Y,
21
+ nodeKey: f,
22
+ width: g,
23
+ height: R,
24
+ maxWidth: z,
25
+ resizable: I,
26
+ showCaption: h,
27
+ caption: p,
28
+ captionsEnabled: W,
29
+ controls: V = !0
30
+ }) {
31
+ const c = A(null), x = A(null), [n, a, C] = me(f), [l, L] = B(!1), [o] = ie(), [N, K] = B(null), O = A(null), H = ue(), D = E(
32
+ (e) => {
33
+ const t = M();
34
+ return n && m(t) && (e.preventDefault(), o.update(() => {
35
+ t.getNodes().forEach((s) => {
36
+ v(s) && s.remove();
37
+ });
38
+ })), !1;
39
+ },
40
+ [o, n]
41
+ ), k = E(
42
+ (e) => {
43
+ const t = M(), r = x.current;
44
+ if (n && m(t) && t.getNodes().length === 1) {
45
+ if (h)
46
+ return $(null), e.preventDefault(), p.focus(), !0;
47
+ if (r !== null && r !== document.activeElement)
48
+ return e.preventDefault(), r.focus(), !0;
49
+ }
50
+ return !1;
51
+ },
52
+ [p, n, h]
53
+ ), y = E(
54
+ (e) => O.current === p || x.current === e.target ? ($(null), o.update(() => {
55
+ a(!0);
56
+ const t = o.getRootElement();
57
+ t !== null && t.focus();
58
+ }), !0) : !1,
59
+ [p, o, a]
60
+ ), P = E(
61
+ (e) => {
62
+ const t = e;
63
+ if (l)
64
+ return !0;
65
+ const s = t.target === c.current;
66
+ let d = !1;
67
+ if (!s && c.current) {
68
+ const b = c.current.getBoundingClientRect();
69
+ d = t.clientX >= b.left && t.clientX <= b.right && t.clientY >= b.top && t.clientY <= b.bottom;
70
+ }
71
+ return s || d ? (t.shiftKey ? a(!n) : (C(), a(!0)), !0) : !1;
72
+ },
73
+ [l, n, a, C]
74
+ );
75
+ Se(() => {
76
+ let e = !0;
77
+ const t = fe(
78
+ o.registerUpdateListener(({ editorState: r }) => {
79
+ e && K(r.read(() => M()));
80
+ }),
81
+ o.registerCommand(
82
+ ge,
83
+ (r, s) => (O.current = s, !1),
84
+ u
85
+ ),
86
+ o.registerCommand(
87
+ pe,
88
+ P,
89
+ u
90
+ ),
91
+ o.registerCommand(
92
+ Ce,
93
+ (r) => r.target === c.current ? (r.preventDefault(), !0) : !1,
94
+ u
95
+ ),
96
+ o.registerCommand(
97
+ Ee,
98
+ D,
99
+ u
100
+ ),
101
+ o.registerCommand(
102
+ he,
103
+ D,
104
+ u
105
+ ),
106
+ o.registerCommand(Ne, k, u),
107
+ o.registerCommand(
108
+ be,
109
+ y,
110
+ u
111
+ )
112
+ );
113
+ return () => {
114
+ e = !1, t();
115
+ };
116
+ }, [
117
+ C,
118
+ o,
119
+ l,
120
+ n,
121
+ f,
122
+ D,
123
+ k,
124
+ y,
125
+ P,
126
+ a
127
+ ]);
128
+ const X = () => {
129
+ o.update(() => {
130
+ const e = _(f);
131
+ v(e) && e.setShowCaption(!0);
132
+ });
133
+ }, j = (e, t) => {
134
+ setTimeout(() => {
135
+ L(!1);
136
+ }, 200), o.update(() => {
137
+ const r = _(f);
138
+ v(r) && r.setWidthAndHeight(e, t);
139
+ });
140
+ }, F = () => {
141
+ L(!0);
142
+ }, G = (e) => {
143
+ e.preventDefault(), e.stopPropagation(), o.update(() => {
144
+ const t = _(f);
145
+ v(t) && t.remove();
146
+ });
147
+ }, U = E(
148
+ (e) => {
149
+ if (l || e.target.closest("button"))
150
+ return;
151
+ const r = e.target === c.current;
152
+ let s = !1;
153
+ if (!r && c.current) {
154
+ const d = c.current.getBoundingClientRect();
155
+ s = e.clientX >= d.left && e.clientX <= d.right && e.clientY >= d.top && e.clientY <= d.bottom;
156
+ }
157
+ !r && !s || (e.stopPropagation(), e.shiftKey ? a(!n) : (C(), a(!0)));
158
+ },
159
+ [l, n, a, C]
160
+ ), q = n && m(N) && !l, T = (n || l) && H, J = typeof g == "number" && typeof R == "number", Q = typeof g == "number" ? g : "auto", Z = typeof R == "number" ? R : "auto";
161
+ return /* @__PURE__ */ S(w, { children: [
162
+ /* @__PURE__ */ S(
163
+ "div",
164
+ {
165
+ draggable: q,
166
+ style: {
167
+ position: "relative",
168
+ display: "inline-block"
169
+ },
170
+ onClick: U,
171
+ children: [
172
+ /* @__PURE__ */ i(
173
+ "video",
174
+ {
175
+ ref: c,
176
+ src: Y,
177
+ controls: V,
178
+ preload: "metadata",
179
+ className: T ? `focused ${m(N) ? "draggable" : ""}` : void 0,
180
+ style: J ? {
181
+ width: Q,
182
+ height: Z,
183
+ maxWidth: "100%"
184
+ } : {
185
+ maxWidth: "100%",
186
+ height: "auto"
187
+ },
188
+ draggable: "false"
189
+ }
190
+ ),
191
+ n && m(N) && /* @__PURE__ */ i("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-1 cteditor-z-10", children: /* @__PURE__ */ i(
192
+ "button",
193
+ {
194
+ onClick: (e) => {
195
+ e.stopPropagation(), G(e);
196
+ },
197
+ 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",
198
+ "aria-label": "Delete video",
199
+ title: "Delete video",
200
+ children: /* @__PURE__ */ i(Me, { className: "cteditor-w-4 cteditor-h-4" })
201
+ }
202
+ ) }),
203
+ I && m(N) && T && /* @__PURE__ */ i(
204
+ ee,
205
+ {
206
+ showCaption: h,
207
+ setShowCaption: X,
208
+ editor: o,
209
+ buttonRef: x,
210
+ imageRef: c,
211
+ maxWidth: z,
212
+ onResizeStart: F,
213
+ onResizeEnd: j,
214
+ captionsEnabled: W
215
+ }
216
+ )
217
+ ]
218
+ }
219
+ ),
220
+ h && /* @__PURE__ */ i(
221
+ "div",
222
+ {
223
+ className: "image-caption-container",
224
+ style: {
225
+ width: typeof g == "number" ? `${g}px` : "100%",
226
+ maxWidth: "100%"
227
+ },
228
+ children: /* @__PURE__ */ S(
229
+ ae,
230
+ {
231
+ initialEditor: p,
232
+ initialNodes: [
233
+ ve,
234
+ Re,
235
+ xe,
236
+ De,
237
+ oe,
238
+ te
239
+ ],
240
+ children: [
241
+ /* @__PURE__ */ i(re, {}),
242
+ /* @__PURE__ */ i(
243
+ de,
244
+ {
245
+ contentEditable: /* @__PURE__ */ i(
246
+ ne,
247
+ {
248
+ "aria-placeholder": "Enter a caption...",
249
+ placeholder: () => /* @__PURE__ */ i("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
250
+ className: "ImageNode__contentEditable"
251
+ }
252
+ ),
253
+ ErrorBoundary: se
254
+ }
255
+ ),
256
+ /* @__PURE__ */ i(
257
+ le,
258
+ {
259
+ onChange: () => {
260
+ }
261
+ }
262
+ ),
263
+ /* @__PURE__ */ i(ce, {}),
264
+ /* @__PURE__ */ i(_e, { namespace: Ae.namespace })
265
+ ]
266
+ }
267
+ )
268
+ }
269
+ )
270
+ ] });
271
+ }
272
+ export {
273
+ Ge as default
274
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerContext";
3
3
  import { $getNodeByKey as w } from "lexical";
4
- import { q as k, r as F, F as y, s as N, u as C, v as D } from "./index-CIBuU2Zv.js";
4
+ import { q as k, r as F, F as y, s as N, v as C, w as D } from "./index-FZVNbwSO.js";
5
5
  const B = (t) => t ? t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB` : "", E = (t) => {
6
6
  const o = t.split(".");
7
7
  return o.length > 1 ? o[o.length - 1].toLowerCase() : "";
@@ -16,11 +16,11 @@ const B = (t) => t ? t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFix
16
16
  i.preventDefault(), i.stopPropagation();
17
17
  try {
18
18
  if (t.startsWith("data:")) {
19
- const e = t.split(","), u = e[0].match(/:(.*?);/), g = u ? u[1] : "application/octet-stream", m = atob(e[1]);
20
- let c = m.length;
19
+ const e = t.split(","), m = e[0].match(/:(.*?);/), g = m ? m[1] : "application/octet-stream", u = atob(e[1]);
20
+ let c = u.length;
21
21
  const p = new Uint8Array(c);
22
22
  for (; c--; )
23
- p[c] = m.charCodeAt(c);
23
+ p[c] = u.charCodeAt(c);
24
24
  const b = new Blob([p], { type: g }), h = URL.createObjectURL(b), d = document.createElement("a");
25
25
  d.href = h, d.download = o, d.style.display = "none", document.body.appendChild(d), d.click(), document.body.removeChild(d), setTimeout(() => URL.revokeObjectURL(h), 100);
26
26
  } else {