@vcp-dev/site-edit-engine 0.6.1 → 0.6.3
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/index.js +9 -9
- package/dist/internal/protocol/render.d.ts +60 -0
- package/dist/internal/protocol.d.ts +1 -1
- package/dist/preview-runtime.d.ts +29 -1
- package/dist/runtime.d.ts +29 -1
- package/package.json +2 -2
|
@@ -31,6 +31,7 @@ export interface RenderEntry {
|
|
|
31
31
|
childKeys: string[];
|
|
32
32
|
pageCompositionUnitKey?: string;
|
|
33
33
|
operationSummary: OperationSummary;
|
|
34
|
+
dynamicDataSummary?: DynamicDataSummaryView;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* 能力概要 —— 标记该节点支持的四个核心操作。
|
|
@@ -42,6 +43,40 @@ export interface OperationSummary {
|
|
|
42
43
|
canMove: boolean;
|
|
43
44
|
canRemove: boolean;
|
|
44
45
|
}
|
|
46
|
+
export type DynamicSourceKindView = "vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api";
|
|
47
|
+
export type DynamicSourceTypeView = "cms-field" | "api-field";
|
|
48
|
+
export type DynamicTargetKindView = "text" | "attribute" | "richtext" | "repeat-region" | "component-prop";
|
|
49
|
+
export type DynamicConfidenceView = "exact" | "safe-derived" | "partial" | "unknown";
|
|
50
|
+
export interface DynamicEvidenceView {
|
|
51
|
+
file: string;
|
|
52
|
+
symbol?: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
}
|
|
55
|
+
export interface DynamicDataBindingView {
|
|
56
|
+
sourceKind: DynamicSourceKindView;
|
|
57
|
+
sourceType: DynamicSourceTypeView;
|
|
58
|
+
endpointPattern?: string;
|
|
59
|
+
operation?: string;
|
|
60
|
+
collection?: string;
|
|
61
|
+
fieldPath?: string;
|
|
62
|
+
valuePath?: string;
|
|
63
|
+
targetKind: DynamicTargetKindView;
|
|
64
|
+
targetName: string;
|
|
65
|
+
confidence: DynamicConfidenceView;
|
|
66
|
+
readonly: true;
|
|
67
|
+
evidence: DynamicEvidenceView[];
|
|
68
|
+
}
|
|
69
|
+
export interface DynamicDataDetailView {
|
|
70
|
+
hasDynamicData: boolean;
|
|
71
|
+
bindings: DynamicDataBindingView[];
|
|
72
|
+
}
|
|
73
|
+
export interface DynamicDataSummaryView {
|
|
74
|
+
hasDynamicData: boolean;
|
|
75
|
+
sourceKinds: DynamicSourceKindView[];
|
|
76
|
+
primaryEndpoint?: string;
|
|
77
|
+
primaryCollection?: string;
|
|
78
|
+
primaryFieldPath?: string;
|
|
79
|
+
}
|
|
45
80
|
/**
|
|
46
81
|
* 选中节点的详细信息 —— 按需加载。
|
|
47
82
|
* 包含完整 capability、text segments、boundary 信息、邻接关系。
|
|
@@ -62,6 +97,7 @@ export interface RenderObjectDetail {
|
|
|
62
97
|
mediaModel?: MediaModelView;
|
|
63
98
|
styleSource?: StyleSourceView;
|
|
64
99
|
conditional?: ConditionalDetailView;
|
|
100
|
+
dynamicData?: DynamicDataDetailView;
|
|
65
101
|
textSegments: TextSegmentView[];
|
|
66
102
|
boundaryKind: BoundaryKind | null;
|
|
67
103
|
isOpaque: boolean;
|
|
@@ -69,6 +105,30 @@ export interface RenderObjectDetail {
|
|
|
69
105
|
children: RenderEntryRef[];
|
|
70
106
|
siblings: RenderEntryRef[];
|
|
71
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* 面向 get-object-edit-context 的紧凑投影。
|
|
110
|
+
* 只包含 Wire DTO 实际消费的字段,避免为了选中态读取并构造 children / siblings
|
|
111
|
+
* 以及完整 provenance chain、文本值等 detail-only 数据。
|
|
112
|
+
*/
|
|
113
|
+
export interface RenderObjectEditContext {
|
|
114
|
+
key: string;
|
|
115
|
+
tag: string;
|
|
116
|
+
componentName: string;
|
|
117
|
+
sourceFile: string;
|
|
118
|
+
sourceLocator?: SourceLocatorView;
|
|
119
|
+
label: string;
|
|
120
|
+
capabilities: NodeCapabilitySnapshot;
|
|
121
|
+
provenanceChain?: Pick<ProvenanceChainView, "editMode" | "diagnostics">;
|
|
122
|
+
dynamicData?: DynamicDataDetailView;
|
|
123
|
+
textSegments: Array<{
|
|
124
|
+
index: number;
|
|
125
|
+
editable: boolean;
|
|
126
|
+
source: Pick<TextSourceView, "kind"> | null;
|
|
127
|
+
}>;
|
|
128
|
+
boundaryKind: BoundaryKind | null;
|
|
129
|
+
isOpaque: boolean;
|
|
130
|
+
ancestors: RenderEntryRef[];
|
|
131
|
+
}
|
|
72
132
|
export interface SourceLocatorRangeView {
|
|
73
133
|
startLine: number;
|
|
74
134
|
startColumn: number;
|
|
@@ -6,4 +6,4 @@ export type { DesignerEvent } from "./protocol/event.js";
|
|
|
6
6
|
export type { OperationError } from "./protocol/error.js";
|
|
7
7
|
export type { SourceIdentity } from "./protocol/identity.js";
|
|
8
8
|
export type { InsertableTag, InsertNodeSpec, MoveTarget, OperationParams, OperationRequest, OperationResult, OperationSelectionRef, OperationTarget, OperationType, OperationValue, StyleBreakpoint, StyleProperty, StyleStateMode, } from "./protocol/operation.js";
|
|
9
|
-
export type { ComponentSemanticDescriptor, ConditionalDetailView, ContentModelView, EffectiveWriteTargetView, MediaModelView, OperationSummary, ProvenanceChainView, ProvenanceHopView, RenderDocument, RenderEntry, RenderEntryRef, RenderObjectDetail, SemanticSourceView, SourceLocatorRangeView, SourceLocatorView, StyleSourceOperation, StyleSourceView, TextSegmentView, TextSourceView, WriteTargetView, } from "./protocol/render.js";
|
|
9
|
+
export type { ComponentSemanticDescriptor, ConditionalDetailView, DynamicConfidenceView, DynamicDataBindingView, DynamicDataDetailView, DynamicDataSummaryView, DynamicEvidenceView, DynamicSourceKindView, DynamicSourceTypeView, DynamicTargetKindView, ContentModelView, EffectiveWriteTargetView, MediaModelView, OperationSummary, ProvenanceChainView, ProvenanceHopView, RenderDocument, RenderEntry, RenderEntryRef, RenderObjectEditContext, RenderObjectDetail, SemanticSourceView, SourceLocatorRangeView, SourceLocatorView, StyleSourceOperation, StyleSourceView, TextSegmentView, TextSourceView, WriteTargetView, } from "./protocol/render.js";
|
|
@@ -25,6 +25,13 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
25
25
|
canRemove: boolean;
|
|
26
26
|
};
|
|
27
27
|
pageCompositionUnitKey?: string | undefined;
|
|
28
|
+
dynamicDataSummary?: {
|
|
29
|
+
hasDynamicData: boolean;
|
|
30
|
+
sourceKinds: ("vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api")[];
|
|
31
|
+
primaryEndpoint?: string | undefined;
|
|
32
|
+
primaryCollection?: string | undefined;
|
|
33
|
+
primaryFieldPath?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
28
35
|
}[];
|
|
29
36
|
pageComposition: {
|
|
30
37
|
status: "supported";
|
|
@@ -131,6 +138,27 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
131
138
|
message: string;
|
|
132
139
|
}[];
|
|
133
140
|
} | undefined;
|
|
141
|
+
dynamicData?: {
|
|
142
|
+
hasDynamicData: boolean;
|
|
143
|
+
bindings: {
|
|
144
|
+
sourceKind: "vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api";
|
|
145
|
+
sourceType: "api-field" | "cms-field";
|
|
146
|
+
targetKind: "repeat-region" | "text" | "attribute" | "richtext" | "component-prop";
|
|
147
|
+
targetName: string;
|
|
148
|
+
confidence: "exact" | "safe-derived" | "partial" | "unknown";
|
|
149
|
+
readonly: true;
|
|
150
|
+
evidence: {
|
|
151
|
+
file: string;
|
|
152
|
+
reason: string;
|
|
153
|
+
symbol?: string | undefined;
|
|
154
|
+
}[];
|
|
155
|
+
endpointPattern?: string | undefined;
|
|
156
|
+
operation?: string | undefined;
|
|
157
|
+
collection?: string | undefined;
|
|
158
|
+
fieldPath?: string | undefined;
|
|
159
|
+
valuePath?: string | undefined;
|
|
160
|
+
}[];
|
|
161
|
+
} | undefined;
|
|
134
162
|
};
|
|
135
163
|
};
|
|
136
164
|
getClassNameSource(key: string, routeId?: string): {
|
|
@@ -140,7 +168,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
140
168
|
routeId: string;
|
|
141
169
|
filePath: string;
|
|
142
170
|
componentName: string;
|
|
143
|
-
sourceKind: "
|
|
171
|
+
sourceKind: "expression" | "missing" | "stringLiteral";
|
|
144
172
|
attrRaw: string | null;
|
|
145
173
|
valueRaw: string | null;
|
|
146
174
|
attrRange: {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -21,6 +21,13 @@ export declare class SnapshotSiteEditEngineRuntime implements SiteEditEngineRunt
|
|
|
21
21
|
canRemove: boolean;
|
|
22
22
|
};
|
|
23
23
|
pageCompositionUnitKey?: string | undefined;
|
|
24
|
+
dynamicDataSummary?: {
|
|
25
|
+
hasDynamicData: boolean;
|
|
26
|
+
sourceKinds: ("vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api")[];
|
|
27
|
+
primaryEndpoint?: string | undefined;
|
|
28
|
+
primaryCollection?: string | undefined;
|
|
29
|
+
primaryFieldPath?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
24
31
|
}[];
|
|
25
32
|
pageComposition: {
|
|
26
33
|
status: "supported";
|
|
@@ -120,13 +127,34 @@ export declare class SnapshotSiteEditEngineRuntime implements SiteEditEngineRunt
|
|
|
120
127
|
message: string;
|
|
121
128
|
}[];
|
|
122
129
|
} | undefined;
|
|
130
|
+
dynamicData?: {
|
|
131
|
+
hasDynamicData: boolean;
|
|
132
|
+
bindings: {
|
|
133
|
+
sourceKind: "vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api";
|
|
134
|
+
sourceType: "api-field" | "cms-field";
|
|
135
|
+
targetKind: "repeat-region" | "text" | "attribute" | "richtext" | "component-prop";
|
|
136
|
+
targetName: string;
|
|
137
|
+
confidence: "exact" | "safe-derived" | "partial" | "unknown";
|
|
138
|
+
readonly: true;
|
|
139
|
+
evidence: {
|
|
140
|
+
file: string;
|
|
141
|
+
reason: string;
|
|
142
|
+
symbol?: string | undefined;
|
|
143
|
+
}[];
|
|
144
|
+
endpointPattern?: string | undefined;
|
|
145
|
+
operation?: string | undefined;
|
|
146
|
+
collection?: string | undefined;
|
|
147
|
+
fieldPath?: string | undefined;
|
|
148
|
+
valuePath?: string | undefined;
|
|
149
|
+
}[];
|
|
150
|
+
} | undefined;
|
|
123
151
|
};
|
|
124
152
|
getClassNameSource(key: string, routeId?: string): {
|
|
125
153
|
key: string;
|
|
126
154
|
routeId: string;
|
|
127
155
|
filePath: string;
|
|
128
156
|
componentName: string;
|
|
129
|
-
sourceKind: "
|
|
157
|
+
sourceKind: "expression" | "missing" | "stringLiteral";
|
|
130
158
|
attrRaw: string | null;
|
|
131
159
|
valueRaw: string | null;
|
|
132
160
|
attrRange: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcp-dev/site-edit-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@babel/parser": "^7.29.3",
|
|
61
61
|
"@babel/traverse": "^7.29.0",
|
|
62
62
|
"@babel/types": "^7.29.0",
|
|
63
|
-
"@vcp-dev/contracts": "0.6.
|
|
63
|
+
"@vcp-dev/contracts": "0.6.3",
|
|
64
64
|
"yaml": "^2.9.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|