eddyter 1.3.63 → 1.3.65
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-CbtUYHip.js +199 -0
- package/dist/Provider/EditorProvider.d.ts +1 -0
- package/dist/api/auth.d.ts +13 -2
- package/dist/assets/style.css +1 -1
- package/dist/components/LockedFeature/LockedFeature.d.ts +29 -0
- package/dist/components/LockedFeature/index.d.ts +2 -0
- package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +14 -0
- package/dist/components/VideoView/index.d.ts +13 -0
- package/dist/constants.d.ts +3 -1
- package/dist/editorConfig.d.ts +2 -3
- package/dist/{html2pdf.bundle-Bc2h6DHT.js → html2pdf.bundle-9PCiy6C2.js} +1 -1
- package/dist/{html2pdf.bundle.min-BvakEXhX.js → html2pdf.bundle.min-D_g_u6ug.js} +1 -1
- package/dist/index-B9Gjsq91.js +274 -0
- package/dist/index-CI28isEa.js +813 -0
- package/dist/{index-DoJIKSPF.js → index-DWw_26Wr.js} +11531 -10773
- package/dist/{index-C2a6-XFM.js → index-dZIrqvsF.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/nodes/UploadingVideoNode.d.ts +30 -0
- package/dist/nodes/VideoNode.d.ts +47 -0
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +1 -1
- package/dist/plugins/VideoPlugin.d.ts +17 -0
- package/dist/types.d.ts +4 -6
- package/dist/ui/Icons.d.ts +2 -1
- package/dist/utils/uploadManager.d.ts +17 -0
- package/package.json +1 -1
- package/dist/index-B0VTEqfr.js +0 -985
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface LockedFeatureProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
isEnabled: boolean;
|
|
5
|
+
featureName: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* variant: "overlay" shows a lock badge on top-right corner (for toolbar buttons)
|
|
9
|
+
* variant: "inline" shows the lock icon inline (for dropdown items, slash commands)
|
|
10
|
+
*/
|
|
11
|
+
variant?: "overlay" | "inline";
|
|
12
|
+
/**
|
|
13
|
+
* planAllows: true if the user's plan includes this feature.
|
|
14
|
+
* When isEnabled=false and planAllows=true, shows "You disabled this" instead of "Not in your plan".
|
|
15
|
+
*/
|
|
16
|
+
planAllows?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* LockedFeature - A wrapper component that shows a lock/disabled overlay on disabled features
|
|
20
|
+
*
|
|
21
|
+
* When isEnabled is true, renders children normally.
|
|
22
|
+
* When isEnabled is false, renders children with:
|
|
23
|
+
* - Grayed out/disabled appearance (opacity-50)
|
|
24
|
+
* - Non-interactive (pointer-events-none on children)
|
|
25
|
+
* - Lock icon + "not available in your plan" (plan doesn't allow)
|
|
26
|
+
* - Eye-off icon + "You disabled this" (plan allows, user turned it off)
|
|
27
|
+
*/
|
|
28
|
+
declare const LockedFeature: FC<LockedFeatureProps>;
|
|
29
|
+
export default LockedFeature;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface UnifiedColorPickerProps {
|
|
3
|
+
onTextColorChange: (color: string) => void;
|
|
4
|
+
onBackgroundColorChange: (color: string | null) => void;
|
|
5
|
+
currentTextColor?: string;
|
|
6
|
+
currentBgColor?: string;
|
|
7
|
+
isHighlightActive?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
showTextColorTab?: boolean;
|
|
11
|
+
showBackgroundColorTab?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const UnifiedColorPicker: FC<UnifiedColorPickerProps>;
|
|
14
|
+
export default UnifiedColorPicker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LexicalEditor, NodeKey } from '../../../node_modules/lexical';
|
|
2
|
+
export default function VideoComponent({ src, nodeKey, width, height, maxWidth, resizable, showCaption, caption, captionsEnabled, controls, }: {
|
|
3
|
+
caption: LexicalEditor;
|
|
4
|
+
height: "inherit" | number;
|
|
5
|
+
maxWidth: number;
|
|
6
|
+
nodeKey: NodeKey;
|
|
7
|
+
resizable: boolean;
|
|
8
|
+
showCaption: boolean;
|
|
9
|
+
src: string;
|
|
10
|
+
width: "inherit" | number;
|
|
11
|
+
captionsEnabled: boolean;
|
|
12
|
+
controls?: boolean;
|
|
13
|
+
}): JSX.Element;
|
package/dist/constants.d.ts
CHANGED
|
@@ -20,8 +20,10 @@ import { CustomHorizontalRuleNode } from './plugins/CustomHorizontalRulePlugin';
|
|
|
20
20
|
import { AlignMenuItem, FormatTextMenuItem } from './types';
|
|
21
21
|
import { UploadingImageNode } from './nodes/UploadingImageNode';
|
|
22
22
|
import { UploadingFileNode } from './nodes/UploadingFileNode';
|
|
23
|
+
import { VideoNode } from './nodes/VideoNode';
|
|
24
|
+
import { UploadingVideoNode } from './nodes/UploadingVideoNode';
|
|
23
25
|
export declare const theme: EditorThemeClasses;
|
|
24
|
-
export declare const EDITOR_NODES: (typeof CommentedTextNode | typeof CommentNode | typeof EmbedNode | typeof FileNode | typeof HtmlCanvasNode | typeof LinkNode | typeof CodeNode | typeof ImageNode | typeof MentionNode | typeof NotePanelNode | typeof ChartNode | typeof CustomHorizontalRuleNode | typeof HorizontalRuleNode | typeof UploadingImageNode | typeof UploadingFileNode | typeof CodeHighlightNode | typeof HeadingNode | typeof QuoteNode | typeof ListNode | typeof ListItemNode | typeof TableNode | typeof TableCellNode | typeof TableRowNode)[];
|
|
26
|
+
export declare const EDITOR_NODES: (typeof CommentedTextNode | typeof CommentNode | typeof EmbedNode | typeof FileNode | typeof HtmlCanvasNode | typeof LinkNode | typeof CodeNode | typeof ImageNode | typeof MentionNode | typeof NotePanelNode | typeof ChartNode | typeof CustomHorizontalRuleNode | typeof HorizontalRuleNode | typeof UploadingImageNode | typeof UploadingFileNode | typeof VideoNode | typeof UploadingVideoNode | typeof CodeHighlightNode | typeof HeadingNode | typeof QuoteNode | typeof ListNode | typeof ListItemNode | typeof TableNode | typeof TableCellNode | typeof TableRowNode)[];
|
|
25
27
|
export declare const initialConfig: InitialConfigType;
|
|
26
28
|
export declare const blockTypeToBlockName: {
|
|
27
29
|
bullet: string;
|
package/dist/editorConfig.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const editorConfig: {
|
|
|
8
8
|
enableTableOptions: boolean;
|
|
9
9
|
enableImageOptions: boolean;
|
|
10
10
|
enableInsertMenu: boolean;
|
|
11
|
-
|
|
11
|
+
enableColors: boolean;
|
|
12
12
|
enableClearOptions: boolean;
|
|
13
13
|
enableEmojiPicker: boolean;
|
|
14
14
|
enableLinks: boolean;
|
|
@@ -25,7 +25,6 @@ export declare const editorConfig: {
|
|
|
25
25
|
enableImageUpload: boolean;
|
|
26
26
|
enableWordCount: boolean;
|
|
27
27
|
enableCharts: boolean;
|
|
28
|
-
enableHighlight: boolean;
|
|
29
28
|
enableAutoCorrection: boolean;
|
|
30
29
|
enablePdfExport: boolean;
|
|
31
30
|
enableSpeechToText: boolean;
|
|
@@ -59,7 +58,7 @@ export declare const editorConfig: {
|
|
|
59
58
|
aiChat: boolean;
|
|
60
59
|
comment: boolean;
|
|
61
60
|
improve: boolean;
|
|
62
|
-
|
|
61
|
+
colors: boolean;
|
|
63
62
|
};
|
|
64
63
|
enableAutocomplete: boolean;
|
|
65
64
|
autocompleteOptions: {
|
|
@@ -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-DWw_26Wr.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
|
+
};
|