@kernel4632/kima 0.8.2 → 0.8.4
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/content/code-editor.ce.vue_vue_type_style_index_0_scoped_233308e5_lang.css +1 -0
- package/dist/components/content/{rich-text-editor.ce.vue_vue_type_style_index_0_scoped_19796b0b_lang.css → rich-text-editor.ce.vue_vue_type_style_index_0_scoped_82e3193e_lang.css} +1 -1
- package/dist/components/core/code-block.ce.vue_vue_type_style_index_0_scoped_7e6342e8_lang.css +1 -0
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +1 -0
- package/dist/components/input/{file-upload.ce.vue_vue_type_style_index_0_scoped_17268263_lang.css → file-upload.ce.vue_vue_type_style_index_0_scoped_1568bdab_lang.css} +1 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +1 -0
- package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_37292ba0_lang.css +1 -0
- package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_f50127b6_lang.css +1 -0
- package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_f5be4658_lang.css +1 -0
- package/dist/kima-elements.js +46116 -45692
- package/dist/kima.js +114 -114
- package/dist/style.css +9 -9
- package/dist/styles/app-shell.css +3 -2
- package/dist/styles/carousel.css +4 -2
- package/dist/styles/code-block.css +4 -2
- package/dist/styles/code-editor.css +4 -2
- package/dist/styles/dynamic-input.css +4 -1
- package/dist/styles/file-upload.css +4 -2
- package/dist/styles/log-viewer.css +4 -2
- package/dist/styles/rich-text-editor.css +4 -1
- package/dist/styles/sidebar.css +4 -2
- package/dist/styles/upload-manager.css +4 -1
- package/dist/vue/components/content/code-editor.ce.js +98 -93
- package/dist/vue/components/content/rich-text-editor.ce.js +148 -121
- package/dist/vue/components/core/code-block.ce.js +72 -49
- package/dist/vue/components/form-completion/dynamic-input.ce.js +97 -91
- package/dist/vue/components/input/file-upload.ce.js +74 -68
- package/dist/vue/components/navigation/carousel.ce.js +71 -59
- package/dist/vue/components/shell/app-shell.ce.js +49 -38
- package/dist/vue/components/shell/sidebar.ce.js +63 -52
- package/dist/vue/components/utility/log-viewer.ce.js +81 -64
- package/package.json +1 -1
- package/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_a61ccf64_lang.css +0 -1
- package/dist/components/core/code-block.ce.vue_vue_type_style_index_0_scoped_6ddc49c8_lang.css +0 -1
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_97d6f5bf_lang.css +0 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_c082836f_lang.css +0 -1
- package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_abea9686_lang.css +0 -1
- package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_0fd95ccf_lang.css +0 -1
- package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_2bf26869_lang.css +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
@import "_tokens.css";
|
|
2
2
|
@import "../components/core/button.ce.vue_vue_type_style_index_0_scoped_ba403858_lang.css";
|
|
3
|
-
@import "../components/
|
|
3
|
+
@import "../components/core/icon.ce.vue_vue_type_style_index_0_scoped_5c94f2ca_lang.css";
|
|
4
|
+
@import "../components/core/icon-button.ce.vue_vue_type_style_index_0_scoped_a18b4478_lang.css";
|
|
5
|
+
@import "../components/core/tooltip.ce.vue_vue_type_style_index_0_scoped_2c931a6a_lang.css";
|
|
6
|
+
@import "../components/content/rich-text-editor.ce.vue_vue_type_style_index_0_scoped_82e3193e_lang.css";
|
package/dist/styles/sidebar.css
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@import "_tokens.css";
|
|
2
|
-
@import "../components/core/button.ce.vue_vue_type_style_index_0_scoped_ba403858_lang.css";
|
|
3
2
|
@import "../components/core/icon.ce.vue_vue_type_style_index_0_scoped_5c94f2ca_lang.css";
|
|
4
3
|
@import "../components/core/drawer.ce.vue_vue_type_style_index_0_scoped_a36af28b_lang.css";
|
|
4
|
+
@import "../components/core/icon-button.ce.vue_vue_type_style_index_0_scoped_a18b4478_lang.css";
|
|
5
|
+
@import "../components/core/tooltip.ce.vue_vue_type_style_index_0_scoped_2c931a6a_lang.css";
|
|
6
|
+
@import "../components/core/button.ce.vue_vue_type_style_index_0_scoped_ba403858_lang.css";
|
|
5
7
|
@import "../components/navigation/link.ce.vue_vue_type_style_index_0_scoped_24e2c032_lang.css";
|
|
6
8
|
@import "../components/navigation/navigation-menu.ce.vue_vue_type_style_index_0_scoped_5a0a5b21_lang.css";
|
|
7
|
-
@import "../components/shell/sidebar.ce.
|
|
9
|
+
@import "../components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_f50127b6_lang.css";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
@import "_tokens.css";
|
|
2
2
|
@import "../components/core/button.ce.vue_vue_type_style_index_0_scoped_ba403858_lang.css";
|
|
3
|
-
@import "../components/
|
|
3
|
+
@import "../components/core/icon.ce.vue_vue_type_style_index_0_scoped_5c94f2ca_lang.css";
|
|
4
|
+
@import "../components/core/icon-button.ce.vue_vue_type_style_index_0_scoped_a18b4478_lang.css";
|
|
5
|
+
@import "../components/core/tooltip.ce.vue_vue_type_style_index_0_scoped_2c931a6a_lang.css";
|
|
6
|
+
@import "../components/input/file-upload.ce.vue_vue_type_style_index_0_scoped_1568bdab_lang.css";
|
|
4
7
|
@import "../components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_5d214e0f_lang.css";
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
-
import t from "../core/button.ce.js";
|
|
3
|
-
import
|
|
2
|
+
import t from "../core/icon-button.ce.js";
|
|
3
|
+
import n from "../core/tooltip.ce.js";
|
|
4
|
+
import { useContentState as r } from "../../utils/content.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { computed as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
6
|
+
import { computed as i, createCommentVNode as ee, createElementBlock as a, createElementVNode as o, createVNode as s, onBeforeUnmount as te, onMounted as c, openBlock as l, ref as u, toDisplayString as d, unref as f, watch as p, withCtx as m, withModifiers as h } from "vue";
|
|
7
|
+
import { RedoIcon as ne, Search01Icon as re, UndoIcon as ie } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { Annotation as ae, Compartment as g, EditorState as _ } from "@codemirror/state";
|
|
9
|
+
import { EditorView as v, drawSelection as y, highlightActiveLine as oe, highlightActiveLineGutter as se, keymap as ce, lineNumbers as b, placeholder as x } from "@codemirror/view";
|
|
10
|
+
import { defaultKeymap as le, history as ue, historyKeymap as de, indentWithTab as fe, redo as S, undo as pe } from "@codemirror/commands";
|
|
11
|
+
import { openSearchPanel as me, search as he, searchKeymap as ge } from "@codemirror/search";
|
|
12
|
+
import { HighlightStyle as _e, bracketMatching as ve, foldGutter as ye, foldKeymap as be, indentOnInput as xe, syntaxHighlighting as Se } from "@codemirror/language";
|
|
13
|
+
import { closeBrackets as C, closeBracketsKeymap as w } from "@codemirror/autocomplete";
|
|
14
|
+
import { javascript as T } from "@codemirror/lang-javascript";
|
|
15
|
+
import { json as E } from "@codemirror/lang-json";
|
|
16
|
+
import { html as D } from "@codemirror/lang-html";
|
|
17
|
+
import { css as O } from "@codemirror/lang-css";
|
|
18
|
+
import { tags as k } from "@lezer/highlight";
|
|
17
19
|
// src/components/content/code-editor.ce.vue
|
|
18
|
-
var
|
|
20
|
+
var A = ["aria-disabled"], j = {
|
|
19
21
|
role: "toolbar",
|
|
20
22
|
"aria-label": "代码操作",
|
|
21
23
|
class: "kima-code-editor__toolbar"
|
|
22
|
-
},
|
|
24
|
+
}, Ce = { class: "kima-code-editor__language" }, we = {
|
|
23
25
|
key: 0,
|
|
24
26
|
class: "kima-code-editor__fallback"
|
|
25
|
-
},
|
|
27
|
+
}, Te = {
|
|
26
28
|
class: "kima-code-editor__selection",
|
|
27
29
|
"aria-live": "off"
|
|
28
|
-
},
|
|
30
|
+
}, Ee = [
|
|
29
31
|
"name",
|
|
30
32
|
"form",
|
|
31
33
|
"value",
|
|
@@ -60,55 +62,55 @@ var D = ["aria-disabled"], O = {
|
|
|
60
62
|
"change",
|
|
61
63
|
"selection-change"
|
|
62
64
|
],
|
|
63
|
-
setup(e, { expose: M, emit:
|
|
64
|
-
let N = e, P =
|
|
65
|
+
setup(e, { expose: M, emit: De }) {
|
|
66
|
+
let N = e, P = De, F = u(null), I = u(null), L = u(null), R = u({
|
|
65
67
|
from: 0,
|
|
66
68
|
to: 0,
|
|
67
69
|
line: 1,
|
|
68
70
|
column: 1
|
|
69
|
-
}), z = u(0), B = null, V = null, H = new g(), U = new g(), W = new g(), G =
|
|
71
|
+
}), z = u(0), B = null, V = null, H = new g(), U = new g(), W = new g(), G = ae.define(), K = i(() => !N.disabled && !N.readonly), { local: q, update: Oe } = r(N, P, F, (e) => String(e ?? ""), () => {
|
|
70
72
|
B && B.setState(X(q.value)), Z();
|
|
71
73
|
}), J = {
|
|
72
|
-
javascript: () =>
|
|
73
|
-
js: () =>
|
|
74
|
-
json: () =>
|
|
75
|
-
html: () =>
|
|
76
|
-
css: () =>
|
|
77
|
-
},
|
|
74
|
+
javascript: () => T(),
|
|
75
|
+
js: () => T(),
|
|
76
|
+
json: () => E(),
|
|
77
|
+
html: () => D(),
|
|
78
|
+
css: () => O()
|
|
79
|
+
}, ke = _e.define([
|
|
78
80
|
{
|
|
79
|
-
tag: [
|
|
81
|
+
tag: [k.keyword, k.operator],
|
|
80
82
|
color: "var(--kima-color-primary)"
|
|
81
83
|
},
|
|
82
84
|
{
|
|
83
|
-
tag: [
|
|
85
|
+
tag: [k.string, k.regexp],
|
|
84
86
|
color: "color-mix(in srgb, var(--kima-color-primary) 70%, var(--kima-color-tertiary-container))"
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
tag: [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
k.number,
|
|
91
|
+
k.bool,
|
|
92
|
+
k.null
|
|
91
93
|
],
|
|
92
94
|
color: "color-mix(in srgb, var(--kima-color-primary) 70%, var(--kima-color-secondary-container))"
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
|
-
tag:
|
|
97
|
+
tag: k.comment,
|
|
96
98
|
color: "var(--kima-color-on-surface-variant)",
|
|
97
99
|
fontStyle: "italic"
|
|
98
100
|
},
|
|
99
101
|
{
|
|
100
102
|
tag: [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
k.typeName,
|
|
104
|
+
k.className,
|
|
105
|
+
k.tagName
|
|
104
106
|
],
|
|
105
107
|
color: "var(--kima-color-primary)"
|
|
106
108
|
},
|
|
107
109
|
{
|
|
108
|
-
tag:
|
|
110
|
+
tag: k.invalid,
|
|
109
111
|
color: "var(--kima-color-error)"
|
|
110
112
|
}
|
|
111
|
-
]),
|
|
113
|
+
]), Ae = v.theme({
|
|
112
114
|
"&": {
|
|
113
115
|
color: "var(--kima-color-on-surface)",
|
|
114
116
|
backgroundColor: "transparent",
|
|
@@ -163,35 +165,35 @@ var D = ["aria-disabled"], O = {
|
|
|
163
165
|
return _.create({
|
|
164
166
|
doc: e,
|
|
165
167
|
extensions: [
|
|
168
|
+
b(),
|
|
169
|
+
se(),
|
|
170
|
+
ue(),
|
|
166
171
|
y(),
|
|
167
|
-
|
|
168
|
-
ce(),
|
|
169
|
-
re(),
|
|
172
|
+
xe(),
|
|
170
173
|
ve(),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
oe.of([
|
|
174
|
+
C(),
|
|
175
|
+
ye(),
|
|
176
|
+
oe(),
|
|
177
|
+
he({ top: !0 }),
|
|
178
|
+
ce.of([
|
|
177
179
|
{
|
|
178
180
|
key: "Mod-Shift-z",
|
|
179
181
|
run: S
|
|
180
182
|
},
|
|
181
|
-
...
|
|
182
|
-
...
|
|
183
|
-
...
|
|
184
|
-
...
|
|
185
|
-
...
|
|
186
|
-
|
|
183
|
+
...w,
|
|
184
|
+
...le,
|
|
185
|
+
...ge,
|
|
186
|
+
...de,
|
|
187
|
+
...be,
|
|
188
|
+
fe
|
|
187
189
|
]),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
W.of(
|
|
190
|
+
Se(ke),
|
|
191
|
+
Ae,
|
|
192
|
+
W.of(x(N.placeholder)),
|
|
191
193
|
H.of(J[N.language]?.() || []),
|
|
192
194
|
U.of(Y()),
|
|
193
195
|
v.updateListener.of((e) => {
|
|
194
|
-
e.docChanged && !e.transactions.some((e) => e.annotation(G)) &&
|
|
196
|
+
e.docChanged && !e.transactions.some((e) => e.annotation(G)) && Oe(e.state.doc.toString()), (e.docChanged || e.selectionSet) && Z();
|
|
195
197
|
}),
|
|
196
198
|
v.domEventHandlers({ compositionend: () => (queueMicrotask(() => {
|
|
197
199
|
if (V !== null) {
|
|
@@ -231,16 +233,16 @@ var D = ["aria-disabled"], O = {
|
|
|
231
233
|
userEvent: "input.external"
|
|
232
234
|
}), Z();
|
|
233
235
|
}
|
|
234
|
-
p(q, Q), p(() => N.placeholder, () => B?.dispatch({ effects: W.reconfigure(
|
|
236
|
+
p(q, Q), p(() => N.placeholder, () => B?.dispatch({ effects: W.reconfigure(x(N.placeholder)) })), p(() => N.language, () => B?.dispatch({ effects: H.reconfigure(J[N.language]?.() || []) })), p([
|
|
235
237
|
() => N.readonly,
|
|
236
238
|
() => N.disabled,
|
|
237
239
|
() => N.label
|
|
238
|
-
], () => B?.dispatch({ effects: U.reconfigure(Y()) })), p(() => N.required, Z),
|
|
240
|
+
], () => B?.dispatch({ effects: U.reconfigure(Y()) })), p(() => N.required, Z), c(() => {
|
|
239
241
|
B = new v({
|
|
240
242
|
state: X(q.value),
|
|
241
243
|
parent: I.value
|
|
242
244
|
}), Z();
|
|
243
|
-
}),
|
|
245
|
+
}), te(() => B?.destroy());
|
|
244
246
|
function $(e) {
|
|
245
247
|
B && (e(B), B.focus());
|
|
246
248
|
}
|
|
@@ -248,49 +250,52 @@ var D = ["aria-disabled"], O = {
|
|
|
248
250
|
focus: () => B?.focus(),
|
|
249
251
|
getSelection: () => ({ ...R.value }),
|
|
250
252
|
getValue: () => q.value
|
|
251
|
-
}), (
|
|
253
|
+
}), (r, i) => (l(), a("div", {
|
|
252
254
|
ref_key: "root",
|
|
253
255
|
ref: F,
|
|
254
256
|
class: "kima-code-editor",
|
|
255
257
|
"aria-disabled": e.disabled
|
|
256
258
|
}, [
|
|
257
|
-
o("div",
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
259
|
+
o("div", j, [
|
|
260
|
+
s(n, { text: "查找" }, {
|
|
261
|
+
default: m(() => [s(t, {
|
|
262
|
+
icon: f(re),
|
|
263
|
+
label: "查找",
|
|
264
|
+
disabled: e.disabled,
|
|
265
|
+
onMousedown: i[0] ||= h(() => {}, ["prevent"]),
|
|
266
|
+
onClick: i[1] ||= (e) => $(f(me))
|
|
267
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
265
268
|
_: 1
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
269
|
+
}),
|
|
270
|
+
s(n, { text: "撤销" }, {
|
|
271
|
+
default: m(() => [s(t, {
|
|
272
|
+
icon: f(ie),
|
|
273
|
+
label: "撤销",
|
|
274
|
+
disabled: !K.value,
|
|
275
|
+
onMousedown: i[2] ||= h(() => {}, ["prevent"]),
|
|
276
|
+
onClick: i[3] ||= (e) => $(f(pe))
|
|
277
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
274
278
|
_: 1
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
}),
|
|
280
|
+
s(n, { text: "重做" }, {
|
|
281
|
+
default: m(() => [s(t, {
|
|
282
|
+
icon: f(ne),
|
|
283
|
+
label: "重做",
|
|
284
|
+
disabled: !K.value,
|
|
285
|
+
onMousedown: i[4] ||= h(() => {}, ["prevent"]),
|
|
286
|
+
onClick: i[5] ||= (e) => $(f(S))
|
|
287
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
283
288
|
_: 1
|
|
284
|
-
}
|
|
285
|
-
o("span",
|
|
289
|
+
}),
|
|
290
|
+
o("span", Ce, d(e.language), 1)
|
|
286
291
|
]),
|
|
287
|
-
z.value ?
|
|
292
|
+
z.value ? ee("", !0) : (l(), a("pre", we, d(f(q) || e.placeholder), 1)),
|
|
288
293
|
o("div", {
|
|
289
294
|
ref_key: "mount",
|
|
290
295
|
ref: I,
|
|
291
296
|
class: "kima-code-editor__mount"
|
|
292
297
|
}, null, 512),
|
|
293
|
-
o("output",
|
|
298
|
+
o("output", Te, "行 " + d(R.value.line) + ",列 " + d(R.value.column) + " · 选区 " + d(R.value.from) + "–" + d(R.value.to), 1),
|
|
294
299
|
o("textarea", {
|
|
295
300
|
ref_key: "proxy",
|
|
296
301
|
ref: L,
|
|
@@ -301,9 +306,9 @@ var D = ["aria-disabled"], O = {
|
|
|
301
306
|
disabled: e.disabled,
|
|
302
307
|
tabindex: "-1",
|
|
303
308
|
"aria-hidden": "true",
|
|
304
|
-
onInvalid:
|
|
305
|
-
}, null, 40,
|
|
306
|
-
], 8,
|
|
309
|
+
onInvalid: i[6] ||= h((e) => f(B)?.focus(), ["prevent"])
|
|
310
|
+
}, null, 40, Ee)
|
|
311
|
+
], 8, A));
|
|
307
312
|
}
|
|
308
|
-
}, [["__scopeId", "data-v-
|
|
313
|
+
}, [["__scopeId", "data-v-233308e5"]]);
|
|
309
314
|
export { M as default };
|