tetrons 2.3.97 → 2.3.98
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/index.cjs +338 -79
- package/dist/index.mjs +326 -67
- package/dist/styles/tetrons.css +281 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ function MathModal({
|
|
|
42
42
|
value,
|
|
43
43
|
setValue
|
|
44
44
|
}) {
|
|
45
|
-
(0,
|
|
45
|
+
(0, import_react22.useEffect)(() => {
|
|
46
46
|
const onEsc = (e) => {
|
|
47
47
|
if (e.key === "Escape") onClose();
|
|
48
48
|
};
|
|
@@ -52,7 +52,7 @@ function MathModal({
|
|
|
52
52
|
return () => window.removeEventListener("keydown", onEsc);
|
|
53
53
|
}, [isOpen, onClose]);
|
|
54
54
|
if (!isOpen) return null;
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-title" }, "Insert LaTeX Equation"), /* @__PURE__ */ import_react22.default.createElement(
|
|
56
56
|
"textarea",
|
|
57
57
|
{
|
|
58
58
|
className: "ai-modal-textarea",
|
|
@@ -60,7 +60,7 @@ function MathModal({
|
|
|
60
60
|
value,
|
|
61
61
|
onChange: (e) => setValue(e.target.value)
|
|
62
62
|
}
|
|
63
|
-
), /* @__PURE__ */
|
|
63
|
+
), /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-preview" }, /* @__PURE__ */ import_react22.default.createElement("strong", null, "Preview:"), /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-preview-output" }, /* @__PURE__ */ import_react22.default.createElement("span", { dangerouslySetInnerHTML: { __html: renderLatex(value) } }))), /* @__PURE__ */ import_react22.default.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ import_react22.default.createElement("button", { type: "button", className: "ai-cancel-btn", onClick: onClose }, "Cancel"), /* @__PURE__ */ import_react22.default.createElement(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
66
66
|
className: "ai-submit-btn",
|
|
@@ -80,11 +80,11 @@ function renderLatex(latex) {
|
|
|
80
80
|
return `<span style="color: red;">Invalid LaTeX</span>`;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var import_react22, import_katex2, import_katex_min;
|
|
84
84
|
var init_MathModal = __esm({
|
|
85
85
|
"src/components/tetrons/toolbar/MathModal.js"() {
|
|
86
86
|
"use strict";
|
|
87
|
-
|
|
87
|
+
import_react22 = __toESM(require("react"));
|
|
88
88
|
import_katex2 = __toESM(require("katex"));
|
|
89
89
|
import_katex_min = require("katex/dist/katex.min.css");
|
|
90
90
|
}
|
|
@@ -95,23 +95,23 @@ var CodeEditorModal_exports = {};
|
|
|
95
95
|
__export(CodeEditorModal_exports, {
|
|
96
96
|
default: () => CodeEditorModal_default
|
|
97
97
|
});
|
|
98
|
-
var
|
|
98
|
+
var import_react23, import_react24, CodeEditorModal, CodeEditorModal_default;
|
|
99
99
|
var init_CodeEditorModal = __esm({
|
|
100
100
|
"src/components/tetrons/toolbar/CodeEditorModal.js"() {
|
|
101
101
|
"use strict";
|
|
102
102
|
"use client";
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
import_react23 = __toESM(require("react"));
|
|
104
|
+
import_react24 = __toESM(require("@monaco-editor/react"));
|
|
105
105
|
CodeEditorModal = ({
|
|
106
106
|
isOpen,
|
|
107
107
|
onClose,
|
|
108
108
|
onSubmitCode,
|
|
109
109
|
onSubmitCodeWithOutput
|
|
110
110
|
}) => {
|
|
111
|
-
const [language, setLanguage] = (0,
|
|
112
|
-
const [code, setCode] = (0,
|
|
113
|
-
const [output, setOutput] = (0,
|
|
114
|
-
const [loading, setLoading] = (0,
|
|
111
|
+
const [language, setLanguage] = (0, import_react23.useState)("javascript");
|
|
112
|
+
const [code, setCode] = (0, import_react23.useState)("// Write your code here");
|
|
113
|
+
const [output, setOutput] = (0, import_react23.useState)("");
|
|
114
|
+
const [loading, setLoading] = (0, import_react23.useState)(false);
|
|
115
115
|
const runCode = async () => {
|
|
116
116
|
setLoading(true);
|
|
117
117
|
try {
|
|
@@ -147,20 +147,20 @@ ${data.stderr}
|
|
|
147
147
|
onClose();
|
|
148
148
|
};
|
|
149
149
|
if (!isOpen) return null;
|
|
150
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-modal-overlay" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-modal-content" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-modal-header" }, /* @__PURE__ */ import_react23.default.createElement("h2", null, "Run Code"), /* @__PURE__ */ import_react23.default.createElement("button", { onClick: onClose, className: "code-close-btn" }, "\xD7")), /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-modal-controls" }, /* @__PURE__ */ import_react23.default.createElement("label", { htmlFor: "language" }, "Language:"), /* @__PURE__ */ import_react23.default.createElement(
|
|
151
151
|
"select",
|
|
152
152
|
{
|
|
153
153
|
id: "language",
|
|
154
154
|
value: language,
|
|
155
155
|
onChange: (e) => setLanguage(e.target.value)
|
|
156
156
|
},
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
), /* @__PURE__ */
|
|
163
|
-
|
|
157
|
+
/* @__PURE__ */ import_react23.default.createElement("option", { value: "javascript" }, "JavaScript"),
|
|
158
|
+
/* @__PURE__ */ import_react23.default.createElement("option", { value: "python" }, "Python"),
|
|
159
|
+
/* @__PURE__ */ import_react23.default.createElement("option", { value: "cpp" }, "C++"),
|
|
160
|
+
/* @__PURE__ */ import_react23.default.createElement("option", { value: "java" }, "Java"),
|
|
161
|
+
/* @__PURE__ */ import_react23.default.createElement("option", { value: "typescript" }, "TypeScript")
|
|
162
|
+
), /* @__PURE__ */ import_react23.default.createElement("button", { className: "run-code", onClick: runCode, disabled: loading }, loading ? "Running..." : "Run")), /* @__PURE__ */ import_react23.default.createElement(
|
|
163
|
+
import_react24.default,
|
|
164
164
|
{
|
|
165
165
|
height: "50vh",
|
|
166
166
|
theme: "vs-dark",
|
|
@@ -168,7 +168,7 @@ ${data.stderr}
|
|
|
168
168
|
value: code,
|
|
169
169
|
onChange: (v) => setCode(v ?? "")
|
|
170
170
|
}
|
|
171
|
-
), /* @__PURE__ */
|
|
171
|
+
), /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-output" }, /* @__PURE__ */ import_react23.default.createElement("strong", null, "Output:"), /* @__PURE__ */ import_react23.default.createElement("pre", null, output.trim() === "" ? "\u2190 Click Run to see output here" : output)), /* @__PURE__ */ import_react23.default.createElement("div", { className: "code-submit-buttons-container" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
172
172
|
"button",
|
|
173
173
|
{
|
|
174
174
|
className: "code-submit-buttons",
|
|
@@ -176,7 +176,7 @@ ${data.stderr}
|
|
|
176
176
|
disabled: loading || !code
|
|
177
177
|
},
|
|
178
178
|
"Submit Code Snippet Only"
|
|
179
|
-
), /* @__PURE__ */
|
|
179
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
180
180
|
"button",
|
|
181
181
|
{
|
|
182
182
|
className: "code-submit-buttons",
|
|
@@ -260,8 +260,8 @@ var MathInline = import_core.Node.create({
|
|
|
260
260
|
});
|
|
261
261
|
|
|
262
262
|
// src/components/tetrons/EditorContent.tsx
|
|
263
|
-
var
|
|
264
|
-
var
|
|
263
|
+
var import_react27 = __toESM(require("react"));
|
|
264
|
+
var import_react28 = require("@tiptap/react");
|
|
265
265
|
|
|
266
266
|
// src/utils/licenseTracker.ts
|
|
267
267
|
var getLicenseKey = (plan) => `__tetrons_license_start_${plan}__`;
|
|
@@ -15978,7 +15978,7 @@ function TableContextMenu({ editor }) {
|
|
|
15978
15978
|
}
|
|
15979
15979
|
|
|
15980
15980
|
// src/components/tetrons/toolbar/TetronsToolbar.tsx
|
|
15981
|
-
var
|
|
15981
|
+
var import_react26 = __toESM(require("react"));
|
|
15982
15982
|
|
|
15983
15983
|
// src/components/tetrons/toolbar/ActionGroup.tsx
|
|
15984
15984
|
var import_react10 = __toESM(require("react"));
|
|
@@ -16875,20 +16875,253 @@ function FileGroup({ editor }) {
|
|
|
16875
16875
|
}
|
|
16876
16876
|
|
|
16877
16877
|
// src/components/tetrons/toolbar/AIGroup.tsx
|
|
16878
|
+
var import_react21 = __toESM(require("react"));
|
|
16879
|
+
var import_fa4 = require("react-icons/fa");
|
|
16880
|
+
var import_loaders = require("@uiball/loaders");
|
|
16881
|
+
|
|
16882
|
+
// src/components/tetrons/toolbar/Tabs.tsx
|
|
16883
|
+
var import_react20 = require("react");
|
|
16884
|
+
|
|
16885
|
+
// src/components/tetrons/toolbar/Converter.tsx
|
|
16878
16886
|
var import_react18 = __toESM(require("react"));
|
|
16887
|
+
|
|
16888
|
+
// src/utils/languages.ts
|
|
16889
|
+
var indianLanguages = [
|
|
16890
|
+
"Assamese",
|
|
16891
|
+
"Bengali",
|
|
16892
|
+
"Bodo",
|
|
16893
|
+
"Dogri",
|
|
16894
|
+
"Gujarati",
|
|
16895
|
+
"Hindi",
|
|
16896
|
+
"Kannada",
|
|
16897
|
+
"Kashmiri",
|
|
16898
|
+
"Konkani",
|
|
16899
|
+
"Maithili",
|
|
16900
|
+
"Malayalam",
|
|
16901
|
+
"Manipuri",
|
|
16902
|
+
"Marathi",
|
|
16903
|
+
"Nepali",
|
|
16904
|
+
"Odia",
|
|
16905
|
+
"Punjabi",
|
|
16906
|
+
"Sanskrit",
|
|
16907
|
+
"Santali",
|
|
16908
|
+
"Sindhi",
|
|
16909
|
+
"Tamil",
|
|
16910
|
+
"Telugu",
|
|
16911
|
+
"Urdu",
|
|
16912
|
+
"English"
|
|
16913
|
+
];
|
|
16914
|
+
|
|
16915
|
+
// src/components/tetrons/toolbar/Converter.tsx
|
|
16879
16916
|
var import_fa2 = require("react-icons/fa");
|
|
16880
|
-
|
|
16917
|
+
function Converter({
|
|
16918
|
+
onResult
|
|
16919
|
+
}) {
|
|
16920
|
+
const [sourceLang, setSourceLang] = (0, import_react18.useState)("Hindi");
|
|
16921
|
+
const [targetLang, setTargetLang] = (0, import_react18.useState)("Bengali");
|
|
16922
|
+
const [text, setText] = (0, import_react18.useState)("");
|
|
16923
|
+
const [result, setResult] = (0, import_react18.useState)("");
|
|
16924
|
+
const handleConvert = async () => {
|
|
16925
|
+
const res = await fetch("https://tetrons.com/api/translate", {
|
|
16926
|
+
method: "POST",
|
|
16927
|
+
headers: { "Content-Type": "application/json" },
|
|
16928
|
+
body: JSON.stringify({ text, sourceLang, targetLang, mode: "convert" })
|
|
16929
|
+
});
|
|
16930
|
+
const data = await res.json();
|
|
16931
|
+
setResult(data.result);
|
|
16932
|
+
if (data.result && onResult) {
|
|
16933
|
+
onResult(data.result);
|
|
16934
|
+
}
|
|
16935
|
+
};
|
|
16936
|
+
const handleSpeakOutput = async () => {
|
|
16937
|
+
if (!result) return;
|
|
16938
|
+
const res = await fetch("https://tetrons.com/api/speak", {
|
|
16939
|
+
method: "POST",
|
|
16940
|
+
headers: { "Content-Type": "application/json" },
|
|
16941
|
+
body: JSON.stringify({ text: result, lang: targetLang })
|
|
16942
|
+
});
|
|
16943
|
+
const blob = await res.blob();
|
|
16944
|
+
const url = URL.createObjectURL(blob);
|
|
16945
|
+
const audio = new Audio(url);
|
|
16946
|
+
audio.play();
|
|
16947
|
+
};
|
|
16948
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: "container" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "sourceLang", className: "label" }, "Source Language:"), /* @__PURE__ */ import_react18.default.createElement(
|
|
16949
|
+
"select",
|
|
16950
|
+
{
|
|
16951
|
+
id: "sourceLang",
|
|
16952
|
+
value: sourceLang,
|
|
16953
|
+
onChange: (e) => setSourceLang(e.target.value),
|
|
16954
|
+
className: "select"
|
|
16955
|
+
},
|
|
16956
|
+
indianLanguages.map((lang) => /* @__PURE__ */ import_react18.default.createElement("option", { key: lang }, lang))
|
|
16957
|
+
)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "targetLang", className: "label" }, "Target Language:"), /* @__PURE__ */ import_react18.default.createElement(
|
|
16958
|
+
"select",
|
|
16959
|
+
{
|
|
16960
|
+
id: "targetLang",
|
|
16961
|
+
value: targetLang,
|
|
16962
|
+
onChange: (e) => setTargetLang(e.target.value),
|
|
16963
|
+
className: "select"
|
|
16964
|
+
},
|
|
16965
|
+
indianLanguages.map((lang) => /* @__PURE__ */ import_react18.default.createElement("option", { key: lang }, lang))
|
|
16966
|
+
)), /* @__PURE__ */ import_react18.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react18.default.createElement("label", { htmlFor: "inputText", className: "label" }, "Enter Text:"), /* @__PURE__ */ import_react18.default.createElement(
|
|
16967
|
+
"textarea",
|
|
16968
|
+
{
|
|
16969
|
+
id: "inputText",
|
|
16970
|
+
placeholder: "Enter text...",
|
|
16971
|
+
value: text,
|
|
16972
|
+
onChange: (e) => setText(e.target.value),
|
|
16973
|
+
className: "textarea"
|
|
16974
|
+
}
|
|
16975
|
+
)), /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: handleConvert, className: "button" }, "Convert"), /* @__PURE__ */ import_react18.default.createElement("div", { className: "outputWrapper" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "output" }, result), result && /* @__PURE__ */ import_react18.default.createElement(
|
|
16976
|
+
"button",
|
|
16977
|
+
{
|
|
16978
|
+
type: "button",
|
|
16979
|
+
onClick: handleSpeakOutput,
|
|
16980
|
+
className: "iconButton",
|
|
16981
|
+
"aria-label": "Play conversion",
|
|
16982
|
+
title: "Play conversion"
|
|
16983
|
+
},
|
|
16984
|
+
/* @__PURE__ */ import_react18.default.createElement(import_fa2.FaMicrophone, null)
|
|
16985
|
+
)));
|
|
16986
|
+
}
|
|
16987
|
+
|
|
16988
|
+
// src/components/tetrons/toolbar/Translator.tsx
|
|
16989
|
+
var import_react19 = __toESM(require("react"));
|
|
16990
|
+
var import_fa3 = require("react-icons/fa");
|
|
16991
|
+
function Translator({
|
|
16992
|
+
onResult
|
|
16993
|
+
}) {
|
|
16994
|
+
const [sourceLang, setSourceLang] = (0, import_react19.useState)("Hindi");
|
|
16995
|
+
const [targetLang, setTargetLang] = (0, import_react19.useState)("English");
|
|
16996
|
+
const [text, setText] = (0, import_react19.useState)("");
|
|
16997
|
+
const [result, setResult] = (0, import_react19.useState)("");
|
|
16998
|
+
const [listening, setListening] = (0, import_react19.useState)(false);
|
|
16999
|
+
const handleTranslate = async () => {
|
|
17000
|
+
const res = await fetch("https://tetrons.com/api/translate", {
|
|
17001
|
+
method: "POST",
|
|
17002
|
+
headers: { "Content-Type": "application/json" },
|
|
17003
|
+
body: JSON.stringify({ text, sourceLang, targetLang, mode: "translate" })
|
|
17004
|
+
});
|
|
17005
|
+
const data = await res.json();
|
|
17006
|
+
setResult(data.result);
|
|
17007
|
+
if (data.result && onResult) {
|
|
17008
|
+
onResult(data.result);
|
|
17009
|
+
}
|
|
17010
|
+
};
|
|
17011
|
+
const handleMicInput = () => {
|
|
17012
|
+
const SpeechRecognitionClass = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
17013
|
+
if (!SpeechRecognitionClass) {
|
|
17014
|
+
alert("Speech recognition is not supported in this browser.");
|
|
17015
|
+
return;
|
|
17016
|
+
}
|
|
17017
|
+
const recognition = new SpeechRecognitionClass();
|
|
17018
|
+
recognition.lang = sourceLang === "English" ? "en-IN" : "hi-IN";
|
|
17019
|
+
recognition.interimResults = false;
|
|
17020
|
+
recognition.onstart = () => setListening(true);
|
|
17021
|
+
recognition.onend = () => setListening(false);
|
|
17022
|
+
recognition.onresult = (event) => {
|
|
17023
|
+
const transcript = event.results[0][0].transcript;
|
|
17024
|
+
setText((prev) => prev ? prev + " " + transcript : transcript);
|
|
17025
|
+
};
|
|
17026
|
+
recognition.start();
|
|
17027
|
+
};
|
|
17028
|
+
const handleSpeakOutput = async () => {
|
|
17029
|
+
if (!result) return;
|
|
17030
|
+
const res = await fetch("/api/speak", {
|
|
17031
|
+
method: "POST",
|
|
17032
|
+
headers: { "Content-Type": "application/json" },
|
|
17033
|
+
body: JSON.stringify({ text: result, lang: targetLang })
|
|
17034
|
+
});
|
|
17035
|
+
const blob = await res.blob();
|
|
17036
|
+
const url = URL.createObjectURL(blob);
|
|
17037
|
+
const audio = new Audio(url);
|
|
17038
|
+
audio.play();
|
|
17039
|
+
};
|
|
17040
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { className: "container" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "sourceLang", className: "label" }, "Source Language:"), /* @__PURE__ */ import_react19.default.createElement(
|
|
17041
|
+
"select",
|
|
17042
|
+
{
|
|
17043
|
+
id: "sourceLang",
|
|
17044
|
+
value: sourceLang,
|
|
17045
|
+
onChange: (e) => setSourceLang(e.target.value),
|
|
17046
|
+
className: "select"
|
|
17047
|
+
},
|
|
17048
|
+
indianLanguages.map((lang) => /* @__PURE__ */ import_react19.default.createElement("option", { key: lang }, lang))
|
|
17049
|
+
)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "targetLang", className: "label" }, "Target Language:"), /* @__PURE__ */ import_react19.default.createElement(
|
|
17050
|
+
"select",
|
|
17051
|
+
{
|
|
17052
|
+
id: "targetLang",
|
|
17053
|
+
value: targetLang,
|
|
17054
|
+
onChange: (e) => setTargetLang(e.target.value),
|
|
17055
|
+
className: "select"
|
|
17056
|
+
},
|
|
17057
|
+
indianLanguages.map((lang) => /* @__PURE__ */ import_react19.default.createElement("option", { key: lang }, lang))
|
|
17058
|
+
)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "field" }, /* @__PURE__ */ import_react19.default.createElement("label", { htmlFor: "inputText", className: "label" }, "Enter Text:"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "textareaWrapper" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
17059
|
+
"textarea",
|
|
17060
|
+
{
|
|
17061
|
+
id: "inputText",
|
|
17062
|
+
placeholder: "Enter text...",
|
|
17063
|
+
value: text,
|
|
17064
|
+
onChange: (e) => setText(e.target.value),
|
|
17065
|
+
className: "textarea"
|
|
17066
|
+
}
|
|
17067
|
+
), /* @__PURE__ */ import_react19.default.createElement(
|
|
17068
|
+
"button",
|
|
17069
|
+
{
|
|
17070
|
+
type: "button",
|
|
17071
|
+
onClick: handleMicInput,
|
|
17072
|
+
className: "iconButton",
|
|
17073
|
+
title: listening ? "Listening..." : "Start voice input"
|
|
17074
|
+
},
|
|
17075
|
+
/* @__PURE__ */ import_react19.default.createElement(import_fa3.FaMicrophone, { color: listening ? "red" : "black" })
|
|
17076
|
+
))), /* @__PURE__ */ import_react19.default.createElement("button", { type: "button", onClick: handleTranslate, className: "button" }, "Translate"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "outputWrapper" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "output" }, result), result && /* @__PURE__ */ import_react19.default.createElement(
|
|
17077
|
+
"button",
|
|
17078
|
+
{
|
|
17079
|
+
type: "button",
|
|
17080
|
+
onClick: handleSpeakOutput,
|
|
17081
|
+
className: "iconButton",
|
|
17082
|
+
"aria-label": "Play translation",
|
|
17083
|
+
title: "Play translation"
|
|
17084
|
+
},
|
|
17085
|
+
/* @__PURE__ */ import_react19.default.createElement(import_fa3.FaVolumeUp, null)
|
|
17086
|
+
)));
|
|
17087
|
+
}
|
|
17088
|
+
|
|
17089
|
+
// src/components/tetrons/toolbar/Tabs.tsx
|
|
17090
|
+
var React14 = __toESM(require("react"));
|
|
17091
|
+
function Tabs({ onResult }) {
|
|
17092
|
+
const [activeTab, setActiveTab] = (0, import_react20.useState)("convert");
|
|
17093
|
+
return /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("div", { className: "tabHeader" }, /* @__PURE__ */ React14.createElement(
|
|
17094
|
+
"button",
|
|
17095
|
+
{
|
|
17096
|
+
type: "button",
|
|
17097
|
+
className: `$"tabButton" ${activeTab === "convert" ? "active" : ""}`,
|
|
17098
|
+
onClick: () => setActiveTab("convert")
|
|
17099
|
+
},
|
|
17100
|
+
"Convert"
|
|
17101
|
+
), /* @__PURE__ */ React14.createElement(
|
|
17102
|
+
"button",
|
|
17103
|
+
{
|
|
17104
|
+
type: "button",
|
|
17105
|
+
className: `$"tabButton" ${activeTab === "translate" ? "active" : ""}`,
|
|
17106
|
+
onClick: () => setActiveTab("translate")
|
|
17107
|
+
},
|
|
17108
|
+
"Translate"
|
|
17109
|
+
)), /* @__PURE__ */ React14.createElement("div", { className: "tabContent" }, activeTab === "convert" ? /* @__PURE__ */ React14.createElement(Converter, { onResult }) : /* @__PURE__ */ React14.createElement(Translator, { onResult })));
|
|
17110
|
+
}
|
|
17111
|
+
|
|
17112
|
+
// src/components/tetrons/toolbar/AIGroup.tsx
|
|
16881
17113
|
function AiGroup({ editor, enabledFeatures }) {
|
|
16882
|
-
const [isRecording, setIsRecording] = (0,
|
|
16883
|
-
const [audioBlob, setAudioBlob] = (0,
|
|
16884
|
-
const [isTranscribing, setIsTranscribing] = (0,
|
|
16885
|
-
const [transcriptionError, setTranscriptionError] = (0,
|
|
16886
|
-
const [showPromptInput, setShowPromptInput] = (0,
|
|
16887
|
-
const [prompt2, setPrompt] = (0,
|
|
16888
|
-
const [isLoadingAI, setIsLoadingAI] = (0,
|
|
16889
|
-
const [aiError, setAiError] = (0,
|
|
16890
|
-
const
|
|
16891
|
-
const
|
|
17114
|
+
const [isRecording, setIsRecording] = (0, import_react21.useState)(false);
|
|
17115
|
+
const [audioBlob, setAudioBlob] = (0, import_react21.useState)(null);
|
|
17116
|
+
const [isTranscribing, setIsTranscribing] = (0, import_react21.useState)(false);
|
|
17117
|
+
const [transcriptionError, setTranscriptionError] = (0, import_react21.useState)("");
|
|
17118
|
+
const [showPromptInput, setShowPromptInput] = (0, import_react21.useState)(false);
|
|
17119
|
+
const [prompt2, setPrompt] = (0, import_react21.useState)("");
|
|
17120
|
+
const [isLoadingAI, setIsLoadingAI] = (0, import_react21.useState)(false);
|
|
17121
|
+
const [aiError, setAiError] = (0, import_react21.useState)("");
|
|
17122
|
+
const [showLangModal, setShowLangModal] = (0, import_react21.useState)(false);
|
|
17123
|
+
const mediaRecorderRef = (0, import_react21.useRef)(null);
|
|
17124
|
+
const chunksRef = (0, import_react21.useRef)([]);
|
|
16892
17125
|
const startRecording = async () => {
|
|
16893
17126
|
setTranscriptionError("");
|
|
16894
17127
|
setAudioBlob(null);
|
|
@@ -16961,7 +17194,16 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16961
17194
|
setIsLoadingAI(false);
|
|
16962
17195
|
}
|
|
16963
17196
|
};
|
|
16964
|
-
|
|
17197
|
+
const handleLangClick = () => {
|
|
17198
|
+
setShowLangModal(true);
|
|
17199
|
+
};
|
|
17200
|
+
const handleLangResult = (output) => {
|
|
17201
|
+
if (output) {
|
|
17202
|
+
editor.commands.insertContent(output);
|
|
17203
|
+
setShowLangModal(false);
|
|
17204
|
+
}
|
|
17205
|
+
};
|
|
17206
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "group flex flex-col gap-2 items-start" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex gap-2 items-center" }, enabledFeatures.includes("voice to text") && /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, !isRecording ? /* @__PURE__ */ import_react21.default.createElement(
|
|
16965
17207
|
"button",
|
|
16966
17208
|
{
|
|
16967
17209
|
type: "button",
|
|
@@ -16969,8 +17211,8 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16969
17211
|
className: "icon-btn",
|
|
16970
17212
|
title: "Start Voice Input"
|
|
16971
17213
|
},
|
|
16972
|
-
/* @__PURE__ */
|
|
16973
|
-
) : /* @__PURE__ */
|
|
17214
|
+
/* @__PURE__ */ import_react21.default.createElement(import_fa4.FaMicrophone, { size: 18 })
|
|
17215
|
+
) : /* @__PURE__ */ import_react21.default.createElement(
|
|
16974
17216
|
"button",
|
|
16975
17217
|
{
|
|
16976
17218
|
type: "button",
|
|
@@ -16978,8 +17220,8 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16978
17220
|
className: "icon-btn stop-btn",
|
|
16979
17221
|
title: "Stop Recording"
|
|
16980
17222
|
},
|
|
16981
|
-
/* @__PURE__ */
|
|
16982
|
-
)), enabledFeatures.includes("ai") && /* @__PURE__ */
|
|
17223
|
+
/* @__PURE__ */ import_react21.default.createElement(import_fa4.FaStop, { size: 18 })
|
|
17224
|
+
)), enabledFeatures.includes("ai") && /* @__PURE__ */ import_react21.default.createElement(
|
|
16983
17225
|
"button",
|
|
16984
17226
|
{
|
|
16985
17227
|
type: "button",
|
|
@@ -16988,7 +17230,16 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16988
17230
|
title: "AI Assist"
|
|
16989
17231
|
},
|
|
16990
17232
|
"AI"
|
|
16991
|
-
)
|
|
17233
|
+
), enabledFeatures.includes("language") && /* @__PURE__ */ import_react21.default.createElement(
|
|
17234
|
+
"button",
|
|
17235
|
+
{
|
|
17236
|
+
type: "button",
|
|
17237
|
+
onClick: handleLangClick,
|
|
17238
|
+
className: "lang-button ml-2",
|
|
17239
|
+
title: "Convert/Translate"
|
|
17240
|
+
},
|
|
17241
|
+
/* @__PURE__ */ import_react21.default.createElement(import_fa4.FaLanguage, { size: 18 })
|
|
17242
|
+
)), isRecording && /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ import_react21.default.createElement(import_loaders.Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ import_react21.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react21.default.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), showPromptInput && /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ import_react21.default.createElement("h2", { className: "ai-modal-title" }, "AI Prompt"), /* @__PURE__ */ import_react21.default.createElement(
|
|
16992
17243
|
"textarea",
|
|
16993
17244
|
{
|
|
16994
17245
|
className: "ai-modal-textarea",
|
|
@@ -16996,7 +17247,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16996
17247
|
onChange: (e) => setPrompt(e.target.value),
|
|
16997
17248
|
placeholder: "Enter your prompt here..."
|
|
16998
17249
|
}
|
|
16999
|
-
), aiError && /* @__PURE__ */
|
|
17250
|
+
), aiError && /* @__PURE__ */ import_react21.default.createElement("p", { className: "ai-modal-error" }, aiError), /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
17000
17251
|
"button",
|
|
17001
17252
|
{
|
|
17002
17253
|
type: "button",
|
|
@@ -17004,7 +17255,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
17004
17255
|
className: "ai-cancel-btn"
|
|
17005
17256
|
},
|
|
17006
17257
|
"Cancel"
|
|
17007
|
-
), /* @__PURE__ */
|
|
17258
|
+
), /* @__PURE__ */ import_react21.default.createElement(
|
|
17008
17259
|
"button",
|
|
17009
17260
|
{
|
|
17010
17261
|
type: "button",
|
|
@@ -17013,11 +17264,19 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
17013
17264
|
className: "ai-submit-btn"
|
|
17014
17265
|
},
|
|
17015
17266
|
isLoadingAI ? "Generating..." : "Submit"
|
|
17267
|
+
)))), showLangModal && /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ import_react21.default.createElement("h2", { className: "ai-modal-title" }, "Convert / Translate"), /* @__PURE__ */ import_react21.default.createElement(Tabs, { onResult: handleLangResult }), /* @__PURE__ */ import_react21.default.createElement("div", { className: "ai-modal-actions mt-2" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
17268
|
+
"button",
|
|
17269
|
+
{
|
|
17270
|
+
type: "button",
|
|
17271
|
+
onClick: () => setShowLangModal(false),
|
|
17272
|
+
className: "ai-cancel-btn"
|
|
17273
|
+
},
|
|
17274
|
+
"Close"
|
|
17016
17275
|
)))));
|
|
17017
17276
|
}
|
|
17018
17277
|
|
|
17019
17278
|
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
17020
|
-
var
|
|
17279
|
+
var import_react25 = __toESM(require("react"));
|
|
17021
17280
|
var import_lucide_react = require("lucide-react");
|
|
17022
17281
|
var import_dynamic = __toESM(require("next/dynamic"));
|
|
17023
17282
|
var import_katex_min2 = require("katex/dist/katex.min.css");
|
|
@@ -17026,9 +17285,9 @@ var CodeEditorModal2 = (0, import_dynamic.default)(() => Promise.resolve().then(
|
|
|
17026
17285
|
ssr: false
|
|
17027
17286
|
});
|
|
17028
17287
|
var AddOnGroup = ({ editor, addOns }) => {
|
|
17029
|
-
const [isMathModalOpen, setMathModalOpen] = (0,
|
|
17030
|
-
const [latexValue, setLatexValue] = (0,
|
|
17031
|
-
const [isCodeModalOpen, setCodeModalOpen] = (0,
|
|
17288
|
+
const [isMathModalOpen, setMathModalOpen] = (0, import_react25.useState)(false);
|
|
17289
|
+
const [latexValue, setLatexValue] = (0, import_react25.useState)("");
|
|
17290
|
+
const [isCodeModalOpen, setCodeModalOpen] = (0, import_react25.useState)(false);
|
|
17032
17291
|
if (!editor) return null;
|
|
17033
17292
|
const insertCodeBlock = () => setCodeModalOpen(true);
|
|
17034
17293
|
const handleMathInsert = (latex) => {
|
|
@@ -17059,7 +17318,7 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17059
17318
|
}).run();
|
|
17060
17319
|
setCodeModalOpen(false);
|
|
17061
17320
|
};
|
|
17062
|
-
return /* @__PURE__ */
|
|
17321
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", { className: "group flex gap-2 items-center" }, addOns.includes("code") && /* @__PURE__ */ import_react25.default.createElement(
|
|
17063
17322
|
"button",
|
|
17064
17323
|
{
|
|
17065
17324
|
type: "button",
|
|
@@ -17067,8 +17326,8 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17067
17326
|
className: "addon-btn",
|
|
17068
17327
|
title: "Open Code Editor"
|
|
17069
17328
|
},
|
|
17070
|
-
/* @__PURE__ */
|
|
17071
|
-
), addOns.includes("math") && /* @__PURE__ */
|
|
17329
|
+
/* @__PURE__ */ import_react25.default.createElement(import_lucide_react.MessageSquareCode, { size: 18 })
|
|
17330
|
+
), addOns.includes("math") && /* @__PURE__ */ import_react25.default.createElement(
|
|
17072
17331
|
"button",
|
|
17073
17332
|
{
|
|
17074
17333
|
type: "button",
|
|
@@ -17076,8 +17335,8 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17076
17335
|
className: "addon-btn",
|
|
17077
17336
|
title: "Insert Math Equation"
|
|
17078
17337
|
},
|
|
17079
|
-
/* @__PURE__ */
|
|
17080
|
-
)), addOns.includes("math") && /* @__PURE__ */
|
|
17338
|
+
/* @__PURE__ */ import_react25.default.createElement(import_lucide_react.SquareRadical, { size: 18 })
|
|
17339
|
+
)), addOns.includes("math") && /* @__PURE__ */ import_react25.default.createElement(
|
|
17081
17340
|
MathModal2,
|
|
17082
17341
|
{
|
|
17083
17342
|
isOpen: isMathModalOpen,
|
|
@@ -17086,7 +17345,7 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17086
17345
|
value: latexValue,
|
|
17087
17346
|
setValue: setLatexValue
|
|
17088
17347
|
}
|
|
17089
|
-
), addOns.includes("code") && /* @__PURE__ */
|
|
17348
|
+
), addOns.includes("code") && /* @__PURE__ */ import_react25.default.createElement(
|
|
17090
17349
|
CodeEditorModal2,
|
|
17091
17350
|
{
|
|
17092
17351
|
isOpen: isCodeModalOpen,
|
|
@@ -17104,8 +17363,8 @@ function TetronsToolbar({
|
|
|
17104
17363
|
version,
|
|
17105
17364
|
addOns = []
|
|
17106
17365
|
}) {
|
|
17107
|
-
const [autoSave, setAutoSave] = (0,
|
|
17108
|
-
(0,
|
|
17366
|
+
const [autoSave, setAutoSave] = (0, import_react26.useState)(false);
|
|
17367
|
+
(0, import_react26.useEffect)(() => {
|
|
17109
17368
|
if (!editor || !autoSave) return;
|
|
17110
17369
|
const handleUpdate = () => {
|
|
17111
17370
|
const content = editor.getJSON();
|
|
@@ -17142,7 +17401,7 @@ function TetronsToolbar({
|
|
|
17142
17401
|
return [];
|
|
17143
17402
|
}
|
|
17144
17403
|
})();
|
|
17145
|
-
return /* @__PURE__ */
|
|
17404
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { className: "tetrons-toolbar" }, version !== "free" && /* @__PURE__ */ import_react26.default.createElement("div", { className: "group" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
17146
17405
|
"input",
|
|
17147
17406
|
{
|
|
17148
17407
|
type: "checkbox",
|
|
@@ -17150,7 +17409,7 @@ function TetronsToolbar({
|
|
|
17150
17409
|
checked: autoSave,
|
|
17151
17410
|
onChange: (e) => setAutoSave(e.target.checked)
|
|
17152
17411
|
}
|
|
17153
|
-
), /* @__PURE__ */
|
|
17412
|
+
), /* @__PURE__ */ import_react26.default.createElement("label", { htmlFor: "autoSave" }, "Auto Save")), ["pro", "premium", "platinum"].includes(version) && /* @__PURE__ */ import_react26.default.createElement(FileGroup, { editor }), /* @__PURE__ */ import_react26.default.createElement(ClipboardGroup, { editor }), /* @__PURE__ */ import_react26.default.createElement(FontStyleGroup, { editor }), /* @__PURE__ */ import_react26.default.createElement(ListAlignGroup, { editor }), ["premium", "platinum"].includes(version) && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(InsertGroup, { editor }), /* @__PURE__ */ import_react26.default.createElement(ActionGroup, { editor })), ["pro", "premium", "platinum"].includes(version) && /* @__PURE__ */ import_react26.default.createElement(
|
|
17154
17413
|
MiscGroup,
|
|
17155
17414
|
{
|
|
17156
17415
|
editor,
|
|
@@ -17165,18 +17424,18 @@ function TetronsToolbar({
|
|
|
17165
17424
|
].includes(a)
|
|
17166
17425
|
)
|
|
17167
17426
|
}
|
|
17168
|
-
), (version === "platinum" || effectiveAddOns.includes("ai") || effectiveAddOns.includes("voice to text")) && /* @__PURE__ */
|
|
17427
|
+
), (version === "platinum" || effectiveAddOns.includes("ai") || effectiveAddOns.includes("voice to text")) && /* @__PURE__ */ import_react26.default.createElement(
|
|
17169
17428
|
AiGroup,
|
|
17170
17429
|
{
|
|
17171
17430
|
editor,
|
|
17172
17431
|
enabledFeatures: [
|
|
17173
|
-
...version === "platinum" ? ["ai"] : [],
|
|
17432
|
+
...version === "platinum" ? ["ai", "language"] : [],
|
|
17174
17433
|
...effectiveAddOns.filter(
|
|
17175
|
-
(a) => ["ai", "voice to text"].includes(a)
|
|
17434
|
+
(a) => ["ai", "voice to text", "language"].includes(a)
|
|
17176
17435
|
)
|
|
17177
17436
|
]
|
|
17178
17437
|
}
|
|
17179
|
-
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */
|
|
17438
|
+
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */ import_react26.default.createElement(
|
|
17180
17439
|
AddOnGroup_default,
|
|
17181
17440
|
{
|
|
17182
17441
|
editor,
|
|
@@ -17191,17 +17450,17 @@ lowlight.register("js", javascript);
|
|
|
17191
17450
|
lowlight.register("ts", typescript);
|
|
17192
17451
|
function EditorContent({ apiKey }) {
|
|
17193
17452
|
const typo = useTypo();
|
|
17194
|
-
const [isValid, setIsValid] = (0,
|
|
17195
|
-
const [error, setError] = (0,
|
|
17196
|
-
const [versions, setVersions] = (0,
|
|
17197
|
-
const [userVersion, setUserVersion] = (0,
|
|
17198
|
-
const [currentVersionIndex, setCurrentVersionIndex] = (0,
|
|
17453
|
+
const [isValid, setIsValid] = (0, import_react27.useState)(null);
|
|
17454
|
+
const [error, setError] = (0, import_react27.useState)(null);
|
|
17455
|
+
const [versions, setVersions] = (0, import_react27.useState)([]);
|
|
17456
|
+
const [userVersion, setUserVersion] = (0, import_react27.useState)(null);
|
|
17457
|
+
const [currentVersionIndex, setCurrentVersionIndex] = (0, import_react27.useState)(
|
|
17199
17458
|
null
|
|
17200
17459
|
);
|
|
17201
|
-
const [addOns, setAddOns] = (0,
|
|
17202
|
-
const wrapperRef = (0,
|
|
17460
|
+
const [addOns, setAddOns] = (0, import_react27.useState)([]);
|
|
17461
|
+
const wrapperRef = (0, import_react27.useRef)(null);
|
|
17203
17462
|
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";
|
|
17204
|
-
(0,
|
|
17463
|
+
(0, import_react27.useEffect)(() => {
|
|
17205
17464
|
const fetchKeyData = async () => {
|
|
17206
17465
|
try {
|
|
17207
17466
|
const res = await fetch(`${API_BASE_URL}/api/api-key?apiKey=${apiKey}`);
|
|
@@ -17222,7 +17481,7 @@ function EditorContent({ apiKey }) {
|
|
|
17222
17481
|
};
|
|
17223
17482
|
fetchKeyData();
|
|
17224
17483
|
}, [apiKey, API_BASE_URL]);
|
|
17225
|
-
const editor = (0,
|
|
17484
|
+
const editor = (0, import_react28.useEditor)({
|
|
17226
17485
|
extensions: [
|
|
17227
17486
|
Document,
|
|
17228
17487
|
Paragraph,
|
|
@@ -17284,7 +17543,7 @@ function EditorContent({ apiKey }) {
|
|
|
17284
17543
|
},
|
|
17285
17544
|
immediatelyRender: false
|
|
17286
17545
|
});
|
|
17287
|
-
(0,
|
|
17546
|
+
(0, import_react27.useEffect)(() => {
|
|
17288
17547
|
return () => {
|
|
17289
17548
|
editor?.destroy();
|
|
17290
17549
|
};
|
|
@@ -17309,15 +17568,15 @@ function EditorContent({ apiKey }) {
|
|
|
17309
17568
|
}
|
|
17310
17569
|
};
|
|
17311
17570
|
if (isValid === false) {
|
|
17312
|
-
return /* @__PURE__ */
|
|
17571
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-error" }, "\u26A0\uFE0F ", error);
|
|
17313
17572
|
}
|
|
17314
17573
|
if (isValid === null) {
|
|
17315
|
-
return /* @__PURE__ */
|
|
17574
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-loading" }, "\u{1F50D} Validating license...");
|
|
17316
17575
|
}
|
|
17317
17576
|
if (!typo) {
|
|
17318
|
-
return /* @__PURE__ */
|
|
17577
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-loading" }, "\u{1F4D6} Loading dictionary...");
|
|
17319
17578
|
}
|
|
17320
|
-
return /* @__PURE__ */
|
|
17579
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-container" }, userVersion !== "free" && /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-toolbar" }, /* @__PURE__ */ import_react27.default.createElement(
|
|
17321
17580
|
"button",
|
|
17322
17581
|
{
|
|
17323
17582
|
type: "button",
|
|
@@ -17326,7 +17585,7 @@ function EditorContent({ apiKey }) {
|
|
|
17326
17585
|
className: "editor-save-btn"
|
|
17327
17586
|
},
|
|
17328
17587
|
"Save Version"
|
|
17329
|
-
), /* @__PURE__ */
|
|
17588
|
+
), /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-versions-wrapper" }, versions.length === 0 ? /* @__PURE__ */ import_react27.default.createElement("span", { className: "editor-no-versions" }, "No saved versions") : versions.map((_, idx) => /* @__PURE__ */ import_react27.default.createElement(
|
|
17330
17589
|
"button",
|
|
17331
17590
|
{
|
|
17332
17591
|
key: idx,
|
|
@@ -17336,14 +17595,14 @@ function EditorContent({ apiKey }) {
|
|
|
17336
17595
|
title: `Restore Version ${idx + 1}`
|
|
17337
17596
|
},
|
|
17338
17597
|
`V${idx + 1}`
|
|
17339
|
-
)))), editor && userVersion && /* @__PURE__ */
|
|
17598
|
+
)))), editor && userVersion && /* @__PURE__ */ import_react27.default.createElement(TetronsToolbar, { editor, version: userVersion, addOns }), /* @__PURE__ */ import_react27.default.createElement(
|
|
17340
17599
|
"div",
|
|
17341
17600
|
{
|
|
17342
17601
|
ref: wrapperRef,
|
|
17343
17602
|
className: "editor-content-wrapper",
|
|
17344
17603
|
onClick: handleEditorClick
|
|
17345
17604
|
},
|
|
17346
|
-
editor ? /* @__PURE__ */
|
|
17605
|
+
editor ? /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(import_react28.EditorContent, { editor }), /* @__PURE__ */ import_react27.default.createElement(TableContextMenu, { editor })) : /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-loading" }, "Loading editor...")
|
|
17347
17606
|
));
|
|
17348
17607
|
}
|
|
17349
17608
|
|