eddyter 1.3.73 → 1.3.74
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.
- package/dist/{ImageResizer-FrE13F54.js → ImageResizer-o0eMm1Mg.js} +56 -50
- package/dist/api/ai/aiAgentService.d.ts +22 -1
- package/dist/api/config/endpoints.d.ts +3 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/VideoView/index.d.ts +3 -1
- package/dist/{html2pdf.bundle-CQue4YDW.js → html2pdf.bundle-Bqwrc-rt.js} +1 -1
- package/dist/{html2pdf.bundle.min-BEj2NT3U.js → html2pdf.bundle.min-IddXSdmD.js} +1 -1
- package/dist/{index-BO5ICrpG.js → index-CUha-eOU.js} +1 -1
- package/dist/{index-CfRDm1jv.js → index-CnJbZHIU.js} +9697 -9439
- package/dist/index-DXkAwL6K.js +381 -0
- package/dist/{index-CX3cfSUQ.js → index-DeaVZP-3.js} +19 -7
- package/dist/index.js +1 -1
- package/dist/nodes/VideoNode.d.ts +10 -3
- package/package.json +1 -1
- package/dist/index-Buj5fA92.js +0 -274
|
@@ -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-CnJbZHIU.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
|
+
};
|
|
@@ -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-
|
|
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-
|
|
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-CnJbZHIU.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" }],
|
|
@@ -504,12 +504,24 @@ function Nr({
|
|
|
504
504
|
// Fill the floated container
|
|
505
505
|
} : c === "full" ? {
|
|
506
506
|
position: "relative",
|
|
507
|
-
display: "
|
|
508
|
-
|
|
509
|
-
|
|
507
|
+
display: "block",
|
|
508
|
+
width: "fit-content",
|
|
509
|
+
margin: "0 auto"
|
|
510
|
+
} : c === "inline-left" ? {
|
|
510
511
|
position: "relative",
|
|
511
|
-
display: "
|
|
512
|
-
|
|
512
|
+
display: "block",
|
|
513
|
+
width: "fit-content",
|
|
514
|
+
marginRight: "auto"
|
|
515
|
+
} : c === "inline-center" ? {
|
|
516
|
+
position: "relative",
|
|
517
|
+
display: "block",
|
|
518
|
+
width: "fit-content",
|
|
519
|
+
margin: "0 auto"
|
|
520
|
+
} : c === "inline-right" ? {
|
|
521
|
+
position: "relative",
|
|
522
|
+
display: "block",
|
|
523
|
+
width: "fit-content",
|
|
524
|
+
marginLeft: "auto"
|
|
513
525
|
} : {
|
|
514
526
|
position: "relative",
|
|
515
527
|
display: "inline-block"
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as a, z as r, G as t, H as s, I as o, J as d, K as v, M as u, N as f, O as n, P as l, Q as w } from "./index-
|
|
1
|
+
import { y as a, z as r, G as t, H as s, I as o, J as d, K as v, M as u, N as f, O as n, P as l, Q as w } from "./index-CnJbZHIU.js";
|
|
2
2
|
export {
|
|
3
3
|
a as ConfigurableEditor,
|
|
4
4
|
r as ConfigurableEditorWithAuth,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread, DecoratorNode } from '../../node_modules/lexical';
|
|
2
|
+
import { ImagePosition } from './ImageNode';
|
|
2
3
|
export interface VideoPayload {
|
|
3
4
|
src: string;
|
|
4
5
|
caption?: LexicalEditor;
|
|
@@ -9,6 +10,7 @@ export interface VideoPayload {
|
|
|
9
10
|
width?: number;
|
|
10
11
|
captionsEnabled?: boolean;
|
|
11
12
|
controls?: boolean;
|
|
13
|
+
position?: ImagePosition;
|
|
12
14
|
}
|
|
13
15
|
export type SerializedVideoNode = Spread<{
|
|
14
16
|
caption: SerializedEditor;
|
|
@@ -18,6 +20,7 @@ export type SerializedVideoNode = Spread<{
|
|
|
18
20
|
src: string;
|
|
19
21
|
width?: number;
|
|
20
22
|
controls: boolean;
|
|
23
|
+
position?: ImagePosition;
|
|
21
24
|
}, SerializedLexicalNode>;
|
|
22
25
|
export declare class VideoNode extends DecoratorNode<JSX.Element> {
|
|
23
26
|
__src: string;
|
|
@@ -28,20 +31,24 @@ export declare class VideoNode extends DecoratorNode<JSX.Element> {
|
|
|
28
31
|
__caption: LexicalEditor;
|
|
29
32
|
__captionsEnabled: boolean;
|
|
30
33
|
__controls: boolean;
|
|
34
|
+
__position: ImagePosition;
|
|
31
35
|
static getType(): string;
|
|
32
36
|
static clone(node: VideoNode): VideoNode;
|
|
33
37
|
static importJSON(serializedNode: SerializedVideoNode): VideoNode;
|
|
34
38
|
exportDOM(): DOMExportOutput;
|
|
35
39
|
static importDOM(): DOMConversionMap | null;
|
|
36
|
-
constructor(src: string, maxWidth: number, width?: "inherit" | number, height?: "inherit" | number, showCaption?: boolean, caption?: LexicalEditor, captionsEnabled?: boolean, controls?: boolean, key?: NodeKey);
|
|
40
|
+
constructor(src: string, maxWidth: number, width?: "inherit" | number, height?: "inherit" | number, showCaption?: boolean, caption?: LexicalEditor, captionsEnabled?: boolean, controls?: boolean, position?: ImagePosition, key?: NodeKey);
|
|
37
41
|
exportJSON(): SerializedVideoNode;
|
|
38
42
|
setWidthAndHeight(width: "inherit" | number, height: "inherit" | number): void;
|
|
39
43
|
setShowCaption(showCaption: boolean): void;
|
|
44
|
+
private getPositionStyles;
|
|
40
45
|
createDOM(config: EditorConfig): HTMLElement;
|
|
41
|
-
updateDOM():
|
|
46
|
+
updateDOM(prevNode: VideoNode, dom: HTMLElement): boolean;
|
|
42
47
|
getSrc(): string;
|
|
43
48
|
setSrc(src: string): void;
|
|
49
|
+
getPosition(): ImagePosition;
|
|
50
|
+
setPosition(position: ImagePosition): void;
|
|
44
51
|
decorate(): JSX.Element;
|
|
45
52
|
}
|
|
46
|
-
export declare function $createVideoNode({ height, maxWidth, captionsEnabled, src, width, showCaption, caption, key, controls, }: VideoPayload): VideoNode;
|
|
53
|
+
export declare function $createVideoNode({ height, maxWidth, captionsEnabled, src, width, showCaption, caption, key, controls, position, }: VideoPayload): VideoNode;
|
|
47
54
|
export declare function $isVideoNode(node: LexicalNode | null | undefined): node is VideoNode;
|