@hia-doc/renderer-html 0.1.3 → 0.1.5
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 +27 -4
- package/dist/index.d.ts +329 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1683 -199
- package/dist/index.js.map +1 -1
- package/dist/information-architecture.d.ts +211 -0
- package/dist/information-architecture.d.ts.map +1 -0
- package/dist/information-architecture.js +243 -0
- package/dist/information-architecture.js.map +1 -0
- package/dist/portal-ui-locale.d.ts +60 -0
- package/dist/portal-ui-locale.d.ts.map +1 -0
- package/dist/portal-ui-locale.js +278 -0
- package/dist/portal-ui-locale.js.map +1 -0
- package/dist/presentation-profile.d.ts +78 -0
- package/dist/presentation-profile.d.ts.map +1 -0
- package/dist/presentation-profile.js +242 -0
- package/dist/presentation-profile.js.map +1 -0
- package/dist/theme-assets.d.ts +31 -0
- package/dist/theme-assets.d.ts.map +1 -0
- package/dist/theme-assets.js +55 -0
- package/dist/theme-assets.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 中性 Portal IA contract identity;它不包含 renderer、theme 或语言 parser 私有结构。
|
|
3
|
+
* Neutral Portal IA contract identity; it contains no renderer, theme, or language-parser private structures.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT = "documentation-portal-information-architecture";
|
|
6
|
+
/** exact draft compatibility identity。Exact draft compatibility identity. */
|
|
7
|
+
export declare const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION = "0.1.0-draft";
|
|
8
|
+
/** 三维 IA 中的逻辑内容分组闭集。Closed logical content-grouping vocabulary. */
|
|
9
|
+
export declare const DOCUMENTATION_PORTAL_CONTENT_GROUPINGS: readonly ["entry", "semantic-container"];
|
|
10
|
+
/** 三维 IA 中的 fragment 获取闭集。Closed fragment-acquisition vocabulary. */
|
|
11
|
+
export declare const DOCUMENTATION_PORTAL_LOADING_STRATEGIES: readonly ["lazy", "eager"];
|
|
12
|
+
/** 三维 IA 中的 member 呈现闭集。Closed member-presentation vocabulary. */
|
|
13
|
+
export declare const DOCUMENTATION_PORTAL_MEMBER_PLACEMENTS: readonly ["separate", "with-parent"];
|
|
14
|
+
/** manifest-only semantic path 的 target-neutral kind 闭集。Target-neutral kind vocabulary for manifest-only semantic paths. */
|
|
15
|
+
export declare const DOCUMENTATION_PORTAL_SEMANTIC_PATH_KINDS: readonly ["repository", "package", "layer", "contract", "operation", "project", "assembly", "namespace", "type"];
|
|
16
|
+
/** kind-aware topic 的稳定 section 顺序。Stable section order for kind-aware topics. */
|
|
17
|
+
export declare const DOCUMENTATION_PORTAL_TOPIC_SECTIONS: readonly ["summary", "declaration", "metadata", "contract", "coverage", "provenance", "members", "relations", "source", "diagnostics"];
|
|
18
|
+
/** 首轮 touched-label catalog 的 locale 闭集。Locale vocabulary for the first touched-label catalog. */
|
|
19
|
+
export declare const DOCUMENTATION_PORTAL_UI_LOCALES: readonly ["zh-CN", "en"];
|
|
20
|
+
export type DocumentationPortalContentGrouping = typeof DOCUMENTATION_PORTAL_CONTENT_GROUPINGS[number];
|
|
21
|
+
export type DocumentationPortalLoadingStrategy = typeof DOCUMENTATION_PORTAL_LOADING_STRATEGIES[number];
|
|
22
|
+
export type DocumentationPortalMemberPlacement = typeof DOCUMENTATION_PORTAL_MEMBER_PLACEMENTS[number];
|
|
23
|
+
export type DocumentationPortalSemanticPathKind = typeof DOCUMENTATION_PORTAL_SEMANTIC_PATH_KINDS[number];
|
|
24
|
+
export type DocumentationPortalTopicSection = typeof DOCUMENTATION_PORTAL_TOPIC_SECTIONS[number];
|
|
25
|
+
export type DocumentationPortalUiLocale = typeof DOCUMENTATION_PORTAL_UI_LOCALES[number];
|
|
26
|
+
/** renderer 接受的显式 IA 配置;缺失整个对象时必须保留 P3。Explicit IA input; omitting the whole object must preserve P3. */
|
|
27
|
+
export interface DocumentationPortalInformationArchitectureOptions {
|
|
28
|
+
contract?: typeof DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT;
|
|
29
|
+
contractVersion?: typeof DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION;
|
|
30
|
+
contentGrouping?: DocumentationPortalContentGrouping;
|
|
31
|
+
loadingStrategy?: DocumentationPortalLoadingStrategy;
|
|
32
|
+
memberPlacement?: DocumentationPortalMemberPlacement;
|
|
33
|
+
}
|
|
34
|
+
/** manifest owner 审阅并显式投影的公开 semantic segment。Public semantic segment explicitly reviewed and projected by the manifest owner. */
|
|
35
|
+
export interface DocumentationPortalSemanticPathSegment {
|
|
36
|
+
kind: DocumentationPortalSemanticPathKind;
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* project-index 中的 resolved IA contract;它同时固定 route、locale、accessibility 与 privacy 边界。
|
|
42
|
+
* Resolved IA contract in project-index; it also freezes routing, locale, accessibility, and privacy boundaries.
|
|
43
|
+
*/
|
|
44
|
+
export interface DocumentationPortalInformationArchitectureContract {
|
|
45
|
+
contract: typeof DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT;
|
|
46
|
+
contractVersion: typeof DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION;
|
|
47
|
+
contentGrouping: DocumentationPortalContentGrouping;
|
|
48
|
+
loadingStrategy: DocumentationPortalLoadingStrategy;
|
|
49
|
+
memberPlacement: DocumentationPortalMemberPlacement;
|
|
50
|
+
semanticPathPolicy: "manifest-only";
|
|
51
|
+
semanticPathKinds: DocumentationPortalSemanticPathKind[];
|
|
52
|
+
topicSections: DocumentationPortalTopicSection[];
|
|
53
|
+
localeModel: {
|
|
54
|
+
uiLocale: DocumentationPortalUiLocale;
|
|
55
|
+
contentLocale: string;
|
|
56
|
+
sourceCommentLocale: "not-projected";
|
|
57
|
+
};
|
|
58
|
+
routing: {
|
|
59
|
+
canonicalEntryRouteStable: true;
|
|
60
|
+
presentationPathAdditive: true;
|
|
61
|
+
versionRouting: false;
|
|
62
|
+
};
|
|
63
|
+
accessibility: {
|
|
64
|
+
disclosureMode: "native-details";
|
|
65
|
+
interactions: ["tab", "enter-space", "visible-focus", "active-ancestor"];
|
|
66
|
+
fullAriaTree: false;
|
|
67
|
+
};
|
|
68
|
+
privacy: {
|
|
69
|
+
semanticPathSource: "manifest-input";
|
|
70
|
+
continuityMode: "metadata-only";
|
|
71
|
+
sourceBodyIncluded: false;
|
|
72
|
+
targetStateRead: false;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* owner-local Draft 2020-12 schema;用于验证 resolved contract,不承诺未知 draft 兼容。
|
|
77
|
+
* Owner-local Draft 2020-12 schema for resolved contracts; it does not promise compatibility with unknown drafts.
|
|
78
|
+
*/
|
|
79
|
+
export declare const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_JSON_SCHEMA: {
|
|
80
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
81
|
+
readonly $id: "https://mandolin.github.io/HIA-Documentation/contracts/documentation-portal-information-architecture-0.1.0-draft.schema.json";
|
|
82
|
+
readonly title: "Generated Documentation Portal Information Architecture";
|
|
83
|
+
readonly type: "object";
|
|
84
|
+
readonly additionalProperties: false;
|
|
85
|
+
readonly required: readonly ["contract", "contractVersion", "contentGrouping", "loadingStrategy", "memberPlacement", "semanticPathPolicy", "semanticPathKinds", "topicSections", "localeModel", "routing", "accessibility", "privacy"];
|
|
86
|
+
readonly properties: {
|
|
87
|
+
readonly contract: {
|
|
88
|
+
readonly const: "documentation-portal-information-architecture";
|
|
89
|
+
};
|
|
90
|
+
readonly contractVersion: {
|
|
91
|
+
readonly const: "0.1.0-draft";
|
|
92
|
+
};
|
|
93
|
+
readonly contentGrouping: {
|
|
94
|
+
readonly enum: readonly ["entry", "semantic-container"];
|
|
95
|
+
};
|
|
96
|
+
readonly loadingStrategy: {
|
|
97
|
+
readonly enum: readonly ["lazy", "eager"];
|
|
98
|
+
};
|
|
99
|
+
readonly memberPlacement: {
|
|
100
|
+
readonly enum: readonly ["separate", "with-parent"];
|
|
101
|
+
};
|
|
102
|
+
readonly semanticPathPolicy: {
|
|
103
|
+
readonly const: "manifest-only";
|
|
104
|
+
};
|
|
105
|
+
readonly semanticPathKinds: {
|
|
106
|
+
readonly const: readonly ["repository", "package", "layer", "contract", "operation", "project", "assembly", "namespace", "type"];
|
|
107
|
+
};
|
|
108
|
+
readonly topicSections: {
|
|
109
|
+
readonly const: readonly ["summary", "declaration", "metadata", "contract", "coverage", "provenance", "members", "relations", "source", "diagnostics"];
|
|
110
|
+
};
|
|
111
|
+
readonly localeModel: {
|
|
112
|
+
readonly type: "object";
|
|
113
|
+
readonly additionalProperties: false;
|
|
114
|
+
readonly required: readonly ["uiLocale", "contentLocale", "sourceCommentLocale"];
|
|
115
|
+
readonly properties: {
|
|
116
|
+
readonly uiLocale: {
|
|
117
|
+
readonly enum: readonly ["zh-CN", "en"];
|
|
118
|
+
};
|
|
119
|
+
readonly contentLocale: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly minLength: 1;
|
|
122
|
+
};
|
|
123
|
+
readonly sourceCommentLocale: {
|
|
124
|
+
readonly const: "not-projected";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly routing: {
|
|
129
|
+
readonly type: "object";
|
|
130
|
+
readonly additionalProperties: false;
|
|
131
|
+
readonly required: readonly ["canonicalEntryRouteStable", "presentationPathAdditive", "versionRouting"];
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly canonicalEntryRouteStable: {
|
|
134
|
+
readonly const: true;
|
|
135
|
+
};
|
|
136
|
+
readonly presentationPathAdditive: {
|
|
137
|
+
readonly const: true;
|
|
138
|
+
};
|
|
139
|
+
readonly versionRouting: {
|
|
140
|
+
readonly const: false;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
readonly accessibility: {
|
|
145
|
+
readonly type: "object";
|
|
146
|
+
readonly additionalProperties: false;
|
|
147
|
+
readonly required: readonly ["disclosureMode", "interactions", "fullAriaTree"];
|
|
148
|
+
readonly properties: {
|
|
149
|
+
readonly disclosureMode: {
|
|
150
|
+
readonly const: "native-details";
|
|
151
|
+
};
|
|
152
|
+
readonly interactions: {
|
|
153
|
+
readonly const: readonly ["tab", "enter-space", "visible-focus", "active-ancestor"];
|
|
154
|
+
};
|
|
155
|
+
readonly fullAriaTree: {
|
|
156
|
+
readonly const: false;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
readonly privacy: {
|
|
161
|
+
readonly type: "object";
|
|
162
|
+
readonly additionalProperties: false;
|
|
163
|
+
readonly required: readonly ["semanticPathSource", "continuityMode", "sourceBodyIncluded", "targetStateRead"];
|
|
164
|
+
readonly properties: {
|
|
165
|
+
readonly semanticPathSource: {
|
|
166
|
+
readonly const: "manifest-input";
|
|
167
|
+
};
|
|
168
|
+
readonly continuityMode: {
|
|
169
|
+
readonly const: "metadata-only";
|
|
170
|
+
};
|
|
171
|
+
readonly sourceBodyIncluded: {
|
|
172
|
+
readonly const: false;
|
|
173
|
+
};
|
|
174
|
+
readonly targetStateRead: {
|
|
175
|
+
readonly const: false;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
/** Portal shell 与 topic 本轮触碰的 label catalog。Label catalog limited to shell and topic labels touched in this slice. */
|
|
182
|
+
export interface DocumentationPortalLabels {
|
|
183
|
+
contract: string;
|
|
184
|
+
coverage: string;
|
|
185
|
+
declaration: string;
|
|
186
|
+
diagnostics: string;
|
|
187
|
+
hierarchy: string;
|
|
188
|
+
loading: string;
|
|
189
|
+
members: string;
|
|
190
|
+
metadata: string;
|
|
191
|
+
open: string;
|
|
192
|
+
provenance: string;
|
|
193
|
+
relations: string;
|
|
194
|
+
requiresServer: string;
|
|
195
|
+
search: string;
|
|
196
|
+
searchPlaceholder: string;
|
|
197
|
+
select: string;
|
|
198
|
+
source: string;
|
|
199
|
+
summary: string;
|
|
200
|
+
unavailable: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* 把显式 IA 输入解析成可序列化 contract;未知 identity/enum 直接抛错,避免 direct API caller 绕过 config。
|
|
204
|
+
* Resolves explicit IA input into a serializable contract; unknown identities/enums throw so direct API callers cannot bypass config.
|
|
205
|
+
*/
|
|
206
|
+
export declare function resolveDocumentationPortalInformationArchitecture(options: DocumentationPortalInformationArchitectureOptions, uiLocale: DocumentationPortalUiLocale, contentLocale: string): DocumentationPortalInformationArchitectureContract;
|
|
207
|
+
/** 解析 touched-label locale;显式未知值 fail closed,缺省按 content locale 选择。Resolves touched-label locale; explicit unknown values fail closed, omission follows content locale. */
|
|
208
|
+
export declare function resolveDocumentationPortalUiLocale(requested: string | undefined, contentLocale: string): DocumentationPortalUiLocale;
|
|
209
|
+
/** 返回不可变 catalog 的浅拷贝,避免 caller 污染全局 label。Returns a shallow catalog copy so callers cannot mutate global labels. */
|
|
210
|
+
export declare function getDocumentationPortalLabels(locale: DocumentationPortalUiLocale): DocumentationPortalLabels;
|
|
211
|
+
//# sourceMappingURL=information-architecture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"information-architecture.d.ts","sourceRoot":"","sources":["../src/information-architecture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sDAAsD,kDAAkD,CAAC;AACtH,6EAA6E;AAC7E,eAAO,MAAM,8DAA8D,gBAAgB,CAAC;AAC5F,mEAAmE;AACnE,eAAO,MAAM,sCAAsC,0CAA2C,CAAC;AAC/F,qEAAqE;AACrE,eAAO,MAAM,uCAAuC,4BAA6B,CAAC;AAClF,kEAAkE;AAClE,eAAO,MAAM,sCAAsC,sCAAuC,CAAC;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AAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AA6CD;;;GAGG;AACH,wBAAgB,iDAAiD,CAC/D,OAAO,EAAE,iDAAiD,EAC1D,QAAQ,EAAE,2BAA2B,EACrC,aAAa,EAAE,MAAM,GACpB,kDAAkD,CA8CpD;AAED,2KAA2K;AAC3K,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,2BAA2B,CAQpI;AAED,qHAAqH;AACrH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,2BAA2B,GAAG,yBAAyB,CAE3G"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 中性 Portal IA contract identity;它不包含 renderer、theme 或语言 parser 私有结构。
|
|
3
|
+
* Neutral Portal IA contract identity; it contains no renderer, theme, or language-parser private structures.
|
|
4
|
+
*/
|
|
5
|
+
export const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT = "documentation-portal-information-architecture";
|
|
6
|
+
/** exact draft compatibility identity。Exact draft compatibility identity. */
|
|
7
|
+
export const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION = "0.1.0-draft";
|
|
8
|
+
/** 三维 IA 中的逻辑内容分组闭集。Closed logical content-grouping vocabulary. */
|
|
9
|
+
export const DOCUMENTATION_PORTAL_CONTENT_GROUPINGS = ["entry", "semantic-container"];
|
|
10
|
+
/** 三维 IA 中的 fragment 获取闭集。Closed fragment-acquisition vocabulary. */
|
|
11
|
+
export const DOCUMENTATION_PORTAL_LOADING_STRATEGIES = ["lazy", "eager"];
|
|
12
|
+
/** 三维 IA 中的 member 呈现闭集。Closed member-presentation vocabulary. */
|
|
13
|
+
export const DOCUMENTATION_PORTAL_MEMBER_PLACEMENTS = ["separate", "with-parent"];
|
|
14
|
+
/** manifest-only semantic path 的 target-neutral kind 闭集。Target-neutral kind vocabulary for manifest-only semantic paths. */
|
|
15
|
+
export const DOCUMENTATION_PORTAL_SEMANTIC_PATH_KINDS = [
|
|
16
|
+
"repository",
|
|
17
|
+
"package",
|
|
18
|
+
"layer",
|
|
19
|
+
"contract",
|
|
20
|
+
"operation",
|
|
21
|
+
"project",
|
|
22
|
+
"assembly",
|
|
23
|
+
"namespace",
|
|
24
|
+
"type"
|
|
25
|
+
];
|
|
26
|
+
/** kind-aware topic 的稳定 section 顺序。Stable section order for kind-aware topics. */
|
|
27
|
+
export const DOCUMENTATION_PORTAL_TOPIC_SECTIONS = [
|
|
28
|
+
"summary",
|
|
29
|
+
"declaration",
|
|
30
|
+
"metadata",
|
|
31
|
+
"contract",
|
|
32
|
+
"coverage",
|
|
33
|
+
"provenance",
|
|
34
|
+
"members",
|
|
35
|
+
"relations",
|
|
36
|
+
"source",
|
|
37
|
+
"diagnostics"
|
|
38
|
+
];
|
|
39
|
+
/** 首轮 touched-label catalog 的 locale 闭集。Locale vocabulary for the first touched-label catalog. */
|
|
40
|
+
export const DOCUMENTATION_PORTAL_UI_LOCALES = ["zh-CN", "en"];
|
|
41
|
+
/**
|
|
42
|
+
* owner-local Draft 2020-12 schema;用于验证 resolved contract,不承诺未知 draft 兼容。
|
|
43
|
+
* Owner-local Draft 2020-12 schema for resolved contracts; it does not promise compatibility with unknown drafts.
|
|
44
|
+
*/
|
|
45
|
+
export const DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_JSON_SCHEMA = {
|
|
46
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
47
|
+
$id: "https://mandolin.github.io/HIA-Documentation/contracts/documentation-portal-information-architecture-0.1.0-draft.schema.json",
|
|
48
|
+
title: "Generated Documentation Portal Information Architecture",
|
|
49
|
+
type: "object",
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
required: [
|
|
52
|
+
"contract",
|
|
53
|
+
"contractVersion",
|
|
54
|
+
"contentGrouping",
|
|
55
|
+
"loadingStrategy",
|
|
56
|
+
"memberPlacement",
|
|
57
|
+
"semanticPathPolicy",
|
|
58
|
+
"semanticPathKinds",
|
|
59
|
+
"topicSections",
|
|
60
|
+
"localeModel",
|
|
61
|
+
"routing",
|
|
62
|
+
"accessibility",
|
|
63
|
+
"privacy"
|
|
64
|
+
],
|
|
65
|
+
properties: {
|
|
66
|
+
contract: { const: DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT },
|
|
67
|
+
contractVersion: { const: DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION },
|
|
68
|
+
contentGrouping: { enum: [...DOCUMENTATION_PORTAL_CONTENT_GROUPINGS] },
|
|
69
|
+
loadingStrategy: { enum: [...DOCUMENTATION_PORTAL_LOADING_STRATEGIES] },
|
|
70
|
+
memberPlacement: { enum: [...DOCUMENTATION_PORTAL_MEMBER_PLACEMENTS] },
|
|
71
|
+
semanticPathPolicy: { const: "manifest-only" },
|
|
72
|
+
semanticPathKinds: { const: [...DOCUMENTATION_PORTAL_SEMANTIC_PATH_KINDS] },
|
|
73
|
+
topicSections: { const: [...DOCUMENTATION_PORTAL_TOPIC_SECTIONS] },
|
|
74
|
+
localeModel: {
|
|
75
|
+
type: "object",
|
|
76
|
+
additionalProperties: false,
|
|
77
|
+
required: ["uiLocale", "contentLocale", "sourceCommentLocale"],
|
|
78
|
+
properties: {
|
|
79
|
+
uiLocale: { enum: [...DOCUMENTATION_PORTAL_UI_LOCALES] },
|
|
80
|
+
contentLocale: { type: "string", minLength: 1 },
|
|
81
|
+
sourceCommentLocale: { const: "not-projected" }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
routing: {
|
|
85
|
+
type: "object",
|
|
86
|
+
additionalProperties: false,
|
|
87
|
+
required: ["canonicalEntryRouteStable", "presentationPathAdditive", "versionRouting"],
|
|
88
|
+
properties: {
|
|
89
|
+
canonicalEntryRouteStable: { const: true },
|
|
90
|
+
presentationPathAdditive: { const: true },
|
|
91
|
+
versionRouting: { const: false }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
accessibility: {
|
|
95
|
+
type: "object",
|
|
96
|
+
additionalProperties: false,
|
|
97
|
+
required: ["disclosureMode", "interactions", "fullAriaTree"],
|
|
98
|
+
properties: {
|
|
99
|
+
disclosureMode: { const: "native-details" },
|
|
100
|
+
interactions: { const: ["tab", "enter-space", "visible-focus", "active-ancestor"] },
|
|
101
|
+
fullAriaTree: { const: false }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
privacy: {
|
|
105
|
+
type: "object",
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
required: ["semanticPathSource", "continuityMode", "sourceBodyIncluded", "targetStateRead"],
|
|
108
|
+
properties: {
|
|
109
|
+
semanticPathSource: { const: "manifest-input" },
|
|
110
|
+
continuityMode: { const: "metadata-only" },
|
|
111
|
+
sourceBodyIncluded: { const: false },
|
|
112
|
+
targetStateRead: { const: false }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const PORTAL_LABEL_CATALOG = {
|
|
118
|
+
"zh-CN": {
|
|
119
|
+
contract: "契约",
|
|
120
|
+
coverage: "覆盖情况",
|
|
121
|
+
declaration: "声明",
|
|
122
|
+
diagnostics: "诊断",
|
|
123
|
+
hierarchy: "层级导航",
|
|
124
|
+
loading: "正在加载文档导航...",
|
|
125
|
+
members: "成员",
|
|
126
|
+
metadata: "元数据",
|
|
127
|
+
open: "打开",
|
|
128
|
+
provenance: "溯源",
|
|
129
|
+
relations: "项目关系",
|
|
130
|
+
requiresServer: "该站点需要通过 HTTP(S) 提供;请使用本地静态服务器打开输出目录。",
|
|
131
|
+
search: "搜索",
|
|
132
|
+
searchPlaceholder: "名称、类型、源码或选择器",
|
|
133
|
+
select: "请从左侧层级导航选择一个文档节点。",
|
|
134
|
+
source: "源码",
|
|
135
|
+
summary: "摘要",
|
|
136
|
+
unavailable: "暂不可用"
|
|
137
|
+
},
|
|
138
|
+
en: {
|
|
139
|
+
contract: "Contract",
|
|
140
|
+
coverage: "Coverage",
|
|
141
|
+
declaration: "Declaration",
|
|
142
|
+
diagnostics: "Diagnostics",
|
|
143
|
+
hierarchy: "Hierarchy",
|
|
144
|
+
loading: "Loading documentation navigation...",
|
|
145
|
+
members: "Members",
|
|
146
|
+
metadata: "Metadata",
|
|
147
|
+
open: "Open",
|
|
148
|
+
provenance: "Provenance",
|
|
149
|
+
relations: "Project relations",
|
|
150
|
+
requiresServer: "The site must be served over HTTP(S); open the output directory through a local static server.",
|
|
151
|
+
search: "Search",
|
|
152
|
+
searchPlaceholder: "Name, kind, source, selector",
|
|
153
|
+
select: "Select a documentation node from the hierarchy.",
|
|
154
|
+
source: "Source",
|
|
155
|
+
summary: "Summary",
|
|
156
|
+
unavailable: "Unavailable"
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* 把显式 IA 输入解析成可序列化 contract;未知 identity/enum 直接抛错,避免 direct API caller 绕过 config。
|
|
161
|
+
* Resolves explicit IA input into a serializable contract; unknown identities/enums throw so direct API callers cannot bypass config.
|
|
162
|
+
*/
|
|
163
|
+
export function resolveDocumentationPortalInformationArchitecture(options, uiLocale, contentLocale) {
|
|
164
|
+
// <lang zh-CN>direct API 也执行 closed-world key 检查,不能依赖 config caller。</lang>
|
|
165
|
+
// <lang en>The direct API also performs a closed-world key check instead of trusting a config caller.</lang>
|
|
166
|
+
const allowedFields = new Set(["contract", "contractVersion", "contentGrouping", "loadingStrategy", "memberPlacement"]);
|
|
167
|
+
for (const field of Object.keys(options)) {
|
|
168
|
+
if (!allowedFields.has(field)) {
|
|
169
|
+
throw createPortalIaError(field, "unsupported-field");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
assertExactValue(options.contract, DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT, "contract");
|
|
173
|
+
assertExactValue(options.contractVersion, DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION, "contractVersion");
|
|
174
|
+
const contentGrouping = resolveEnum(options.contentGrouping, DOCUMENTATION_PORTAL_CONTENT_GROUPINGS, "contentGrouping", "entry");
|
|
175
|
+
const loadingStrategy = resolveEnum(options.loadingStrategy, DOCUMENTATION_PORTAL_LOADING_STRATEGIES, "loadingStrategy", "lazy");
|
|
176
|
+
const memberPlacement = resolveEnum(options.memberPlacement, DOCUMENTATION_PORTAL_MEMBER_PLACEMENTS, "memberPlacement", "separate");
|
|
177
|
+
return {
|
|
178
|
+
contract: DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT,
|
|
179
|
+
contractVersion: DOCUMENTATION_PORTAL_INFORMATION_ARCHITECTURE_CONTRACT_VERSION,
|
|
180
|
+
contentGrouping,
|
|
181
|
+
loadingStrategy,
|
|
182
|
+
memberPlacement,
|
|
183
|
+
semanticPathPolicy: "manifest-only",
|
|
184
|
+
semanticPathKinds: [...DOCUMENTATION_PORTAL_SEMANTIC_PATH_KINDS],
|
|
185
|
+
topicSections: [...DOCUMENTATION_PORTAL_TOPIC_SECTIONS],
|
|
186
|
+
localeModel: {
|
|
187
|
+
uiLocale,
|
|
188
|
+
contentLocale,
|
|
189
|
+
sourceCommentLocale: "not-projected"
|
|
190
|
+
},
|
|
191
|
+
routing: {
|
|
192
|
+
canonicalEntryRouteStable: true,
|
|
193
|
+
presentationPathAdditive: true,
|
|
194
|
+
versionRouting: false
|
|
195
|
+
},
|
|
196
|
+
accessibility: {
|
|
197
|
+
disclosureMode: "native-details",
|
|
198
|
+
interactions: ["tab", "enter-space", "visible-focus", "active-ancestor"],
|
|
199
|
+
fullAriaTree: false
|
|
200
|
+
},
|
|
201
|
+
privacy: {
|
|
202
|
+
semanticPathSource: "manifest-input",
|
|
203
|
+
continuityMode: "metadata-only",
|
|
204
|
+
sourceBodyIncluded: false,
|
|
205
|
+
targetStateRead: false
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/** 解析 touched-label locale;显式未知值 fail closed,缺省按 content locale 选择。Resolves touched-label locale; explicit unknown values fail closed, omission follows content locale. */
|
|
210
|
+
export function resolveDocumentationPortalUiLocale(requested, contentLocale) {
|
|
211
|
+
if (requested !== undefined) {
|
|
212
|
+
if (!DOCUMENTATION_PORTAL_UI_LOCALES.includes(requested)) {
|
|
213
|
+
throw createPortalIaError("uiLocale", requested);
|
|
214
|
+
}
|
|
215
|
+
return requested;
|
|
216
|
+
}
|
|
217
|
+
return contentLocale.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
218
|
+
}
|
|
219
|
+
/** 返回不可变 catalog 的浅拷贝,避免 caller 污染全局 label。Returns a shallow catalog copy so callers cannot mutate global labels. */
|
|
220
|
+
export function getDocumentationPortalLabels(locale) {
|
|
221
|
+
return { ...PORTAL_LABEL_CATALOG[locale] };
|
|
222
|
+
}
|
|
223
|
+
/** exact optional identity 校验。Validates one optional exact identity. */
|
|
224
|
+
function assertExactValue(value, expected, field) {
|
|
225
|
+
if (value !== undefined && value !== expected) {
|
|
226
|
+
throw createPortalIaError(field, value);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/** enum 解析只接受闭集或已冻结缺省值。Enum resolution accepts only the closed set or its frozen default. */
|
|
230
|
+
function resolveEnum(value, allowed, field, fallback) {
|
|
231
|
+
if (value === undefined) {
|
|
232
|
+
return fallback;
|
|
233
|
+
}
|
|
234
|
+
if (!allowed.includes(value)) {
|
|
235
|
+
throw createPortalIaError(field, value);
|
|
236
|
+
}
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
/** 创建带固定 code 的 fail-closed runtime error。Creates a fail-closed runtime error carrying a stable code. */
|
|
240
|
+
function createPortalIaError(field, value) {
|
|
241
|
+
return new TypeError(`HIA_PORTAL_IA_UNSUPPORTED: Unsupported ${field}: ${value}.`);
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=information-architecture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"information-architecture.js","sourceRoot":"","sources":["../src/information-architecture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,sDAAsD,GAAG,+CAA+C,CAAC;AACtH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,8DAA8D,GAAG,aAAa,CAAC;AAC5F,mEAAmE;AACnE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,OAAO,EAAE,oBAAoB,CAAU,CAAC;AAC/F,qEAAqE;AACrE,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAClF,kEAAkE;AAClE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAU,CAAC;AAC3F,4HAA4H;AAC5H,MAAM,CAAC,MAAM,wCAAwC,GAAG;IACtD,YAAY;IACZ,SAAS;IACT,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,WAAW;IACX,MAAM;CACE,CAAC;AACX,kFAAkF;AAClF,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,SAAS;IACT,aAAa;IACb,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;IACR,aAAa;CACL,CAAC;AACX,kGAAkG;AAClG,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,OAAO,EAAE,IAAI,CAAU,CAAC;AA6DxE;;;GAGG;AACH,MAAM,CAAC,MAAM,yDAAyD,GAAG;IACvE,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,8HAA8H;IACnI,KAAK,EAAE,yDAAyD;IAChE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE;QACR,UAAU;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,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,SAAwC,CAAC;IAClD,CAAC;IACD,OAAO,aAAa,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACvE,CAAC;AAED,qHAAqH;AACrH,MAAM,UAAU,4BAA4B,CAAC,MAAmC;IAC9E,OAAO,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7C,CAAC;AAED,wEAAwE;AACxE,SAAS,gBAAgB,CAAC,KAAyB,EAAE,QAAgB,EAAE,KAAa;IAClF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,6FAA6F;AAC7F,SAAS,WAAW,CAClB,KAAyB,EACzB,OAAqB,EACrB,KAAa,EACb,QAAW;IAEX,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAU,CAAC,EAAE,CAAC;QAClC,MAAM,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,KAAU,CAAC;AACpB,CAAC;AAED,yGAAyG;AACzG,SAAS,mBAAmB,CAAC,KAAa,EAAE,KAAa;IACvD,OAAO,IAAI,SAAS,CAAC,0CAA0C,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type DocumentationUiLocaleCompletenessReport, type DocumentationUiLocaleCompletenessSummary } from "@hia-doc/core";
|
|
2
|
+
import type { DocumentationPortalUiLocale } from "./information-architecture.js";
|
|
3
|
+
/**
|
|
4
|
+
* @lang zh-CN
|
|
5
|
+
* Portal owner 输出的 W-P123 metadata-only 报告路径。
|
|
6
|
+
*
|
|
7
|
+
* @lang en
|
|
8
|
+
* Path of the W-P123 metadata-only report emitted by the Portal owner.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DOCUMENTATION_PORTAL_UI_LOCALE_REPORT_PATH: "documentation-ui-locale-completeness.json";
|
|
11
|
+
/** @lang zh-CN 默认 Portal profile identity。 @lang en Default Portal profile identity. */
|
|
12
|
+
export declare const DOCUMENTATION_PORTAL_UI_LOCALE_PROFILE_ID: "portal.default";
|
|
13
|
+
/** @lang zh-CN 默认 split-site surface identity。 @lang en Default split-site surface identity. */
|
|
14
|
+
export declare const DOCUMENTATION_PORTAL_UI_LOCALE_SURFACE_ID: "portal.split-site";
|
|
15
|
+
/** @lang zh-CN Portal P1 支持的 UI locale 闭集。 @lang en Closed UI-locale set supported by Portal P1. */
|
|
16
|
+
export declare const DOCUMENTATION_PORTAL_UI_CATALOG_LOCALES: readonly ["zh-CN", "en"];
|
|
17
|
+
/** @lang zh-CN 按 registry 顺序冻结的稳定 message id 清单。 @lang en Stable message-id list frozen in registry order. */
|
|
18
|
+
export declare const DOCUMENTATION_PORTAL_UI_MESSAGE_IDS: readonly string[];
|
|
19
|
+
/** @lang zh-CN Portal locale adoption 的 caller 配置。 @lang en Caller configuration for Portal locale adoption. */
|
|
20
|
+
export interface DocumentationPortalUiLocaleAdoptionOptions {
|
|
21
|
+
contentLocale: string;
|
|
22
|
+
contentLocales: string[];
|
|
23
|
+
defaultUiLocale: DocumentationPortalUiLocale;
|
|
24
|
+
profileId?: string;
|
|
25
|
+
surfaceId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** @lang zh-CN Portal owner 生成的已通过 gate 的 report、summary 与 runtime bundle。 @lang en Gate-complete report, summary, and runtime bundles produced by the Portal owner. */
|
|
28
|
+
export interface DocumentationPortalUiLocaleAdoption {
|
|
29
|
+
bundles: Readonly<Record<DocumentationPortalUiLocale, Readonly<Record<string, string>>>>;
|
|
30
|
+
report: DocumentationUiLocaleCompletenessReport;
|
|
31
|
+
reportJson: string;
|
|
32
|
+
summary: DocumentationUiLocaleCompletenessSummary;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @lang zh-CN
|
|
36
|
+
* 构造并执行 W-P123 owner gate;任何 malformed 或 incomplete catalog 都在 renderer 生成文件前拒绝。
|
|
37
|
+
*
|
|
38
|
+
* @lang en
|
|
39
|
+
* Builds and executes the W-P123 owner gate; any malformed or incomplete catalog is rejected before the renderer emits files.
|
|
40
|
+
*
|
|
41
|
+
* @param options <lang><zh-CN>caller-explicit locale 与 owner-neutral profile/surface identity。</lang><en>Caller-explicit locales and owner-neutral profile/surface identities.</en></lang>
|
|
42
|
+
* @returns <lang><zh-CN>不含私有数据的 report 与仅供页面 runtime 使用的 public bundle。</lang><en>A privacy-safe report and public bundles used only by the page runtime.</en></lang>
|
|
43
|
+
* @throws <lang><zh-CN>当 W-P123 evaluator 未返回 complete report 时抛出。</lang><en>Thrown when the W-P123 evaluator does not return a complete report.</en></lang>
|
|
44
|
+
*/
|
|
45
|
+
export declare function createDocumentationPortalUiLocaleAdoption(options: DocumentationPortalUiLocaleAdoptionOptions): DocumentationPortalUiLocaleAdoption;
|
|
46
|
+
/**
|
|
47
|
+
* @lang zh-CN
|
|
48
|
+
* 从已验证 Portal bundle 解析一条纯文本消息并替换非执行占位符。
|
|
49
|
+
*
|
|
50
|
+
* @lang en
|
|
51
|
+
* Resolves one plain-text message from a validated Portal bundle and substitutes non-executable placeholders.
|
|
52
|
+
*
|
|
53
|
+
* @param adoption <lang><zh-CN>当前 renderer 调用的已通过 gate 的 adoption。</lang><en>Gate-complete adoption for the current render call.</en></lang>
|
|
54
|
+
* @param locale <lang><zh-CN>显式 UI locale。</lang><en>Explicit UI locale.</en></lang>
|
|
55
|
+
* @param messageId <lang><zh-CN>稳定 dotted message identity。</lang><en>Stable dotted message identity.</en></lang>
|
|
56
|
+
* @param values <lang><zh-CN>按名称替换的纯文本值。</lang><en>Plain-text values substituted by name.</en></lang>
|
|
57
|
+
* @returns <lang><zh-CN>已解析但尚未 HTML 转义的纯文本。</lang><en>Resolved plain text that has not yet been HTML-escaped.</en></lang>
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveDocumentationPortalUiMessage(adoption: DocumentationPortalUiLocaleAdoption, locale: DocumentationPortalUiLocale, messageId: string, values?: Readonly<Record<string, string | number>>): string;
|
|
60
|
+
//# sourceMappingURL=portal-ui-locale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-ui-locale.d.ts","sourceRoot":"","sources":["../src/portal-ui-locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uCAAuC,EAC5C,KAAK,wCAAwC,EAG9C,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF;;;;;;GAMG;AACH,eAAO,MAAM,0CAA0C,EACrD,2CAAoD,CAAC;AAEvD,wFAAwF;AACxF,eAAO,MAAM,yCAAyC,EAAG,gBAAyB,CAAC;AAEnF,gGAAgG;AAChG,eAAO,MAAM,yCAAyC,EAAG,mBAA4B,CAAC;AAEtF,oGAAoG;AACpG,eAAO,MAAM,uCAAuC,0BAA2B,CAAC;AAyKhF,8GAA8G;AAC9G,eAAO,MAAM,mCAAmC,mBAE/C,CAAC;AAEF,gHAAgH;AAChH,MAAM,WAAW,0CAA0C;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,2BAA2B,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wKAAwK;AACxK,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,2BAA2B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,M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