@robot-admin/layout 3.1.0 → 3.2.1

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