Connect canonical projects to persistent workspace runtimes and canvas views

This commit is contained in:
2026-11-08 00:07:27 +08:00
parent 8a76e53a9f
commit e2987de21a
27 changed files with 970 additions and 57 deletions
+10
View File
@@ -0,0 +1,10 @@
/** A captured pointer may only finish the exact interaction that acquired it. */
export type EditingLease<T> = { preview(value: T): void; commit(): void; cancel(): void };
export function guardEditingLease<T>(isCurrent: () => boolean, actions: EditingLease<T>): EditingLease<T> {
return Object.freeze({
preview(value: T) { if (isCurrent()) actions.preview(value); },
commit() { if (isCurrent()) actions.commit(); },
cancel() { if (isCurrent()) actions.cancel(); },
});
}