@robot-admin/layout 3.0.0 → 3.2.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/CHANGELOG.md CHANGED
@@ -1,144 +1,164 @@
1
- # Changelog
2
-
3
- ## 3.0.0
4
-
5
- ### Major Changes
6
-
7
- - Release the 3.0 architecture upgrade while preserving the existing Naive UI layouts, interactions, slots, and visual styling.
8
-
9
- - Add a UI-independent `@robot-admin/layout/core` entrypoint for validated settings and shared contracts.
10
- - Make layout/store injection and collapsed state work reliably with custom stores and multi-instance hosts.
11
- - Replace destructive built-in storage clearing with explicit host actions and add stable SettingsDrawer extension slots.
12
- - Validate complete imported configuration files before applying state and restore host-owned global classes on teardown.
13
- - Respect the transition enable switch, harden route caching and responsive measurement, and improve built-in menu keyboard semantics.
14
- - Verify all six layout modes in SSR and validate both ESM and CommonJS package entrypoints before publishing.
15
-
16
- ## 2.3.2
17
-
18
- ### Patch Changes
19
-
20
- - Validate imported settings at runtime, support short hex colors safely, and preserve invalid color input instead of silently turning it black.
21
- - Use route-segment-aware menu matching so `/users` no longer activates `/users-admin`.
22
- - Disable cache debug logging and global window helpers by default; add configurable Settings Store ids.
23
- - Standardize the automatic theme value on `system` and roll back settings if asynchronous theme synchronization fails.
24
- - Improve menu/drawer keyboard navigation, focus restoration and ARIA state; guard browser and Canvas APIs for SSR or unsupported environments.
25
- - Synchronize the exported version constant with package version 2.3.2 and add regression tests for the critical settings and routing contracts.
26
-
27
- ## 2.2.0
28
-
29
- ### 🐛 Bug 修复
30
-
31
- - **ReverseHorizontalMixLayout 右侧菜单错位**: 修复右侧菜单显示在底部而非右侧的问题(`.main-area` 添加 `flex-direction: row`)
32
- - **MixLayout 二级菜单消失**: 修复鼠标离开后二级菜单内容消失的问题(新增 `displayMenuItem` 作为 `hoveredMenuItem` fallback)
33
- - **MixTopLayout 全局 CSS 泄漏**: 修复 `.main-area`、`.content-layout` 等选择器污染其他布局的问题(嵌套到 `.mix-top-layout-container` 内)
34
-
35
- ### ✨ 功能优化
36
-
37
- - **ResponsiveMenu 字符宽度估算**: 区分 CJK 字符(15px)和 ASCII 字符(8px),顶部菜单文字完整显示不截断
38
- - **ReverseHorizontalMixLayout 折叠动画**: 用 width 过渡替代 Transition,避免黑色闪烁,动画更流畅(0.35s cubic-bezier)
39
- - **MixLayout 交互模式**: 从悬停触发改为纯点击模式,点击同一菜单切换展开/折叠,点击不同菜单切换内容不关闭
40
-
41
- ### 🎨 视觉设计
42
-
43
- - **ReverseHorizontalMixLayout 玻璃质感**: 参考搜索组件样式,应用 indigo 渐变玻璃设计(`linear-gradient` + `backdrop-filter` + 顶部高光线)
44
- - **pure CSS 图标**: 替换所有 UnoCSS 图标(`i-ri:*`)为纯 CSS 实现(dots-icon、grid-icon、hamburger-icon、collapse-arrow),减少外部依赖
45
-
46
- ### 📦 依赖
47
-
48
- - 移除对 UnoCSS 图标的依赖,提升包的独立性
49
-
50
- ---
51
-
52
- ## 2.1.0
53
-
54
- ### Minor Changes
55
-
56
- - 重构目录结构 + 代码优化
57
-
58
- - **目录重构**: 6 种布局骨架迁入 `components/layouts/` 子目录,层次更清晰
59
- - **文件分离**: 每个布局的样式从 `<style>` 标签提取到独立的 `index.scss` 文件
60
- - **注释统一**: 所有组件注释标准化为 `@robot-admin/layout - ComponentName` 格式
61
- - **文档优化**: 重写 README,精简核心内容、添加目录树、API 参考更清晰
62
-
63
- All notable changes to this project will be documented in this file.
64
-
65
- ## [2.0.2] - 2026-02-11
66
-
67
- ### 🗑️ Removed
68
-
69
- - **Dead files**: Removed unused `tsup.config.ts` (actual build uses Vite)
70
- - **Empty directories**: Removed `composables/`, `core/`, `layouts/` (8 empty directories total)
71
- - **Unused dependencies**: Removed `vue-router` from peerDependencies and devDependencies (never used in source code)
72
-
73
- ### 🔧 Fixed
74
-
75
- - **package.json**:
76
- - Refined `sideEffects` to `["*.css", "*.scss"]` for better tree-shaking
77
- - Removed blocking patterns `"*.vue"` and `"src/index.ts"`
78
- - **Source code**:
79
-
80
- - `constants/index.ts`: Removed commented-out code, fixed version from `"1.0.0"` to `"2.0.2"`
81
- - `types/index.ts`: Removed unimplemented `storageKey` option from `SettingsStoreOptions`
82
- - `stores/settings.ts`:
83
- - Exported `adjustColor` utility function (was private)
84
- - Removed redundant `|| false` in collapsed state initialization
85
- - `data.ts`:
86
- - Fixed `COLOR_SWATCHES` duplication (now imports from constants)
87
- - Renamed `LAYOUT_MODES` to `LAYOUT_MODE_OPTIONS` to avoid naming conflict
88
-
89
- - **SettingsDrawer component**:
90
-
91
- - Removed unimplemented `storageKey` prop
92
- - Fixed hardcoded timezone `"XIAn"` → `Intl.DateTimeFormat().resolvedOptions().timeZone`
93
- - Fixed `handleResetLayout` missing `fixedHeader` and `tagsViewStyle` resets
94
- - Fixed `handleImportConfig` to use `$patch` instead of `Object.assign` for proper reactivity
95
-
96
- - **Styles (`settings.scss`)**:
97
-
98
- - Replaced hardcoded `#409EFF` with `var(--primary-color, #409eff)` for theme color support
99
- - Replaced hardcoded `rgba(32, 128, 240)` shadows with CSS variable fallbacks
100
-
101
- - **Build config**:
102
- - Removed unused `globals` from `vite.config.ts` (no UMD output)
103
-
104
- ### 📖 Documentation
105
-
106
- - **README.md**: Fixed multiple inconsistencies with actual code:
107
- - `themeMode` default: `'system'` `'light'`
108
- - `transitionType` default: `'fade'` → `'slide'`
109
- - `tagsViewHeight` default: `40` → `44`
110
- - `showFooter` default: `false` → `true`
111
- - Removed non-existent store properties: `enableWatermark`, `watermarkText`, `enableGrayMode`, `enableColorWeakMode`
112
- - Removed non-existent methods: `exportSettings()`, `importSettings()`
113
- - Removed unimplemented feature: "持久化存储"
114
- - Removed all `storageKey` parameter references
115
- - Added `adjustColor` utility function documentation
116
- - Fixed `ThemeMode` type: `'system'` → `'auto'`
117
-
118
- ### Enhanced
119
-
120
- - Exported `adjustColor` utility function for external use
121
- - Improved CSS variable support for theme customization
122
-
123
- ---
124
-
125
- ## [2.0.1] - 2026-02-09
126
-
127
- ### Added
128
-
129
- - Initial v2.0 release with decoupled architecture
130
- - Complete settings management system
131
- - SettingsDrawer UI component
132
- - 6 layout mode presets
133
- - Theme customization with CSS variables
134
- - Full TypeScript support
135
-
136
- ---
137
-
138
- ## [2.0.0] - 2026-02-09
139
-
140
- ### 🎉 Initial Release
141
-
142
- - Layout and settings management system
143
- - Integration with @robot-admin/theme
144
- - Naive UI components support
1
+ # Changelog
2
+
3
+ ## 3.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add layered `@robot-admin/layout/vue` and `@robot-admin/layout/naive` entrypoints. The Naive entry aggregates the Vue API for one-entry consumption, all runtime entries preserve shared InjectionKey/Store identity, and the Vue entry contains no Naive UI or Element Plus imports; the 3.x root entry remains fully compatible.
8
+ - Decouple `createLayoutContext()` from the package Pinia Store through the structural `LayoutSettingsSource` contract and add safe host-menu normalization.
9
+ - Extract UI-independent settings transactions, responsive-menu measurement, icon fallback, CSS-variable binding, and the shared routed-content renderer for reuse by future UI adapters.
10
+ - Scope layout selectors and animation names, add `--ra-layout-*` variables, support reactive custom CSS variable targets, and restore detached/disposed targets without allowing post-disposal writes while preserving 3.x legacy variables by default.
11
+ - Restore custom Store defaults correctly from SettingsDrawer, establish `C_*Layout` as the single canonical component naming system, and retain unprefixed 3.1 names only as deprecated compatibility exports until 4.0.
12
+ - Add browser contracts for all six layouts, typed/legacy collapse interoperability, scoped side effects, structural Store adapters, and CI verification of source, package, ESM/CJS and dependency boundaries.
13
+
14
+ ## 3.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Add `createLayoutContext()` and `provideLayout()` to derive the complete reactive layout contract from a settings Store, menus, dark state, brand data, and an optional icon component.
19
+ - Keep the advanced `LayoutContext` API intact while formally deprecating the legacy `C_*Layout` aliases for removal in 4.0.
20
+ - Add browser interaction coverage for SettingsDrawer providers, atomic imports, reset rollback, host-owned cache clearing, and global visual-effect cleanup.
21
+ - Correct integration prerequisites, host-owned setting semantics, migration guidance, architecture diagrams, and stale version references without changing existing layout visuals or interactions.
22
+
23
+ ## 3.0.0
24
+
25
+ ### Major Changes
26
+
27
+ - Release the 3.0 architecture upgrade while preserving the existing Naive UI layouts, interactions, slots, and visual styling.
28
+
29
+ - Add a UI-independent `@robot-admin/layout/core` entrypoint for validated settings and shared contracts.
30
+ - Make layout/store injection and collapsed state work reliably with custom stores and multi-instance hosts.
31
+ - Replace destructive built-in storage clearing with explicit host actions and add stable SettingsDrawer extension slots.
32
+ - Validate complete imported configuration files before applying state and restore host-owned global classes on teardown.
33
+ - Respect the transition enable switch, harden route caching and responsive measurement, and improve built-in menu keyboard semantics.
34
+ - Verify all six layout modes in SSR and validate both ESM and CommonJS package entrypoints before publishing.
35
+
36
+ ## 2.3.2
37
+
38
+ ### Patch Changes
39
+
40
+ - Validate imported settings at runtime, support short hex colors safely, and preserve invalid color input instead of silently turning it black.
41
+ - Use route-segment-aware menu matching so `/users` no longer activates `/users-admin`.
42
+ - Disable cache debug logging and global window helpers by default; add configurable Settings Store ids.
43
+ - Standardize the automatic theme value on `system` and roll back settings if asynchronous theme synchronization fails.
44
+ - Improve menu/drawer keyboard navigation, focus restoration and ARIA state; guard browser and Canvas APIs for SSR or unsupported environments.
45
+ - Synchronize the exported version constant with package version 2.3.2 and add regression tests for the critical settings and routing contracts.
46
+
47
+ ## 2.2.0
48
+
49
+ ### 🐛 Bug 修复
50
+
51
+ - **ReverseHorizontalMixLayout 右侧菜单错位**: 修复右侧菜单显示在底部而非右侧的问题(`.main-area` 添加 `flex-direction: row`)
52
+ - **MixLayout 二级菜单消失**: 修复鼠标离开后二级菜单内容消失的问题(新增 `displayMenuItem` 作为 `hoveredMenuItem` 的 fallback)
53
+ - **MixTopLayout 全局 CSS 泄漏**: 修复 `.main-area`、`.content-layout` 等选择器污染其他布局的问题(嵌套到 `.mix-top-layout-container` 内)
54
+
55
+ ### ✨ 功能优化
56
+
57
+ - **ResponsiveMenu 字符宽度估算**: 区分 CJK 字符(15px)和 ASCII 字符(8px),顶部菜单文字完整显示不截断
58
+ - **ReverseHorizontalMixLayout 折叠动画**: width 过渡替代 Transition,避免黑色闪烁,动画更流畅(0.35s cubic-bezier)
59
+ - **MixLayout 交互模式**: 从悬停触发改为纯点击模式,点击同一菜单切换展开/折叠,点击不同菜单切换内容不关闭
60
+
61
+ ### 🎨 视觉设计
62
+
63
+ - **ReverseHorizontalMixLayout 玻璃质感**: 参考搜索组件样式,应用 indigo 渐变玻璃设计(`linear-gradient` + `backdrop-filter` + 顶部高光线)
64
+ - **pure CSS 图标**: 替换所有 UnoCSS 图标(`i-ri:*`)为纯 CSS 实现(dots-icon、grid-icon、hamburger-icon、collapse-arrow),减少外部依赖
65
+
66
+ ### 📦 依赖
67
+
68
+ - 移除对 UnoCSS 图标的依赖,提升包的独立性
69
+
70
+ ---
71
+
72
+ ## 2.1.0
73
+
74
+ ### Minor Changes
75
+
76
+ - 重构目录结构 + 代码优化
77
+
78
+ - **目录重构**: 6 种布局骨架迁入 `components/layouts/` 子目录,层次更清晰
79
+ - **文件分离**: 每个布局的样式从 `<style>` 标签提取到独立的 `index.scss` 文件
80
+ - **注释统一**: 所有组件注释标准化为 `@robot-admin/layout - ComponentName` 格式
81
+ - **文档优化**: 重写 README,精简核心内容、添加目录树、API 参考更清晰
82
+
83
+ All notable changes to this project will be documented in this file.
84
+
85
+ ## [2.0.2] - 2026-02-11
86
+
87
+ ### 🗑️ Removed
88
+
89
+ - **Dead files**: Removed unused `tsup.config.ts` (actual build uses Vite)
90
+ - **Empty directories**: Removed `composables/`, `core/`, `layouts/` (8 empty directories total)
91
+ - **Unused dependencies**: Removed `vue-router` from peerDependencies and devDependencies (never used in source code)
92
+
93
+ ### 🔧 Fixed
94
+
95
+ - **package.json**:
96
+ - Refined `sideEffects` to `["*.css", "*.scss"]` for better tree-shaking
97
+ - Removed blocking patterns `"*.vue"` and `"src/index.ts"`
98
+ - **Source code**:
99
+
100
+ - `constants/index.ts`: Removed commented-out code, fixed version from `"1.0.0"` to `"2.0.2"`
101
+ - `types/index.ts`: Removed unimplemented `storageKey` option from `SettingsStoreOptions`
102
+ - `stores/settings.ts`:
103
+ - Exported `adjustColor` utility function (was private)
104
+ - Removed redundant `|| false` in collapsed state initialization
105
+ - `data.ts`:
106
+ - Fixed `COLOR_SWATCHES` duplication (now imports from constants)
107
+ - Renamed `LAYOUT_MODES` to `LAYOUT_MODE_OPTIONS` to avoid naming conflict
108
+
109
+ - **SettingsDrawer component**:
110
+
111
+ - Removed unimplemented `storageKey` prop
112
+ - Fixed hardcoded timezone `"XIAn"` `Intl.DateTimeFormat().resolvedOptions().timeZone`
113
+ - Fixed `handleResetLayout` missing `fixedHeader` and `tagsViewStyle` resets
114
+ - Fixed `handleImportConfig` to use `$patch` instead of `Object.assign` for proper reactivity
115
+
116
+ - **Styles (`settings.scss`)**:
117
+
118
+ - Replaced hardcoded `#409EFF` with `var(--primary-color, #409eff)` for theme color support
119
+ - Replaced hardcoded `rgba(32, 128, 240)` shadows with CSS variable fallbacks
120
+
121
+ - **Build config**:
122
+ - Removed unused `globals` from `vite.config.ts` (no UMD output)
123
+
124
+ ### 📖 Documentation
125
+
126
+ - **README.md**: Fixed multiple inconsistencies with actual code:
127
+ - `themeMode` default: `'system'` → `'light'`
128
+ - `transitionType` default: `'fade'` → `'slide'`
129
+ - `tagsViewHeight` default: `40` `44`
130
+ - `showFooter` default: `false` → `true`
131
+ - Removed non-existent store properties: `enableWatermark`, `watermarkText`, `enableGrayMode`, `enableColorWeakMode`
132
+ - Removed non-existent methods: `exportSettings()`, `importSettings()`
133
+ - Removed unimplemented feature: "持久化存储"
134
+ - Removed all `storageKey` parameter references
135
+ - Added `adjustColor` utility function documentation
136
+ - Fixed `ThemeMode` type: `'system'` → `'auto'`
137
+
138
+ ### Enhanced
139
+
140
+ - Exported `adjustColor` utility function for external use
141
+ - Improved CSS variable support for theme customization
142
+
143
+ ---
144
+
145
+ ## [2.0.1] - 2026-02-09
146
+
147
+ ### ✨ Added
148
+
149
+ - Initial v2.0 release with decoupled architecture
150
+ - Complete settings management system
151
+ - SettingsDrawer UI component
152
+ - 6 layout mode presets
153
+ - Theme customization with CSS variables
154
+ - Full TypeScript support
155
+
156
+ ---
157
+
158
+ ## [2.0.0] - 2026-02-09
159
+
160
+ ### 🎉 Initial Release
161
+
162
+ - Layout and settings management system
163
+ - Integration with @robot-admin/theme
164
+ - Naive UI components support