@vcp-dev/site-edit-engine 0.11.3 → 0.11.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 +1 -0
- package/dist/index.d.ts +48 -3
- package/dist/index.js +18 -16
- package/dist/site-edit-instrumentation-loader.cjs +1 -1
- package/dist/webpack-loader.cjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ npm install @vcp-dev/contracts @vcp-dev/site-edit-engine
|
|
|
24
24
|
- `PreviewFileSystemSiteEditEngineRuntime`
|
|
25
25
|
- `scanSiteEditThemeStyleViolations` / `SITE_EDIT_RAW_COLOR_LITERAL_RE`
|
|
26
26
|
- `parseSourceModule` / `resolveImportBase`:复用引擎的 TSX 解析与本地 import 路径规则,公开类型由独立 facade 定义,不暴露 `internal/*` 模块路径。
|
|
27
|
+
- `provenRecordThumbnailRanges`:只读 AST 分析,返回可证明来自 `record.thumbnail` 数组的 JSX 表达式范围(`start:end`)。调用方仍须验证集合视图身份和完整记录媒体覆盖;范围集合不授予执行、写入或媒体下载权限。
|
|
27
28
|
- `openFileHistoryStore` / `FileHistoryStoreError`
|
|
28
29
|
- 相关 runtime、style policy 与 file history public types
|
|
29
30
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1890,6 +1890,13 @@ export interface PortableInvocationCall {
|
|
|
1890
1890
|
readonly ordinal: number;
|
|
1891
1891
|
readonly source_range: PortableInvocationSourceRange;
|
|
1892
1892
|
}
|
|
1893
|
+
export interface PortableLocalInvocationCall {
|
|
1894
|
+
readonly kind: "local";
|
|
1895
|
+
readonly source_file: string;
|
|
1896
|
+
readonly local_name: string;
|
|
1897
|
+
readonly ordinal: number;
|
|
1898
|
+
readonly source_range: PortableInvocationSourceRange;
|
|
1899
|
+
}
|
|
1893
1900
|
export type PortableInvocationAnalyzerErrorCode = "INVOCATION_PARSE_FAILED" | "INVOCATION_RENDER_GRAPH_INCOMPLETE" | "INVOCATION_TARGET_NOT_RENDERED" | "INVOCATION_TARGET_AMBIGUOUS" | "INVOCATION_PAGE_UNIT_NOT_FOUND" | "INVOCATION_PAGE_UNIT_UNSUPPORTED" | "INVOCATION_SPREAD_UNRESOLVED" | "INVOCATION_VALUE_UNRESOLVED" | "INVOCATION_DUPLICATE_PROP" | "INVOCATION_BLOCK_ID_UNRESOLVED" | "INVOCATION_ORDER_UNRESOLVED" | "INVOCATION_CHILDREN_UNRESOLVED" | "COLLECTION_SOURCE_CLOSURE_INCOMPLETE" | "COLLECTION_LIST_CONTAINER_UNPROVEN" | "COLLECTION_PAGINATION_UNPROVEN" | "COLLECTION_SEARCH_PARAMS_MISMATCH" | "COLLECTION_VIEW_UNPROVEN" | "COLLECTION_DETAIL_CONSUMER_UNPROVEN" | "COLLECTION_SCHEMA_UNPROVEN" | "COLLECTION_RECIPE_INVALID";
|
|
1894
1901
|
export interface PortableInvocationAnalyzerError {
|
|
1895
1902
|
readonly code: PortableInvocationAnalyzerErrorCode;
|
|
@@ -1908,6 +1915,31 @@ export interface PortableInvocationAnalyzerResult {
|
|
|
1908
1915
|
readonly semantic_props: Readonly<Record<string, PortableJsonValue>>;
|
|
1909
1916
|
readonly errors: readonly PortableInvocationAnalyzerError[];
|
|
1910
1917
|
}
|
|
1918
|
+
export interface PortableLocalInvocationAnalyzerInput {
|
|
1919
|
+
readonly file_path: string;
|
|
1920
|
+
readonly source: string;
|
|
1921
|
+
readonly target: {
|
|
1922
|
+
readonly kind: "local";
|
|
1923
|
+
readonly local_name: string;
|
|
1924
|
+
readonly original_block_id?: string;
|
|
1925
|
+
};
|
|
1926
|
+
/** Exact local component opening proven by the call-site lexical binding. */
|
|
1927
|
+
readonly call_source_range?: {
|
|
1928
|
+
readonly start_line: number;
|
|
1929
|
+
readonly start_column: number;
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
export interface PortableLocalInvocationAnalyzerResult {
|
|
1933
|
+
readonly complete: boolean;
|
|
1934
|
+
readonly entry_file: string;
|
|
1935
|
+
readonly target: PortableLocalInvocationAnalyzerInput["target"];
|
|
1936
|
+
readonly call: PortableLocalInvocationCall | null;
|
|
1937
|
+
readonly bindings: readonly PortableInvocationBinding[];
|
|
1938
|
+
readonly original_block_id: string | null;
|
|
1939
|
+
readonly original_order: number | null;
|
|
1940
|
+
readonly semantic_props: Readonly<Record<string, PortableJsonValue>>;
|
|
1941
|
+
readonly errors: readonly PortableInvocationAnalyzerError[];
|
|
1942
|
+
}
|
|
1911
1943
|
export interface PortablePageUnitInvocationSelectionInput {
|
|
1912
1944
|
readonly route: string;
|
|
1913
1945
|
readonly composition: SiteEditCompositionSelector;
|
|
@@ -2285,6 +2317,13 @@ export interface PortableBlockMetadataInput {
|
|
|
2285
2317
|
readonly jsx?: string;
|
|
2286
2318
|
/** A full TS/TSX source module, when the caller is normalizing a materialized file. */
|
|
2287
2319
|
readonly source?: string;
|
|
2320
|
+
/** Exact materialization entry export; omitted retains legacy single-JSX behavior. */
|
|
2321
|
+
readonly entryExport?: {
|
|
2322
|
+
readonly kind: "default";
|
|
2323
|
+
} | {
|
|
2324
|
+
readonly kind: "named";
|
|
2325
|
+
readonly name: string;
|
|
2326
|
+
};
|
|
2288
2327
|
readonly targetBlockId: string;
|
|
2289
2328
|
readonly targetOrder: number;
|
|
2290
2329
|
}
|
|
@@ -2576,6 +2615,8 @@ interface ProvenBlockCall {
|
|
|
2576
2615
|
structuralPath: string;
|
|
2577
2616
|
sourceRange: SourceRange;
|
|
2578
2617
|
};
|
|
2618
|
+
/** Equivalent conditional call sites, not simultaneous render occurrences. */
|
|
2619
|
+
alternativeLocators?: readonly ProvenBlockCall["callLocator"][];
|
|
2579
2620
|
}
|
|
2580
2621
|
interface ProvenBlockOwner {
|
|
2581
2622
|
kind: "route-member" | "component-definition";
|
|
@@ -2650,8 +2691,10 @@ export interface PortableBlockSelection {
|
|
|
2650
2691
|
readonly content_hash: string;
|
|
2651
2692
|
readonly source_range: PortableInvocationSourceRange;
|
|
2652
2693
|
readonly owner: ResolvedPageBlock["descriptor"]["owner"];
|
|
2653
|
-
readonly call_chain: readonly PortableInvocationCall[];
|
|
2654
|
-
readonly strategy: "reuse-entry" | "extract-jsx" | "managed-thin-entry";
|
|
2694
|
+
readonly call_chain: readonly (PortableInvocationCall | PortableLocalInvocationCall)[];
|
|
2695
|
+
readonly strategy: "reuse-entry" | "extract-jsx" | "managed-thin-entry" | "collection-container";
|
|
2696
|
+
/** Only set after proving the selected root is the container's sole view. */
|
|
2697
|
+
readonly collection_container_file?: string;
|
|
2655
2698
|
readonly entry_file: string;
|
|
2656
2699
|
readonly entry_export: {
|
|
2657
2700
|
readonly kind: "default";
|
|
@@ -2659,7 +2702,7 @@ export interface PortableBlockSelection {
|
|
|
2659
2702
|
readonly kind: "named";
|
|
2660
2703
|
readonly name: string;
|
|
2661
2704
|
};
|
|
2662
|
-
readonly invocation: PortableInvocationAnalyzerResult | null;
|
|
2705
|
+
readonly invocation: PortableInvocationAnalyzerResult | PortableLocalInvocationAnalyzerResult | null;
|
|
2663
2706
|
}
|
|
2664
2707
|
export interface ResolvePortableBlockSelectionInput {
|
|
2665
2708
|
readonly binding: ResolvedPageBlock;
|
|
@@ -2848,6 +2891,8 @@ export type PageBlockSnapshotResolution = BlockResolution & {
|
|
|
2848
2891
|
index?: PageBlockIndex;
|
|
2849
2892
|
};
|
|
2850
2893
|
export declare function resolvePageBlockFromSnapshot(input: BlockSnapshotInput): Promise<PageBlockSnapshotResolution>;
|
|
2894
|
+
/** Exact JSX ranges proven to read the captured record.thumbnail array only. */
|
|
2895
|
+
export declare function provenRecordThumbnailRanges(source: string): ReadonlySet<string>;
|
|
2851
2896
|
export type PortableMediaReferenceKind = "src" | "srcset" | "poster" | "thumbnail" | "object" | "array-item" | "import" | "manifest";
|
|
2852
2897
|
export type PortableMediaReferenceSource = "jsx-attribute" | "object-property" | "array-item" | "import" | "media-manifest";
|
|
2853
2898
|
export interface PortableMediaSourceRange {
|