@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.
Files changed (39) hide show
  1. package/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_233308e5_lang.css +1 -0
  2. 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
  3. package/dist/components/core/code-block.ce.vue_vue_type_style_index_0_scoped_7e6342e8_lang.css +1 -0
  4. package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +1 -0
  5. 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
  6. package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +1 -0
  7. package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_37292ba0_lang.css +1 -0
  8. package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_f50127b6_lang.css +1 -0
  9. package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_f5be4658_lang.css +1 -0
  10. package/dist/kima-elements.js +46116 -45692
  11. package/dist/kima.js +114 -114
  12. package/dist/style.css +9 -9
  13. package/dist/styles/app-shell.css +3 -2
  14. package/dist/styles/carousel.css +4 -2
  15. package/dist/styles/code-block.css +4 -2
  16. package/dist/styles/code-editor.css +4 -2
  17. package/dist/styles/dynamic-input.css +4 -1
  18. package/dist/styles/file-upload.css +4 -2
  19. package/dist/styles/log-viewer.css +4 -2
  20. package/dist/styles/rich-text-editor.css +4 -1
  21. package/dist/styles/sidebar.css +4 -2
  22. package/dist/styles/upload-manager.css +4 -1
  23. package/dist/vue/components/content/code-editor.ce.js +98 -93
  24. package/dist/vue/components/content/rich-text-editor.ce.js +148 -121
  25. package/dist/vue/components/core/code-block.ce.js +72 -49
  26. package/dist/vue/components/form-completion/dynamic-input.ce.js +97 -91
  27. package/dist/vue/components/input/file-upload.ce.js +74 -68
  28. package/dist/vue/components/navigation/carousel.ce.js +71 -59
  29. package/dist/vue/components/shell/app-shell.ce.js +49 -38
  30. package/dist/vue/components/shell/sidebar.ce.js +63 -52
  31. package/dist/vue/components/utility/log-viewer.ce.js +81 -64
  32. package/package.json +1 -1
  33. package/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_a61ccf64_lang.css +0 -1
  34. package/dist/components/core/code-block.ce.vue_vue_type_style_index_0_scoped_6ddc49c8_lang.css +0 -1
  35. package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_97d6f5bf_lang.css +0 -1
  36. package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_c082836f_lang.css +0 -1
  37. package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_abea9686_lang.css +0 -1
  38. package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_0fd95ccf_lang.css +0 -1
  39. 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/content/rich-text-editor.ce.vue_vue_type_style_index_0_scoped_19796b0b_lang.css";
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";
@@ -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.vue_vue_type_style_index_0_scoped_0fd95ccf_lang.css";
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/input/file-upload.ce.vue_vue_type_style_index_0_scoped_17268263_lang.css";
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 { useContentState as n } from "../../utils/content.js";
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 r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, onBeforeUnmount as ee, onMounted as te, openBlock as l, ref as u, toDisplayString as d, unref as f, watch as p, withCtx as m, withModifiers as h } from "vue";
6
- import { Annotation as ne, Compartment as g, EditorState as _ } from "@codemirror/state";
7
- import { EditorView as v, drawSelection as re, highlightActiveLine as ie, highlightActiveLineGutter as ae, keymap as oe, lineNumbers as y, placeholder as b } from "@codemirror/view";
8
- import { defaultKeymap as se, history as ce, historyKeymap as x, indentWithTab as le, redo as S, undo as ue } from "@codemirror/commands";
9
- import { openSearchPanel as de, search as fe, searchKeymap as pe } from "@codemirror/search";
10
- import { HighlightStyle as me, bracketMatching as he, foldGutter as ge, foldKeymap as _e, indentOnInput as ve, syntaxHighlighting as ye } from "@codemirror/language";
11
- import { closeBrackets as be, closeBracketsKeymap as xe } from "@codemirror/autocomplete";
12
- import { javascript as C } from "@codemirror/lang-javascript";
13
- import { json as Se } from "@codemirror/lang-json";
14
- import { html as w } from "@codemirror/lang-html";
15
- import { css as T } from "@codemirror/lang-css";
16
- import { tags as E } from "@lezer/highlight";
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 D = ["aria-disabled"], O = {
20
+ var A = ["aria-disabled"], j = {
19
21
  role: "toolbar",
20
22
  "aria-label": "代码操作",
21
23
  class: "kima-code-editor__toolbar"
22
- }, k = {
24
+ }, Ce = { class: "kima-code-editor__language" }, we = {
23
25
  key: 0,
24
26
  class: "kima-code-editor__fallback"
25
- }, A = {
27
+ }, Te = {
26
28
  class: "kima-code-editor__selection",
27
29
  "aria-live": "off"
28
- }, j = [
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: Ce }) {
64
- let N = e, P = Ce, F = u(null), I = u(null), L = u(null), R = u({
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 = ne.define(), K = r(() => !N.disabled && !N.readonly), { local: q, update: we } = n(N, P, F, (e) => String(e ?? ""), () => {
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: () => C(),
73
- js: () => C(),
74
- json: () => Se(),
75
- html: () => w(),
76
- css: () => T()
77
- }, Te = me.define([
74
+ javascript: () => T(),
75
+ js: () => T(),
76
+ json: () => E(),
77
+ html: () => D(),
78
+ css: () => O()
79
+ }, ke = _e.define([
78
80
  {
79
- tag: [E.keyword, E.operator],
81
+ tag: [k.keyword, k.operator],
80
82
  color: "var(--kima-color-primary)"
81
83
  },
82
84
  {
83
- tag: [E.string, E.regexp],
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
- E.number,
89
- E.bool,
90
- E.null
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: E.comment,
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
- E.typeName,
102
- E.className,
103
- E.tagName
103
+ k.typeName,
104
+ k.className,
105
+ k.tagName
104
106
  ],
105
107
  color: "var(--kima-color-primary)"
106
108
  },
107
109
  {
108
- tag: E.invalid,
110
+ tag: k.invalid,
109
111
  color: "var(--kima-color-error)"
110
112
  }
111
- ]), Ee = v.theme({
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
- ae(),
168
- ce(),
169
- re(),
172
+ xe(),
170
173
  ve(),
171
- he(),
172
- be(),
173
- ge(),
174
- ie(),
175
- fe({ top: !0 }),
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
- ...xe,
182
- ...se,
183
- ...pe,
184
- ...x,
185
- ..._e,
186
- le
183
+ ...w,
184
+ ...le,
185
+ ...ge,
186
+ ...de,
187
+ ...be,
188
+ fe
187
189
  ]),
188
- ye(Te),
189
- Ee,
190
- W.of(b(N.placeholder)),
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)) && we(e.state.doc.toString()), (e.docChanged || e.selectionSet) && Z();
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(b(N.placeholder)) })), p(() => N.language, () => B?.dispatch({ effects: H.reconfigure(J[N.language]?.() || []) })), p([
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), te(() => {
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
- }), ee(() => B?.destroy());
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
- }), (n, r) => (l(), a("div", {
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", O, [
258
- c(t, {
259
- variant: "text",
260
- disabled: e.disabled,
261
- onMousedown: r[0] ||= h(() => {}, ["prevent"]),
262
- onClick: r[1] ||= (e) => $(f(de))
263
- }, {
264
- default: m(() => [...r[7] ||= [s("查找", -1)]]),
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
- }, 8, ["disabled"]),
267
- c(t, {
268
- variant: "text",
269
- disabled: !K.value,
270
- onMousedown: r[2] ||= h(() => {}, ["prevent"]),
271
- onClick: r[3] ||= (e) => $(f(ue))
272
- }, {
273
- default: m(() => [...r[8] ||= [s("撤销", -1)]]),
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
- }, 8, ["disabled"]),
276
- c(t, {
277
- variant: "text",
278
- disabled: !K.value,
279
- onMousedown: r[4] ||= h(() => {}, ["prevent"]),
280
- onClick: r[5] ||= (e) => $(f(S))
281
- }, {
282
- default: m(() => [...r[9] ||= [s("重做", -1)]]),
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
- }, 8, ["disabled"]),
285
- o("span", null, d(e.language), 1)
289
+ }),
290
+ o("span", Ce, d(e.language), 1)
286
291
  ]),
287
- z.value ? i("", !0) : (l(), a("pre", k, d(f(q) || e.placeholder), 1)),
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", A, "行 " + d(R.value.line) + ",列 " + d(R.value.column) + " · 选区 " + d(R.value.from) + "–" + d(R.value.to), 1),
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: r[6] ||= h((e) => f(B)?.focus(), ["prevent"])
305
- }, null, 40, j)
306
- ], 8, D));
309
+ onInvalid: i[6] ||= h((e) => f(B)?.focus(), ["prevent"])
310
+ }, null, 40, Ee)
311
+ ], 8, A));
307
312
  }
308
- }, [["__scopeId", "data-v-a61ccf64"]]);
313
+ }, [["__scopeId", "data-v-233308e5"]]);
309
314
  export { M as default };