@kernel4632/kima 0.8.3 → 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 (36) 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/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +1 -0
  4. 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
  5. package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +1 -0
  6. package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_37292ba0_lang.css +1 -0
  7. package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_f50127b6_lang.css +1 -0
  8. package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_f5be4658_lang.css +1 -0
  9. package/dist/kima-elements.js +46764 -46407
  10. package/dist/kima.js +21 -21
  11. package/dist/style.css +8 -8
  12. package/dist/styles/app-shell.css +3 -2
  13. package/dist/styles/carousel.css +4 -2
  14. package/dist/styles/code-editor.css +4 -2
  15. package/dist/styles/dynamic-input.css +4 -1
  16. package/dist/styles/file-upload.css +4 -2
  17. package/dist/styles/log-viewer.css +4 -2
  18. package/dist/styles/rich-text-editor.css +4 -1
  19. package/dist/styles/sidebar.css +4 -2
  20. package/dist/styles/upload-manager.css +4 -1
  21. package/dist/vue/components/content/code-editor.ce.js +98 -93
  22. package/dist/vue/components/content/rich-text-editor.ce.js +148 -121
  23. package/dist/vue/components/core/code-block.ce.js +6 -6
  24. package/dist/vue/components/form-completion/dynamic-input.ce.js +97 -91
  25. package/dist/vue/components/input/file-upload.ce.js +74 -68
  26. package/dist/vue/components/navigation/carousel.ce.js +71 -59
  27. package/dist/vue/components/shell/app-shell.ce.js +49 -38
  28. package/dist/vue/components/shell/sidebar.ce.js +63 -52
  29. package/dist/vue/components/utility/log-viewer.ce.js +81 -64
  30. package/package.json +1 -1
  31. package/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_a61ccf64_lang.css +0 -1
  32. package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_97d6f5bf_lang.css +0 -1
  33. package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_c082836f_lang.css +0 -1
  34. package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_abea9686_lang.css +0 -1
  35. package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_0fd95ccf_lang.css +0 -1
  36. package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_2bf26869_lang.css +0 -1
@@ -1,14 +1,16 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
- import t from "../core/button.ce.js";
3
- import { useNavigationRoot as n } from "../../utils/navigation.js";
4
- import r from "../core/drawer.ce.js";
5
- import { useNarrow as i, useShellModel as a } from "../../utils/shell.js";
6
- import { useKimaConfig as o } from "../../utils/config.js";
7
- import { useScopedSlots as s } from "../../utils/scoped-slots.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import n from "../core/drawer.ce.js";
4
+ import r from "../core/icon-button.ce.js";
5
+ import i from "../core/tooltip.ce.js";
6
+ import { useNarrow as a, useShellModel as o } from "../../utils/shell.js";
7
+ import { useKimaConfig as s } from "../../utils/config.js";
8
+ import { useScopedSlots as c } from "../../utils/scoped-slots.js";
8
9
  /* empty css */
9
- import { Fragment as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, mergeProps as m, openBlock as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, watch as S, withCtx as C, withDirectives as w, withModifiers as T } from "vue";
10
+ import { Fragment as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, mergeProps as h, openBlock as g, ref as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as S, watch as C, withCtx as w, withDirectives as T, withModifiers as E } from "vue";
11
+ import { Menu01Icon as D } from "@hugeicons/core-free-icons";
10
12
  // src/components/shell/app-shell.ce.vue
11
- var E = ["href"], D = { class: "kima-app-shell__header" }, O = { key: 1 }, k = { key: 0 }, A = { class: "kima-app-shell__footer" }, j = { key: 0 }, M = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
13
+ var O = ["href"], k = { class: "kima-app-shell__header" }, A = { key: 1 }, j = { key: 0 }, M = { class: "kima-app-shell__footer" }, N = { key: 0 }, P = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
12
14
  __name: "app-shell.ce",
13
15
  props: {
14
16
  open: Boolean,
@@ -30,40 +32,49 @@ var E = ["href"], D = { class: "kima-app-shell__header" }, O = { key: 1 }, k = {
30
32
  }
31
33
  },
32
34
  emits: ["update:open"],
