@veltra/desktop 1.10.0 → 1.11.0
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/components/ai-button/ai-button.js +117 -0
- package/dist/components/ai-button/ai-button.js.map +1 -0
- package/dist/components/ai-button/style.d.ts +1 -0
- package/dist/components/ai-button/style.js +3 -0
- package/dist/components/ai-button/style2.css +29 -0
- package/dist/components/code-editor/basic-setup.js +5 -5
- package/dist/components/code-editor/code-editor.js +2 -2
- package/dist/components/code-editor/langs/bash/index.js +2 -2
- package/dist/components/code-editor/langs/powershell/index.js +2 -2
- package/dist/components/code-editor/langs/spel/index.js +1 -1
- package/dist/components/code-editor/langs/spel/language.js +1 -1
- package/dist/components/code-editor/shell-extension.js +2 -2
- package/dist/components/file-viewer/previewers/pdf-worker-wrapper.js.map +1 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js +5 -5
- package/dist/components/file-viewer/previewers/sheet-previewer.js.map +1 -1
- package/dist/components/file-viewer/style2.css +42 -176
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +108 -106
- package/dist/index.js +107 -106
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_commands@6.11.0 → @codemirror_commands@6.11.1}/node_modules/@codemirror/commands/dist/index.js +6 -6
- package/dist/node_modules/.bun/@codemirror_commands@6.11.1/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_language@6.12.4 → @codemirror_language@6.13.1}/node_modules/@codemirror/language/dist/index.js +5 -168
- package/dist/node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_search@6.7.1 → @codemirror_search@6.7.2}/node_modules/@codemirror/search/dist/index.js +10 -3
- package/dist/node_modules/.bun/@codemirror_search@6.7.2/node_modules/@codemirror/search/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_state@6.7.1 → @codemirror_state@6.7.6}/node_modules/@codemirror/state/dist/index.js +50 -16
- package/dist/node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js +169 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_view@6.43.9 → @codemirror_view@6.43.14}/node_modules/@codemirror/view/dist/index.js +159 -93
- package/dist/node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@lezer_common@1.5.3/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_css@1.3.9/node_modules/@lezer/css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_java@1.1.5/node_modules/@lezer/java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_markdown@1.8.0/node_modules/@lezer/markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@marijn_find-cluster-break@1.0.4/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -1
- package/dist/node_modules/.bun/crelt@1.0.7/node_modules/crelt/index.js.map +1 -1
- package/dist/node_modules/.bun/style-mod@4.1.4/node_modules/style-mod/src/style-mod.js.map +1 -1
- package/dist/node_modules/.bun/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js.map +1 -1
- package/dist/types/ai-button.d.ts +42 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +16 -16
- package/src/components/ai-button/__test__/ai-button.test.ts +375 -0
- package/src/components/ai-button/ai-button.vue +87 -0
- package/src/components/ai-button/index.ts +1 -0
- package/src/components/ai-button/style.scss +19 -0
- package/src/components/ai-button/style.ts +3 -0
- package/src/components/file-viewer/previewers/sheet-previewer.vue +1 -1
- package/src/components/file-viewer/style.scss +52 -233
- package/src/components/index.ts +2 -0
- package/src/types/ai-button.ts +44 -0
- package/src/types/index.ts +2 -0
- package/dist/node_modules/.bun/@codemirror_commands@6.11.0/node_modules/@codemirror/commands/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_state@6.7.1/node_modules/@codemirror/state/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.9/node_modules/@codemirror/view/dist/index.js.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _sfc_main$1 from "../tip/tip.js";
|
|
2
|
+
import _sfc_main$2 from "../button/button.js";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderSlot, unref, withCtx } from "vue";
|
|
4
|
+
import { useConfig } from "@veltra/compositions";
|
|
5
|
+
import { bem, requestAiText } from "@veltra/utils";
|
|
6
|
+
import { Sparkles } from "@veltra/icons";
|
|
7
|
+
//#region src/components/ai-button/ai-button.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "UAiButton",
|
|
10
|
+
__name: "ai-button",
|
|
11
|
+
props: {
|
|
12
|
+
provider: {},
|
|
13
|
+
systemPrompt: {},
|
|
14
|
+
prompt: {},
|
|
15
|
+
variant: { default: "default" },
|
|
16
|
+
size: {}
|
|
17
|
+
},
|
|
18
|
+
emits: [
|
|
19
|
+
"success",
|
|
20
|
+
"error",
|
|
21
|
+
"delta",
|
|
22
|
+
"confirm",
|
|
23
|
+
"cancel"
|
|
24
|
+
],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const cls = bem("ai-button");
|
|
28
|
+
const { config } = useConfig();
|
|
29
|
+
/** 配置优先级:实例 provider 字段 > 全局 ai 字段 > 默认值(stream 缺省 false) */
|
|
30
|
+
const requestConfig = computed(() => ({
|
|
31
|
+
stream: false,
|
|
32
|
+
...config.ai,
|
|
33
|
+
...__props.provider
|
|
34
|
+
}));
|
|
35
|
+
/** 生成中:按钮 loading 转圈并禁用 */
|
|
36
|
+
const loading = ref(false);
|
|
37
|
+
/** 发起请求;生成中忽略重复触发 */
|
|
38
|
+
function send() {
|
|
39
|
+
if (loading.value) return;
|
|
40
|
+
loading.value = true;
|
|
41
|
+
requestAiText({
|
|
42
|
+
config: requestConfig.value,
|
|
43
|
+
prompt: __props.prompt ?? "",
|
|
44
|
+
systemPrompt: __props.systemPrompt,
|
|
45
|
+
onDelta: (chunk) => emit("delta", chunk),
|
|
46
|
+
onSuccess: (text) => emit("success", text),
|
|
47
|
+
onError: (error) => emit("error", error)
|
|
48
|
+
}).finally(() => {
|
|
49
|
+
loading.value = false;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** pre-input 气泡可见性 */
|
|
53
|
+
const visible = ref(false);
|
|
54
|
+
function confirm() {
|
|
55
|
+
emit("confirm");
|
|
56
|
+
visible.value = false;
|
|
57
|
+
send();
|
|
58
|
+
}
|
|
59
|
+
function cancel() {
|
|
60
|
+
emit("cancel");
|
|
61
|
+
visible.value = false;
|
|
62
|
+
}
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" pre-input 变体:先经气泡收集补充输入,确认后再发请求 "), __props.variant === "pre-input" ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
65
|
+
key: 0,
|
|
66
|
+
trigger: "click",
|
|
67
|
+
direction: "bottom",
|
|
68
|
+
visible: visible.value,
|
|
69
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
|
|
70
|
+
}, {
|
|
71
|
+
content: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cls).e("main")) }, [renderSlot(_ctx.$slots, "pre-input")], 2), createElementVNode("div", { class: normalizeClass(unref(cls).e("action")) }, [createVNode(unref(_sfc_main$2), {
|
|
72
|
+
size: "small",
|
|
73
|
+
type: "primary",
|
|
74
|
+
text: "",
|
|
75
|
+
onClick: cancel
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" 取消 ", -1)])]),
|
|
78
|
+
_: 1
|
|
79
|
+
}), createVNode(unref(_sfc_main$2), {
|
|
80
|
+
size: "small",
|
|
81
|
+
type: "primary",
|
|
82
|
+
onClick: confirm
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 确认 ", -1)])]),
|
|
85
|
+
_: 1
|
|
86
|
+
})], 2)]),
|
|
87
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$2), {
|
|
88
|
+
class: normalizeClass(unref(cls).b),
|
|
89
|
+
size: __props.size,
|
|
90
|
+
icon: unref(Sparkles),
|
|
91
|
+
loading: loading.value
|
|
92
|
+
}, null, 8, [
|
|
93
|
+
"class",
|
|
94
|
+
"size",
|
|
95
|
+
"icon",
|
|
96
|
+
"loading"
|
|
97
|
+
])]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["visible"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 普通变体:点击即发 "), createVNode(unref(_sfc_main$2), {
|
|
100
|
+
class: normalizeClass(unref(cls).b),
|
|
101
|
+
size: __props.size,
|
|
102
|
+
icon: unref(Sparkles),
|
|
103
|
+
loading: loading.value,
|
|
104
|
+
onClick: send
|
|
105
|
+
}, null, 8, [
|
|
106
|
+
"class",
|
|
107
|
+
"size",
|
|
108
|
+
"icon",
|
|
109
|
+
"loading"
|
|
110
|
+
])], 2112))], 2112);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//#endregion
|
|
115
|
+
export { _sfc_main as default };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=ai-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-button.js","names":["_openBlock","_createElementBlock","_Fragment","_createCommentVNode","_createBlock","_unref","UTip","_withCtx","_createElementVNode","_normalizeClass","_renderSlot","_createVNode","UButton","_createTextVNode"],"sources":["../../../src/components/ai-button/ai-button.vue"],"sourcesContent":["<template>\n <!-- pre-input 变体:先经气泡收集补充输入,确认后再发请求 -->\n <u-tip\n v-if=\"variant === 'pre-input'\"\n trigger=\"click\"\n direction=\"bottom\"\n v-model:visible=\"visible\"\n >\n <u-button :class=\"cls.b\" :size=\"size\" :icon=\"Sparkles\" :loading=\"loading\" />\n\n <template #content>\n <div :class=\"cls.e('main')\">\n <slot name=\"pre-input\" />\n </div>\n <div :class=\"cls.e('action')\">\n <u-button size=\"small\" type=\"primary\" text @click=\"cancel\"> 取消 </u-button>\n <u-button size=\"small\" type=\"primary\" @click=\"confirm\"> 确认 </u-button>\n </div>\n </template>\n </u-tip>\n\n <!-- 普通变体:点击即发 -->\n <u-button v-else :class=\"cls.b\" :size=\"size\" :icon=\"Sparkles\" :loading=\"loading\" @click=\"send\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { useConfig } from '@veltra/compositions'\nimport { Sparkles } from '@veltra/icons'\nimport { bem, requestAiText } from '@veltra/utils'\nimport type { AiProviderConfig } from '@veltra/utils'\nimport { computed, ref } from 'vue'\n\nimport type { AiButtonEmits, AiButtonProps } from '../../types'\nimport { UButton } from '../button'\nimport { UTip } from '../tip'\n\ndefineOptions({ name: 'UAiButton' })\n\nconst { provider, systemPrompt, prompt, variant = 'default', size } = defineProps<AiButtonProps>()\n\nconst emit = defineEmits<AiButtonEmits>()\n\nconst cls = bem('ai-button')\n\nconst { config } = useConfig()\n\n/** 配置优先级:实例 provider 字段 > 全局 ai 字段 > 默认值(stream 缺省 false) */\nconst requestConfig = computed<AiProviderConfig>(() => ({\n stream: false,\n ...config.ai,\n ...provider\n}))\n\n/** 生成中:按钮 loading 转圈并禁用 */\nconst loading = ref(false)\n\n/** 发起请求;生成中忽略重复触发 */\nfunction send() {\n if (loading.value) return\n loading.value = true\n\n requestAiText({\n config: requestConfig.value,\n prompt: prompt ?? '',\n systemPrompt,\n onDelta: (chunk) => emit('delta', chunk),\n onSuccess: (text) => emit('success', text),\n onError: (error) => emit('error', error)\n }).finally(() => {\n loading.value = false\n })\n}\n\n/** pre-input 气泡可见性 */\nconst visible = ref(false)\n\nfunction confirm() {\n emit('confirm')\n visible.value = false\n send()\n}\n\nfunction cancel() {\n emit('cancel')\n visible.value = false\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAwCA,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,WAAW;EAE3B,MAAM,EAAE,WAAW,UAAU;;EAG7B,MAAM,gBAAgB,gBAAkC;GACtD,QAAQ;GACR,GAAG,OAAO;GACV,GAAG,QAAA;EACL,EAAE;;EAGF,MAAM,UAAU,IAAI,KAAK;;EAGzB,SAAS,OAAO;GACd,IAAI,QAAQ,OAAO;GACnB,QAAQ,QAAQ;GAEhB,cAAc;IACZ,QAAQ,cAAc;IACtB,QAAQ,QAAA,UAAU;IAClB,cAAW,QAAA;IACX,UAAU,UAAU,KAAK,SAAS,KAAK;IACvC,YAAY,SAAS,KAAK,WAAW,IAAI;IACzC,UAAU,UAAU,KAAK,SAAS,KAAK;GACzC,CAAC,CAAC,CAAC,cAAc;IACf,QAAQ,QAAQ;GAClB,CAAC;EACH;;EAGA,MAAM,UAAU,IAAI,KAAK;EAEzB,SAAS,UAAU;GACjB,KAAK,SAAS;GACd,QAAQ,QAAQ;GAChB,KAAK;EACP;EAEA,SAAS,SAAS;GAChB,KAAK,QAAQ;GACb,QAAQ,QAAQ;EAClB;;GApFE,OAAA,UAAA,GAAA,mBAAA,UAAA,MAAA,CAAAG,mBAAA,mCAAA,GAEQ,QAAA,YAAO,eADfH,UAAA,GAAAI,YAiBQC,MAAAC,WAAA,GAAA;;IAfN,SAAQ;IACR,WAAU;IACF,SAAS,QAAA;IAAA,oBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,QAAO,QAAA;;IAIb,SAAOC,cAGV,CAFNC,mBAEM,OAAA,EAFA,OAAKC,eAAEJ,MAAA,GAAA,CAAG,CAAC,EAAC,MAAA,CAAA,EAAA,GAChB,CAAAK,WAAyB,KAAA,QAAA,WAAA,CAAA,GAAA,CAE3B,GAAAF,mBAGM,OAAA,EAHA,OAAKC,eAAEJ,MAAA,GAAA,CAAG,CAAC,EAAC,QAAA,CAAA,EAAA,GAChB,CAAAM,YAA0EN,MAAAO,WAAA,GAAA;KAAhE,MAAK;KAAQ,MAAK;KAAU,MAAA;KAAM,SAAO;;KAAQ,SAAAL,cAAI,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAJM,gBAAA,QAAI,EAAA,CAAA,EAAA,CAAA;;IAC/D,CAAA,GAAAF,YAAsEN,MAAAO,WAAA,GAAA;KAA5D,MAAK;KAAQ,MAAK;KAAW,SAAO;;KAAS,SAAAL,cAAI,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAJM,gBAAA,QAAI,EAAA,CAAA,EAAA,CAAA;;;IAR/D,SAAAN,cAA4E,CAA5EI,YAA4EN,MAAAO,WAAA,GAAA;KAAjE,OAAKH,eAAEJ,MAAA,GAAA,CAAG,CAAC,CAAC;KAAG,MAAM,QAAA;KAAO,MAAMA,MAAA,QAAA;KAAW,SAAS,QAAA;;;;;;;;GAcnE,GAAA,GAAA,CAAA,SAAA,CAAA,MAAAL,UAAA,GAAAC,mBAAiGC,UAAA,EAAA,KAAA,EAAA,GAAA,CADjGC,mBAAA,aAAA,GACAQ,YAAiGN,MAAAO,WAAA,GAAA;IAA/E,OAAKH,eAAEJ,MAAA,GAAA,CAAG,CAAC,CAAC;IAAG,MAAM,QAAA;IAAO,MAAMA,MAAA,QAAA;IAAW,SAAS,QAAA;IAAU,SAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../button/style.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/** flex布局 */
|
|
3
|
+
/**
|
|
4
|
+
* 设置css变量
|
|
5
|
+
* 参数1:变量前缀
|
|
6
|
+
* 参数2: 一个由值组成的列表或者由key, value组成的map
|
|
7
|
+
* css-var(height, (
|
|
8
|
+
* large: 40px
|
|
9
|
+
* default: 32px
|
|
10
|
+
* small: 24px
|
|
11
|
+
* ))
|
|
12
|
+
* 生成的css变量:
|
|
13
|
+
* --u-height-large: 40px;
|
|
14
|
+
* --u-height-default: 32px;
|
|
15
|
+
* --u-height-small: 24px;
|
|
16
|
+
*/
|
|
17
|
+
/** 暗色:`UITheme.render()` 按主题系列写入 html[data-theme] */
|
|
18
|
+
.u-ai-button__main {
|
|
19
|
+
max-width: 280px;
|
|
20
|
+
width: max-content;
|
|
21
|
+
}
|
|
22
|
+
.u-ai-button__action {
|
|
23
|
+
margin-top: var(--u-gap-default);
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: flex-end;
|
|
26
|
+
align-items: center;
|
|
27
|
+
flex-wrap: nowrap;
|
|
28
|
+
gap: var(--u-gap-small);
|
|
29
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EditorState } from "../../node_modules/.bun/@codemirror_state@6.7.
|
|
2
|
-
import { crosshairCursor, drawSelection, dropCursor, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, rectangularSelection } from "../../node_modules/.bun/@codemirror_view@6.43.
|
|
3
|
-
import { bracketMatching, defaultHighlightStyle, foldGutter, foldKeymap, indentOnInput, syntaxHighlighting } from "../../node_modules/.bun/@codemirror_language@6.
|
|
1
|
+
import { EditorState } from "../../node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js";
|
|
2
|
+
import { crosshairCursor, drawSelection, dropCursor, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, rectangularSelection } from "../../node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
3
|
+
import { bracketMatching, defaultHighlightStyle, foldGutter, foldKeymap, indentOnInput, syntaxHighlighting } from "../../node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
4
4
|
import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap } from "../../node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js";
|
|
5
|
-
import { defaultKeymap, history, historyKeymap, indentWithTab } from "../../node_modules/.bun/@codemirror_commands@6.11.
|
|
5
|
+
import { defaultKeymap, history, historyKeymap, indentWithTab } from "../../node_modules/.bun/@codemirror_commands@6.11.1/node_modules/@codemirror/commands/dist/index.js";
|
|
6
6
|
import { lintKeymap } from "../../node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js";
|
|
7
|
-
import { highlightSelectionMatches, searchKeymap } from "../../node_modules/.bun/@codemirror_search@6.7.
|
|
7
|
+
import { highlightSelectionMatches, searchKeymap } from "../../node_modules/.bun/@codemirror_search@6.7.2/node_modules/@codemirror/search/dist/index.js";
|
|
8
8
|
//#region src/components/code-editor/basic-setup.ts
|
|
9
9
|
/**
|
|
10
10
|
* 等价于 codemirror 包的 basicSetup,按官方建议内联以便统一依赖来源。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _sfc_main$1 from "../icon/icon.js";
|
|
2
2
|
import _sfc_main$2 from "../scroll/scroll.js";
|
|
3
3
|
import _sfc_main$3 from "../select/select.js";
|
|
4
|
-
import { Compartment, EditorState } from "../../node_modules/.bun/@codemirror_state@6.7.
|
|
5
|
-
import { EditorView, tooltips } from "../../node_modules/.bun/@codemirror_view@6.43.
|
|
4
|
+
import { Compartment, EditorState } from "../../node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js";
|
|
5
|
+
import { EditorView, tooltips } from "../../node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
6
6
|
import { oneDark } from "../../node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js";
|
|
7
7
|
import { basicSetup } from "./basic-setup.js";
|
|
8
8
|
import { loadLanguage } from "./lang-loaders.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.
|
|
2
|
-
import { shell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.
|
|
1
|
+
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
2
|
+
import { shell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.5/node_modules/@codemirror/legacy-modes/mode/shell.js";
|
|
3
3
|
//#region src/components/code-editor/langs/bash/index.ts
|
|
4
4
|
/** Bash / shell 脚本语言支持(基于 CodeMirror legacy shell mode) */
|
|
5
5
|
function bash() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.
|
|
2
|
-
import { powerShell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.
|
|
1
|
+
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
2
|
+
import { powerShell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.5/node_modules/@codemirror/legacy-modes/mode/powershell.js";
|
|
3
3
|
//#region src/components/code-editor/langs/powershell/index.ts
|
|
4
4
|
/** PowerShell 语言支持(基于 CodeMirror legacy powershell mode) */
|
|
5
5
|
function powershell() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageSupport } from "../../../../node_modules/.bun/@codemirror_language@6.
|
|
1
|
+
import { LanguageSupport } from "../../../../node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
2
2
|
import { spelCompletion } from "./completion.js";
|
|
3
3
|
import { spelLanguage } from "./language.js";
|
|
4
4
|
//#region src/components/code-editor/langs/spel/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.
|
|
1
|
+
import { StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
2
2
|
//#region src/components/code-editor/langs/spel/language.ts
|
|
3
3
|
const KEYWORDS = /* @__PURE__ */ new Set([
|
|
4
4
|
"new",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EditorSelection, EditorState, RangeSetBuilder, StateField } from "../../node_modules/.bun/@codemirror_state@6.7.
|
|
2
|
-
import { Decoration, EditorView } from "../../node_modules/.bun/@codemirror_view@6.43.
|
|
1
|
+
import { EditorSelection, EditorState, RangeSetBuilder, StateField } from "../../node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js";
|
|
2
|
+
import { Decoration, EditorView } from "../../node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
3
3
|
//#region src/components/code-editor/shell-extension.ts
|
|
4
4
|
/**
|
|
5
5
|
* 判断 Text 文档是否与外壳对齐。
|