tetrons 2.3.76 → 2.3.78
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/api/execute/route.cjs +55 -0
- package/dist/app/api/execute/route.d.mts +8 -0
- package/dist/app/api/execute/route.d.ts +8 -0
- package/dist/app/api/execute/route.mjs +30 -0
- package/dist/components/tetrons/EditorContent.tsx +29 -23
- package/dist/dictionaries/dictionaries/index.aff +205 -0
- package/dist/dictionaries/dictionaries/index.dic +49569 -0
- package/dist/index.cjs +380 -126
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +455 -197
- package/dist/styles/tetrons.css +107 -0
- package/package.json +18 -7
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,210 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// src/components/tetrons/toolbar/MathModal.js
|
|
12
|
+
var MathModal_exports = {};
|
|
13
|
+
__export(MathModal_exports, {
|
|
14
|
+
default: () => MathModal
|
|
15
|
+
});
|
|
16
|
+
import { useEffect as useEffect7 } from "react";
|
|
17
|
+
import katex2 from "katex";
|
|
18
|
+
import "katex/dist/katex.min.css";
|
|
19
|
+
function MathModal({
|
|
20
|
+
isOpen,
|
|
21
|
+
onClose,
|
|
22
|
+
onSubmit,
|
|
23
|
+
value,
|
|
24
|
+
setValue
|
|
25
|
+
}) {
|
|
26
|
+
useEffect7(() => {
|
|
27
|
+
const onEsc = (e) => {
|
|
28
|
+
if (e.key === "Escape") onClose();
|
|
29
|
+
};
|
|
30
|
+
if (isOpen) {
|
|
31
|
+
window.addEventListener("keydown", onEsc);
|
|
32
|
+
}
|
|
33
|
+
return () => window.removeEventListener("keydown", onEsc);
|
|
34
|
+
}, [isOpen, onClose]);
|
|
35
|
+
if (!isOpen) return null;
|
|
36
|
+
return /* @__PURE__ */ React.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ React.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ React.createElement("div", { className: "ai-modal-title" }, "Insert LaTeX Equation"), /* @__PURE__ */ React.createElement(
|
|
37
|
+
"textarea",
|
|
38
|
+
{
|
|
39
|
+
className: "ai-modal-textarea",
|
|
40
|
+
placeholder: "Enter LaTeX code here...",
|
|
41
|
+
value,
|
|
42
|
+
onChange: (e) => setValue(e.target.value)
|
|
43
|
+
}
|
|
44
|
+
), /* @__PURE__ */ React.createElement("div", { className: "ai-modal-preview" }, /* @__PURE__ */ React.createElement("strong", null, "Preview:"), /* @__PURE__ */ React.createElement("div", { className: "ai-modal-preview-output" }, /* @__PURE__ */ React.createElement("span", { dangerouslySetInnerHTML: { __html: renderLatex(value) } }))), /* @__PURE__ */ React.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React.createElement("button", { type: "button", className: "ai-cancel-btn", onClick: onClose }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
className: "ai-submit-btn",
|
|
48
|
+
onClick: () => onSubmit(value),
|
|
49
|
+
disabled: !value.trim()
|
|
50
|
+
},
|
|
51
|
+
"Insert"
|
|
52
|
+
))));
|
|
53
|
+
}
|
|
54
|
+
function renderLatex(latex) {
|
|
55
|
+
try {
|
|
56
|
+
return katex2.renderToString(latex, {
|
|
57
|
+
throwOnError: false,
|
|
58
|
+
displayMode: false
|
|
59
|
+
});
|
|
60
|
+
} catch {
|
|
61
|
+
return `<span style="color: red;">Invalid LaTeX</span>`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var init_MathModal = __esm({
|
|
65
|
+
"src/components/tetrons/toolbar/MathModal.js"() {
|
|
66
|
+
"use strict";
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// src/components/tetrons/toolbar/CodeEditorModal.js
|
|
71
|
+
var CodeEditorModal_exports = {};
|
|
72
|
+
__export(CodeEditorModal_exports, {
|
|
73
|
+
default: () => CodeEditorModal_default
|
|
74
|
+
});
|
|
75
|
+
import React14, { useState as useState8 } from "react";
|
|
76
|
+
import Editor from "@monaco-editor/react";
|
|
77
|
+
var CodeEditorModal, CodeEditorModal_default;
|
|
78
|
+
var init_CodeEditorModal = __esm({
|
|
79
|
+
"src/components/tetrons/toolbar/CodeEditorModal.js"() {
|
|
80
|
+
"use strict";
|
|
81
|
+
"use client";
|
|
82
|
+
CodeEditorModal = ({ isOpen, onClose }) => {
|
|
83
|
+
const [language, setLanguage] = useState8("javascript");
|
|
84
|
+
const [code, setCode] = useState8("// Write your code here");
|
|
85
|
+
const [output, setOutput] = useState8("");
|
|
86
|
+
const [loading, setLoading] = useState8(false);
|
|
87
|
+
const runCode = async () => {
|
|
88
|
+
setLoading(true);
|
|
89
|
+
try {
|
|
90
|
+
const res = await fetch("/api/execute", {
|
|
91
|
+
method: "POST",
|
|
92
|
+
headers: { "Content-Type": "application/json" },
|
|
93
|
+
body: JSON.stringify({ language, code })
|
|
94
|
+
});
|
|
95
|
+
const data = await res.json();
|
|
96
|
+
let result = "";
|
|
97
|
+
if (data.stderr) result += `Error:
|
|
98
|
+
${data.stderr}
|
|
99
|
+
`;
|
|
100
|
+
if (data.stdout) result += data.stdout;
|
|
101
|
+
if (!data.stdout && !data.stderr) result = "No output";
|
|
102
|
+
setOutput(result);
|
|
103
|
+
} catch (err) {
|
|
104
|
+
console.log(err.message);
|
|
105
|
+
setOutput("Error running code");
|
|
106
|
+
}
|
|
107
|
+
setLoading(false);
|
|
108
|
+
};
|
|
109
|
+
if (!isOpen) return null;
|
|
110
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "code-modal-overlay" }, /* @__PURE__ */ React14.createElement("div", { className: "code-modal-content" }, /* @__PURE__ */ React14.createElement("div", { className: "code-modal-header" }, /* @__PURE__ */ React14.createElement("h2", null, "Run Code"), /* @__PURE__ */ React14.createElement("button", { onClick: onClose, className: "code-close-btn" }, "\xD7")), /* @__PURE__ */ React14.createElement("div", { className: "code-modal-controls" }, /* @__PURE__ */ React14.createElement("label", { htmlFor: "language" }, "Language:"), /* @__PURE__ */ React14.createElement(
|
|
111
|
+
"select",
|
|
112
|
+
{
|
|
113
|
+
id: "language",
|
|
114
|
+
value: language,
|
|
115
|
+
onChange: (e) => setLanguage(e.target.value)
|
|
116
|
+
},
|
|
117
|
+
/* @__PURE__ */ React14.createElement("option", { value: "javascript" }, "JavaScript"),
|
|
118
|
+
/* @__PURE__ */ React14.createElement("option", { value: "python" }, "Python"),
|
|
119
|
+
/* @__PURE__ */ React14.createElement("option", { value: "cpp" }, "C++"),
|
|
120
|
+
/* @__PURE__ */ React14.createElement("option", { value: "java" }, "Java"),
|
|
121
|
+
/* @__PURE__ */ React14.createElement("option", { value: "typescript" }, "TypeScript")
|
|
122
|
+
), /* @__PURE__ */ React14.createElement("button", { className: "run-code", onClick: runCode, disabled: loading }, loading ? "Running..." : "Run")), /* @__PURE__ */ React14.createElement(
|
|
123
|
+
Editor,
|
|
124
|
+
{
|
|
125
|
+
height: "50vh",
|
|
126
|
+
theme: "vs-dark",
|
|
127
|
+
language,
|
|
128
|
+
value: code,
|
|
129
|
+
onChange: (v) => setCode(v ?? "")
|
|
130
|
+
}
|
|
131
|
+
), /* @__PURE__ */ React14.createElement("div", { className: "code-output" }, /* @__PURE__ */ React14.createElement("strong", null, "Output:"), /* @__PURE__ */ React14.createElement("pre", null, output.trim() === "" ? "\u2190 Click Run to see output here" : output))));
|
|
132
|
+
};
|
|
133
|
+
CodeEditorModal_default = CodeEditorModal;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// src/components/tetrons/extensions/MathExtension.ts
|
|
138
|
+
import { Node, mergeAttributes } from "@tiptap/core";
|
|
139
|
+
import katex from "katex";
|
|
140
|
+
var MathInline = Node.create({
|
|
141
|
+
name: "mathInline",
|
|
142
|
+
inline: true,
|
|
143
|
+
group: "inline",
|
|
144
|
+
atom: true,
|
|
145
|
+
addAttributes() {
|
|
146
|
+
return {
|
|
147
|
+
formula: {
|
|
148
|
+
default: ""
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
parseHTML() {
|
|
153
|
+
return [{ tag: "span[data-math-inline]" }];
|
|
154
|
+
},
|
|
155
|
+
renderHTML({ HTMLAttributes }) {
|
|
156
|
+
return [
|
|
157
|
+
"span",
|
|
158
|
+
mergeAttributes(HTMLAttributes, {
|
|
159
|
+
"data-math-inline": "",
|
|
160
|
+
class: "math-inline"
|
|
161
|
+
}),
|
|
162
|
+
HTMLAttributes.formula
|
|
163
|
+
];
|
|
164
|
+
},
|
|
165
|
+
addNodeView() {
|
|
166
|
+
return ({ node }) => {
|
|
167
|
+
const span = document.createElement("span");
|
|
168
|
+
try {
|
|
169
|
+
span.innerHTML = katex.renderToString(node.attrs.formula, {
|
|
170
|
+
throwOnError: false,
|
|
171
|
+
displayMode: false
|
|
172
|
+
});
|
|
173
|
+
} catch {
|
|
174
|
+
span.textContent = node.attrs.formula;
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
dom: span
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
addCommands() {
|
|
182
|
+
return {
|
|
183
|
+
insertMathInline: (formula) => ({ commands }) => {
|
|
184
|
+
return commands.insertContent({
|
|
185
|
+
type: this.name,
|
|
186
|
+
attrs: { formula }
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
1
193
|
// src/components/tetrons/EditorContent.tsx
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
useEditor,
|
|
5
|
-
EditorContent as TiptapEditorContent
|
|
6
|
-
} from "@tiptap/react";
|
|
194
|
+
import React17, { useEffect as useEffect9, useRef as useRef7, useState as useState11 } from "react";
|
|
195
|
+
import { useEditor, EditorContent as TiptapEditorContent } from "@tiptap/react";
|
|
7
196
|
|
|
8
197
|
// node_modules/@tiptap/extension-document/dist/index.js
|
|
9
|
-
import { Node } from "@tiptap/core";
|
|
10
|
-
var Document =
|
|
198
|
+
import { Node as Node2 } from "@tiptap/core";
|
|
199
|
+
var Document = Node2.create({
|
|
11
200
|
name: "doc",
|
|
12
201
|
topNode: true,
|
|
13
202
|
content: "block+"
|
|
14
203
|
});
|
|
15
204
|
|
|
16
205
|
// node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
17
|
-
import { Node as
|
|
18
|
-
var Paragraph =
|
|
206
|
+
import { Node as Node3, mergeAttributes as mergeAttributes2 } from "@tiptap/core";
|
|
207
|
+
var Paragraph = Node3.create({
|
|
19
208
|
name: "paragraph",
|
|
20
209
|
priority: 1e3,
|
|
21
210
|
addOptions() {
|
|
@@ -31,7 +220,7 @@ var Paragraph = Node2.create({
|
|
|
31
220
|
];
|
|
32
221
|
},
|
|
33
222
|
renderHTML({ HTMLAttributes }) {
|
|
34
|
-
return ["p",
|
|
223
|
+
return ["p", mergeAttributes2(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
35
224
|
},
|
|
36
225
|
addCommands() {
|
|
37
226
|
return {
|
|
@@ -48,8 +237,8 @@ var Paragraph = Node2.create({
|
|
|
48
237
|
});
|
|
49
238
|
|
|
50
239
|
// node_modules/@tiptap/extension-text/dist/index.js
|
|
51
|
-
import { Node as
|
|
52
|
-
var Text =
|
|
240
|
+
import { Node as Node4 } from "@tiptap/core";
|
|
241
|
+
var Text = Node4.create({
|
|
53
242
|
name: "text",
|
|
54
243
|
group: "inline"
|
|
55
244
|
});
|
|
@@ -1272,7 +1461,7 @@ var NodeRange = class {
|
|
|
1272
1461
|
}
|
|
1273
1462
|
};
|
|
1274
1463
|
var emptyAttrs = /* @__PURE__ */ Object.create(null);
|
|
1275
|
-
var
|
|
1464
|
+
var Node5 = class _Node {
|
|
1276
1465
|
/**
|
|
1277
1466
|
@internal
|
|
1278
1467
|
*/
|
|
@@ -1673,7 +1862,7 @@ var Node4 = class _Node {
|
|
|
1673
1862
|
return node;
|
|
1674
1863
|
}
|
|
1675
1864
|
};
|
|
1676
|
-
|
|
1865
|
+
Node5.prototype.text = void 0;
|
|
1677
1866
|
function wrapMarks(marks, str) {
|
|
1678
1867
|
for (let i = marks.length - 1; i >= 0; i--)
|
|
1679
1868
|
str = marks[i].type.name + "(" + str + ")";
|
|
@@ -5713,7 +5902,7 @@ var History = Extension.create({
|
|
|
5713
5902
|
});
|
|
5714
5903
|
|
|
5715
5904
|
// node_modules/@tiptap/extension-bold/dist/index.js
|
|
5716
|
-
import { Mark as Mark2, mergeAttributes as
|
|
5905
|
+
import { Mark as Mark2, mergeAttributes as mergeAttributes3, markInputRule, markPasteRule } from "@tiptap/core";
|
|
5717
5906
|
var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
|
|
5718
5907
|
var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
|
|
5719
5908
|
var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
|
|
@@ -5745,7 +5934,7 @@ var Bold = Mark2.create({
|
|
|
5745
5934
|
];
|
|
5746
5935
|
},
|
|
5747
5936
|
renderHTML({ HTMLAttributes }) {
|
|
5748
|
-
return ["strong",
|
|
5937
|
+
return ["strong", mergeAttributes3(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5749
5938
|
},
|
|
5750
5939
|
addCommands() {
|
|
5751
5940
|
return {
|
|
@@ -5793,7 +5982,7 @@ var Bold = Mark2.create({
|
|
|
5793
5982
|
});
|
|
5794
5983
|
|
|
5795
5984
|
// node_modules/@tiptap/extension-italic/dist/index.js
|
|
5796
|
-
import { Mark as Mark3, mergeAttributes as
|
|
5985
|
+
import { Mark as Mark3, mergeAttributes as mergeAttributes4, markInputRule as markInputRule2, markPasteRule as markPasteRule2 } from "@tiptap/core";
|
|
5797
5986
|
var starInputRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
|
|
5798
5987
|
var starPasteRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
|
|
5799
5988
|
var underscoreInputRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
|
|
@@ -5824,7 +6013,7 @@ var Italic = Mark3.create({
|
|
|
5824
6013
|
];
|
|
5825
6014
|
},
|
|
5826
6015
|
renderHTML({ HTMLAttributes }) {
|
|
5827
|
-
return ["em",
|
|
6016
|
+
return ["em", mergeAttributes4(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5828
6017
|
},
|
|
5829
6018
|
addCommands() {
|
|
5830
6019
|
return {
|
|
@@ -5875,7 +6064,7 @@ var Italic = Mark3.create({
|
|
|
5875
6064
|
import Underline from "@tiptap/extension-underline";
|
|
5876
6065
|
|
|
5877
6066
|
// node_modules/@tiptap/extension-strike/dist/index.js
|
|
5878
|
-
import { Mark as Mark4, mergeAttributes as
|
|
6067
|
+
import { Mark as Mark4, mergeAttributes as mergeAttributes5, markInputRule as markInputRule3, markPasteRule as markPasteRule3 } from "@tiptap/core";
|
|
5879
6068
|
var inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
|
|
5880
6069
|
var pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
|
|
5881
6070
|
var Strike = Mark4.create({
|
|
@@ -5904,7 +6093,7 @@ var Strike = Mark4.create({
|
|
|
5904
6093
|
];
|
|
5905
6094
|
},
|
|
5906
6095
|
renderHTML({ HTMLAttributes }) {
|
|
5907
|
-
return ["s",
|
|
6096
|
+
return ["s", mergeAttributes5(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5908
6097
|
},
|
|
5909
6098
|
addCommands() {
|
|
5910
6099
|
return {
|
|
@@ -5943,7 +6132,7 @@ var Strike = Mark4.create({
|
|
|
5943
6132
|
});
|
|
5944
6133
|
|
|
5945
6134
|
// node_modules/@tiptap/extension-code/dist/index.js
|
|
5946
|
-
import { Mark as Mark5, mergeAttributes as
|
|
6135
|
+
import { Mark as Mark5, mergeAttributes as mergeAttributes6, markInputRule as markInputRule4, markPasteRule as markPasteRule4 } from "@tiptap/core";
|
|
5947
6136
|
var inputRegex2 = /(^|[^`])`([^`]+)`(?!`)/;
|
|
5948
6137
|
var pasteRegex2 = /(^|[^`])`([^`]+)`(?!`)/g;
|
|
5949
6138
|
var Code = Mark5.create({
|
|
@@ -5962,7 +6151,7 @@ var Code = Mark5.create({
|
|
|
5962
6151
|
];
|
|
5963
6152
|
},
|
|
5964
6153
|
renderHTML({ HTMLAttributes }) {
|
|
5965
|
-
return ["code",
|
|
6154
|
+
return ["code", mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5966
6155
|
},
|
|
5967
6156
|
addCommands() {
|
|
5968
6157
|
return {
|
|
@@ -6001,9 +6190,9 @@ var Code = Mark5.create({
|
|
|
6001
6190
|
});
|
|
6002
6191
|
|
|
6003
6192
|
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
6004
|
-
import { Node as
|
|
6193
|
+
import { Node as Node6, mergeAttributes as mergeAttributes7, wrappingInputRule } from "@tiptap/core";
|
|
6005
6194
|
var inputRegex3 = /^\s*>\s$/;
|
|
6006
|
-
var Blockquote =
|
|
6195
|
+
var Blockquote = Node6.create({
|
|
6007
6196
|
name: "blockquote",
|
|
6008
6197
|
addOptions() {
|
|
6009
6198
|
return {
|
|
@@ -6019,7 +6208,7 @@ var Blockquote = Node5.create({
|
|
|
6019
6208
|
];
|
|
6020
6209
|
},
|
|
6021
6210
|
renderHTML({ HTMLAttributes }) {
|
|
6022
|
-
return ["blockquote",
|
|
6211
|
+
return ["blockquote", mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6023
6212
|
},
|
|
6024
6213
|
addCommands() {
|
|
6025
6214
|
return {
|
|
@@ -6050,8 +6239,8 @@ var Blockquote = Node5.create({
|
|
|
6050
6239
|
});
|
|
6051
6240
|
|
|
6052
6241
|
// node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
6053
|
-
import { Node as
|
|
6054
|
-
var HardBreak =
|
|
6242
|
+
import { Node as Node7, mergeAttributes as mergeAttributes8 } from "@tiptap/core";
|
|
6243
|
+
var HardBreak = Node7.create({
|
|
6055
6244
|
name: "hardBreak",
|
|
6056
6245
|
addOptions() {
|
|
6057
6246
|
return {
|
|
@@ -6069,7 +6258,7 @@ var HardBreak = Node6.create({
|
|
|
6069
6258
|
];
|
|
6070
6259
|
},
|
|
6071
6260
|
renderHTML({ HTMLAttributes }) {
|
|
6072
|
-
return ["br",
|
|
6261
|
+
return ["br", mergeAttributes8(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6073
6262
|
},
|
|
6074
6263
|
renderText() {
|
|
6075
6264
|
return "\n";
|
|
@@ -6108,8 +6297,8 @@ var HardBreak = Node6.create({
|
|
|
6108
6297
|
});
|
|
6109
6298
|
|
|
6110
6299
|
// node_modules/@tiptap/extension-heading/dist/index.js
|
|
6111
|
-
import { Node as
|
|
6112
|
-
var Heading =
|
|
6300
|
+
import { Node as Node8, mergeAttributes as mergeAttributes9, textblockTypeInputRule } from "@tiptap/core";
|
|
6301
|
+
var Heading = Node8.create({
|
|
6113
6302
|
name: "heading",
|
|
6114
6303
|
addOptions() {
|
|
6115
6304
|
return {
|
|
@@ -6137,7 +6326,7 @@ var Heading = Node7.create({
|
|
|
6137
6326
|
renderHTML({ node, HTMLAttributes }) {
|
|
6138
6327
|
const hasLevel = this.options.levels.includes(node.attrs.level);
|
|
6139
6328
|
const level = hasLevel ? node.attrs.level : this.options.levels[0];
|
|
6140
|
-
return [`h${level}`,
|
|
6329
|
+
return [`h${level}`, mergeAttributes9(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6141
6330
|
},
|
|
6142
6331
|
addCommands() {
|
|
6143
6332
|
return {
|
|
@@ -6177,8 +6366,8 @@ var Heading = Node7.create({
|
|
|
6177
6366
|
});
|
|
6178
6367
|
|
|
6179
6368
|
// node_modules/@tiptap/extension-horizontal-rule/dist/index.js
|
|
6180
|
-
import { Node as
|
|
6181
|
-
var HorizontalRule =
|
|
6369
|
+
import { Node as Node9, mergeAttributes as mergeAttributes10, canInsertNode, isNodeSelection, nodeInputRule } from "@tiptap/core";
|
|
6370
|
+
var HorizontalRule = Node9.create({
|
|
6182
6371
|
name: "horizontalRule",
|
|
6183
6372
|
addOptions() {
|
|
6184
6373
|
return {
|
|
@@ -6190,7 +6379,7 @@ var HorizontalRule = Node8.create({
|
|
|
6190
6379
|
return [{ tag: "hr" }];
|
|
6191
6380
|
},
|
|
6192
6381
|
renderHTML({ HTMLAttributes }) {
|
|
6193
|
-
return ["hr",
|
|
6382
|
+
return ["hr", mergeAttributes10(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6194
6383
|
},
|
|
6195
6384
|
addCommands() {
|
|
6196
6385
|
return {
|
|
@@ -6261,8 +6450,8 @@ import Link from "@tiptap/extension-link";
|
|
|
6261
6450
|
import TextStyle from "@tiptap/extension-text-style";
|
|
6262
6451
|
|
|
6263
6452
|
// node_modules/@tiptap/extension-list-item/dist/index.js
|
|
6264
|
-
import { Node as
|
|
6265
|
-
var ListItem =
|
|
6453
|
+
import { Node as Node10, mergeAttributes as mergeAttributes11 } from "@tiptap/core";
|
|
6454
|
+
var ListItem = Node10.create({
|
|
6266
6455
|
name: "listItem",
|
|
6267
6456
|
addOptions() {
|
|
6268
6457
|
return {
|
|
@@ -6281,7 +6470,7 @@ var ListItem = Node9.create({
|
|
|
6281
6470
|
];
|
|
6282
6471
|
},
|
|
6283
6472
|
renderHTML({ HTMLAttributes }) {
|
|
6284
|
-
return ["li",
|
|
6473
|
+
return ["li", mergeAttributes11(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6285
6474
|
},
|
|
6286
6475
|
addKeyboardShortcuts() {
|
|
6287
6476
|
return {
|
|
@@ -6293,11 +6482,11 @@ var ListItem = Node9.create({
|
|
|
6293
6482
|
});
|
|
6294
6483
|
|
|
6295
6484
|
// node_modules/@tiptap/extension-bullet-list/dist/index.js
|
|
6296
|
-
import { Node as
|
|
6485
|
+
import { Node as Node11, mergeAttributes as mergeAttributes12, wrappingInputRule as wrappingInputRule2 } from "@tiptap/core";
|
|
6297
6486
|
var ListItemName = "listItem";
|
|
6298
6487
|
var TextStyleName = "textStyle";
|
|
6299
6488
|
var inputRegex4 = /^\s*([-+*])\s$/;
|
|
6300
|
-
var BulletList =
|
|
6489
|
+
var BulletList = Node11.create({
|
|
6301
6490
|
name: "bulletList",
|
|
6302
6491
|
addOptions() {
|
|
6303
6492
|
return {
|
|
@@ -6317,7 +6506,7 @@ var BulletList = Node10.create({
|
|
|
6317
6506
|
];
|
|
6318
6507
|
},
|
|
6319
6508
|
renderHTML({ HTMLAttributes }) {
|
|
6320
|
-
return ["ul",
|
|
6509
|
+
return ["ul", mergeAttributes12(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6321
6510
|
},
|
|
6322
6511
|
addCommands() {
|
|
6323
6512
|
return {
|
|
@@ -6358,11 +6547,11 @@ var BulletList = Node10.create({
|
|
|
6358
6547
|
});
|
|
6359
6548
|
|
|
6360
6549
|
// node_modules/@tiptap/extension-ordered-list/dist/index.js
|
|
6361
|
-
import { Node as
|
|
6550
|
+
import { Node as Node12, mergeAttributes as mergeAttributes13, wrappingInputRule as wrappingInputRule3 } from "@tiptap/core";
|
|
6362
6551
|
var ListItemName2 = "listItem";
|
|
6363
6552
|
var TextStyleName2 = "textStyle";
|
|
6364
6553
|
var inputRegex5 = /^(\d+)\.\s$/;
|
|
6365
|
-
var OrderedList =
|
|
6554
|
+
var OrderedList = Node12.create({
|
|
6366
6555
|
name: "orderedList",
|
|
6367
6556
|
addOptions() {
|
|
6368
6557
|
return {
|
|
@@ -6399,7 +6588,7 @@ var OrderedList = Node11.create({
|
|
|
6399
6588
|
},
|
|
6400
6589
|
renderHTML({ HTMLAttributes }) {
|
|
6401
6590
|
const { start, ...attributesWithoutStart } = HTMLAttributes;
|
|
6402
|
-
return start === 1 ? ["ol",
|
|
6591
|
+
return start === 1 ? ["ol", mergeAttributes13(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes13(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6403
6592
|
},
|
|
6404
6593
|
addCommands() {
|
|
6405
6594
|
return {
|
|
@@ -8025,7 +8214,7 @@ var Spellcheck = Mark6.create({
|
|
|
8025
8214
|
});
|
|
8026
8215
|
|
|
8027
8216
|
// src/components/tetrons/toolbar/extensions/Comment.ts
|
|
8028
|
-
import { Mark as Mark7, mergeAttributes as
|
|
8217
|
+
import { Mark as Mark7, mergeAttributes as mergeAttributes14 } from "@tiptap/core";
|
|
8029
8218
|
var Comment = Mark7.create({
|
|
8030
8219
|
name: "comment",
|
|
8031
8220
|
addOptions() {
|
|
@@ -8050,7 +8239,7 @@ var Comment = Mark7.create({
|
|
|
8050
8239
|
renderHTML({ HTMLAttributes }) {
|
|
8051
8240
|
return [
|
|
8052
8241
|
"span",
|
|
8053
|
-
|
|
8242
|
+
mergeAttributes14(HTMLAttributes, {
|
|
8054
8243
|
"data-comment": HTMLAttributes.comment,
|
|
8055
8244
|
class: "comment-highlight",
|
|
8056
8245
|
title: HTMLAttributes.comment,
|
|
@@ -15210,8 +15399,8 @@ var ResizableTable = Table.extend({
|
|
|
15210
15399
|
});
|
|
15211
15400
|
|
|
15212
15401
|
// src/components/tetrons/toolbar/extensions/Embed.ts
|
|
15213
|
-
import { Node as
|
|
15214
|
-
var Embed =
|
|
15402
|
+
import { Node as Node13, mergeAttributes as mergeAttributes15 } from "@tiptap/core";
|
|
15403
|
+
var Embed = Node13.create({
|
|
15215
15404
|
name: "embed",
|
|
15216
15405
|
group: "block",
|
|
15217
15406
|
atom: true,
|
|
@@ -15226,7 +15415,7 @@ var Embed = Node12.create({
|
|
|
15226
15415
|
return [{ tag: "iframe[src]" }];
|
|
15227
15416
|
},
|
|
15228
15417
|
renderHTML({ HTMLAttributes }) {
|
|
15229
|
-
return ["iframe",
|
|
15418
|
+
return ["iframe", mergeAttributes15(HTMLAttributes)];
|
|
15230
15419
|
},
|
|
15231
15420
|
addCommands() {
|
|
15232
15421
|
return {
|
|
@@ -15304,7 +15493,7 @@ var Embed = Node12.create({
|
|
|
15304
15493
|
});
|
|
15305
15494
|
|
|
15306
15495
|
// src/components/tetrons/toolbar/extensions/FontFamily.ts
|
|
15307
|
-
import { Mark as Mark10, mergeAttributes as
|
|
15496
|
+
import { Mark as Mark10, mergeAttributes as mergeAttributes16 } from "@tiptap/core";
|
|
15308
15497
|
var FontFamily = Mark10.create({
|
|
15309
15498
|
name: "fontFamily",
|
|
15310
15499
|
addAttributes() {
|
|
@@ -15323,7 +15512,7 @@ var FontFamily = Mark10.create({
|
|
|
15323
15512
|
return [{ style: "font-family" }];
|
|
15324
15513
|
},
|
|
15325
15514
|
renderHTML({ HTMLAttributes }) {
|
|
15326
|
-
return ["span",
|
|
15515
|
+
return ["span", mergeAttributes16(HTMLAttributes), 0];
|
|
15327
15516
|
},
|
|
15328
15517
|
addCommands() {
|
|
15329
15518
|
return {
|
|
@@ -15333,7 +15522,7 @@ var FontFamily = Mark10.create({
|
|
|
15333
15522
|
});
|
|
15334
15523
|
|
|
15335
15524
|
// src/components/tetrons/toolbar/extensions/FontSize.ts
|
|
15336
|
-
import { Mark as Mark11, mergeAttributes as
|
|
15525
|
+
import { Mark as Mark11, mergeAttributes as mergeAttributes17 } from "@tiptap/core";
|
|
15337
15526
|
var FontSize = Mark11.create({
|
|
15338
15527
|
name: "fontSize",
|
|
15339
15528
|
addAttributes() {
|
|
@@ -15352,7 +15541,7 @@ var FontSize = Mark11.create({
|
|
|
15352
15541
|
return [{ style: "font-size" }];
|
|
15353
15542
|
},
|
|
15354
15543
|
renderHTML({ HTMLAttributes }) {
|
|
15355
|
-
return ["span",
|
|
15544
|
+
return ["span", mergeAttributes17(HTMLAttributes), 0];
|
|
15356
15545
|
},
|
|
15357
15546
|
addCommands() {
|
|
15358
15547
|
return {
|
|
@@ -15366,7 +15555,7 @@ import Image from "@tiptap/extension-image";
|
|
|
15366
15555
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
15367
15556
|
|
|
15368
15557
|
// src/components/tetrons/ResizableImageComponent.tsx
|
|
15369
|
-
import
|
|
15558
|
+
import React2, { useRef, useEffect as useEffect2, useState as useState2 } from "react";
|
|
15370
15559
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
15371
15560
|
var ResizableImageComponent = ({
|
|
15372
15561
|
node,
|
|
@@ -15404,7 +15593,7 @@ var ResizableImageComponent = ({
|
|
|
15404
15593
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
15405
15594
|
};
|
|
15406
15595
|
}, [isResizing, updateAttributes, aspectRatio]);
|
|
15407
|
-
return /* @__PURE__ */
|
|
15596
|
+
return /* @__PURE__ */ React2.createElement(
|
|
15408
15597
|
NodeViewWrapper,
|
|
15409
15598
|
{
|
|
15410
15599
|
ref: wrapperRef,
|
|
@@ -15423,7 +15612,7 @@ var ResizableImageComponent = ({
|
|
|
15423
15612
|
padding: 2
|
|
15424
15613
|
}
|
|
15425
15614
|
},
|
|
15426
|
-
/* @__PURE__ */
|
|
15615
|
+
/* @__PURE__ */ React2.createElement(
|
|
15427
15616
|
"img",
|
|
15428
15617
|
{
|
|
15429
15618
|
src,
|
|
@@ -15441,7 +15630,7 @@ var ResizableImageComponent = ({
|
|
|
15441
15630
|
draggable: false
|
|
15442
15631
|
}
|
|
15443
15632
|
),
|
|
15444
|
-
/* @__PURE__ */
|
|
15633
|
+
/* @__PURE__ */ React2.createElement(
|
|
15445
15634
|
"div",
|
|
15446
15635
|
{
|
|
15447
15636
|
onMouseDown: (e) => {
|
|
@@ -15494,11 +15683,11 @@ var ResizableImage = Image.extend({
|
|
|
15494
15683
|
});
|
|
15495
15684
|
|
|
15496
15685
|
// src/components/tetrons/ResizableVideo.ts
|
|
15497
|
-
import { Node as
|
|
15686
|
+
import { Node as Node14 } from "@tiptap/core";
|
|
15498
15687
|
import { ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
|
|
15499
15688
|
|
|
15500
15689
|
// src/components/tetrons/ResizableVideoComponent.tsx
|
|
15501
|
-
import
|
|
15690
|
+
import React3, { useRef as useRef2, useEffect as useEffect3 } from "react";
|
|
15502
15691
|
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
15503
15692
|
var ResizableVideoComponent = ({
|
|
15504
15693
|
node,
|
|
@@ -15519,7 +15708,7 @@ var ResizableVideoComponent = ({
|
|
|
15519
15708
|
observer.observe(video);
|
|
15520
15709
|
return () => observer.disconnect();
|
|
15521
15710
|
}, [updateAttributes]);
|
|
15522
|
-
return /* @__PURE__ */
|
|
15711
|
+
return /* @__PURE__ */ React3.createElement(
|
|
15523
15712
|
NodeViewWrapper2,
|
|
15524
15713
|
{
|
|
15525
15714
|
ref: wrapperRef,
|
|
@@ -15533,7 +15722,7 @@ var ResizableVideoComponent = ({
|
|
|
15533
15722
|
display: "inline-block"
|
|
15534
15723
|
}
|
|
15535
15724
|
},
|
|
15536
|
-
/* @__PURE__ */
|
|
15725
|
+
/* @__PURE__ */ React3.createElement(
|
|
15537
15726
|
"video",
|
|
15538
15727
|
{
|
|
15539
15728
|
ref: videoRef,
|
|
@@ -15550,7 +15739,7 @@ var ResizableVideoComponent = ({
|
|
|
15550
15739
|
var ResizableVideoComponent_default = ResizableVideoComponent;
|
|
15551
15740
|
|
|
15552
15741
|
// src/components/tetrons/ResizableVideo.ts
|
|
15553
|
-
var ResizableVideo =
|
|
15742
|
+
var ResizableVideo = Node14.create({
|
|
15554
15743
|
name: "video",
|
|
15555
15744
|
group: "block",
|
|
15556
15745
|
draggable: true,
|
|
@@ -15597,7 +15786,7 @@ var ResizableVideo = Node13.create({
|
|
|
15597
15786
|
});
|
|
15598
15787
|
|
|
15599
15788
|
// src/components/tetrons/toolbar/TableContextMenu.tsx
|
|
15600
|
-
import
|
|
15789
|
+
import React4, { useEffect as useEffect4, useState as useState3 } from "react";
|
|
15601
15790
|
function TableContextMenu({ editor }) {
|
|
15602
15791
|
const [menuPosition, setMenuPosition] = useState3(null);
|
|
15603
15792
|
useEffect4(() => {
|
|
@@ -15625,13 +15814,13 @@ function TableContextMenu({ editor }) {
|
|
|
15625
15814
|
const deleteRow = () => editor.chain().focus().deleteRow().run();
|
|
15626
15815
|
const deleteCol = () => editor.chain().focus().deleteColumn().run();
|
|
15627
15816
|
if (!menuPosition) return null;
|
|
15628
|
-
return /* @__PURE__ */
|
|
15817
|
+
return /* @__PURE__ */ React4.createElement(
|
|
15629
15818
|
"ul",
|
|
15630
15819
|
{
|
|
15631
15820
|
className: "absolute bg-white shadow border rounded text-sm z-50",
|
|
15632
15821
|
style: { top: menuPosition.y, left: menuPosition.x }
|
|
15633
15822
|
},
|
|
15634
|
-
/* @__PURE__ */
|
|
15823
|
+
/* @__PURE__ */ React4.createElement(
|
|
15635
15824
|
"li",
|
|
15636
15825
|
{
|
|
15637
15826
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15639,7 +15828,7 @@ function TableContextMenu({ editor }) {
|
|
|
15639
15828
|
},
|
|
15640
15829
|
"Insert Row Above"
|
|
15641
15830
|
),
|
|
15642
|
-
/* @__PURE__ */
|
|
15831
|
+
/* @__PURE__ */ React4.createElement(
|
|
15643
15832
|
"li",
|
|
15644
15833
|
{
|
|
15645
15834
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15647,7 +15836,7 @@ function TableContextMenu({ editor }) {
|
|
|
15647
15836
|
},
|
|
15648
15837
|
"Insert Row Below"
|
|
15649
15838
|
),
|
|
15650
|
-
/* @__PURE__ */
|
|
15839
|
+
/* @__PURE__ */ React4.createElement(
|
|
15651
15840
|
"li",
|
|
15652
15841
|
{
|
|
15653
15842
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15655,7 +15844,7 @@ function TableContextMenu({ editor }) {
|
|
|
15655
15844
|
},
|
|
15656
15845
|
"Insert Column Left"
|
|
15657
15846
|
),
|
|
15658
|
-
/* @__PURE__ */
|
|
15847
|
+
/* @__PURE__ */ React4.createElement(
|
|
15659
15848
|
"li",
|
|
15660
15849
|
{
|
|
15661
15850
|
className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
|
|
@@ -15663,7 +15852,7 @@ function TableContextMenu({ editor }) {
|
|
|
15663
15852
|
},
|
|
15664
15853
|
"Insert Column Right"
|
|
15665
15854
|
),
|
|
15666
|
-
/* @__PURE__ */
|
|
15855
|
+
/* @__PURE__ */ React4.createElement(
|
|
15667
15856
|
"li",
|
|
15668
15857
|
{
|
|
15669
15858
|
className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
|
|
@@ -15671,7 +15860,7 @@ function TableContextMenu({ editor }) {
|
|
|
15671
15860
|
},
|
|
15672
15861
|
"Delete Row"
|
|
15673
15862
|
),
|
|
15674
|
-
/* @__PURE__ */
|
|
15863
|
+
/* @__PURE__ */ React4.createElement(
|
|
15675
15864
|
"li",
|
|
15676
15865
|
{
|
|
15677
15866
|
className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
|
|
@@ -15683,10 +15872,10 @@ function TableContextMenu({ editor }) {
|
|
|
15683
15872
|
}
|
|
15684
15873
|
|
|
15685
15874
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
15686
|
-
import
|
|
15875
|
+
import React16, { useEffect as useEffect8, useState as useState10 } from "react";
|
|
15687
15876
|
|
|
15688
15877
|
// src/components/tetrons/toolbar/ActionGroup.tsx
|
|
15689
|
-
import
|
|
15878
|
+
import React6, { useEffect as useEffect5, useRef as useRef3, useState as useState4 } from "react";
|
|
15690
15879
|
import {
|
|
15691
15880
|
MdZoomIn,
|
|
15692
15881
|
MdZoomOut,
|
|
@@ -15696,10 +15885,10 @@ import {
|
|
|
15696
15885
|
} from "react-icons/md";
|
|
15697
15886
|
|
|
15698
15887
|
// src/components/tetrons/toolbar/ToolbarButton.tsx
|
|
15699
|
-
import
|
|
15700
|
-
var ToolbarButton =
|
|
15888
|
+
import React5 from "react";
|
|
15889
|
+
var ToolbarButton = React5.forwardRef(
|
|
15701
15890
|
({ icon: Icon, onClick, disabled = false, title, label, isActive = false }, ref) => {
|
|
15702
|
-
return /* @__PURE__ */
|
|
15891
|
+
return /* @__PURE__ */ React5.createElement(
|
|
15703
15892
|
"button",
|
|
15704
15893
|
{
|
|
15705
15894
|
type: "button",
|
|
@@ -15710,7 +15899,7 @@ var ToolbarButton = React4.forwardRef(
|
|
|
15710
15899
|
"aria-label": title ?? label,
|
|
15711
15900
|
className: `toolbar-button ${isActive ? "active" : ""}`
|
|
15712
15901
|
},
|
|
15713
|
-
/* @__PURE__ */
|
|
15902
|
+
/* @__PURE__ */ React5.createElement(Icon, { size: 20 })
|
|
15714
15903
|
);
|
|
15715
15904
|
}
|
|
15716
15905
|
);
|
|
@@ -15844,7 +16033,7 @@ function ActionGroup({ editor }) {
|
|
|
15844
16033
|
link.click();
|
|
15845
16034
|
document.body.removeChild(link);
|
|
15846
16035
|
};
|
|
15847
|
-
return /* @__PURE__ */
|
|
16036
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "action-group", role: "group", "aria-label": "Editor actions" }, /* @__PURE__ */ React6.createElement(ToolbarButton_default, { icon: MdZoomIn, onClick: zoomIn, title: "Zoom In" }), /* @__PURE__ */ React6.createElement(ToolbarButton_default, { icon: MdZoomOut, onClick: zoomOut, title: "Zoom Out" }), /* @__PURE__ */ React6.createElement(ToolbarButton_default, { icon: MdPrint, onClick: handlePrint, title: "Print" }), /* @__PURE__ */ React6.createElement(ToolbarButton_default, { icon: MdSave, onClick: handleSave, title: "Save" }), /* @__PURE__ */ React6.createElement("div", { className: "relative", ref: dropdownRef }, /* @__PURE__ */ React6.createElement(
|
|
15848
16037
|
"button",
|
|
15849
16038
|
{
|
|
15850
16039
|
type: "button",
|
|
@@ -15854,9 +16043,9 @@ function ActionGroup({ editor }) {
|
|
|
15854
16043
|
className: "export-button",
|
|
15855
16044
|
title: "Export"
|
|
15856
16045
|
},
|
|
15857
|
-
/* @__PURE__ */
|
|
15858
|
-
/* @__PURE__ */
|
|
15859
|
-
), dropdownOpen && /* @__PURE__ */
|
|
16046
|
+
/* @__PURE__ */ React6.createElement(MdDownload, null),
|
|
16047
|
+
/* @__PURE__ */ React6.createElement("span", { className: "text-sm" })
|
|
16048
|
+
), dropdownOpen && /* @__PURE__ */ React6.createElement("div", { className: "export-dropdown" }, /* @__PURE__ */ React6.createElement(
|
|
15860
16049
|
"button",
|
|
15861
16050
|
{
|
|
15862
16051
|
type: "button",
|
|
@@ -15866,7 +16055,7 @@ function ActionGroup({ editor }) {
|
|
|
15866
16055
|
}
|
|
15867
16056
|
},
|
|
15868
16057
|
"Export as PDF"
|
|
15869
|
-
), /* @__PURE__ */
|
|
16058
|
+
), /* @__PURE__ */ React6.createElement(
|
|
15870
16059
|
"button",
|
|
15871
16060
|
{
|
|
15872
16061
|
type: "button",
|
|
@@ -15876,7 +16065,7 @@ function ActionGroup({ editor }) {
|
|
|
15876
16065
|
}
|
|
15877
16066
|
},
|
|
15878
16067
|
"Export as HTML"
|
|
15879
|
-
), /* @__PURE__ */
|
|
16068
|
+
), /* @__PURE__ */ React6.createElement(
|
|
15880
16069
|
"button",
|
|
15881
16070
|
{
|
|
15882
16071
|
type: "button",
|
|
@@ -15896,9 +16085,9 @@ import {
|
|
|
15896
16085
|
MdContentCopy,
|
|
15897
16086
|
MdFormatPaint
|
|
15898
16087
|
} from "react-icons/md";
|
|
15899
|
-
import
|
|
16088
|
+
import React7 from "react";
|
|
15900
16089
|
function ClipboardGroup({ editor }) {
|
|
15901
|
-
return /* @__PURE__ */
|
|
16090
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "clipboard-group" }, /* @__PURE__ */ React7.createElement(
|
|
15902
16091
|
ToolbarButton_default,
|
|
15903
16092
|
{
|
|
15904
16093
|
icon: MdContentPaste,
|
|
@@ -15912,7 +16101,7 @@ function ClipboardGroup({ editor }) {
|
|
|
15912
16101
|
}
|
|
15913
16102
|
}
|
|
15914
16103
|
}
|
|
15915
|
-
), /* @__PURE__ */
|
|
16104
|
+
), /* @__PURE__ */ React7.createElement(
|
|
15916
16105
|
ToolbarButton_default,
|
|
15917
16106
|
{
|
|
15918
16107
|
icon: MdContentCut,
|
|
@@ -15926,7 +16115,7 @@ function ClipboardGroup({ editor }) {
|
|
|
15926
16115
|
});
|
|
15927
16116
|
}
|
|
15928
16117
|
}
|
|
15929
|
-
), /* @__PURE__ */
|
|
16118
|
+
), /* @__PURE__ */ React7.createElement(
|
|
15930
16119
|
ToolbarButton_default,
|
|
15931
16120
|
{
|
|
15932
16121
|
icon: MdContentCopy,
|
|
@@ -15938,7 +16127,7 @@ function ClipboardGroup({ editor }) {
|
|
|
15938
16127
|
navigator.clipboard.writeText(selectedText);
|
|
15939
16128
|
}
|
|
15940
16129
|
}
|
|
15941
|
-
), /* @__PURE__ */
|
|
16130
|
+
), /* @__PURE__ */ React7.createElement(
|
|
15942
16131
|
ToolbarButton_default,
|
|
15943
16132
|
{
|
|
15944
16133
|
icon: MdFormatPaint,
|
|
@@ -15964,7 +16153,7 @@ import {
|
|
|
15964
16153
|
} from "react-icons/md";
|
|
15965
16154
|
import { ImTextColor } from "react-icons/im";
|
|
15966
16155
|
import { BiSolidColorFill } from "react-icons/bi";
|
|
15967
|
-
import
|
|
16156
|
+
import React8, { useEffect as useEffect6, useState as useState5 } from "react";
|
|
15968
16157
|
function FontStyleGroup({ editor }) {
|
|
15969
16158
|
const [textColor, setTextColor] = useState5("#000000");
|
|
15970
16159
|
const [highlightColor, setHighlightColor] = useState5("#ffff00");
|
|
@@ -15990,7 +16179,7 @@ function FontStyleGroup({ editor }) {
|
|
|
15990
16179
|
editor.off("transaction", updateStates);
|
|
15991
16180
|
};
|
|
15992
16181
|
}, [editor]);
|
|
15993
|
-
return /* @__PURE__ */
|
|
16182
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "font-style-group" }, /* @__PURE__ */ React8.createElement(
|
|
15994
16183
|
"select",
|
|
15995
16184
|
{
|
|
15996
16185
|
title: "Font Family",
|
|
@@ -16001,12 +16190,12 @@ function FontStyleGroup({ editor }) {
|
|
|
16001
16190
|
editor.chain().focus().setFontFamily(value).run();
|
|
16002
16191
|
}
|
|
16003
16192
|
},
|
|
16004
|
-
/* @__PURE__ */
|
|
16005
|
-
/* @__PURE__ */
|
|
16006
|
-
/* @__PURE__ */
|
|
16007
|
-
/* @__PURE__ */
|
|
16008
|
-
/* @__PURE__ */
|
|
16009
|
-
), /* @__PURE__ */
|
|
16193
|
+
/* @__PURE__ */ React8.createElement("option", { value: "Arial" }, "Arial"),
|
|
16194
|
+
/* @__PURE__ */ React8.createElement("option", { value: "Georgia" }, "Georgia"),
|
|
16195
|
+
/* @__PURE__ */ React8.createElement("option", { value: "Times New Roman" }, "Times New Roman"),
|
|
16196
|
+
/* @__PURE__ */ React8.createElement("option", { value: "Courier New" }, "Courier New"),
|
|
16197
|
+
/* @__PURE__ */ React8.createElement("option", { value: "Verdana" }, "Verdana")
|
|
16198
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16010
16199
|
"select",
|
|
16011
16200
|
{
|
|
16012
16201
|
title: "Font Size",
|
|
@@ -16017,16 +16206,16 @@ function FontStyleGroup({ editor }) {
|
|
|
16017
16206
|
editor.chain().focus().setFontSize(value).run();
|
|
16018
16207
|
}
|
|
16019
16208
|
},
|
|
16020
|
-
/* @__PURE__ */
|
|
16021
|
-
/* @__PURE__ */
|
|
16022
|
-
/* @__PURE__ */
|
|
16023
|
-
/* @__PURE__ */
|
|
16024
|
-
/* @__PURE__ */
|
|
16025
|
-
/* @__PURE__ */
|
|
16026
|
-
/* @__PURE__ */
|
|
16027
|
-
/* @__PURE__ */
|
|
16028
|
-
/* @__PURE__ */
|
|
16029
|
-
), /* @__PURE__ */
|
|
16209
|
+
/* @__PURE__ */ React8.createElement("option", { value: "12px" }, "12"),
|
|
16210
|
+
/* @__PURE__ */ React8.createElement("option", { value: "14px" }, "14"),
|
|
16211
|
+
/* @__PURE__ */ React8.createElement("option", { value: "16px" }, "16"),
|
|
16212
|
+
/* @__PURE__ */ React8.createElement("option", { value: "18px" }, "18"),
|
|
16213
|
+
/* @__PURE__ */ React8.createElement("option", { value: "24px" }, "24"),
|
|
16214
|
+
/* @__PURE__ */ React8.createElement("option", { value: "36px" }, "36"),
|
|
16215
|
+
/* @__PURE__ */ React8.createElement("option", { value: "48px" }, "48"),
|
|
16216
|
+
/* @__PURE__ */ React8.createElement("option", { value: "64px" }, "64"),
|
|
16217
|
+
/* @__PURE__ */ React8.createElement("option", { value: "72px" }, "72")
|
|
16218
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16030
16219
|
ToolbarButton_default,
|
|
16031
16220
|
{
|
|
16032
16221
|
icon: MdFormatBold,
|
|
@@ -16034,7 +16223,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16034
16223
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
16035
16224
|
isActive: editor.isActive("bold")
|
|
16036
16225
|
}
|
|
16037
|
-
), /* @__PURE__ */
|
|
16226
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16038
16227
|
ToolbarButton_default,
|
|
16039
16228
|
{
|
|
16040
16229
|
icon: MdFormatItalic,
|
|
@@ -16042,7 +16231,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16042
16231
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
16043
16232
|
isActive: editor.isActive("italic")
|
|
16044
16233
|
}
|
|
16045
|
-
), /* @__PURE__ */
|
|
16234
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16046
16235
|
ToolbarButton_default,
|
|
16047
16236
|
{
|
|
16048
16237
|
icon: MdFormatUnderlined,
|
|
@@ -16050,7 +16239,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16050
16239
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
16051
16240
|
isActive: editor.isActive("underline")
|
|
16052
16241
|
}
|
|
16053
|
-
), /* @__PURE__ */
|
|
16242
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16054
16243
|
ToolbarButton_default,
|
|
16055
16244
|
{
|
|
16056
16245
|
icon: MdStrikethroughS,
|
|
@@ -16058,7 +16247,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16058
16247
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
16059
16248
|
isActive: editor.isActive("strike")
|
|
16060
16249
|
}
|
|
16061
|
-
), /* @__PURE__ */
|
|
16250
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16062
16251
|
ToolbarButton_default,
|
|
16063
16252
|
{
|
|
16064
16253
|
icon: MdSubscript,
|
|
@@ -16066,7 +16255,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16066
16255
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
16067
16256
|
isActive: editor.isActive("subscript")
|
|
16068
16257
|
}
|
|
16069
|
-
), /* @__PURE__ */
|
|
16258
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16070
16259
|
ToolbarButton_default,
|
|
16071
16260
|
{
|
|
16072
16261
|
icon: MdSuperscript,
|
|
@@ -16074,7 +16263,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16074
16263
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
16075
16264
|
isActive: editor.isActive("superscript")
|
|
16076
16265
|
}
|
|
16077
|
-
), /* @__PURE__ */
|
|
16266
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16078
16267
|
"label",
|
|
16079
16268
|
{
|
|
16080
16269
|
title: "Font Color",
|
|
@@ -16082,9 +16271,9 @@ function FontStyleGroup({ editor }) {
|
|
|
16082
16271
|
className: "color-label",
|
|
16083
16272
|
style: { "--indicator-color": textColor }
|
|
16084
16273
|
},
|
|
16085
|
-
/* @__PURE__ */
|
|
16086
|
-
/* @__PURE__ */
|
|
16087
|
-
/* @__PURE__ */
|
|
16274
|
+
/* @__PURE__ */ React8.createElement(ImTextColor, { size: 20 }),
|
|
16275
|
+
/* @__PURE__ */ React8.createElement("div", { className: "color-indicator" }),
|
|
16276
|
+
/* @__PURE__ */ React8.createElement(
|
|
16088
16277
|
"input",
|
|
16089
16278
|
{
|
|
16090
16279
|
type: "color",
|
|
@@ -16096,7 +16285,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16096
16285
|
}
|
|
16097
16286
|
}
|
|
16098
16287
|
)
|
|
16099
|
-
), /* @__PURE__ */
|
|
16288
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16100
16289
|
"label",
|
|
16101
16290
|
{
|
|
16102
16291
|
title: "Highlight Color",
|
|
@@ -16104,9 +16293,9 @@ function FontStyleGroup({ editor }) {
|
|
|
16104
16293
|
className: "color-label",
|
|
16105
16294
|
style: { "--indicator-color": highlightColor }
|
|
16106
16295
|
},
|
|
16107
|
-
/* @__PURE__ */
|
|
16108
|
-
/* @__PURE__ */
|
|
16109
|
-
/* @__PURE__ */
|
|
16296
|
+
/* @__PURE__ */ React8.createElement(BiSolidColorFill, { size: 20 }),
|
|
16297
|
+
/* @__PURE__ */ React8.createElement("div", { className: "color-indicator" }),
|
|
16298
|
+
/* @__PURE__ */ React8.createElement(
|
|
16110
16299
|
"input",
|
|
16111
16300
|
{
|
|
16112
16301
|
type: "color",
|
|
@@ -16118,14 +16307,14 @@ function FontStyleGroup({ editor }) {
|
|
|
16118
16307
|
}
|
|
16119
16308
|
}
|
|
16120
16309
|
)
|
|
16121
|
-
), /* @__PURE__ */
|
|
16310
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16122
16311
|
ToolbarButton_default,
|
|
16123
16312
|
{
|
|
16124
16313
|
icon: MdFormatClear,
|
|
16125
16314
|
label: "Clear Formatting",
|
|
16126
16315
|
onClick: () => editor.chain().focus().unsetAllMarks().run()
|
|
16127
16316
|
}
|
|
16128
|
-
), /* @__PURE__ */
|
|
16317
|
+
), /* @__PURE__ */ React8.createElement(
|
|
16129
16318
|
ToolbarButton_default,
|
|
16130
16319
|
{
|
|
16131
16320
|
icon: MdFormatPaint2,
|
|
@@ -16144,7 +16333,7 @@ function FontStyleGroup({ editor }) {
|
|
|
16144
16333
|
}
|
|
16145
16334
|
|
|
16146
16335
|
// src/components/tetrons/toolbar/InsertGroup.tsx
|
|
16147
|
-
import
|
|
16336
|
+
import React9, { useRef as useRef4, useState as useState6 } from "react";
|
|
16148
16337
|
import {
|
|
16149
16338
|
MdTableChart,
|
|
16150
16339
|
MdInsertPhoto,
|
|
@@ -16231,7 +16420,7 @@ function InsertGroup({ editor }) {
|
|
|
16231
16420
|
return url;
|
|
16232
16421
|
}
|
|
16233
16422
|
}
|
|
16234
|
-
return /* @__PURE__ */
|
|
16423
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "insert-group" }, /* @__PURE__ */ React9.createElement(
|
|
16235
16424
|
"input",
|
|
16236
16425
|
{
|
|
16237
16426
|
type: "file",
|
|
@@ -16242,7 +16431,7 @@ function InsertGroup({ editor }) {
|
|
|
16242
16431
|
"aria-label": "Upload Image",
|
|
16243
16432
|
title: "Upload Image"
|
|
16244
16433
|
}
|
|
16245
|
-
), /* @__PURE__ */
|
|
16434
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16246
16435
|
"input",
|
|
16247
16436
|
{
|
|
16248
16437
|
type: "file",
|
|
@@ -16253,23 +16442,23 @@ function InsertGroup({ editor }) {
|
|
|
16253
16442
|
"aria-label": "Upload Video",
|
|
16254
16443
|
title: "Upload Video"
|
|
16255
16444
|
}
|
|
16256
|
-
), /* @__PURE__ */
|
|
16445
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16257
16446
|
ToolbarButton_default,
|
|
16258
16447
|
{
|
|
16259
16448
|
icon: MdTableChart,
|
|
16260
16449
|
label: "Insert Table",
|
|
16261
16450
|
onClick: () => setShowTableGrid(!showTableGrid)
|
|
16262
16451
|
}
|
|
16263
|
-
), showTableGrid && /* @__PURE__ */
|
|
16452
|
+
), showTableGrid && /* @__PURE__ */ React9.createElement(
|
|
16264
16453
|
"div",
|
|
16265
16454
|
{
|
|
16266
16455
|
className: "table-grid-popup",
|
|
16267
16456
|
onMouseLeave: () => setShowTableGrid(false)
|
|
16268
16457
|
},
|
|
16269
|
-
/* @__PURE__ */
|
|
16458
|
+
/* @__PURE__ */ React9.createElement("div", { className: "table-grid" }, [...Array(10)].map(
|
|
16270
16459
|
(_, row) => [...Array(10)].map((_2, col) => {
|
|
16271
16460
|
const isSelected = row < selectedRows && col < selectedCols;
|
|
16272
|
-
return /* @__PURE__ */
|
|
16461
|
+
return /* @__PURE__ */ React9.createElement(
|
|
16273
16462
|
"div",
|
|
16274
16463
|
{
|
|
16275
16464
|
key: `${row}-${col}`,
|
|
@@ -16280,22 +16469,22 @@ function InsertGroup({ editor }) {
|
|
|
16280
16469
|
);
|
|
16281
16470
|
})
|
|
16282
16471
|
)),
|
|
16283
|
-
/* @__PURE__ */
|
|
16284
|
-
), /* @__PURE__ */
|
|
16472
|
+
/* @__PURE__ */ React9.createElement("div", { className: "table-grid-label" }, selectedRows, " x ", selectedCols)
|
|
16473
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16285
16474
|
ToolbarButton_default,
|
|
16286
16475
|
{
|
|
16287
16476
|
icon: MdInsertPhoto,
|
|
16288
16477
|
label: "Insert Image",
|
|
16289
16478
|
onClick: () => imageInputRef.current?.click()
|
|
16290
16479
|
}
|
|
16291
|
-
), /* @__PURE__ */
|
|
16480
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16292
16481
|
ToolbarButton_default,
|
|
16293
16482
|
{
|
|
16294
16483
|
icon: MdVideoLibrary,
|
|
16295
16484
|
label: "Insert Video",
|
|
16296
16485
|
onClick: () => videoInputRef.current?.click()
|
|
16297
16486
|
}
|
|
16298
|
-
), /* @__PURE__ */
|
|
16487
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16299
16488
|
ToolbarButton_default,
|
|
16300
16489
|
{
|
|
16301
16490
|
icon: MdInsertLink,
|
|
@@ -16307,7 +16496,7 @@ function InsertGroup({ editor }) {
|
|
|
16307
16496
|
}
|
|
16308
16497
|
}
|
|
16309
16498
|
}
|
|
16310
|
-
), /* @__PURE__ */
|
|
16499
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16311
16500
|
ToolbarButton_default,
|
|
16312
16501
|
{
|
|
16313
16502
|
icon: MdInsertComment,
|
|
@@ -16321,14 +16510,14 @@ function InsertGroup({ editor }) {
|
|
|
16321
16510
|
}
|
|
16322
16511
|
}
|
|
16323
16512
|
}
|
|
16324
|
-
), /* @__PURE__ */
|
|
16513
|
+
), /* @__PURE__ */ React9.createElement("div", { className: "relative" }, /* @__PURE__ */ React9.createElement(
|
|
16325
16514
|
ToolbarButton_default,
|
|
16326
16515
|
{
|
|
16327
16516
|
icon: MdInsertEmoticon,
|
|
16328
16517
|
label: "Emoji",
|
|
16329
16518
|
onClick: () => setShowPicker(!showPicker)
|
|
16330
16519
|
}
|
|
16331
|
-
), showPicker && /* @__PURE__ */
|
|
16520
|
+
), showPicker && /* @__PURE__ */ React9.createElement("div", { className: "emoji-picker" }, /* @__PURE__ */ React9.createElement(
|
|
16332
16521
|
Picker,
|
|
16333
16522
|
{
|
|
16334
16523
|
onEmojiSelect: addEmoji,
|
|
@@ -16338,14 +16527,14 @@ function InsertGroup({ editor }) {
|
|
|
16338
16527
|
showSkinTones: true,
|
|
16339
16528
|
emojiTooltip: true
|
|
16340
16529
|
}
|
|
16341
|
-
))), /* @__PURE__ */
|
|
16530
|
+
))), /* @__PURE__ */ React9.createElement(
|
|
16342
16531
|
ToolbarButton_default,
|
|
16343
16532
|
{
|
|
16344
16533
|
icon: MdHorizontalRule,
|
|
16345
16534
|
label: "Horizontal Line",
|
|
16346
16535
|
onClick: () => editor.chain().focus().setHorizontalRule().run()
|
|
16347
16536
|
}
|
|
16348
|
-
), /* @__PURE__ */
|
|
16537
|
+
), /* @__PURE__ */ React9.createElement(
|
|
16349
16538
|
ToolbarButton_default,
|
|
16350
16539
|
{
|
|
16351
16540
|
icon: MdOutlineOndemandVideo,
|
|
@@ -16369,7 +16558,7 @@ function InsertGroup({ editor }) {
|
|
|
16369
16558
|
}
|
|
16370
16559
|
|
|
16371
16560
|
// src/components/tetrons/toolbar/ListAlignGroup.tsx
|
|
16372
|
-
import
|
|
16561
|
+
import React10 from "react";
|
|
16373
16562
|
import {
|
|
16374
16563
|
MdFormatListBulleted,
|
|
16375
16564
|
MdFormatListNumbered,
|
|
@@ -16381,7 +16570,7 @@ import {
|
|
|
16381
16570
|
MdFormatAlignJustify
|
|
16382
16571
|
} from "react-icons/md";
|
|
16383
16572
|
function ListAlignGroup({ editor }) {
|
|
16384
|
-
return /* @__PURE__ */
|
|
16573
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "list-align-group" }, /* @__PURE__ */ React10.createElement(
|
|
16385
16574
|
ToolbarButton_default,
|
|
16386
16575
|
{
|
|
16387
16576
|
icon: MdFormatListBulleted,
|
|
@@ -16389,7 +16578,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16389
16578
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
16390
16579
|
disabled: !editor.can().toggleBulletList()
|
|
16391
16580
|
}
|
|
16392
|
-
), /* @__PURE__ */
|
|
16581
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16393
16582
|
ToolbarButton_default,
|
|
16394
16583
|
{
|
|
16395
16584
|
icon: MdFormatListNumbered,
|
|
@@ -16397,7 +16586,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16397
16586
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
16398
16587
|
disabled: !editor.can().toggleOrderedList()
|
|
16399
16588
|
}
|
|
16400
|
-
), /* @__PURE__ */
|
|
16589
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16401
16590
|
ToolbarButton_default,
|
|
16402
16591
|
{
|
|
16403
16592
|
icon: MdFormatIndentIncrease,
|
|
@@ -16405,7 +16594,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16405
16594
|
onClick: () => editor.chain().focus().sinkListItem("listItem").run(),
|
|
16406
16595
|
disabled: !editor.can().sinkListItem("listItem")
|
|
16407
16596
|
}
|
|
16408
|
-
), /* @__PURE__ */
|
|
16597
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16409
16598
|
ToolbarButton_default,
|
|
16410
16599
|
{
|
|
16411
16600
|
icon: MdFormatIndentDecrease,
|
|
@@ -16413,7 +16602,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16413
16602
|
onClick: () => editor.chain().focus().liftListItem("listItem").run(),
|
|
16414
16603
|
disabled: !editor.can().liftListItem("listItem")
|
|
16415
16604
|
}
|
|
16416
|
-
), /* @__PURE__ */
|
|
16605
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16417
16606
|
ToolbarButton_default,
|
|
16418
16607
|
{
|
|
16419
16608
|
icon: MdFormatAlignLeft,
|
|
@@ -16421,7 +16610,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16421
16610
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
16422
16611
|
disabled: !editor.can().setTextAlign("left")
|
|
16423
16612
|
}
|
|
16424
|
-
), /* @__PURE__ */
|
|
16613
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16425
16614
|
ToolbarButton_default,
|
|
16426
16615
|
{
|
|
16427
16616
|
icon: MdFormatAlignCenter,
|
|
@@ -16429,7 +16618,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16429
16618
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
16430
16619
|
disabled: !editor.can().setTextAlign("center")
|
|
16431
16620
|
}
|
|
16432
|
-
), /* @__PURE__ */
|
|
16621
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16433
16622
|
ToolbarButton_default,
|
|
16434
16623
|
{
|
|
16435
16624
|
icon: MdFormatAlignRight,
|
|
@@ -16437,7 +16626,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16437
16626
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
16438
16627
|
disabled: !editor.can().setTextAlign("right")
|
|
16439
16628
|
}
|
|
16440
|
-
), /* @__PURE__ */
|
|
16629
|
+
), /* @__PURE__ */ React10.createElement(
|
|
16441
16630
|
ToolbarButton_default,
|
|
16442
16631
|
{
|
|
16443
16632
|
icon: MdFormatAlignJustify,
|
|
@@ -16449,7 +16638,7 @@ function ListAlignGroup({ editor }) {
|
|
|
16449
16638
|
}
|
|
16450
16639
|
|
|
16451
16640
|
// src/components/tetrons/toolbar/MiscGroup.tsx
|
|
16452
|
-
import
|
|
16641
|
+
import React11 from "react";
|
|
16453
16642
|
import {
|
|
16454
16643
|
MdUndo,
|
|
16455
16644
|
MdRedo,
|
|
@@ -16522,7 +16711,7 @@ Reason: ${issue.message}
|
|
|
16522
16711
|
alert("\u274C Failed to check grammar. Please try again later.");
|
|
16523
16712
|
}
|
|
16524
16713
|
};
|
|
16525
|
-
return /* @__PURE__ */
|
|
16714
|
+
return /* @__PURE__ */ React11.createElement("div", { className: "misc-group" }, /* @__PURE__ */ React11.createElement(
|
|
16526
16715
|
ToolbarButton_default,
|
|
16527
16716
|
{
|
|
16528
16717
|
icon: MdUndo,
|
|
@@ -16530,7 +16719,7 @@ Reason: ${issue.message}
|
|
|
16530
16719
|
onClick: () => editor.chain().focus().undo().run(),
|
|
16531
16720
|
disabled: !editor.can().undo()
|
|
16532
16721
|
}
|
|
16533
|
-
), /* @__PURE__ */
|
|
16722
|
+
), /* @__PURE__ */ React11.createElement(
|
|
16534
16723
|
ToolbarButton_default,
|
|
16535
16724
|
{
|
|
16536
16725
|
icon: MdRedo,
|
|
@@ -16538,14 +16727,14 @@ Reason: ${issue.message}
|
|
|
16538
16727
|
onClick: () => editor.chain().focus().redo().run(),
|
|
16539
16728
|
disabled: !editor.can().redo()
|
|
16540
16729
|
}
|
|
16541
|
-
), /* @__PURE__ */
|
|
16730
|
+
), /* @__PURE__ */ React11.createElement(
|
|
16542
16731
|
ToolbarButton_default,
|
|
16543
16732
|
{
|
|
16544
16733
|
icon: MdRefresh,
|
|
16545
16734
|
label: "Reset Formatting",
|
|
16546
16735
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run()
|
|
16547
16736
|
}
|
|
16548
|
-
), /* @__PURE__ */
|
|
16737
|
+
), /* @__PURE__ */ React11.createElement(
|
|
16549
16738
|
ToolbarButton_default,
|
|
16550
16739
|
{
|
|
16551
16740
|
icon: MdCode,
|
|
@@ -16553,14 +16742,14 @@ Reason: ${issue.message}
|
|
|
16553
16742
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
16554
16743
|
isActive: editor.isActive("codeBlock")
|
|
16555
16744
|
}
|
|
16556
|
-
), /* @__PURE__ */
|
|
16745
|
+
), /* @__PURE__ */ React11.createElement(
|
|
16557
16746
|
ToolbarButton_default,
|
|
16558
16747
|
{
|
|
16559
16748
|
icon: MdVisibility,
|
|
16560
16749
|
label: "Preview",
|
|
16561
16750
|
onClick: handlePreview
|
|
16562
16751
|
}
|
|
16563
|
-
), /* @__PURE__ */
|
|
16752
|
+
), /* @__PURE__ */ React11.createElement(
|
|
16564
16753
|
ToolbarButton_default,
|
|
16565
16754
|
{
|
|
16566
16755
|
icon: MdSpellcheck,
|
|
@@ -16573,7 +16762,7 @@ Reason: ${issue.message}
|
|
|
16573
16762
|
// src/components/tetrons/toolbar/FileGroup.tsx
|
|
16574
16763
|
import { FaRegFolderOpen } from "react-icons/fa";
|
|
16575
16764
|
import { VscNewFile } from "react-icons/vsc";
|
|
16576
|
-
import
|
|
16765
|
+
import React12, { useRef as useRef5 } from "react";
|
|
16577
16766
|
function FileGroup({ editor }) {
|
|
16578
16767
|
const fileInputRef = useRef5(null);
|
|
16579
16768
|
const handleNew = () => {
|
|
@@ -16602,7 +16791,7 @@ function FileGroup({ editor }) {
|
|
|
16602
16791
|
e.target.value = "";
|
|
16603
16792
|
}
|
|
16604
16793
|
};
|
|
16605
|
-
return /* @__PURE__ */
|
|
16794
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "file-group", role: "group", "aria-label": "File actions" }, /* @__PURE__ */ React12.createElement(
|
|
16606
16795
|
"input",
|
|
16607
16796
|
{
|
|
16608
16797
|
type: "file",
|
|
@@ -16612,7 +16801,7 @@ function FileGroup({ editor }) {
|
|
|
16612
16801
|
className: "hidden",
|
|
16613
16802
|
"aria-label": "Open JSON file"
|
|
16614
16803
|
}
|
|
16615
|
-
), /* @__PURE__ */
|
|
16804
|
+
), /* @__PURE__ */ React12.createElement(ToolbarButton_default, { icon: VscNewFile, onClick: handleNew, title: "New" }), /* @__PURE__ */ React12.createElement(
|
|
16616
16805
|
ToolbarButton_default,
|
|
16617
16806
|
{
|
|
16618
16807
|
icon: FaRegFolderOpen,
|
|
@@ -16623,7 +16812,7 @@ function FileGroup({ editor }) {
|
|
|
16623
16812
|
}
|
|
16624
16813
|
|
|
16625
16814
|
// src/components/tetrons/toolbar/AIGroup.tsx
|
|
16626
|
-
import
|
|
16815
|
+
import React13, { useState as useState7, useRef as useRef6 } from "react";
|
|
16627
16816
|
import { FaMicrophone, FaStop } from "react-icons/fa";
|
|
16628
16817
|
import { Waveform } from "@uiball/loaders";
|
|
16629
16818
|
import { motion, AnimatePresence } from "framer-motion";
|
|
@@ -16710,7 +16899,7 @@ function AiGroup({ editor }) {
|
|
|
16710
16899
|
setIsLoadingAI(false);
|
|
16711
16900
|
}
|
|
16712
16901
|
};
|
|
16713
|
-
return /* @__PURE__ */
|
|
16902
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "group relative space-y-3" }, /* @__PURE__ */ React13.createElement("div", { className: "flex gap-2 items-center" }, !isRecording ? /* @__PURE__ */ React13.createElement(
|
|
16714
16903
|
"button",
|
|
16715
16904
|
{
|
|
16716
16905
|
type: "button",
|
|
@@ -16718,8 +16907,8 @@ function AiGroup({ editor }) {
|
|
|
16718
16907
|
className: "icon-btn",
|
|
16719
16908
|
title: "Start Voice Input"
|
|
16720
16909
|
},
|
|
16721
|
-
/* @__PURE__ */
|
|
16722
|
-
) : /* @__PURE__ */
|
|
16910
|
+
/* @__PURE__ */ React13.createElement(FaMicrophone, { size: 18 })
|
|
16911
|
+
) : /* @__PURE__ */ React13.createElement(
|
|
16723
16912
|
"button",
|
|
16724
16913
|
{
|
|
16725
16914
|
type: "button",
|
|
@@ -16727,8 +16916,8 @@ function AiGroup({ editor }) {
|
|
|
16727
16916
|
className: "icon-btn stop-btn",
|
|
16728
16917
|
title: "Stop Recording"
|
|
16729
16918
|
},
|
|
16730
|
-
/* @__PURE__ */
|
|
16731
|
-
), /* @__PURE__ */
|
|
16919
|
+
/* @__PURE__ */ React13.createElement(FaStop, { size: 18 })
|
|
16920
|
+
), /* @__PURE__ */ React13.createElement(
|
|
16732
16921
|
"button",
|
|
16733
16922
|
{
|
|
16734
16923
|
type: "button",
|
|
@@ -16737,7 +16926,7 @@ function AiGroup({ editor }) {
|
|
|
16737
16926
|
title: "AI Assist"
|
|
16738
16927
|
},
|
|
16739
16928
|
"AI"
|
|
16740
|
-
)), isRecording && /* @__PURE__ */
|
|
16929
|
+
)), isRecording && /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React13.createElement(Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ React13.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ React13.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ React13.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ React13.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React13.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), /* @__PURE__ */ React13.createElement(AnimatePresence, null, showPromptInput && /* @__PURE__ */ React13.createElement(
|
|
16741
16930
|
motion.div,
|
|
16742
16931
|
{
|
|
16743
16932
|
className: "ai-modal-backdrop",
|
|
@@ -16745,7 +16934,7 @@ function AiGroup({ editor }) {
|
|
|
16745
16934
|
animate: { opacity: 1 },
|
|
16746
16935
|
exit: { opacity: 0 }
|
|
16747
16936
|
},
|
|
16748
|
-
/* @__PURE__ */
|
|
16937
|
+
/* @__PURE__ */ React13.createElement(
|
|
16749
16938
|
motion.div,
|
|
16750
16939
|
{
|
|
16751
16940
|
className: "ai-modal-content",
|
|
@@ -16753,8 +16942,8 @@ function AiGroup({ editor }) {
|
|
|
16753
16942
|
animate: { scale: 1, opacity: 1 },
|
|
16754
16943
|
exit: { scale: 0.9, opacity: 0 }
|
|
16755
16944
|
},
|
|
16756
|
-
/* @__PURE__ */
|
|
16757
|
-
/* @__PURE__ */
|
|
16945
|
+
/* @__PURE__ */ React13.createElement("h2", { className: "ai-modal-title" }, "AI Prompt"),
|
|
16946
|
+
/* @__PURE__ */ React13.createElement(
|
|
16758
16947
|
"textarea",
|
|
16759
16948
|
{
|
|
16760
16949
|
className: "ai-modal-textarea",
|
|
@@ -16763,15 +16952,15 @@ function AiGroup({ editor }) {
|
|
|
16763
16952
|
placeholder: "Enter your prompt here..."
|
|
16764
16953
|
}
|
|
16765
16954
|
),
|
|
16766
|
-
aiError && /* @__PURE__ */
|
|
16767
|
-
/* @__PURE__ */
|
|
16955
|
+
aiError && /* @__PURE__ */ React13.createElement("p", { className: "ai-modal-error" }, aiError),
|
|
16956
|
+
/* @__PURE__ */ React13.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React13.createElement(
|
|
16768
16957
|
"button",
|
|
16769
16958
|
{
|
|
16770
16959
|
onClick: () => setShowPromptInput(false),
|
|
16771
16960
|
className: "ai-cancel-btn"
|
|
16772
16961
|
},
|
|
16773
16962
|
"Cancel"
|
|
16774
|
-
), /* @__PURE__ */
|
|
16963
|
+
), /* @__PURE__ */ React13.createElement(
|
|
16775
16964
|
"button",
|
|
16776
16965
|
{
|
|
16777
16966
|
onClick: handlePromptSubmit,
|
|
@@ -16784,13 +16973,76 @@ function AiGroup({ editor }) {
|
|
|
16784
16973
|
)));
|
|
16785
16974
|
}
|
|
16786
16975
|
|
|
16976
|
+
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
16977
|
+
import React15, { useState as useState9 } from "react";
|
|
16978
|
+
import { SquareRadical, MessageSquareCode } from "lucide-react";
|
|
16979
|
+
import dynamic from "next/dynamic";
|
|
16980
|
+
import "katex/dist/katex.min.css";
|
|
16981
|
+
var MathModal2 = dynamic(() => Promise.resolve().then(() => (init_MathModal(), MathModal_exports)), { ssr: false });
|
|
16982
|
+
var CodeEditorModal2 = dynamic(() => Promise.resolve().then(() => (init_CodeEditorModal(), CodeEditorModal_exports)), {
|
|
16983
|
+
ssr: false
|
|
16984
|
+
});
|
|
16985
|
+
var AddOnGroup = ({ editor }) => {
|
|
16986
|
+
const [isModalOpen, setModalOpen] = useState9(false);
|
|
16987
|
+
const [latexValue, setLatexValue] = useState9("");
|
|
16988
|
+
const [isCodeModalOpen, setCodeModalOpen] = useState9(false);
|
|
16989
|
+
if (!editor) return null;
|
|
16990
|
+
const insertCodeBlock = () => {
|
|
16991
|
+
setCodeModalOpen(true);
|
|
16992
|
+
};
|
|
16993
|
+
const handleMathInsert = (latex) => {
|
|
16994
|
+
editor.chain().focus().insertContent({
|
|
16995
|
+
type: "mathInline",
|
|
16996
|
+
attrs: { formula: latex }
|
|
16997
|
+
}).run();
|
|
16998
|
+
setModalOpen(false);
|
|
16999
|
+
setLatexValue("");
|
|
17000
|
+
};
|
|
17001
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", { className: "group flex gap-2 items-center" }, /* @__PURE__ */ React15.createElement(
|
|
17002
|
+
"button",
|
|
17003
|
+
{
|
|
17004
|
+
type: "button",
|
|
17005
|
+
onClick: insertCodeBlock,
|
|
17006
|
+
className: "addon-btn",
|
|
17007
|
+
title: "Open Code Editor"
|
|
17008
|
+
},
|
|
17009
|
+
/* @__PURE__ */ React15.createElement(MessageSquareCode, { size: 18 })
|
|
17010
|
+
), /* @__PURE__ */ React15.createElement(
|
|
17011
|
+
"button",
|
|
17012
|
+
{
|
|
17013
|
+
type: "button",
|
|
17014
|
+
onClick: () => setModalOpen(true),
|
|
17015
|
+
className: "addon-btn",
|
|
17016
|
+
title: "Insert Math Equation"
|
|
17017
|
+
},
|
|
17018
|
+
/* @__PURE__ */ React15.createElement(SquareRadical, { size: 18 })
|
|
17019
|
+
)), /* @__PURE__ */ React15.createElement(
|
|
17020
|
+
MathModal2,
|
|
17021
|
+
{
|
|
17022
|
+
isOpen: isModalOpen,
|
|
17023
|
+
onClose: () => setModalOpen(false),
|
|
17024
|
+
onSubmit: handleMathInsert,
|
|
17025
|
+
value: latexValue,
|
|
17026
|
+
setValue: setLatexValue
|
|
17027
|
+
}
|
|
17028
|
+
), /* @__PURE__ */ React15.createElement(
|
|
17029
|
+
CodeEditorModal2,
|
|
17030
|
+
{
|
|
17031
|
+
isOpen: isCodeModalOpen,
|
|
17032
|
+
onClose: () => setCodeModalOpen(false)
|
|
17033
|
+
}
|
|
17034
|
+
));
|
|
17035
|
+
};
|
|
17036
|
+
var AddOnGroup_default = AddOnGroup;
|
|
17037
|
+
|
|
16787
17038
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
16788
17039
|
function TetronsToolbar({
|
|
16789
17040
|
editor,
|
|
16790
|
-
version
|
|
17041
|
+
version,
|
|
17042
|
+
addOns = []
|
|
16791
17043
|
}) {
|
|
16792
|
-
const [autoSave, setAutoSave] =
|
|
16793
|
-
|
|
17044
|
+
const [autoSave, setAutoSave] = useState10(false);
|
|
17045
|
+
useEffect8(() => {
|
|
16794
17046
|
if (!editor) return;
|
|
16795
17047
|
const handleUpdate = () => {
|
|
16796
17048
|
if (!autoSave) return;
|
|
@@ -16806,7 +17058,7 @@ function TetronsToolbar({
|
|
|
16806
17058
|
editor.off("update", handleUpdate);
|
|
16807
17059
|
};
|
|
16808
17060
|
}, [autoSave, editor]);
|
|
16809
|
-
return /* @__PURE__ */
|
|
17061
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "tetrons-toolbar" }, version !== "free" && /* @__PURE__ */ React16.createElement("div", { className: "group" }, /* @__PURE__ */ React16.createElement(
|
|
16810
17062
|
"input",
|
|
16811
17063
|
{
|
|
16812
17064
|
type: "checkbox",
|
|
@@ -16814,7 +17066,7 @@ function TetronsToolbar({
|
|
|
16814
17066
|
checked: autoSave,
|
|
16815
17067
|
onChange: (e) => setAutoSave(e.target.checked)
|
|
16816
17068
|
}
|
|
16817
|
-
), /* @__PURE__ */
|
|
17069
|
+
), /* @__PURE__ */ React16.createElement("label", { htmlFor: "autoSave" }, "Auto Save")), ["pro", "premium", "platinum"].includes(version) && /* @__PURE__ */ React16.createElement(FileGroup, { editor }), /* @__PURE__ */ React16.createElement(ClipboardGroup, { editor }), /* @__PURE__ */ React16.createElement(FontStyleGroup, { editor }), /* @__PURE__ */ React16.createElement(ListAlignGroup, { editor }), ["premium", "platinum"].includes(version) && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(InsertGroup, { editor }), /* @__PURE__ */ React16.createElement(ActionGroup, { editor })), version === "platinum" && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(MiscGroup, { editor }), /* @__PURE__ */ React16.createElement(AiGroup, { editor })), addOns.length > 0 && /* @__PURE__ */ React16.createElement(AddOnGroup_default, { editor }));
|
|
16818
17070
|
}
|
|
16819
17071
|
|
|
16820
17072
|
// src/components/tetrons/EditorContent.tsx
|
|
@@ -16823,25 +17075,16 @@ lowlight.register("js", javascript);
|
|
|
16823
17075
|
lowlight.register("ts", typescript);
|
|
16824
17076
|
function EditorContent({ apiKey }) {
|
|
16825
17077
|
const typo = useTypo();
|
|
16826
|
-
const [isValid, setIsValid] =
|
|
16827
|
-
const [error, setError] =
|
|
16828
|
-
const [versions, setVersions] =
|
|
16829
|
-
const [userVersion, setUserVersion] =
|
|
16830
|
-
const [currentVersionIndex, setCurrentVersionIndex] =
|
|
17078
|
+
const [isValid, setIsValid] = useState11(null);
|
|
17079
|
+
const [error, setError] = useState11(null);
|
|
17080
|
+
const [versions, setVersions] = useState11([]);
|
|
17081
|
+
const [userVersion, setUserVersion] = useState11(null);
|
|
17082
|
+
const [currentVersionIndex, setCurrentVersionIndex] = useState11(
|
|
16831
17083
|
null
|
|
16832
17084
|
);
|
|
16833
17085
|
const wrapperRef = useRef7(null);
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
return import.meta.env.VITE_TETRONS_API_URL;
|
|
16837
|
-
}
|
|
16838
|
-
if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
|
|
16839
|
-
return process.env.NEXT_PUBLIC_TETRONS_API_URL;
|
|
16840
|
-
}
|
|
16841
|
-
return "https://staging.tetrons.com";
|
|
16842
|
-
}
|
|
16843
|
-
const API_BASE_URL = getApiBaseUrl();
|
|
16844
|
-
useEffect8(() => {
|
|
17086
|
+
const API_BASE_URL = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL ? process.env.NEXT_PUBLIC_TETRONS_API_URL : "https://staging.tetrons.com";
|
|
17087
|
+
useEffect9(() => {
|
|
16845
17088
|
const validateKey = async () => {
|
|
16846
17089
|
try {
|
|
16847
17090
|
const res = await fetch(`${API_BASE_URL}/api/validate`, {
|
|
@@ -16912,7 +17155,8 @@ function EditorContent({ apiKey }) {
|
|
|
16912
17155
|
Spellcheck.configure({
|
|
16913
17156
|
spellcheckFn: (word) => typo.check(word)
|
|
16914
17157
|
})
|
|
16915
|
-
] : []
|
|
17158
|
+
] : [],
|
|
17159
|
+
MathInline
|
|
16916
17160
|
],
|
|
16917
17161
|
content: "",
|
|
16918
17162
|
editorProps: {
|
|
@@ -16923,7 +17167,7 @@ function EditorContent({ apiKey }) {
|
|
|
16923
17167
|
},
|
|
16924
17168
|
immediatelyRender: false
|
|
16925
17169
|
});
|
|
16926
|
-
|
|
17170
|
+
useEffect9(() => {
|
|
16927
17171
|
return () => {
|
|
16928
17172
|
editor?.destroy();
|
|
16929
17173
|
};
|
|
@@ -16948,15 +17192,22 @@ function EditorContent({ apiKey }) {
|
|
|
16948
17192
|
}
|
|
16949
17193
|
};
|
|
16950
17194
|
if (isValid === false) {
|
|
16951
|
-
return /* @__PURE__ */
|
|
17195
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "editor-error" }, "\u26A0\uFE0F ", error);
|
|
16952
17196
|
}
|
|
16953
17197
|
if (isValid === null) {
|
|
16954
|
-
return /* @__PURE__ */
|
|
17198
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "editor-loading" }, "\u{1F50D} Validating license...");
|
|
16955
17199
|
}
|
|
16956
17200
|
if (!typo) {
|
|
16957
|
-
return /* @__PURE__ */
|
|
17201
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "editor-loading" }, "\u{1F4D6} Loading dictionary...");
|
|
16958
17202
|
}
|
|
16959
|
-
|
|
17203
|
+
const versionAddOnsMap = {
|
|
17204
|
+
free: [],
|
|
17205
|
+
pro: ["code"],
|
|
17206
|
+
premium: ["code", "math"],
|
|
17207
|
+
platinum: ["code", "math"]
|
|
17208
|
+
};
|
|
17209
|
+
const enabledAddOns = userVersion ? versionAddOnsMap[userVersion] || [] : [];
|
|
17210
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "editor-container" }, userVersion !== "free" && /* @__PURE__ */ React17.createElement("div", { className: "editor-toolbar" }, /* @__PURE__ */ React17.createElement(
|
|
16960
17211
|
"button",
|
|
16961
17212
|
{
|
|
16962
17213
|
type: "button",
|
|
@@ -16965,7 +17216,7 @@ function EditorContent({ apiKey }) {
|
|
|
16965
17216
|
className: "editor-save-btn"
|
|
16966
17217
|
},
|
|
16967
17218
|
"Save Version"
|
|
16968
|
-
), /* @__PURE__ */
|
|
17219
|
+
), /* @__PURE__ */ React17.createElement("div", { className: "editor-versions-wrapper" }, versions.length === 0 ? /* @__PURE__ */ React17.createElement("span", { className: "editor-no-versions" }, "No saved versions") : versions.map((_, idx) => /* @__PURE__ */ React17.createElement(
|
|
16969
17220
|
"button",
|
|
16970
17221
|
{
|
|
16971
17222
|
key: idx,
|
|
@@ -16975,14 +17226,21 @@ function EditorContent({ apiKey }) {
|
|
|
16975
17226
|
title: `Restore Version ${idx + 1}`
|
|
16976
17227
|
},
|
|
16977
17228
|
`V${idx + 1}`
|
|
16978
|
-
)))), editor && userVersion && /* @__PURE__ */
|
|
17229
|
+
)))), editor && userVersion && /* @__PURE__ */ React17.createElement(
|
|
17230
|
+
TetronsToolbar,
|
|
17231
|
+
{
|
|
17232
|
+
editor,
|
|
17233
|
+
version: userVersion,
|
|
17234
|
+
addOns: enabledAddOns
|
|
17235
|
+
}
|
|
17236
|
+
), /* @__PURE__ */ React17.createElement(
|
|
16979
17237
|
"div",
|
|
16980
17238
|
{
|
|
16981
17239
|
ref: wrapperRef,
|
|
16982
17240
|
className: "editor-content-wrapper",
|
|
16983
17241
|
onClick: handleEditorClick
|
|
16984
17242
|
},
|
|
16985
|
-
editor ? /* @__PURE__ */
|
|
17243
|
+
editor ? /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(TiptapEditorContent, { editor }), /* @__PURE__ */ React17.createElement(TableContextMenu, { editor })) : /* @__PURE__ */ React17.createElement("div", { className: "editor-loading" }, "Loading editor...")
|
|
16986
17244
|
));
|
|
16987
17245
|
}
|
|
16988
17246
|
|