@done-coding/admin-core 0.12.1 → 0.12.2

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 (128) hide show
  1. package/README.md +1 -48
  2. package/es/bridge/index.mjs +75 -72
  3. package/es/bridge/layout.mjs +51 -0
  4. package/es/bridge/theme/index.mjs +1 -1
  5. package/es/bridge/theme/persist.mjs +1 -1
  6. package/es/components/app-layout/AppAside.vue.mjs +2 -2
  7. package/es/components/app-layout/AppAside.vue2.mjs +27 -10
  8. package/es/components/app-layout/AppCollapseToggle.vue.mjs +7 -0
  9. package/es/components/app-layout/AppCollapseToggle.vue2.mjs +54 -0
  10. package/es/components/app-layout/AppFooter.vue.mjs +1 -1
  11. package/es/components/app-layout/AppHeader.vue.mjs +3 -3
  12. package/es/components/app-layout/AppHeader.vue2.mjs +1 -1
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +3 -3
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +41 -61
  17. package/es/components/app-layout/AppTheme.vue.mjs +3 -3
  18. package/es/components/app-layout/viewport.mjs +3 -3
  19. package/es/components/display/TabsHeader.vue.mjs +4 -4
  20. package/es/components/form/FormItemNestForm.vue.mjs +2 -2
  21. package/es/components/form/FormItemNestFormList.vue.mjs +2 -2
  22. package/es/components/form/FormSubmitPanel.vue.mjs +1 -1
  23. package/es/components/form/FormVerifyImage.vue.mjs +1 -1
  24. package/es/components/table/TableToolbar.vue.mjs +3 -3
  25. package/es/hooks/{use-admin-theme-apply.mjs → use-theme-apply.mjs} +62 -62
  26. package/es/hooks/use-viewport-apply.mjs +39 -0
  27. package/es/index.mjs +88 -88
  28. package/es/inject/key.mjs +13 -13
  29. package/es/store/app.mjs +69 -62
  30. package/es/style.css +1 -1
  31. package/package.json +6 -8
  32. package/types/bridge/config-hook.d.ts +0 -68
  33. package/types/bridge/index.d.ts +18 -417
  34. package/types/bridge/layout.d.ts +25 -0
  35. package/types/bridge/plugin.d.ts +12 -30
  36. package/types/bridge/route.d.ts +1 -20
  37. package/types/bridge/state.d.ts +0 -14
  38. package/types/bridge/storage.d.ts +0 -9
  39. package/types/bridge/theme/index.d.ts +1 -8
  40. package/types/bridge/theme/persist.d.ts +3 -15
  41. package/types/bridge/theme/system-dark.d.ts +0 -12
  42. package/types/bridge/theme/types.d.ts +27 -265
  43. package/types/components/app-layout/AppAside.vue.d.ts +0 -1
  44. package/types/components/app-layout/AppCollapseToggle.vue.d.ts +11 -0
  45. package/types/components/app-layout/AppHeader.vue.d.ts +0 -3
  46. package/types/components/app-layout/AppLayout.vue.d.ts +0 -12
  47. package/types/components/app-layout/AppPage.vue.d.ts +0 -2
  48. package/types/components/app-layout/AppSidebar.vue.d.ts +0 -2
  49. package/types/components/app-layout/types.d.ts +2 -127
  50. package/types/components/app-layout/viewport.d.ts +2 -30
  51. package/types/components/data-view/DataListViewItem.vue.d.ts +0 -8
  52. package/types/components/data-view/index.d.ts +0 -4
  53. package/types/components/data-view/types.d.ts +0 -41
  54. package/types/components/data-view/utils.d.ts +0 -3
  55. package/types/components/display/TabsHeader.vue.d.ts +0 -2
  56. package/types/components/display/TabsMain.vue.d.ts +0 -2
  57. package/types/components/display/TabsRefineFlow.vue.d.ts +0 -1
  58. package/types/components/display/index.d.ts +1 -37
  59. package/types/components/display/types.d.ts +0 -131
  60. package/types/components/form/FormItemNestForm.vue.d.ts +0 -5
  61. package/types/components/form/FormItemNestFormList.vue.d.ts +0 -17
  62. package/types/components/form/FormVerifyCode.vue.d.ts +0 -9
  63. package/types/components/form/FormVerifyImage.vue.d.ts +0 -1
  64. package/types/components/form/form-search-utils.d.ts +0 -14
  65. package/types/components/form/nest-form-item-list.d.ts +0 -28
  66. package/types/components/form/nest-form-item.d.ts +0 -21
  67. package/types/components/form/nest-registry.d.ts +0 -14
  68. package/types/components/form/types.d.ts +8 -185
  69. package/types/components/form/use-form-submit.d.ts +0 -12
  70. package/types/components/form/use-nest-form-list.d.ts +0 -13
  71. package/types/components/form/use-nest-form.d.ts +0 -15
  72. package/types/components/form/use-nest-layout-scale.d.ts +0 -12
  73. package/types/components/form/utils.d.ts +1 -56
  74. package/types/components/list-page/ListPage.vue.d.ts +0 -6
  75. package/types/components/list-page/types.d.ts +2 -19
  76. package/types/components/misc/index.d.ts +1 -6
  77. package/types/components/misc/types.d.ts +0 -6
  78. package/types/components/modal/ConfirmModal.vue.d.ts +0 -10
  79. package/types/components/modal/modal-shelf-core.d.ts +0 -3
  80. package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -4
  81. package/types/components/modal/modal-shelf-types.d.ts +0 -34
  82. package/types/components/modal/types.d.ts +1 -20
  83. package/types/components/panel/PanelItemNestForm.vue.d.ts +0 -6
  84. package/types/components/panel/PanelItemNestPanel.vue.d.ts +0 -5
  85. package/types/components/panel/nest-panel-form.d.ts +0 -21
  86. package/types/components/panel/nest-panel-item.d.ts +0 -14
  87. package/types/components/panel/types.d.ts +1 -49
  88. package/types/components/table/types.d.ts +9 -124
  89. package/types/config/list-model.d.ts +0 -29
  90. package/types/config/route.d.ts +0 -2
  91. package/types/helpers/form.d.ts +0 -5
  92. package/types/helpers/list-helper.d.ts +0 -26
  93. package/types/helpers/types.d.ts +0 -11
  94. package/types/hooks/activated.d.ts +0 -10
  95. package/types/hooks/feel-size.d.ts +0 -2
  96. package/types/hooks/index.d.ts +2 -2
  97. package/types/hooks/menus-dispatch.d.ts +0 -4
  98. package/types/hooks/timeout.d.ts +0 -4
  99. package/types/hooks/use-channel-viewport-height.d.ts +0 -14
  100. package/types/hooks/use-theme-apply.d.ts +11 -0
  101. package/types/hooks/use-viewport-apply.d.ts +8 -0
  102. package/types/inject/key.d.ts +2 -87
  103. package/types/router/guard/index.d.ts +0 -13
  104. package/types/router/guard/login.d.ts +0 -1
  105. package/types/router/guard/permission.d.ts +0 -1
  106. package/types/router/guard/types.d.ts +2 -5
  107. package/types/store/app.d.ts +10 -31
  108. package/types/store/router-permission.d.ts +2 -55
  109. package/types/store/user.d.ts +2 -26
  110. package/types/types/dot-path.d.ts +0 -8
  111. package/types/types/route.d.ts +0 -45
  112. package/types/types/utility-types.d.ts +0 -7
  113. package/types/utils/export.d.ts +1 -16
  114. package/types/utils/id.d.ts +0 -1
  115. package/types/utils/router.d.ts +0 -2
  116. package/types/utils/theme-scale.d.ts +0 -31
  117. package/types/utils/time.d.ts +0 -1
  118. package/docs/TECH_SNAPSHOT.md +0 -146
  119. package/docs/nested-config-paradigm.md +0 -80
  120. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +0 -63
  121. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +0 -575
  122. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +0 -107
  123. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +0 -58
  124. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +0 -238
  125. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +0 -290
  126. package/es/hooks/use-admin-viewport-apply.mjs +0 -39
  127. package/types/hooks/use-admin-theme-apply.d.ts +0 -34
  128. package/types/hooks/use-admin-viewport-apply.d.ts +0 -20
