weifuwu 0.91.0 → 0.93.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 +1 -1
- package/dist/client/components/index.d.ts +3 -0
- package/dist/client/components/style.css +1 -12219
- package/dist/client/layout/bundle.d.ts +42 -0
- package/dist/client/layout/weifuwu-layout.css +1 -1495
- package/dist/client/vdom/core/protocol.d.ts +62 -7
- package/dist/client/vdom/index.js +3 -3
- package/dist/server/db/http.d.ts +4 -4
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +295 -174
- package/dist/server/response.d.ts +17 -0
- package/docs/client.md +128 -7
- package/docs/layout.md +243 -0
- package/docs/server.md +229 -9
- package/package.json +5 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 层序(优先级从低到高——后声明者胜)
|
|
3
|
+
*
|
|
4
|
+
* **utilities 在 components 之后**(LAYOUT-PLAN W2):工具类是消费侧的**显式覆盖**意图,
|
|
5
|
+
* 必须能胜组件自身样式(Tailwind 惯例)。旧序(utilities 在 components 之前)下的实证:
|
|
6
|
+
* · `.wf-card--pad-lg + .wf-padding-xs` → 24px(工具类 4px 被吞)
|
|
7
|
+
* · `.wf-btn + .wf-hidden` → inline-flex(**隐藏失效**——agent-platform 面板按钮
|
|
8
|
+
* 桌面隐藏不生效,当时靠 `wf-hidden\@lg { … !important }` 变通)
|
|
9
|
+
* 层序声明必须是**活 atrule**(见文件头 ③:旧 build 的未闭合注释曾吞掉本声明 →
|
|
10
|
+
* 优先级退化为块首现顺序,改层序会是空操作)。unlayered 应用 CSS 仍胜全部层(规范行为)。
|
|
11
|
+
*/
|
|
12
|
+
export declare const LAYER_ORDER: readonly ["tokens", "base", "layout", "components", "utilities"];
|
|
13
|
+
/** 文件 → 层归属(未登记即抛错——静默降级 = 层叠优先级悄悄变化) */
|
|
14
|
+
export declare const LAYER_OF: Record<string, string>;
|
|
15
|
+
export interface CssBundle {
|
|
16
|
+
/** 装配后的完整 CSS(可直接作为 Response body / 写盘) */
|
|
17
|
+
css: string;
|
|
18
|
+
/** 参与装配的文件绝对路径(新鲜度键——mtime+size 逐个校验) */
|
|
19
|
+
inputs: string[];
|
|
20
|
+
}
|
|
21
|
+
/** entry 的 `@import` 顺序(源面即顺序面——单源①) */
|
|
22
|
+
export declare function layoutEntryFiles(layoutDir: string): Promise<string[]>;
|
|
23
|
+
/** 目录是否为 layout 源面(有 entry + 分量 `_*.css`——dist 只有合并产物 → false) */
|
|
24
|
+
export declare function isLayoutSourceDir(dir: string): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* 装配 layout CSS(Token + 暗色 + 预设 + 基础 + 原语 + 工具——按 LAYER_OF 分层)
|
|
27
|
+
* @param layoutDir `src/client/layout` 绝对/相对路径
|
|
28
|
+
*/
|
|
29
|
+
export declare function bundleLayout(layoutDir: string): Promise<CssBundle>;
|
|
30
|
+
/**
|
|
31
|
+
* 装配组件 CSS = layout 全量 + 全部组件 CSS(`@layer components`)
|
|
32
|
+
* 组件目录动态扫描(新增组件自动包含——硬编码列表会静默漏 CSS)
|
|
33
|
+
*/
|
|
34
|
+
export declare function bundleComponents(layoutDir: string, componentsDir: string): Promise<CssBundle>;
|
|
35
|
+
/**
|
|
36
|
+
* 类 → 层归属映射(契约用:跨管线层归属全等断言)
|
|
37
|
+
*
|
|
38
|
+
* 顶层 `@layer <name> { … }` 块内的 `.wf-*` 归该层(块内嵌套 @media/@supports 自然包含);
|
|
39
|
+
* 块外的类归 `unlayered`(tokens 层文件不包裹——但其内容零类,仅 :root 变量)。
|
|
40
|
+
* 首现优先(同类多规则同层——跨管线比较只看归属,不看声明明细)。
|
|
41
|
+
*/
|
|
42
|
+
export declare function layerMapOf(css: string): Map<string, string>;
|