tetrons 2.3.98 → 2.3.100
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/app/HomeClient.d.ts +1 -0
- package/dist/app/layout.d.ts +7 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/view/page.d.ts +1 -0
- package/dist/chunk-EO6RXFIC.mjs +79 -0
- package/dist/components/Editor/AIModal.d.ts +8 -0
- package/dist/components/Editor/Editor.d.ts +3 -0
- package/dist/components/Editor/LinkPreviewPopup.d.ts +14 -0
- package/dist/components/Editor/TetronsEditor.d.ts +8 -0
- package/dist/components/Editor/config/versionConfig.d.ts +3 -0
- package/dist/components/Editor/toolbar/BasicToolbar.d.ts +12 -0
- package/dist/components/Editor/toolbar/CodeEditor.d.ts +13 -0
- package/dist/components/Editor/toolbar/Converter.d.ts +3 -0
- package/dist/components/Editor/toolbar/FaqSection.d.ts +2 -0
- package/dist/components/Editor/toolbar/FindReplaceModal.d.ts +9 -0
- package/dist/components/Editor/toolbar/HelpModal.d.ts +8 -0
- package/dist/components/Editor/toolbar/ImageToTextModal.d.ts +7 -0
- package/dist/components/Editor/toolbar/MathEquation.d.ts +10 -0
- package/dist/components/Editor/toolbar/SecondRow.d.ts +18 -0
- package/dist/components/Editor/toolbar/ShareEmailModal.d.ts +5 -0
- package/dist/components/Editor/toolbar/ShareLinkModal.d.ts +7 -0
- package/dist/components/Editor/toolbar/Tabs.d.ts +6 -0
- package/dist/components/Editor/toolbar/ThirdRow.d.ts +9 -0
- package/dist/components/Editor/toolbar/TopMenu.d.ts +24 -0
- package/dist/components/Editor/toolbar/Translator.d.ts +3 -0
- package/dist/components/Editor/toolbar/UserGuideSection.d.ts +2 -0
- package/dist/components/Editor/toolbar/VersionDiffModal.d.ts +6 -0
- package/dist/components/Editor/toolbar/VersionHistoryModal.d.ts +12 -0
- package/dist/components/Editor/toolbar/VersionInfoSection.d.ts +2 -0
- package/dist/components/Editor/toolbar/VersionRollbackModal.d.ts +6 -0
- package/dist/components/Editor/toolbar/VirtualKeyboard.d.ts +11 -0
- package/dist/components/Editor/toolbar/VoiceModal.d.ts +7 -0
- package/dist/components/Editor/toolbar/extensions/Audio.d.ts +2 -0
- package/dist/components/Editor/toolbar/extensions/BetterListItem.d.ts +1 -0
- package/dist/components/Editor/toolbar/extensions/Comment.d.ts +17 -0
- package/dist/components/Editor/toolbar/extensions/Embed.d.ts +7 -0
- package/dist/components/Editor/toolbar/extensions/FontFamily.d.ts +10 -0
- package/dist/components/Editor/toolbar/extensions/FontSize.d.ts +10 -0
- package/dist/components/Editor/toolbar/extensions/FontStyleCommands.d.ts +2 -0
- package/dist/components/Editor/toolbar/extensions/LineHeightExtension.d.ts +2 -0
- package/dist/components/Editor/toolbar/extensions/MathBlock.d.ts +12 -0
- package/dist/components/Editor/toolbar/extensions/MathBlockView.d.ts +3 -0
- package/dist/components/Editor/toolbar/extensions/MathNode.d.ts +10 -0
- package/dist/components/Editor/toolbar/extensions/ResizableEmbed.d.ts +9 -0
- package/dist/components/Editor/toolbar/extensions/ResizableImage.d.ts +2 -0
- package/dist/components/Editor/toolbar/extensions/ResizableVideo.d.ts +2 -0
- package/dist/components/Editor/toolbar/extensions/WordCount.d.ts +2 -0
- package/dist/components/Editor/toolbar/groups/AlignGroup.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/ClipboardGroup.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/ColorGroup.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/FileGroup.d.ts +12 -0
- package/dist/components/Editor/toolbar/groups/InsertGroup.d.ts +6 -0
- package/dist/components/Editor/toolbar/groups/ListGroup.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/PlatinumGroup.d.ts +19 -0
- package/dist/components/Editor/toolbar/groups/PreviewModal.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/TextFormattingGroup.d.ts +8 -0
- package/dist/components/Editor/toolbar/groups/UtilityGroup.d.ts +10 -0
- package/dist/components/Editor/toolbar/useFileActions.d.ts +6 -0
- package/dist/components/Editor/toolbar/useUtilityActions.d.ts +8 -0
- package/dist/components/Editor/types/TetronsEditorProps.d.ts +100 -0
- package/dist/components/Editor/types/ValidationResponse.d.ts +10 -0
- package/dist/components/ui/Button.d.ts +12 -0
- package/dist/components/ui/ConfirmModal.d.ts +10 -0
- package/dist/components/ui/Dropdown.d.ts +14 -0
- package/dist/index.css +4888 -0
- package/dist/index.d.ts +6 -16
- package/dist/index.mjs +14802 -14936
- package/dist/lib/indianKeyboardLayouts.d.ts +1 -0
- package/dist/lib/languages.d.ts +1 -0
- package/dist/server/dictionary.d.ts +1 -0
- package/dist/tiptap/extensions/SpellCheck.d.ts +2 -0
- package/dist/types/VersionEntry.d.ts +6 -0
- package/dist/typescript-A2I22B6E.mjs +210768 -0
- package/package.json +88 -109
- package/dist/app/api/ai-action/route.cjs +0 -61
- package/dist/app/api/ai-action/route.d.mts +0 -9
- package/dist/app/api/ai-action/route.d.ts +0 -9
- package/dist/app/api/ai-action/route.mjs +0 -36
- package/dist/app/api/execute/route.cjs +0 -55
- package/dist/app/api/execute/route.d.mts +0 -8
- package/dist/app/api/execute/route.d.ts +0 -8
- package/dist/app/api/execute/route.mjs +0 -30
- package/dist/app/api/export/route.cjs +0 -33
- package/dist/app/api/export/route.d.mts +0 -3
- package/dist/app/api/export/route.d.ts +0 -3
- package/dist/app/api/export/route.mjs +0 -8
- package/dist/app/api/register/route.cjs +0 -120
- package/dist/app/api/register/route.d.mts +0 -10
- package/dist/app/api/register/route.d.ts +0 -10
- package/dist/app/api/register/route.mjs +0 -85
- package/dist/app/api/save/route.cjs +0 -53
- package/dist/app/api/save/route.d.mts +0 -9
- package/dist/app/api/save/route.d.ts +0 -9
- package/dist/app/api/save/route.mjs +0 -18
- package/dist/app/api/transcribe/route.cjs +0 -72
- package/dist/app/api/transcribe/route.d.mts +0 -10
- package/dist/app/api/transcribe/route.d.ts +0 -10
- package/dist/app/api/transcribe/route.mjs +0 -46
- package/dist/app/api/validate/route.cjs +0 -143
- package/dist/app/api/validate/route.d.mts +0 -13
- package/dist/app/api/validate/route.d.ts +0 -13
- package/dist/app/api/validate/route.mjs +0 -107
- package/dist/components/UI/Dropdown.tsx +0 -0
- package/dist/components/tetrons/EditorContent.tsx +0 -272
- package/dist/components/tetrons/ResizableImageComponent.tsx +0 -112
- package/dist/components/tetrons/ResizableVideoComponent.tsx +0 -56
- package/dist/dictionaries/index.aff +0 -205
- package/dist/dictionaries/index.dic +0 -49569
- package/dist/index.cjs +0 -17652
- package/dist/index.d.mts +0 -16
- package/dist/styles/tetrons.css +0 -981
- package/public/dictionaries/index.aff +0 -205
- package/public/dictionaries/index.dic +0 -49569
- /package/dist/components/{UI/Button.tsx → Editor/config/featureConfig.d.ts} +0 -0
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { MathInline } from "./extensions/MathExtension";
|
|
3
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { useEditor, EditorContent as TiptapEditorContent } from "@tiptap/react";
|
|
5
|
-
import type { AddOn } from "../../types/types";
|
|
6
|
-
import { getActivePlan, Plan } from "../../utils/licenseTracker";
|
|
7
|
-
|
|
8
|
-
import Document from "@tiptap/extension-document";
|
|
9
|
-
import Paragraph from "@tiptap/extension-paragraph";
|
|
10
|
-
import Text from "@tiptap/extension-text";
|
|
11
|
-
import History from "@tiptap/extension-history";
|
|
12
|
-
import Bold from "@tiptap/extension-bold";
|
|
13
|
-
import Italic from "@tiptap/extension-italic";
|
|
14
|
-
import Underline from "@tiptap/extension-underline";
|
|
15
|
-
import Strike from "@tiptap/extension-strike";
|
|
16
|
-
import Code from "@tiptap/extension-code";
|
|
17
|
-
import Blockquote from "@tiptap/extension-blockquote";
|
|
18
|
-
import HardBreak from "@tiptap/extension-hard-break";
|
|
19
|
-
import Heading from "@tiptap/extension-heading";
|
|
20
|
-
import HorizontalRule from "@tiptap/extension-horizontal-rule";
|
|
21
|
-
import TextAlign from "@tiptap/extension-text-align";
|
|
22
|
-
import Color from "@tiptap/extension-color";
|
|
23
|
-
import Highlight from "@tiptap/extension-highlight";
|
|
24
|
-
import Image from "@tiptap/extension-image";
|
|
25
|
-
import Link from "@tiptap/extension-link";
|
|
26
|
-
import TextStyle from "@tiptap/extension-text-style";
|
|
27
|
-
import ListItem from "@tiptap/extension-list-item";
|
|
28
|
-
import BulletList from "@tiptap/extension-bullet-list";
|
|
29
|
-
import OrderedList from "@tiptap/extension-ordered-list";
|
|
30
|
-
import TableRow from "@tiptap/extension-table-row";
|
|
31
|
-
import TableCell from "@tiptap/extension-table-cell";
|
|
32
|
-
import TableHeader from "@tiptap/extension-table-header";
|
|
33
|
-
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
34
|
-
|
|
35
|
-
import js from "highlight.js/lib/languages/javascript";
|
|
36
|
-
import ts from "highlight.js/lib/languages/typescript";
|
|
37
|
-
import { createLowlight } from "lowlight";
|
|
38
|
-
|
|
39
|
-
import { useTypo } from "../../utils/useTypo";
|
|
40
|
-
import { Spellcheck } from "./extensions/Spellcheck";
|
|
41
|
-
import { Comment } from "./toolbar/extensions/Comment";
|
|
42
|
-
import { Subscript } from "./toolbar/marks/Subscript";
|
|
43
|
-
import { Superscript } from "./toolbar/marks/Superscript";
|
|
44
|
-
import { ResizableTable } from "./toolbar/extensions/ResizableTable";
|
|
45
|
-
import { Embed } from "./toolbar/extensions/Embed";
|
|
46
|
-
import { FontFamily } from "./toolbar/extensions/FontFamily";
|
|
47
|
-
import { FontSize } from "./toolbar/extensions/FontSize";
|
|
48
|
-
import { ResizableImage } from "./ResizableImage";
|
|
49
|
-
import { ResizableVideo } from "./ResizableVideo";
|
|
50
|
-
import TableContextMenu from "./toolbar/TableContextMenu";
|
|
51
|
-
import TetronsToolbar from "./toolbar/TetronsToolbar";
|
|
52
|
-
|
|
53
|
-
const lowlight = createLowlight();
|
|
54
|
-
lowlight.register("js", js);
|
|
55
|
-
lowlight.register("ts", ts);
|
|
56
|
-
|
|
57
|
-
type EditorContentProps = {
|
|
58
|
-
apiKey: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default function EditorContent({ apiKey }: EditorContentProps) {
|
|
62
|
-
const typo = useTypo();
|
|
63
|
-
|
|
64
|
-
const [isValid, setIsValid] = useState<boolean | null>(null);
|
|
65
|
-
const [error, setError] = useState<string | null>(null);
|
|
66
|
-
const [versions, setVersions] = useState<string[]>([]);
|
|
67
|
-
const [userVersion, setUserVersion] = useState<
|
|
68
|
-
"free" | "pro" | "premium" | "platinum" | null
|
|
69
|
-
>(null);
|
|
70
|
-
const [currentVersionIndex, setCurrentVersionIndex] = useState<number | null>(
|
|
71
|
-
null
|
|
72
|
-
);
|
|
73
|
-
const [addOns, setAddOns] = useState<AddOn[]>([]);
|
|
74
|
-
|
|
75
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
76
|
-
|
|
77
|
-
const API_BASE_URL =
|
|
78
|
-
typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL
|
|
79
|
-
? process.env.NEXT_PUBLIC_TETRONS_API_URL
|
|
80
|
-
: "https://staging.tetrons.com";
|
|
81
|
-
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
const fetchKeyData = async () => {
|
|
84
|
-
try {
|
|
85
|
-
const res = await fetch(`${API_BASE_URL}/api/api-key?apiKey=${apiKey}`);
|
|
86
|
-
const data = await res.json();
|
|
87
|
-
|
|
88
|
-
if (!res.ok) throw new Error(data.error || "Invalid API Key");
|
|
89
|
-
|
|
90
|
-
const version =
|
|
91
|
-
data.version &&
|
|
92
|
-
["free", "pro", "premium", "platinum"].includes(data.version)
|
|
93
|
-
? (data.version as Plan)
|
|
94
|
-
: "free";
|
|
95
|
-
|
|
96
|
-
const activeVersion = getActivePlan(version);
|
|
97
|
-
|
|
98
|
-
setIsValid(true);
|
|
99
|
-
setUserVersion(activeVersion);
|
|
100
|
-
setAddOns(data.addOn || []);
|
|
101
|
-
|
|
102
|
-
if (activeVersion === "free" && data.version !== "free") {
|
|
103
|
-
setError("Your paid plan has expired. Downgraded to Free version.");
|
|
104
|
-
}
|
|
105
|
-
} catch (err: unknown) {
|
|
106
|
-
setError(err instanceof Error ? err.message : "Invalid API Key");
|
|
107
|
-
setIsValid(false);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
fetchKeyData();
|
|
112
|
-
}, [apiKey, API_BASE_URL]);
|
|
113
|
-
|
|
114
|
-
const editor = useEditor({
|
|
115
|
-
extensions: [
|
|
116
|
-
Document,
|
|
117
|
-
Paragraph,
|
|
118
|
-
Text,
|
|
119
|
-
History,
|
|
120
|
-
Bold,
|
|
121
|
-
Italic,
|
|
122
|
-
Underline,
|
|
123
|
-
Strike,
|
|
124
|
-
Code,
|
|
125
|
-
Blockquote,
|
|
126
|
-
HardBreak,
|
|
127
|
-
Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }),
|
|
128
|
-
HorizontalRule,
|
|
129
|
-
TextStyle,
|
|
130
|
-
Color,
|
|
131
|
-
Highlight.configure({ multicolor: true }),
|
|
132
|
-
FontFamily,
|
|
133
|
-
FontSize,
|
|
134
|
-
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
135
|
-
ListItem,
|
|
136
|
-
BulletList,
|
|
137
|
-
OrderedList,
|
|
138
|
-
Subscript,
|
|
139
|
-
Superscript,
|
|
140
|
-
Image,
|
|
141
|
-
Link.configure({
|
|
142
|
-
openOnClick: false,
|
|
143
|
-
autolink: true,
|
|
144
|
-
linkOnPaste: true,
|
|
145
|
-
}),
|
|
146
|
-
ResizableTable.configure({ resizable: true }),
|
|
147
|
-
TableRow,
|
|
148
|
-
TableCell,
|
|
149
|
-
TableHeader,
|
|
150
|
-
Embed,
|
|
151
|
-
ResizableImage,
|
|
152
|
-
ResizableVideo,
|
|
153
|
-
Comment,
|
|
154
|
-
CodeBlockLowlight.configure({
|
|
155
|
-
lowlight,
|
|
156
|
-
HTMLAttributes: {
|
|
157
|
-
class: "bg-gray-100 p-2 rounded font-mono text-sm overflow-auto",
|
|
158
|
-
},
|
|
159
|
-
}),
|
|
160
|
-
...(typo
|
|
161
|
-
? [
|
|
162
|
-
Spellcheck.configure({
|
|
163
|
-
spellcheckFn: (word: string) => typo.check(word),
|
|
164
|
-
}),
|
|
165
|
-
]
|
|
166
|
-
: []),
|
|
167
|
-
MathInline,
|
|
168
|
-
],
|
|
169
|
-
content: "",
|
|
170
|
-
editorProps: {
|
|
171
|
-
attributes: {
|
|
172
|
-
class: "min-h-full focus:outline-none p-0",
|
|
173
|
-
"data-placeholder": "Start typing here...",
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
immediatelyRender: false,
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
useEffect(() => {
|
|
180
|
-
return () => {
|
|
181
|
-
editor?.destroy();
|
|
182
|
-
};
|
|
183
|
-
}, [editor]);
|
|
184
|
-
|
|
185
|
-
const handleEditorClick = () => {
|
|
186
|
-
if (editor && !editor.isFocused) {
|
|
187
|
-
editor.commands.focus();
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const saveVersion = () => {
|
|
192
|
-
if (!editor) return;
|
|
193
|
-
const content = editor.getJSON();
|
|
194
|
-
setVersions((prev) => [...prev, JSON.stringify(content)]);
|
|
195
|
-
setCurrentVersionIndex(versions.length);
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const restoreVersion = (index: number) => {
|
|
199
|
-
if (!editor) return;
|
|
200
|
-
const versionContent = versions[index];
|
|
201
|
-
if (versionContent) {
|
|
202
|
-
editor.commands.setContent(JSON.parse(versionContent));
|
|
203
|
-
setCurrentVersionIndex(index);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
if (isValid === false) {
|
|
208
|
-
return <div className="editor-error">⚠️ {error}</div>;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (isValid === null) {
|
|
212
|
-
return <div className="editor-loading">🔍 Validating license...</div>;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (!typo) {
|
|
216
|
-
return <div className="editor-loading">📖 Loading dictionary...</div>;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<div className="editor-container">
|
|
221
|
-
{userVersion !== "free" && (
|
|
222
|
-
<div className="editor-toolbar">
|
|
223
|
-
<button
|
|
224
|
-
type="button"
|
|
225
|
-
onClick={saveVersion}
|
|
226
|
-
disabled={!editor}
|
|
227
|
-
className="editor-save-btn"
|
|
228
|
-
>
|
|
229
|
-
Save Version
|
|
230
|
-
</button>
|
|
231
|
-
|
|
232
|
-
<div className="editor-versions-wrapper">
|
|
233
|
-
{versions.length === 0 ? (
|
|
234
|
-
<span className="editor-no-versions">No saved versions</span>
|
|
235
|
-
) : (
|
|
236
|
-
versions.map((_, idx) => (
|
|
237
|
-
<button
|
|
238
|
-
key={idx}
|
|
239
|
-
type="button"
|
|
240
|
-
onClick={() => restoreVersion(idx)}
|
|
241
|
-
className={`editor-version-btn ${idx === currentVersionIndex ? "active" : ""}`}
|
|
242
|
-
title={`Restore Version ${idx + 1}`}
|
|
243
|
-
>
|
|
244
|
-
{`V${idx + 1}`}
|
|
245
|
-
</button>
|
|
246
|
-
))
|
|
247
|
-
)}
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
)}
|
|
251
|
-
|
|
252
|
-
{editor && userVersion && (
|
|
253
|
-
<TetronsToolbar editor={editor} version={userVersion} addOns={addOns} />
|
|
254
|
-
)}
|
|
255
|
-
|
|
256
|
-
<div
|
|
257
|
-
ref={wrapperRef}
|
|
258
|
-
className="editor-content-wrapper"
|
|
259
|
-
onClick={handleEditorClick}
|
|
260
|
-
>
|
|
261
|
-
{editor ? (
|
|
262
|
-
<>
|
|
263
|
-
<TiptapEditorContent editor={editor} />
|
|
264
|
-
<TableContextMenu editor={editor} />
|
|
265
|
-
</>
|
|
266
|
-
) : (
|
|
267
|
-
<div className="editor-loading">Loading editor...</div>
|
|
268
|
-
)}
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
);
|
|
272
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from "react";
|
|
2
|
-
import { NodeViewWrapper, ReactNodeViewProps } from "@tiptap/react";
|
|
3
|
-
|
|
4
|
-
const ResizableImageComponent: React.FC<ReactNodeViewProps> = ({
|
|
5
|
-
node,
|
|
6
|
-
updateAttributes,
|
|
7
|
-
selected,
|
|
8
|
-
}) => {
|
|
9
|
-
const { src, alt, title, width, height } = node.attrs as {
|
|
10
|
-
src: string;
|
|
11
|
-
alt?: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
width?: number | null;
|
|
14
|
-
height?: number | null;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const defaultWidth = width ?? 300;
|
|
18
|
-
const defaultHeight = height ?? 200;
|
|
19
|
-
const aspectRatio = defaultHeight > 0 ? defaultWidth / defaultHeight : 4 / 3;
|
|
20
|
-
|
|
21
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
22
|
-
const [isResizing, setIsResizing] = useState(false);
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const handleMouseMove = (e: MouseEvent) => {
|
|
26
|
-
if (!isResizing || !wrapperRef.current) return;
|
|
27
|
-
|
|
28
|
-
const rect = wrapperRef.current.getBoundingClientRect();
|
|
29
|
-
const newWidth = e.clientX - rect.left;
|
|
30
|
-
const newHeight = newWidth / aspectRatio;
|
|
31
|
-
|
|
32
|
-
if (newWidth > 50 && newHeight > 50) {
|
|
33
|
-
updateAttributes({
|
|
34
|
-
width: Math.round(newWidth),
|
|
35
|
-
height: Math.round(newHeight),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const handleMouseUp = () => {
|
|
41
|
-
setIsResizing(false);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
if (isResizing) {
|
|
45
|
-
window.addEventListener("mousemove", handleMouseMove);
|
|
46
|
-
window.addEventListener("mouseup", handleMouseUp);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return () => {
|
|
50
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
51
|
-
window.removeEventListener("mouseup", handleMouseUp);
|
|
52
|
-
};
|
|
53
|
-
}, [isResizing, updateAttributes, aspectRatio]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<NodeViewWrapper
|
|
57
|
-
ref={wrapperRef}
|
|
58
|
-
contentEditable={false}
|
|
59
|
-
className={`resizable-image-wrapper ${
|
|
60
|
-
selected ? "ProseMirror-selectednode" : ""
|
|
61
|
-
}`}
|
|
62
|
-
style={{
|
|
63
|
-
position: "relative",
|
|
64
|
-
border: "1px solid #ccc",
|
|
65
|
-
display: "inline-block",
|
|
66
|
-
width: `${defaultWidth}px`,
|
|
67
|
-
height: `${defaultHeight}px`,
|
|
68
|
-
minWidth: "50px",
|
|
69
|
-
minHeight: "50px",
|
|
70
|
-
maxWidth: "100%",
|
|
71
|
-
userSelect: "none",
|
|
72
|
-
padding: 2,
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<img
|
|
76
|
-
src={src}
|
|
77
|
-
alt={alt ?? ""}
|
|
78
|
-
title={title ?? ""}
|
|
79
|
-
loading="lazy"
|
|
80
|
-
style={{
|
|
81
|
-
width: "100%",
|
|
82
|
-
height: "100%",
|
|
83
|
-
objectFit: "contain",
|
|
84
|
-
display: "block",
|
|
85
|
-
userSelect: "none",
|
|
86
|
-
pointerEvents: "auto",
|
|
87
|
-
}}
|
|
88
|
-
draggable={false}
|
|
89
|
-
/>
|
|
90
|
-
|
|
91
|
-
<div
|
|
92
|
-
onMouseDown={(e) => {
|
|
93
|
-
e.preventDefault();
|
|
94
|
-
setIsResizing(true);
|
|
95
|
-
}}
|
|
96
|
-
style={{
|
|
97
|
-
position: "absolute",
|
|
98
|
-
width: "12px",
|
|
99
|
-
height: "12px",
|
|
100
|
-
right: 2,
|
|
101
|
-
bottom: 2,
|
|
102
|
-
background: "#ccc",
|
|
103
|
-
borderRadius: "2px",
|
|
104
|
-
cursor: "nwse-resize",
|
|
105
|
-
zIndex: 10,
|
|
106
|
-
}}
|
|
107
|
-
/>
|
|
108
|
-
</NodeViewWrapper>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export default ResizableImageComponent;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect } from "react";
|
|
2
|
-
import { NodeViewWrapper } from "@tiptap/react";
|
|
3
|
-
import type { NodeViewProps } from "@tiptap/core";
|
|
4
|
-
|
|
5
|
-
const ResizableVideoComponent: React.FC<NodeViewProps> = ({
|
|
6
|
-
node,
|
|
7
|
-
updateAttributes,
|
|
8
|
-
selected,
|
|
9
|
-
}) => {
|
|
10
|
-
const { src, controls, width, height } = node.attrs;
|
|
11
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
12
|
-
const videoRef = useRef<HTMLVideoElement>(null);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const video = videoRef.current;
|
|
16
|
-
if (!video) return;
|
|
17
|
-
|
|
18
|
-
const observer = new ResizeObserver(() => {
|
|
19
|
-
const w = Math.round(video.offsetWidth);
|
|
20
|
-
const h = Math.round(video.offsetHeight);
|
|
21
|
-
updateAttributes({ width: w, height: h });
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
observer.observe(video);
|
|
25
|
-
return () => observer.disconnect();
|
|
26
|
-
}, [updateAttributes]);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<NodeViewWrapper
|
|
30
|
-
ref={wrapperRef}
|
|
31
|
-
contentEditable={false}
|
|
32
|
-
className={`resizable-video-wrapper ${
|
|
33
|
-
selected ? "ProseMirror-selectednode" : ""
|
|
34
|
-
}`}
|
|
35
|
-
style={{
|
|
36
|
-
resize: "both",
|
|
37
|
-
overflow: "auto",
|
|
38
|
-
border: "1px solid #ccc",
|
|
39
|
-
padding: "2px",
|
|
40
|
-
display: "inline-block",
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
<video
|
|
44
|
-
ref={videoRef}
|
|
45
|
-
src={src}
|
|
46
|
-
controls={controls}
|
|
47
|
-
style={{
|
|
48
|
-
width: width ? `${width}px` : "auto",
|
|
49
|
-
height: height ? `${height}px` : "auto",
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
</NodeViewWrapper>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default ResizableVideoComponent;
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
SET UTF-8
|
|
2
|
-
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'
|
|
3
|
-
ICONV 1
|
|
4
|
-
ICONV ’ '
|
|
5
|
-
NOSUGGEST !
|
|
6
|
-
|
|
7
|
-
# ordinal numbers
|
|
8
|
-
COMPOUNDMIN 1
|
|
9
|
-
# only in compounds: 1th, 2th, 3th
|
|
10
|
-
ONLYINCOMPOUND c
|
|
11
|
-
# compound rules:
|
|
12
|
-
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
|
|
13
|
-
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
|
|
14
|
-
COMPOUNDRULE 2
|
|
15
|
-
COMPOUNDRULE n*1t
|
|
16
|
-
COMPOUNDRULE n*mp
|
|
17
|
-
WORDCHARS 0123456789
|
|
18
|
-
|
|
19
|
-
PFX A Y 1
|
|
20
|
-
PFX A 0 re .
|
|
21
|
-
|
|
22
|
-
PFX I Y 1
|
|
23
|
-
PFX I 0 in .
|
|
24
|
-
|
|
25
|
-
PFX U Y 1
|
|
26
|
-
PFX U 0 un .
|
|
27
|
-
|
|
28
|
-
PFX C Y 1
|
|
29
|
-
PFX C 0 de .
|
|
30
|
-
|
|
31
|
-
PFX E Y 1
|
|
32
|
-
PFX E 0 dis .
|
|
33
|
-
|
|
34
|
-
PFX F Y 1
|
|
35
|
-
PFX F 0 con .
|
|
36
|
-
|
|
37
|
-
PFX K Y 1
|
|
38
|
-
PFX K 0 pro .
|
|
39
|
-
|
|
40
|
-
SFX V N 2
|
|
41
|
-
SFX V e ive e
|
|
42
|
-
SFX V 0 ive [^e]
|
|
43
|
-
|
|
44
|
-
SFX N Y 3
|
|
45
|
-
SFX N e ion e
|
|
46
|
-
SFX N y ication y
|
|
47
|
-
SFX N 0 en [^ey]
|
|
48
|
-
|
|
49
|
-
SFX X Y 3
|
|
50
|
-
SFX X e ions e
|
|
51
|
-
SFX X y ications y
|
|
52
|
-
SFX X 0 ens [^ey]
|
|
53
|
-
|
|
54
|
-
SFX H N 2
|
|
55
|
-
SFX H y ieth y
|
|
56
|
-
SFX H 0 th [^y]
|
|
57
|
-
|
|
58
|
-
SFX Y Y 1
|
|
59
|
-
SFX Y 0 ly .
|
|
60
|
-
|
|
61
|
-
SFX G Y 2
|
|
62
|
-
SFX G e ing e
|
|
63
|
-
SFX G 0 ing [^e]
|
|
64
|
-
|
|
65
|
-
SFX J Y 2
|
|
66
|
-
SFX J e ings e
|
|
67
|
-
SFX J 0 ings [^e]
|
|
68
|
-
|
|
69
|
-
SFX D Y 4
|
|
70
|
-
SFX D 0 d e
|
|
71
|
-
SFX D y ied [^aeiou]y
|
|
72
|
-
SFX D 0 ed [^ey]
|
|
73
|
-
SFX D 0 ed [aeiou]y
|
|
74
|
-
|
|
75
|
-
SFX T N 4
|
|
76
|
-
SFX T 0 st e
|
|
77
|
-
SFX T y iest [^aeiou]y
|
|
78
|
-
SFX T 0 est [aeiou]y
|
|
79
|
-
SFX T 0 est [^ey]
|
|
80
|
-
|
|
81
|
-
SFX R Y 4
|
|
82
|
-
SFX R 0 r e
|
|
83
|
-
SFX R y ier [^aeiou]y
|
|
84
|
-
SFX R 0 er [aeiou]y
|
|
85
|
-
SFX R 0 er [^ey]
|
|
86
|
-
|
|
87
|
-
SFX Z Y 4
|
|
88
|
-
SFX Z 0 rs e
|
|
89
|
-
SFX Z y iers [^aeiou]y
|
|
90
|
-
SFX Z 0 ers [aeiou]y
|
|
91
|
-
SFX Z 0 ers [^ey]
|
|
92
|
-
|
|
93
|
-
SFX S Y 4
|
|
94
|
-
SFX S y ies [^aeiou]y
|
|
95
|
-
SFX S 0 s [aeiou]y
|
|
96
|
-
SFX S 0 es [sxzh]
|
|
97
|
-
SFX S 0 s [^sxzhy]
|
|
98
|
-
|
|
99
|
-
SFX P Y 3
|
|
100
|
-
SFX P y iness [^aeiou]y
|
|
101
|
-
SFX P 0 ness [aeiou]y
|
|
102
|
-
SFX P 0 ness [^y]
|
|
103
|
-
|
|
104
|
-
SFX M Y 1
|
|
105
|
-
SFX M 0 's .
|
|
106
|
-
|
|
107
|
-
SFX B Y 3
|
|
108
|
-
SFX B 0 able [^aeiou]
|
|
109
|
-
SFX B 0 able ee
|
|
110
|
-
SFX B e able [^aeiou]e
|
|
111
|
-
|
|
112
|
-
SFX L Y 1
|
|
113
|
-
SFX L 0 ment .
|
|
114
|
-
|
|
115
|
-
REP 90
|
|
116
|
-
REP a ei
|
|
117
|
-
REP ei a
|
|
118
|
-
REP a ey
|
|
119
|
-
REP ey a
|
|
120
|
-
REP ai ie
|
|
121
|
-
REP ie ai
|
|
122
|
-
REP alot a_lot
|
|
123
|
-
REP are air
|
|
124
|
-
REP are ear
|
|
125
|
-
REP are eir
|
|
126
|
-
REP air are
|
|
127
|
-
REP air ere
|
|
128
|
-
REP ere air
|
|
129
|
-
REP ere ear
|
|
130
|
-
REP ere eir
|
|
131
|
-
REP ear are
|
|
132
|
-
REP ear air
|
|
133
|
-
REP ear ere
|
|
134
|
-
REP eir are
|
|
135
|
-
REP eir ere
|
|
136
|
-
REP ch te
|
|
137
|
-
REP te ch
|
|
138
|
-
REP ch ti
|
|
139
|
-
REP ti ch
|
|
140
|
-
REP ch tu
|
|
141
|
-
REP tu ch
|
|
142
|
-
REP ch s
|
|
143
|
-
REP s ch
|
|
144
|
-
REP ch k
|
|
145
|
-
REP k ch
|
|
146
|
-
REP f ph
|
|
147
|
-
REP ph f
|
|
148
|
-
REP gh f
|
|
149
|
-
REP f gh
|
|
150
|
-
REP i igh
|
|
151
|
-
REP igh i
|
|
152
|
-
REP i uy
|
|
153
|
-
REP uy i
|
|
154
|
-
REP i ee
|
|
155
|
-
REP ee i
|
|
156
|
-
REP j di
|
|
157
|
-
REP di j
|
|
158
|
-
REP j gg
|
|
159
|
-
REP gg j
|
|
160
|
-
REP j ge
|
|
161
|
-
REP ge j
|
|
162
|
-
REP s ti
|
|
163
|
-
REP ti s
|
|
164
|
-
REP s ci
|
|
165
|
-
REP ci s
|
|
166
|
-
REP k cc
|
|
167
|
-
REP cc k
|
|
168
|
-
REP k qu
|
|
169
|
-
REP qu k
|
|
170
|
-
REP kw qu
|
|
171
|
-
REP o eau
|
|
172
|
-
REP eau o
|
|
173
|
-
REP o ew
|
|
174
|
-
REP ew o
|
|
175
|
-
REP oo ew
|
|
176
|
-
REP ew oo
|
|
177
|
-
REP ew ui
|
|
178
|
-
REP ui ew
|
|
179
|
-
REP oo ui
|
|
180
|
-
REP ui oo
|
|
181
|
-
REP ew u
|
|
182
|
-
REP u ew
|
|
183
|
-
REP oo u
|
|
184
|
-
REP u oo
|
|
185
|
-
REP u oe
|
|
186
|
-
REP oe u
|
|
187
|
-
REP u ieu
|
|
188
|
-
REP ieu u
|
|
189
|
-
REP ue ew
|
|
190
|
-
REP ew ue
|
|
191
|
-
REP uff ough
|
|
192
|
-
REP oo ieu
|
|
193
|
-
REP ieu oo
|
|
194
|
-
REP ier ear
|
|
195
|
-
REP ear ier
|
|
196
|
-
REP ear air
|
|
197
|
-
REP air ear
|
|
198
|
-
REP w qu
|
|
199
|
-
REP qu w
|
|
200
|
-
REP z ss
|
|
201
|
-
REP ss z
|
|
202
|
-
REP shun tion
|
|
203
|
-
REP shun sion
|
|
204
|
-
REP shun cion
|
|
205
|
-
REP size cise
|