@cnc_cbz/usefultools-plugin-official 1.0.4 → 1.0.6
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/js-runner.mjs +68 -94
- package/dist/translator.mjs +98 -43
- package/package.json +1 -1
package/dist/js-runner.mjs
CHANGED
|
@@ -39573,108 +39573,82 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39573
39573
|
}
|
|
39574
39574
|
});
|
|
39575
39575
|
}
|
|
39576
|
+
function serialize(v2, depth = 0) {
|
|
39577
|
+
var _a3, _b2;
|
|
39578
|
+
if (v2 === null) return { t: "null", p: "null" };
|
|
39579
|
+
if (v2 === void 0) return { t: "undefined", p: "undefined" };
|
|
39580
|
+
const tp2 = typeof v2;
|
|
39581
|
+
if (tp2 === "string") return { t: "string", p: `"${v2}"` };
|
|
39582
|
+
if (tp2 === "number" || tp2 === "boolean") return { t: tp2, p: String(v2) };
|
|
39583
|
+
if (tp2 === "function") return { t: "function", p: `ƒ ${v2.name || "anonymous"}()` };
|
|
39584
|
+
if (tp2 === "symbol") return { t: "symbol", p: v2.toString() };
|
|
39585
|
+
if (v2 instanceof Error) return { t: "error", p: v2.stack || v2.message || String(v2) };
|
|
39586
|
+
if (v2 instanceof Date) return { t: "date", p: v2.toISOString() };
|
|
39587
|
+
if (v2 instanceof RegExp) return { t: "regexp", p: v2.toString() };
|
|
39588
|
+
if (depth > 4) return { t: Array.isArray(v2) ? "array" : "object", p: Array.isArray(v2) ? "[...]" : "{...}" };
|
|
39589
|
+
if (Array.isArray(v2)) {
|
|
39590
|
+
const entries = [];
|
|
39591
|
+
for (let i = 0; i < v2.length && i < 100; i++) entries.push({ k: String(i), v: serialize(v2[i], depth + 1) });
|
|
39592
|
+
return { t: "array", p: `Array(${v2.length})`, e: entries };
|
|
39593
|
+
}
|
|
39594
|
+
if (tp2 === "object") {
|
|
39595
|
+
const keys2 = Object.keys(v2);
|
|
39596
|
+
const entries = [];
|
|
39597
|
+
for (let i = 0; i < keys2.length && i < 50; i++) {
|
|
39598
|
+
try {
|
|
39599
|
+
entries.push({ k: keys2[i], v: serialize(v2[keys2[i]], depth + 1) });
|
|
39600
|
+
} catch {
|
|
39601
|
+
entries.push({ k: keys2[i], v: { t: "error", p: "<getter error>" } });
|
|
39602
|
+
}
|
|
39603
|
+
}
|
|
39604
|
+
const name2 = ((_a3 = v2.constructor) == null ? void 0 : _a3.name) !== "Object" ? (_b2 = v2.constructor) == null ? void 0 : _b2.name : "";
|
|
39605
|
+
let preview = name2 ? `${name2} {…}` : "{…}";
|
|
39606
|
+
if (keys2.length <= 5) {
|
|
39607
|
+
preview = (name2 ? `${name2} {` : "{") + keys2.slice(0, 5).map((k2) => `${k2}: …`).join(", ") + "}";
|
|
39608
|
+
}
|
|
39609
|
+
return { t: "object", p: preview, e: entries };
|
|
39610
|
+
}
|
|
39611
|
+
return { t: "string", p: String(v2) };
|
|
39612
|
+
}
|
|
39576
39613
|
async function runCode() {
|
|
39577
39614
|
var _a3;
|
|
39578
39615
|
if (running.value) return;
|
|
39579
39616
|
running.value = true;
|
|
39580
39617
|
logs.value = [];
|
|
39581
39618
|
const userCode = ((_a3 = editorView.value) == null ? void 0 : _a3.state.doc.toString()) || "";
|
|
39582
|
-
const
|
|
39583
|
-
|
|
39584
|
-
|
|
39585
|
-
${urls.map((u) => `<script src="${u}"><\/script>`).join("\n")}
|
|
39586
|
-
</head><body><script>
|
|
39587
|
-
// 递归序列化值为结构化树
|
|
39588
|
-
function _ser(v, depth) {
|
|
39589
|
-
if (depth === undefined) depth = 0;
|
|
39590
|
-
if (v === null) return { t: 'null', p: 'null' };
|
|
39591
|
-
if (v === undefined) return { t: 'undefined', p: 'undefined' };
|
|
39592
|
-
var tp = typeof v;
|
|
39593
|
-
if (tp === 'string') return { t: 'string', p: '"' + v + '"' };
|
|
39594
|
-
if (tp === 'number' || tp === 'boolean') return { t: tp, p: String(v) };
|
|
39595
|
-
if (tp === 'function') return { t: 'function', p: 'ƒ ' + (v.name || 'anonymous') + '()' };
|
|
39596
|
-
if (tp === 'symbol') return { t: 'symbol', p: v.toString() };
|
|
39597
|
-
if (v instanceof Error) return { t: 'error', p: v.stack || v.message || String(v) };
|
|
39598
|
-
if (v instanceof Date) return { t: 'date', p: v.toISOString() };
|
|
39599
|
-
if (v instanceof RegExp) return { t: 'regexp', p: v.toString() };
|
|
39600
|
-
if (depth > 4) return { t: typeof v === 'object' ? (Array.isArray(v) ? 'array' : 'object') : tp, p: Array.isArray(v) ? '[...]' : '{...}' };
|
|
39601
|
-
if (Array.isArray(v)) {
|
|
39602
|
-
var entries = [];
|
|
39603
|
-
for (var i = 0; i < v.length && i < 100; i++) entries.push({ k: String(i), v: _ser(v[i], depth + 1) });
|
|
39604
|
-
return { t: 'array', p: 'Array(' + v.length + ')', e: entries };
|
|
39605
|
-
}
|
|
39606
|
-
if (tp === 'object') {
|
|
39607
|
-
var keys = Object.keys(v), entries = [];
|
|
39608
|
-
for (var i = 0; i < keys.length && i < 50; i++) {
|
|
39609
|
-
try { entries.push({ k: keys[i], v: _ser(v[keys[i]], depth + 1) }); } catch(e) { entries.push({ k: keys[i], v: { t: 'error', p: '<getter error>' } }); }
|
|
39610
|
-
}
|
|
39611
|
-
var name = v.constructor && v.constructor.name !== 'Object' ? v.constructor.name : '';
|
|
39612
|
-
var preview = name ? name + ' {…}' : '{…}';
|
|
39613
|
-
if (keys.length <= 5) {
|
|
39614
|
-
preview = name ? name + ' {' : '{';
|
|
39615
|
-
preview += keys.slice(0, 5).map(function(k) { return k + ': …' }).join(', ');
|
|
39616
|
-
preview += '}';
|
|
39617
|
-
}
|
|
39618
|
-
return { t: 'object', p: preview, e: entries };
|
|
39619
|
-
}
|
|
39620
|
-
return { t: 'string', p: String(v) };
|
|
39621
|
-
}
|
|
39622
|
-
|
|
39623
|
-
const _post = (type, args) => {
|
|
39624
|
-
window.parent.postMessage({ __jsRunner: true, type, args: args.map(a => _ser(a)) }, '*');
|
|
39625
|
-
};
|
|
39626
|
-
console.log = (...a) => _post('log', a);
|
|
39627
|
-
console.warn = (...a) => _post('warn', a);
|
|
39628
|
-
console.error = (...a) => _post('error', a);
|
|
39629
|
-
console.info = (...a) => _post('info', a);
|
|
39630
|
-
|
|
39631
|
-
window.onerror = (msg, src, line, col, err) => {
|
|
39632
|
-
_post('error', [err || msg]);
|
|
39633
|
-
};
|
|
39634
|
-
window.onunhandledrejection = (e) => {
|
|
39635
|
-
_post('error', [e.reason || 'Unhandled Promise Rejection']);
|
|
39636
|
-
};
|
|
39637
|
-
|
|
39638
|
-
try {
|
|
39639
|
-
${userCode}
|
|
39640
|
-
} catch(e) {
|
|
39641
|
-
_post('error', [e]);
|
|
39642
|
-
}
|
|
39643
|
-
|
|
39644
|
-
window.parent.postMessage({ __jsRunner: true, type: '__done' }, '*');
|
|
39645
|
-
<\/script></body></html>`;
|
|
39646
|
-
const handler = (e) => {
|
|
39647
|
-
var _a4;
|
|
39648
|
-
if ((_a4 = e.data) == null ? void 0 : _a4.__jsRunner) {
|
|
39649
|
-
if (e.data.type === "__done") {
|
|
39650
|
-
running.value = false;
|
|
39651
|
-
window.removeEventListener("message", handler);
|
|
39652
|
-
iframe == null ? void 0 : iframe.remove();
|
|
39653
|
-
return;
|
|
39654
|
-
}
|
|
39655
|
-
logs.value.push({
|
|
39656
|
-
type: e.data.type,
|
|
39657
|
-
args: e.data.args || [],
|
|
39658
|
-
timestamp: now()
|
|
39659
|
-
});
|
|
39660
|
-
scrollToBottom();
|
|
39661
|
-
}
|
|
39619
|
+
const pushLog = (type, ...args) => {
|
|
39620
|
+
logs.value.push({ type, args: args.map((a3) => serialize(a3)), timestamp: now() });
|
|
39621
|
+
scrollToBottom();
|
|
39662
39622
|
};
|
|
39663
|
-
|
|
39664
|
-
|
|
39665
|
-
|
|
39666
|
-
|
|
39667
|
-
|
|
39668
|
-
|
|
39669
|
-
|
|
39670
|
-
|
|
39671
|
-
|
|
39672
|
-
|
|
39673
|
-
|
|
39674
|
-
|
|
39675
|
-
|
|
39623
|
+
const sandboxConsole = {
|
|
39624
|
+
log: (...a3) => pushLog("log", ...a3),
|
|
39625
|
+
warn: (...a3) => pushLog("warn", ...a3),
|
|
39626
|
+
error: (...a3) => pushLog("error", ...a3),
|
|
39627
|
+
info: (...a3) => pushLog("info", ...a3)
|
|
39628
|
+
};
|
|
39629
|
+
let timer = null;
|
|
39630
|
+
let timedOut = false;
|
|
39631
|
+
try {
|
|
39632
|
+
const timeoutPromise = new Promise((_2, reject) => {
|
|
39633
|
+
timer = setTimeout(() => {
|
|
39634
|
+
timedOut = true;
|
|
39635
|
+
reject(new Error("⏱ 执行超时(10秒)"));
|
|
39636
|
+
}, 1e4);
|
|
39637
|
+
});
|
|
39638
|
+
const AsyncFunction = Object.getPrototypeOf(async function() {
|
|
39639
|
+
}).constructor;
|
|
39640
|
+
const fn2 = new AsyncFunction("console", userCode);
|
|
39641
|
+
await Promise.race([fn2(sandboxConsole), timeoutPromise]);
|
|
39642
|
+
} catch (e) {
|
|
39643
|
+
if (timedOut) {
|
|
39644
|
+
pushLog("error", "⏱ 执行超时(10秒)");
|
|
39645
|
+
} else {
|
|
39646
|
+
pushLog("error", e);
|
|
39676
39647
|
}
|
|
39677
|
-
}
|
|
39648
|
+
} finally {
|
|
39649
|
+
if (timer) clearTimeout(timer);
|
|
39650
|
+
running.value = false;
|
|
39651
|
+
}
|
|
39678
39652
|
}
|
|
39679
39653
|
const logStyles = {
|
|
39680
39654
|
log: "text-gray-200",
|
package/dist/translator.mjs
CHANGED
|
@@ -28,27 +28,32 @@ const _hoisted_14 = {
|
|
|
28
28
|
};
|
|
29
29
|
const _hoisted_15 = { class: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-4 min-h-0" };
|
|
30
30
|
const _hoisted_16 = { class: "flex flex-col min-h-0" };
|
|
31
|
-
const _hoisted_17 =
|
|
32
|
-
const _hoisted_18 = { class: "flex
|
|
33
|
-
const _hoisted_19 = { class: "
|
|
34
|
-
const _hoisted_20 = { class: "
|
|
35
|
-
const _hoisted_21 = {
|
|
31
|
+
const _hoisted_17 = ["placeholder"];
|
|
32
|
+
const _hoisted_18 = { class: "flex flex-col min-h-0" };
|
|
33
|
+
const _hoisted_19 = { class: "flex items-center gap-2 mb-2" };
|
|
34
|
+
const _hoisted_20 = { class: "material-icons text-sm" };
|
|
35
|
+
const _hoisted_21 = { class: "flex-1 w-full bg-deep-charcoal border-4 border-black rounded-xl p-4 overflow-auto shadow-hard min-h-[200px] text-sm leading-relaxed flex flex-col" };
|
|
36
|
+
const _hoisted_22 = {
|
|
36
37
|
key: 0,
|
|
37
|
-
class: "text-gray-
|
|
38
|
+
class: "text-gray-400 flex items-center gap-2"
|
|
38
39
|
};
|
|
39
|
-
const
|
|
40
|
+
const _hoisted_23 = {
|
|
40
41
|
key: 1,
|
|
42
|
+
class: "text-gray-600"
|
|
43
|
+
};
|
|
44
|
+
const _hoisted_24 = {
|
|
45
|
+
key: 2,
|
|
41
46
|
class: "text-gray-100 whitespace-pre-wrap"
|
|
42
47
|
};
|
|
43
|
-
const
|
|
48
|
+
const _hoisted_25 = {
|
|
44
49
|
key: 0,
|
|
45
50
|
class: "fixed inset-0 z-50 flex items-center justify-center"
|
|
46
51
|
};
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
+
const _hoisted_26 = { class: "relative w-full max-w-lg bg-deep-charcoal border-4 border-black rounded-xl shadow-hard-xl p-6 flex flex-col gap-4" };
|
|
53
|
+
const _hoisted_27 = { class: "flex items-center gap-2" };
|
|
54
|
+
const _hoisted_28 = { class: "flex flex-col gap-1.5" };
|
|
55
|
+
const _hoisted_29 = { class: "flex flex-col gap-1.5" };
|
|
56
|
+
const _hoisted_30 = { class: "flex justify-end gap-3 mt-1" };
|
|
52
57
|
const GOOGLE_KEY = "translator-google-api-key";
|
|
53
58
|
const AI_KEY = "translator-ai-api-key";
|
|
54
59
|
const AI_MODEL_KEY = "translator-ai-model";
|
|
@@ -250,6 +255,48 @@ ${sourceText.value}`;
|
|
|
250
255
|
copySuccess.value = false;
|
|
251
256
|
}, 1500);
|
|
252
257
|
}
|
|
258
|
+
function detectAndSwitchTarget(text) {
|
|
259
|
+
if (sourceLang.value !== "auto") return;
|
|
260
|
+
const stripped = text.replace(/\s+/g, "");
|
|
261
|
+
if (!stripped) return;
|
|
262
|
+
const cjkCount = (stripped.match(/[\u4e00-\u9fff]/g) || []).length;
|
|
263
|
+
const ratio = cjkCount / stripped.length;
|
|
264
|
+
const newTarget = ratio > 0.3 ? "en" : "zh-CN";
|
|
265
|
+
if (targetLang.value !== newTarget) targetLang.value = newTarget;
|
|
266
|
+
}
|
|
267
|
+
let googleDebounceTimer = null;
|
|
268
|
+
function triggerGoogleAuto() {
|
|
269
|
+
if (engine.value !== "google") return;
|
|
270
|
+
if (googleDebounceTimer) clearTimeout(googleDebounceTimer);
|
|
271
|
+
if (!sourceText.value.trim()) {
|
|
272
|
+
translatedText.value = "";
|
|
273
|
+
loading.value = false;
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
loading.value = true;
|
|
277
|
+
translatedText.value = "";
|
|
278
|
+
errorMsg.value = "";
|
|
279
|
+
googleDebounceTimer = setTimeout(async () => {
|
|
280
|
+
try {
|
|
281
|
+
await translateGoogle();
|
|
282
|
+
} catch (e) {
|
|
283
|
+
errorMsg.value = e.message || "翻译失败";
|
|
284
|
+
} finally {
|
|
285
|
+
loading.value = false;
|
|
286
|
+
}
|
|
287
|
+
}, 500);
|
|
288
|
+
}
|
|
289
|
+
watch(sourceText, (val) => {
|
|
290
|
+
detectAndSwitchTarget(val);
|
|
291
|
+
triggerGoogleAuto();
|
|
292
|
+
});
|
|
293
|
+
watch([sourceLang, targetLang], () => triggerGoogleAuto());
|
|
294
|
+
function onTextareaKeydown(e) {
|
|
295
|
+
if (engine.value === "ai" && e.key === "Enter" && !e.shiftKey) {
|
|
296
|
+
e.preventDefault();
|
|
297
|
+
translate();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
253
300
|
return (_ctx, _cache) => {
|
|
254
301
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
255
302
|
createCommentVNode(" Toolbar "),
|
|
@@ -486,24 +533,19 @@ ${sourceText.value}`;
|
|
|
486
533
|
-1
|
|
487
534
|
/* CACHED */
|
|
488
535
|
)),
|
|
489
|
-
withDirectives(createElementVNode(
|
|
490
|
-
"
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
},
|
|
497
|
-
null,
|
|
498
|
-
512
|
|
499
|
-
/* NEED_PATCH */
|
|
500
|
-
), [
|
|
536
|
+
withDirectives(createElementVNode("textarea", {
|
|
537
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => sourceText.value = $event),
|
|
538
|
+
spellcheck: "false",
|
|
539
|
+
placeholder: engine.value === "google" ? "输入文本自动翻译..." : "在此输入要翻译的文本...\nEnter 翻译 / Shift+Enter 换行",
|
|
540
|
+
class: "flex-1 w-full bg-deep-charcoal text-gray-100 border-4 border-black rounded-xl p-4 font-mono text-sm leading-relaxed resize-none shadow-hard focus:border-primary focus:shadow-none focus:translate-x-[4px] focus:translate-y-[4px] transition-all outline-none placeholder-gray-600 min-h-[200px]",
|
|
541
|
+
onKeydown: onTextareaKeydown
|
|
542
|
+
}, null, 40, _hoisted_17), [
|
|
501
543
|
[vModelText, sourceText.value]
|
|
502
544
|
])
|
|
503
545
|
]),
|
|
504
546
|
createCommentVNode(" 翻译结果 "),
|
|
505
|
-
createElementVNode("div",
|
|
506
|
-
createElementVNode("div",
|
|
547
|
+
createElementVNode("div", _hoisted_18, [
|
|
548
|
+
createElementVNode("div", _hoisted_19, [
|
|
507
549
|
_cache[18] || (_cache[18] = createElementVNode(
|
|
508
550
|
"span",
|
|
509
551
|
{ class: "material-icons text-neon-green text-lg" },
|
|
@@ -528,7 +570,7 @@ ${sourceText.value}`;
|
|
|
528
570
|
[
|
|
529
571
|
createElementVNode(
|
|
530
572
|
"span",
|
|
531
|
-
|
|
573
|
+
_hoisted_20,
|
|
532
574
|
toDisplayString(copySuccess.value ? "check_circle" : "content_copy"),
|
|
533
575
|
1
|
|
534
576
|
/* TEXT */
|
|
@@ -543,10 +585,23 @@ ${sourceText.value}`;
|
|
|
543
585
|
/* CLASS */
|
|
544
586
|
)) : createCommentVNode("v-if", true)
|
|
545
587
|
]),
|
|
546
|
-
createElementVNode("div",
|
|
547
|
-
|
|
588
|
+
createElementVNode("div", _hoisted_21, [
|
|
589
|
+
loading.value && engine.value === "google" ? (openBlock(), createElementBlock("div", _hoisted_22, [..._cache[20] || (_cache[20] = [
|
|
590
|
+
createElementVNode(
|
|
591
|
+
"span",
|
|
592
|
+
{ class: "material-icons text-primary text-base animate-spin" },
|
|
593
|
+
"hourglass_top",
|
|
594
|
+
-1
|
|
595
|
+
/* CACHED */
|
|
596
|
+
),
|
|
597
|
+
createTextVNode(
|
|
598
|
+
" 翻译中... ",
|
|
599
|
+
-1
|
|
600
|
+
/* CACHED */
|
|
601
|
+
)
|
|
602
|
+
])])) : !translatedText.value ? (openBlock(), createElementBlock("div", _hoisted_23, " 翻译结果将显示在这里... ")) : (openBlock(), createElementBlock(
|
|
548
603
|
"div",
|
|
549
|
-
|
|
604
|
+
_hoisted_24,
|
|
550
605
|
toDisplayString(translatedText.value),
|
|
551
606
|
1
|
|
552
607
|
/* TEXT */
|
|
@@ -556,21 +611,21 @@ ${sourceText.value}`;
|
|
|
556
611
|
]),
|
|
557
612
|
createCommentVNode(" API Key 设置弹窗 "),
|
|
558
613
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
559
|
-
showSettings.value ? (openBlock(), createElementBlock("div",
|
|
614
|
+
showSettings.value ? (openBlock(), createElementBlock("div", _hoisted_25, [
|
|
560
615
|
createElementVNode("div", {
|
|
561
616
|
class: "absolute inset-0 bg-black/60",
|
|
562
617
|
onClick: _cache[6] || (_cache[6] = ($event) => showSettings.value = false)
|
|
563
618
|
}),
|
|
564
|
-
createElementVNode("div",
|
|
565
|
-
createElementVNode("div",
|
|
566
|
-
_cache[
|
|
619
|
+
createElementVNode("div", _hoisted_26, [
|
|
620
|
+
createElementVNode("div", _hoisted_27, [
|
|
621
|
+
_cache[22] || (_cache[22] = createElementVNode(
|
|
567
622
|
"span",
|
|
568
623
|
{ class: "material-icons text-primary text-xl" },
|
|
569
624
|
"key",
|
|
570
625
|
-1
|
|
571
626
|
/* CACHED */
|
|
572
627
|
)),
|
|
573
|
-
_cache[
|
|
628
|
+
_cache[23] || (_cache[23] = createElementVNode(
|
|
574
629
|
"span",
|
|
575
630
|
{ class: "text-lg font-bold text-white" },
|
|
576
631
|
"配置 API Key",
|
|
@@ -580,7 +635,7 @@ ${sourceText.value}`;
|
|
|
580
635
|
createElementVNode("button", {
|
|
581
636
|
class: "ml-auto w-8 h-8 flex items-center justify-center text-gray-400 hover:text-white transition-colors",
|
|
582
637
|
onClick: _cache[7] || (_cache[7] = ($event) => showSettings.value = false)
|
|
583
|
-
}, [..._cache[
|
|
638
|
+
}, [..._cache[21] || (_cache[21] = [
|
|
584
639
|
createElementVNode(
|
|
585
640
|
"span",
|
|
586
641
|
{ class: "material-icons" },
|
|
@@ -591,8 +646,8 @@ ${sourceText.value}`;
|
|
|
591
646
|
])])
|
|
592
647
|
]),
|
|
593
648
|
createCommentVNode(" Google API Key "),
|
|
594
|
-
createElementVNode("div",
|
|
595
|
-
_cache[
|
|
649
|
+
createElementVNode("div", _hoisted_28, [
|
|
650
|
+
_cache[24] || (_cache[24] = createElementVNode(
|
|
596
651
|
"label",
|
|
597
652
|
{ class: "text-xs font-bold text-gray-400 uppercase tracking-wider" },
|
|
598
653
|
"Google Translation API Key",
|
|
@@ -615,8 +670,8 @@ ${sourceText.value}`;
|
|
|
615
670
|
])
|
|
616
671
|
]),
|
|
617
672
|
createCommentVNode(" SiliconFlow API Key "),
|
|
618
|
-
createElementVNode("div",
|
|
619
|
-
_cache[
|
|
673
|
+
createElementVNode("div", _hoisted_29, [
|
|
674
|
+
_cache[25] || (_cache[25] = createElementVNode(
|
|
620
675
|
"label",
|
|
621
676
|
{ class: "text-xs font-bold text-gray-400 uppercase tracking-wider" },
|
|
622
677
|
"SiliconFlow API Key(AI 翻译)",
|
|
@@ -637,7 +692,7 @@ ${sourceText.value}`;
|
|
|
637
692
|
), [
|
|
638
693
|
[vModelText, aiKeyInput.value]
|
|
639
694
|
]),
|
|
640
|
-
_cache[
|
|
695
|
+
_cache[26] || (_cache[26] = createElementVNode(
|
|
641
696
|
"p",
|
|
642
697
|
{ class: "text-[11px] text-gray-600" },
|
|
643
698
|
"密钥从 cloud.siliconflow.cn 获取,保存后可在工具栏选择模型",
|
|
@@ -645,7 +700,7 @@ ${sourceText.value}`;
|
|
|
645
700
|
/* CACHED */
|
|
646
701
|
))
|
|
647
702
|
]),
|
|
648
|
-
createElementVNode("div",
|
|
703
|
+
createElementVNode("div", _hoisted_30, [
|
|
649
704
|
createElementVNode("button", {
|
|
650
705
|
class: "px-4 py-2 bg-white/10 text-gray-300 font-bold border-2 border-white/20 rounded hover:border-white hover:text-white transition-all text-sm",
|
|
651
706
|
onClick: _cache[10] || (_cache[10] = ($event) => showSettings.value = false)
|