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.cjs
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,6 +30,133 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
32
|
|
|
33
|
+
// src/components/tetrons/toolbar/MathModal.js
|
|
34
|
+
var MathModal_exports = {};
|
|
35
|
+
__export(MathModal_exports, {
|
|
36
|
+
default: () => MathModal
|
|
37
|
+
});
|
|
38
|
+
function MathModal({
|
|
39
|
+
isOpen,
|
|
40
|
+
onClose,
|
|
41
|
+
onSubmit,
|
|
42
|
+
value,
|
|
43
|
+
setValue
|
|
44
|
+
}) {
|
|
45
|
+
(0, import_react19.useEffect)(() => {
|
|
46
|
+
const onEsc = (e) => {
|
|
47
|
+
if (e.key === "Escape") onClose();
|
|
48
|
+
};
|
|
49
|
+
if (isOpen) {
|
|
50
|
+
window.addEventListener("keydown", onEsc);
|
|
51
|
+
}
|
|
52
|
+
return () => window.removeEventListener("keydown", onEsc);
|
|
53
|
+
}, [isOpen, onClose]);
|
|
54
|
+
if (!isOpen) return null;
|
|
55
|
+
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(
|
|
56
|
+
"textarea",
|
|
57
|
+
{
|
|
58
|
+
className: "ai-modal-textarea",
|
|
59
|
+
placeholder: "Enter LaTeX code here...",
|
|
60
|
+
value,
|
|
61
|
+
onChange: (e) => setValue(e.target.value)
|
|
62
|
+
}
|
|
63
|
+
), /* @__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(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
className: "ai-submit-btn",
|
|
67
|
+
onClick: () => onSubmit(value),
|
|
68
|
+
disabled: !value.trim()
|
|
69
|
+
},
|
|
70
|
+
"Insert"
|
|
71
|
+
))));
|
|
72
|
+
}
|
|
73
|
+
function renderLatex(latex) {
|
|
74
|
+
try {
|
|
75
|
+
return import_katex2.default.renderToString(latex, {
|
|
76
|
+
throwOnError: false,
|
|
77
|
+
displayMode: false
|
|
78
|
+
});
|
|
79
|
+
} catch {
|
|
80
|
+
return `<span style="color: red;">Invalid LaTeX</span>`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var import_react19, import_katex2, import_katex_min;
|
|
84
|
+
var init_MathModal = __esm({
|
|
85
|
+
"src/components/tetrons/toolbar/MathModal.js"() {
|
|
86
|
+
"use strict";
|
|
87
|
+
import_react19 = require("react");
|
|
88
|
+
import_katex2 = __toESM(require("katex"));
|
|
89
|
+
import_katex_min = require("katex/dist/katex.min.css");
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// src/components/tetrons/toolbar/CodeEditorModal.js
|
|
94
|
+
var CodeEditorModal_exports = {};
|
|
95
|
+
__export(CodeEditorModal_exports, {
|
|
96
|
+
default: () => CodeEditorModal_default
|
|
97
|
+
});
|
|
98
|
+
var import_react20, import_react21, CodeEditorModal, CodeEditorModal_default;
|
|
99
|
+
var init_CodeEditorModal = __esm({
|
|
100
|
+
"src/components/tetrons/toolbar/CodeEditorModal.js"() {
|
|
101
|
+
"use strict";
|
|
102
|
+
"use client";
|
|
103
|
+
import_react20 = __toESM(require("react"));
|
|
104
|
+
import_react21 = __toESM(require("@monaco-editor/react"));
|
|
105
|
+
CodeEditorModal = ({ isOpen, onClose }) => {
|
|
106
|
+
const [language, setLanguage] = (0, import_react20.useState)("javascript");
|
|
107
|
+
const [code, setCode] = (0, import_react20.useState)("// Write your code here");
|
|
108
|
+
const [output, setOutput] = (0, import_react20.useState)("");
|
|
109
|
+
const [loading, setLoading] = (0, import_react20.useState)(false);
|
|
110
|
+
const runCode = async () => {
|
|
111
|
+
setLoading(true);
|
|
112
|
+
try {
|
|
113
|
+
const res = await fetch("/api/execute", {
|
|
114
|
+
method: "POST",
|
|
115
|
+
headers: { "Content-Type": "application/json" },
|
|
116
|
+
body: JSON.stringify({ language, code })
|
|
117
|
+
});
|
|
118
|
+
const data = await res.json();
|
|
119
|
+
let result = "";
|
|
120
|
+
if (data.stderr) result += `Error:
|
|
121
|
+
${data.stderr}
|
|
122
|
+
`;
|
|
123
|
+
if (data.stdout) result += data.stdout;
|
|
124
|
+
if (!data.stdout && !data.stderr) result = "No output";
|
|
125
|
+
setOutput(result);
|
|
126
|
+
} catch (err) {
|
|
127
|
+
console.log(err.message);
|
|
128
|
+
setOutput("Error running code");
|
|
129
|
+
}
|
|
130
|
+
setLoading(false);
|
|
131
|
+
};
|
|
132
|
+
if (!isOpen) return null;
|
|
133
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { className: "code-modal-overlay" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "code-modal-content" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "code-modal-header" }, /* @__PURE__ */ import_react20.default.createElement("h2", null, "Run Code"), /* @__PURE__ */ import_react20.default.createElement("button", { onClick: onClose, className: "code-close-btn" }, "\xD7")), /* @__PURE__ */ import_react20.default.createElement("div", { className: "code-modal-controls" }, /* @__PURE__ */ import_react20.default.createElement("label", { htmlFor: "language" }, "Language:"), /* @__PURE__ */ import_react20.default.createElement(
|
|
134
|
+
"select",
|
|
135
|
+
{
|
|
136
|
+
id: "language",
|
|
137
|
+
value: language,
|
|
138
|
+
onChange: (e) => setLanguage(e.target.value)
|
|
139
|
+
},
|
|
140
|
+
/* @__PURE__ */ import_react20.default.createElement("option", { value: "javascript" }, "JavaScript"),
|
|
141
|
+
/* @__PURE__ */ import_react20.default.createElement("option", { value: "python" }, "Python"),
|
|
142
|
+
/* @__PURE__ */ import_react20.default.createElement("option", { value: "cpp" }, "C++"),
|
|
143
|
+
/* @__PURE__ */ import_react20.default.createElement("option", { value: "java" }, "Java"),
|
|
144
|
+
/* @__PURE__ */ import_react20.default.createElement("option", { value: "typescript" }, "TypeScript")
|
|
145
|
+
), /* @__PURE__ */ import_react20.default.createElement("button", { className: "run-code", onClick: runCode, disabled: loading }, loading ? "Running..." : "Run")), /* @__PURE__ */ import_react20.default.createElement(
|
|
146
|
+
import_react21.default,
|
|
147
|
+
{
|
|
148
|
+
height: "50vh",
|
|
149
|
+
theme: "vs-dark",
|
|
150
|
+
language,
|
|
151
|
+
value: code,
|
|
152
|
+
onChange: (v) => setCode(v ?? "")
|
|
153
|
+
}
|
|
154
|
+
), /* @__PURE__ */ import_react20.default.createElement("div", { className: "code-output" }, /* @__PURE__ */ import_react20.default.createElement("strong", null, "Output:"), /* @__PURE__ */ import_react20.default.createElement("pre", null, output.trim() === "" ? "\u2190 Click Run to see output here" : output))));
|
|
155
|
+
};
|
|
156
|
+
CodeEditorModal_default = CodeEditorModal;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
30
160
|
// src/index.ts
|
|
31
161
|
var index_exports = {};
|
|
32
162
|
__export(index_exports, {
|
|
@@ -39,21 +169,77 @@ __export(index_exports, {
|
|
|
39
169
|
});
|
|
40
170
|
module.exports = __toCommonJS(index_exports);
|
|
41
171
|
|
|
172
|
+
// src/components/tetrons/extensions/MathExtension.ts
|
|
173
|
+
var import_core = require("@tiptap/core");
|
|
174
|
+
var import_katex = __toESM(require("katex"));
|
|
175
|
+
var MathInline = import_core.Node.create({
|
|
176
|
+
name: "mathInline",
|
|
177
|
+
inline: true,
|
|
178
|
+
group: "inline",
|
|
179
|
+
atom: true,
|
|
180
|
+
addAttributes() {
|
|
181
|
+
return {
|
|
182
|
+
formula: {
|
|
183
|
+
default: ""
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
parseHTML() {
|
|
188
|
+
return [{ tag: "span[data-math-inline]" }];
|
|
189
|
+
},
|
|
190
|
+
renderHTML({ HTMLAttributes }) {
|
|
191
|
+
return [
|
|
192
|
+
"span",
|
|
193
|
+
(0, import_core.mergeAttributes)(HTMLAttributes, {
|
|
194
|
+
"data-math-inline": "",
|
|
195
|
+
class: "math-inline"
|
|
196
|
+
}),
|
|
197
|
+
HTMLAttributes.formula
|
|
198
|
+
];
|
|
199
|
+
},
|
|
200
|
+
addNodeView() {
|
|
201
|
+
return ({ node }) => {
|
|
202
|
+
const span = document.createElement("span");
|
|
203
|
+
try {
|
|
204
|
+
span.innerHTML = import_katex.default.renderToString(node.attrs.formula, {
|
|
205
|
+
throwOnError: false,
|
|
206
|
+
displayMode: false
|
|
207
|
+
});
|
|
208
|
+
} catch {
|
|
209
|
+
span.textContent = node.attrs.formula;
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
dom: span
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
addCommands() {
|
|
217
|
+
return {
|
|
218
|
+
insertMathInline: (formula) => ({ commands }) => {
|
|
219
|
+
return commands.insertContent({
|
|
220
|
+
type: this.name,
|
|
221
|
+
attrs: { formula }
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
42
228
|
// src/components/tetrons/EditorContent.tsx
|
|
43
|
-
var
|
|
44
|
-
var
|
|
229
|
+
var import_react24 = __toESM(require("react"));
|
|
230
|
+
var import_react25 = require("@tiptap/react");
|
|
45
231
|
|
|
46
232
|
// node_modules/@tiptap/extension-document/dist/index.js
|
|
47
|
-
var
|
|
48
|
-
var Document =
|
|
233
|
+
var import_core2 = require("@tiptap/core");
|
|
234
|
+
var Document = import_core2.Node.create({
|
|
49
235
|
name: "doc",
|
|
50
236
|
topNode: true,
|
|
51
237
|
content: "block+"
|
|
52
238
|
});
|
|
53
239
|
|
|
54
240
|
// node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
55
|
-
var
|
|
56
|
-
var Paragraph =
|
|
241
|
+
var import_core3 = require("@tiptap/core");
|
|
242
|
+
var Paragraph = import_core3.Node.create({
|
|
57
243
|
name: "paragraph",
|
|
58
244
|
priority: 1e3,
|
|
59
245
|
addOptions() {
|
|
@@ -69,7 +255,7 @@ var Paragraph = import_core2.Node.create({
|
|
|
69
255
|
];
|
|
70
256
|
},
|
|
71
257
|
renderHTML({ HTMLAttributes }) {
|
|
72
|
-
return ["p", (0,
|
|
258
|
+
return ["p", (0, import_core3.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
73
259
|
},
|
|
74
260
|
addCommands() {
|
|
75
261
|
return {
|
|
@@ -86,14 +272,14 @@ var Paragraph = import_core2.Node.create({
|
|
|
86
272
|
});
|
|
87
273
|
|
|
88
274
|
// node_modules/@tiptap/extension-text/dist/index.js
|
|
89
|
-
var
|
|
90
|
-
var Text =
|
|
275
|
+
var import_core4 = require("@tiptap/core");
|
|
276
|
+
var Text = import_core4.Node.create({
|
|
91
277
|
name: "text",
|
|
92
278
|
group: "inline"
|
|
93
279
|
});
|
|
94
280
|
|
|
95
281
|
// node_modules/@tiptap/extension-history/dist/index.js
|
|
96
|
-
var
|
|
282
|
+
var import_core5 = require("@tiptap/core");
|
|
97
283
|
|
|
98
284
|
// node_modules/rope-sequence/dist/index.js
|
|
99
285
|
var GOOD_LEAF_SIZE = 200;
|
|
@@ -1310,7 +1496,7 @@ var NodeRange = class {
|
|
|
1310
1496
|
}
|
|
1311
1497
|
};
|
|
1312
1498
|
var emptyAttrs = /* @__PURE__ */ Object.create(null);
|
|
1313
|
-
var
|
|
1499
|
+
var Node5 = class _Node {
|
|
1314
1500
|
/**
|
|
1315
1501
|
@internal
|
|
1316
1502
|
*/
|
|
@@ -1711,7 +1897,7 @@ var Node4 = class _Node {
|
|
|
1711
1897
|
return node;
|
|
1712
1898
|
}
|
|
1713
1899
|
};
|
|
1714
|
-
|
|
1900
|
+
Node5.prototype.text = void 0;
|
|
1715
1901
|
function wrapMarks(marks, str) {
|
|
1716
1902
|
for (let i = marks.length - 1; i >= 0; i--)
|
|
1717
1903
|
str = marks[i].type.name + "(" + str + ")";
|
|
@@ -5715,7 +5901,7 @@ var undoNoScroll = buildCommand(false, false);
|
|
|
5715
5901
|
var redoNoScroll = buildCommand(true, false);
|
|
5716
5902
|
|
|
5717
5903
|
// node_modules/@tiptap/extension-history/dist/index.js
|
|
5718
|
-
var History =
|
|
5904
|
+
var History = import_core5.Extension.create({
|
|
5719
5905
|
name: "history",
|
|
5720
5906
|
addOptions() {
|
|
5721
5907
|
return {
|
|
@@ -5751,12 +5937,12 @@ var History = import_core4.Extension.create({
|
|
|
5751
5937
|
});
|
|
5752
5938
|
|
|
5753
5939
|
// node_modules/@tiptap/extension-bold/dist/index.js
|
|
5754
|
-
var
|
|
5940
|
+
var import_core6 = require("@tiptap/core");
|
|
5755
5941
|
var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
|
|
5756
5942
|
var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
|
|
5757
5943
|
var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
|
|
5758
5944
|
var underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
|
|
5759
|
-
var Bold =
|
|
5945
|
+
var Bold = import_core6.Mark.create({
|
|
5760
5946
|
name: "bold",
|
|
5761
5947
|
addOptions() {
|
|
5762
5948
|
return {
|
|
@@ -5783,7 +5969,7 @@ var Bold = import_core5.Mark.create({
|
|
|
5783
5969
|
];
|
|
5784
5970
|
},
|
|
5785
5971
|
renderHTML({ HTMLAttributes }) {
|
|
5786
|
-
return ["strong", (0,
|
|
5972
|
+
return ["strong", (0, import_core6.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5787
5973
|
},
|
|
5788
5974
|
addCommands() {
|
|
5789
5975
|
return {
|
|
@@ -5806,11 +5992,11 @@ var Bold = import_core5.Mark.create({
|
|
|
5806
5992
|
},
|
|
5807
5993
|
addInputRules() {
|
|
5808
5994
|
return [
|
|
5809
|
-
(0,
|
|
5995
|
+
(0, import_core6.markInputRule)({
|
|
5810
5996
|
find: starInputRegex,
|
|
5811
5997
|
type: this.type
|
|
5812
5998
|
}),
|
|
5813
|
-
(0,
|
|
5999
|
+
(0, import_core6.markInputRule)({
|
|
5814
6000
|
find: underscoreInputRegex,
|
|
5815
6001
|
type: this.type
|
|
5816
6002
|
})
|
|
@@ -5818,11 +6004,11 @@ var Bold = import_core5.Mark.create({
|
|
|
5818
6004
|
},
|
|
5819
6005
|
addPasteRules() {
|
|
5820
6006
|
return [
|
|
5821
|
-
(0,
|
|
6007
|
+
(0, import_core6.markPasteRule)({
|
|
5822
6008
|
find: starPasteRegex,
|
|
5823
6009
|
type: this.type
|
|
5824
6010
|
}),
|
|
5825
|
-
(0,
|
|
6011
|
+
(0, import_core6.markPasteRule)({
|
|
5826
6012
|
find: underscorePasteRegex,
|
|
5827
6013
|
type: this.type
|
|
5828
6014
|
})
|
|
@@ -5831,12 +6017,12 @@ var Bold = import_core5.Mark.create({
|
|
|
5831
6017
|
});
|
|
5832
6018
|
|
|
5833
6019
|
// node_modules/@tiptap/extension-italic/dist/index.js
|
|
5834
|
-
var
|
|
6020
|
+
var import_core7 = require("@tiptap/core");
|
|
5835
6021
|
var starInputRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
|
|
5836
6022
|
var starPasteRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
|
|
5837
6023
|
var underscoreInputRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
|
|
5838
6024
|
var underscorePasteRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g;
|
|
5839
|
-
var Italic =
|
|
6025
|
+
var Italic = import_core7.Mark.create({
|
|
5840
6026
|
name: "italic",
|
|
5841
6027
|
addOptions() {
|
|
5842
6028
|
return {
|
|
@@ -5862,7 +6048,7 @@ var Italic = import_core6.Mark.create({
|
|
|
5862
6048
|
];
|
|
5863
6049
|
},
|
|
5864
6050
|
renderHTML({ HTMLAttributes }) {
|
|
5865
|
-
return ["em", (0,
|
|
6051
|
+
return ["em", (0, import_core7.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5866
6052
|
},
|
|
5867
6053
|
addCommands() {
|
|
5868
6054
|
return {
|
|
@@ -5885,11 +6071,11 @@ var Italic = import_core6.Mark.create({
|
|
|
5885
6071
|
},
|
|
5886
6072
|
addInputRules() {
|
|
5887
6073
|
return [
|
|
5888
|
-
(0,
|
|
6074
|
+
(0, import_core7.markInputRule)({
|
|
5889
6075
|
find: starInputRegex2,
|
|
5890
6076
|
type: this.type
|
|
5891
6077
|
}),
|
|
5892
|
-
(0,
|
|
6078
|
+
(0, import_core7.markInputRule)({
|
|
5893
6079
|
find: underscoreInputRegex2,
|
|
5894
6080
|
type: this.type
|
|
5895
6081
|
})
|
|
@@ -5897,11 +6083,11 @@ var Italic = import_core6.Mark.create({
|
|
|
5897
6083
|
},
|
|
5898
6084
|
addPasteRules() {
|
|
5899
6085
|
return [
|
|
5900
|
-
(0,
|
|
6086
|
+
(0, import_core7.markPasteRule)({
|
|
5901
6087
|
find: starPasteRegex2,
|
|
5902
6088
|
type: this.type
|
|
5903
6089
|
}),
|
|
5904
|
-
(0,
|
|
6090
|
+
(0, import_core7.markPasteRule)({
|
|
5905
6091
|
find: underscorePasteRegex2,
|
|
5906
6092
|
type: this.type
|
|
5907
6093
|
})
|
|
@@ -5913,10 +6099,10 @@ var Italic = import_core6.Mark.create({
|
|
|
5913
6099
|
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
5914
6100
|
|
|
5915
6101
|
// node_modules/@tiptap/extension-strike/dist/index.js
|
|
5916
|
-
var
|
|
6102
|
+
var import_core8 = require("@tiptap/core");
|
|
5917
6103
|
var inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
|
|
5918
6104
|
var pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
|
|
5919
|
-
var Strike =
|
|
6105
|
+
var Strike = import_core8.Mark.create({
|
|
5920
6106
|
name: "strike",
|
|
5921
6107
|
addOptions() {
|
|
5922
6108
|
return {
|
|
@@ -5942,7 +6128,7 @@ var Strike = import_core7.Mark.create({
|
|
|
5942
6128
|
];
|
|
5943
6129
|
},
|
|
5944
6130
|
renderHTML({ HTMLAttributes }) {
|
|
5945
|
-
return ["s", (0,
|
|
6131
|
+
return ["s", (0, import_core8.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
5946
6132
|
},
|
|
5947
6133
|
addCommands() {
|
|
5948
6134
|
return {
|
|
@@ -5964,7 +6150,7 @@ var Strike = import_core7.Mark.create({
|
|
|
5964
6150
|
},
|
|
5965
6151
|
addInputRules() {
|
|
5966
6152
|
return [
|
|
5967
|
-
(0,
|
|
6153
|
+
(0, import_core8.markInputRule)({
|
|
5968
6154
|
find: inputRegex,
|
|
5969
6155
|
type: this.type
|
|
5970
6156
|
})
|
|
@@ -5972,7 +6158,7 @@ var Strike = import_core7.Mark.create({
|
|
|
5972
6158
|
},
|
|
5973
6159
|
addPasteRules() {
|
|
5974
6160
|
return [
|
|
5975
|
-
(0,
|
|
6161
|
+
(0, import_core8.markPasteRule)({
|
|
5976
6162
|
find: pasteRegex,
|
|
5977
6163
|
type: this.type
|
|
5978
6164
|
})
|
|
@@ -5981,10 +6167,10 @@ var Strike = import_core7.Mark.create({
|
|
|
5981
6167
|
});
|
|
5982
6168
|
|
|
5983
6169
|
// node_modules/@tiptap/extension-code/dist/index.js
|
|
5984
|
-
var
|
|
6170
|
+
var import_core9 = require("@tiptap/core");
|
|
5985
6171
|
var inputRegex2 = /(^|[^`])`([^`]+)`(?!`)/;
|
|
5986
6172
|
var pasteRegex2 = /(^|[^`])`([^`]+)`(?!`)/g;
|
|
5987
|
-
var Code =
|
|
6173
|
+
var Code = import_core9.Mark.create({
|
|
5988
6174
|
name: "code",
|
|
5989
6175
|
addOptions() {
|
|
5990
6176
|
return {
|
|
@@ -6000,7 +6186,7 @@ var Code = import_core8.Mark.create({
|
|
|
6000
6186
|
];
|
|
6001
6187
|
},
|
|
6002
6188
|
renderHTML({ HTMLAttributes }) {
|
|
6003
|
-
return ["code", (0,
|
|
6189
|
+
return ["code", (0, import_core9.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6004
6190
|
},
|
|
6005
6191
|
addCommands() {
|
|
6006
6192
|
return {
|
|
@@ -6022,7 +6208,7 @@ var Code = import_core8.Mark.create({
|
|
|
6022
6208
|
},
|
|
6023
6209
|
addInputRules() {
|
|
6024
6210
|
return [
|
|
6025
|
-
(0,
|
|
6211
|
+
(0, import_core9.markInputRule)({
|
|
6026
6212
|
find: inputRegex2,
|
|
6027
6213
|
type: this.type
|
|
6028
6214
|
})
|
|
@@ -6030,7 +6216,7 @@ var Code = import_core8.Mark.create({
|
|
|
6030
6216
|
},
|
|
6031
6217
|
addPasteRules() {
|
|
6032
6218
|
return [
|
|
6033
|
-
(0,
|
|
6219
|
+
(0, import_core9.markPasteRule)({
|
|
6034
6220
|
find: pasteRegex2,
|
|
6035
6221
|
type: this.type
|
|
6036
6222
|
})
|
|
@@ -6039,9 +6225,9 @@ var Code = import_core8.Mark.create({
|
|
|
6039
6225
|
});
|
|
6040
6226
|
|
|
6041
6227
|
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
6042
|
-
var
|
|
6228
|
+
var import_core10 = require("@tiptap/core");
|
|
6043
6229
|
var inputRegex3 = /^\s*>\s$/;
|
|
6044
|
-
var Blockquote =
|
|
6230
|
+
var Blockquote = import_core10.Node.create({
|
|
6045
6231
|
name: "blockquote",
|
|
6046
6232
|
addOptions() {
|
|
6047
6233
|
return {
|
|
@@ -6057,7 +6243,7 @@ var Blockquote = import_core9.Node.create({
|
|
|
6057
6243
|
];
|
|
6058
6244
|
},
|
|
6059
6245
|
renderHTML({ HTMLAttributes }) {
|
|
6060
|
-
return ["blockquote", (0,
|
|
6246
|
+
return ["blockquote", (0, import_core10.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6061
6247
|
},
|
|
6062
6248
|
addCommands() {
|
|
6063
6249
|
return {
|
|
@@ -6079,7 +6265,7 @@ var Blockquote = import_core9.Node.create({
|
|
|
6079
6265
|
},
|
|
6080
6266
|
addInputRules() {
|
|
6081
6267
|
return [
|
|
6082
|
-
(0,
|
|
6268
|
+
(0, import_core10.wrappingInputRule)({
|
|
6083
6269
|
find: inputRegex3,
|
|
6084
6270
|
type: this.type
|
|
6085
6271
|
})
|
|
@@ -6088,8 +6274,8 @@ var Blockquote = import_core9.Node.create({
|
|
|
6088
6274
|
});
|
|
6089
6275
|
|
|
6090
6276
|
// node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
6091
|
-
var
|
|
6092
|
-
var HardBreak =
|
|
6277
|
+
var import_core11 = require("@tiptap/core");
|
|
6278
|
+
var HardBreak = import_core11.Node.create({
|
|
6093
6279
|
name: "hardBreak",
|
|
6094
6280
|
addOptions() {
|
|
6095
6281
|
return {
|
|
@@ -6107,7 +6293,7 @@ var HardBreak = import_core10.Node.create({
|
|
|
6107
6293
|
];
|
|
6108
6294
|
},
|
|
6109
6295
|
renderHTML({ HTMLAttributes }) {
|
|
6110
|
-
return ["br", (0,
|
|
6296
|
+
return ["br", (0, import_core11.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6111
6297
|
},
|
|
6112
6298
|
renderText() {
|
|
6113
6299
|
return "\n";
|
|
@@ -6146,8 +6332,8 @@ var HardBreak = import_core10.Node.create({
|
|
|
6146
6332
|
});
|
|
6147
6333
|
|
|
6148
6334
|
// node_modules/@tiptap/extension-heading/dist/index.js
|
|
6149
|
-
var
|
|
6150
|
-
var Heading =
|
|
6335
|
+
var import_core12 = require("@tiptap/core");
|
|
6336
|
+
var Heading = import_core12.Node.create({
|
|
6151
6337
|
name: "heading",
|
|
6152
6338
|
addOptions() {
|
|
6153
6339
|
return {
|
|
@@ -6175,7 +6361,7 @@ var Heading = import_core11.Node.create({
|
|
|
6175
6361
|
renderHTML({ node, HTMLAttributes }) {
|
|
6176
6362
|
const hasLevel = this.options.levels.includes(node.attrs.level);
|
|
6177
6363
|
const level = hasLevel ? node.attrs.level : this.options.levels[0];
|
|
6178
|
-
return [`h${level}`, (0,
|
|
6364
|
+
return [`h${level}`, (0, import_core12.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6179
6365
|
},
|
|
6180
6366
|
addCommands() {
|
|
6181
6367
|
return {
|
|
@@ -6203,7 +6389,7 @@ var Heading = import_core11.Node.create({
|
|
|
6203
6389
|
},
|
|
6204
6390
|
addInputRules() {
|
|
6205
6391
|
return this.options.levels.map((level) => {
|
|
6206
|
-
return (0,
|
|
6392
|
+
return (0, import_core12.textblockTypeInputRule)({
|
|
6207
6393
|
find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\s$`),
|
|
6208
6394
|
type: this.type,
|
|
6209
6395
|
getAttributes: {
|
|
@@ -6215,8 +6401,8 @@ var Heading = import_core11.Node.create({
|
|
|
6215
6401
|
});
|
|
6216
6402
|
|
|
6217
6403
|
// node_modules/@tiptap/extension-horizontal-rule/dist/index.js
|
|
6218
|
-
var
|
|
6219
|
-
var HorizontalRule =
|
|
6404
|
+
var import_core13 = require("@tiptap/core");
|
|
6405
|
+
var HorizontalRule = import_core13.Node.create({
|
|
6220
6406
|
name: "horizontalRule",
|
|
6221
6407
|
addOptions() {
|
|
6222
6408
|
return {
|
|
@@ -6228,12 +6414,12 @@ var HorizontalRule = import_core12.Node.create({
|
|
|
6228
6414
|
return [{ tag: "hr" }];
|
|
6229
6415
|
},
|
|
6230
6416
|
renderHTML({ HTMLAttributes }) {
|
|
6231
|
-
return ["hr", (0,
|
|
6417
|
+
return ["hr", (0, import_core13.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
|
|
6232
6418
|
},
|
|
6233
6419
|
addCommands() {
|
|
6234
6420
|
return {
|
|
6235
6421
|
setHorizontalRule: () => ({ chain, state }) => {
|
|
6236
|
-
if (!(0,
|
|
6422
|
+
if (!(0, import_core13.canInsertNode)(state, state.schema.nodes[this.name])) {
|
|
6237
6423
|
return false;
|
|
6238
6424
|
}
|
|
6239
6425
|
const { selection } = state;
|
|
@@ -6246,7 +6432,7 @@ var HorizontalRule = import_core12.Node.create({
|
|
|
6246
6432
|
}, {
|
|
6247
6433
|
type: this.name
|
|
6248
6434
|
});
|
|
6249
|
-
} else if ((0,
|
|
6435
|
+
} else if ((0, import_core13.isNodeSelection)(selection)) {
|
|
6250
6436
|
currentChain.insertContentAt($originTo.pos, {
|
|
6251
6437
|
type: this.name
|
|
6252
6438
|
});
|
|
@@ -6282,7 +6468,7 @@ var HorizontalRule = import_core12.Node.create({
|
|
|
6282
6468
|
},
|
|
6283
6469
|
addInputRules() {
|
|
6284
6470
|
return [
|
|
6285
|
-
(0,
|
|
6471
|
+
(0, import_core13.nodeInputRule)({
|
|
6286
6472
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
6287
6473
|
type: this.type
|
|
6288
6474
|
})
|
|
@@ -6299,8 +6485,8 @@ var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
|
6299
6485
|
var import_extension_text_style = __toESM(require("@tiptap/extension-text-style"));
|
|
6300
6486
|
|
|
6301
6487
|
// node_modules/@tiptap/extension-list-item/dist/index.js
|
|
6302
|
-
var
|
|
6303
|
-
var ListItem =
|
|
6488
|
+
var import_core14 = require("@tiptap/core");
|
|
6489
|
+
var ListItem = import_core14.Node.create({
|
|
6304
6490
|
name: "listItem",
|
|
6305
6491
|
addOptions() {
|
|
6306
6492
|
return {
|
|
@@ -6319,7 +6505,7 @@ var ListItem = import_core13.Node.create({
|
|
|
6319
6505
|
];
|
|
6320
6506
|
},
|
|
6321
6507
|
renderHTML({ HTMLAttributes }) {
|
|
6322
|
-
return ["li", (0,
|
|
6508
|
+
return ["li", (0, import_core14.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6323
6509
|
},
|
|
6324
6510
|
addKeyboardShortcuts() {
|
|
6325
6511
|
return {
|
|
@@ -6331,11 +6517,11 @@ var ListItem = import_core13.Node.create({
|
|
|
6331
6517
|
});
|
|
6332
6518
|
|
|
6333
6519
|
// node_modules/@tiptap/extension-bullet-list/dist/index.js
|
|
6334
|
-
var
|
|
6520
|
+
var import_core15 = require("@tiptap/core");
|
|
6335
6521
|
var ListItemName = "listItem";
|
|
6336
6522
|
var TextStyleName = "textStyle";
|
|
6337
6523
|
var inputRegex4 = /^\s*([-+*])\s$/;
|
|
6338
|
-
var BulletList =
|
|
6524
|
+
var BulletList = import_core15.Node.create({
|
|
6339
6525
|
name: "bulletList",
|
|
6340
6526
|
addOptions() {
|
|
6341
6527
|
return {
|
|
@@ -6355,7 +6541,7 @@ var BulletList = import_core14.Node.create({
|
|
|
6355
6541
|
];
|
|
6356
6542
|
},
|
|
6357
6543
|
renderHTML({ HTMLAttributes }) {
|
|
6358
|
-
return ["ul", (0,
|
|
6544
|
+
return ["ul", (0, import_core15.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6359
6545
|
},
|
|
6360
6546
|
addCommands() {
|
|
6361
6547
|
return {
|
|
@@ -6373,12 +6559,12 @@ var BulletList = import_core14.Node.create({
|
|
|
6373
6559
|
};
|
|
6374
6560
|
},
|
|
6375
6561
|
addInputRules() {
|
|
6376
|
-
let inputRule = (0,
|
|
6562
|
+
let inputRule = (0, import_core15.wrappingInputRule)({
|
|
6377
6563
|
find: inputRegex4,
|
|
6378
6564
|
type: this.type
|
|
6379
6565
|
});
|
|
6380
6566
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
6381
|
-
inputRule = (0,
|
|
6567
|
+
inputRule = (0, import_core15.wrappingInputRule)({
|
|
6382
6568
|
find: inputRegex4,
|
|
6383
6569
|
type: this.type,
|
|
6384
6570
|
keepMarks: this.options.keepMarks,
|
|
@@ -6396,11 +6582,11 @@ var BulletList = import_core14.Node.create({
|
|
|
6396
6582
|
});
|
|
6397
6583
|
|
|
6398
6584
|
// node_modules/@tiptap/extension-ordered-list/dist/index.js
|
|
6399
|
-
var
|
|
6585
|
+
var import_core16 = require("@tiptap/core");
|
|
6400
6586
|
var ListItemName2 = "listItem";
|
|
6401
6587
|
var TextStyleName2 = "textStyle";
|
|
6402
6588
|
var inputRegex5 = /^(\d+)\.\s$/;
|
|
6403
|
-
var OrderedList =
|
|
6589
|
+
var OrderedList = import_core16.Node.create({
|
|
6404
6590
|
name: "orderedList",
|
|
6405
6591
|
addOptions() {
|
|
6406
6592
|
return {
|
|
@@ -6437,7 +6623,7 @@ var OrderedList = import_core15.Node.create({
|
|
|
6437
6623
|
},
|
|
6438
6624
|
renderHTML({ HTMLAttributes }) {
|
|
6439
6625
|
const { start, ...attributesWithoutStart } = HTMLAttributes;
|
|
6440
|
-
return start === 1 ? ["ol", (0,
|
|
6626
|
+
return start === 1 ? ["ol", (0, import_core16.mergeAttributes)(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", (0, import_core16.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
6441
6627
|
},
|
|
6442
6628
|
addCommands() {
|
|
6443
6629
|
return {
|
|
@@ -6455,14 +6641,14 @@ var OrderedList = import_core15.Node.create({
|
|
|
6455
6641
|
};
|
|
6456
6642
|
},
|
|
6457
6643
|
addInputRules() {
|
|
6458
|
-
let inputRule = (0,
|
|
6644
|
+
let inputRule = (0, import_core16.wrappingInputRule)({
|
|
6459
6645
|
find: inputRegex5,
|
|
6460
6646
|
type: this.type,
|
|
6461
6647
|
getAttributes: (match) => ({ start: +match[1] }),
|
|
6462
6648
|
joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1]
|
|
6463
6649
|
});
|
|
6464
6650
|
if (this.options.keepMarks || this.options.keepAttributes) {
|
|
6465
|
-
inputRule = (0,
|
|
6651
|
+
inputRule = (0, import_core16.wrappingInputRule)({
|
|
6466
6652
|
find: inputRegex5,
|
|
6467
6653
|
type: this.type,
|
|
6468
6654
|
keepMarks: this.options.keepMarks,
|
|
@@ -8024,9 +8210,9 @@ function useTypo() {
|
|
|
8024
8210
|
}
|
|
8025
8211
|
|
|
8026
8212
|
// src/components/tetrons/extensions/Spellcheck.ts
|
|
8027
|
-
var
|
|
8213
|
+
var import_core17 = require("@tiptap/core");
|
|
8028
8214
|
var wordMatchRegex = () => /(?:^|\s)([a-zA-Z]{2,})(?=\s|$)/g;
|
|
8029
|
-
var Spellcheck =
|
|
8215
|
+
var Spellcheck = import_core17.Mark.create({
|
|
8030
8216
|
name: "spellcheck",
|
|
8031
8217
|
addOptions() {
|
|
8032
8218
|
return {
|
|
@@ -8035,7 +8221,7 @@ var Spellcheck = import_core16.Mark.create({
|
|
|
8035
8221
|
},
|
|
8036
8222
|
addInputRules() {
|
|
8037
8223
|
return [
|
|
8038
|
-
(0,
|
|
8224
|
+
(0, import_core17.markInputRule)({
|
|
8039
8225
|
find: wordMatchRegex(),
|
|
8040
8226
|
type: this.type,
|
|
8041
8227
|
getAttributes: (match) => this.options.spellcheckFn(match[1]) ? false : { "data-spellcheck": "true" }
|
|
@@ -8063,8 +8249,8 @@ var Spellcheck = import_core16.Mark.create({
|
|
|
8063
8249
|
});
|
|
8064
8250
|
|
|
8065
8251
|
// src/components/tetrons/toolbar/extensions/Comment.ts
|
|
8066
|
-
var
|
|
8067
|
-
var Comment =
|
|
8252
|
+
var import_core18 = require("@tiptap/core");
|
|
8253
|
+
var Comment = import_core18.Mark.create({
|
|
8068
8254
|
name: "comment",
|
|
8069
8255
|
addOptions() {
|
|
8070
8256
|
return {
|
|
@@ -8088,7 +8274,7 @@ var Comment = import_core17.Mark.create({
|
|
|
8088
8274
|
renderHTML({ HTMLAttributes }) {
|
|
8089
8275
|
return [
|
|
8090
8276
|
"span",
|
|
8091
|
-
(0,
|
|
8277
|
+
(0, import_core18.mergeAttributes)(HTMLAttributes, {
|
|
8092
8278
|
"data-comment": HTMLAttributes.comment,
|
|
8093
8279
|
class: "comment-highlight",
|
|
8094
8280
|
title: HTMLAttributes.comment,
|
|
@@ -8110,8 +8296,8 @@ var Comment = import_core17.Mark.create({
|
|
|
8110
8296
|
});
|
|
8111
8297
|
|
|
8112
8298
|
// src/components/tetrons/toolbar/marks/Subscript.ts
|
|
8113
|
-
var
|
|
8114
|
-
var Subscript =
|
|
8299
|
+
var import_core19 = require("@tiptap/core");
|
|
8300
|
+
var Subscript = import_core19.Mark.create({
|
|
8115
8301
|
name: "subscript",
|
|
8116
8302
|
excludes: "superscript",
|
|
8117
8303
|
parseHTML() {
|
|
@@ -8127,7 +8313,7 @@ var Subscript = import_core18.Mark.create({
|
|
|
8127
8313
|
},
|
|
8128
8314
|
addInputRules() {
|
|
8129
8315
|
return [
|
|
8130
|
-
(0,
|
|
8316
|
+
(0, import_core19.markInputRule)({
|
|
8131
8317
|
find: /~([^~]+)~/,
|
|
8132
8318
|
type: this.type
|
|
8133
8319
|
})
|
|
@@ -8135,7 +8321,7 @@ var Subscript = import_core18.Mark.create({
|
|
|
8135
8321
|
},
|
|
8136
8322
|
addPasteRules() {
|
|
8137
8323
|
return [
|
|
8138
|
-
(0,
|
|
8324
|
+
(0, import_core19.markPasteRule)({
|
|
8139
8325
|
find: /~([^~]+)~/g,
|
|
8140
8326
|
type: this.type
|
|
8141
8327
|
})
|
|
@@ -8144,8 +8330,8 @@ var Subscript = import_core18.Mark.create({
|
|
|
8144
8330
|
});
|
|
8145
8331
|
|
|
8146
8332
|
// src/components/tetrons/toolbar/marks/Superscript.ts
|
|
8147
|
-
var
|
|
8148
|
-
var Superscript =
|
|
8333
|
+
var import_core20 = require("@tiptap/core");
|
|
8334
|
+
var Superscript = import_core20.Mark.create({
|
|
8149
8335
|
name: "superscript",
|
|
8150
8336
|
excludes: "subscript",
|
|
8151
8337
|
parseHTML() {
|
|
@@ -8161,7 +8347,7 @@ var Superscript = import_core19.Mark.create({
|
|
|
8161
8347
|
},
|
|
8162
8348
|
addInputRules() {
|
|
8163
8349
|
return [
|
|
8164
|
-
(0,
|
|
8350
|
+
(0, import_core20.markInputRule)({
|
|
8165
8351
|
find: /\^([^^]+)\^/,
|
|
8166
8352
|
type: this.type
|
|
8167
8353
|
})
|
|
@@ -8169,7 +8355,7 @@ var Superscript = import_core19.Mark.create({
|
|
|
8169
8355
|
},
|
|
8170
8356
|
addPasteRules() {
|
|
8171
8357
|
return [
|
|
8172
|
-
(0,
|
|
8358
|
+
(0, import_core20.markPasteRule)({
|
|
8173
8359
|
find: /\^([^^]+)\^/g,
|
|
8174
8360
|
type: this.type
|
|
8175
8361
|
})
|
|
@@ -15248,8 +15434,8 @@ var ResizableTable = import_extension_table.Table.extend({
|
|
|
15248
15434
|
});
|
|
15249
15435
|
|
|
15250
15436
|
// src/components/tetrons/toolbar/extensions/Embed.ts
|
|
15251
|
-
var
|
|
15252
|
-
var Embed =
|
|
15437
|
+
var import_core21 = require("@tiptap/core");
|
|
15438
|
+
var Embed = import_core21.Node.create({
|
|
15253
15439
|
name: "embed",
|
|
15254
15440
|
group: "block",
|
|
15255
15441
|
atom: true,
|
|
@@ -15264,7 +15450,7 @@ var Embed = import_core20.Node.create({
|
|
|
15264
15450
|
return [{ tag: "iframe[src]" }];
|
|
15265
15451
|
},
|
|
15266
15452
|
renderHTML({ HTMLAttributes }) {
|
|
15267
|
-
return ["iframe", (0,
|
|
15453
|
+
return ["iframe", (0, import_core21.mergeAttributes)(HTMLAttributes)];
|
|
15268
15454
|
},
|
|
15269
15455
|
addCommands() {
|
|
15270
15456
|
return {
|
|
@@ -15342,8 +15528,8 @@ var Embed = import_core20.Node.create({
|
|
|
15342
15528
|
});
|
|
15343
15529
|
|
|
15344
15530
|
// src/components/tetrons/toolbar/extensions/FontFamily.ts
|
|
15345
|
-
var
|
|
15346
|
-
var FontFamily =
|
|
15531
|
+
var import_core22 = require("@tiptap/core");
|
|
15532
|
+
var FontFamily = import_core22.Mark.create({
|
|
15347
15533
|
name: "fontFamily",
|
|
15348
15534
|
addAttributes() {
|
|
15349
15535
|
return {
|
|
@@ -15361,7 +15547,7 @@ var FontFamily = import_core21.Mark.create({
|
|
|
15361
15547
|
return [{ style: "font-family" }];
|
|
15362
15548
|
},
|
|
15363
15549
|
renderHTML({ HTMLAttributes }) {
|
|
15364
|
-
return ["span", (0,
|
|
15550
|
+
return ["span", (0, import_core22.mergeAttributes)(HTMLAttributes), 0];
|
|
15365
15551
|
},
|
|
15366
15552
|
addCommands() {
|
|
15367
15553
|
return {
|
|
@@ -15371,8 +15557,8 @@ var FontFamily = import_core21.Mark.create({
|
|
|
15371
15557
|
});
|
|
15372
15558
|
|
|
15373
15559
|
// src/components/tetrons/toolbar/extensions/FontSize.ts
|
|
15374
|
-
var
|
|
15375
|
-
var FontSize =
|
|
15560
|
+
var import_core23 = require("@tiptap/core");
|
|
15561
|
+
var FontSize = import_core23.Mark.create({
|
|
15376
15562
|
name: "fontSize",
|
|
15377
15563
|
addAttributes() {
|
|
15378
15564
|
return {
|
|
@@ -15390,7 +15576,7 @@ var FontSize = import_core22.Mark.create({
|
|
|
15390
15576
|
return [{ style: "font-size" }];
|
|
15391
15577
|
},
|
|
15392
15578
|
renderHTML({ HTMLAttributes }) {
|
|
15393
|
-
return ["span", (0,
|
|
15579
|
+
return ["span", (0, import_core23.mergeAttributes)(HTMLAttributes), 0];
|
|
15394
15580
|
},
|
|
15395
15581
|
addCommands() {
|
|
15396
15582
|
return {
|
|
@@ -15532,7 +15718,7 @@ var ResizableImage = import_extension_image.default.extend({
|
|
|
15532
15718
|
});
|
|
15533
15719
|
|
|
15534
15720
|
// src/components/tetrons/ResizableVideo.ts
|
|
15535
|
-
var
|
|
15721
|
+
var import_core24 = require("@tiptap/core");
|
|
15536
15722
|
var import_react7 = require("@tiptap/react");
|
|
15537
15723
|
|
|
15538
15724
|
// src/components/tetrons/ResizableVideoComponent.tsx
|
|
@@ -15588,7 +15774,7 @@ var ResizableVideoComponent = ({
|
|
|
15588
15774
|
var ResizableVideoComponent_default = ResizableVideoComponent;
|
|
15589
15775
|
|
|
15590
15776
|
// src/components/tetrons/ResizableVideo.ts
|
|
15591
|
-
var ResizableVideo =
|
|
15777
|
+
var ResizableVideo = import_core24.Node.create({
|
|
15592
15778
|
name: "video",
|
|
15593
15779
|
group: "block",
|
|
15594
15780
|
draggable: true,
|
|
@@ -15721,7 +15907,7 @@ function TableContextMenu({ editor }) {
|
|
|
15721
15907
|
}
|
|
15722
15908
|
|
|
15723
15909
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
15724
|
-
var
|
|
15910
|
+
var import_react23 = __toESM(require("react"));
|
|
15725
15911
|
|
|
15726
15912
|
// src/components/tetrons/toolbar/ActionGroup.tsx
|
|
15727
15913
|
var import_react10 = __toESM(require("react"));
|
|
@@ -16777,13 +16963,76 @@ function AiGroup({ editor }) {
|
|
|
16777
16963
|
)));
|
|
16778
16964
|
}
|
|
16779
16965
|
|
|
16966
|
+
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
16967
|
+
var import_react22 = __toESM(require("react"));
|
|
16968
|
+
var import_lucide_react = require("lucide-react");
|
|
16969
|
+
var import_dynamic = __toESM(require("next/dynamic"));
|
|
16970
|
+
var import_katex_min2 = require("katex/dist/katex.min.css");
|
|
16971
|
+
var MathModal2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_MathModal(), MathModal_exports)), { ssr: false });
|
|
16972
|
+
var CodeEditorModal2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_CodeEditorModal(), CodeEditorModal_exports)), {
|
|
16973
|
+
ssr: false
|
|
16974
|
+
});
|
|
16975
|
+
var AddOnGroup = ({ editor }) => {
|
|
16976
|
+
const [isModalOpen, setModalOpen] = (0, import_react22.useState)(false);
|
|
16977
|
+
const [latexValue, setLatexValue] = (0, import_react22.useState)("");
|
|
16978
|
+
const [isCodeModalOpen, setCodeModalOpen] = (0, import_react22.useState)(false);
|
|
16979
|
+
if (!editor) return null;
|
|
16980
|
+
const insertCodeBlock = () => {
|
|
16981
|
+
setCodeModalOpen(true);
|
|
16982
|
+
};
|
|
16983
|
+
const handleMathInsert = (latex) => {
|
|
16984
|
+
editor.chain().focus().insertContent({
|
|
16985
|
+
type: "mathInline",
|
|
16986
|
+
attrs: { formula: latex }
|
|
16987
|
+
}).run();
|
|
16988
|
+
setModalOpen(false);
|
|
16989
|
+
setLatexValue("");
|
|
16990
|
+
};
|
|
16991
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement("div", { className: "group flex gap-2 items-center" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
16992
|
+
"button",
|
|
16993
|
+
{
|
|
16994
|
+
type: "button",
|
|
16995
|
+
onClick: insertCodeBlock,
|
|
16996
|
+
className: "addon-btn",
|
|
16997
|
+
title: "Open Code Editor"
|
|
16998
|
+
},
|
|
16999
|
+
/* @__PURE__ */ import_react22.default.createElement(import_lucide_react.MessageSquareCode, { size: 18 })
|
|
17000
|
+
), /* @__PURE__ */ import_react22.default.createElement(
|
|
17001
|
+
"button",
|
|
17002
|
+
{
|
|
17003
|
+
type: "button",
|
|
17004
|
+
onClick: () => setModalOpen(true),
|
|
17005
|
+
className: "addon-btn",
|
|
17006
|
+
title: "Insert Math Equation"
|
|
17007
|
+
},
|
|
17008
|
+
/* @__PURE__ */ import_react22.default.createElement(import_lucide_react.SquareRadical, { size: 18 })
|
|
17009
|
+
)), /* @__PURE__ */ import_react22.default.createElement(
|
|
17010
|
+
MathModal2,
|
|
17011
|
+
{
|
|
17012
|
+
isOpen: isModalOpen,
|
|
17013
|
+
onClose: () => setModalOpen(false),
|
|
17014
|
+
onSubmit: handleMathInsert,
|
|
17015
|
+
value: latexValue,
|
|
17016
|
+
setValue: setLatexValue
|
|
17017
|
+
}
|
|
17018
|
+
), /* @__PURE__ */ import_react22.default.createElement(
|
|
17019
|
+
CodeEditorModal2,
|
|
17020
|
+
{
|
|
17021
|
+
isOpen: isCodeModalOpen,
|
|
17022
|
+
onClose: () => setCodeModalOpen(false)
|
|
17023
|
+
}
|
|
17024
|
+
));
|
|
17025
|
+
};
|
|
17026
|
+
var AddOnGroup_default = AddOnGroup;
|
|
17027
|
+
|
|
16780
17028
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
16781
17029
|
function TetronsToolbar({
|
|
16782
17030
|
editor,
|
|
16783
|
-
version
|
|
17031
|
+
version,
|
|
17032
|
+
addOns = []
|
|
16784
17033
|
}) {
|
|
16785
|
-
const [autoSave, setAutoSave] = (0,
|
|
16786
|
-
(0,
|
|
17034
|
+
const [autoSave, setAutoSave] = (0, import_react23.useState)(false);
|
|
17035
|
+
(0, import_react23.useEffect)(() => {
|
|
16787
17036
|
if (!editor) return;
|
|
16788
17037
|
const handleUpdate = () => {
|
|
16789
17038
|
if (!autoSave) return;
|
|
@@ -16799,7 +17048,7 @@ function TetronsToolbar({
|
|
|
16799
17048
|
editor.off("update", handleUpdate);
|
|
16800
17049
|
};
|
|
16801
17050
|
}, [autoSave, editor]);
|
|
16802
|
-
return /* @__PURE__ */
|
|
17051
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { className: "tetrons-toolbar" }, version !== "free" && /* @__PURE__ */ import_react23.default.createElement("div", { className: "group" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
16803
17052
|
"input",
|
|
16804
17053
|
{
|
|
16805
17054
|
type: "checkbox",
|
|
@@ -16807,35 +17056,25 @@ function TetronsToolbar({
|
|
|
16807
17056
|
checked: autoSave,
|
|
16808
17057
|
onChange: (e) => setAutoSave(e.target.checked)
|
|
16809
17058
|
}
|
|
16810
|
-
), /* @__PURE__ */
|
|
17059
|
+
), /* @__PURE__ */ import_react23.default.createElement("label", { htmlFor: "autoSave" }, "Auto Save")), ["pro", "premium", "platinum"].includes(version) && /* @__PURE__ */ import_react23.default.createElement(FileGroup, { editor }), /* @__PURE__ */ import_react23.default.createElement(ClipboardGroup, { editor }), /* @__PURE__ */ import_react23.default.createElement(FontStyleGroup, { editor }), /* @__PURE__ */ import_react23.default.createElement(ListAlignGroup, { editor }), ["premium", "platinum"].includes(version) && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(InsertGroup, { editor }), /* @__PURE__ */ import_react23.default.createElement(ActionGroup, { editor })), version === "platinum" && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(MiscGroup, { editor }), /* @__PURE__ */ import_react23.default.createElement(AiGroup, { editor })), addOns.length > 0 && /* @__PURE__ */ import_react23.default.createElement(AddOnGroup_default, { editor }));
|
|
16811
17060
|
}
|
|
16812
17061
|
|
|
16813
17062
|
// src/components/tetrons/EditorContent.tsx
|
|
16814
|
-
var import_meta = {};
|
|
16815
17063
|
var lowlight = (0, import_lowlight.createLowlight)();
|
|
16816
17064
|
lowlight.register("js", javascript);
|
|
16817
17065
|
lowlight.register("ts", typescript);
|
|
16818
17066
|
function EditorContent({ apiKey }) {
|
|
16819
17067
|
const typo = useTypo();
|
|
16820
|
-
const [isValid, setIsValid] = (0,
|
|
16821
|
-
const [error, setError] = (0,
|
|
16822
|
-
const [versions, setVersions] = (0,
|
|
16823
|
-
const [userVersion, setUserVersion] = (0,
|
|
16824
|
-
const [currentVersionIndex, setCurrentVersionIndex] = (0,
|
|
17068
|
+
const [isValid, setIsValid] = (0, import_react24.useState)(null);
|
|
17069
|
+
const [error, setError] = (0, import_react24.useState)(null);
|
|
17070
|
+
const [versions, setVersions] = (0, import_react24.useState)([]);
|
|
17071
|
+
const [userVersion, setUserVersion] = (0, import_react24.useState)(null);
|
|
17072
|
+
const [currentVersionIndex, setCurrentVersionIndex] = (0, import_react24.useState)(
|
|
16825
17073
|
null
|
|
16826
17074
|
);
|
|
16827
|
-
const wrapperRef = (0,
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
return import_meta.env.VITE_TETRONS_API_URL;
|
|
16831
|
-
}
|
|
16832
|
-
if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_TETRONS_API_URL) {
|
|
16833
|
-
return process.env.NEXT_PUBLIC_TETRONS_API_URL;
|
|
16834
|
-
}
|
|
16835
|
-
return "https://staging.tetrons.com";
|
|
16836
|
-
}
|
|
16837
|
-
const API_BASE_URL = getApiBaseUrl();
|
|
16838
|
-
(0, import_react20.useEffect)(() => {
|
|
17075
|
+
const wrapperRef = (0, import_react24.useRef)(null);
|
|
17076
|
+
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";
|
|
17077
|
+
(0, import_react24.useEffect)(() => {
|
|
16839
17078
|
const validateKey = async () => {
|
|
16840
17079
|
try {
|
|
16841
17080
|
const res = await fetch(`${API_BASE_URL}/api/validate`, {
|
|
@@ -16856,7 +17095,7 @@ function EditorContent({ apiKey }) {
|
|
|
16856
17095
|
};
|
|
16857
17096
|
validateKey();
|
|
16858
17097
|
}, [apiKey, API_BASE_URL]);
|
|
16859
|
-
const editor = (0,
|
|
17098
|
+
const editor = (0, import_react25.useEditor)({
|
|
16860
17099
|
extensions: [
|
|
16861
17100
|
Document,
|
|
16862
17101
|
Paragraph,
|
|
@@ -16906,7 +17145,8 @@ function EditorContent({ apiKey }) {
|
|
|
16906
17145
|
Spellcheck.configure({
|
|
16907
17146
|
spellcheckFn: (word) => typo.check(word)
|
|
16908
17147
|
})
|
|
16909
|
-
] : []
|
|
17148
|
+
] : [],
|
|
17149
|
+
MathInline
|
|
16910
17150
|
],
|
|
16911
17151
|
content: "",
|
|
16912
17152
|
editorProps: {
|
|
@@ -16917,7 +17157,7 @@ function EditorContent({ apiKey }) {
|
|
|
16917
17157
|
},
|
|
16918
17158
|
immediatelyRender: false
|
|
16919
17159
|
});
|
|
16920
|
-
(0,
|
|
17160
|
+
(0, import_react24.useEffect)(() => {
|
|
16921
17161
|
return () => {
|
|
16922
17162
|
editor?.destroy();
|
|
16923
17163
|
};
|
|
@@ -16942,15 +17182,22 @@ function EditorContent({ apiKey }) {
|
|
|
16942
17182
|
}
|
|
16943
17183
|
};
|
|
16944
17184
|
if (isValid === false) {
|
|
16945
|
-
return /* @__PURE__ */
|
|
17185
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-error" }, "\u26A0\uFE0F ", error);
|
|
16946
17186
|
}
|
|
16947
17187
|
if (isValid === null) {
|
|
16948
|
-
return /* @__PURE__ */
|
|
17188
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-loading" }, "\u{1F50D} Validating license...");
|
|
16949
17189
|
}
|
|
16950
17190
|
if (!typo) {
|
|
16951
|
-
return /* @__PURE__ */
|
|
17191
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-loading" }, "\u{1F4D6} Loading dictionary...");
|
|
16952
17192
|
}
|
|
16953
|
-
|
|
17193
|
+
const versionAddOnsMap = {
|
|
17194
|
+
free: [],
|
|
17195
|
+
pro: ["code"],
|
|
17196
|
+
premium: ["code", "math"],
|
|
17197
|
+
platinum: ["code", "math"]
|
|
17198
|
+
};
|
|
17199
|
+
const enabledAddOns = userVersion ? versionAddOnsMap[userVersion] || [] : [];
|
|
17200
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-container" }, userVersion !== "free" && /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-toolbar" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
16954
17201
|
"button",
|
|
16955
17202
|
{
|
|
16956
17203
|
type: "button",
|
|
@@ -16959,7 +17206,7 @@ function EditorContent({ apiKey }) {
|
|
|
16959
17206
|
className: "editor-save-btn"
|
|
16960
17207
|
},
|
|
16961
17208
|
"Save Version"
|
|
16962
|
-
), /* @__PURE__ */
|
|
17209
|
+
), /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-versions-wrapper" }, versions.length === 0 ? /* @__PURE__ */ import_react24.default.createElement("span", { className: "editor-no-versions" }, "No saved versions") : versions.map((_, idx) => /* @__PURE__ */ import_react24.default.createElement(
|
|
16963
17210
|
"button",
|
|
16964
17211
|
{
|
|
16965
17212
|
key: idx,
|
|
@@ -16969,14 +17216,21 @@ function EditorContent({ apiKey }) {
|
|
|
16969
17216
|
title: `Restore Version ${idx + 1}`
|
|
16970
17217
|
},
|
|
16971
17218
|
`V${idx + 1}`
|
|
16972
|
-
)))), editor && userVersion && /* @__PURE__ */
|
|
17219
|
+
)))), editor && userVersion && /* @__PURE__ */ import_react24.default.createElement(
|
|
17220
|
+
TetronsToolbar,
|
|
17221
|
+
{
|
|
17222
|
+
editor,
|
|
17223
|
+
version: userVersion,
|
|
17224
|
+
addOns: enabledAddOns
|
|
17225
|
+
}
|
|
17226
|
+
), /* @__PURE__ */ import_react24.default.createElement(
|
|
16973
17227
|
"div",
|
|
16974
17228
|
{
|
|
16975
17229
|
ref: wrapperRef,
|
|
16976
17230
|
className: "editor-content-wrapper",
|
|
16977
17231
|
onClick: handleEditorClick
|
|
16978
17232
|
},
|
|
16979
|
-
editor ? /* @__PURE__ */
|
|
17233
|
+
editor ? /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement(import_react25.EditorContent, { editor }), /* @__PURE__ */ import_react24.default.createElement(TableContextMenu, { editor })) : /* @__PURE__ */ import_react24.default.createElement("div", { className: "editor-loading" }, "Loading editor...")
|
|
16980
17234
|
));
|
|
16981
17235
|
}
|
|
16982
17236
|
|