33
- setup(e, { emit: M }) {
34
- let { native: N, vOutlet: P } = s(), F = e, I = M, { root: L, forwardedAttrs: R } = n(), z = o(L), B = g(null), [V, H] = a(F, "open", I), U = i(L, () => F.breakpoint), W = `kima-main-${x()}`;
35
- return S(U, () => H(!1)), (n, i) => (h(), d("div", m({
35
+ setup(e, { emit: P }) {
36
+ let { native: F, vOutlet: I } = c(), L = e, R = P, { root: z, forwardedAttrs: B } = t(), V = s(z), H = _(null), [U, W] = o(L, "open", R), G = a(z, () => L.breakpoint), K = `kima-main-${S()}`;
37
+ return C(G, () => W(!1)), (t, a) => (g(), f("div", h({
36
38
  ref_key: "root",
37
- ref: L
38
- }, b(R), {
39
- class: ["kima-app-shell", { "kima-app-shell--narrow": b(U) }],
39
+ ref: z
40
+ }, x(B), {
41
+ class: ["kima-app-shell", { "kima-app-shell--narrow": x(G) }],
40
42
  style: { "--kima-shell-sidebar-width": e.sidebarWidth }
41
43
  }), [
42
- f("a", {
44
+ p("a", {
43
45
  class: "kima-app-shell__skip",
44
- href: `#${W}`,
45
- onClick: i[0] ||= T((e) => B.value?.focus(), ["prevent"])
46
- }, y(e.skipLabel), 9, E),
47
- f("header", D, [b(U) ? (h(), l(t, {
46
+ href: `#${K}`,
47
+ onClick: a[0] ||= E((e) => H.value?.focus(), ["prevent"])
48
+ }, b(e.skipLabel), 9, O),
49
+ p("header", k, [x(G) ? (g(), u(i, {
48
50
  key: 0,
49
- variant: "text",
50
- "aria-expanded": b(V),
51
- "aria-controls": `${W}-sidebar`,
52
- onClick: i[1] ||= (e) => b(H)(!b(V))
51
+ text: x(U) ? "关闭导航" : "打开导航",
52
+ position: "right"
53
53
  }, {
54
- default: C(() => [...i[2] ||= [p("打开导航", -1)]]),
54
+ default: w(() => [m(r, {
55
+ icon: x(D),
56
+ label: x(U) ? "关闭导航" : "打开导航",
57
+ "aria-expanded": x(U),
58
+ "aria-controls": `${K}-sidebar`,
59
+ onClick: a[1] ||= (e) => x(W)(!x(U))
60
+ }, null, 8, [
61
+ "icon",
62
+ "label",
63
+ "aria-expanded",
64
+ "aria-controls"
65
+ ])]),
55
66
  _: 1
56
- }, 8, ["aria-expanded", "aria-controls"])) : u("", !0), b(N) ? w((h(), d("div", O, null, 512)), [[b(P), "header"]]) : _(n.$slots, "header", {}, void 0, !0, 2)]),
57
- (h(), l(v(b(U) ? r : "aside"), {
58
- id: `${W}-sidebar`,
59
- open: b(U) && b(V),
60
- placement: b(z).direction === "rtl" ? "right" : "left",
67
+ }, 8, ["text"])) : d("", !0), x(F) ? T((g(), f("div", A, null, 512)), [[x(I), "header"]]) : v(t.$slots, "header", {}, void 0, !0, 2)]),
68
+ (g(), u(y(x(G) ? n : "aside"), {
69
+ id: `${K}-sidebar`,
70
+ open: x(G) && x(U),
71
+ placement: x(V).direction === "rtl" ? "right" : "left",
61
72
  title: e.label,
62
73
  "aria-label": e.label,
63
74
  class: "kima-app-shell__sidebar",
64
- "onUpdate:open": b(H)
75
+ "onUpdate:open": x(W)
65
76
  }, {
66
- default: C(() => [b(N) ? w((h(), d("div", k, null, 512)), [[b(P), "sidebar"]]) : _(n.$slots, "sidebar", { close: () => b(H)(!1) }, void 0, !0, 1)]),
77
+ default: w(() => [x(F) ? T((g(), f("div", j, null, 512)), [[x(I), "sidebar"]]) : v(t.$slots, "sidebar", { close: () => x(W)(!1) }, void 0, !0, 1)]),
67
78
  _: 3
68
79
  }, 40, [
69
80
  "id",
@@ -73,15 +84,15 @@ var E = ["href"], D = { class: "kima-app-shell__header" }, O = { key: 1 }, k = {
73
84
  "aria-label",
74
85
  "onUpdate:open"
75
86
  ])),
76
- f("main", {
77
- id: W,
87
+ p("main", {
88
+ id: K,
78
89
  ref_key: "main",
79
- ref: B,
90
+ ref: H,
80
91
  tabindex: "-1",
81
92
  class: "kima-app-shell__main"
82
- }, [b(N) ? (h(), d(c, { key: 0 }, [w(f("div", null, null, 512), [[b(P), "main"]]), w(f("div", null, null, 512), [[b(P)]])], 64)) : _(n.$slots, "main", {}, () => [_(n.$slots, "default", {}, void 0, !0)], !0, 1)], 512),
83
- f("footer", A, [b(N) ? w((h(), d("div", j, null, 512)), [[b(P), "footer"]]) : _(n.$slots, "footer", {}, void 0, !0, 1)])
93
+ }, [x(F) ? (g(), f(l, { key: 0 }, [T(p("div", null, null, 512), [[x(I), "main"]]), T(p("div", null, null, 512), [[x(I)]])], 64)) : v(t.$slots, "main", {}, () => [v(t.$slots, "default", {}, void 0, !0)], !0, 1)], 512),
94
+ p("footer", M, [x(F) ? T((g(), f("div", N, null, 512)), [[x(I), "footer"]]) : v(t.$slots, "footer", {}, void 0, !0, 1)])
84
95
  ], 16));
85
96
  }
86
- }), [["__scopeId", "data-v-abea9686"]]);
87
- export { M as default };
97
+ }), [["__scopeId", "data-v-37292ba0"]]);
98
+ export { P as default };
@@ -1,15 +1,17 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
- import t from "../core/button.ce.js";
3
- import { useNavigationRoot as n } from "../../utils/navigation.js";
4
- import r from "../core/drawer.ce.js";
5
- import { useNarrow as i, useShellModel as a } from "../../utils/shell.js";
6
- import { useKimaConfig as o } from "../../utils/config.js";
7
- import { useScopedSlots as s } from "../../utils/scoped-slots.js";
8
- import c from "../navigation/navigation-menu.ce.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import n from "../core/drawer.ce.js";
4
+ import r from "../core/icon-button.ce.js";
5
+ import i from "../core/tooltip.ce.js";
6
+ import { useNarrow as a, useShellModel as o } from "../../utils/shell.js";
7
+ import { useKimaConfig as s } from "../../utils/config.js";
8
+ import { useScopedSlots as c } from "../../utils/scoped-slots.js";
9
+ import l from "../navigation/navigation-menu.ce.js";
9
10
  /* empty css */
10
- import { createBlock as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, mergeProps as m, onMounted as h, openBlock as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, watch as S, withCtx as C, withDirectives as w } from "vue";
11
+ import { computed as u, createBlock as d, createElementBlock as f, createElementVNode as p, createVNode as m, mergeProps as h, onMounted as g, openBlock as _, renderSlot as v, resolveDynamicComponent as y, unref as b, useId as x, watch as S, withCtx as C, withDirectives as w } from "vue";
12
+ import { Menu01Icon as T, SidebarLeftIcon as E, SidebarRightIcon as D } from "@hugeicons/core-free-icons";
11
13
  // src/components/shell/sidebar.ce.vue
12
- var T = ["data-collapsed", "aria-label"], E = { key: 0 }, D = { key: 0 }, O = { key: 0 }, k = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
14
+ var O = ["data-collapsed", "aria-label"], k = { key: 0 }, A = { key: 0 }, j = { key: 0 }, M = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
13
15
  __name: "sidebar.ce",
14
16
  props: {
15
17
  items: {
@@ -47,60 +49,69 @@ var T = ["data-collapsed", "aria-label"], E = { key: 0 }, D = { key: 0 }, O = {
47
49
  "update:open",
48
50
  "navigate"
49
51
  ],
50
- setup(e, { emit: k }) {
51
- let { native: A, vOutlet: j } = s(), M = e, N = k, { root: P, forwardedAttrs: F } = n(), I = o(P), [L, R] = a(M, "modelValue", N), [z, B] = a(M, "expanded", N), [V, H] = a(M, "collapsed", N), [U, W] = a(M, "open", N), G = i(P, () => M.breakpoint, !0), K = `kima-sidebar-${x()}`;
52
- h(() => {
53
- if (M.storageKey) try {
54
- let e = localStorage.getItem(M.storageKey);
55
- e != null && H(e === "true");
52
+ setup(e, { emit: M }) {
53
+ let { native: N, vOutlet: P } = c(), F = e, I = M, { root: L, forwardedAttrs: R } = t(), z = s(L), [B, V] = o(F, "modelValue", I), [H, U] = o(F, "expanded", I), [W, G] = o(F, "collapsed", I), [K, q] = o(F, "open", I), J = a(L, () => F.breakpoint, !0), Y = `kima-sidebar-${x()}`, X = u(() => J.value ? K.value ? "关闭导航" : "打开导航" : W.value ? "展开侧栏" : "折叠侧栏"), Z = u(() => J.value ? T : z.value.direction === "rtl" ? D : E);
54
+ g(() => {
55
+ if (F.storageKey) try {
56
+ let e = localStorage.getItem(F.storageKey);
57
+ e != null && G(e === "true");
56
58
  } catch {}
57
- }), S(V, (e) => {
58
- if (M.storageKey) try {
59
- localStorage.setItem(M.storageKey, String(e));
59
+ }), S(W, (e) => {
60
+ if (F.storageKey) try {
61
+ localStorage.setItem(F.storageKey, String(e));
60
62
  } catch {}
61
- }), S(G, () => W(!1));
62
- function q(e, t) {
63
- N("navigate", e, t), G.value && !t.defaultPrevented && !t.metaKey && !t.ctrlKey && W(!1);
63
+ }), S(J, () => q(!1));
64
+ function Q(e, t) {
65
+ I("navigate", e, t), J.value && !t.defaultPrevented && !t.metaKey && !t.ctrlKey && q(!1);
64
66
  }
65
- return (n, i) => (g(), u("aside", m({
67
+ return (t, a) => (_(), f("aside", h({
66
68
  ref_key: "root",
67
- ref: P
68
- }, b(F), {
69
+ ref: L
70
+ }, b(R), {
69
71
  class: ["kima-sidebar", {
70
- "kima-sidebar--collapsed": b(V) && !b(G),
71
- "kima-sidebar--mobile": b(G)
72
+ "kima-sidebar--collapsed": b(W) && !b(J),
73
+ "kima-sidebar--mobile": b(J)
72
74
  }],
73
- "data-collapsed": b(V),
74
- "aria-label": e.label || (b(I).locale.startsWith("en") ? "Sidebar" : "侧栏")
75
- }), [p(t, {
76
- variant: "text",
77
- disabled: e.disabled,
78
- "aria-expanded": b(G) ? b(U) : !b(V),
79
- "aria-controls": K,
80
- onClick: i[0] ||= (e) => b(G) ? b(W)(!b(U)) : b(H)(!b(V))
75
+ "data-collapsed": b(W),
76
+ "aria-label": e.label || (b(z).locale.startsWith("en") ? "Sidebar" : "侧栏")
77
+ }), [m(i, {
78
+ text: X.value,
79
+ position: "right"
81
80
  }, {
82
- default: C(() => [f(y(b(G) ? "打开导航" : b(V) ? "展开侧栏" : "折叠侧栏"), 1)]),
81
+ default: C(() => [m(r, {
82
+ icon: Z.value,
83
+ label: X.value,
84
+ disabled: e.disabled,
85
+ "aria-expanded": b(J) ? b(K) : !b(W),
86
+ "aria-controls": Y,
87
+ onClick: a[0] ||= (e) => b(J) ? b(q)(!b(K)) : b(G)(!b(W))
88
+ }, null, 8, [
89
+ "icon",
90
+ "label",
91
+ "disabled",
92
+ "aria-expanded"
93
+ ])]),
83
94
  _: 1
84
- }, 8, ["disabled", "aria-expanded"]), (g(), l(v(b(G) ? r : "div"), {
85
- id: K,
86
- open: b(G) && b(U),
87
- placement: b(I).direction === "rtl" ? "right" : "left",
95
+ }, 8, ["text"]), (_(), d(y(b(J) ? n : "div"), {
96
+ id: Y,
97
+ open: b(J) && b(K),
98
+ placement: b(z).direction === "rtl" ? "right" : "left",
88
99
  title: e.label || "侧栏导航",
89
100
  class: "kima-sidebar__body",
90
- "onUpdate:open": b(W)
101
+ "onUpdate:open": b(q)
91
102
  }, {
92
103
  default: C(() => [
93
- d("header", null, [b(A) ? w((g(), u("div", E, null, 512)), [[b(j), "header"]]) : _(n.$slots, "header", { collapsed: b(V) && !b(G) }, void 0, !0, 1)]),
94
- p(c, {
104
+ p("header", null, [b(N) ? w((_(), f("div", k, null, 512)), [[b(P), "header"]]) : v(t.$slots, "header", { collapsed: b(W) && !b(J) }, void 0, !0, 1)]),
105
+ m(l, {
95
106
  items: e.items,
96
- "model-value": b(L),
97
- expanded: b(z),
107
+ "model-value": b(B),
108
+ expanded: b(H),
98
109
  disabled: e.disabled,
99
110
  orientation: "vertical",
100
111
  label: e.label || "侧栏导航",
101
- "onUpdate:modelValue": b(R),
102
- "onUpdate:expanded": b(B),
103
- onNavigate: q
112
+ "onUpdate:modelValue": b(V),
113
+ "onUpdate:expanded": b(U),
114
+ onNavigate: Q
104
115
  }, null, 8, [
105
116
  "items",
106
117
  "model-value",
@@ -110,8 +121,8 @@ var T = ["data-collapsed", "aria-label"], E = { key: 0 }, D = { key: 0 }, O = {
110
121
  "onUpdate:modelValue",
111
122
  "onUpdate:expanded"
112
123
  ]),
113
- b(A) ? w((g(), u("div", D, null, 512)), [[b(j)]]) : _(n.$slots, "default", { collapsed: b(V) && !b(G) }, void 0, !0, 1),
114
- d("footer", null, [b(A) ? w((g(), u("div", O, null, 512)), [[b(j), "footer"]]) : _(n.$slots, "footer", { collapsed: b(V) && !b(G) }, void 0, !0, 1)])
124
+ b(N) ? w((_(), f("div", A, null, 512)), [[b(P)]]) : v(t.$slots, "default", { collapsed: b(W) && !b(J) }, void 0, !0, 1),
125
+ p("footer", null, [b(N) ? w((_(), f("div", j, null, 512)), [[b(P), "footer"]]) : v(t.$slots, "footer", { collapsed: b(W) && !b(J) }, void 0, !0, 1)])
115
126
  ]),
116
127
  _: 3
117
128
  }, 40, [
@@ -119,7 +130,7 @@ var T = ["data-collapsed", "aria-label"], E = { key: 0 }, D = { key: 0 }, O = {
119
130
  "placement",
120
131
  "title",
121
132
  "onUpdate:open"
122
- ]))], 16, T));
133
+ ]))], 16, O));
123
134
  }
124
- }), [["__scopeId", "data-v-0fd95ccf"]]);
125
- export { k as default };
135
+ }), [["__scopeId", "data-v-f50127b6"]]);
136
+ export { M as default };
@@ -1,11 +1,16 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
- import t from "../core/button.ce.js";
3
- import { useInteractionRoot as n } from "../../utils/interaction.js";
4
- import r from "../display/highlight.ce.js";
2
+ import { useInteractionRoot as t } from "../../utils/interaction.js";
3
+ import n from "../core/icon-button.ce.js";
4
+ import r from "../core/tooltip.ce.js";
5
+ import i from "../display/highlight.ce.js";
5
6
  /* empty css */
6
- import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, mergeProps as d, nextTick as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, vModelText as v, watch as y, withCtx as b, withDirectives as x } from "vue";
7
+ import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, mergeProps as d, nextTick as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, vModelText as v, watch as y, withCtx as b, withDirectives as x } from "vue";
8
+ import { Download01Icon as S, PauseIcon as C, PlayIcon as w } from "@hugeicons/core-free-icons";
7
9
  // src/components/utility/log-viewer.ce.vue
8
- var S = ["aria-label"], C = { class: "kima-log-viewer__tools" }, w = ["aria-label", "aria-live"], T = { key: 0 }, E = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
10
+ var T = ["aria-label"], E = { class: "kima-log-viewer__tools" }, D = {
11
+ class: "kima-log-viewer__follow-status",
12
+ role: "status"
13
+ }, O = ["aria-label", "aria-live"], k = { key: 0 }, A = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
9
14
  __name: "log-viewer.ce",
10
15
  props: {
11
16
  lines: {
@@ -30,95 +35,107 @@ var S = ["aria-label"], C = { class: "kima-log-viewer__tools" }, w = ["aria-labe
30
35
  "follow-change",
31
36
  "export"
32
37
  ],
33
- setup(e, { expose: E, emit: D }) {
34
- let O = e, k = D, { root: A, forwardedAttrs: j } = n(), M = m([]), N = m(""), P = m(!0), F = m(null), I = 0;
35
- function L() {
36
- M.value = M.value.slice(-Math.max(1, Math.floor(O.maxLines) || 1));
38
+ setup(e, { expose: A, emit: j }) {
39
+ let M = e, N = j, { root: P, forwardedAttrs: F } = t(), I = m([]), L = m(""), R = m(!0), z = m(null), B = 0;
40
+ function V() {
41
+ I.value = I.value.slice(-Math.max(1, Math.floor(M.maxLines) || 1));
37
42
  }
38
- async function R() {
39
- await f(), P.value && F.value && (F.value.scrollTop = F.value.scrollHeight);
43
+ async function H() {
44
+ await f(), R.value && z.value && (z.value.scrollTop = z.value.scrollHeight);
40
45
  }
41
- function z(e) {
46
+ function U(e) {
42
47
  let t = Array.isArray(e) ? e : String(e).split("\n");
43
- M.value.push(...t.map((e) => ({
44
- id: ++I,
48
+ I.value.push(...t.map((e) => ({
49
+ id: ++B,
45
50
  text: String(e)
46
- }))), L(), R(), k("append", t);
51
+ }))), V(), H(), N("append", t);
47
52
  }
48
- y(() => O.lines, (e) => {
49
- M.value = e.map((e) => ({
50
- id: ++I,
53
+ y(() => M.lines, (e) => {
54
+ I.value = e.map((e) => ({
55
+ id: ++B,
51
56
  text: String(e)
52
- })), L(), R();
57
+ })), V(), H();
53
58
  }, {
54
59
  immediate: !0,
55
60
  deep: !0
56
- }), y(() => O.maxLines, L);
57
- let B = a(() => M.value.filter((e) => !N.value || e.text.toLocaleLowerCase().includes(N.value.toLocaleLowerCase())));
58
- function V(e) {
59
- P.value !== e && (P.value = e, k("follow-change", e)), e && R();
61
+ }), y(() => M.maxLines, V);
62
+ let W = o(() => I.value.filter((e) => !L.value || e.text.toLocaleLowerCase().includes(L.value.toLocaleLowerCase())));
63
+ function G(e) {
64
+ R.value !== e && (R.value = e, N("follow-change", e)), e && H();
60
65
  }
61
- function H() {
62
- let e = F.value;
63
- V(e.scrollHeight - e.scrollTop - e.clientHeight < 8);
66
+ function K() {
67
+ let e = z.value;
68
+ G(e.scrollHeight - e.scrollTop - e.clientHeight < 8);
64
69
  }
65
- function U() {
66
- let e = M.value.map((e) => e.text).join("\n");
67
- return k("export", e), e;
70
+ function q() {
71
+ let e = I.value.map((e) => e.text).join("\n");
72
+ return N("export", e), e;
68
73
  }
69
- function W() {
70
- let e = URL.createObjectURL(new Blob([U()], { type: "text/plain;charset=utf-8" })), t = document.createElement("a");
74
+ function J() {
75
+ let e = URL.createObjectURL(new Blob([q()], { type: "text/plain;charset=utf-8" })), t = document.createElement("a");
71
76
  t.href = e, t.download = "kima-log.txt", t.click(), setTimeout(() => URL.revokeObjectURL(e), 0);
72
77
  }
73
- return E({
74
- append: z,
75
- exportText: U,
76
- resume: () => V(!0)
77
- }), (n, a) => (p(), s("section", d({
78
+ return A({
79
+ append: U,
80
+ exportText: q,
81
+ resume: () => G(!0)
82
+ }), (t, o) => (p(), c("section", d({
78
83
  ref_key: "root",
79
- ref: A
80
- }, _(j), {
84
+ ref: P
85
+ }, _(F), {
81
86
  class: "kima-log-viewer",
82
87
  "aria-label": e.label
83
- }), [c("div", C, [
84
- e.searchable ? x((p(), s("input", {
88
+ }), [l("div", E, [
89
+ e.searchable ? x((p(), c("input", {
85
90
  key: 0,
86
- "onUpdate:modelValue": a[0] ||= (e) => N.value = e,
91
+ "onUpdate:modelValue": o[0] ||= (e) => L.value = e,
87
92
  type: "search",
88
93
  placeholder: "过滤日志",
89
94
  "aria-label": "搜索日志"
90
- }, null, 512)), [[v, N.value]]) : o("", !0),
91
- u(t, {
92
- variant: "text",
93
- "aria-pressed": P.value,
94
- onClick: a[1] ||= (e) => V(!P.value)
95
- }, {
96
- default: b(() => [l(g(P.value ? "暂停跟尾" : "恢复跟尾"), 1)]),
95
+ }, null, 512)), [[v, L.value]]) : s("", !0),
96
+ u(r, { text: R.value ? "暂停跟尾" : "恢复跟尾" }, {
97
+ default: b(() => [u(n, {
98
+ icon: R.value ? _(C) : _(w),
99
+ label: R.value ? "暂停跟尾" : "恢复跟尾",
100
+ variant: R.value ? "tonal" : "standard",
101
+ "aria-pressed": R.value,
102
+ onClick: o[1] ||= (e) => G(!R.value)
103
+ }, null, 8, [
104
+ "icon",
105
+ "label",
106
+ "variant",
107
+ "aria-pressed"
108
+ ])]),
97
109
  _: 1
98
- }, 8, ["aria-pressed"]),
99
- u(t, {
100
- variant: "text",
101
- onClick: W
110
+ }, 8, ["text"]),
111
+ u(r, {
112
+ text: "导出日志",
113
+ position: "left"
102
114
  }, {
103
- default: b(() => [...a[2] ||= [l("导出日志", -1)]]),
115
+ default: b(() => [u(n, {
116
+ icon: _(S),
117
+ label: "导出日志",
118
+ onClick: J
119
+ }, null, 8, ["icon"])]),
104
120
  _: 1
105
- })
106
- ]), c("div", {
121
+ }),
122
+ l("span", D, g(R.value ? "跟随最新" : "已暂停跟尾"), 1)
123
+ ]), l("div", {
107
124
  ref_key: "viewport",
108
- ref: F,
125
+ ref: z,
109
126
  class: "kima-log-viewer__viewport",
110
127
  role: "log",
111
128
  "aria-label": e.label,
112
- "aria-live": P.value ? "polite" : "off",
129
+ "aria-live": R.value ? "polite" : "off",
113
130
  tabindex: "0",
114
- onScroll: H
115
- }, [(p(!0), s(i, null, h(B.value, (e) => (p(), s("div", {
131
+ onScroll: K
132
+ }, [(p(!0), c(a, null, h(W.value, (e) => (p(), c("div", {
116
133
  key: e.id,
117
134
  class: "kima-log-viewer__line"
118
- }, [u(r, {
135
+ }, [u(i, {
119
136
  text: e.text,
120
- keywords: N.value
121
- }, null, 8, ["text", "keywords"])]))), 128)), B.value.length ? o("", !0) : (p(), s("p", T, "没有匹配日志"))], 40, w)], 16, S));
137
+ keywords: L.value
138
+ }, null, 8, ["text", "keywords"])]))), 128)), W.value.length ? s("", !0) : (p(), c("p", k, "没有匹配日志"))], 40, O)], 16, T));
122
139
  }
123
- }), [["__scopeId", "data-v-2bf26869"]]);
124
- export { E as default };
140
+ }), [["__scopeId", "data-v-f5be4658"]]);
141
+ export { A as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernel4632/kima",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "KIMA (Kinetic, Interaction, Motion, Alive) - a Material 3 style Web UI design system and component library.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-a61ccf64{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-code-editor[data-v-a61ccf64]{--kima-chart-series-1:var(--kima-color-primary);--kima-chart-series-2:color-mix(in srgb, var(--kima-color-primary) 65%, var(--kima-color-tertiary-container));--kima-chart-series-3:color-mix(in srgb, var(--kima-color-primary) 65%, var(--kima-color-secondary-container));--kima-chart-series-4:color-mix(in srgb, var(--kima-color-primary) 55%, var(--kima-color-on-surface));--kima-heatmap-low:var(--kima-color-layer-2);--kima-heatmap-high:var(--kima-color-primary-container);min-width:0;color:var(--kima-color-on-surface);font-family:var(--kima-font-family);font-weight:var(--kima-font-weight-semi-bold);background:var(--kima-color-layer-1);border-radius:var(--kima-radius-m);border:0;overflow:clip}.kima-code-editor[data-v-a61ccf64]:focus-within{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:2px}.kima-code-editor[aria-disabled=true][data-v-a61ccf64]{opacity:var(--kima-opacity-disabled)}@media (prefers-reduced-motion:reduce){.kima-code-editor[data-v-a61ccf64],.kima-code-editor[data-v-a61ccf64] *{transition-duration:0s!important;animation-duration:0s!important}}.kima-code-editor[data-v-a61ccf64]{position:relative}.kima-code-editor__toolbar[data-v-a61ccf64]{align-items:center;gap:var(--kima-space-2);padding:var(--kima-space-2);flex-wrap:wrap;display:flex}.kima-code-editor__toolbar span[data-v-a61ccf64]{padding:var(--kima-space-2);color:var(--kima-color-on-surface-variant);margin-inline-start:auto}.kima-code-editor__mount[data-v-a61ccf64]{min-width:0}.kima-code-editor__mount[data-v-a61ccf64] .cm-editor{max-height:32em}.kima-code-editor__mount[data-v-a61ccf64] .cm-button,.kima-code-editor__mount[data-v-a61ccf64] .cm-textfield{background:var(--kima-color-layer-2);color:var(--kima-color-on-surface);border-radius:var(--kima-radius-s);font:inherit;padding:var(--kima-space-2);border:0}.kima-code-editor__mount[data-v-a61ccf64] .cm-panel.cm-search{padding:var(--kima-space-3)}.kima-code-editor__fallback[data-v-a61ccf64]{padding:var(--kima-space-4);font:inherit;white-space:pre-wrap;min-height:12em;margin:0}.kima-code-editor__selection[data-v-a61ccf64]{padding:var(--kima-space-2) var(--kima-space-4);font-size:var(--kima-font-size-label-medium);color:var(--kima-color-on-surface-variant);display:block}.kima-code-editor__proxy[data-v-a61ccf64]{opacity:0;pointer-events:none;clip-path:inset(50%);width:1px;height:1px;position:absolute}
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-97d6f5bf{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-dynamic-input[data-v-97d6f5bf]{box-sizing:border-box;color:var(--kima-color-on-surface);font-family:var(--kima-font-family);font-size:var(--kima-font-size-body-large);font-weight:var(--kima-font-weight-semi-bold)}.kima-dynamic-input[aria-disabled=true][data-v-97d6f5bf]{opacity:var(--kima-opacity-disabled)}.kima-dynamic-input[data-v-97d6f5bf]{gap:var(--kima-space-3);min-width:0;display:grid}.kima-dynamic-input__rows[data-v-97d6f5bf]{gap:var(--kima-space-3);display:grid;position:relative}.kima-dynamic-input__row[data-v-97d6f5bf]{background:var(--kima-color-layer-2);border:0;position:relative}.kima-dynamic-input__row[data-v-97d6f5bf]:after{content:"";z-index:1;border-radius:inherit;opacity:0;pointer-events:none;transition:opacity var(--kima-duration-effects) var(--kima-curve-standard);background:currentColor;position:absolute;inset:0}.kima-dynamic-input__row[data-v-97d6f5bf]>*{z-index:2;position:relative}.kima-dynamic-input__row[data-v-97d6f5bf]:hover:not(:disabled):not([aria-disabled=true]):after{opacity:var(--kima-state-hover)}.kima-dynamic-input__row[data-v-97d6f5bf]:focus-visible:after{opacity:var(--kima-state-focus)}.kima-dynamic-input__row[data-v-97d6f5bf]:active:not(:disabled):not([aria-disabled=true]):after{opacity:var(--kima-state-pressed)}.kima-dynamic-input__row[data-v-97d6f5bf]{position:relative;overflow:hidden}.kima-dynamic-input__row[data-v-97d6f5bf] .kima-ripple{z-index:2;pointer-events:none;animation:kima-ripple-glow-97d6f5bf var(--kima-duration-slower) linear forwards;background:currentColor;position:absolute;inset:0}.kima-dynamic-input__row[data-v-97d6f5bf]{border-radius:var(--kima-radius-m);transition:background-color var(--kima-duration-effects) var(--kima-curve-standard), box-shadow var(--kima-duration-effects) var(--kima-curve-standard)}.kima-dynamic-input__row[data-v-97d6f5bf]:focus-within{background:var(--kima-color-layer-3);box-shadow:inset 0 0 0 var(--kima-outline-width-focused) var(--kima-color-primary)}.kima-dynamic-input__row[data-v-97d6f5bf]{gap:var(--kima-space-2);padding:var(--kima-space-3);min-width:0;display:grid}.kima-dynamic-input__actions[data-v-97d6f5bf]{gap:var(--kima-space-1);flex-wrap:wrap;display:flex}.kima-dynamic-input__row.kima-list-enter-active[data-v-97d6f5bf],.kima-dynamic-input__row.kima-list-leave-active[data-v-97d6f5bf]{transition:opacity var(--kima-duration-medium) var(--kima-curve-standard), transform var(--kima-duration-medium) var(--kima-curve-emphasized)}.kima-dynamic-input__row.kima-list-move[data-v-97d6f5bf]{transition:transform var(--kima-duration-slow) var(--kima-curve-emphasized)}
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-c082836f{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-carousel[data-v-c082836f]{box-sizing:border-box;min-width:0;color:var(--kima-color-on-surface);font-family:var(--kima-font-family);font-weight:var(--kima-font-weight-semi-bold);font-size:var(--kima-font-size-body-large);background:var(--kima-color-layer-1);border-radius:var(--kima-radius-m);width:100%;min-width:0;padding:var(--kima-space-4);border:0;display:block}.kima-carousel[data-v-c082836f]:focus-visible{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:var(--kima-focus-ring-offset)}.kima-carousel__viewport[data-v-c082836f]{padding:var(--kima-space-6);box-sizing:border-box;background:var(--kima-color-layer-1);border-radius:var(--kima-radius-m);overflow-wrap:anywhere;min-height:180px}.kima-carousel__controls[data-v-c082836f]{justify-content:space-between;align-items:center;gap:var(--kima-space-3);margin-top:var(--kima-space-4);flex-wrap:wrap;display:flex}.kima-carousel__viewport[data-v-c082836f]{display:grid}.kima-carousel__slide[data-v-c082836f]{grid-area:1/1;min-width:0}.kima-carousel__slide.kima-fade-leave-active[data-v-c082836f]{inset-block-start:var(--kima-space-6);inset-inline:var(--kima-space-6);position:absolute}
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-abea9686{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-app-shell[data-v-abea9686]{grid-template-columns:minmax(0, var(--kima-shell-sidebar-width)) minmax(0, 1fr);gap:var(--kima-space-4);color:var(--kima-color-on-surface);font-family:var(--kima-font-family);grid-template-areas:"header header""sidebar main""footer footer";display:grid;position:relative}.kima-app-shell--narrow[data-v-abea9686]{grid-template-columns:minmax(0,1fr);grid-template-areas:"header""main""footer"}.kima-app-shell__header[data-v-abea9686]{align-items:center;gap:var(--kima-space-3);grid-area:header;display:flex}.kima-app-shell__sidebar[data-v-abea9686]{background:var(--kima-color-layer-1);padding:var(--kima-space-4);border-radius:var(--kima-radius-l);border:0;grid-area:sidebar}.kima-app-shell__main[data-v-abea9686]{grid-area:main;min-width:0}.kima-app-shell__main[data-v-abea9686]:focus-visible{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:var(--kima-focus-ring-offset)}.kima-app-shell__footer[data-v-abea9686]{grid-area:footer}.kima-app-shell__skip[data-v-abea9686]{z-index:100;padding:var(--kima-space-3);color:var(--kima-color-on-primary);background:var(--kima-color-primary);clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.kima-app-shell__skip[data-v-abea9686]:focus{clip-path:none;width:auto;height:auto;overflow:visible}
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-0fd95ccf{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-sidebar[data-v-0fd95ccf]{background:var(--kima-color-layer-1);box-sizing:border-box;width:288px;max-width:100%;padding:var(--kima-space-3);border-radius:var(--kima-radius-l);transition:width var(--kima-duration-slow) var(--kima-curve-emphasized);border:0}.kima-sidebar--collapsed[data-v-0fd95ccf]{width:180px}.kima-sidebar--mobile[data-v-0fd95ccf]{width:100%}.kima-sidebar__body[data-v-0fd95ccf]:not(dialog){gap:var(--kima-space-4);flex-direction:column;display:flex}.kima-sidebar footer[data-v-0fd95ccf]{margin-top:auto}@media (prefers-reduced-motion:reduce){.kima-sidebar[data-v-0fd95ccf]{transition:none}}
@@ -1 +0,0 @@
1
- @keyframes kima-ripple-glow-2bf26869{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-log-viewer[data-v-2bf26869]{background:var(--kima-color-layer-1);color:var(--kima-color-on-surface);font-family:var(--kima-font-family);padding:var(--kima-space-4);border-radius:var(--kima-radius-m);border:0}.kima-log-viewer__tools[data-v-2bf26869]{gap:var(--kima-space-2);flex-wrap:wrap;display:flex}.kima-log-viewer__tools input[data-v-2bf26869]{box-sizing:border-box;width:100%;min-height:48px;margin-bottom:var(--kima-space-2);padding:var(--kima-space-3);border-radius:var(--kima-radius-m);background:var(--kima-color-layer-2);color:var(--kima-color-on-surface);font:inherit;border:0}.kima-log-viewer__tools input[data-v-2bf26869]:focus{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:-2px}.kima-log-viewer__tools input[data-v-2bf26869]{width:min(100%,240px)}.kima-log-viewer__viewport[data-v-2bf26869]:focus-visible{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:var(--kima-focus-ring-offset)}.kima-log-viewer__viewport[data-v-2bf26869]{overflow-anchor:none;height:260px;overflow:auto}.kima-log-viewer__line[data-v-2bf26869]{white-space:pre-wrap;overflow-wrap:anywhere;min-height:28px}