tetrons 2.3.96 → 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 +359 -121
- package/dist/index.mjs +347 -109
- 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,21 +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
|
-
|
|
16881
|
-
|
|
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
|
|
16882
17113
|
function AiGroup({ editor, enabledFeatures }) {
|
|
16883
|
-
const [isRecording, setIsRecording] = (0,
|
|
16884
|
-
const [audioBlob, setAudioBlob] = (0,
|
|
16885
|
-
const [isTranscribing, setIsTranscribing] = (0,
|
|
16886
|
-
const [transcriptionError, setTranscriptionError] = (0,
|
|
16887
|
-
const [showPromptInput, setShowPromptInput] = (0,
|
|
16888
|
-
const [prompt2, setPrompt] = (0,
|
|
16889
|
-
const [isLoadingAI, setIsLoadingAI] = (0,
|
|
16890
|
-
const [aiError, setAiError] = (0,
|
|
16891
|
-
const
|
|
16892
|
-
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)([]);
|
|
16893
17125
|
const startRecording = async () => {
|
|
16894
17126
|
setTranscriptionError("");
|
|
16895
17127
|
setAudioBlob(null);
|
|
@@ -16962,8 +17194,16 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16962
17194
|
setIsLoadingAI(false);
|
|
16963
17195
|
}
|
|
16964
17196
|
};
|
|
16965
|
-
|
|
16966
|
-
|
|
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(
|
|
16967
17207
|
"button",
|
|
16968
17208
|
{
|
|
16969
17209
|
type: "button",
|
|
@@ -16971,8 +17211,8 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16971
17211
|
className: "icon-btn",
|
|
16972
17212
|
title: "Start Voice Input"
|
|
16973
17213
|
},
|
|
16974
|
-
/* @__PURE__ */
|
|
16975
|
-
)
|
|
17214
|
+
/* @__PURE__ */ import_react21.default.createElement(import_fa4.FaMicrophone, { size: 18 })
|
|
17215
|
+
) : /* @__PURE__ */ import_react21.default.createElement(
|
|
16976
17216
|
"button",
|
|
16977
17217
|
{
|
|
16978
17218
|
type: "button",
|
|
@@ -16980,8 +17220,8 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16980
17220
|
className: "icon-btn stop-btn",
|
|
16981
17221
|
title: "Stop Recording"
|
|
16982
17222
|
},
|
|
16983
|
-
/* @__PURE__ */
|
|
16984
|
-
), enabledFeatures.includes("ai") && /* @__PURE__ */
|
|
17223
|
+
/* @__PURE__ */ import_react21.default.createElement(import_fa4.FaStop, { size: 18 })
|
|
17224
|
+
)), enabledFeatures.includes("ai") && /* @__PURE__ */ import_react21.default.createElement(
|
|
16985
17225
|
"button",
|
|
16986
17226
|
{
|
|
16987
17227
|
type: "button",
|
|
@@ -16990,55 +17230,53 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16990
17230
|
title: "AI Assist"
|
|
16991
17231
|
},
|
|
16992
17232
|
"AI"
|
|
16993
|
-
)
|
|
16994
|
-
|
|
17233
|
+
), enabledFeatures.includes("language") && /* @__PURE__ */ import_react21.default.createElement(
|
|
17234
|
+
"button",
|
|
16995
17235
|
{
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17236
|
+
type: "button",
|
|
17237
|
+
onClick: handleLangClick,
|
|
17238
|
+
className: "lang-button ml-2",
|
|
17239
|
+
title: "Convert/Translate"
|
|
17000
17240
|
},
|
|
17001
|
-
/* @__PURE__ */
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
)
|
|
17037
|
-
)));
|
|
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(
|
|
17243
|
+
"textarea",
|
|
17244
|
+
{
|
|
17245
|
+
className: "ai-modal-textarea",
|
|
17246
|
+
value: prompt2,
|
|
17247
|
+
onChange: (e) => setPrompt(e.target.value),
|
|
17248
|
+
placeholder: "Enter your prompt here..."
|
|
17249
|
+
}
|
|
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(
|
|
17251
|
+
"button",
|
|
17252
|
+
{
|
|
17253
|
+
type: "button",
|
|
17254
|
+
onClick: () => setShowPromptInput(false),
|
|
17255
|
+
className: "ai-cancel-btn"
|
|
17256
|
+
},
|
|
17257
|
+
"Cancel"
|
|
17258
|
+
), /* @__PURE__ */ import_react21.default.createElement(
|
|
17259
|
+
"button",
|
|
17260
|
+
{
|
|
17261
|
+
type: "button",
|
|
17262
|
+
onClick: handlePromptSubmit,
|
|
17263
|
+
disabled: isLoadingAI,
|
|
17264
|
+
className: "ai-submit-btn"
|
|
17265
|
+
},
|
|
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"
|
|
17275
|
+
)))));
|
|
17038
17276
|
}
|
|
17039
17277
|
|
|
17040
17278
|
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
17041
|
-
var
|
|
17279
|
+
var import_react25 = __toESM(require("react"));
|
|
17042
17280
|
var import_lucide_react = require("lucide-react");
|
|
17043
17281
|
var import_dynamic = __toESM(require("next/dynamic"));
|
|
17044
17282
|
var import_katex_min2 = require("katex/dist/katex.min.css");
|
|
@@ -17047,9 +17285,9 @@ var CodeEditorModal2 = (0, import_dynamic.default)(() => Promise.resolve().then(
|
|
|
17047
17285
|
ssr: false
|
|
17048
17286
|
});
|
|
17049
17287
|
var AddOnGroup = ({ editor, addOns }) => {
|
|
17050
|
-
const [isMathModalOpen, setMathModalOpen] = (0,
|
|
17051
|
-
const [latexValue, setLatexValue] = (0,
|
|
17052
|
-
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);
|
|
17053
17291
|
if (!editor) return null;
|
|
17054
17292
|
const insertCodeBlock = () => setCodeModalOpen(true);
|
|
17055
17293
|
const handleMathInsert = (latex) => {
|
|
@@ -17080,7 +17318,7 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17080
17318
|
}).run();
|
|
17081
17319
|
setCodeModalOpen(false);
|
|
17082
17320
|
};
|
|
17083
|
-
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(
|
|
17084
17322
|
"button",
|
|
17085
17323
|
{
|
|
17086
17324
|
type: "button",
|
|
@@ -17088,8 +17326,8 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17088
17326
|
className: "addon-btn",
|
|
17089
17327
|
title: "Open Code Editor"
|
|
17090
17328
|
},
|
|
17091
|
-
/* @__PURE__ */
|
|
17092
|
-
), 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(
|
|
17093
17331
|
"button",
|
|
17094
17332
|
{
|
|
17095
17333
|
type: "button",
|
|
@@ -17097,8 +17335,8 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17097
17335
|
className: "addon-btn",
|
|
17098
17336
|
title: "Insert Math Equation"
|
|
17099
17337
|
},
|
|
17100
|
-
/* @__PURE__ */
|
|
17101
|
-
)), 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(
|
|
17102
17340
|
MathModal2,
|
|
17103
17341
|
{
|
|
17104
17342
|
isOpen: isMathModalOpen,
|
|
@@ -17107,7 +17345,7 @@ var AddOnGroup = ({ editor, addOns }) => {
|
|
|
17107
17345
|
value: latexValue,
|
|
17108
17346
|
setValue: setLatexValue
|
|
17109
17347
|
}
|
|
17110
|
-
), addOns.includes("code") && /* @__PURE__ */
|
|
17348
|
+
), addOns.includes("code") && /* @__PURE__ */ import_react25.default.createElement(
|
|
17111
17349
|
CodeEditorModal2,
|
|
17112
17350
|
{
|
|
17113
17351
|
isOpen: isCodeModalOpen,
|
|
@@ -17125,8 +17363,8 @@ function TetronsToolbar({
|
|
|
17125
17363
|
version,
|
|
17126
17364
|
addOns = []
|
|
17127
17365
|
}) {
|
|
17128
|
-
const [autoSave, setAutoSave] = (0,
|
|
17129
|
-
(0,
|
|
17366
|
+
const [autoSave, setAutoSave] = (0, import_react26.useState)(false);
|
|
17367
|
+
(0, import_react26.useEffect)(() => {
|
|
17130
17368
|
if (!editor || !autoSave) return;
|
|
17131
17369
|
const handleUpdate = () => {
|
|
17132
17370
|
const content = editor.getJSON();
|
|
@@ -17163,7 +17401,7 @@ function TetronsToolbar({
|
|
|
17163
17401
|
return [];
|
|
17164
17402
|
}
|
|
17165
17403
|
})();
|
|
17166
|
-
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(
|
|
17167
17405
|
"input",
|
|
17168
17406
|
{
|
|
17169
17407
|
type: "checkbox",
|
|
@@ -17171,7 +17409,7 @@ function TetronsToolbar({
|
|
|
17171
17409
|
checked: autoSave,
|
|
17172
17410
|
onChange: (e) => setAutoSave(e.target.checked)
|
|
17173
17411
|
}
|
|
17174
|
-
), /* @__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(
|
|
17175
17413
|
MiscGroup,
|
|
17176
17414
|
{
|
|
17177
17415
|
editor,
|
|
@@ -17186,18 +17424,18 @@ function TetronsToolbar({
|
|
|
17186
17424
|
].includes(a)
|
|
17187
17425
|
)
|
|
17188
17426
|
}
|
|
17189
|
-
), (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(
|
|
17190
17428
|
AiGroup,
|
|
17191
17429
|
{
|
|
17192
17430
|
editor,
|
|
17193
17431
|
enabledFeatures: [
|
|
17194
|
-
...version === "platinum" ? ["ai"] : [],
|
|
17432
|
+
...version === "platinum" ? ["ai", "language"] : [],
|
|
17195
17433
|
...effectiveAddOns.filter(
|
|
17196
|
-
(a) => ["ai", "voice to text"].includes(a)
|
|
17434
|
+
(a) => ["ai", "voice to text", "language"].includes(a)
|
|
17197
17435
|
)
|
|
17198
17436
|
]
|
|
17199
17437
|
}
|
|
17200
|
-
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */
|
|
17438
|
+
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */ import_react26.default.createElement(
|
|
17201
17439
|
AddOnGroup_default,
|
|
17202
17440
|
{
|
|
17203
17441
|
editor,
|
|
@@ -17212,17 +17450,17 @@ lowlight.register("js", javascript);
|
|
|
17212
17450
|
lowlight.register("ts", typescript);
|
|
17213
17451
|
function EditorContent({ apiKey }) {
|
|
17214
17452
|
const typo = useTypo();
|
|
17215
|
-
const [isValid, setIsValid] = (0,
|
|
17216
|
-
const [error, setError] = (0,
|
|
17217
|
-
const [versions, setVersions] = (0,
|
|
17218
|
-
const [userVersion, setUserVersion] = (0,
|
|
17219
|
-
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)(
|
|
17220
17458
|
null
|
|
17221
17459
|
);
|
|
17222
|
-
const [addOns, setAddOns] = (0,
|
|
17223
|
-
const wrapperRef = (0,
|
|
17460
|
+
const [addOns, setAddOns] = (0, import_react27.useState)([]);
|
|
17461
|
+
const wrapperRef = (0, import_react27.useRef)(null);
|
|
17224
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";
|
|
17225
|
-
(0,
|
|
17463
|
+
(0, import_react27.useEffect)(() => {
|
|
17226
17464
|
const fetchKeyData = async () => {
|
|
17227
17465
|
try {
|
|
17228
17466
|
const res = await fetch(`${API_BASE_URL}/api/api-key?apiKey=${apiKey}`);
|
|
@@ -17243,7 +17481,7 @@ function EditorContent({ apiKey }) {
|
|
|
17243
17481
|
};
|
|
17244
17482
|
fetchKeyData();
|
|
17245
17483
|
}, [apiKey, API_BASE_URL]);
|
|
17246
|
-
const editor = (0,
|
|
17484
|
+
const editor = (0, import_react28.useEditor)({
|
|
17247
17485
|
extensions: [
|
|
17248
17486
|
Document,
|
|
17249
17487
|
Paragraph,
|
|
@@ -17305,7 +17543,7 @@ function EditorContent({ apiKey }) {
|
|
|
17305
17543
|
},
|
|
17306
17544
|
immediatelyRender: false
|
|
17307
17545
|
});
|
|
17308
|
-
(0,
|
|
17546
|
+
(0, import_react27.useEffect)(() => {
|
|
17309
17547
|
return () => {
|
|
17310
17548
|
editor?.destroy();
|
|
17311
17549
|
};
|
|
@@ -17330,15 +17568,15 @@ function EditorContent({ apiKey }) {
|
|
|
17330
17568
|
}
|
|
17331
17569
|
};
|
|
17332
17570
|
if (isValid === false) {
|
|
17333
|
-
return /* @__PURE__ */
|
|
17571
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-error" }, "\u26A0\uFE0F ", error);
|
|
17334
17572
|
}
|
|
17335
17573
|
if (isValid === null) {
|
|
17336
|
-
return /* @__PURE__ */
|
|
17574
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-loading" }, "\u{1F50D} Validating license...");
|
|
17337
17575
|
}
|
|
17338
17576
|
if (!typo) {
|
|
17339
|
-
return /* @__PURE__ */
|
|
17577
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { className: "editor-loading" }, "\u{1F4D6} Loading dictionary...");
|
|
17340
17578
|
}
|
|
17341
|
-
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(
|
|
17342
17580
|
"button",
|
|
17343
17581
|
{
|
|
17344
17582
|
type: "button",
|
|
@@ -17347,7 +17585,7 @@ function EditorContent({ apiKey }) {
|
|
|
17347
17585
|
className: "editor-save-btn"
|
|
17348
17586
|
},
|
|
17349
17587
|
"Save Version"
|
|
17350
|
-
), /* @__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(
|
|
17351
17589
|
"button",
|
|
17352
17590
|
{
|
|
17353
17591
|
key: idx,
|
|
@@ -17357,14 +17595,14 @@ function EditorContent({ apiKey }) {
|
|
|
17357
17595
|
title: `Restore Version ${idx + 1}`
|
|
17358
17596
|
},
|
|
17359
17597
|
`V${idx + 1}`
|
|
17360
|
-
)))), editor && userVersion && /* @__PURE__ */
|
|
17598
|
+
)))), editor && userVersion && /* @__PURE__ */ import_react27.default.createElement(TetronsToolbar, { editor, version: userVersion, addOns }), /* @__PURE__ */ import_react27.default.createElement(
|
|
17361
17599
|
"div",
|
|
17362
17600
|
{
|
|
17363
17601
|
ref: wrapperRef,
|
|
17364
17602
|
className: "editor-content-wrapper",
|
|
17365
17603
|
onClick: handleEditorClick
|
|
17366
17604
|
},
|
|
17367
|
-
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...")
|
|
17368
17606
|
));
|
|
17369
17607
|
}
|
|
17370
17608
|
|