package/README.md CHANGED
@@ -1,48 +1 @@
1
- # @done-coding/admin-core
2
-
3
- ```
4
- 后台管理核心
5
- ```
6
-
7
- ## 使用
8
-
9
- ```bash
10
- npm install @done-coding/admin-core
11
- ```
12
-
13
- ## 进阶用法
14
-
15
- ### 自定义分页字段(pnpm patch 逃生通道)
16
-
17
- `@done-coding/admin-core` 的列表分页 KEY 配置(`APP_API_LIST_MODEL_KEY_CONFIG`)在 core 包内**固化为标准级约定**:
18
-
19
- ```ts
20
- {
21
- CURRENT_PAGE_KEY: "page.page",
22
- PAGE_SIZE_KEY: "page.pageSize",
23
- TOTAL_KEY: "page.totalRecord",
24
- LIST_KEY: "items",
25
- }
26
- ```
27
-
28
- 若消费方后端约定不同(如 `current` / `size` / `total` / `list`),通过 `pnpm patch` 在工具链层重写:
29
-
30
- ```bash
31
- # 1. 创建 patch
32
- pnpm patch @done-coding/admin-core
33
-
34
- # 2. 编辑临时目录下 3 个产物文件(必须同步改)
35
- # - es/index.mjs (ESM 运行时)
36
- # - lib/index.cjs (CJS 运行时)
37
- # - types/index.d.ts (as const 字符串字面量类型,必须同步以保 typeof 推导)
38
- # 将 APP_API_LIST_MODEL_KEY_CONFIG 4 KEY 取值改为消费方约定
39
-
40
- # 3. 提交 patch
41
- pnpm patch-commit <临时目录>
42
-
43
- # 4. 重启 dev / 重新 build
44
- ```
45
-
46
- **[MUST NOT]** 在业务运行时通过 plugin 配置 / 全局变量 / 工厂函数覆盖 KEY 取值——会让 `typeof KEY_CONFIG` 类型推导失效(编译期常量),等于自废 dot-path 工具能力。
47
-
48
- 详见 [TECH_SNAPSHOT 已知约束](./docs/TECH_SNAPSHOT.md#22-pnpm-patch-逃生通道)。
1
+ 内部维护,暂无公开文档。
@@ -1,33 +1,34 @@
1
- import { computed as s } from "vue";
2
- import { createStorageWithNamespace as L } from "./storage.mjs";
3
- import { createUseState as l } from "./state.mjs";
4
- import { createGenerateRouteMetaRawTree as Y } from "./route.mjs";
5
- import { createBridgeConfigHook as B } from "./config-hook.mjs";
6
- import { createBridgePluginHost as D } from "./plugin.mjs";
1
+ import { computed as L } from "vue";
2
+ import { createStorageWithNamespace as l } from "./storage.mjs";
3
+ import { createUseState as Y } from "./state.mjs";
4
+ import { createGenerateRouteMetaRawTree as B } from "./route.mjs";
5
+ import { createBridgeConfigHook as D } from "./config-hook.mjs";
6
+ import { createBridgePluginHost as k } from "./plugin.mjs";
7
7
  import { createBridgeThemeHook as S } from "./theme/index.mjs";
8
- import { ADMIN_BRIDGE_KEY as k } from "../inject/key.mjs";
9
- function v(e) {
10
- const g = e.APP_CACHE_CONFIG.namespace;
8
+ import { createBridgeLayoutHook as H } from "./layout.mjs";
9
+ import { CORE_BRIDGE_KEY as w } from "../inject/key.mjs";
10
+ function x(e) {
11
+ const C = e.APP_CACHE_CONFIG.namespace;
11
12
  let P;
12
- g === "" ? (console.error(
13
- "[adminBridge] APP_CACHE_CONFIG.namespace 为空,已兜底为 'ADMIN_CORE'"
14
- ), P = "ADMIN_CORE") : P = g, Object.freeze(e);
15
- const f = L(P), N = e.routes, h = e.getUserInfoInitFn, m = e.userInfoAccess, d = l(P), U = Y(
13
+ C === "" ? (console.error(
14
+ "[coreBridge] APP_CACHE_CONFIG.namespace 为空,已兜底为 'CORE'"
15
+ ), P = "CORE") : P = C, Object.freeze(e);
16
+ const O = l(P), h = e.routes, m = e.getUserInfoInitFn, N = e.userInfoAccess, d = Y(P), U = B(
16
17
  e.APP_ROUTER_META_DEFAULT_CONFIG
17
- ), C = {
18
+ ), f = {
18
19
  // 核内默认宽 0:默认 shell 渲染 AppAside 但不可见、经典 1:1 无右间隙;app/preset 加宽启用。
19
20
  width: 0,
20
21
  ...e.APP_LAYOUT_ASIDE_CONFIG
21
22
  }, u = {
22
23
  size: 0,
23
24
  ...e.APP_LAYOUT_GAP_CONFIG
24
- }, A = B({
25
+ }, t = D({
25
26
  APP_BASE_INFO: e.APP_BASE_INFO,
26
27
  APP_THEME_CONFIG: e.APP_THEME_CONFIG,
27
28
  APP_LAYOUT_HEADER_CONFIG: e.APP_LAYOUT_HEADER_CONFIG,
28
29
  APP_LAYOUT_FOOTER_CONFIG: e.APP_LAYOUT_FOOTER_CONFIG,
29
30
  APP_LAYOUT_SIDEBAR_CONFIG: e.APP_LAYOUT_SIDEBAR_CONFIG,
30
- APP_LAYOUT_ASIDE_CONFIG: C,
31
+ APP_LAYOUT_ASIDE_CONFIG: f,
31
32
  APP_LAYOUT_BREADCRUMB_CONFIG: e.APP_LAYOUT_BREADCRUMB_CONFIG,
32
33
  APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
33
34
  // viewport 边框:app 可整体不传 / 传部分字段,与核内默认四边 0 浅合并补全
@@ -40,16 +41,16 @@ function v(e) {
40
41
  ...e.APP_LAYOUT_VIEWPORT_CONFIG
41
42
  },
42
43
  APP_LAYOUT_GAP_CONFIG: u
43
- }), _ = S({
44
+ }), A = S({
44
45
  initConfig: e.APP_THEME_CONFIG,
45
- update: A.update,
46
+ update: t.update,
46
47
  // 布局基线快照(preset 切换基线复位 + 叠加用)。六组布局 config init 值浅快照——
47
48
  // viewport 取已合并核内默认四边 0 的完整值(与 configHook 入参口径一致)。
48
49
  layoutBaseline: {
49
50
  header: { ...e.APP_LAYOUT_HEADER_CONFIG },
50
51
  footer: { ...e.APP_LAYOUT_FOOTER_CONFIG },
51
52
  sidebar: { ...e.APP_LAYOUT_SIDEBAR_CONFIG },
52
- aside: { ...C },
53
+ aside: { ...f },
53
54
  breadcrumb: { ...e.APP_LAYOUT_BREADCRUMB_CONFIG },
54
55
  body: { ...e.APP_LAYOUT_BODY_CONFIG },
55
56
  viewport: {
@@ -61,43 +62,43 @@ function v(e) {
61
62
  },
62
63
  gap: { ...u }
63
64
  },
64
- storage: f,
65
+ storage: O,
65
66
  defaultMode: e.defaultThemeMode
66
- }), G = s(
67
- () => _.themeIsDark.value ? A.roTheme.dark : A.roTheme.light
67
+ }), G = H({ storage: O }), c = L(
68
+ () => A.themeIsDark.value ? t.roTheme.dark : t.roTheme.light
68
69
  );
69
- let O, o, n, T, I, i, a, F;
70
- const t = (r) => `admin bridge: ${r} 未注册`, R = D(), E = {
70
+ let o, n, T, I, i, a, E, F;
71
+ const _ = (r) => `admin bridge: ${r} 未注册`, R = k(), g = {
71
72
  register(r) {
72
- r.getToken && (O = r.getToken), r.goToLogin && (o = r.goToLogin), r.refreshToken && (n = r.refreshToken), r.refreshAuth && (T = r.refreshAuth), r.loginApi && (I = r.loginApi), r.logoutApi && (i = r.logoutApi), r.getUserInfoApi && (a = r.getUserInfoApi), r.refreshTokenApi && (F = r.refreshTokenApi);
73
+ r.getToken && (o = r.getToken), r.goToLogin && (n = r.goToLogin), r.refreshToken && (T = r.refreshToken), r.refreshAuth && (I = r.refreshAuth), r.loginApi && (i = r.loginApi), r.logoutApi && (a = r.logoutApi), r.getUserInfoApi && (E = r.getUserInfoApi), r.refreshTokenApi && (F = r.refreshTokenApi);
73
74
  },
74
75
  // 已注册返回 undefined 是合法业务态不 throw
75
76
  // v3 终锁 Δ8b:零参 facade(BR-1 ③ 终裁——core 对 UserInfo 不透明 + 拦截器无 info 源)
76
77
  getToken() {
77
- if (!O) throw new Error(t("getToken"));
78
- return O();
78
+ if (!o) throw new Error(_("getToken"));
79
+ return o();
79
80
  },
80
81
  goToLogin() {
81
- if (!o) throw new Error(t("goToLogin"));
82
- o();
82
+ if (!n) throw new Error(_("goToLogin"));
83
+ n();
83
84
  },
84
85
  // 异步对:未注册才返回 rejected Promise(既有降级语义保留)。
85
86
  refreshToken() {
86
- return n ? n().then(() => {
87
- }) : Promise.reject(new Error(t("refreshToken")));
87
+ return T ? T().then(() => {
88
+ }) : Promise.reject(new Error(_("refreshToken")));
88
89
  },
89
90
  refreshAuth() {
90
- return T ? T().then(() => {
91
- }) : Promise.reject(new Error(t("refreshAuth")));
91
+ return I ? I().then(() => {
92
+ }) : Promise.reject(new Error(_("refreshAuth")));
92
93
  },
93
94
  getStorage() {
94
- return f;
95
+ return O;
95
96
  },
96
97
  getRoutes() {
97
- return N;
98
+ return h;
98
99
  },
99
100
  getUserInfoInitFn() {
100
- return h;
101
+ return m;
101
102
  },
102
103
  useState: d,
103
104
  generateRouteMetaRawTree: U,
@@ -111,7 +112,7 @@ function v(e) {
111
112
  * 更新后本属性自动跟随。[SHOULD] 在 `computed` / 响应式上下文中读取,[MUST NOT]
112
113
  * 解构或一次性快照取值(`const x = bridge.APP_BASE_INFO.foo` ⚠️ 快照定格,update 后不变)。
113
114
  */
114
- APP_BASE_INFO: A.roBaseInfo,
115
+ APP_BASE_INFO: t.roBaseInfo,
115
116
  /** 应用环境信息(per #2.5 期 REQ-1) */
116
117
  APP_ENV_INFO: e.APP_ENV_INFO,
117
118
  /** 应用缓存配置(per #2.5 期 REQ-1) */
@@ -122,14 +123,14 @@ function v(e) {
122
123
  * `readonly(reactive(...))` 包裹——`bridge.update("APP_LAYOUT_HEADER_CONFIG", partial)`
123
124
  * 后自动跟随。[SHOULD] 响应式上下文 / `computed` 读取,[MUST NOT] 解构/快照(⚠️ 定格)。
124
125
  */
125
- APP_LAYOUT_HEADER_CONFIG: A.roHeader,
126
+ APP_LAYOUT_HEADER_CONFIG: t.roHeader,
126
127
  /**
127
128
  * 应用布局-footer 配置(**响应式只读视图**,插件系统一期改)。
128
129
  *
129
130
  * `readonly(reactive(...))`——`bridge.update("APP_LAYOUT_FOOTER_CONFIG", partial)`
130
131
  * 后跟随。[SHOULD] 响应式上下文读取,[MUST NOT] 解构/快照(⚠️ 定格)。
131
132
  */
132
- APP_LAYOUT_FOOTER_CONFIG: A.roFooter,
133
+ APP_LAYOUT_FOOTER_CONFIG: t.roFooter,
133
134
  /**
134
135
  * 应用布局-sidebar 配置(**响应式只读视图**,插件系统一期改)。
135
136
  *
@@ -137,28 +138,28 @@ function v(e) {
137
138
  * 后跟随(一级浅合并,传 `{width}` 保留 `collapseWidth`)。[SHOULD] 响应式上下文
138
139
  * 读取,[MUST NOT] 解构/快照(⚠️ 定格)。
139
140
  */
140
- APP_LAYOUT_SIDEBAR_CONFIG: A.roSidebar,
141
+ APP_LAYOUT_SIDEBAR_CONFIG: t.roSidebar,
141
142
  /**
142
143
  * 应用布局-aside 右侧补充区配置(**响应式只读视图**,P1' additive)。
143
144
  *
144
145
  * `readonly(reactive(...))`——`bridge.update("APP_LAYOUT_ASIDE_CONFIG", partial)` 后跟随。
145
146
  * 仅自定义 shell 渲染右侧区时消费;经典布局不读。[MUST NOT] 解构/快照(⚠️ 定格)。
146
147
  */
147
- APP_LAYOUT_ASIDE_CONFIG: A.roAside,
148
+ APP_LAYOUT_ASIDE_CONFIG: t.roAside,
148
149
  /**
149
150
  * 应用布局-面包屑配置(**响应式只读视图**,插件系统一期改)。
150
151
  *
151
152
  * `readonly(reactive(...))`——`bridge.update("APP_LAYOUT_BREADCRUMB_CONFIG", partial)`
152
153
  * 后跟随。[SHOULD] 响应式上下文读取,[MUST NOT] 解构/快照(⚠️ 定格)。
153
154
  */
154
- APP_LAYOUT_BREADCRUMB_CONFIG: A.roBreadcrumb,
155
+ APP_LAYOUT_BREADCRUMB_CONFIG: t.roBreadcrumb,
155
156
  /**
156
157
  * 应用布局-页面主体配置(**响应式只读视图**,插件系统一期改)。
157
158
  *
158
159
  * `readonly(reactive(...))`——`bridge.update("APP_LAYOUT_BODY_CONFIG", partial)`
159
160
  * 后跟随。[SHOULD] 响应式上下文读取,[MUST NOT] 解构/快照(⚠️ 定格)。
160
161
  */
161
- APP_LAYOUT_BODY_CONFIG: A.roBody,
162
+ APP_LAYOUT_BODY_CONFIG: t.roBody,
162
163
  /**
163
164
  * 应用布局-视口边框配置(**响应式只读视图**)。
164
165
  *
@@ -166,7 +167,7 @@ function v(e) {
166
167
  * 后跟随(一级浅合并,传 `{paddingTop}` 保留其余三边)。store/app 经此派生 viewport
167
168
  * padding 给 Header/Sidebar fixed 锚点 + AppBody calc。[MUST NOT] 解构/快照(⚠️ 定格)。
168
169
  */
169
- APP_LAYOUT_VIEWPORT_CONFIG: A.roViewport,
170
+ APP_LAYOUT_VIEWPORT_CONFIG: t.roViewport,
170
171
  /**
171
172
  * 应用布局-模块间距配置(**响应式只读视图**,内缝 gap)。
172
173
  *
@@ -174,7 +175,7 @@ function v(e) {
174
175
  * 后跟随。store/app 经此派生 gapTop/Left/Right/Bottom 叠加进几何 calc。
175
176
  * [MUST NOT] 解构/快照(⚠️ 定格)。
176
177
  */
177
- APP_LAYOUT_GAP_CONFIG: A.roGap,
178
+ APP_LAYOUT_GAP_CONFIG: t.roGap,
178
179
  /**
179
180
  * 应用布局聚合配置(**响应式只读视图**,插件系统一期改)。
180
181
  *
@@ -182,7 +183,7 @@ function v(e) {
182
183
  * `readonly(reactive({header, footer, sidebar, breadcrumb, body}))`——不再是
183
184
  * `Object.freeze` 静态聚合。[SHOULD] 响应式上下文读取,[MUST NOT] 解构/快照(⚠️ 定格)。
184
185
  */
185
- APP_LAYOUT_CONFIG: A.roLayout,
186
+ APP_LAYOUT_CONFIG: t.roLayout,
186
187
  /** 应用路由元信息默认配置(per #2.5 期 REQ-1) */
187
188
  APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
188
189
  /** 应用路由配置(per #2.5 期 REQ-1) */
@@ -196,56 +197,58 @@ function v(e) {
196
197
  * 一级浅合并整体替换 `light`、保留 `dark`,后自动跟随。[SHOULD] 响应式上下文读取,
197
198
  * [MUST NOT] 解构/快照(⚠️ 定格)。
198
199
  */
199
- APP_THEME_CONFIG: A.roTheme,
200
+ APP_THEME_CONFIG: t.roTheme,
200
201
  /** 主题模块(架构反转:风格切换真相源在 bridge;插件经 theme.add 注册风格) */
201
- theme: _.theme,
202
+ theme: A.theme,
202
203
  /** 当前风格名(响应式只读真相源) */
203
- themeStyle: _.themeStyle,
204
+ themeStyle: A.themeStyle,
204
205
  /** 明暗模式三态真相源(亮/暗/跟随系统) */
205
- themeMode: _.themeMode,
206
+ themeMode: A.themeMode,
206
207
  /** 是否暗色(响应式只读派生;appStore / 挂值 composable 读此) */
207
- themeIsDark: _.themeIsDark,
208
+ themeIsDark: A.themeIsDark,
208
209
  /** 当前 preset 的 layout 运行时维度(AppLayout 直读 shell + 分流意图) */
209
- themeLayout: _.themeLayout,
210
- /** 当前密度档 / 动效档(节奏真相源;useAdminThemeApply 消费,明暗无关) */
211
- themeDensity: _.themeDensity,
212
- themeMotion: _.themeMotion,
210
+ themeLayout: A.themeLayout,
211
+ /** 当前密度档 / 动效档(节奏真相源;useThemeApply 消费,明暗无关) */
212
+ themeDensity: A.themeDensity,
213
+ themeMotion: A.themeMotion,
213
214
  /** 当前生效 JS 主题色(输出 B;MenuTree/布局直读、appStore.theme 转发) */
214
- themeColors: G,
215
+ themeColors: c,
215
216
  /** 是否显示内置风格切换下拉(AppTheme ElSelect);init 静态值,缺省 true(亮暗恒显) */
216
217
  showThemeStyleSwitcher: e.showThemeStyleSwitcher ?? !0,
218
+ /** 布局折叠模块(折叠真相源在 bridge;appStore 转发,AppSidebar / AppAside 驱动) */
219
+ layout: G.layout,
217
220
  /** 用户信息字段访问器集(第一宪法:业务注入 get/set 读写 token/refreshToken/permission) */
218
- userInfoAccess: m,
221
+ userInfoAccess: N,
219
222
  // 插件系统一期:update(REQ-1)+ install(REQ-9)挂载。
220
223
  // install 箭头函数闭包引用 bridgeInstance([MUST NOT] 用 this——strict
221
224
  // noImplicitThis);provide 整 bridge 自身;零单例([MUST NOT] globalThis/模块级缓存)。
222
- update: A.update,
223
- use: (r, c) => R.use({
224
- bridge: E,
225
- update: A.update,
225
+ update: t.update,
226
+ use: (r, s) => R.use({
227
+ bridge: g,
228
+ update: t.update,
226
229
  plugin: r,
227
- options: c
230
+ options: s
228
231
  }),
229
- install: (r) => (r.provide(k, E), r),
232
+ install: (r) => (r.provide(w, g), r),
230
233
  // 异步对:未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
231
234
  loginApi(r) {
232
- return I ? I(r) : Promise.reject(new Error(t("loginApi")));
235
+ return i ? i(r) : Promise.reject(new Error(_("loginApi")));
233
236
  },
234
237
  logoutApi() {
235
- return i ? i() : Promise.reject(new Error(t("logoutApi")));
238
+ return a ? a() : Promise.reject(new Error(_("logoutApi")));
236
239
  },
237
240
  getUserInfoApi() {
238
- return a ? a() : Promise.reject(new Error(t("getUserInfoApi")));
241
+ return E ? E() : Promise.reject(new Error(_("getUserInfoApi")));
239
242
  },
240
243
  refreshTokenApi(r) {
241
- return F ? F(r) : Promise.reject(new Error(t("refreshTokenApi")));
244
+ return F ? F(r) : Promise.reject(new Error(_("refreshTokenApi")));
242
245
  }
243
246
  };
244
- return E;
247
+ return g;
245
248
  }
246
249
  export {
247
- v as createAdminBridge,
248
- Y as createGenerateRouteMetaRawTree,
249
- L as createStorageWithNamespace,
250
- l as createUseState
250
+ x as createCoreBridge,
251
+ B as createGenerateRouteMetaRawTree,
252
+ l as createStorageWithNamespace,
253
+ Y as createUseState
251
254
  };
@@ -0,0 +1,51 @@
1
+ import { ref as i, readonly as p } from "vue";
2
+ const C = "dc-core-layout";
3
+ function y(a) {
4
+ const t = a.storageKey ?? C, l = i(a.defaultSidebarCollapsed ?? !1), o = i(a.defaultAsideCollapsed ?? !1);
5
+ let s = null;
6
+ try {
7
+ s = a.storage.getItem(t);
8
+ } catch {
9
+ s = null;
10
+ }
11
+ if (s)
12
+ try {
13
+ const e = JSON.parse(s);
14
+ typeof (e == null ? void 0 : e.sidebarCollapsed) == "boolean" && (l.value = e.sidebarCollapsed), typeof (e == null ? void 0 : e.asideCollapsed) == "boolean" && (o.value = e.asideCollapsed);
15
+ } catch {
16
+ }
17
+ const d = () => {
18
+ try {
19
+ a.storage.setItem(
20
+ t,
21
+ JSON.stringify({
22
+ sidebarCollapsed: l.value,
23
+ asideCollapsed: o.value
24
+ })
25
+ );
26
+ } catch {
27
+ }
28
+ }, r = (e) => {
29
+ l.value = e, d();
30
+ }, u = () => {
31
+ r(!l.value);
32
+ }, c = (e) => {
33
+ o.value = e, d();
34
+ }, n = () => {
35
+ c(!o.value);
36
+ };
37
+ return {
38
+ layout: {
39
+ sidebarCollapsed: p(l),
40
+ asideCollapsed: p(o),
41
+ setSidebarCollapse: r,
42
+ toggleSidebar: u,
43
+ setAsideCollapse: c,
44
+ toggleAside: n
45
+ }
46
+ };
47
+ }
48
+ export {
49
+ C as DEFAULT_LAYOUT_STORAGE_KEY,
50
+ y as createBridgeLayoutHook
51
+ };
@@ -43,7 +43,7 @@ function re(o) {
43
43
  try {
44
44
  e({ id: t });
45
45
  } catch (s) {
46
- console.warn("[admin-theme] lifecycle hook error", s);
46
+ console.warn("[dc-theme] lifecycle hook error", s);
47
47
  }
48
48
  }, T = (e) => {
49
49
  var G, N;
@@ -1,4 +1,4 @@
1
- const c = "admin-core-theme", o = (r, n) => {
1
+ const c = "dc-core-theme", o = (r, n) => {
2
2
  const e = r.getItem(n);
3
3
  if (!e) return null;
4
4
  try {
@@ -1,7 +1,7 @@
1
1
  import o from "./AppAside.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-d07cb9ed"]]);
4
+ const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-7e17d342"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,22 +1,39 @@
1
- import { defineComponent as r, inject as a, computed as n, withDirectives as p, openBlock as i, createElementBlock as l, normalizeStyle as c, renderSlot as d, vShow as m } from "vue";
2
- import { APP_LAYOUT_APP_STORE_KEY as _ } from "../../inject/key.mjs";
3
- const h = /* @__PURE__ */ r({
1
+ import { defineComponent as m, inject as a, computed as o, withDirectives as u, openBlock as _, createElementBlock as h, normalizeStyle as i, createElementVNode as p, renderSlot as v, createVNode as A, unref as S, vShow as w } from "vue";
2
+ import f from "./AppCollapseToggle.vue.mjs";
3
+ import { APP_LAYOUT_APP_STORE_KEY as y, APP_LAYOUT_BRIDGE_KEY as P } from "../../inject/key.mjs";
4
+ const E = { class: "app-aside-clip" }, Y = /* @__PURE__ */ m({
4
5
  __name: "AppAside",
5
6
  props: {
6
7
  show: { type: Boolean }
7
8
  },
8
- setup(e) {
9
- const t = a(_), o = n(() => t.asideStyle);
10
- return (s, u) => p((i(), l("div", {
9
+ setup(t) {
10
+ const e = a(y), n = o(() => e.asideStyle), d = a(P), s = o(() => e.asideIsCollapse), c = o(() => ({
11
+ width: `${d.APP_LAYOUT_ASIDE_CONFIG.width}px`,
12
+ opacity: s.value ? 0 : 1
13
+ }));
14
+ return (r, l) => u((_(), h("div", {
11
15
  class: "app-aside",
12
- style: c(o.value)
16
+ style: i(n.value)
13
17
  }, [
14
- d(s.$slots, "default", {}, void 0, !0)
18
+ p("div", E, [
19
+ p("div", {
20
+ class: "app-aside-shim",
21
+ style: i(c.value)
22
+ }, [
23
+ v(r.$slots, "default", {}, void 0, !0)
24
+ ], 4)
25
+ ]),
26
+ A(f, {
27
+ side: "aside",
28
+ show: t.show,
29
+ collapse: s.value,
30
+ onToggle: l[0] || (l[0] = (g) => S(e).changeAsideCollapseStatus(!s.value))
31
+ }, null, 8, ["show", "collapse"])
15
32
  ], 4)), [
16
- [m, e.show]
33
+ [w, t.show]
17
34
  ]);
18
35
  }
19
36
  });
20
37
  export {
21
- h as default
38
+ Y as default
22
39
  };
@@ -0,0 +1,7 @@
1
+ import o from "./AppCollapseToggle.vue2.mjs";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-10c7e006"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as f, computed as s, openBlock as y, createBlock as v, unref as n, withCtx as r, createElementVNode as w, withKeys as i, withModifiers as c, normalizeClass as b, createVNode as p, normalizeStyle as C, createCommentVNode as $ } from "vue";
2
+ import { ElTooltip as B, ElIcon as h } from "element-plus";
3
+ import { ArrowRightBold as k } from "@element-plus/icons-vue";
4
+ const x = ["aria-label"], z = /* @__PURE__ */ f({
5
+ __name: "AppCollapseToggle",
6
+ props: {
7
+ side: {},
8
+ collapse: { type: Boolean },
9
+ show: { type: Boolean }
10
+ },
11
+ emits: ["toggle"],
12
+ setup(e, { emit: d }) {
13
+ const l = e, o = d, g = s(() => l.side === "sidebar" ? "right" : "left"), m = s(() => ({ transform: `rotate(${l.side === "sidebar" ? l.collapse ? 0 : 180 : l.collapse ? 180 : 0}deg)` }));
14
+ return (u, t) => e.show ? (y(), v(n(B), {
15
+ key: 0,
16
+ content: e.collapse ? "展开" : "收起",
17
+ placement: g.value,
18
+ "show-after": 200
19
+ }, {
20
+ default: r(() => [
21
+ w("div", {
22
+ class: b([
23
+ "dc-collapse-toggle",
24
+ `dc-collapse-toggle--${e.side}`,
25
+ "app-collapse-toggle",
26
+ `app-collapse-toggle--${e.side}`
27
+ ]),
28
+ role: "button",
29
+ tabindex: "0",
30
+ "aria-label": e.collapse ? "展开" : "收起",
31
+ onClick: t[0] || (t[0] = (a) => o("toggle")),
32
+ onKeydown: [
33
+ t[1] || (t[1] = i(c((a) => o("toggle"), ["prevent"]), ["enter"])),
34
+ t[2] || (t[2] = i(c((a) => o("toggle"), ["prevent"]), ["space"]))
35
+ ]
36
+ }, [
37
+ p(n(h), null, {
38
+ default: r(() => [
39
+ p(n(k), {
40
+ class: "app-collapse-toggle__icon",
41
+ style: C(m.value)
42
+ }, null, 8, ["style"])
43
+ ]),
44
+ _: 1
45
+ })
46
+ ], 42, x)
47
+ ]),
48
+ _: 1
49
+ }, 8, ["content", "placement"])) : $("", !0);
50
+ }
51
+ });
52
+ export {
53
+ z as default
54
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppFooter.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-71b2892d"]]);
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8960664d"]]);
5
5
  export {
6
6
  _ as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppHeader.vue2.mjs";
2
2
  /* empty css */
3
- import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ p(o, [["__scopeId", "data-v-ef6c4b9f"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-c78820aa"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -13,7 +13,7 @@ const D = { class: "app-header-shim" }, O = ["name", "onClick"], R = { class: "a
13
13
  },
14
14
  setup(c) {
15
15
  g((t) => ({
16
- v1eee7516: y.value.primaryColor
16
+ v8834c284: y.value.primaryColor
17
17
  }));
18
18
  const n = c, _ = d(Y), f = d(b), y = a(() => f.themeColors.value), C = a(() => _.headerStyle), M = T(), u = `app-header-module_${Math.random().toString(36).substring(2)}`, S = a(() => n.menus), l = a({
19
19
  get() {
@@ -1,7 +1,7 @@
1
1
  import o from "./AppLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-452f511b"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-718c207c"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };
@@ -6,8 +6,8 @@ import K from "./AppShell.vue.mjs";
6
6
  import V from "../modal/ModalShelf.vue.mjs";
7
7
  import { themeScaleToRgba as W } from "../../utils/theme-scale.mjs";
8
8
  import { APP_LAYOUT_BRIDGE_KEY as j, APP_LAYOUT_APP_STORE_KEY as q, APP_LAYOUT_USER_STORE_KEY as J } from "../../inject/key.mjs";
9
- import { useAdminThemeApply as Q } from "../../hooks/use-admin-theme-apply.mjs";
10
- import { useAdminViewportApply as X } from "../../hooks/use-admin-viewport-apply.mjs";
9
+ import { useThemeApply as Q } from "../../hooks/use-theme-apply.mjs";
10
+ import { useViewportApply as X } from "../../hooks/use-viewport-apply.mjs";
11
11
  import { flatRouteMetaResolveRaw as Z } from "../../utils/router.mjs";
12
12
  import { useMenusDataDispatch as ee } from "../../hooks/menus-dispatch.mjs";
13
13
  const ce = /* @__PURE__ */ F({
@@ -27,7 +27,7 @@ const ce = /* @__PURE__ */ F({
27
27
  m(j, e.adminBridge), m(q, e.appStore), m(J, e.userStore), Q({
28
28
  getThemeConfig: () => e.adminBridge.APP_THEME_CONFIG,
29
29
  getThemeIsDark: () => e.adminBridge.themeIsDark.value,
30
- // 节奏挂值(density/motion):喂新响应式源给同一挂值钩子,注入独立 admin-core-rhythm <style>
30
+ // 节奏挂值(density/motion):喂新响应式源给同一挂值钩子,注入独立 dc-core-rhythm <style>
31
31
  getThemeDensity: () => e.adminBridge.themeDensity.value,
32
32
  getThemeMotion: () => e.adminBridge.themeMotion.value
33
33
  }), X({
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-1dee248d"]]);
4
+ const d = /* @__PURE__ */ p(o, [["__scopeId", "data-v-7dc1d7e7"]]);
5
5
  export {
6
- a as default
6
+ d as default
7
7
  };