@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
@@ -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">
@@ -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-full"),用于已收藏/已订阅状态 -->
2
6
  <template>
3
7
  <svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 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
  <!-- 播放(三角)图标(注册名 "start"),用于启动/运行 -->
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
  <!-- 标签图标(注册名 "tag"),用于标签/标记 -->
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
  <!-- 实心圆形叉号图标(注册名 "times-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
  <!-- 扳手与螺丝刀工具图标(注册名 "tools"),用于维护/调试功能 -->
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
  <!-- 逆时针旋转箭头图标(注册名 "undo"),用于向左旋转/撤销 -->
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
  <!-- 用户人形图标(注册名 "user"),用于用户/登录相关界面 -->
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
  /**
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
  k-card:通用卡片容器。
3
7
  可选 header(标题文字或 header 插槽)与 footer 插槽;
@@ -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-content:页面主内容区容器。
3
7
  水平居中、限宽 55rem,自带垂直滚动(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
  <!--
2
6
  k-empty:空状态占位组件。
3
7
  居中展示 Koishi 徽标图标与默认插槽文案,用于无数据 / 无权限等场景。
@@ -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 Card from "./card.vue";
3
7
  import Content from "./content.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-tab-group:侧栏式选项卡分组。
3
7
  遍历 data(键 → 条目对象),filter 可按条目过滤显示;
@@ -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-item:选项卡条目(配合 k-tab-group 使用)。
3
7
  label 为条目标识兼默认文案,点击时 emit update: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
  import { type App, defineComponent, h } from "vue";
2
6
  import { RouterLink } from "vue-router";
3
7
  import { useContext } from "../context";
@@ -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
  perms.vue:权限选择控件(array + perms 角色)。
3
7
  把服务端下发的扁平权限名(如 "channel.xxx")按 ":" 逐级拆分,
@@ -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, type Component, defineComponent, h } from "vue";
2
6
  import { useContext } from "../context";
3
7
 
package/client/context.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
  import * as cordis from "cordis";
2
6
  import {
3
7
  type App,
package/client/data.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
  /// <reference path="./shims.d.ts" />
2
6
  import type { Promisify, Universal } from "@koishi-ce/koishi";
3
7
  import type {
package/client/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
  * @koishi_ce/client 包的主入口(Koishi 控制台前端组件库)。
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
  * 动作(action)与菜单服务:控制台的快捷键、右键菜单、
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
  import { watchEffect } from "vue";
2
6
  import { createI18n } from "vue-i18n";
3
7
  import type { Context } from "../context";
@@ -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 { EntryData } from "@koishi-ce/plugin-console";
2
6
  import type { EffectScope, Plugin } from "cordis";
3
7
  import type { Dict } from "cosmokit";
@@ -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)与插槽视图的注册中心。
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
  * 设置服务:控制台本地配置(localStorage)与设置面板的管理。
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
  *
package/client/shims.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026-present Koishi-CE contributors.
3
+
1
4
  /**
2
5
  * 浏览器端类型垫片(packages/web/client 自身使用;app 项目通过
3
6
  * app/shims.d.ts 引用本文件):
package/client/utils.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
  import * as cordis from "cordis";
2
6
  import { markRaw } from "vue";
3
7
  import type { Context } from "./context";
package/global.d.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
  /// <reference types="vue-i18n" />
2
6
  /// <reference types="vite/client" />
3
7
  /// <reference types="element-plus/global" />
package/lib/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as build } from "./src-lTfcJ1xA.mjs";
2
+ import { t as build } from "./src-DXaM1Kgh.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { resolve } from "node:path";
5
5
  //#endregion
@@ -16,7 +16,7 @@ import { resolve } from "node:path";
16
16
  const { version } = {
17
17
  name: "@koishi-ce/client",
18
18
  description: "Koishi Console Client",
19
- version: "1.0.2",
19
+ version: "1.0.3",
20
20
  type: "module",
21
21
  main: "client/index.ts",
22
22
  exports: {
@@ -70,6 +70,10 @@ const { version } = {
70
70
  "vue": "^3.5.42",
71
71
  "vue-i18n": "^11.4.10",
72
72
  "vue-router": "^5.2.0"
73
+ },
74
+ devDependencies: {
75
+ "@koishi-ce/koishi": "workspace:*",
76
+ "@koishi-ce/plugin-console": "workspace:*"
73
77
  }
74
78
  };
75
79
  const help = `koishi-console/${version}
package/lib/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as createServer, t as build } from "./src-lTfcJ1xA.mjs";
1
+ import { n as createServer, t as build } from "./src-DXaM1Kgh.mjs";
2
2
  export { build, createServer };
@@ -2,6 +2,7 @@ import { t as yaml } from "./yaml-UzQbvquH.mjs";
2
2
  import { existsSync } from "node:fs";
3
3
  import { mkdir, rm } from "node:fs/promises";
4
4
  import { resolve } from "node:path";
5
+ import { pathToFileURL } from "node:url";
5
6
  import vue from "@vitejs/plugin-vue";
6
7
  import * as vite from "vite";
7
8
  //#region src/index.ts
@@ -43,6 +44,11 @@ const runtimeShimPath = (workspaceAliases["@koishi-ce/components"] ?? "").replac
43
44
  */
44
45
  async function build(root, config = {}) {
45
46
  if (!existsSync(`${root}/client`)) return;
47
+ const overridePath = `${root}/build/client.ts`;
48
+ if (existsSync(overridePath)) {
49
+ const mod = await import(pathToFileURL(overridePath).href);
50
+ config = vite.mergeConfig(config, mod.default ?? mod);
51
+ }
46
52
  const outDir = `${root}/dist`;
47
53
  if (existsSync(outDir)) await rm(outDir, { recursive: true });
48
54
  await mkdir(outDir, { recursive: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koishi-ce/client",
3
3
  "description": "Koishi Console Client",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "type": "module",
6
6
  "main": "client/index.ts",
7
7
  "exports": {
@@ -48,7 +48,7 @@
48
48
  "build"
49
49
  ],
50
50
  "dependencies": {
51
- "@koishi-ce/components": "^1.0.0",
51
+ "@koishi-ce/components": "^1.0.1",
52
52
  "@satorijs/protocol": "^1.7.0",
53
53
  "@vitejs/plugin-vue": "^6.0.8",
54
54
  "@vueuse/core": "^14.4.0",
@@ -62,5 +62,9 @@
62
62
  "vue": "^3.5.42",
63
63
  "vue-i18n": "^11.4.10",
64
64
  "vue-router": "^5.2.0"
65
+ },
66
+ "devDependencies": {
67
+ "@koishi-ce/koishi": "^1.0.4",
68
+ "@koishi-ce/plugin-console": "^1.0.3"
65
69
  }
66
70
  }
package/src/bin.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+ // Copyright (c) 2019-present Shigma and Koishijs contributors.
4
+ // Copyright (c) 2026-present Koishi-CE contributors.
2
5
 
3
6
  /**
4
7
  * `koishi-console` CLI 入口(构建产物 lib/bin.mjs 由 package.json 的
package/src/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
  * @koishi-ce/client 构建入口。
3
7
  *
@@ -10,6 +14,7 @@
10
14
  import { existsSync } from "node:fs";
11
15
  import { mkdir, rm } from "node:fs/promises";
12
16
  import { resolve } from "node:path";
17
+ import { pathToFileURL } from "node:url";
13
18
  import vue from "@vitejs/plugin-vue";
14
19
  import * as vite from "vite";
15
20
  import { yaml } from "./yaml.ts";
@@ -78,6 +83,15 @@ const runtimeShimPath = (
78
83
  export async function build(root: string, config: vite.UserConfig = {}) {
79
84
  if (!existsSync(`${root}/client`)) return;
80
85
 
86
+ // 插件可自带 `build/client.ts` 导出额外的 vite 配置覆盖下方默认值
87
+ // (vite 只自动发现 vite.config.*,不会加载该路径,须在此显式接线),
88
+ // 如 analytics 的 fuck-echarts 符号遮蔽修补
89
+ const overridePath = `${root}/build/client.ts`;
90
+ if (existsSync(overridePath)) {
91
+ const mod = await import(pathToFileURL(overridePath).href);
92
+ config = vite.mergeConfig(config, mod.default ?? mod);
93
+ }
94
+
81
95
  // 产物约定:固定写入插件目录下的 dist/,清空后重建
82
96
  const outDir = `${root}/dist`;
83
97
  if (existsSync(outDir)) {
package/src/yaml.ts CHANGED
@@ -1,3 +1,6 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026-present Koishi-CE contributors.
3
+
1
4
  import type { Plugin } from "vite";
2
5
 
3
6
  /**