@vcp-dev/contracts 0.10.12 → 0.10.15
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/dist/colorway-distinctness.js +1 -1
- package/dist/design-token-block.d.ts +9 -0
- package/dist/design-token-block.js +2 -2
- package/dist/design-tokens.d.ts +8 -0
- package/dist/design-tokens.js +1 -1
- package/dist/index.d.ts +211 -0
- package/dist/index.js +6 -6
- package/dist/launcher-prompt-templates.d.ts +10 -0
- package/dist/site-design-notes.d.ts +14 -0
- package/dist/site-edit-operation.d.ts +1 -1
- package/dist/site-edit-render-document.d.ts +1 -1
- package/dist/site-edit-source.d.ts +3 -3
- package/dist/site-edit-version.d.ts +1 -1
- package/dist/step6-design.d.ts +61 -2
- package/dist/step6-gpt-design.d.ts +15 -0
- package/dist/type-weight.d.ts +29 -0
- package/dist/workspace-design-apply.d.ts +15 -0
- package/package.json +1 -1
|
@@ -248,6 +248,11 @@ export declare const LauncherPromptTemplateApplyRequestSchema: z.ZodObject<{
|
|
|
248
248
|
themeId: z.ZodOptional<z.ZodString>;
|
|
249
249
|
themeDescription: z.ZodOptional<z.ZodString>;
|
|
250
250
|
aestheticNote: z.ZodOptional<z.ZodString>;
|
|
251
|
+
weightStyle: z.ZodOptional<z.ZodEnum<{
|
|
252
|
+
bold: "bold";
|
|
253
|
+
light: "light";
|
|
254
|
+
standard: "standard";
|
|
255
|
+
}>>;
|
|
251
256
|
}, z.core.$strip>>;
|
|
252
257
|
}, z.core.$strip>>;
|
|
253
258
|
userChoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -435,6 +440,11 @@ export declare const LauncherPromptTemplateApplyResponseSchema: z.ZodObject<{
|
|
|
435
440
|
themeId: z.ZodOptional<z.ZodString>;
|
|
436
441
|
themeDescription: z.ZodOptional<z.ZodString>;
|
|
437
442
|
aestheticNote: z.ZodOptional<z.ZodString>;
|
|
443
|
+
weightStyle: z.ZodOptional<z.ZodEnum<{
|
|
444
|
+
bold: "bold";
|
|
445
|
+
light: "light";
|
|
446
|
+
standard: "standard";
|
|
447
|
+
}>>;
|
|
438
448
|
}, z.core.$strip>>;
|
|
439
449
|
}, z.core.$strip>>;
|
|
440
450
|
userChoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -23,9 +23,23 @@ export declare const PaletteInputsSchema: z.ZodObject<{
|
|
|
23
23
|
}, z.core.$strip>>;
|
|
24
24
|
}, z.core.$strip>;
|
|
25
25
|
export type PaletteInputs = z.infer<typeof PaletteInputsSchema>;
|
|
26
|
+
/**
|
|
27
|
+
* `type-inputs` 行的结构化载荷:Step 6 字重档位选择的记录。独立于
|
|
28
|
+
* `palette-inputs`,坏了只丢这一行(方案「对齐决定」#2)。
|
|
29
|
+
*/
|
|
30
|
+
export declare const TypeInputsSchema: z.ZodObject<{
|
|
31
|
+
weightStyle: z.ZodEnum<{
|
|
32
|
+
bold: "bold";
|
|
33
|
+
light: "light";
|
|
34
|
+
standard: "standard";
|
|
35
|
+
}>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type TypeInputs = z.infer<typeof TypeInputsSchema>;
|
|
26
38
|
export type SiteDesignNotes = {
|
|
27
39
|
lines: string[];
|
|
28
40
|
paletteInputs: PaletteInputs | null;
|
|
41
|
+
/** Optional: `undefined` for callers building notes without a weight style choice. */
|
|
42
|
+
typeInputs?: TypeInputs;
|
|
29
43
|
};
|
|
30
44
|
export declare function formatSiteDesignNotes(notes: SiteDesignNotes): string;
|
|
31
45
|
/**
|
|
@@ -71,13 +71,13 @@ export type SiteEditOperationResultTarget = z.infer<typeof SiteEditOperationResu
|
|
|
71
71
|
export declare const SiteEditStylePropertySchema: z.ZodEnum<{
|
|
72
72
|
color: "color";
|
|
73
73
|
transform: "transform";
|
|
74
|
+
display: "display";
|
|
74
75
|
cursor: "cursor";
|
|
75
76
|
position: "position";
|
|
76
77
|
columns: "columns";
|
|
77
78
|
width: "width";
|
|
78
79
|
height: "height";
|
|
79
80
|
order: "order";
|
|
80
|
-
display: "display";
|
|
81
81
|
top: "top";
|
|
82
82
|
right: "right";
|
|
83
83
|
bottom: "bottom";
|
|
@@ -462,13 +462,13 @@ export declare const SiteEditStyleModelSchema: z.ZodUnion<readonly [z.ZodRecord<
|
|
|
462
462
|
property: z.ZodEnum<{
|
|
463
463
|
color: "color";
|
|
464
464
|
transform: "transform";
|
|
465
|
+
display: "display";
|
|
465
466
|
cursor: "cursor";
|
|
466
467
|
position: "position";
|
|
467
468
|
columns: "columns";
|
|
468
469
|
width: "width";
|
|
469
470
|
height: "height";
|
|
470
471
|
order: "order";
|
|
471
|
-
display: "display";
|
|
472
472
|
top: "top";
|
|
473
473
|
right: "right";
|
|
474
474
|
bottom: "bottom";
|
|
@@ -216,9 +216,9 @@ export declare function isSiteEditSourcePath(path: string): boolean;
|
|
|
216
216
|
export declare function isSiteEditTextSourcePath(path: string): boolean;
|
|
217
217
|
export declare function isSiteEditSourceDirectoryPath(path: string): boolean;
|
|
218
218
|
/**
|
|
219
|
-
* 站点设计说明文档(根级 `design.md` / `DESIGN.md
|
|
220
|
-
*
|
|
221
|
-
*
|
|
219
|
+
* 站点设计说明文档(根级 `design.md` / `DESIGN.md`)。这是旧快照里的遗留文件:
|
|
220
|
+
* 全站设计改为以 `app/globals.css` 为单一来源后,新站不再生成或维护它;仍需要
|
|
221
|
+
* 在存量快照里保护它不被删、也不在工作台代码 tab 的源码树里暴露。
|
|
222
222
|
*/
|
|
223
223
|
export declare function isSiteEditDesignDocumentPath(path: string): boolean;
|
|
224
224
|
export declare function getSiteEditSourceDeleteProtectionReason(path: string): SiteEditSourceDeleteProtectionReason | null;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* 由 release-edit-engine-packages.ts 在 bump 版本时自动更新。
|
|
7
7
|
*/
|
|
8
|
-
export declare const CURRENT_EDIT_ENGINE_VERSION = "0.10.
|
|
8
|
+
export declare const CURRENT_EDIT_ENGINE_VERSION = "0.10.15";
|
|
9
9
|
export declare const EDIT_ENGINE_VERSION_HEADER = "x-vcp-edit-engine-version";
|
|
10
10
|
export declare const EDIT_ENGINE_VERSION_SOURCE_HEADER = "x-vcp-edit-engine-version-source";
|
|
11
11
|
export type EditEngineVersionSource = "explicit" | "fallback_current" | "system_current";
|
package/dist/step6-design.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type SiteDesignRadiusId } from "./site-design-presets.js";
|
|
3
|
+
import { type WeightStyleId } from "./type-weight.js";
|
|
3
4
|
/**
|
|
4
5
|
* 审美说明上限 300 字。用户自由文本,服务端一律原样透传:不做替换、不截断
|
|
5
6
|
* 关键词、不做正则规整 —— 这类处理在本仓有过把正文改坏的实际教训。
|
|
@@ -65,6 +66,11 @@ export declare const Step6AiThemeCandidateSchema: z.ZodObject<{
|
|
|
65
66
|
comfortable: "comfortable";
|
|
66
67
|
airy: "airy";
|
|
67
68
|
}>;
|
|
69
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
bold: "bold";
|
|
71
|
+
light: "light";
|
|
72
|
+
standard: "standard";
|
|
73
|
+
}>>;
|
|
68
74
|
reason: z.ZodString;
|
|
69
75
|
}, z.core.$strict>;
|
|
70
76
|
export type Step6AiThemeCandidate = z.infer<typeof Step6AiThemeCandidateSchema>;
|
|
@@ -111,6 +117,11 @@ export declare const Step6GeneratedThemeCardSchema: z.ZodObject<{
|
|
|
111
117
|
comfortable: "comfortable";
|
|
112
118
|
airy: "airy";
|
|
113
119
|
}>;
|
|
120
|
+
weight_style: z.ZodEnum<{
|
|
121
|
+
bold: "bold";
|
|
122
|
+
light: "light";
|
|
123
|
+
standard: "standard";
|
|
124
|
+
}>;
|
|
114
125
|
}, z.core.$strict>;
|
|
115
126
|
export type Step6GeneratedThemeCard = z.infer<typeof Step6GeneratedThemeCardSchema>;
|
|
116
127
|
export declare const Step6DesignSelectionSchema: z.ZodObject<{
|
|
@@ -162,6 +173,11 @@ export declare const Step6DesignSelectionSchema: z.ZodObject<{
|
|
|
162
173
|
lg: "lg";
|
|
163
174
|
xl: "xl";
|
|
164
175
|
}>>;
|
|
176
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
bold: "bold";
|
|
178
|
+
light: "light";
|
|
179
|
+
standard: "standard";
|
|
180
|
+
}>>;
|
|
165
181
|
aesthetic_note: z.ZodOptional<z.ZodString>;
|
|
166
182
|
updated_at: z.ZodString;
|
|
167
183
|
}, z.core.$strict>;
|
|
@@ -350,6 +366,11 @@ export declare const Step6DesignRecommendationSchema: z.ZodObject<{
|
|
|
350
366
|
comfortable: "comfortable";
|
|
351
367
|
airy: "airy";
|
|
352
368
|
}>;
|
|
369
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
370
|
+
bold: "bold";
|
|
371
|
+
light: "light";
|
|
372
|
+
standard: "standard";
|
|
373
|
+
}>>;
|
|
353
374
|
reason: z.ZodString;
|
|
354
375
|
}, z.core.$strict>>;
|
|
355
376
|
}, z.core.$strict>;
|
|
@@ -587,6 +608,11 @@ export declare const Step6DesignRecommendationsResponseSchema: z.ZodObject<{
|
|
|
587
608
|
comfortable: "comfortable";
|
|
588
609
|
airy: "airy";
|
|
589
610
|
}>;
|
|
611
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
612
|
+
bold: "bold";
|
|
613
|
+
light: "light";
|
|
614
|
+
standard: "standard";
|
|
615
|
+
}>>;
|
|
590
616
|
reason: z.ZodString;
|
|
591
617
|
}, z.core.$strict>>;
|
|
592
618
|
}, z.core.$strict>;
|
|
@@ -680,6 +706,11 @@ export declare const Step6DesignRecommendationsResponseSchema: z.ZodObject<{
|
|
|
680
706
|
lg: "lg";
|
|
681
707
|
xl: "xl";
|
|
682
708
|
}>>;
|
|
709
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
710
|
+
bold: "bold";
|
|
711
|
+
light: "light";
|
|
712
|
+
standard: "standard";
|
|
713
|
+
}>>;
|
|
683
714
|
aesthetic_note: z.ZodOptional<z.ZodString>;
|
|
684
715
|
updated_at: z.ZodString;
|
|
685
716
|
}, z.core.$strict>;
|
|
@@ -734,6 +765,11 @@ export declare const UpdateStep6DesignSelectionRequestSchema: z.ZodObject<{
|
|
|
734
765
|
lg: "lg";
|
|
735
766
|
xl: "xl";
|
|
736
767
|
}>>;
|
|
768
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
769
|
+
bold: "bold";
|
|
770
|
+
light: "light";
|
|
771
|
+
standard: "standard";
|
|
772
|
+
}>>;
|
|
737
773
|
aesthetic_note: z.ZodOptional<z.ZodString>;
|
|
738
774
|
}, z.core.$strict>;
|
|
739
775
|
export type UpdateStep6DesignSelectionRequest = z.infer<typeof UpdateStep6DesignSelectionRequestSchema>;
|
|
@@ -787,6 +823,11 @@ export declare const UpdateStep6DesignSelectionResponseSchema: z.ZodObject<{
|
|
|
787
823
|
lg: "lg";
|
|
788
824
|
xl: "xl";
|
|
789
825
|
}>>;
|
|
826
|
+
weight_style: z.ZodOptional<z.ZodEnum<{
|
|
827
|
+
bold: "bold";
|
|
828
|
+
light: "light";
|
|
829
|
+
standard: "standard";
|
|
830
|
+
}>>;
|
|
790
831
|
aesthetic_note: z.ZodOptional<z.ZodString>;
|
|
791
832
|
updated_at: z.ZodString;
|
|
792
833
|
}, z.core.$strict>;
|
|
@@ -944,6 +985,11 @@ export declare const Step6DesignRecommendationModelOutputSchema: z.ZodObject<{
|
|
|
944
985
|
comfortable: "comfortable";
|
|
945
986
|
airy: "airy";
|
|
946
987
|
}>;
|
|
988
|
+
weight_style: z.ZodEnum<{
|
|
989
|
+
bold: "bold";
|
|
990
|
+
light: "light";
|
|
991
|
+
standard: "standard";
|
|
992
|
+
}>;
|
|
947
993
|
}, z.core.$strict>>;
|
|
948
994
|
conversion: z.ZodOptional<z.ZodObject<{
|
|
949
995
|
protocol: z.ZodEnum<{
|
|
@@ -970,8 +1016,20 @@ export declare function buildStep6FallbackThemeCards(): Step6GeneratedThemeCard[
|
|
|
970
1016
|
* 主题也认不出时才落到物化端同款默认,保证老站行为不变。
|
|
971
1017
|
*/
|
|
972
1018
|
export declare function resolveStep6RadiusId(selection: Step6DesignSelection): SiteDesignRadiusId;
|
|
973
|
-
/**
|
|
974
|
-
|
|
1019
|
+
/**
|
|
1020
|
+
* 用户选择的字重档位。存量选择没有该字段时,先按本轮推荐里与已选主题同 id
|
|
1021
|
+
* 的卡回退,那张卡也找不到(如存量 `ai-*` 选择对不上本轮 `gen-*` 推荐)就
|
|
1022
|
+
* 退到卡 #1,推荐本身读不到时才落到平台默认档 `"standard"`。
|
|
1023
|
+
*/
|
|
1024
|
+
export declare function resolveStep6WeightStyle(selection: Step6DesignSelection, recommendation?: Step6DesignRecommendation): WeightStyleId;
|
|
1025
|
+
/**
|
|
1026
|
+
* Deterministic handoff from persisted selection to Sitemap/DesignPlan.
|
|
1027
|
+
*
|
|
1028
|
+
* `recommendation` is optional and only used to resolve `weightStyle` when
|
|
1029
|
+
* the selection itself doesn't carry one (see `resolveStep6WeightStyle`);
|
|
1030
|
+
* omitting it just falls straight through to the platform default `"standard"`.
|
|
1031
|
+
*/
|
|
1032
|
+
export declare function toStep6GenerationVisualHints(selection: Step6DesignSelection, recommendation?: Step6DesignRecommendation): {
|
|
975
1033
|
readonly colorSeeds: {
|
|
976
1034
|
primary: string;
|
|
977
1035
|
accent: string;
|
|
@@ -986,5 +1044,6 @@ export declare function toStep6GenerationVisualHints(selection: Step6DesignSelec
|
|
|
986
1044
|
readonly motionLevel: "subtle" | "moderate" | "expressive";
|
|
987
1045
|
readonly motionPreset: "subtle" | "moderate" | "expressive";
|
|
988
1046
|
readonly radius: "none" | "sm" | "md" | "lg" | "xl";
|
|
1047
|
+
readonly weightStyle: "bold" | "light" | "standard";
|
|
989
1048
|
};
|
|
990
1049
|
export declare function defaultStep6Selection(recommendation: Step6DesignRecommendation, now: Date): Step6DesignSelection;
|
|
@@ -42,6 +42,11 @@ export declare const Step6GptDesignRecommendationModelOutputSchema: z.ZodObject<
|
|
|
42
42
|
comfortable: "comfortable";
|
|
43
43
|
airy: "airy";
|
|
44
44
|
}>;
|
|
45
|
+
weight_style: z.ZodEnum<{
|
|
46
|
+
bold: "bold";
|
|
47
|
+
light: "light";
|
|
48
|
+
standard: "standard";
|
|
49
|
+
}>;
|
|
45
50
|
}, z.core.$strict>>;
|
|
46
51
|
conversion: z.ZodOptional<z.ZodObject<{
|
|
47
52
|
protocol: z.ZodEnum<{
|
|
@@ -100,6 +105,11 @@ export declare const Step6DesignAgentRecommendationsResponseSchema: z.ZodUnion<r
|
|
|
100
105
|
comfortable: "comfortable";
|
|
101
106
|
airy: "airy";
|
|
102
107
|
}>;
|
|
108
|
+
weight_style: z.ZodEnum<{
|
|
109
|
+
bold: "bold";
|
|
110
|
+
light: "light";
|
|
111
|
+
standard: "standard";
|
|
112
|
+
}>;
|
|
103
113
|
}, z.core.$strict>>;
|
|
104
114
|
conversion: z.ZodOptional<z.ZodObject<{
|
|
105
115
|
protocol: z.ZodEnum<{
|
|
@@ -152,6 +162,11 @@ export declare const Step6DesignAgentRecommendationsResponseSchema: z.ZodUnion<r
|
|
|
152
162
|
comfortable: "comfortable";
|
|
153
163
|
airy: "airy";
|
|
154
164
|
}>;
|
|
165
|
+
weight_style: z.ZodEnum<{
|
|
166
|
+
bold: "bold";
|
|
167
|
+
light: "light";
|
|
168
|
+
standard: "standard";
|
|
169
|
+
}>;
|
|
155
170
|
}, z.core.$strict>>;
|
|
156
171
|
conversion: z.ZodOptional<z.ZodObject<{
|
|
157
172
|
protocol: z.ZodEnum<{
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WEIGHT_STYLE_IDS: readonly ["light", "standard", "bold"];
|
|
3
|
+
export type WeightStyleId = (typeof WEIGHT_STYLE_IDS)[number];
|
|
4
|
+
export declare const WeightStyleIdSchema: z.ZodEnum<{
|
|
5
|
+
bold: "bold";
|
|
6
|
+
light: "light";
|
|
7
|
+
standard: "standard";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const DEFAULT_WEIGHT_STYLE_ID: WeightStyleId;
|
|
10
|
+
export type WeightRole = "display" | "heading" | "title" | "ui" | "button" | "body" | "strong";
|
|
11
|
+
/** 三档预设表:以后加档只改这张表(方案「已确认的决定」)。 */
|
|
12
|
+
export declare const WEIGHT_STYLE_PRESETS: Readonly<Record<WeightStyleId, Readonly<Record<WeightRole, number>>>>;
|
|
13
|
+
export declare const SITE_WEIGHT_TOKEN_NAMES: string[];
|
|
14
|
+
export declare const SITE_LEADING_BODY_TOKEN = "--site-leading-body";
|
|
15
|
+
/**
|
|
16
|
+
* `resolveFontDisplayName` silently falls back to `"Inter"` for a name it
|
|
17
|
+
* doesn't recognize, so calling it first would make an unknown font
|
|
18
|
+
* indistinguishable from a real "Inter" request. Check the original name
|
|
19
|
+
* first, then its normalized form (trimmed, underscore-joined,
|
|
20
|
+
* lower-cased — matching either a display name or an `import` name); only
|
|
21
|
+
* once one of those two matches do we resolve and look up the range.
|
|
22
|
+
*/
|
|
23
|
+
export declare function availableFontWeights(family: string): readonly number[] | null;
|
|
24
|
+
export declare function siteWeightVariables(style: WeightStyleId | undefined, fonts?: {
|
|
25
|
+
heading?: string;
|
|
26
|
+
body?: string;
|
|
27
|
+
}): Record<`--site-weight-${WeightRole}`, string>;
|
|
28
|
+
export declare function siteLeadingBody(locale: string | undefined): string;
|
|
29
|
+
export declare function resolveTryOnFontWeights(family: string, wanted: readonly number[]): string[];
|
|
@@ -14,6 +14,11 @@ export declare const WorkspaceDesignApplyRequestSchema: z.ZodObject<{
|
|
|
14
14
|
heading: z.ZodString;
|
|
15
15
|
body: z.ZodString;
|
|
16
16
|
}, z.core.$strict>>;
|
|
17
|
+
weightStyle: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
bold: "bold";
|
|
19
|
+
light: "light";
|
|
20
|
+
standard: "standard";
|
|
21
|
+
}>>;
|
|
17
22
|
}, z.core.$strict>;
|
|
18
23
|
export type WorkspaceDesignApplyRequest = z.infer<typeof WorkspaceDesignApplyRequestSchema>;
|
|
19
24
|
export declare const WorkspaceDesignApplyResponseSchema: z.ZodObject<{
|
|
@@ -74,6 +79,11 @@ export declare const WorkspaceDesignApplyResponseSchema: z.ZodObject<{
|
|
|
74
79
|
muted: z.ZodOptional<z.ZodString>;
|
|
75
80
|
border: z.ZodOptional<z.ZodString>;
|
|
76
81
|
}, z.core.$strip>>;
|
|
82
|
+
weightStyle: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
bold: "bold";
|
|
84
|
+
light: "light";
|
|
85
|
+
standard: "standard";
|
|
86
|
+
}>>;
|
|
77
87
|
}, z.core.$strip>>>;
|
|
78
88
|
changed_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
89
|
}, z.core.$strip>;
|
|
@@ -118,6 +128,11 @@ export declare const WorkspaceDesignCurrentResponseSchema: z.ZodObject<{
|
|
|
118
128
|
}, z.core.$strip>>;
|
|
119
129
|
}, z.core.$strip>>;
|
|
120
130
|
notes: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
131
|
+
weight_style: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
132
|
+
bold: "bold";
|
|
133
|
+
light: "light";
|
|
134
|
+
standard: "standard";
|
|
135
|
+
}>>>;
|
|
121
136
|
source: z.ZodEnum<{
|
|
122
137
|
globals_css: "globals_css";
|
|
123
138
|
design_plan_archive: "design_plan_archive";
|