@smart-cloud/ai-kit-ui 1.1.37 → 1.1.39
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 +6 -6
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/src/ai-feature/AiFeature.tsx +7 -4
package/package.json
CHANGED
|
@@ -336,7 +336,7 @@ const AiFeatureBase: FC<AiFeatureProps & AiKitShellInjectedProps> = (props) => {
|
|
|
336
336
|
|
|
337
337
|
const [state, setState] = useState<string>();
|
|
338
338
|
const [featureOpen, setFeatureOpen] = useState<boolean>(!showOpenButton);
|
|
339
|
-
const [optionsOpen, setOptionsOpen] = useState<boolean>();
|
|
339
|
+
const [optionsOpen, setOptionsOpen] = useState<boolean>(false);
|
|
340
340
|
const [backendConfigured, setBackendConfigured] = useState(false);
|
|
341
341
|
const [error, setError] = useState<string | null>(null);
|
|
342
342
|
const [generated, setGenerated] = useState<never | null>(null);
|
|
@@ -525,6 +525,7 @@ const AiFeatureBase: FC<AiFeatureProps & AiKitShellInjectedProps> = (props) => {
|
|
|
525
525
|
const res = await ai.run(async ({ signal, onStatus }) => {
|
|
526
526
|
const expectedInputLanguages: AiKitLanguageCode[] = [];
|
|
527
527
|
try {
|
|
528
|
+
setState("Detecting input language...");
|
|
528
529
|
const res = await detectLanguage(
|
|
529
530
|
{ text: text!.trim() },
|
|
530
531
|
{
|
|
@@ -970,7 +971,6 @@ Follow these additional instructions: ${instructions}`
|
|
|
970
971
|
|
|
971
972
|
useEffect(() => {
|
|
972
973
|
if (
|
|
973
|
-
optionsOpen !== false ||
|
|
974
974
|
!featureOpen ||
|
|
975
975
|
!autoRun ||
|
|
976
976
|
!canGenerate ||
|
|
@@ -998,7 +998,10 @@ Follow these additional instructions: ${instructions}`
|
|
|
998
998
|
useEffect(() => {
|
|
999
999
|
if (!allowOverrideParameters) return;
|
|
1000
1000
|
if (mode === "proofread") return;
|
|
1001
|
-
if (!canGenerate)
|
|
1001
|
+
if (!canGenerate) {
|
|
1002
|
+
setOptionsOpen(true);
|
|
1003
|
+
autoRunOnceRef.current = true;
|
|
1004
|
+
}
|
|
1002
1005
|
}, [allowOverrideParameters, canGenerate, mode]);
|
|
1003
1006
|
|
|
1004
1007
|
useEffect(() => {
|
|
@@ -1220,7 +1223,7 @@ Follow these additional instructions: ${instructions}`
|
|
|
1220
1223
|
)}
|
|
1221
1224
|
</Group>
|
|
1222
1225
|
|
|
1223
|
-
<CollapseComponent in={optionsOpen
|
|
1226
|
+
<CollapseComponent in={optionsOpen}>
|
|
1224
1227
|
{optionsDisplay === "collapse" && <Divider my="sm" />}
|
|
1225
1228
|
<OptionsComponent gap="xs" justify="space-between">
|
|
1226
1229
|
{/* TOPIC */}
|