@koishi-ce/client 1.0.2 → 1.0.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/README.md +56 -0
- package/app/home/home.vue +4 -0
- package/app/home/index.ts +4 -0
- package/app/home/welcome.en-US.yml +4 -0
- package/app/home/welcome.vue +16 -6
- package/app/home/welcome.zh-CN.yml +4 -0
- package/app/index.scss +4 -0
- package/app/index.ts +12 -2
- package/app/layout/header.vue +16 -4
- package/app/layout/index.ts +4 -0
- package/app/layout/layout.vue +8 -1
- package/app/layout/menu-item.vue +7 -1
- package/app/settings/index.ts +4 -0
- package/app/settings/settings.vue +10 -4
- package/app/settings/theme.vue +8 -1
- package/app/shims.d.ts +3 -0
- package/app/status/index.ts +4 -0
- package/app/status/loading.vue +8 -1
- package/app/status/status.vue +4 -0
- package/app/styles/element.scss +4 -0
- package/app/styles/hc.scss +4 -0
- package/app/styles/index.scss +4 -0
- package/app/styles/index.ts +4 -0
- package/app/styles/layout.scss +4 -0
- package/app/theme/activity/button.vue +8 -1
- package/app/theme/activity/index.vue +16 -4
- package/app/theme/activity/item.vue +22 -4
- package/app/theme/activity/separator.vue +48 -12
- package/app/theme/activity/utils.ts +4 -0
- package/app/theme/blank.vue +4 -0
- package/app/theme/index.ts +9 -1
- package/app/theme/index.vue +7 -1
- package/app/theme/menu/index.vue +4 -0
- package/app/theme/menu/menu-item.vue +14 -4
- package/app/theme/menu/menu.vue +13 -4
- package/app/theme/status.vue +4 -0
- package/client/components/chat/image.vue +4 -0
- package/client/components/chat/overlay.vue +34 -8
- package/client/components/chat/utils.ts +4 -0
- package/client/components/common/index.ts +4 -0
- package/client/components/common/k-button.vue +4 -0
- package/client/components/common/k-hint.vue +7 -1
- package/client/components/common/k-tab.vue +4 -0
- package/client/components/dynamic.vue +6 -1
- package/client/components/icons/activity/default.vue +4 -0
- package/client/components/icons/activity/ellipsis.vue +4 -0
- package/client/components/icons/activity/home.vue +4 -0
- package/client/components/icons/activity/moon.vue +4 -0
- package/client/components/icons/activity/settings.vue +4 -0
- package/client/components/icons/activity/sun.vue +4 -0
- package/client/components/icons/index.ts +11 -2
- package/client/components/icons/style.scss +4 -0
- package/client/components/icons/svg/arrow-left.vue +4 -0
- package/client/components/icons/svg/arrow-right.vue +4 -0
- package/client/components/icons/svg/box-open.vue +4 -0
- package/client/components/icons/svg/check-full.vue +4 -0
- package/client/components/icons/svg/chevron-down.vue +4 -0
- package/client/components/icons/svg/chevron-left.vue +4 -0
- package/client/components/icons/svg/chevron-right.vue +4 -0
- package/client/components/icons/svg/chevron-up.vue +4 -0
- package/client/components/icons/svg/clipboard-list.vue +4 -0
- package/client/components/icons/svg/edit.vue +4 -0
- package/client/components/icons/svg/exclamation-full.vue +4 -0
- package/client/components/icons/svg/expand.vue +4 -0
- package/client/components/icons/svg/file-archive.vue +4 -0
- package/client/components/icons/svg/filter.vue +4 -0
- package/client/components/icons/svg/github.vue +4 -0
- package/client/components/icons/svg/gitlab.vue +4 -0
- package/client/components/icons/svg/info-full.vue +4 -0
- package/client/components/icons/svg/koishi.vue +4 -0
- package/client/components/icons/svg/link.vue +4 -0
- package/client/components/icons/svg/paper-plane.vue +4 -0
- package/client/components/icons/svg/question-empty.vue +4 -0
- package/client/components/icons/svg/redo.vue +4 -0
- package/client/components/icons/svg/search-minus.vue +4 -0
- package/client/components/icons/svg/search-plus.vue +4 -0
- package/client/components/icons/svg/search.vue +4 -0
- package/client/components/icons/svg/star-empty.vue +4 -0
- package/client/components/icons/svg/star-full.vue +4 -0
- package/client/components/icons/svg/start.vue +4 -0
- package/client/components/icons/svg/tag.vue +4 -0
- package/client/components/icons/svg/times-full.vue +4 -0
- package/client/components/icons/svg/tools.vue +4 -0
- package/client/components/icons/svg/undo.vue +4 -0
- package/client/components/icons/svg/user.vue +4 -0
- package/client/components/index.ts +12 -2
- package/client/components/layout/card.vue +4 -0
- package/client/components/layout/content.vue +4 -0
- package/client/components/layout/empty.vue +4 -0
- package/client/components/layout/index.ts +4 -0
- package/client/components/layout/tab-group.vue +4 -0
- package/client/components/layout/tab-item.vue +4 -0
- package/client/components/link.ts +9 -2
- package/client/components/perms.vue +26 -5
- package/client/components/slot.ts +23 -4
- package/client/context.ts +16 -4
- package/client/data.ts +61 -26
- package/client/index.ts +6 -1
- package/client/plugins/action.ts +50 -13
- package/client/plugins/i18n.ts +4 -0
- package/client/plugins/loader.ts +71 -45
- package/client/plugins/router.ts +38 -11
- package/client/plugins/setting.ts +49 -12
- package/client/plugins/theme.ts +25 -6
- package/client/shims.d.ts +3 -0
- package/client/utils.ts +11 -2
- package/global.d.ts +4 -0
- package/lib/bin.mjs +7 -3
- package/lib/{client-CaTn_gVG.mjs → client-C97iYPCr.mjs} +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{src-lTfcJ1xA.mjs → src-BOakssV3.mjs} +8 -2
- package/package.json +6 -2
- package/src/bin.ts +13 -3
- package/src/index.ts +72 -14
- package/src/yaml.ts +3 -0
package/app/theme/index.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (c) 2019-present Shigma and Koishijs contributors.
|
|
3
|
+
// Copyright (c) 2026-present Koishi-CE contributors.
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* 主题插件(控制台外壳):
|
|
3
7
|
* - 向 "root" 插槽注册应用根组件(活动栏 + 路由视图 + 状态栏 + 全局菜单层);
|
|
4
8
|
* - 注册活动栏右键菜单 "theme.activity" 及其动作(重置活动栏自定义配置)。
|
|
5
9
|
*/
|
|
6
10
|
|
|
7
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
type Context,
|
|
13
|
+
router,
|
|
14
|
+
useConfig,
|
|
15
|
+
} from "@koishi-ce/client";
|
|
8
16
|
import App from "./index.vue";
|
|
9
17
|
|
|
10
18
|
export default function (ctx: Context) {
|
package/app/theme/index.vue
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
控制台根组件:活动栏 + 路由页面(keep-alive 缓存) + 状态栏 + 全局菜单层。
|
|
3
7
|
路由声明了所需 store 字段(route.meta.activity.fields)时,
|
|
@@ -29,6 +33,8 @@ const route = useRoute();
|
|
|
29
33
|
// 否则要求 meta.activity.fields 中每个 store 字段都有数据
|
|
30
34
|
const loaded = computed(() => {
|
|
31
35
|
if (!route.meta.activity?.fields) return true;
|
|
32
|
-
return route.meta.activity.fields.every(
|
|
36
|
+
return route.meta.activity.fields.every(
|
|
37
|
+
(key) => store[key],
|
|
38
|
+
);
|
|
33
39
|
});
|
|
34
40
|
</script>
|
package/app/theme/menu/index.vue
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
全局菜单层:渲染当前处于活动状态的所有上下文菜单(activeMenus)。
|
|
3
7
|
任意 click / contextmenu 事件都视为点击了菜单外区域,关闭全部活动菜单。
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
上下文菜单的单个菜单项:点击时调用对应 action。
|
|
3
7
|
id 支持两种特殊写法:"!" 前缀会被去除(兼容旧的否定式 id),
|
|
@@ -17,7 +21,11 @@
|
|
|
17
21
|
</template>
|
|
18
22
|
|
|
19
23
|
<script lang="ts" setup>
|
|
20
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
type MaybeGetter,
|
|
26
|
+
type MenuItem,
|
|
27
|
+
useContext,
|
|
28
|
+
} from "@koishi-ce/client";
|
|
21
29
|
import { computed } from "vue";
|
|
22
30
|
|
|
23
31
|
const props = defineProps<MenuItem & { prefix: string }>();
|
|
@@ -51,8 +59,10 @@ const icon = computed(() => toValue(props.icon));
|
|
|
51
59
|
function toValue<T>(getter: MaybeGetter<T>): T {
|
|
52
60
|
if (typeof getter !== "function") return getter;
|
|
53
61
|
// 收窄到 MaybeGetter 的函数分支(以作用域为参的 getter)
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
return (
|
|
63
|
+
getter as (
|
|
64
|
+
current: ReturnType<typeof ctx.$action.createScope>,
|
|
65
|
+
) => T
|
|
66
|
+
)(ctx.$action.createScope());
|
|
57
67
|
}
|
|
58
68
|
</script>
|
package/app/theme/menu/menu.vue
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
单个浮动上下文菜单(页面模板中 <k-menu> 的内置实现):
|
|
3
7
|
依据触发点的锚点矩形(props.relative)与自身实际尺寸,
|
|
@@ -13,7 +17,10 @@
|
|
|
13
17
|
</template>
|
|
14
18
|
|
|
15
19
|
<script lang="ts" setup>
|
|
16
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
type ActiveMenu,
|
|
22
|
+
useContext,
|
|
23
|
+
} from "@koishi-ce/client";
|
|
17
24
|
import { ref } from "vue";
|
|
18
25
|
import MenuItem from "./menu-item.vue";
|
|
19
26
|
|
|
@@ -27,9 +34,11 @@ const el = ref<HTMLElement>();
|
|
|
27
34
|
// 结合菜单自身渲染后的实际宽高计算定位;尚未挂载时先隐藏避免闪烁
|
|
28
35
|
const getStyle = () => {
|
|
29
36
|
if (!el.value) return { visibility: "hidden" };
|
|
30
|
-
const { height, width } =
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
const { height, width } =
|
|
38
|
+
el.value.getBoundingClientRect();
|
|
39
|
+
const style: Partial<
|
|
40
|
+
Record<"top" | "right" | "bottom" | "left", string>
|
|
41
|
+
> = {};
|
|
33
42
|
if (props.relative.right + width > window.innerWidth) {
|
|
34
43
|
style.right = `${window.innerWidth - props.relative.left}px`;
|
|
35
44
|
} else {
|
package/app/theme/status.vue
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
overlay.vue:全屏图片查看器(经 router 的 global 插槽挂载)。
|
|
3
7
|
打开时把图片从原位"飞入"屏幕中心(appear 阶段从原坐标过渡到居中),
|
|
@@ -38,7 +42,13 @@
|
|
|
38
42
|
</template>
|
|
39
43
|
|
|
40
44
|
<script lang="ts" setup>
|
|
41
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
computed,
|
|
47
|
+
onBeforeUnmount,
|
|
48
|
+
onMounted,
|
|
49
|
+
ref,
|
|
50
|
+
watch,
|
|
51
|
+
} from "vue";
|
|
42
52
|
import { shared } from "./utils";
|
|
43
53
|
|
|
44
54
|
// 用户手动调整的缩放与旋转量(复原即回到 1 / 0)
|
|
@@ -54,7 +64,9 @@ const transform = computed(() => {
|
|
|
54
64
|
const siblings = computed(() => {
|
|
55
65
|
if (!shared.overlayImage) return;
|
|
56
66
|
const elements = Array.from(
|
|
57
|
-
document.querySelectorAll<HTMLImageElement>(
|
|
67
|
+
document.querySelectorAll<HTMLImageElement>(
|
|
68
|
+
".chat-image",
|
|
69
|
+
),
|
|
58
70
|
);
|
|
59
71
|
const index = elements.indexOf(shared.overlayImage);
|
|
60
72
|
return {
|
|
@@ -65,10 +77,15 @@ const siblings = computed(() => {
|
|
|
65
77
|
|
|
66
78
|
// 初始(适配屏幕)缩放比:按视口剩余空间把图片等比缩小,不放大
|
|
67
79
|
const defaultScale = computed(() => {
|
|
68
|
-
const { naturalHeight, naturalWidth } =
|
|
80
|
+
const { naturalHeight, naturalWidth } =
|
|
81
|
+
shared.overlayImage;
|
|
69
82
|
const maxHeight = innerHeight - paddingVertical * 2;
|
|
70
83
|
const maxWidth = innerWidth - paddingHorizontal * 2;
|
|
71
|
-
return Math.min(
|
|
84
|
+
return Math.min(
|
|
85
|
+
1,
|
|
86
|
+
maxHeight / naturalHeight,
|
|
87
|
+
maxWidth / naturalWidth,
|
|
88
|
+
);
|
|
72
89
|
});
|
|
73
90
|
|
|
74
91
|
// 切换/关闭查看器时重置手动缩放与旋转;
|
|
@@ -92,7 +109,10 @@ function setImage(el: HTMLImageElement) {
|
|
|
92
109
|
}
|
|
93
110
|
|
|
94
111
|
/** 把大图元素摆到原图片所在的位置与尺寸(关闭时的"飞回"动画终点) */
|
|
95
|
-
function moveToOrigin(
|
|
112
|
+
function moveToOrigin(
|
|
113
|
+
el: HTMLImageElement,
|
|
114
|
+
origin = shared.overlayImage,
|
|
115
|
+
) {
|
|
96
116
|
const { height, width } = origin;
|
|
97
117
|
const { left, top } = origin.getBoundingClientRect();
|
|
98
118
|
el.style.width = `${width}px`;
|
|
@@ -108,7 +128,8 @@ const paddingHorizontal = 0;
|
|
|
108
128
|
|
|
109
129
|
/** 把图片按适配缩放比居中摆放到视口中央 */
|
|
110
130
|
function moveToCenter(el: HTMLImageElement) {
|
|
111
|
-
const { naturalHeight, naturalWidth } =
|
|
131
|
+
const { naturalHeight, naturalWidth } =
|
|
132
|
+
shared.overlayImage;
|
|
112
133
|
const scale = defaultScale.value;
|
|
113
134
|
const width = naturalWidth * scale;
|
|
114
135
|
const height = naturalHeight * scale;
|
|
@@ -132,13 +153,18 @@ function onKeyDown(ev: KeyboardEvent) {
|
|
|
132
153
|
ev.preventDefault();
|
|
133
154
|
if (ev.key === "ArrowUp" || ev.key === "ArrowLeft") {
|
|
134
155
|
setImage(siblings.value.prev);
|
|
135
|
-
} else if (
|
|
156
|
+
} else if (
|
|
157
|
+
ev.key === "ArrowDown" ||
|
|
158
|
+
ev.key === "ArrowRight"
|
|
159
|
+
) {
|
|
136
160
|
setImage(siblings.value.next);
|
|
137
161
|
} else if (ev.key === "Escape") {
|
|
138
162
|
setImage(null);
|
|
139
163
|
} else if (ev.key === "Enter") {
|
|
140
164
|
// 关闭并把页面滚动到原图所在位置,便于继续浏览消息
|
|
141
|
-
shared.overlayImage.offsetParent.scrollIntoView({
|
|
165
|
+
shared.overlayImage.offsetParent.scrollIntoView({
|
|
166
|
+
behavior: "smooth",
|
|
167
|
+
});
|
|
142
168
|
setImage(null);
|
|
143
169
|
}
|
|
144
170
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (c) 2019-present Shigma and Koishijs contributors.
|
|
3
|
+
// Copyright (c) 2026-present Koishi-CE contributors.
|
|
4
|
+
|
|
1
5
|
import type { App } from "vue";
|
|
2
6
|
import Button from "./k-button.vue";
|
|
3
7
|
import Hint from "./k-hint.vue";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
k-button:通用按钮组件。
|
|
3
7
|
通过 type(primary / warning / success / error)着色,支持 solid(实心)、
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
k-hint:带悬浮提示(tooltip)的问号图标。
|
|
3
7
|
默认是纯展示的提示图标;当传入 v-model(modelValue 有值)时变为
|
|
@@ -28,7 +32,9 @@ const props = defineProps({
|
|
|
28
32
|
const emit = defineEmits(["update:modelValue"]);
|
|
29
33
|
|
|
30
34
|
// modelValue 被显式传入时才呈现手型光标并响应点击(开关语义)
|
|
31
|
-
const pointer = computed(
|
|
35
|
+
const pointer = computed(
|
|
36
|
+
() => props.modelValue !== undefined,
|
|
37
|
+
);
|
|
32
38
|
|
|
33
39
|
function onClick() {
|
|
34
40
|
if (!pointer.value) return;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!--
|
|
2
6
|
dynamic.vue:动态 schema 表单控件(any + dynamic 角色)。
|
|
3
7
|
适用于"具体结构由服务端决定"的配置项:本地 schema 只带 meta.extra.name,
|
|
@@ -54,7 +58,8 @@ defineEmits(["update:modelValue"]);
|
|
|
54
58
|
// 按本地 schema 标注的名称,从服务端下发的 schema 仓库中取出完整定义;
|
|
55
59
|
// 元信息做一层合并,保留本地的 meta 覆盖权
|
|
56
60
|
const inner = computed(() => {
|
|
57
|
-
const hydrated =
|
|
61
|
+
const hydrated =
|
|
62
|
+
store.schema?.[props.schema?.meta.extra?.name];
|
|
58
63
|
return hydrated && new Schema(hydrated);
|
|
59
64
|
});
|
|
60
65
|
</script>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏页面默认图标(注册名 "activity:default"):仪表盘样式 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏"更多"图标(注册名 "activity:ellipsis"):三点省略号 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏主页图标(注册名 "activity:home"):田字格仪表盘 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" viewBox="-64 0 1152 1024" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏夜间模式图标(注册名 "activity:moon"):弯月 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏设置页图标(注册名 "activity:settings"):三组滑杆 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- activity 侧栏日间模式图标(注册名 "activity:sun"):太阳 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (c) 2019-present Shigma and Koishijs contributors.
|
|
3
|
+
// Copyright (c) 2026-present Koishi-CE contributors.
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* 图标中心:所有内置图标的注册表与 <k-icon> 组件。
|
|
3
7
|
*
|
|
@@ -112,7 +116,10 @@ register("undo", Undo);
|
|
|
112
116
|
register("user", User);
|
|
113
117
|
|
|
114
118
|
/** 向注册表登记一个图标(markRaw 避免组件被响应式代理) */
|
|
115
|
-
export function register(
|
|
119
|
+
export function register(
|
|
120
|
+
name: string,
|
|
121
|
+
component: Component,
|
|
122
|
+
) {
|
|
116
123
|
registry[name] = markRaw(component);
|
|
117
124
|
}
|
|
118
125
|
|
|
@@ -125,7 +132,9 @@ export function install(app: App) {
|
|
|
125
132
|
name: String,
|
|
126
133
|
},
|
|
127
134
|
render(props: { name?: string }) {
|
|
128
|
-
const component = props.name
|
|
135
|
+
const component = props.name
|
|
136
|
+
? registry[props.name]
|
|
137
|
+
: undefined;
|
|
129
138
|
return component && h(component);
|
|
130
139
|
},
|
|
131
140
|
}),
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 左箭头图标(注册名 "arrow-left"),用于返回上一步 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 右箭头图标(注册名 "arrow-right"),用于前进到下一步 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 打开的收纳盒图标(注册名 "box-open"),用于插件市场类页面 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 实心圆形对勾图标(注册名 "check-full"),用于成功/已选状态 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 向下的尖角箭头图标(注册名 "chevron-down"),用于展开/下拉 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 向左的尖角箭头图标(注册名 "chevron-left"),用于折叠侧栏/上一张 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 向右的尖角箭头图标(注册名 "chevron-right"),用于展开侧栏/下一张 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 向上的尖角箭头图标(注册名 "chevron-up"),用于收起/上拉 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 带列表的写字板图标(注册名 "clipboard-list"),用于日志/列表类页面 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 铅笔编辑图标(注册名 "edit"),用于编辑入口 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 实心圆形感叹号图标(注册名 "exclamation-full"),用于错误/警告状态 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 四角外扩图标(注册名 "expand"),用于复原/全屏切换 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 压缩包文件图标(注册名 "file-archive"),用于导出/备份文件 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 漏斗筛选图标(注册名 "filter"),用于列表过滤开关 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon k-icon-filter" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- GitHub 品牌图标(注册名 "github"),用于源码/Issue 链接 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- GitLab 品牌图标(注册名 "gitlab"),用于 GitLab 相关链接 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 实心圆形信息图标(注册名 "info-full"),用于提示/说明状态 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- Koishi 官方徽标图标(注册名 "koishi"),用于品牌展示与空状态占位 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 双环链条图标(注册名 "link"),用于链接/关联 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 纸飞机图标(注册名 "paper-plane"),用于发送消息/指令 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 空心圆形问号图标(注册名 "question-empty"),k-hint 提示图标的默认图标 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 顺时针旋转箭头图标(注册名 "redo"),用于向右旋转/重做 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 带减号的放大镜图标(注册名 "search-minus"),用于缩小视图 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 带加号的放大镜图标(注册名 "search-plus"),用于放大视图 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 放大镜图标(注册名 "search"),用于搜索入口 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
|
|
2
|
+
<!-- Copyright (c) 2019-present Shigma and Koishijs contributors. -->
|
|
3
|
+
<!-- Copyright (c) 2026-present Koishi-CE contributors. -->
|
|
4
|
+
|
|
1
5
|
<!-- 空心五角星图标(注册名 "star-empty"),用于未收藏/未订阅状态 -->
|
|
2
6
|
<template>
|
|
3
7
|
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
|