@vcp-dev/contracts 0.10.20 → 0.10.21

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.
@@ -1,12 +1,19 @@
1
1
  import { z } from "zod";
2
2
  export declare const SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES: readonly ["design.md", "DESIGN.md"];
3
3
  export declare const SITE_EDIT_SOURCE_ALLOWED_DIRS: readonly ["components/site", "src/components/site", "lib/generated", "src/lib/generated", "public"];
4
+ /**
5
+ * 目录白名单之外、按**全等**放行的模板层文件:路径在模板里,内容却归每个站。
6
+ *
7
+ * 404 正文由 `app/not-found.tsx` 与设计器入口 `app/system/not-found/page.tsx` 共用,
8
+ * 文案是普通文字,设计器改完要能写回;不放开整个 `components/system/`。
9
+ */
10
+ export declare const SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES: readonly ["components/system/not-found-content.tsx", "src/components/system/not-found-content.tsx"];
4
11
  export declare const SITE_EDIT_SOURCE_ALLOWED_APP_FILES: readonly ["app/globals.css", "src/app/globals.css"];
5
12
  export declare const SITE_EDIT_TEXT_SOURCE_EXTENSIONS: readonly [".cjs", ".css", ".cts", ".html", ".js", ".json", ".jsx", ".md", ".mdx", ".mjs", ".mts", ".ts", ".tsx", ".txt", ".yaml", ".yml"];
6
13
  export declare const SITE_EDIT_SOURCE_DELETE_CAPABILITY: "source-delete";
7
14
  export declare const SiteEditSourceDeleteCapabilitySchema: z.ZodLiteral<"source-delete">;
8
15
  export type SiteEditSourceDeleteCapability = z.infer<typeof SiteEditSourceDeleteCapabilitySchema>;
9
- export type SiteEditSourceDeleteProtectionReason = "design-document" | "route-entry" | "app-global-style" | "generated-media-manifest";
16
+ export type SiteEditSourceDeleteProtectionReason = "design-document" | "route-entry" | "app-global-style" | "generated-media-manifest" | "system-page";
10
17
  export declare const SiteEditSourcePathSchema: z.ZodString;
11
18
  export type SiteEditSourcePath = z.infer<typeof SiteEditSourcePathSchema>;
12
19
  export declare const SiteEditSourceDirectoryPathSchema: z.ZodString;
@@ -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.20";
8
+ export declare const CURRENT_EDIT_ENGINE_VERSION = "0.10.21";
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";
@@ -17,7 +17,7 @@ import { z } from "zod";
17
17
  * 落空、整页 SEO 元数据全部丢失且不报错。
18
18
  * - **根布局 `metadata`**(平台确定性产出的站级元数据):站名、标题模板、
19
19
  * OpenGraph / Twitter 的标题与描述是文案;`metadataBase`、`openGraph.type`、
20
- * `twitter.card`、各类图片地址是机器值。
20
+ * `twitter.card`、各类图片地址、`robots` 索引指令是机器值。
21
21
  * - **`NAV_ITEMS`**(导航静态兜底数据):`label` 是导航上印着的字;`href` 是路由、
22
22
  * `targetType` 是渲染分支的判别式、`iconKey` 是图标注册表的键。
23
23
  *
@@ -36,8 +36,9 @@ import { z } from "zod";
36
36
  *
37
37
  * - `*`:数组下标(查表前把具体下标归一成这一段)。
38
38
  * - `**`:**本段及其整棵子树**。只用在取值形状开放、无法逐字段枚举的地方
39
- * (`schema_json` 是任意 JSON-LD,`meta_tags_json` 是键由 CMS 决定的开放记录)。
40
- * 这两处按机器值整体处理是**故意往漏翻倒**:真有一天生成侧往里写文案,结果是
39
+ * (`schema_json` 是任意 JSON-LD,`meta_tags_json` 是键由 CMS 决定的开放记录,
40
+ * 根布局 `robots` 是上游 Next 的指令对象,形状随 Next 版本开放)。
41
+ * 这几处按机器值整体处理是**故意往漏翻倒**:真有一天生成侧往里写文案,结果是
41
42
  * 那段不被翻译(可见、可查),而不是把结构化数据译坏(静默、难查)。
42
43
  */
43
44
  /** 已登记的混合结构。取值与抽取器的单元 `kind` 同名,便于对读。 */
