weifuwu 0.35.1 → 0.36.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 CHANGED
@@ -23,6 +23,7 @@ npm install weifuwu
23
23
  | **ui** | `ui` | SSR 渲染 + 动态 JS 编译 → `ctx.ui.html/css/js` | `Router` |
24
24
  | **graphql** | `router.graphql()` | GraphQL 端点 | `Router` |
25
25
  | **client** | — | 前端 VDOM + Proxy 框架 | — |
26
+ | **layout** | — | 纯 CSS 布局原语 + 主题 Token 系统 | — |
26
27
 
27
28
  **前端 `weifuwu/client` 模块总览:**
28
29
 
@@ -721,6 +722,105 @@ function myMiddleware(): AppMiddleware {
721
722
 
722
723
  ---
723
724
 
725
+ ## 布局 & 主题 (`weifuwu/layout`)
726
+
727
+ 纯 CSS 布局原语 + 主题 Token 系统,不绑定任何 JS 框架。
728
+
729
+ ```bash
730
+ npm install weifuwu # 已包含
731
+ ```
732
+
733
+ ```ts
734
+ // 服务端编译 CSS
735
+ app.get('/weifuwu.css', async (req, ctx) => ctx.ui.css('./node_modules/weifuwu/dist/layout/weifuwu-layout.css'))
736
+ ```
737
+
738
+ ```html
739
+ <!-- 或直接引入 -->
740
+ <link rel="stylesheet" href="/weifuwu.css">
741
+ ```
742
+
743
+ ### 33 个布局原语
744
+
745
+ | 类别 | 原语 | 含义 | CSS 实现 |
746
+ |------|------|------|---------|
747
+ | **排列** | `wf-stack` | 纵向堆叠 | `flex-direction: column + gap` |
748
+ | | `wf-stack-reverse` | 反向堆叠 | `flex-direction: column-reverse + gap` |
749
+ | | `wf-row` | 横向排列 | `flex + flex-wrap + gap` |
750
+ | | `wf-row-reverse` | 反向排列 | `flex-direction: row-reverse` |
751
+ | | `wf-nowrap` | 不换行 | `flex-wrap: nowrap` |
752
+ | | `wf-cluster` | 换行簇 | `flex-wrap: wrap + justify-content: center` |
753
+ | **分布** | `wf-split` | 两端展开 | `justify-content: space-between` |
754
+ | | `wf-center` | 居中 | `flex + center both axes` |
755
+ | | `wf-right` | 靠右 | `justify-content: flex-end` |
756
+ | | `wf-around` | 环绕 | `justify-content: space-around` |
757
+ | | `wf-evenly` | 均匀 | `justify-content: space-evenly` |
758
+ | **对齐** | `wf-top` | 顶部 | `align-items: flex-start` |
759
+ | | `wf-bottom` | 底部 | `align-items: flex-end` |
760
+ | | `wf-stretch` | 拉伸 | `align-items: stretch` |
761
+ | **弹性** | `wf-fill` | 撑满 | `flex: 1 + min-width: 0` |
762
+ | | `wf-fixed` | 固定 | `flex: none` |
763
+ | | `wf-auto` | 按内容 | `flex: auto` |
764
+ | | `wf-shrink` | 可收缩 | `min-width: 0 / min-height: 0` |
765
+ | **Z轴** | `wf-cover` | 全屏覆盖 | `position: fixed + inset: 0` |
766
+ | | `wf-pop` | 浮动层 | `position: absolute` |
767
+ | | `wf-anchor` | 锚点容器 | `position: relative` |
768
+ | | `wf-layer` | 层级控制 | `position: relative + z-index` |
769
+ | | `wf-sticky` | 粘性 | `position: sticky` |
770
+ | **容器** | `wf-surface` | 基础面 | `border-radius + box-shadow + bg` |
771
+ | | `wf-grid` | 网格 | `display: grid + --wf-cols` |
772
+ | | `wf-container` | 宽度约束 | `max-width + margin: auto` |
773
+ | | `wf-scroll` | 滚动 | `overflow: auto` |
774
+ | | `wf-clip` | 裁剪 | `overflow: hidden` |
775
+ | **显隐** | `wf-hidden` | 隐藏 | `display: none` |
776
+ | | `wf-block` | 块级 | `display: block` |
777
+ | | `wf-inline` | 行内 | `display: inline` |
778
+ | | `wf-inline-block` | 行内块 | `display: inline-block` |
779
+ | | `wf-contents` | 容器抹除 | `display: contents` |
780
+
781
+ ### 72 个主题 Token
782
+
783
+ | 类别 | Token 示例 | 含义 |
784
+ |------|-----------|------|
785
+ | 品牌色 | `--wf-color-primary`, `--wf-color-primary-bg` | 品牌色、Hover、背景 |
786
+ | 语义色 | `--wf-color-success`, `--wf-color-warning`, `--wf-color-error`, `--wf-color-info` | 状态语义色 |
787
+ | 中性色 | `--wf-color-text`, `--wf-color-bg`, `--wf-color-border` | 文字/背景/边框 |
788
+ | 字体 | `--wf-font-sans`, `--wf-font-mono` | 字体族 |
789
+ | 字号 | `--wf-font-size-xs` ~ `--wf-font-size-5xl`(9 级)| 字号层级 |
790
+ | 字重 | `--wf-font-weight-normal` ~ `bold`(4 级)| 字重 |
791
+ | 行高 | `--wf-line-height-tight`, `--wf-line-height`, `--wf-line-height-relaxed` | 行高 |
792
+ | 字距 | `--wf-letter-spacing`, `--wf-letter-spacing-wide`, `--wf-letter-spacing-wider` | 字符间距 |
793
+ | 间距 | `--wf-space-xs` ~ `--wf-space-2xl`(8 级)| margin / padding |
794
+ | 间隔 | `--wf-gap-xs` ~ `--wf-gap-2xl`(6 级)| flex / grid gap |
795
+ | 圆角 | `--wf-radius-sm` ~ `--wf-radius-xl`(5 级)| border-radius |
796
+ | 阴影 | `--wf-shadow-sm` ~ `--wf-shadow-lg`(4 级)| box-shadow |
797
+ | 边框 | `--wf-border-width` | 边框宽度 |
798
+ | 聚焦 | `--wf-focus-ring` | 聚焦环 |
799
+ | 动效 | `--wf-transition-duration`, `--wf-transition-timing` | 过渡时长/曲线 |
800
+ | 表单 | `--wf-accent-color`, `--wf-caret-color` | 表单控件主题色 |
801
+ | 透明 | `--wf-opacity-disabled`, `--wf-opacity-overlay` | 禁用态/遮罩透明度 |
802
+ | 层级 | `--wf-pop-z`, `--wf-cover-z` | z-index |
803
+
804
+ ### 暗色模式
805
+
806
+ 切换 `html` 标签的 `data-theme` 属性即可自动切换全部主题色:
807
+
808
+ ```ts
809
+ // weifuwu/client
810
+ function toggleTheme() {
811
+ const dark = document.documentElement.getAttribute('data-theme') === 'dark'
812
+ document.documentElement.setAttribute('data-theme', dark ? 'light' : 'dark')
813
+ }
814
+ ```
815
+
816
+ ### 基础元素默认样式
817
+
818
+ 引入 `weifuwu/layout` 后,以下 HTML 元素自动绑定主题 Token,无需额外样式:
819
+
820
+ `body`, `h1`~`h6`, `p`, `a`, `label`, `small`, `input`, `textarea`, `select`, `button`, `table`, `th`, `td`, `hr`, `pre`, `code`
821
+
822
+ ---
823
+
724
824
  ## 全栈模式
725
825
 
726
826
  ### 认证流程
@@ -0,0 +1,536 @@
1
+ /* weifuwu/layout — 基于 CSS 标准的布局原语 */
2
+
3
+ /* weifuwu/theme — 设计 Token */
4
+ :root {
5
+ /* ── 间距 ── */
6
+ --wf-gap-xs: 4px;
7
+ --wf-gap-sm: 8px;
8
+ --wf-gap-md: 12px;
9
+ --wf-gap-lg: 16px;
10
+ --wf-gap-xl: 24px;
11
+ --wf-gap-2xl: 32px;
12
+
13
+ --wf-space-xs: 4px;
14
+ --wf-space-sm: 8px;
15
+ --wf-space: 12px;
16
+ --wf-space-md: 16px;
17
+ --wf-space-lg: 24px;
18
+ --wf-space-xl: 32px;
19
+ --wf-space-2xl: 40px;
20
+
21
+ /* ── 圆角 ── */
22
+ --wf-radius-sm: 4px;
23
+ --wf-radius: 6px;
24
+ --wf-radius-md: 8px;
25
+ --wf-radius-lg: 12px;
26
+ --wf-radius-xl: 20px;
27
+
28
+ --wf-surface-radius: var(--wf-radius-md);
29
+ --wf-surface-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
30
+
31
+ /* ── 阴影 ── */
32
+ --wf-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
33
+ --wf-shadow: 0 1px 3px rgba(0,0,0,0.08);
34
+ --wf-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
35
+ --wf-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
36
+
37
+ /* ── 层级 ── */
38
+ --wf-pop-z: 50;
39
+ --wf-cover-z: 100;
40
+
41
+ /* ── 色彩 — 品牌 ── */
42
+ --wf-color-primary: #4f6ef7;
43
+ --wf-color-primary-hover: #3b5ae0;
44
+ --wf-color-primary-bg: #eef1ff;
45
+
46
+ --wf-color-success: #22c55e;
47
+ --wf-color-success-bg: #f0fdf4;
48
+ --wf-color-warning: #f59e0b;
49
+ --wf-color-warning-bg: #fffbeb;
50
+ --wf-color-error: #ef4444;
51
+ --wf-color-error-bg: #fef2f2;
52
+
53
+ /* ── 色彩 — 中性 ── */
54
+ --wf-color-text: #0f172a;
55
+ --wf-color-text-secondary: #64748b;
56
+ --wf-color-text-tertiary: #94a3b8;
57
+ --wf-color-text-disabled: #cbd5e1;
58
+
59
+ --wf-color-bg: #ffffff;
60
+ --wf-color-bg-secondary: #f8fafc;
61
+ --wf-color-bg-tertiary: #f1f5f9;
62
+
63
+ --wf-color-border: #e2e8f0;
64
+ --wf-color-border-light: #f1f5f9;
65
+ --wf-color-border-dark: #cbd5e1;
66
+
67
+ /* ── surface 引用色彩 ── */
68
+ --wf-surface-bg: var(--wf-color-bg);
69
+
70
+ /* ── 字体 ── */
71
+ --wf-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
72
+ --wf-font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
73
+
74
+ --wf-font-size-xs: 11px;
75
+ --wf-font-size-sm: 12px;
76
+ --wf-font-size-base: 13px;
77
+ --wf-font-size-lg: 14px;
78
+ --wf-font-size-xl: 15px;
79
+ --wf-font-size-2xl: 20px;
80
+ --wf-font-size-3xl: 24px;
81
+ --wf-font-size-4xl: 28px;
82
+ --wf-font-size-5xl: 32px;
83
+
84
+ --wf-font-weight-normal: 400;
85
+ --wf-font-weight-medium: 500;
86
+ --wf-font-weight-semibold: 600;
87
+ --wf-font-weight-bold: 700;
88
+
89
+ /* ── 行高 ── */
90
+ --wf-line-height-tight: 1.25;
91
+ --wf-line-height: 1.5;
92
+ --wf-line-height-relaxed: 1.75;
93
+
94
+ /* ── 边框宽度 ── */
95
+ --wf-border-width: 1px;
96
+
97
+ /* ── 聚焦环 ── */
98
+ --wf-focus-ring: 0 0 0 2px var(--wf-color-primary-bg);
99
+
100
+ /* ── 动效 ── */
101
+ --wf-transition-duration: 150ms;
102
+ --wf-transition-timing: ease;
103
+ --wf-transition: var(--wf-transition-duration) var(--wf-transition-timing);
104
+
105
+ /* ── 色彩 — 信息(补充) ── */
106
+ --wf-color-info: #1677ff;
107
+ --wf-color-info-bg: #e6f4ff;
108
+
109
+ /* ── 表单控件 ── */
110
+ --wf-accent-color: var(--wf-color-primary);
111
+ --wf-caret-color: var(--wf-color-primary);
112
+
113
+ /* ── 透明度 ── */
114
+ --wf-opacity-disabled: 0.5;
115
+ --wf-opacity-overlay: 0.4;
116
+
117
+ /* ── 文字间距 ── */
118
+ --wf-letter-spacing: normal;
119
+ --wf-letter-spacing-wide: 0.5px;
120
+ --wf-letter-spacing-wider: 1px;
121
+ }
122
+
123
+ /* weifuwu/theme — 暗色模式 */
124
+ [data-theme="dark"] {
125
+ --wf-color-primary: #6b8aff;
126
+ --wf-color-primary-hover: #8ba3ff;
127
+ --wf-color-primary-bg: #1e293b;
128
+
129
+ --wf-color-success: #4ade80;
130
+ --wf-color-success-bg: #14532d;
131
+ --wf-color-warning: #fbbf24;
132
+ --wf-color-warning-bg: #451a03;
133
+ --wf-color-error: #f87171;
134
+ --wf-color-error-bg: #451a1a;
135
+
136
+ --wf-color-info: #60a5fa;
137
+ --wf-color-info-bg: #172554;
138
+
139
+ --wf-color-text: #f1f5f9;
140
+ --wf-color-text-secondary: #94a3b8;
141
+ --wf-color-text-tertiary: #64748b;
142
+ --wf-color-text-disabled: #475569;
143
+
144
+ --wf-color-bg: #0f172a;
145
+ --wf-color-bg-secondary: #1e293b;
146
+ --wf-color-bg-tertiary: #334155;
147
+
148
+ --wf-color-border: #334155;
149
+ --wf-color-border-light: #1e293b;
150
+ --wf-color-border-dark: #475569;
151
+
152
+ --wf-surface-shadow: 0 1px 3px rgba(0,0,0,0.3);
153
+ --wf-shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
154
+ --wf-shadow: 0 1px 3px rgba(0,0,0,0.3);
155
+ --wf-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
156
+ --wf-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
157
+
158
+ --wf-focus-ring: 0 0 0 2px var(--wf-color-primary-bg);
159
+
160
+ --wf-surface-bg: var(--wf-color-bg);
161
+ }
162
+
163
+ /* weifuwu/theme — 基础元素默认样式 */
164
+ *,
165
+ *::before,
166
+ *::after {
167
+ box-sizing: border-box;
168
+ }
169
+
170
+ body {
171
+ margin: 0;
172
+ background: var(--wf-color-bg);
173
+ color: var(--wf-color-text);
174
+ font-family: var(--wf-font-sans);
175
+ font-size: var(--wf-font-size-base);
176
+ line-height: var(--wf-line-height);
177
+ -webkit-font-smoothing: antialiased;
178
+ }
179
+
180
+ a {
181
+ color: var(--wf-color-primary);
182
+ text-decoration: none;
183
+ }
184
+ a:hover {
185
+ color: var(--wf-color-primary-hover);
186
+ text-decoration: underline;
187
+ }
188
+
189
+ input,
190
+ textarea,
191
+ select,
192
+ button {
193
+ font-family: inherit;
194
+ font-size: inherit;
195
+ line-height: inherit;
196
+ }
197
+
198
+ input,
199
+ textarea,
200
+ select {
201
+ accent-color: var(--wf-accent-color);
202
+ caret-color: var(--wf-caret-color);
203
+ background: var(--wf-color-bg);
204
+ color: var(--wf-color-text);
205
+ border: var(--wf-border-width) solid var(--wf-color-border);
206
+ border-radius: var(--wf-radius);
207
+ padding: var(--wf-space-sm) var(--wf-space);
208
+ }
209
+
210
+ input:focus,
211
+ textarea:focus,
212
+ select:focus {
213
+ outline: none;
214
+ box-shadow: var(--wf-focus-ring);
215
+ border-color: var(--wf-color-primary);
216
+ }
217
+
218
+ input:disabled,
219
+ textarea:disabled,
220
+ select:disabled,
221
+ button:disabled {
222
+ opacity: var(--wf-opacity-disabled);
223
+ cursor: not-allowed;
224
+ }
225
+
226
+ button {
227
+ accent-color: var(--wf-accent-color);
228
+ background: var(--wf-color-bg);
229
+ color: var(--wf-color-text);
230
+ border: var(--wf-border-width) solid var(--wf-color-border);
231
+ border-radius: var(--wf-radius);
232
+ padding: var(--wf-space-sm) var(--wf-space-md);
233
+ cursor: pointer;
234
+ }
235
+ button:hover {
236
+ border-color: var(--wf-color-primary);
237
+ color: var(--wf-color-primary);
238
+ }
239
+
240
+ h1, h2, h3, h4, h5, h6 {
241
+ font-weight: var(--wf-font-weight-semibold);
242
+ line-height: var(--wf-line-height-tight);
243
+ color: var(--wf-color-text);
244
+ }
245
+
246
+ p {
247
+ line-height: var(--wf-line-height-relaxed);
248
+ }
249
+
250
+ small {
251
+ font-size: var(--wf-font-size-sm);
252
+ color: var(--wf-color-text-tertiary);
253
+ }
254
+
255
+ label {
256
+ font-size: var(--wf-font-size-base);
257
+ font-weight: var(--wf-font-weight-medium);
258
+ color: var(--wf-color-text);
259
+ }
260
+
261
+ table {
262
+ width: 100%;
263
+ border-collapse: collapse;
264
+ }
265
+
266
+ th {
267
+ text-align: left;
268
+ font-weight: var(--wf-font-weight-medium);
269
+ font-size: var(--wf-font-size-xs);
270
+ color: var(--wf-color-text-tertiary);
271
+ text-transform: uppercase;
272
+ letter-spacing: 0.5px;
273
+ padding: var(--wf-space) var(--wf-space-sm);
274
+ border-bottom: var(--wf-border-width) solid var(--wf-color-border);
275
+ background: var(--wf-color-bg-secondary);
276
+ }
277
+
278
+ td {
279
+ padding: var(--wf-space) var(--wf-space-sm);
280
+ border-bottom: var(--wf-border-width) solid var(--wf-color-border);
281
+ color: var(--wf-color-text);
282
+ font-size: var(--wf-font-size-base);
283
+ }
284
+
285
+ hr {
286
+ border: none;
287
+ border-top: var(--wf-border-width) solid var(--wf-color-border);
288
+ margin: var(--wf-space-md) 0;
289
+ }
290
+
291
+ pre, code {
292
+ font-family: var(--wf-font-mono);
293
+ font-size: var(--wf-font-size-sm);
294
+ }
295
+
296
+ pre {
297
+ background: var(--wf-color-bg-secondary);
298
+ border: var(--wf-border-width) solid var(--wf-color-border);
299
+ border-radius: var(--wf-radius);
300
+ padding: var(--wf-space) var(--wf-space-md);
301
+ overflow-x: auto;
302
+ white-space: pre;
303
+ }
304
+
305
+ code {
306
+ background: var(--wf-color-bg-secondary);
307
+ padding: 2px 6px;
308
+ border-radius: var(--wf-radius-sm);
309
+ }
310
+
311
+ /* stack — 纵向堆叠 */
312
+ .wf-stack {
313
+ display: flex;
314
+ flex-direction: column;
315
+ gap: var(--wf-gap, var(--wf-gap-md));
316
+ }
317
+
318
+ /* stack-reverse — 纵向反向堆叠 */
319
+ .wf-stack-reverse {
320
+ display: flex;
321
+ flex-direction: column-reverse;
322
+ gap: var(--wf-gap, var(--wf-gap-md));
323
+ }
324
+
325
+ /* row — 横向排列 */
326
+ .wf-row {
327
+ display: flex;
328
+ flex-wrap: wrap;
329
+ gap: var(--wf-gap, var(--wf-gap-md));
330
+ align-items: var(--wf-align, center);
331
+ }
332
+
333
+ /* row-reverse — 横向反向排列 */
334
+ .wf-row-reverse {
335
+ display: flex;
336
+ flex-direction: row-reverse;
337
+ flex-wrap: wrap;
338
+ gap: var(--wf-gap, var(--wf-gap-md));
339
+ align-items: var(--wf-align, center);
340
+ }
341
+
342
+ /* split — 两端展开 */
343
+ .wf-split {
344
+ display: flex;
345
+ justify-content: space-between;
346
+ align-items: var(--wf-align, center);
347
+ gap: var(--wf-gap, var(--wf-gap-md));
348
+ }
349
+ .wf-split > :last-child {
350
+ flex-shrink: 0;
351
+ }
352
+
353
+ /* center — 居中 */
354
+ .wf-center {
355
+ display: flex;
356
+ flex-direction: column;
357
+ align-items: center;
358
+ justify-content: center;
359
+ }
360
+
361
+ /* right — 靠右对齐 */
362
+ .wf-right {
363
+ display: flex;
364
+ justify-content: flex-end;
365
+ align-items: var(--wf-align, center);
366
+ gap: var(--wf-gap, var(--wf-gap-md));
367
+ }
368
+
369
+ /* top — 顶部对齐 */
370
+ .wf-top {
371
+ display: flex;
372
+ align-items: flex-start;
373
+ gap: var(--wf-gap, var(--wf-gap-md));
374
+ }
375
+
376
+ /* bottom — 底部对齐 */
377
+ .wf-bottom {
378
+ display: flex;
379
+ align-items: flex-end;
380
+ gap: var(--wf-gap, var(--wf-gap-md));
381
+ }
382
+
383
+ /* stretch — 拉伸对齐 */
384
+ .wf-stretch {
385
+ display: flex;
386
+ align-items: stretch;
387
+ gap: var(--wf-gap, var(--wf-gap-md));
388
+ }
389
+
390
+ /* around — 均匀环绕分布 */
391
+ .wf-around {
392
+ display: flex;
393
+ justify-content: space-around;
394
+ align-items: var(--wf-align, center);
395
+ gap: var(--wf-gap, var(--wf-gap-md));
396
+ }
397
+
398
+ /* evenly — 均匀分布 */
399
+ .wf-evenly {
400
+ display: flex;
401
+ justify-content: space-evenly;
402
+ align-items: var(--wf-align, center);
403
+ gap: var(--wf-gap, var(--wf-gap-md));
404
+ }
405
+
406
+ /* fill — 撑满剩余空间 */
407
+ .wf-fill {
408
+ flex: 1;
409
+ min-width: 0;
410
+ min-height: 0;
411
+ }
412
+
413
+ /* fixed — 固定不伸缩 */
414
+ .wf-fixed {
415
+ flex: none;
416
+ }
417
+
418
+ /* auto — 按内容撑满 */
419
+ .wf-auto {
420
+ flex: auto;
421
+ min-width: 0;
422
+ min-height: 0;
423
+ }
424
+
425
+ /* cover — 全屏覆盖 */
426
+ .wf-cover {
427
+ position: fixed;
428
+ inset: 0;
429
+ display: flex;
430
+ align-items: center;
431
+ justify-content: center;
432
+ z-index: var(--wf-z, var(--wf-cover-z));
433
+ }
434
+
435
+ /* pop — 浮动层 */
436
+ .wf-pop {
437
+ position: absolute;
438
+ z-index: var(--wf-z, var(--wf-pop-z));
439
+ }
440
+
441
+ /* anchor — 定位锚点容器 */
442
+ .wf-anchor {
443
+ position: relative;
444
+ }
445
+
446
+ /* sticky — 粘性定位 */
447
+ .wf-sticky {
448
+ position: sticky;
449
+ top: var(--wf-offset, 0);
450
+ }
451
+
452
+ /* surface — 基础面 */
453
+ .wf-surface {
454
+ border-radius: var(--wf-surface-radius);
455
+ box-shadow: var(--wf-surface-shadow);
456
+ background: var(--wf-surface-bg);
457
+ }
458
+
459
+ /* grid — 二维网格 */
460
+ .wf-grid {
461
+ display: grid;
462
+ grid-template-columns: var(--wf-cols, repeat(auto-fill, minmax(280px, 1fr)));
463
+ gap: var(--wf-gap, var(--wf-gap-lg));
464
+ }
465
+
466
+ /* cluster — 换行簇 */
467
+ .wf-cluster {
468
+ display: flex;
469
+ flex-wrap: wrap;
470
+ gap: var(--wf-gap, var(--wf-gap-sm));
471
+ justify-content: var(--wf-justify, center);
472
+ align-items: var(--wf-align, center);
473
+ }
474
+
475
+ /* scroll — 可滚动容器 */
476
+ .wf-scroll {
477
+ overflow: auto;
478
+ }
479
+
480
+ /* clip — 裁剪溢出 */
481
+ .wf-clip {
482
+ overflow: hidden;
483
+ }
484
+
485
+ /* hidden — 隐藏元素 */
486
+ .wf-hidden {
487
+ display: none;
488
+ }
489
+
490
+ /* block — 块级显示 */
491
+ .wf-block {
492
+ display: block;
493
+ }
494
+
495
+ /* inline — 行内显示 */
496
+ .wf-inline {
497
+ display: inline;
498
+ }
499
+
500
+ /* inline-block — 行内块 */
501
+ .wf-inline-block {
502
+ display: inline-block;
503
+ }
504
+
505
+ /* container — 内容宽度约束居中 */
506
+ .wf-container {
507
+ max-width: var(--wf-max, 1200px);
508
+ margin: 0 auto;
509
+ padding: 0 var(--wf-gap, var(--wf-gap-lg));
510
+ }
511
+
512
+ /* contents — 容器抹除(子元素直接参与上层布局) */
513
+ .wf-contents {
514
+ display: contents;
515
+ }
516
+
517
+ /* layer — 层级控制 */
518
+ .wf-layer {
519
+ position: relative;
520
+ z-index: var(--wf-z, 1);
521
+ }
522
+
523
+ /* nowrap — 不换行 */
524
+ .wf-nowrap {
525
+ display: flex;
526
+ flex-wrap: nowrap;
527
+ gap: var(--wf-gap, var(--wf-gap-md));
528
+ align-items: var(--wf-align, center);
529
+ }
530
+
531
+ /* min — flex 子项可收缩约束 */
532
+ .wf-shrink {
533
+ min-width: 0;
534
+ min-height: 0;
535
+ }
536
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weifuwu",
3
3
  "type": "module",
4
- "version": "0.35.1",
4
+ "version": "0.36.0",
5
5
  "description": "AI SaaS framework — (req, ctx) => Response",
6
6
  "exports": {
7
7
  ".": {
@@ -15,7 +15,8 @@
15
15
  "./client/jsx-runtime": {
16
16
  "types": "./dist/client/index.d.ts",
17
17
  "default": "./dist/client/index.js"
18
- }
18
+ },
19
+ "./layout": "./dist/layout/weifuwu-layout.css"
19
20
  },
20
21
  "files": [
21
22
  "dist/",