@done-coding/admin-plugin-theme 0.1.0 → 0.1.1-alpha.0
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/es/index.mjs +4 -4
- package/lib/index.cjs +1 -1
- package/package.json +3 -3
- package/types/plugin.d.ts +1 -1
- package/types/types.d.ts +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = {
|
|
2
2
|
name: "admin-plugin-theme",
|
|
3
|
-
install(
|
|
3
|
+
install(t, e) {
|
|
4
4
|
var h;
|
|
5
5
|
if (!e || !((h = e.themes) != null && h.length))
|
|
6
6
|
throw new Error(
|
|
7
7
|
"admin-plugin-theme: 安装需要 options.themes(至少 1 个风格)"
|
|
8
8
|
);
|
|
9
9
|
e.themes.forEach((m) => {
|
|
10
|
-
|
|
10
|
+
t.bridge.theme.add(m.id, m);
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
n as themePlugin
|
|
16
16
|
};
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={name:"admin-plugin-theme",install(m,e){var t;if(!e||!((t=e.themes)!=null&&t.length))throw new Error("admin-plugin-theme: 安装需要 options.themes(至少 1 个风格)");e.themes.forEach(i=>{m.bridge.theme.add(i.id,i)})}};exports.themePlugin=n;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/admin-plugin-theme",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-alpha.0",
|
|
4
4
|
"description": "admin 主题风格插件",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@done-coding/admin-core": "0.9.0",
|
|
53
|
+
"@done-coding/admin-core": "0.9.1-alpha.0",
|
|
54
54
|
"@done-coding/cli-inject": "^0.6.2",
|
|
55
55
|
"@types/node": "^18.0.0",
|
|
56
56
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=18.0.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "6924deab3afbbc45ec75501f9a888ae0eb3d0648"
|
|
75
75
|
}
|
package/types/plugin.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AdminThemePluginOptions } from './types';
|
|
|
4
4
|
* admin bridge 主题插件(期 3 架构反转后退化为「风格库」)。
|
|
5
5
|
*
|
|
6
6
|
* `install` 同步执行(遵守 bridge install 同步语义):遍历 `options.themes`,
|
|
7
|
-
* 经 `ctx.bridge.theme.add(id,
|
|
7
|
+
* 经 `ctx.bridge.theme.add(preset.id, preset)` 把每个风格(含 label)注册进 bridge 风格 map。
|
|
8
8
|
* 切换(`setStyle`/`setDark`)、持久化、CSS var 双命名空间挂值与 `<html>.dark`
|
|
9
9
|
* toggle 全部归 core/bridge——插件不再持 runtime、不写 DOM、不写 CSS var、
|
|
10
10
|
* 不调 `ctx.update`。`name` 用于 bridge 插件宿主的跨对象实例幂等安装。
|
package/types/types.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type AdminThemeStyleInput = AdminThemeStyleId | (string & {});
|
|
|
21
21
|
*
|
|
22
22
|
* 期 3 架构反转后插件退化为「风格库」:asset 仅声明风格 id/label + light/dark
|
|
23
23
|
* 两套 {@link AppThemeColor}(core 类型,8 必填色 + 9 可选风格字段),由
|
|
24
|
-
* `themePlugin.install` 经 `bridge.theme.add(id,
|
|
24
|
+
* `themePlugin.install` 经 `bridge.theme.add(id, preset)` 注册进 bridge 风格 map(label 随之带入)。
|
|
25
25
|
* 切换(setStyle/setDark)、持久化、CSS var 挂值与 `.dark` toggle 全部归
|
|
26
26
|
* core/bridge——插件不再持 runtime、不写 DOM、不写 CSS var。
|
|
27
27
|
*/
|