@@ -77,9 +78,17 @@ export declare const PageSeoDeclSchema: z.ZodObject<{
77
78
  * `keywords`、`openGraph.url` / `locale`——它们今天只出现在运行时返回值里,但形状
78
79
  * 同源,一并登记免得哪天被内联进源码时整份文件停翻。
79
80
  *
80
- * 这里**没有**声明 `robots` / `icons` / `verification` 等其余 Next 元数据键:真出现
81
- * 了就是「已登记结构长出了没登记的字段」,按设计整文件本轮不翻并记降级,由人来
82
- * 决定新键是文案还是机器值。这是清单相对上游开放类型必然会漂的那一面,方向安全。
81
+ * `robots` 是平台自己写进系统页的:`app/system/not-found/page.tsx`(模板)与
82
+ * `app/search/page.tsx`(产品搜索)都用 `export const metadata` 声明
83
+ * `robots: { index: false, follow: false }`——这两条路由返回 200,不挡就会被收录。
84
+ * 它是给爬虫的指令,取值要么是布尔开关,要么是 `googleBot` 这类指令串
85
+ * (`"max-snippet:-1"`),没有一处是访客读的字,因此整棵子树按机器值登记。
86
+ * 没登记之前,这两份文件在翻译链路上整文件不译(搜索页标题停在主站语种),在可见
87
+ * 文本导出里直接让整站导出失败。
88
+ *
89
+ * 这里**没有**声明 `icons` / `verification` 等其余 Next 元数据键:真出现了就是
90
+ * 「已登记结构长出了没登记的字段」,按设计整文件本轮不翻并记降级,由人来决定新键
91
+ * 是文案还是机器值。这是清单相对上游开放类型必然会漂的那一面,方向安全。
83
92
  */
84
93
  export declare const RootLayoutMetadataSchema: z.ZodObject<{
85
94
  metadataBase: z.ZodOptional<z.ZodString>;
@@ -111,6 +120,7 @@ export declare const RootLayoutMetadataSchema: z.ZodObject<{
111
120
  alternates: z.ZodOptional<z.ZodObject<{
112
121
  canonical: z.ZodOptional<z.ZodString>;
113
122
  }, z.core.$strip>>;
123
+ robots: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
114
124
  }, z.core.$strip>;
115
125
  /**
116
126
  * `NAV_ITEMS` 的一条,与 `@vcp/sitemap` 的 `NavItem` 对齐(分组条目是同一批字段的
@@ -172,7 +182,7 @@ export declare const PAGE_SEO_MACHINE_FIELD_PATHS: readonly ["path", "meta_tags_
172
182
  /** 根布局 `metadata` 里该翻的字段路径。 */
173
183
  export declare const ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS: readonly ["title", "title.default", "title.template", "title.absolute", "description", "keywords", "openGraph.title", "openGraph.description", "openGraph.siteName", "openGraph.images.*.alt", "twitter.title", "twitter.description"];
174
184
  /** 根布局 `metadata` 里必须逐字节留下的字段路径。 */
175
- export declare const ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS: readonly ["metadataBase", "openGraph.type", "openGraph.url", "openGraph.locale", "openGraph.images.*", "openGraph.images.*.url", "twitter.card", "twitter.images.*", "alternates.canonical"];
185
+ export declare const ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS: readonly ["metadataBase", "openGraph.type", "openGraph.url", "openGraph.locale", "openGraph.images.*", "openGraph.images.*.url", "twitter.card", "twitter.images.*", "alternates.canonical", "robots.**"];
176
186
  /**
177
187
  * `NAV_ITEMS` 里该翻的字段路径。写成**叶子字段名**:查表前下标与 `children` 层会被
178
188
  * 归一掉,`NAV_ITEMS[2].children[0].label` 与 `NAV_ITEMS[0].label` 查的是同一条。
@@ -29,6 +29,25 @@ export declare const SubsiteVisibleTextExportResponseSchema: z.ZodObject<{
29
29
  text: z.ZodString;
30
30
  media_key: z.ZodOptional<z.ZodString>;
31
31
  }, z.core.$strip>>>;
32
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ id: z.ZodString;
34
+ source: z.ZodEnum<{
35
+ "media-registry": "media-registry";
36
+ "source-literal": "source-literal";
37
+ }>;
38
+ src: z.ZodString;
39
+ alt: z.ZodNullable<z.ZodString>;
40
+ media_key: z.ZodOptional<z.ZodString>;
41
+ width: z.ZodOptional<z.ZodNumber>;
42
+ height: z.ZodOptional<z.ZodNumber>;
43
+ provider: z.ZodOptional<z.ZodString>;
44
+ is_placeholder: z.ZodBoolean;
45
+ occurrences: z.ZodArray<z.ZodObject<{
46
+ file_path: z.ZodString;
47
+ line: z.ZodNumber;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>>>;
32
50
  }, z.core.$strip>;
51
+ export type SubsiteVisibleTextImage = NonNullable<z.infer<typeof SubsiteVisibleTextExportResponseSchema>["images"]>[number];
33
52
  export type SubsiteVisibleTextEntry = NonNullable<z.infer<typeof SubsiteVisibleTextExportResponseSchema>["entries"]>[number];
34
53
  export type SubsiteVisibleTextExportResponse = z.infer<typeof SubsiteVisibleTextExportResponseSchema>;
@@ -12,6 +12,9 @@ export type WeightRole = "display" | "heading" | "title" | "ui" | "button" | "bo
12
12
  export declare const WEIGHT_STYLE_PRESETS: Readonly<Record<WeightStyleId, Readonly<Record<WeightRole, number>>>>;
13
13
  export declare const SITE_WEIGHT_TOKEN_NAMES: string[];
14
14
  export declare const SITE_LEADING_BODY_TOKEN = "--site-leading-body";
15
+ /** 标题行高令牌,与 display / heading / title 三个字重角色一一对应(模板基础层挂在 h1 / h2 / h3 与对应的 `type-*` 角色类上)。 */
16
+ export declare const SITE_LEADING_HEADING_TOKEN_NAMES: readonly ["--site-leading-display", "--site-leading-heading", "--site-leading-title"];
17
+ export type SiteLeadingHeadingToken = (typeof SITE_LEADING_HEADING_TOKEN_NAMES)[number];
15
18
  /**
16
19
  * `resolveFontDisplayName` silently falls back to `"Inter"` for a name it
17
20
  * doesn't recognize, so calling it first would make an unknown font
@@ -26,4 +29,5 @@ export declare function siteWeightVariables(style: WeightStyleId | undefined, fo
26
29
  body?: string;
27
30
  }): Record<`--site-weight-${WeightRole}`, string>;
28
31
  export declare function siteLeadingBody(locale: string | undefined): string;
32
+ export declare function siteLeadingHeadingVariables(locale: string | undefined): Record<SiteLeadingHeadingToken, string>;
29
33
  export declare function resolveTryOnFontWeights(family: string, wanted: readonly number[]): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcp-dev/contracts",
3
- "version": "0.10.20",
3
+ "version": "0.10.21",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {