@veltra/desktop 1.2.17 → 1.2.18
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/action/action-group.vue.d.ts +2 -2
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +1 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +2 -2
- package/dist/components/cascade/cascade.vue.d.ts +7 -7
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
- package/dist/components/code-editor/basic-setup.js +1 -1
- package/dist/components/code-editor/code-editor.js +13 -8
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
- package/dist/components/empty/empty.vue.d.ts +1 -1
- package/dist/components/input/input.vue.d.ts +3 -3
- package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +6 -6
- package/dist/components/number-input/number-input.vue.d.ts +3 -3
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/progress-nodes/progress-nodes.vue.d.ts +1 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/steps/steps.vue.d.ts +2 -2
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +1 -1
- package/dist/components/tabs/tabs.vue.d.ts +1 -1
- package/dist/components/textarea/textarea.vue.d.ts +3 -3
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree/tree.vue.d.ts +2 -2
- package/dist/components/tree-select/tree-select.vue.d.ts +5 -5
- package/dist/components/watermark/watermark.vue.d.ts +1 -1
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_commands@6.10.4/node_modules/@codemirror/commands/dist/index.js +2 -2
- 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-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +3 -3
- 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_language@6.12.4/node_modules/@codemirror/language/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.4/node_modules/@codemirror/view/dist/index.js +915 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.4/node_modules/@codemirror/view/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_java@1.1.3/node_modules/@lezer/java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/components/code-editor/code-editor.vue +12 -7
- package/dist/node_modules/.bun/@codemirror_view@6.43.3/node_modules/@codemirror/view/dist/index.js +0 -8862
- package/dist/node_modules/.bun/@codemirror_view@6.43.3/node_modules/@codemirror/view/dist/index.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { LRParser } from "../../../../../@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
//#region ../../node_modules/.bun/@lezer+java@1.1.3/node_modules/@lezer/java/dist/index.js
|
|
4
4
|
const javaHighlighting = styleTags({
|
|
5
5
|
null: tags.null,
|
package/dist/node_modules/.bun/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { ContextTracker, ExternalTokenizer, LRParser, LocalTokenGroup } from "../../../../../@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
//#region ../../node_modules/.bun/@lezer+javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js
|
|
4
4
|
const noSemi = 316, noSemiType = 317, incdec = 1, incdecPrefix = 2, questionDot = 3, JSXStartTag = 4, insertSemi = 318, spaces = 320, newline = 321, LineComment = 5, BlockComment = 6, Dialect_jsx = 0;
|
|
5
5
|
const space = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { LRParser } from "../../../../../@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
//#region ../../node_modules/.bun/@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js
|
|
4
4
|
const jsonHighlighting = styleTags({
|
|
5
5
|
String: tags.string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/desktop",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src"
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"@cat-kit/core": ">=1.1.8",
|
|
58
58
|
"@cat-kit/excel": ">=1.0.0",
|
|
59
59
|
"@cat-kit/fe": "^1.1.8",
|
|
60
|
-
"@veltra/compositions": "1.2.
|
|
61
|
-
"@veltra/directives": "1.2.
|
|
62
|
-
"@veltra/icons": "1.2.
|
|
63
|
-
"@veltra/styles": "1.2.
|
|
64
|
-
"@veltra/utils": "1.2.
|
|
60
|
+
"@veltra/compositions": "1.2.18",
|
|
61
|
+
"@veltra/directives": "1.2.18",
|
|
62
|
+
"@veltra/icons": "1.2.18",
|
|
63
|
+
"@veltra/styles": "1.2.18",
|
|
64
|
+
"@veltra/utils": "1.2.18",
|
|
65
65
|
"vue": ">=3.5.39"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
+
import { java } from '@codemirror/lang-java'
|
|
9
|
+
import { javascript } from '@codemirror/lang-javascript'
|
|
10
|
+
import { json } from '@codemirror/lang-json'
|
|
11
|
+
import { sql } from '@codemirror/lang-sql'
|
|
8
12
|
import { Compartment, EditorState, type Extension } from '@codemirror/state'
|
|
9
13
|
import { oneDark } from '@codemirror/theme-one-dark'
|
|
10
14
|
import { EditorView, ViewPlugin, tooltips, type ViewUpdate } from '@codemirror/view'
|
|
@@ -58,11 +62,12 @@ const rootStyle = computed<CSSProperties>(() => ({
|
|
|
58
62
|
const containerRef = useTemplateRef('container')
|
|
59
63
|
const editor = shallowRef<EditorView | null>(null)
|
|
60
64
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
/** 静态导入语言包,避免动态 import 在打包/Vite 预构建下产生多份 @codemirror/* 实例 */
|
|
66
|
+
const langExtensions: Record<CodeEditorLang, Extension> = {
|
|
67
|
+
js: javascript({ typescript: true }),
|
|
68
|
+
sql: sql(),
|
|
69
|
+
java: java(),
|
|
70
|
+
json: json()
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
const themeCompartment = new Compartment()
|
|
@@ -156,12 +161,12 @@ function buildExtensions(): Extension[] {
|
|
|
156
161
|
let editorToken = 0
|
|
157
162
|
let langToken = 0
|
|
158
163
|
|
|
159
|
-
|
|
164
|
+
function applyLanguage() {
|
|
160
165
|
const view = editor.value
|
|
161
166
|
if (!view) return
|
|
162
167
|
const myToken = ++langToken
|
|
163
168
|
const { language } = props
|
|
164
|
-
const ext = language ?
|
|
169
|
+
const ext = language ? langExtensions[language] : []
|
|
165
170
|
if (myToken !== langToken || editor.value !== view) return
|
|
166
171
|
view.dispatch({ effects: langCompartment.reconfigure(ext) })
|
|
167
172
|
}
|