@mxmweb/zui-layouts 1.1.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/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # @mxmweb工具库开发环境说明文档
2
+
3
+ 一个用于快速初始化项目的工具库,提供了一系列常用的工具函数和组件。
4
+
5
+ ## 特性
6
+
7
+ - 🚀 快速初始化项目
8
+ - 📦 自动配置开发环境
9
+ - 🛠 提供常用工具函数
10
+ - 🎨 内置 UI 组件
11
+ - 📝 TypeScript 支持
12
+ - 🔧 可配置性强
13
+
14
+
15
+
16
+ ## 开发指南
17
+
18
+ ### 环境要求
19
+
20
+ - Node.js >= 18
21
+ - pnpm >= 8
22
+
23
+ ### 本地开发
24
+
25
+ 1. 克隆仓库
26
+ ```bash
27
+ git clone https://github.com/your-username/mxmweb.git
28
+ cd mxmweb/apps/init
29
+ ```
30
+
31
+ 2. 安装依赖
32
+ ```bash
33
+ pnpm install
34
+ ```
35
+
36
+ 3. 启动开发服务器
37
+ ```bash
38
+ pnpm dev 启动全部工程
39
+ pnpm --filter @mxmweb/fileviewer dev 启动指定开发工程
40
+ ```
41
+
42
+ ### 构建
43
+
44
+ ```bash
45
+ pnpm build
46
+ ```
47
+
48
+ ### 代码规范
49
+
50
+ - 使用 TypeScript 编写代码
51
+ - 遵循 ESLint 和 Prettier 配置
52
+ - 使用 EditorConfig 保持一致的代码风格
53
+ - 编写清晰的提交信息,遵循 [Conventional Commits](https://www.conventionalcommits.org/)
54
+
55
+ ### 提交规范
56
+
57
+ 提交信息应该遵循以下格式:
58
+
59
+ ```
60
+ <type>(<scope>): <subject>
61
+
62
+ <body>
63
+
64
+ <footer>
65
+ ```
66
+
67
+ 类型(type):
68
+ - feat: 新功能
69
+ - fix: 修复
70
+ - docs: 文档
71
+ - style: 格式
72
+ - refactor: 重构
73
+ - test: 测试
74
+ - chore: 构建过程或辅助工具的变动
75
+
76
+ ### 发布流程
77
+
78
+ 1. 确保代码已经提交并推送到 main 分支
79
+ 2. 运行发布命令:
80
+ ```bash
81
+ pnpm release
82
+ ```
83
+
84
+ 3. 或者使用预发布测试:
85
+ ```bash
86
+ pnpm release:dry
87
+ ```
88
+
89
+ ### GitHub Actions 配置
90
+
91
+ 1. 在 GitHub 仓库设置中添加以下 Secrets:
92
+ - `NPM_TOKEN`: npm 发布令牌
93
+ - `GITHUB_TOKEN`: GitHub 令牌(自动提供)
94
+
95
+ 2. 确保仓库设置中启用了 Actions:
96
+ - 进入仓库的 Settings > Actions > General
97
+ - 在 "Actions permissions" 中选择 "Allow all actions and reusable workflows"
98
+
99
+ 3. 推送代码到 main 分支,Actions 将自动运行:
100
+ - 安装依赖
101
+ - 构建项目
102
+ - 运行测试
103
+ - 发布到 npm
104
+ - 创建 GitHub Release
105
+ - 更新 CHANGELOG.md
106
+
107
+ ## 目录结构
108
+
109
+ ```
110
+ src/
111
+ ├── application/ # 应用入口
112
+ ├── components/ # UI 组件
113
+ ├── hooks/ # React Hooks
114
+ ├── utils/ # 工具函数
115
+ └── types/ # 类型定义
116
+ ```
117
+
118
+ ## 贡献指南
119
+
120
+ 欢迎提交 Pull Request 或创建 Issue。在提交代码前,请确保:
121
+
122
+ 1. 代码符合项目规范
123
+ 2. 添加了必要的测试
124
+ 3. 更新了相关文档
125
+ 4. 提交信息符合规范
126
+
127
+ ## 许可证
128
+
129
+ MIT
@@ -0,0 +1 @@
1
+ /*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-ease:initial}}:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-50:oklch(98.5% .002 247.839);--spacing:.25rem;--ease-out:cubic-bezier(0,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sticky{position:sticky}.isolate{isolation:isolate}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.hidden{display:none}.inline{display:inline}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.flex-shrink,.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.border{border-style:var(--tw-border-style);border-width:1px}.italic{font-style:italic}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}*{margin:0;padding:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
package/index.js ADDED
@@ -0,0 +1,562 @@
1
+ import { jsx as n, jsxs as k, Fragment as ne } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import x, { forwardRef as J, createElement as j } from "react";
4
+ import s from "styled-components";
5
+ import { deepMergeTheme as Q, defaultTheme as z } from "@mxmweb/zui-theme";
6
+ import { GoogleNavbar as le, CustomDock as ie } from "@mxmweb/zui-components";
7
+ /**
8
+ * React Router v6.30.1
9
+ *
10
+ * Copyright (c) Remix Software Inc.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE.md file in the root directory of this source tree.
14
+ *
15
+ * @license MIT
16
+ */
17
+ const re = /* @__PURE__ */ u.createContext(null);
18
+ process.env.NODE_ENV !== "production" && (re.displayName = "DataRouter");
19
+ const ae = /* @__PURE__ */ u.createContext(null);
20
+ process.env.NODE_ENV !== "production" && (ae.displayName = "DataRouterState");
21
+ const ce = /* @__PURE__ */ u.createContext(null);
22
+ process.env.NODE_ENV !== "production" && (ce.displayName = "Await");
23
+ const se = /* @__PURE__ */ u.createContext(null);
24
+ process.env.NODE_ENV !== "production" && (se.displayName = "Navigation");
25
+ const de = /* @__PURE__ */ u.createContext(null);
26
+ process.env.NODE_ENV !== "production" && (de.displayName = "Location");
27
+ const U = /* @__PURE__ */ u.createContext({
28
+ outlet: null,
29
+ matches: [],
30
+ isDataRoute: !1
31
+ });
32
+ process.env.NODE_ENV !== "production" && (U.displayName = "Route");
33
+ const he = /* @__PURE__ */ u.createContext(null);
34
+ process.env.NODE_ENV !== "production" && (he.displayName = "RouteError");
35
+ const fe = /* @__PURE__ */ u.createContext(null);
36
+ function pe(t) {
37
+ let i = u.useContext(U).outlet;
38
+ return i && /* @__PURE__ */ u.createElement(fe.Provider, {
39
+ value: t
40
+ }, i);
41
+ }
42
+ function ue(t) {
43
+ return pe(t.context);
44
+ }
45
+ new Promise(() => {
46
+ });
47
+ /**
48
+ * @license lucide-react v0.456.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */
53
+ const ge = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = (...t) => t.filter((i, c, d) => !!i && i.trim() !== "" && d.indexOf(i) === c).join(" ").trim();
54
+ /**
55
+ * @license lucide-react v0.456.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */
60
+ var xe = {
61
+ xmlns: "http://www.w3.org/2000/svg",
62
+ width: 24,
63
+ height: 24,
64
+ viewBox: "0 0 24 24",
65
+ fill: "none",
66
+ stroke: "currentColor",
67
+ strokeWidth: 2,
68
+ strokeLinecap: "round",
69
+ strokeLinejoin: "round"
70
+ };
71
+ /**
72
+ * @license lucide-react v0.456.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */
77
+ const ke = J(
78
+ ({
79
+ color: t = "currentColor",
80
+ size: i = 24,
81
+ strokeWidth: c = 2,
82
+ absoluteStrokeWidth: d,
83
+ className: e = "",
84
+ children: p,
85
+ iconNode: D,
86
+ ...N
87
+ }, $) => j(
88
+ "svg",
89
+ {
90
+ ref: $,
91
+ ...xe,
92
+ width: i,
93
+ height: i,
94
+ stroke: t,
95
+ strokeWidth: d ? Number(c) * 24 / Number(i) : c,
96
+ className: E("lucide", e),
97
+ ...N
98
+ },
99
+ [
100
+ ...D.map(([a, l]) => j(a, l)),
101
+ ...Array.isArray(p) ? p : [p]
102
+ ]
103
+ )
104
+ );
105
+ /**
106
+ * @license lucide-react v0.456.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */
111
+ const ee = (t, i) => {
112
+ const c = J(
113
+ ({ className: d, ...e }, p) => j(ke, {
114
+ ref: p,
115
+ iconNode: i,
116
+ className: E(`lucide-${ge(t)}`, d),
117
+ ...e
118
+ })
119
+ );
120
+ return c.displayName = `${t}`, c;
121
+ };
122
+ /**
123
+ * @license lucide-react v0.456.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */
128
+ const Ce = ee("ArrowLeft", [
129
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
130
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
131
+ ]);
132
+ /**
133
+ * @license lucide-react v0.456.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */
138
+ const B = ee("ChevronRight", [
139
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
140
+ ]), we = s.div`
141
+ display: flex;
142
+ justify-content: flex-start;
143
+ align-items: flex-start;
144
+ margin-left: 20px;
145
+ flex-direction: column;
146
+ height: 100%;
147
+ width: 100%;
148
+ max-width: 98%;
149
+ position: relative;
150
+ `, ye = s.div`
151
+ display: flex;
152
+ height: 38px;
153
+ z-index: 10;
154
+ background: transparent;
155
+ gap: 8px;
156
+ flex-direction: row;
157
+ align-items: center;
158
+ justify-content: flex-start;
159
+ width: 100%;
160
+ min-width: 0; /* 确保 flex 子元素可以收缩 */
161
+ `, ve = s.button`
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ width: 32px;
166
+ height: 32px;
167
+ background: transparent;
168
+ border: none;
169
+ cursor: pointer;
170
+
171
+ /* 仅让图标在 hover 时上浮,按钮背景保持透明 */
172
+ svg {
173
+ transition: transform 0.2s ease;
174
+ }
175
+
176
+ &:hover {
177
+ background: transparent;
178
+ }
179
+
180
+ &:hover svg {
181
+ transform: translateY(-1px);
182
+ }
183
+
184
+ &:active svg {
185
+ transform: translateY(0);
186
+ }
187
+ `, me = s.div`
188
+ line-height: 1.4;
189
+ cursor: pointer;
190
+ transition: color 0.2s ease;
191
+ white-space: nowrap;
192
+ overflow: hidden;
193
+ text-overflow: ellipsis;
194
+ max-width: 200px;
195
+ min-width: 0;
196
+
197
+ &:hover {
198
+ color: #007bff;
199
+ }
200
+ `, be = s.div`
201
+ line-height: 1.4;
202
+ white-space: nowrap;
203
+ overflow: hidden;
204
+ text-overflow: ellipsis;
205
+ flex: 1;
206
+ min-width: 0;
207
+ `, Z = s.div`
208
+ display: flex;
209
+ align-items: center;
210
+ gap: 4px;
211
+ flex-wrap: nowrap;
212
+ max-width: 50%;
213
+ min-width: 0;
214
+ overflow: hidden;
215
+ `, I = s.div`
216
+ display: flex;
217
+ align-items: center;
218
+ gap: 4px;
219
+ font-size: 14px;
220
+ color: ${(t) => t.$isLast ? "#343a40" : "#6c757d"};
221
+ font-weight: ${(t) => t.$isLast ? "600" : "normal"};
222
+ cursor: ${(t) => t.$isClickable ? "pointer" : "default"};
223
+ transition: color 0.2s ease;
224
+ white-space: nowrap;
225
+ overflow: hidden;
226
+ text-overflow: ellipsis;
227
+ max-width: 120px;
228
+
229
+ &:hover {
230
+ color: ${(t) => t.$isLast ? "#007bff" : "inherit"};
231
+ }
232
+ `, S = s.div`
233
+ display: flex;
234
+ align-items: center;
235
+ color: #6c757d;
236
+ margin: 0 2px;
237
+ `, De = s.div`
238
+ display: flex;
239
+ flex-direction: column;
240
+ width: 100%;
241
+ height: calc(100% - 45px);
242
+ min-height: 650px;
243
+ overflow: auto;
244
+ `;
245
+ s.div`
246
+ position: fixed;
247
+ bottom: 20px;
248
+ left: 50%;
249
+ transform: translateX(-50%);
250
+ z-index: 1000;
251
+ `;
252
+ const Te = ({
253
+ children: t,
254
+ goBack: i,
255
+ title: c,
256
+ description: d,
257
+ breadcrumbs: e,
258
+ dockItems: p,
259
+ dockActiveMode: D = "single",
260
+ defaultDockActiveId: N,
261
+ defaultDockActiveIds: $,
262
+ styles: a,
263
+ eventsEmit: l
264
+ }) => {
265
+ var V, _, H, G, P, Y, q, K;
266
+ const w = Q({ theme: z, mode: "light" }, a), o = (w == null ? void 0 : w.theme) || z, O = x.useRef(null), L = () => {
267
+ l != null && l.onGoBack ? l.onGoBack() : i && i();
268
+ }, A = () => {
269
+ l != null && l.onTitleClick && l.onTitleClick();
270
+ }, y = (h, b) => {
271
+ l != null && l.onBreadcrumbClick ? l.onBreadcrumbClick(h, b) : h.onClick && h.onClick();
272
+ }, g = (h, b) => {
273
+ l != null && l.onDockItemClick && l.onDockItemClick(h, b);
274
+ }, C = () => {
275
+ if (!e || e.length === 0) return null;
276
+ const h = x.useRef(null), [b, W] = x.useState({ start: 0, end: e.length, showEllipsis: !1 }), M = x.useCallback(() => {
277
+ if (!h.current || e.length <= 3) {
278
+ W({ start: 0, end: e.length, showEllipsis: !1 });
279
+ return;
280
+ }
281
+ const f = h.current.offsetWidth * 0.5;
282
+ let R = Math.floor((f - 30) / (120 + 20));
283
+ if (R < 2 && (R = 2), R >= e.length) {
284
+ W({ start: 0, end: e.length, showEllipsis: !1 });
285
+ return;
286
+ }
287
+ const oe = 0, X = Math.min(R - 1, e.length);
288
+ W({
289
+ start: oe,
290
+ end: X,
291
+ showEllipsis: X < e.length - 1
292
+ });
293
+ }, [e.length]);
294
+ if (x.useEffect(() => {
295
+ M();
296
+ const r = new ResizeObserver(() => {
297
+ M();
298
+ });
299
+ return h.current && r.observe(h.current), () => {
300
+ r.disconnect();
301
+ };
302
+ }, [M]), e.length <= 3)
303
+ return /* @__PURE__ */ n(Z, { children: e.map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
304
+ /* @__PURE__ */ n(
305
+ I,
306
+ {
307
+ $isLast: f === e.length - 1,
308
+ $isClickable: !!(f < e.length - 1 || r.onClick),
309
+ onClick: () => y(r, f),
310
+ style: {
311
+ color: f === e.length - 1 ? o.colors.text : o.colors.textSecondary || o.colors.disabledText
312
+ },
313
+ title: r.label,
314
+ children: r.label
315
+ }
316
+ ),
317
+ f < e.length - 1 && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) })
318
+ ] }, r.id)) });
319
+ const { start: v, end: m, showEllipsis: T } = b;
320
+ return /* @__PURE__ */ k(Z, { children: [
321
+ e.slice(v, m).map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
322
+ /* @__PURE__ */ n(
323
+ I,
324
+ {
325
+ $isLast: f === m - v - 1 && !T,
326
+ $isClickable: !!(f < m - v - 1 || r.onClick),
327
+ onClick: () => y(r, v + f),
328
+ style: {
329
+ color: f === m - v - 1 && !T ? o.colors.text : o.colors.textSecondary || o.colors.disabledText
330
+ },
331
+ title: r.label,
332
+ children: r.label
333
+ }
334
+ ),
335
+ f < m - v - 1 && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) })
336
+ ] }, r.id)),
337
+ T && /* @__PURE__ */ k(ne, { children: [
338
+ /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) }),
339
+ /* @__PURE__ */ n(
340
+ I,
341
+ {
342
+ $isLast: !1,
343
+ $isClickable: !1,
344
+ style: {
345
+ color: o.colors.textSecondary || o.colors.disabledText,
346
+ cursor: "default",
347
+ maxWidth: "auto"
348
+ },
349
+ title: `${e.slice(m, -1).map((r) => r.label).join(" > ")}`,
350
+ children: "..."
351
+ }
352
+ ),
353
+ /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) }),
354
+ /* @__PURE__ */ n(
355
+ I,
356
+ {
357
+ $isLast: !0,
358
+ $isClickable: !!e[e.length - 1].onClick,
359
+ onClick: () => y(e[e.length - 1], e.length - 1),
360
+ style: {
361
+ color: o.colors.text
362
+ },
363
+ title: e[e.length - 1].label,
364
+ children: e[e.length - 1].label
365
+ }
366
+ )
367
+ ] })
368
+ ] });
369
+ }, [F, te] = x.useState(!0);
370
+ return /* @__PURE__ */ n(
371
+ we,
372
+ {
373
+ style: {
374
+ background: o.colors.appBackground,
375
+ color: o.colors.text,
376
+ fontFamily: ((_ = (V = o.fonts) == null ? void 0 : V.body) == null ? void 0 : _.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
377
+ },
378
+ children: /* @__PURE__ */ k("div", { style: { height: "100%", display: "flex", width: "100%", gap: 12 }, children: [
379
+ p && p.length > 0 && /* @__PURE__ */ n("div", { style: { flex: `0 0 ${F ? 72 : 28}px`, transition: "flex-basis .2s ease" }, children: /* @__PURE__ */ n(
380
+ le,
381
+ {
382
+ items: p,
383
+ open: F,
384
+ onOpenChange: te,
385
+ onItemClick: (h) => g({ id: String(h.key), label: h.name }, 0),
386
+ defaultOpen: !0
387
+ }
388
+ ) }),
389
+ /* @__PURE__ */ k("div", { style: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0 }, children: [
390
+ (c || d || i || e) && /* @__PURE__ */ k(ye, { ref: O, children: [
391
+ i && /* @__PURE__ */ n(
392
+ ve,
393
+ {
394
+ onClick: L,
395
+ style: { color: o.colors.primary, borderRadius: o.space.radius || "6px" },
396
+ title: "\u8FD4\u56DE",
397
+ children: /* @__PURE__ */ n(Ce, { size: 18 })
398
+ }
399
+ ),
400
+ C(),
401
+ c && /* @__PURE__ */ n(
402
+ me,
403
+ {
404
+ onClick: A,
405
+ style: {
406
+ color: o.colors.text,
407
+ fontSize: ((G = (H = o.fonts) == null ? void 0 : H.heading) == null ? void 0 : G.size) || "16px",
408
+ fontWeight: ((Y = (P = o.fonts) == null ? void 0 : P.heading) == null ? void 0 : Y.weight) || "600"
409
+ },
410
+ title: c,
411
+ children: c
412
+ }
413
+ ),
414
+ d && /* @__PURE__ */ n(
415
+ be,
416
+ {
417
+ style: {
418
+ color: o.colors.textSecondary || o.colors.disabledText,
419
+ opacity: 0.7,
420
+ fontSize: ((K = (q = o.fonts) == null ? void 0 : q.body) == null ? void 0 : K.size) || "12px"
421
+ },
422
+ title: d,
423
+ children: d
424
+ }
425
+ )
426
+ ] }),
427
+ /* @__PURE__ */ n(
428
+ De,
429
+ {
430
+ style: {
431
+ background: o.colors.dashboardBackground || "transparent",
432
+ border: `1px solid ${o.colors.border}` || void 0,
433
+ borderRadius: o.space.radius || void 0,
434
+ boxShadow: o.colors.shadow || void 0
435
+ },
436
+ children: t || /* @__PURE__ */ n(ue, {})
437
+ }
438
+ )
439
+ ] })
440
+ ] })
441
+ }
442
+ );
443
+ }, Ne = s.div.withConfig({
444
+ shouldForwardProp: (t) => !["backgroundImage", "backgroundColor"].includes(t)
445
+ })`
446
+ position: fixed;
447
+ top: 0;
448
+ left: 0;
449
+ width: 100vw;
450
+ height: 100vh;
451
+ background: ${(t) => t.backgroundImage ? `url(${t.backgroundImage}) center/cover no-repeat` : t.backgroundColor || "#1a1a1a"};
452
+ display: flex;
453
+ flex-direction: column;
454
+ overflow: hidden;
455
+ z-index: 1;
456
+ `, $e = s.div`
457
+ height: 48px;
458
+ width: 100%;
459
+ display: flex;
460
+ align-items: center;
461
+ justify-content: center;
462
+ background: transparent;
463
+ z-index: 10;
464
+ flex-shrink: 0;
465
+ `, Ae = s.div`
466
+ flex: 1;
467
+ width: 100%;
468
+ overflow-y: auto;
469
+ overflow-x: hidden;
470
+ position: relative;
471
+ z-index: 2;
472
+ background: transparent;
473
+
474
+ /* 自定义滚动条样式 */
475
+ &::-webkit-scrollbar {
476
+ width: 6px;
477
+ }
478
+
479
+ &::-webkit-scrollbar-track {
480
+ background: rgba(255, 255, 255, 0.1);
481
+ border-radius: 3px;
482
+ }
483
+
484
+ &::-webkit-scrollbar-thumb {
485
+ background: rgba(255, 255, 255, 0.3);
486
+ border-radius: 3px;
487
+ }
488
+
489
+ &::-webkit-scrollbar-thumb:hover {
490
+ background: rgba(255, 255, 255, 0.5);
491
+ }
492
+ `, Re = s.div`
493
+ height: 80px;
494
+ width: 100%;
495
+ display: flex;
496
+ align-items: flex-end;
497
+ justify-content: center;
498
+ padding: 12px 0;
499
+ background: transparent;
500
+ z-index: 10;
501
+ flex-shrink: 0;
502
+ `, je = ({
503
+ children: t,
504
+ backgroundImage: i,
505
+ backgroundColor: c,
506
+ header: d,
507
+ dockItems: e,
508
+ dockActiveMode: p = "single",
509
+ defaultDockActiveId: D,
510
+ defaultDockActiveIds: N,
511
+ styles: $,
512
+ eventsEmit: a
513
+ }) => {
514
+ var A, y;
515
+ const l = Q({ theme: z, mode: "light" }, $), w = (l == null ? void 0 : l.theme) || z, o = (g, C) => {
516
+ a != null && a.onDockItemClick ? a.onDockItemClick(g, C) : g.onClick && g.onClick();
517
+ }, O = (g, C) => {
518
+ a != null && a.onDockActiveChange && a.onDockActiveChange(g, C);
519
+ }, L = (g, C) => {
520
+ a != null && a.onDockActiveChangeMultiple && a.onDockActiveChangeMultiple(g, C);
521
+ };
522
+ return /* @__PURE__ */ k(
523
+ Ne,
524
+ {
525
+ backgroundImage: i,
526
+ backgroundColor: c,
527
+ children: [
528
+ d && /* @__PURE__ */ n($e, { children: d }),
529
+ /* @__PURE__ */ n(
530
+ Ae,
531
+ {
532
+ style: {
533
+ color: w.colors.text,
534
+ fontFamily: ((y = (A = w.fonts) == null ? void 0 : A.body) == null ? void 0 : y.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
535
+ },
536
+ children: t
537
+ }
538
+ ),
539
+ e && e.length > 0 && /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(
540
+ ie,
541
+ {
542
+ items: e,
543
+ itemWidth: 48,
544
+ itemHeight: 48,
545
+ magnification: 1.5,
546
+ itemGap: 8,
547
+ activeMode: p,
548
+ defaultActiveId: D,
549
+ defaultActiveIds: N,
550
+ onItemClick: o,
551
+ onActiveChange: O,
552
+ onActiveChangeMultiple: L
553
+ }
554
+ ) })
555
+ ]
556
+ }
557
+ );
558
+ };
559
+ export {
560
+ Te as DashboardContainer,
561
+ je as DockContainer
562
+ };
package/lib_enter.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default as DashboardContainer } from './DashboardContainer';
2
+ export { default as DockContainer } from './DockContainer';
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@mxmweb/zui-layouts",
3
+ "main": "index.js",
4
+ "license": "MIT",
5
+ "style": "assets/style.css",
6
+ "types": "lib_enter.d.ts",
7
+ "private": false,
8
+ "version": "1.1.0",
9
+ "author": "hanfeng_Zhang",
10
+ "type": "module",
11
+ "scripts": {
12
+ "test": "yarn link",
13
+ "disconnect": "yarn unlink"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./lib_enter.d.ts",
18
+ "import": "./index.js",
19
+ "default": "./index.js"
20
+ },
21
+ "./style.css": "./assets/style.css"
22
+ },
23
+ "peerDependencies": {
24
+ "@mxmweb/zui-components": "*",
25
+ "@mxmweb/zui-elements": "*",
26
+ "@mxmweb/zui-theme": "*",
27
+ "react": ">=18",
28
+ "react-dom": ">=18",
29
+ "styled-components": "^6"
30
+ }
31
+ }