@koishi-ce/client 1.0.2 → 1.0.3

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 (114) hide show
  1. package/README.md +56 -0
  2. package/app/home/home.vue +4 -0
  3. package/app/home/index.ts +4 -0
  4. package/app/home/welcome.en-US.yml +4 -0
  5. package/app/home/welcome.vue +4 -0
  6. package/app/home/welcome.zh-CN.yml +4 -0
  7. package/app/index.scss +4 -0
  8. package/app/index.ts +4 -0
  9. package/app/layout/header.vue +4 -0
  10. package/app/layout/index.ts +4 -0
  11. package/app/layout/layout.vue +4 -0
  12. package/app/layout/menu-item.vue +4 -0
  13. package/app/settings/index.ts +4 -0
  14. package/app/settings/settings.vue +4 -0
  15. package/app/settings/theme.vue +4 -0
  16. package/app/shims.d.ts +3 -0
  17. package/app/status/index.ts +4 -0
  18. package/app/status/loading.vue +4 -0
  19. package/app/status/status.vue +4 -0
  20. package/app/styles/element.scss +4 -0
  21. package/app/styles/hc.scss +4 -0
  22. package/app/styles/index.scss +4 -0
  23. package/app/styles/index.ts +4 -0
  24. package/app/styles/layout.scss +4 -0
  25. package/app/theme/activity/button.vue +4 -0
  26. package/app/theme/activity/index.vue +4 -0
  27. package/app/theme/activity/item.vue +4 -0
  28. package/app/theme/activity/separator.vue +4 -0
  29. package/app/theme/activity/utils.ts +4 -0
  30. package/app/theme/blank.vue +4 -0
  31. package/app/theme/index.ts +4 -0
  32. package/app/theme/index.vue +4 -0
  33. package/app/theme/menu/index.vue +4 -0
  34. package/app/theme/menu/menu-item.vue +4 -0
  35. package/app/theme/menu/menu.vue +4 -0
  36. package/app/theme/status.vue +4 -0
  37. package/client/components/chat/image.vue +4 -0
  38. package/client/components/chat/overlay.vue +4 -0
  39. package/client/components/chat/utils.ts +4 -0
  40. package/client/components/common/index.ts +4 -0
  41. package/client/components/common/k-button.vue +4 -0
  42. package/client/components/common/k-hint.vue +4 -0
  43. package/client/components/common/k-tab.vue +4 -0
  44. package/client/components/dynamic.vue +4 -0
  45. package/client/components/icons/activity/default.vue +4 -0
  46. package/client/components/icons/activity/ellipsis.vue +4 -0
  47. package/client/components/icons/activity/home.vue +4 -0
  48. package/client/components/icons/activity/moon.vue +4 -0
  49. package/client/components/icons/activity/settings.vue +4 -0
  50. package/client/components/icons/activity/sun.vue +4 -0
  51. package/client/components/icons/index.ts +4 -0
  52. package/client/components/icons/style.scss +4 -0
  53. package/client/components/icons/svg/arrow-left.vue +4 -0
  54. package/client/components/icons/svg/arrow-right.vue +4 -0
  55. package/client/components/icons/svg/box-open.vue +4 -0
  56. package/client/components/icons/svg/check-full.vue +4 -0
  57. package/client/components/icons/svg/chevron-down.vue +4 -0
  58. package/client/components/icons/svg/chevron-left.vue +4 -0
  59. package/client/components/icons/svg/chevron-right.vue +4 -0
  60. package/client/components/icons/svg/chevron-up.vue +4 -0
  61. package/client/components/icons/svg/clipboard-list.vue +4 -0
  62. package/client/components/icons/svg/edit.vue +4 -0
  63. package/client/components/icons/svg/exclamation-full.vue +4 -0
  64. package/client/components/icons/svg/expand.vue +4 -0
  65. package/client/components/icons/svg/file-archive.vue +4 -0
  66. package/client/components/icons/svg/filter.vue +4 -0
  67. package/client/components/icons/svg/github.vue +4 -0
  68. package/client/components/icons/svg/gitlab.vue +4 -0
  69. package/client/components/icons/svg/info-full.vue +4 -0
  70. package/client/components/icons/svg/koishi.vue +4 -0
  71. package/client/components/icons/svg/link.vue +4 -0
  72. package/client/components/icons/svg/paper-plane.vue +4 -0
  73. package/client/components/icons/svg/question-empty.vue +4 -0
  74. package/client/components/icons/svg/redo.vue +4 -0
  75. package/client/components/icons/svg/search-minus.vue +4 -0
  76. package/client/components/icons/svg/search-plus.vue +4 -0
  77. package/client/components/icons/svg/search.vue +4 -0
  78. package/client/components/icons/svg/star-empty.vue +4 -0
  79. package/client/components/icons/svg/star-full.vue +4 -0
  80. package/client/components/icons/svg/start.vue +4 -0
  81. package/client/components/icons/svg/tag.vue +4 -0
  82. package/client/components/icons/svg/times-full.vue +4 -0
  83. package/client/components/icons/svg/tools.vue +4 -0
  84. package/client/components/icons/svg/undo.vue +4 -0
  85. package/client/components/icons/svg/user.vue +4 -0
  86. package/client/components/index.ts +4 -0
  87. package/client/components/layout/card.vue +4 -0
  88. package/client/components/layout/content.vue +4 -0
  89. package/client/components/layout/empty.vue +4 -0
  90. package/client/components/layout/index.ts +4 -0
  91. package/client/components/layout/tab-group.vue +4 -0
  92. package/client/components/layout/tab-item.vue +4 -0
  93. package/client/components/link.ts +4 -0
  94. package/client/components/perms.vue +4 -0
  95. package/client/components/slot.ts +4 -0
  96. package/client/context.ts +4 -0
  97. package/client/data.ts +4 -0
  98. package/client/index.ts +4 -0
  99. package/client/plugins/action.ts +4 -0
  100. package/client/plugins/i18n.ts +4 -0
  101. package/client/plugins/loader.ts +4 -0
  102. package/client/plugins/router.ts +4 -0
  103. package/client/plugins/setting.ts +4 -0
  104. package/client/plugins/theme.ts +4 -0
  105. package/client/shims.d.ts +3 -0
  106. package/client/utils.ts +4 -0
  107. package/global.d.ts +4 -0
  108. package/lib/bin.mjs +6 -2
  109. package/lib/index.mjs +1 -1
  110. package/lib/{src-lTfcJ1xA.mjs → src-DXaM1Kgh.mjs} +6 -0
  111. package/package.json +6 -2
  112. package/src/bin.ts +3 -0
  113. package/src/index.ts +14 -0
  114. package/src/yaml.ts +3 -0
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @koishi-ce/client
2
+
3
+ **简体中文** | [English](#english)
4
+
5
+ Koishi 控制台的浏览器端运行时与组件基座,移植自上游 [koishijs/webui](https://github.com/koishijs/webui) 的 `packages/client`。它承载控制台前端的全部基础设施——根 Context、服务与插件系统、路由与活动栏、状态管理、主题、动作与菜单——同时提供把各控制台插件的前端组装为可部署产物的编程式构建器。
6
+
7
+ 与 [`@koishi-ce/plugin-console`](https://github.com/Koishi-CE/koishi/tree/main/plugins/webui/console)(node 侧宿主)的分工:本包运行在浏览器,是前端基座;plugin-console 运行在 node,负责 WebSocket 通道与静态资源托管。宿主总装产物直接写入 plugin-console 的 `dist` 目录。
8
+
9
+ ## 主要导出
10
+
11
+ - `root` 与 `Context`:唯一根上下文实例与其类型;
12
+ - `defineExtension`:控制台插件前端扩展的定义入口;
13
+ - `Service`:前端侧服务基类;
14
+ - 路由与活动:`RouterService`、`Activity`、`redirectTo`;
15
+ - 状态:`store`(reactive 全局状态)及 `socket` / `send` / `receive` / `connect`;
16
+ - 设置与主题:`createStorage`、`useConfig`、`SettingService`、`useColorMode`、`ThemeService`;
17
+ - 动作与菜单:`useMenu` 与 ActionService(动作面板、菜单注册、全局快捷键分发);
18
+ - 国际化:I18nService;
19
+ - element-plus 的 `loading` / `message` / `messageBox` 服务封装;
20
+ - `Satori` / `Universal` 命名空间与 `ScopeStatus` 常量。
21
+
22
+ ## 构建器
23
+
24
+ 本包没有独立的运行时发布形态,而是作为源码被各前端工程消费:
25
+
26
+ - CLI:`koishi-console build [root]`(`src/bin.ts`)——带 root 时构建单个插件的前端,否则执行宿主控制台总装(产物硬编码到 `plugins/webui/console/dist`,含共享 chunk 与样式);
27
+ - 编程式:`build(root, config)` 构建单个插件前端,`createServer(baseDir)` 创建 Vite 开发中间件;
28
+ - `collectWorkspaceAliases()`:读取根 package.json 的 workspaces,为每个工作区包名建立指向其 `client/index.ts` 的别名——未被依赖的 workspace 包不会出现在 node_modules 链接里,必须显式映射才能被 bundler 解析。
29
+
30
+ ## 许可证
31
+
32
+ [AGPL-3.0](https://github.com/Koishi-CE/koishi/blob/main/LICENSES/AGPL-3.0.txt)。本包是上游 koishijs/webui 的社区再分发,版权归 Shigma 及 Koishijs 贡献者(上游)与 Koishi-CE 贡献者,见 [NOTICE](https://github.com/Koishi-CE/koishi/blob/main/NOTICE)。
33
+
34
+ ---
35
+
36
+ ## English
37
+
38
+ The browser-side runtime and component foundation of the Koishi console, ported from `packages/client` of the upstream [koishijs/webui](https://github.com/koishijs/webui). It hosts the entire frontend infrastructure — the root Context, services and plugin system, router and activity bar, state management, themes, actions and menus — and ships a programmatic builder that assembles console plugin frontends into deployable bundles.
39
+
40
+ Division of labor with [`@koishi-ce/plugin-console`](https://github.com/Koishi-CE/koishi/tree/main/plugins/webui/console) (the node-side host): this package runs in the browser as the frontend foundation, while plugin-console runs on node serving the WebSocket channel and static assets. Host assembly output is written straight into plugin-console's `dist` directory.
41
+
42
+ ## Key exports
43
+
44
+ `root` and `Context` (the single root context), `defineExtension` (entry for console plugin frontends), the frontend `Service` base, `RouterService` / `Activity` / `redirectTo`, the reactive `store` with `socket` / `send` / `receive` / `connect`, settings and theming (`createStorage`, `useConfig`, `SettingService`, `useColorMode`, `ThemeService`), actions and menus (`useMenu`, ActionService with global shortcut dispatch), I18nService, element-plus service wrappers (`loading` / `message` / `messageBox`), plus the `Satori` / `Universal` namespaces and `ScopeStatus`.
45
+
46
+ ## Builder
47
+
48
+ The package is consumed as source code rather than shipped as a standalone runtime:
49
+
50
+ - CLI: `koishi-console build [root]` — builds a single plugin frontend when a root is given, otherwise performs the host console assembly (output hardcoded to `plugins/webui/console/dist`).
51
+ - Programmatic: `build(root, config)` and `createServer(baseDir)` (a Vite dev middleware).
52
+ - `collectWorkspaceAliases()` — maps every workspace package to its `client/index.ts`; workspace packages absent from node_modules links can only be resolved through this explicit alias map.
53
+
54
+ ## License
55
+
56
+ [AGPL-3.0](https://github.com/Koishi-CE/koishi/blob/main/LICENSES/AGPL-3.0.txt). Community redistribution of upstream koishijs/webui; copyright Shigma and Koishijs contributors (upstream) and Koishi-CE contributors — see [NOTICE](https://github.com/Koishi-CE/koishi/blob/main/NOTICE).
package/app/home/home.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
  控制台首页:WebSocket 就绪后渲染 "home" 插槽内容(默认为欢迎卡片),
3
7
  未连接时显示连接提示卡片。
package/app/home/index.ts 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
  * 首页插件:将 welcome 欢迎页注册为根路由 "/"。
3
7
  * order 取极大值(活动栏 top 组渲染时按 order 逆序输出,故首页位于最顶部)。
@@ -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
  title: Welcome to Koishi!
2
6
  description: Your chatbot is ready to go. 点击下面的任一选项,开启你的 Koishi 之旅吧。
3
7
  action:
@@ -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
  欢迎卡片:文档 / 社区论坛等入口链接。
3
7
  自带 zh-CN 与 en-US 两套文案(局部 vue-i18n 实例,独立于全局语言包),
@@ -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
  title: 欢迎使用 Koishi!
2
6
  description: 你的机器人已经准备就绪。点击下面的任一选项,开启你的 Koishi 之旅吧。
3
7
  action:
package/app/index.scss 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
  body {
2
6
  margin: 0;
3
7
  min-height: 100vh;
package/app/index.ts 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
  * 控制台前端宿主应用入口(scripts/client.ts 总装构建的主入口)。
3
7
  *
@@ -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
  布局顶栏:左侧标题(默认取当前路由名)、右侧菜单区,
3
7
  移动端额外提供侧栏开关按钮与溢出菜单("...")按钮。
@@ -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
  * 布局插件:向全局 "layout" 插槽注册三栏布局组件。
3
7
  * order 取极小值保证它先于其它同插槽内容排序(作为页面骨架)。
@@ -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-layout> 的内置实现):
3
7
  可选的左右侧栏 + 顶部 header + 主区域。
@@ -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
  顶栏菜单按钮(图标型):hidden/disabled/label/icon 均支持 getter,
3
7
  点击时以 action scope 为参调用对应 action。
@@ -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
  * 设置插件:
3
7
  * - 注册用户设置页(/settings/:name*,活动栏底部);
@@ -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
  用户设置页:左侧 el-tree 分组导航 + 右侧当前分组的内容。
3
7
  分组内的条目三种形态二选一渲染:组件型(component)、表单型(schema),
@@ -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
  主题选择器:role 为 "theme" 的字符串 schema 的专用渲染组件。
3
7
  下拉选项按明 / 暗模式过滤(主题 id 以 -light / -dark 结尾),
package/app/shims.d.ts CHANGED
@@ -1 +1,4 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026-present Koishi-CE contributors.
3
+
1
4
  /// <reference path="../client/shims.d.ts" />
@@ -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
  * 状态栏插件:向全局 "status" 插槽注册状态栏主体(可悬停出 tooltip 的
3
7
  * 状态项容器),并向 "status-right" 插槽注册页面组件加载进度条。
@@ -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
  页面组件按需加载进度条:按当前路由所需扩展(ctx.$loader.extensions)
3
7
  的完成比例显示进度;store.entry 尚未就绪时以不确定进度(indeterminate)展示。
@@ -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-status> 的内置实现):
3
7
  内容区 + 悬停时的 tooltip(内容经 el-scrollbar 限高滚动)。
@@ -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
  :root {
2
6
  --el-text-color-regular: var(--fg1);
3
7
  --el-text-color-primary: var(--fg2);
@@ -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
  :root, .theme-root.light {
2
6
  &[theme=hc-light] {
3
7
  --bg0: white;
@@ -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
  @use 'sass:color';
2
6
  @use './layout.scss';
3
7
  @use './element.scss';
@@ -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
  * 全局样式插件:引入 app 级 SCSS,并注册四套内置主题
3
7
  * (默认 / 高对比 × 明亮 / 暗色),供主题选择器列出与切换。
@@ -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
  :root {
2
6
  --aside-width: 17.5rem;
3
7
  --activity-width: 4rem;
@@ -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
  活动栏单个图标按钮,也是拖拽排序的拖拽源:
3
7
  拖起时向 dataTransfer 写入 "activity:<id>" 文本供落点组件识别。
@@ -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
  活动栏(最左侧图标栏):分 top / bottom 两区渲染活动项,
3
7
  项与项之间的分隔槽(activity-separator)同时充当拖拽排序的落点。
@@ -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
  活动栏条目:children[0] 为组的主图标,其余为并入该组的子活动,
3
7
  悬停 tooltip 中列出组内成员。条目本身也是拖拽落点——
@@ -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
  活动栏条目间的分隔槽:平时不可见,拖拽悬停时显示横线提示,
3
7
  松手即把被拖项移动到该位置(拖拽排序的核心落点组件)。
@@ -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
  * 活动栏(activity bar)相关的类型扩充:
3
7
  * - 为 ActionContext 补充 "theme.activity" 菜单的求值上下文类型;
@@ -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
  <!-- 404 空白页:控制台本体加载成功但没有任何扩展页面时的兜底展示 -->
2
6
  <template>
3
7
  <div class="blank">
@@ -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
  * 主题插件(控制台外壳):
3
7
  * - 向 "root" 插槽注册应用根组件(活动栏 + 路由视图 + 状态栏 + 全局菜单层);
@@ -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)时,
@@ -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),
@@ -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)与自身实际尺寸,
@@ -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
  底部状态栏容器:左右两组插槽(status-left / status-right),
3
7
  移动端(<=768px)整条隐藏。
@@ -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
  chat-image:聊天消息中的图片。
3
7
  普通点击打开内置大图查看器(overlay.vue,经 global 插槽全局挂载);
@@ -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 阶段从原坐标过渡到居中),
@@ -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 { reactive } from "vue";
2
6
 
3
7
  /** chat 子模块的跨组件共享状态:当前在大图查看器(overlay)中展示的图片 */
@@ -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 有值)时变为
@@ -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-tab:水平选项卡(文字式切换器)。
3
7
  data 为 "键 → 文案" 映射,点击某项时通过 v-model 更新选中键;
@@ -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,
@@ -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
  *
@@ -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
  .k-icon {
2
6
  height: 1em;
3
7
  }
@@ -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">