@vcp-dev/site-edit-engine 0.9.5 → 0.10.0
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 +10 -9
- package/dist/internal/protocol/render.d.ts +3 -1
- package/dist/preview-runtime.d.ts +63 -9
- package/dist/runtime.d.ts +56 -2
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteEditClassNameSourceStyleContext, SiteEditCompositionContext, SiteEditPageComposition } from "@vcp-dev/contracts";
|
|
1
|
+
import type { SiteEditClassNameSourceStyleContext, SiteEditCompositionContext, SiteEditPageComposition, SiteEditProperties } from "@vcp-dev/contracts";
|
|
2
2
|
import type { NodeCapabilitySnapshot } from "./capability.js";
|
|
3
3
|
import type { BoundaryKind } from "./boundary.js";
|
|
4
4
|
import type { OperationType } from "./operation.js";
|
|
@@ -100,6 +100,7 @@ export interface RenderObjectDetail {
|
|
|
100
100
|
styleSource?: StyleSourceView;
|
|
101
101
|
conditional?: ConditionalDetailView;
|
|
102
102
|
dynamicData?: DynamicDataDetailView;
|
|
103
|
+
properties?: SiteEditProperties;
|
|
103
104
|
textSegments: TextSegmentView[];
|
|
104
105
|
boundaryKind: BoundaryKind | null;
|
|
105
106
|
isOpaque: boolean;
|
|
@@ -123,6 +124,7 @@ export interface RenderObjectEditContext {
|
|
|
123
124
|
capabilities: NodeCapabilitySnapshot;
|
|
124
125
|
provenanceChain?: Pick<ProvenanceChainView, "editMode" | "diagnostics">;
|
|
125
126
|
dynamicData?: DynamicDataDetailView;
|
|
127
|
+
properties?: SiteEditProperties;
|
|
126
128
|
textSegments: Array<{
|
|
127
129
|
index: number;
|
|
128
130
|
editable: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteEditCommandSuccess, SiteEditCompositionContext, SiteEditCompositionSelector, SiteEditMutationContext, SiteEditResolveSourceLocationInput } from "@vcp-dev/contracts";
|
|
1
|
+
import type { SiteEditCommandSuccess, SiteEditCompositionContext, SiteEditCompositionSelector, SiteEditMutationContext, SiteEditOperationSelectionRef, SiteEditResolveSourceLocationInput } from "@vcp-dev/contracts";
|
|
2
2
|
import type { SiteEditEngineHistoryStatus, PreviewSiteEditEngineRuntime, PreviewSiteEditEngineRuntimeOptions } from "./types.js";
|
|
3
3
|
export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSiteEditEngineRuntime {
|
|
4
4
|
private readonly options;
|
|
@@ -85,7 +85,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
85
85
|
} | null;
|
|
86
86
|
};
|
|
87
87
|
getHistoryStatus(): Promise<SiteEditCommandSuccess<SiteEditEngineHistoryStatus>>;
|
|
88
|
-
getObjectEditContext(key: string, composition: SiteEditCompositionSelector): {
|
|
88
|
+
getObjectEditContext(key: string, composition: SiteEditCompositionSelector, selectionRef?: SiteEditOperationSelectionRef): {
|
|
89
89
|
readonly ok: true;
|
|
90
90
|
readonly composition: {
|
|
91
91
|
routeId: string;
|
|
@@ -186,6 +186,60 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
186
186
|
valuePath?: string | undefined;
|
|
187
187
|
}[];
|
|
188
188
|
} | undefined;
|
|
189
|
+
properties?: {
|
|
190
|
+
documentVersion: number;
|
|
191
|
+
items: {
|
|
192
|
+
name: string;
|
|
193
|
+
source: {
|
|
194
|
+
kind: "expression" | "literal" | "binding" | "repeat-template" | "boolean-shorthand";
|
|
195
|
+
raw?: string | undefined;
|
|
196
|
+
};
|
|
197
|
+
resolution: {
|
|
198
|
+
status: "resolved";
|
|
199
|
+
value: import("@vcp-dev/contracts").SiteEditOperationValue;
|
|
200
|
+
} | {
|
|
201
|
+
status: "undefined";
|
|
202
|
+
} | {
|
|
203
|
+
status: "unresolved";
|
|
204
|
+
};
|
|
205
|
+
editMode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
|
|
206
|
+
sourceScope: "node" | "repeat-template" | "repeat-item";
|
|
207
|
+
allowedWriteScopes: ("template" | "selection")[];
|
|
208
|
+
diagnostics: {
|
|
209
|
+
code: string;
|
|
210
|
+
message: string;
|
|
211
|
+
}[];
|
|
212
|
+
effectiveWriteTarget?: {
|
|
213
|
+
kind: "jsx-node" | "route-export" | "value-path" | "external-entry";
|
|
214
|
+
isProxy: boolean;
|
|
215
|
+
file?: string | undefined;
|
|
216
|
+
displayPath?: string | undefined;
|
|
217
|
+
sourceType?: "api-field" | "cms-field" | "i18n-message" | "config-entry" | undefined;
|
|
218
|
+
sourceId?: string | undefined;
|
|
219
|
+
} | undefined;
|
|
220
|
+
}[];
|
|
221
|
+
spreads: {
|
|
222
|
+
raw: string;
|
|
223
|
+
sourceRange: {
|
|
224
|
+
start: number;
|
|
225
|
+
end: number;
|
|
226
|
+
};
|
|
227
|
+
order: number;
|
|
228
|
+
diagnostics: {
|
|
229
|
+
code: string;
|
|
230
|
+
message: string;
|
|
231
|
+
}[];
|
|
232
|
+
}[];
|
|
233
|
+
creation: {
|
|
234
|
+
selection: "direct" | "unsupported" | "materialize";
|
|
235
|
+
template: "direct" | "unsupported";
|
|
236
|
+
};
|
|
237
|
+
selectionRef?: {
|
|
238
|
+
key: string;
|
|
239
|
+
instanceIndex?: number | undefined;
|
|
240
|
+
instanceCount?: number | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
} | undefined;
|
|
189
243
|
};
|
|
190
244
|
};
|
|
191
245
|
getClassNameSource(key: string, composition: SiteEditCompositionSelector): {
|
|
@@ -310,7 +364,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
310
364
|
refreshSourceForKey(key: string, composition: SiteEditCompositionSelector): Promise<void>;
|
|
311
365
|
executeOperation(request: Parameters<PreviewSiteEditEngineRuntime["executeOperation"]>[0], mutationContext?: SiteEditMutationContext): Promise<SiteEditCommandSuccess<{
|
|
312
366
|
requestId: string;
|
|
313
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
367
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
314
368
|
composition: {
|
|
315
369
|
routeId: string;
|
|
316
370
|
effectiveTemplateId?: string | undefined;
|
|
@@ -365,7 +419,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
365
419
|
} | undefined;
|
|
366
420
|
}> | import("@vcp-dev/contracts").SiteEditCommandFailure<"VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "HOME_PAGE_LOCKED" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR", unknown, never, Partial<{
|
|
367
421
|
requestId: string;
|
|
368
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
422
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
369
423
|
composition: {
|
|
370
424
|
routeId: string;
|
|
371
425
|
effectiveTemplateId?: string | undefined;
|
|
@@ -431,7 +485,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
431
485
|
data: {
|
|
432
486
|
affectedFiles?: string[] | undefined;
|
|
433
487
|
requestId: string;
|
|
434
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
488
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
435
489
|
composition: {
|
|
436
490
|
routeId: string;
|
|
437
491
|
effectiveTemplateId?: string | undefined;
|
|
@@ -476,7 +530,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
476
530
|
};
|
|
477
531
|
data: {
|
|
478
532
|
requestId: string;
|
|
479
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
533
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
480
534
|
composition: {
|
|
481
535
|
routeId: string;
|
|
482
536
|
effectiveTemplateId?: string | undefined;
|
|
@@ -516,7 +570,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
516
570
|
};
|
|
517
571
|
data: {
|
|
518
572
|
requestId: string;
|
|
519
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
573
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
520
574
|
composition: {
|
|
521
575
|
routeId: string;
|
|
522
576
|
effectiveTemplateId?: string | undefined;
|
|
@@ -584,7 +638,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
584
638
|
};
|
|
585
639
|
data: {
|
|
586
640
|
requestId: string;
|
|
587
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
641
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
588
642
|
composition: {
|
|
589
643
|
routeId: string;
|
|
590
644
|
effectiveTemplateId?: string | undefined;
|
|
@@ -624,7 +678,7 @@ export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSi
|
|
|
624
678
|
};
|
|
625
679
|
data: {
|
|
626
680
|
requestId: string;
|
|
627
|
-
kind: "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "
|
|
681
|
+
kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "move-node" | "set-class-name-source" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
|
|
628
682
|
composition: {
|
|
629
683
|
routeId: string;
|
|
630
684
|
effectiveTemplateId?: string | undefined;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteEditCompositionSelector } from "@vcp-dev/contracts";
|
|
1
|
+
import type { SiteEditCompositionSelector, SiteEditOperationSelectionRef } from "@vcp-dev/contracts";
|
|
2
2
|
import { type SiteEditResolveSourceLocationInput } from "@vcp-dev/contracts";
|
|
3
3
|
import type { SiteEditEngineRuntime, SiteEditEngineRuntimeOptions, SiteEditPlanOperationResult } from "./types.js";
|
|
4
4
|
export declare class SnapshotSiteEditEngineRuntime implements SiteEditEngineRuntime {
|
|
@@ -69,7 +69,7 @@ export declare class SnapshotSiteEditEngineRuntime implements SiteEditEngineRunt
|
|
|
69
69
|
hash?: string | undefined;
|
|
70
70
|
}[];
|
|
71
71
|
} | null;
|
|
72
|
-
getObjectEditContext(key: string, composition: SiteEditCompositionSelector): {
|
|
72
|
+
getObjectEditContext(key: string, composition: SiteEditCompositionSelector, selectionRef?: SiteEditOperationSelectionRef): {
|
|
73
73
|
composition: {
|
|
74
74
|
routeId: string;
|
|
75
75
|
effectiveTemplateId?: string | undefined;
|
|
@@ -164,6 +164,60 @@ export declare class SnapshotSiteEditEngineRuntime implements SiteEditEngineRunt
|
|
|
164
164
|
valuePath?: string | undefined;
|
|
165
165
|
}[];
|
|
166
166
|
} | undefined;
|
|
167
|
+
properties?: {
|
|
168
|
+
documentVersion: number;
|
|
169
|
+
items: {
|
|
170
|
+
name: string;
|
|
171
|
+
source: {
|
|
172
|
+
kind: "expression" | "literal" | "binding" | "repeat-template" | "boolean-shorthand";
|
|
173
|
+
raw?: string | undefined;
|
|
174
|
+
};
|
|
175
|
+
resolution: {
|
|
176
|
+
status: "resolved";
|
|
177
|
+
value: import("@vcp-dev/contracts").SiteEditOperationValue;
|
|
178
|
+
} | {
|
|
179
|
+
status: "undefined";
|
|
180
|
+
} | {
|
|
181
|
+
status: "unresolved";
|
|
182
|
+
};
|
|
183
|
+
editMode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
|
|
184
|
+
sourceScope: "node" | "repeat-template" | "repeat-item";
|
|
185
|
+
allowedWriteScopes: ("template" | "selection")[];
|
|
186
|
+
diagnostics: {
|
|
187
|
+
code: string;
|
|
188
|
+
message: string;
|
|
189
|
+
}[];
|
|
190
|
+
effectiveWriteTarget?: {
|
|
191
|
+
kind: "jsx-node" | "route-export" | "value-path" | "external-entry";
|
|
192
|
+
isProxy: boolean;
|
|
193
|
+
file?: string | undefined;
|
|
194
|
+
displayPath?: string | undefined;
|
|
195
|
+
sourceType?: "api-field" | "cms-field" | "i18n-message" | "config-entry" | undefined;
|
|
196
|
+
sourceId?: string | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
}[];
|
|
199
|
+
spreads: {
|
|
200
|
+
raw: string;
|
|
201
|
+
sourceRange: {
|
|
202
|
+
start: number;
|
|
203
|
+
end: number;
|
|
204
|
+
};
|
|
205
|
+
order: number;
|
|
206
|
+
diagnostics: {
|
|
207
|
+
code: string;
|
|
208
|
+
message: string;
|
|
209
|
+
}[];
|
|
210
|
+
}[];
|
|
211
|
+
creation: {
|
|
212
|
+
selection: "direct" | "unsupported" | "materialize";
|
|
213
|
+
template: "direct" | "unsupported";
|
|
214
|
+
};
|
|
215
|
+
selectionRef?: {
|
|
216
|
+
key: string;
|
|
217
|
+
instanceIndex?: number | undefined;
|
|
218
|
+
instanceCount?: number | undefined;
|
|
219
|
+
} | undefined;
|
|
220
|
+
} | undefined;
|
|
167
221
|
};
|
|
168
222
|
getClassNameSource(key: string, composition: SiteEditCompositionSelector): {
|
|
169
223
|
key: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteEditCommandSuccess, SiteEditEvent, SiteEditGetClassNameSourceCommandResult, SiteEditGetClassNameSourceResult, SiteEditClassNameSourceStyleContext, SiteEditCompositionSelector, SiteEditCompositionContext, SiteEditObjectEditContext, SiteEditOperationCommandResult, SiteEditMutationContext, SiteEditOperationRequest, SiteEditPatchPlan, SiteEditRenderDocument, SiteEditResolveSourceLocationInput, SiteEditSourceFileResponse, SiteEditSourceLocation, SiteEditSourceTreeResponse } from "@vcp-dev/contracts";
|
|
1
|
+
import type { SiteEditCommandSuccess, SiteEditEvent, SiteEditGetClassNameSourceCommandResult, SiteEditGetClassNameSourceResult, SiteEditClassNameSourceStyleContext, SiteEditCompositionSelector, SiteEditCompositionContext, SiteEditObjectEditContext, SiteEditOperationCommandResult, SiteEditMutationContext, SiteEditOperationRequest, SiteEditOperationSelectionRef, SiteEditPatchPlan, SiteEditRenderDocument, SiteEditResolveSourceLocationInput, SiteEditSourceFileResponse, SiteEditSourceLocation, SiteEditSourceTreeResponse } from "@vcp-dev/contracts";
|
|
2
2
|
import type { SiteEditProjectFileSystem } from "./public-file-system.js";
|
|
3
3
|
import type { FileHistoryStore } from "./history/file-history-store.js";
|
|
4
4
|
export type { SiteEditProjectFileSystem } from "./public-file-system.js";
|
|
@@ -45,7 +45,7 @@ export interface SiteEditEngineRuntime {
|
|
|
45
45
|
initializeComposition(composition: SiteEditCompositionSelector): Promise<void>;
|
|
46
46
|
getDocument(composition: SiteEditCompositionSelector): SiteEditRenderDocument;
|
|
47
47
|
getStyleContext(composition: SiteEditCompositionSelector): SiteEditClassNameSourceStyleContext | null;
|
|
48
|
-
getObjectEditContext(key: string, composition: SiteEditCompositionSelector): SiteEditObjectEditContext;
|
|
48
|
+
getObjectEditContext(key: string, composition: SiteEditCompositionSelector, selectionRef?: SiteEditOperationSelectionRef): SiteEditObjectEditContext;
|
|
49
49
|
getClassNameSource(key: string, composition: SiteEditCompositionSelector): SiteEditGetClassNameSourceResult;
|
|
50
50
|
getSourceTree(composition: SiteEditCompositionSelector): Promise<SiteEditSourceTreeResponse>;
|
|
51
51
|
getSourceFile(input: {
|
|
@@ -79,7 +79,7 @@ export interface PreviewSiteEditEngineRuntime {
|
|
|
79
79
|
getDocument(composition: SiteEditCompositionSelector): SiteEditCommandSuccess<SiteEditRenderDocument>;
|
|
80
80
|
getStyleContext(composition: SiteEditCompositionSelector): SiteEditCommandSuccess<SiteEditClassNameSourceStyleContext | null>;
|
|
81
81
|
getHistoryStatus(): Promise<SiteEditCommandSuccess<SiteEditEngineHistoryStatus>>;
|
|
82
|
-
getObjectEditContext(key: string, composition: SiteEditCompositionSelector): SiteEditCommandSuccess<SiteEditObjectEditContext>;
|
|
82
|
+
getObjectEditContext(key: string, composition: SiteEditCompositionSelector, selectionRef?: SiteEditOperationSelectionRef): SiteEditCommandSuccess<SiteEditObjectEditContext>;
|
|
83
83
|
getClassNameSource(key: string, composition: SiteEditCompositionSelector): SiteEditGetClassNameSourceCommandResult;
|
|
84
84
|
getSourceTree(composition: SiteEditCompositionSelector): Promise<SiteEditCommandSuccess<SiteEditSourceTreeResponse>>;
|
|
85
85
|
getSourceFile(input: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcp-dev/site-edit-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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.
|
|
63
|
+
"@vcp-dev/contracts": "0.10.0",
|
|
64
64
|
"yaml": "^2.9.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|