tetrons 2.3.95 → 2.3.97
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 +33 -51
- package/dist/index.mjs +33 -51
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16878,7 +16878,6 @@ function FileGroup({ editor }) {
|
|
|
16878
16878
|
var import_react18 = __toESM(require("react"));
|
|
16879
16879
|
var import_fa2 = require("react-icons/fa");
|
|
16880
16880
|
var import_loaders = require("@uiball/loaders");
|
|
16881
|
-
var import_framer_motion = require("framer-motion");
|
|
16882
16881
|
function AiGroup({ editor, enabledFeatures }) {
|
|
16883
16882
|
const [isRecording, setIsRecording] = (0, import_react18.useState)(false);
|
|
16884
16883
|
const [audioBlob, setAudioBlob] = (0, import_react18.useState)(null);
|
|
@@ -16962,8 +16961,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16962
16961
|
setIsLoadingAI(false);
|
|
16963
16962
|
}
|
|
16964
16963
|
};
|
|
16965
|
-
|
|
16966
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: "group flex flex-col gap-2 items-start" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex gap-2 items-center" }, !isRecording && enabledFeatures.includes("voice to text") && /* @__PURE__ */ import_react18.default.createElement(
|
|
16964
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: "group flex flex-col gap-2 items-start" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex gap-2 items-center" }, enabledFeatures.includes("voice to text") && /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, !isRecording ? /* @__PURE__ */ import_react18.default.createElement(
|
|
16967
16965
|
"button",
|
|
16968
16966
|
{
|
|
16969
16967
|
type: "button",
|
|
@@ -16972,7 +16970,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16972
16970
|
title: "Start Voice Input"
|
|
16973
16971
|
},
|
|
16974
16972
|
/* @__PURE__ */ import_react18.default.createElement(import_fa2.FaMicrophone, { size: 18 })
|
|
16975
|
-
)
|
|
16973
|
+
) : /* @__PURE__ */ import_react18.default.createElement(
|
|
16976
16974
|
"button",
|
|
16977
16975
|
{
|
|
16978
16976
|
type: "button",
|
|
@@ -16981,7 +16979,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16981
16979
|
title: "Stop Recording"
|
|
16982
16980
|
},
|
|
16983
16981
|
/* @__PURE__ */ import_react18.default.createElement(import_fa2.FaStop, { size: 18 })
|
|
16984
|
-
), enabledFeatures.includes("ai") && /* @__PURE__ */ import_react18.default.createElement(
|
|
16982
|
+
)), enabledFeatures.includes("ai") && /* @__PURE__ */ import_react18.default.createElement(
|
|
16985
16983
|
"button",
|
|
16986
16984
|
{
|
|
16987
16985
|
type: "button",
|
|
@@ -16990,51 +16988,32 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16990
16988
|
title: "AI Assist"
|
|
16991
16989
|
},
|
|
16992
16990
|
"AI"
|
|
16993
|
-
)), isRecording && /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ import_react18.default.createElement(import_loaders.Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ import_react18.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react18.default.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), /* @__PURE__ */ import_react18.default.createElement(
|
|
16994
|
-
|
|
16991
|
+
)), isRecording && /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ import_react18.default.createElement(import_loaders.Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ import_react18.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react18.default.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), showPromptInput && /* @__PURE__ */ import_react18.default.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ import_react18.default.createElement("h2", { className: "ai-modal-title" }, "AI Prompt"), /* @__PURE__ */ import_react18.default.createElement(
|
|
16992
|
+
"textarea",
|
|
16995
16993
|
{
|
|
16996
|
-
className: "ai-modal-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
16994
|
+
className: "ai-modal-textarea",
|
|
16995
|
+
value: prompt2,
|
|
16996
|
+
onChange: (e) => setPrompt(e.target.value),
|
|
16997
|
+
placeholder: "Enter your prompt here..."
|
|
16998
|
+
}
|
|
16999
|
+
), aiError && /* @__PURE__ */ import_react18.default.createElement("p", { className: "ai-modal-error" }, aiError), /* @__PURE__ */ import_react18.default.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
17000
|
+
"button",
|
|
17001
|
+
{
|
|
17002
|
+
type: "button",
|
|
17003
|
+
onClick: () => setShowPromptInput(false),
|
|
17004
|
+
className: "ai-cancel-btn"
|
|
17000
17005
|
},
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
{
|
|
17013
|
-
className: "ai-modal-textarea",
|
|
17014
|
-
value: prompt2,
|
|
17015
|
-
onChange: (e) => setPrompt(e.target.value),
|
|
17016
|
-
placeholder: "Enter your prompt here..."
|
|
17017
|
-
}
|
|
17018
|
-
),
|
|
17019
|
-
aiError && /* @__PURE__ */ import_react18.default.createElement("p", { className: "ai-modal-error" }, aiError),
|
|
17020
|
-
/* @__PURE__ */ import_react18.default.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
17021
|
-
"button",
|
|
17022
|
-
{
|
|
17023
|
-
onClick: () => setShowPromptInput(false),
|
|
17024
|
-
className: "ai-cancel-btn"
|
|
17025
|
-
},
|
|
17026
|
-
"Cancel"
|
|
17027
|
-
), /* @__PURE__ */ import_react18.default.createElement(
|
|
17028
|
-
"button",
|
|
17029
|
-
{
|
|
17030
|
-
onClick: handlePromptSubmit,
|
|
17031
|
-
disabled: isLoadingAI,
|
|
17032
|
-
className: "ai-submit-btn"
|
|
17033
|
-
},
|
|
17034
|
-
isLoadingAI ? "Generating..." : "Submit"
|
|
17035
|
-
))
|
|
17036
|
-
)
|
|
17037
|
-
)));
|
|
17006
|
+
"Cancel"
|
|
17007
|
+
), /* @__PURE__ */ import_react18.default.createElement(
|
|
17008
|
+
"button",
|
|
17009
|
+
{
|
|
17010
|
+
type: "button",
|
|
17011
|
+
onClick: handlePromptSubmit,
|
|
17012
|
+
disabled: isLoadingAI,
|
|
17013
|
+
className: "ai-submit-btn"
|
|
17014
|
+
},
|
|
17015
|
+
isLoadingAI ? "Generating..." : "Submit"
|
|
17016
|
+
)))));
|
|
17038
17017
|
}
|
|
17039
17018
|
|
|
17040
17019
|
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
@@ -17190,9 +17169,12 @@ function TetronsToolbar({
|
|
|
17190
17169
|
AiGroup,
|
|
17191
17170
|
{
|
|
17192
17171
|
editor,
|
|
17193
|
-
enabledFeatures:
|
|
17194
|
-
|
|
17195
|
-
|
|
17172
|
+
enabledFeatures: [
|
|
17173
|
+
...version === "platinum" ? ["ai"] : [],
|
|
17174
|
+
...effectiveAddOns.filter(
|
|
17175
|
+
(a) => ["ai", "voice to text"].includes(a)
|
|
17176
|
+
)
|
|
17177
|
+
]
|
|
17196
17178
|
}
|
|
17197
17179
|
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */ import_react23.default.createElement(
|
|
17198
17180
|
AddOnGroup_default,
|
package/dist/index.mjs
CHANGED
|
@@ -16887,7 +16887,6 @@ function FileGroup({ editor }) {
|
|
|
16887
16887
|
import React12, { useState as useState7, useRef as useRef6 } from "react";
|
|
16888
16888
|
import { FaMicrophone, FaStop } from "react-icons/fa";
|
|
16889
16889
|
import { Waveform } from "@uiball/loaders";
|
|
16890
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
16891
16890
|
function AiGroup({ editor, enabledFeatures }) {
|
|
16892
16891
|
const [isRecording, setIsRecording] = useState7(false);
|
|
16893
16892
|
const [audioBlob, setAudioBlob] = useState7(null);
|
|
@@ -16971,8 +16970,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16971
16970
|
setIsLoadingAI(false);
|
|
16972
16971
|
}
|
|
16973
16972
|
};
|
|
16974
|
-
|
|
16975
|
-
return /* @__PURE__ */ React12.createElement("div", { className: "group flex flex-col gap-2 items-start" }, /* @__PURE__ */ React12.createElement("div", { className: "flex gap-2 items-center" }, !isRecording && enabledFeatures.includes("voice to text") && /* @__PURE__ */ React12.createElement(
|
|
16973
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "group flex flex-col gap-2 items-start" }, /* @__PURE__ */ React12.createElement("div", { className: "flex gap-2 items-center" }, enabledFeatures.includes("voice to text") && /* @__PURE__ */ React12.createElement(React12.Fragment, null, !isRecording ? /* @__PURE__ */ React12.createElement(
|
|
16976
16974
|
"button",
|
|
16977
16975
|
{
|
|
16978
16976
|
type: "button",
|
|
@@ -16981,7 +16979,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16981
16979
|
title: "Start Voice Input"
|
|
16982
16980
|
},
|
|
16983
16981
|
/* @__PURE__ */ React12.createElement(FaMicrophone, { size: 18 })
|
|
16984
|
-
)
|
|
16982
|
+
) : /* @__PURE__ */ React12.createElement(
|
|
16985
16983
|
"button",
|
|
16986
16984
|
{
|
|
16987
16985
|
type: "button",
|
|
@@ -16990,7 +16988,7 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16990
16988
|
title: "Stop Recording"
|
|
16991
16989
|
},
|
|
16992
16990
|
/* @__PURE__ */ React12.createElement(FaStop, { size: 18 })
|
|
16993
|
-
), enabledFeatures.includes("ai") && /* @__PURE__ */ React12.createElement(
|
|
16991
|
+
)), enabledFeatures.includes("ai") && /* @__PURE__ */ React12.createElement(
|
|
16994
16992
|
"button",
|
|
16995
16993
|
{
|
|
16996
16994
|
type: "button",
|
|
@@ -16999,51 +16997,32 @@ function AiGroup({ editor, enabledFeatures }) {
|
|
|
16999
16997
|
title: "AI Assist"
|
|
17000
16998
|
},
|
|
17001
16999
|
"AI"
|
|
17002
|
-
)), isRecording && /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React12.createElement(Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ React12.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ React12.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React12.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), /* @__PURE__ */ React12.createElement(
|
|
17003
|
-
|
|
17000
|
+
)), isRecording && /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React12.createElement(Waveform, { size: 30, lineWeight: 3.5, speed: 1, color: "#4F46E5" }), /* @__PURE__ */ React12.createElement("p", { className: "text-sm mt-1 text-gray-600" }, "Recording...")), isTranscribing && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-500" }, "Transcribing..."), transcriptionError && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-red-600" }, transcriptionError), audioBlob && /* @__PURE__ */ React12.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React12.createElement("audio", { controls: true, src: URL.createObjectURL(audioBlob) })), showPromptInput && /* @__PURE__ */ React12.createElement("div", { className: "ai-modal-backdrop" }, /* @__PURE__ */ React12.createElement("div", { className: "ai-modal-content" }, /* @__PURE__ */ React12.createElement("h2", { className: "ai-modal-title" }, "AI Prompt"), /* @__PURE__ */ React12.createElement(
|
|
17001
|
+
"textarea",
|
|
17004
17002
|
{
|
|
17005
|
-
className: "ai-modal-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17003
|
+
className: "ai-modal-textarea",
|
|
17004
|
+
value: prompt2,
|
|
17005
|
+
onChange: (e) => setPrompt(e.target.value),
|
|
17006
|
+
placeholder: "Enter your prompt here..."
|
|
17007
|
+
}
|
|
17008
|
+
), aiError && /* @__PURE__ */ React12.createElement("p", { className: "ai-modal-error" }, aiError), /* @__PURE__ */ React12.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React12.createElement(
|
|
17009
|
+
"button",
|
|
17010
|
+
{
|
|
17011
|
+
type: "button",
|
|
17012
|
+
onClick: () => setShowPromptInput(false),
|
|
17013
|
+
className: "ai-cancel-btn"
|
|
17009
17014
|
},
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
{
|
|
17022
|
-
className: "ai-modal-textarea",
|
|
17023
|
-
value: prompt2,
|
|
17024
|
-
onChange: (e) => setPrompt(e.target.value),
|
|
17025
|
-
placeholder: "Enter your prompt here..."
|
|
17026
|
-
}
|
|
17027
|
-
),
|
|
17028
|
-
aiError && /* @__PURE__ */ React12.createElement("p", { className: "ai-modal-error" }, aiError),
|
|
17029
|
-
/* @__PURE__ */ React12.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React12.createElement(
|
|
17030
|
-
"button",
|
|
17031
|
-
{
|
|
17032
|
-
onClick: () => setShowPromptInput(false),
|
|
17033
|
-
className: "ai-cancel-btn"
|
|
17034
|
-
},
|
|
17035
|
-
"Cancel"
|
|
17036
|
-
), /* @__PURE__ */ React12.createElement(
|
|
17037
|
-
"button",
|
|
17038
|
-
{
|
|
17039
|
-
onClick: handlePromptSubmit,
|
|
17040
|
-
disabled: isLoadingAI,
|
|
17041
|
-
className: "ai-submit-btn"
|
|
17042
|
-
},
|
|
17043
|
-
isLoadingAI ? "Generating..." : "Submit"
|
|
17044
|
-
))
|
|
17045
|
-
)
|
|
17046
|
-
)));
|
|
17015
|
+
"Cancel"
|
|
17016
|
+
), /* @__PURE__ */ React12.createElement(
|
|
17017
|
+
"button",
|
|
17018
|
+
{
|
|
17019
|
+
type: "button",
|
|
17020
|
+
onClick: handlePromptSubmit,
|
|
17021
|
+
disabled: isLoadingAI,
|
|
17022
|
+
className: "ai-submit-btn"
|
|
17023
|
+
},
|
|
17024
|
+
isLoadingAI ? "Generating..." : "Submit"
|
|
17025
|
+
)))));
|
|
17047
17026
|
}
|
|
17048
17027
|
|
|
17049
17028
|
// src/components/tetrons/toolbar/AddOnGroup.tsx
|
|
@@ -17199,9 +17178,12 @@ function TetronsToolbar({
|
|
|
17199
17178
|
AiGroup,
|
|
17200
17179
|
{
|
|
17201
17180
|
editor,
|
|
17202
|
-
enabledFeatures:
|
|
17203
|
-
|
|
17204
|
-
|
|
17181
|
+
enabledFeatures: [
|
|
17182
|
+
...version === "platinum" ? ["ai"] : [],
|
|
17183
|
+
...effectiveAddOns.filter(
|
|
17184
|
+
(a) => ["ai", "voice to text"].includes(a)
|
|
17185
|
+
)
|
|
17186
|
+
]
|
|
17205
17187
|
}
|
|
17206
17188
|
), effectiveAddOns.some((a) => a === "math" || a === "code") && /* @__PURE__ */ React16.createElement(
|
|
17207
17189
|
AddOnGroup_default,
|