@fps-games/editor 0.2.0-beta.3 → 0.2.0-beta.4

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.
Files changed (116) hide show
  1. package/dist/agent-bridge/capabilities/editor-state.d.ts.map +1 -1
  2. package/dist/agent-bridge/capabilities/editor-state.js +26 -17
  3. package/dist/agent-bridge/capabilities/editor-state.js.map +1 -1
  4. package/dist/agent-bridge/capabilities/prefabs.d.ts.map +1 -1
  5. package/dist/agent-bridge/capabilities/prefabs.js +61 -13
  6. package/dist/agent-bridge/capabilities/prefabs.js.map +1 -1
  7. package/dist/agent-bridge/capabilities/scene-objects.d.ts +1 -1
  8. package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +1 -1
  9. package/dist/agent-bridge/capabilities/scene-objects.js +110 -25
  10. package/dist/agent-bridge/capabilities/scene-objects.js.map +1 -1
  11. package/dist/agent-bridge/capabilities/selection.d.ts.map +1 -1
  12. package/dist/agent-bridge/capabilities/selection.js +8 -5
  13. package/dist/agent-bridge/capabilities/selection.js.map +1 -1
  14. package/dist/agent-bridge/capabilities/shadows.d.ts.map +1 -1
  15. package/dist/agent-bridge/capabilities/shadows.js +11 -2
  16. package/dist/agent-bridge/capabilities/shadows.js.map +1 -1
  17. package/dist/agent-bridge/capabilities/transform.d.ts.map +1 -1
  18. package/dist/agent-bridge/capabilities/transform.js +6 -4
  19. package/dist/agent-bridge/capabilities/transform.js.map +1 -1
  20. package/dist/agent-bridge/capabilities/viewport.d.ts.map +1 -1
  21. package/dist/agent-bridge/capabilities/viewport.js +79 -47
  22. package/dist/agent-bridge/capabilities/viewport.js.map +1 -1
  23. package/dist/agent-bridge/shared.d.ts +8 -3
  24. package/dist/agent-bridge/shared.d.ts.map +1 -1
  25. package/dist/agent-bridge/shared.js +32 -0
  26. package/dist/agent-bridge/shared.js.map +1 -1
  27. package/dist/build-info.json +34 -34
  28. package/dist/local-editor-agent-actions.d.ts.map +1 -1
  29. package/dist/local-editor-agent-actions.js +9 -5
  30. package/dist/local-editor-agent-actions.js.map +1 -1
  31. package/dist/local-editor-harness.d.ts.map +1 -1
  32. package/dist/local-editor-harness.js +264 -41
  33. package/dist/local-editor-harness.js.map +1 -1
  34. package/node_modules/@fps-games/babylon-renderer/package.json +7 -7
  35. package/node_modules/@fps-games/editor-babylon/package.json +5 -5
  36. package/node_modules/@fps-games/editor-browser/dist/index.d.ts +3 -1
  37. package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
  38. package/node_modules/@fps-games/editor-browser/dist/index.js +2 -0
  39. package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
  40. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +2 -1
  41. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
  42. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +260 -94
  43. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
  44. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-projection.d.ts +7 -0
  45. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-projection.d.ts.map +1 -0
  46. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-projection.js +186 -0
  47. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-projection.js.map +1 -0
  48. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts +2 -2
  49. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts.map +1 -1
  50. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js +14 -8
  51. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js.map +1 -1
  52. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -1
  53. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +23 -7
  54. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -1
  55. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
  56. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
  57. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +6 -0
  58. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
  59. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.d.ts +3 -0
  60. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.d.ts.map +1 -1
  61. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.js +60 -13
  62. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.js.map +1 -1
  63. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-status-diagnostics.d.ts +24 -0
  64. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-status-diagnostics.d.ts.map +1 -0
  65. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-status-diagnostics.js +69 -0
  66. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-status-diagnostics.js.map +1 -0
  67. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +58 -14
  68. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
  69. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
  70. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +1 -1
  71. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
  72. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +196 -11
  73. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
  74. package/node_modules/@fps-games/editor-browser/package.json +4 -4
  75. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts +3 -0
  76. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
  77. package/node_modules/@fps-games/editor-core/dist/editor-session.js +9 -0
  78. package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
  79. package/node_modules/@fps-games/editor-core/package.json +6 -6
  80. package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
  81. package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
  82. package/node_modules/@fps-games/editor-protocol/package.json +2 -2
  83. package/node_modules/@fps-games/editor-tooling/package.json +3 -3
  84. package/node_modules/@fps-games/playable-assets/package.json +1 -1
  85. package/node_modules/@fps-games/playable-contracts/package.json +1 -1
  86. package/node_modules/@fps-games/playable-rendering/package.json +2 -2
  87. package/node_modules/@fps-games/playable-runtime/package.json +12 -12
  88. package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
  89. package/node_modules/@fps-games/playable-scene/package.json +2 -2
  90. package/node_modules/@fps-games/plugin-api/package.json +1 -1
  91. package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
  92. package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
  93. package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
  94. package/node_modules/@fps-games/plugin-assets/package.json +5 -5
  95. package/node_modules/@fps-games/plugin-host/package.json +2 -2
  96. package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
  97. package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
  98. package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
  99. package/node_modules/@fps-games/plugin-markers/package.json +5 -5
  100. package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
  101. package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
  102. package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
  103. package/node_modules/@fps-games/plugin-materials/package.json +5 -5
  104. package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
  105. package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
  106. package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
  107. package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
  108. package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
  109. package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
  110. package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
  111. package/node_modules/@fps-games/plugin-scene/package.json +5 -5
  112. package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
  113. package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
  114. package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
  115. package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
  116. package/package.json +19 -19
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-browser",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Browser host adapters for fps-game-editor.",
@@ -14,8 +14,8 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/editor-core": "0.2.0-beta.3",
18
- "@fps-games/editor-playable-sdk": "0.2.0-beta.3",
19
- "@fps-games/plugin-api": "0.2.0-beta.3"
17
+ "@fps-games/editor-core": "0.2.0-beta.4",
18
+ "@fps-games/editor-playable-sdk": "0.2.0-beta.4",
19
+ "@fps-games/plugin-api": "0.2.0-beta.4"
20
20
  }
21
21
  }
@@ -52,6 +52,7 @@ export interface EditorSessionState<TDocument> {
52
52
  canUndo: boolean;
53
53
  canRedo: boolean;
54
54
  history: EditorSessionHistoryView;
55
+ documentRevision: number;
55
56
  }
56
57
  export interface EditorSessionChange {
57
58
  readonly reason: 'selection' | 'document' | 'history' | 'saved' | 'reset' | 'rebase';
@@ -59,6 +60,7 @@ export interface EditorSessionChange {
59
60
  readonly documentChanged: boolean;
60
61
  readonly selectionChanged: boolean;
61
62
  readonly historyChanged: boolean;
63
+ readonly documentRevision: number;
62
64
  }
63
65
  export interface EditorSessionExternalRebaseInput<TDocument> {
64
66
  persistedDocument: TDocument;
@@ -150,6 +152,7 @@ export declare class EditorSession<TDocument, TPatch = unknown> {
150
152
  private undoStack;
151
153
  private redoStack;
152
154
  private nextTransactionId;
155
+ private documentRevision;
153
156
  constructor(options: EditorSessionOptions<TDocument, TPatch>);
154
157
  getState(options?: EditorSessionStateOptions): EditorSessionState<TDocument>;
155
158
  getWorkingDocument(): TDocument;
@@ -1 +1 @@
1
- {"version":3,"file":"editor-session.d.ts","sourceRoot":"","sources":["../src/editor-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,GAAG,OAAO,CAAE,SAAQ,iBAAiB;IAC/E,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB,CAAC,SAAS,CAAE,SAAQ,iBAAiB;IAC1E,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,CAAC,SAAS,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,IAC7D,oBAAoB,CAAC,MAAM,CAAC,GAC5B,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAEtC,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,IAAI,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M,EACnD,OAAO,EAAE,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/C,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC"}
@@ -85,6 +85,7 @@ export class EditorSession {
85
85
  this.undoStack = [];
86
86
  this.redoStack = [];
87
87
  this.nextTransactionId = 1;
88
+ this.documentRevision = 0;
88
89
  this.cloneDocument = options.cloneDocument ?? defaultCloneDocument;
89
90
  this.compareDocuments = options.compareDocuments ?? defaultCompareDocuments;
90
91
  this.reduceDocument = options.reduceDocument;
@@ -107,6 +108,7 @@ export class EditorSession {
107
108
  canUndo: this.canUndo(),
108
109
  canRedo: this.canRedo(),
109
110
  history: this.getHistoryView(),
111
+ documentRevision: this.documentRevision,
110
112
  };
111
113
  }
112
114
  getWorkingDocument() {
@@ -161,6 +163,7 @@ export class EditorSession {
161
163
  : !this.compareDocuments(beforeDocument, this.workingDocument);
162
164
  const selectionChanged = !selectionEquals(beforeSelection, this.selection);
163
165
  if (documentChanged) {
166
+ this.documentRevision += 1;
164
167
  this.dirty = options.assumeDirty === true
165
168
  ? true
166
169
  : !this.compareDocuments(this.workingDocument, this.persistedDocument);
@@ -187,6 +190,7 @@ export class EditorSession {
187
190
  return null;
188
191
  this.redoStack.push(transaction);
189
192
  this.workingDocument = this.cloneDocument(transaction.beforeDocument);
193
+ this.documentRevision += 1;
190
194
  this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);
191
195
  this.emitChange('history', true, false, true);
192
196
  return {
@@ -203,6 +207,7 @@ export class EditorSession {
203
207
  return null;
204
208
  this.undoStack.push(transaction);
205
209
  this.workingDocument = this.cloneDocument(transaction.afterDocument);
210
+ this.documentRevision += 1;
206
211
  this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);
207
212
  this.emitChange('history', true, false, true);
208
213
  return {
@@ -218,6 +223,7 @@ export class EditorSession {
218
223
  this.source = cloneAuthoringSourceDescriptorOptional(source);
219
224
  this.persistedDocument = this.cloneDocument(document);
220
225
  this.workingDocument = this.cloneDocument(document);
226
+ this.documentRevision += 1;
221
227
  this.dirty = false;
222
228
  this.emitChange('saved', true, false, false);
223
229
  return this.getState();
@@ -226,6 +232,7 @@ export class EditorSession {
226
232
  this.source = cloneAuthoringSourceDescriptorOptional(source);
227
233
  this.persistedDocument = this.cloneDocument(document);
228
234
  this.workingDocument = this.cloneDocument(document);
235
+ this.documentRevision += 1;
229
236
  this.selection = normalizeSelection();
230
237
  this.dirty = false;
231
238
  this.undoStack = [];
@@ -236,6 +243,7 @@ export class EditorSession {
236
243
  rebaseExternalDocuments(input) {
237
244
  this.persistedDocument = this.cloneDocument(input.persistedDocument);
238
245
  this.workingDocument = this.cloneDocument(input.workingDocument);
246
+ this.documentRevision += 1;
239
247
  this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);
240
248
  this.undoStack = [];
241
249
  this.redoStack = [];
@@ -250,6 +258,7 @@ export class EditorSession {
250
258
  documentChanged,
251
259
  selectionChanged,
252
260
  historyChanged,
261
+ documentRevision: this.documentRevision,
253
262
  }));
254
263
  }
255
264
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"editor-session.js","sourceRoot":"","sources":["../src/editor-session.ts"],"names":[],"mappings":"AAuLA,SAAS,oBAAoB,CAAY,QAAmB;IAC1D,MAAM,iBAAiB,GAAI,UAAkC,CAAC,eAAe,CAAC;IAC9E,IAAI,OAAO,iBAAiB,KAAK,UAAU;QAAE,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAc,CAAC;AAC3D,CAAC;AAED,SAAS,uBAAuB,CAAY,IAAe,EAAE,KAAgB;IAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,kBAAkB,CAAC,SAAyC;IACnE,MAAM,WAAW,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AAC1C,CAAC;AAQD,MAAM,UAAU,mBAAmB,CACjC,OAAgD;IAEhD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { AuthoringSourceDescriptor } from './authoring-source';\n\nexport interface EditorSelectionState {\n selectedIds: string[];\n activeId: string | null;\n}\n\nexport interface EditorCommandBase {\n type: string;\n label?: string;\n projectionImpact?: EditorProjectionImpact;\n}\n\nexport interface DocumentPatchCommand<TPatch = unknown> extends EditorCommandBase {\n type: 'document.patch';\n patch: TPatch;\n targetId?: string;\n propertyPath?: string;\n}\n\nexport interface DocumentReplaceCommand<TDocument> extends EditorCommandBase {\n type: 'document.replace';\n document: TDocument;\n}\n\nexport type DocumentCommand<TDocument = unknown, TPatch = unknown> =\n | DocumentPatchCommand<TPatch>\n | DocumentReplaceCommand<TDocument>;\n\nexport interface SelectionReplaceCommand extends EditorCommandBase {\n type: 'selection.replace';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionAddCommand extends EditorCommandBase {\n type: 'selection.add';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionRemoveCommand extends EditorCommandBase {\n type: 'selection.remove';\n selectedIds: string[];\n}\n\nexport interface SelectionToggleCommand extends EditorCommandBase {\n type: 'selection.toggle';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionClearCommand extends EditorCommandBase {\n type: 'selection.clear';\n}\n\nexport type SelectionCommand =\n | SelectionReplaceCommand\n | SelectionAddCommand\n | SelectionRemoveCommand\n | SelectionToggleCommand\n | SelectionClearCommand;\n\nexport type EditorCommand<TDocument = unknown, TPatch = unknown> =\n | DocumentCommand<TDocument, TPatch>\n | SelectionCommand;\n\nexport interface EditorSessionState<TDocument> {\n persistedDocument: TDocument;\n workingDocument: TDocument;\n source?: AuthoringSourceDescriptor;\n selection: EditorSelectionState;\n dirty: boolean;\n canUndo: boolean;\n canRedo: boolean;\n history: EditorSessionHistoryView;\n}\n\nexport interface EditorSessionChange {\n readonly reason: 'selection' | 'document' | 'history' | 'saved' | 'reset' | 'rebase';\n readonly dirty: boolean;\n readonly documentChanged: boolean;\n readonly selectionChanged: boolean;\n readonly historyChanged: boolean;\n}\n\nexport interface EditorSessionExternalRebaseInput<TDocument> {\n persistedDocument: TDocument;\n workingDocument: TDocument;\n}\n\nexport interface EditorSessionDispatchResult<TDocument> {\n command: EditorCommand;\n workingDocument: TDocument;\n selection: EditorSelectionState;\n dirty: boolean;\n documentChanged: boolean;\n selectionChanged: boolean;\n transaction?: UndoTransaction<TDocument>;\n}\n\nexport interface EditorSessionDispatchOptions {\n mergeWithPrevious?: boolean;\n assumeDocumentChanged?: boolean;\n assumeDirty?: boolean;\n clonePatchInput?: boolean;\n cloneResultDocument?: boolean;\n}\n\nexport interface EditorSessionStateOptions {\n /**\n * Defaults to true to preserve the historical snapshot semantics.\n * Performance-sensitive editor UI code can pass false when it treats\n * documents as read-only during render.\n */\n cloneDocuments?: boolean;\n}\n\nexport interface EditorSessionOptions<TDocument, TPatch = unknown> {\n source?: AuthoringSourceDescriptor;\n persistedDocument: TDocument;\n workingDocument?: TDocument;\n selection?: Partial<EditorSelectionState>;\n onChange?(change: EditorSessionChange): void;\n onChangeError?(error: unknown): void;\n cloneDocument?: (document: TDocument) => TDocument;\n compareDocuments?: (left: TDocument, right: TDocument) => boolean;\n reduceDocument?: (\n document: TDocument,\n command: DocumentCommand<TDocument, TPatch>,\n ) => TDocument;\n}\n\nexport interface UndoTransaction<TDocument> {\n id: string;\n label: string;\n commandType: string;\n beforeDocument: TDocument;\n afterDocument: TDocument;\n projectionImpact?: EditorProjectionImpact;\n createdAt: number;\n}\n\nexport type EditorProjectionImpact =\n | EditorProjectionIncrementalImpact\n | EditorProjectionRebuildImpact;\n\nexport interface EditorProjectionIncrementalImpact {\n type: 'incremental';\n syncTransformIds?: string[];\n reprojectIds?: string[];\n createdNodeIds?: string[];\n deletedNodeIds?: string[];\n}\n\nexport interface EditorProjectionRebuildImpact {\n type: 'rebuild';\n reason?: string;\n}\n\nexport interface EditorSessionHistoryEntry {\n id: string;\n label: string;\n commandType: string;\n createdAt: number;\n}\n\nexport interface EditorSessionHistoryView {\n entries: EditorSessionHistoryEntry[];\n}\n\nexport interface EditorSessionHistoryResult<TDocument> {\n transaction: UndoTransaction<TDocument>;\n workingDocument: TDocument;\n selection: EditorSelectionState;\n dirty: boolean;\n documentChanged: true;\n}\n\ntype StructuredCloneHost = typeof globalThis & {\n structuredClone?: <T>(value: T) => T;\n};\n\nfunction defaultCloneDocument<TDocument>(document: TDocument): TDocument {\n const structuredCloneFn = (globalThis as StructuredCloneHost).structuredClone;\n if (typeof structuredCloneFn === 'function') return structuredCloneFn(document);\n return JSON.parse(JSON.stringify(document)) as TDocument;\n}\n\nfunction defaultCompareDocuments<TDocument>(left: TDocument, right: TDocument): boolean {\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\nfunction normalizeSelection(selection?: Partial<EditorSelectionState>): EditorSelectionState {\n const selectedIds = uniqueIds(selection?.selectedIds ?? []);\n const activeId = selection?.activeId && selectedIds.includes(selection.activeId)\n ? selection.activeId\n : selectedIds[selectedIds.length - 1] ?? null;\n return {\n selectedIds,\n activeId,\n };\n}\n\nfunction uniqueIds(ids: readonly string[]): string[] {\n const result: string[] = [];\n const seen = new Set<string>();\n for (const id of ids) {\n if (!id || seen.has(id)) continue;\n seen.add(id);\n result.push(id);\n }\n return result;\n}\n\nfunction selectionEquals(left: EditorSelectionState, right: EditorSelectionState): boolean {\n if (left.activeId !== right.activeId) return false;\n if (left.selectedIds.length !== right.selectedIds.length) return false;\n return left.selectedIds.every((id, index) => right.selectedIds[index] === id);\n}\n\nfunction applySelectionCommand(\n selection: EditorSelectionState,\n command: SelectionCommand,\n): EditorSelectionState {\n if (command.type === 'selection.clear') return normalizeSelection();\n\n if (command.type === 'selection.replace') {\n return normalizeSelection({\n selectedIds: command.selectedIds,\n activeId: command.activeId,\n });\n }\n\n if (command.type === 'selection.add') {\n const selectedIds = uniqueIds([...selection.selectedIds, ...command.selectedIds]);\n return normalizeSelection({\n selectedIds,\n activeId: command.activeId ?? command.selectedIds[command.selectedIds.length - 1] ?? selection.activeId,\n });\n }\n\n if (command.type === 'selection.remove') {\n const removeIds = new Set(command.selectedIds);\n const selectedIds = selection.selectedIds.filter(id => !removeIds.has(id));\n return normalizeSelection({\n selectedIds,\n activeId: selection.activeId && selectedIds.includes(selection.activeId)\n ? selection.activeId\n : selectedIds[selectedIds.length - 1] ?? null,\n });\n }\n\n const selectedIds = [...selection.selectedIds];\n let activeId = selection.activeId;\n for (const id of command.selectedIds) {\n const index = selectedIds.indexOf(id);\n if (index >= 0) {\n selectedIds.splice(index, 1);\n if (activeId === id) activeId = selectedIds[selectedIds.length - 1] ?? null;\n } else if (id) {\n selectedIds.push(id);\n activeId = id;\n }\n }\n return normalizeSelection({\n selectedIds,\n activeId: command.activeId ?? activeId,\n });\n}\n\nexport class EditorSession<TDocument, TPatch = unknown> {\n private source?: AuthoringSourceDescriptor;\n private persistedDocument: TDocument;\n private workingDocument: TDocument;\n private selection: EditorSelectionState;\n private dirty: boolean;\n private readonly onChange?: (change: EditorSessionChange) => void;\n private readonly onChangeError?: (error: unknown) => void;\n private readonly cloneDocument: (document: TDocument) => TDocument;\n private readonly compareDocuments: (left: TDocument, right: TDocument) => boolean;\n private readonly reduceDocument?: (\n document: TDocument,\n command: DocumentCommand<TDocument, TPatch>,\n ) => TDocument;\n private undoStack: UndoTransaction<TDocument>[] = [];\n private redoStack: UndoTransaction<TDocument>[] = [];\n private nextTransactionId = 1;\n\n constructor(options: EditorSessionOptions<TDocument, TPatch>) {\n this.cloneDocument = options.cloneDocument ?? defaultCloneDocument;\n this.compareDocuments = options.compareDocuments ?? defaultCompareDocuments;\n this.reduceDocument = options.reduceDocument;\n this.source = cloneAuthoringSourceDescriptorOptional(options.source);\n this.persistedDocument = this.cloneDocument(options.persistedDocument);\n this.workingDocument = this.cloneDocument(options.workingDocument ?? options.persistedDocument);\n this.selection = normalizeSelection(options.selection);\n this.onChange = options.onChange;\n this.onChangeError = options.onChangeError;\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n }\n\n getState(options: EditorSessionStateOptions = {}): EditorSessionState<TDocument> {\n const cloneDocuments = options.cloneDocuments !== false;\n return {\n persistedDocument: cloneDocuments ? this.cloneDocument(this.persistedDocument) : this.persistedDocument,\n workingDocument: cloneDocuments ? this.cloneDocument(this.workingDocument) : this.workingDocument,\n source: cloneAuthoringSourceDescriptorOptional(this.source),\n selection: this.getSelection(),\n dirty: this.dirty,\n canUndo: this.canUndo(),\n canRedo: this.canRedo(),\n history: this.getHistoryView(),\n };\n }\n\n getWorkingDocument(): TDocument {\n return this.cloneDocument(this.workingDocument);\n }\n\n getSource(): AuthoringSourceDescriptor | undefined {\n return cloneAuthoringSourceDescriptorOptional(this.source);\n }\n\n getSelection(): EditorSelectionState {\n return {\n selectedIds: [...this.selection.selectedIds],\n activeId: this.selection.activeId,\n };\n }\n\n isDirty(): boolean {\n return this.dirty;\n }\n\n canUndo(): boolean {\n return this.undoStack.length > 0;\n }\n\n canRedo(): boolean {\n return this.redoStack.length > 0;\n }\n\n dispatch(\n command: EditorCommand<TDocument, TPatch>,\n options: EditorSessionDispatchOptions = {},\n ): EditorSessionDispatchResult<TDocument> {\n const beforeSelection = this.selection;\n if (isSelectionCommand(command)) {\n this.selection = applySelectionCommand(this.selection, command);\n const selectionChanged = !selectionEquals(beforeSelection, this.selection);\n this.emitChange('selection', false, selectionChanged, false);\n return {\n command,\n workingDocument: this.workingDocument,\n selection: this.getSelection(),\n dirty: this.dirty,\n documentChanged: false,\n selectionChanged,\n };\n }\n\n const useFastDocumentPatch = command.type === 'document.patch' && options.assumeDocumentChanged === true;\n const beforeDocument = useFastDocumentPatch ? this.workingDocument : this.cloneDocument(this.workingDocument);\n if (command.type === 'document.replace') {\n this.workingDocument = this.cloneDocument(command.document);\n } else if (command.type === 'document.patch') {\n if (!this.reduceDocument) {\n throw new Error('EditorSession requires reduceDocument to handle document.patch commands.');\n }\n this.workingDocument = this.reduceDocument(\n options.clonePatchInput === false ? this.workingDocument : this.cloneDocument(this.workingDocument),\n command,\n );\n }\n const documentChanged = options.assumeDocumentChanged === true\n ? true\n : !this.compareDocuments(beforeDocument, this.workingDocument);\n const selectionChanged = !selectionEquals(beforeSelection, this.selection);\n if (documentChanged) {\n this.dirty = options.assumeDirty === true\n ? true\n : !this.compareDocuments(this.workingDocument, this.persistedDocument);\n }\n const transaction = documentChanged && isDocumentCommand(command)\n ? this.pushTransaction(command, beforeDocument, this.workingDocument, options)\n : undefined;\n this.emitChange('document', documentChanged, selectionChanged, !!transaction);\n return {\n command,\n workingDocument: options.cloneResultDocument === false\n ? this.workingDocument\n : this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged,\n selectionChanged,\n transaction,\n };\n }\n\n undo(): EditorSessionHistoryResult<TDocument> | null {\n const transaction = this.undoStack.pop();\n if (!transaction) return null;\n this.redoStack.push(transaction);\n this.workingDocument = this.cloneDocument(transaction.beforeDocument);\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.emitChange('history', true, false, true);\n return {\n transaction,\n workingDocument: this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged: true,\n };\n }\n\n redo(): EditorSessionHistoryResult<TDocument> | null {\n const transaction = this.redoStack.pop();\n if (!transaction) return null;\n this.undoStack.push(transaction);\n this.workingDocument = this.cloneDocument(transaction.afterDocument);\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.emitChange('history', true, false, true);\n return {\n transaction,\n workingDocument: this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged: true,\n };\n }\n\n markSaved(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument> {\n if (source) this.source = cloneAuthoringSourceDescriptorOptional(source);\n this.persistedDocument = this.cloneDocument(document);\n this.workingDocument = this.cloneDocument(document);\n this.dirty = false;\n this.emitChange('saved', true, false, false);\n return this.getState();\n }\n\n reset(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument> {\n this.source = cloneAuthoringSourceDescriptorOptional(source);\n this.persistedDocument = this.cloneDocument(document);\n this.workingDocument = this.cloneDocument(document);\n this.selection = normalizeSelection();\n this.dirty = false;\n this.undoStack = [];\n this.redoStack = [];\n this.emitChange('reset', true, true, true);\n return this.getState();\n }\n\n rebaseExternalDocuments(\n input: EditorSessionExternalRebaseInput<TDocument>,\n ): EditorSessionState<TDocument> {\n this.persistedDocument = this.cloneDocument(input.persistedDocument);\n this.workingDocument = this.cloneDocument(input.workingDocument);\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.undoStack = [];\n this.redoStack = [];\n this.emitChange('rebase', true, false, true);\n return this.getState();\n }\n\n private emitChange(\n reason: EditorSessionChange['reason'],\n documentChanged: boolean,\n selectionChanged: boolean,\n historyChanged: boolean,\n ): void {\n try {\n this.onChange?.(Object.freeze({\n reason,\n dirty: this.dirty,\n documentChanged,\n selectionChanged,\n historyChanged,\n }));\n } catch (error) {\n try { this.onChangeError?.(error); }\n catch { /* Session observers cannot change an already-applied command. */ }\n }\n }\n\n private pushTransaction(\n command: DocumentCommand<TDocument, TPatch>,\n beforeDocument: TDocument,\n afterDocument: TDocument,\n options: EditorSessionDispatchOptions,\n ): UndoTransaction<TDocument> {\n const previous = options.mergeWithPrevious ? this.undoStack[this.undoStack.length - 1] : undefined;\n if (previous) {\n previous.afterDocument = this.cloneDocument(afterDocument);\n previous.projectionImpact = mergeProjectionImpact(previous.projectionImpact, command.projectionImpact);\n this.redoStack = [];\n return {\n ...previous,\n beforeDocument: this.cloneDocument(previous.beforeDocument),\n afterDocument: this.cloneDocument(previous.afterDocument),\n projectionImpact: cloneProjectionImpact(previous.projectionImpact),\n };\n }\n const transaction: UndoTransaction<TDocument> = {\n id: `transaction_${this.nextTransactionId++}`,\n label: command.label ?? command.type,\n commandType: command.type,\n beforeDocument: this.cloneDocument(beforeDocument),\n afterDocument: this.cloneDocument(afterDocument),\n ...(command.projectionImpact ? { projectionImpact: cloneProjectionImpact(command.projectionImpact) } : {}),\n createdAt: Date.now(),\n };\n this.undoStack.push(transaction);\n this.redoStack = [];\n return transaction;\n }\n\n private getHistoryView(): EditorSessionHistoryView {\n return {\n entries: [...this.undoStack, ...this.redoStack]\n .map(toHistoryEntry)\n .sort((left, right) => right.createdAt - left.createdAt),\n };\n }\n}\n\nfunction cloneProjectionImpact(\n impact: EditorProjectionImpact | undefined,\n): EditorProjectionImpact | undefined {\n if (!impact) return undefined;\n if (impact.type === 'rebuild') {\n return {\n type: 'rebuild',\n ...(impact.reason ? { reason: impact.reason } : {}),\n };\n }\n return {\n type: 'incremental',\n ...(impact.syncTransformIds ? { syncTransformIds: [...impact.syncTransformIds] } : {}),\n ...(impact.reprojectIds ? { reprojectIds: [...impact.reprojectIds] } : {}),\n ...(impact.createdNodeIds ? { createdNodeIds: [...impact.createdNodeIds] } : {}),\n ...(impact.deletedNodeIds ? { deletedNodeIds: [...impact.deletedNodeIds] } : {}),\n };\n}\n\nfunction mergeProjectionImpact(\n previous: EditorProjectionImpact | undefined,\n next: EditorProjectionImpact | undefined,\n): EditorProjectionImpact | undefined {\n if (!previous || !next) return undefined;\n if (previous.type === 'rebuild' || next.type === 'rebuild') {\n const reason = previous.type === 'rebuild'\n ? previous.reason\n : next.type === 'rebuild'\n ? next.reason\n : undefined;\n return {\n type: 'rebuild',\n ...(reason ? { reason } : {}),\n };\n }\n return {\n type: 'incremental',\n syncTransformIds: uniqueIds([\n ...(previous.syncTransformIds ?? []),\n ...(next.syncTransformIds ?? []),\n ]),\n reprojectIds: uniqueIds([\n ...(previous.reprojectIds ?? []),\n ...(next.reprojectIds ?? []),\n ]),\n createdNodeIds: uniqueIds([\n ...(previous.createdNodeIds ?? []),\n ...(next.createdNodeIds ?? []),\n ]),\n deletedNodeIds: uniqueIds([\n ...(previous.deletedNodeIds ?? []),\n ...(next.deletedNodeIds ?? []),\n ]),\n };\n}\n\nfunction toHistoryEntry<TDocument>(\n transaction: UndoTransaction<TDocument>,\n): EditorSessionHistoryEntry {\n return {\n id: transaction.id,\n label: transaction.label,\n commandType: transaction.commandType,\n createdAt: transaction.createdAt,\n };\n}\n\nfunction cloneAuthoringSourceDescriptorOptional(\n source: AuthoringSourceDescriptor | undefined,\n): AuthoringSourceDescriptor | undefined {\n if (!source) return undefined;\n return {\n ...source,\n ref: { ...source.ref },\n capabilities: source.capabilities ? { ...source.capabilities } : undefined,\n metadata: source.metadata ? { ...source.metadata } : undefined,\n };\n}\n\nfunction isDocumentCommand<TDocument, TPatch>(\n command: EditorCommand<TDocument, TPatch>,\n): command is DocumentCommand<TDocument, TPatch> {\n return command.type === 'document.patch' || command.type === 'document.replace';\n}\n\nfunction isSelectionCommand<TDocument, TPatch>(\n command: EditorCommand<TDocument, TPatch>,\n): command is SelectionCommand {\n return command.type === 'selection.replace'\n || command.type === 'selection.add'\n || command.type === 'selection.remove'\n || command.type === 'selection.toggle'\n || command.type === 'selection.clear';\n}\n\nexport function createEditorSession<TDocument>(\n options: EditorSessionOptions<TDocument>,\n): EditorSession<TDocument>;\nexport function createEditorSession<TDocument, TPatch>(\n options: EditorSessionOptions<TDocument, TPatch>,\n): EditorSession<TDocument, TPatch>;\nexport function createEditorSession<TDocument, TPatch = unknown>(\n options: EditorSessionOptions<TDocument, TPatch>,\n): EditorSession<TDocument, TPatch> {\n return new EditorSession(options);\n}\n"]}
1
+ {"version":3,"file":"editor-session.js","sourceRoot":"","sources":["../src/editor-session.ts"],"names":[],"mappings":"AAyLA,SAAS,oBAAoB,CAAY,QAAmB;IAC1D,MAAM,iBAAiB,GAAI,UAAkC,CAAC,eAAe,CAAC;IAC9E,IAAI,OAAO,iBAAiB,KAAK,UAAU;QAAE,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChF,OAAO,IAAI,CAAC,K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,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE;QACtB,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1E,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;KAC/D,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,OAAyC;IAEzC,OAAO,OAAO,CAAC,IAAI,KAAK,gBAAgB,IAAI,OAAO,CAAC,IAAI,KAAK,kBAAkB,CAAC;AAClF,CAAC;AAED,SAAS,kBAAkB,CACzB,OAAyC;IAEzC,OAAO,OAAO,CAAC,IAAI,KAAK,mBAAmB;WACtC,OAAO,CAAC,IAAI,KAAK,eAAe;WAChC,OAAO,CAAC,IAAI,KAAK,kBAAkB;WACnC,OAAO,CAAC,IAAI,KAAK,kBAAkB;WACnC,OAAO,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAC1C,CAAC;AAQD,MAAM,UAAU,mBAAmB,CACjC,OAAgD;IAEhD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { AuthoringSourceDescriptor } from './authoring-source';\n\nexport interface EditorSelectionState {\n selectedIds: string[];\n activeId: string | null;\n}\n\nexport interface EditorCommandBase {\n type: string;\n label?: string;\n projectionImpact?: EditorProjectionImpact;\n}\n\nexport interface DocumentPatchCommand<TPatch = unknown> extends EditorCommandBase {\n type: 'document.patch';\n patch: TPatch;\n targetId?: string;\n propertyPath?: string;\n}\n\nexport interface DocumentReplaceCommand<TDocument> extends EditorCommandBase {\n type: 'document.replace';\n document: TDocument;\n}\n\nexport type DocumentCommand<TDocument = unknown, TPatch = unknown> =\n | DocumentPatchCommand<TPatch>\n | DocumentReplaceCommand<TDocument>;\n\nexport interface SelectionReplaceCommand extends EditorCommandBase {\n type: 'selection.replace';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionAddCommand extends EditorCommandBase {\n type: 'selection.add';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionRemoveCommand extends EditorCommandBase {\n type: 'selection.remove';\n selectedIds: string[];\n}\n\nexport interface SelectionToggleCommand extends EditorCommandBase {\n type: 'selection.toggle';\n selectedIds: string[];\n activeId?: string | null;\n}\n\nexport interface SelectionClearCommand extends EditorCommandBase {\n type: 'selection.clear';\n}\n\nexport type SelectionCommand =\n | SelectionReplaceCommand\n | SelectionAddCommand\n | SelectionRemoveCommand\n | SelectionToggleCommand\n | SelectionClearCommand;\n\nexport type EditorCommand<TDocument = unknown, TPatch = unknown> =\n | DocumentCommand<TDocument, TPatch>\n | SelectionCommand;\n\nexport interface EditorSessionState<TDocument> {\n persistedDocument: TDocument;\n workingDocument: TDocument;\n source?: AuthoringSourceDescriptor;\n selection: EditorSelectionState;\n dirty: boolean;\n canUndo: boolean;\n canRedo: boolean;\n history: EditorSessionHistoryView;\n documentRevision: number;\n}\n\nexport interface EditorSessionChange {\n readonly reason: 'selection' | 'document' | 'history' | 'saved' | 'reset' | 'rebase';\n readonly dirty: boolean;\n readonly documentChanged: boolean;\n readonly selectionChanged: boolean;\n readonly historyChanged: boolean;\n readonly documentRevision: number;\n}\n\nexport interface EditorSessionExternalRebaseInput<TDocument> {\n persistedDocument: TDocument;\n workingDocument: TDocument;\n}\n\nexport interface EditorSessionDispatchResult<TDocument> {\n command: EditorCommand;\n workingDocument: TDocument;\n selection: EditorSelectionState;\n dirty: boolean;\n documentChanged: boolean;\n selectionChanged: boolean;\n transaction?: UndoTransaction<TDocument>;\n}\n\nexport interface EditorSessionDispatchOptions {\n mergeWithPrevious?: boolean;\n assumeDocumentChanged?: boolean;\n assumeDirty?: boolean;\n clonePatchInput?: boolean;\n cloneResultDocument?: boolean;\n}\n\nexport interface EditorSessionStateOptions {\n /**\n * Defaults to true to preserve the historical snapshot semantics.\n * Performance-sensitive editor UI code can pass false when it treats\n * documents as read-only during render.\n */\n cloneDocuments?: boolean;\n}\n\nexport interface EditorSessionOptions<TDocument, TPatch = unknown> {\n source?: AuthoringSourceDescriptor;\n persistedDocument: TDocument;\n workingDocument?: TDocument;\n selection?: Partial<EditorSelectionState>;\n onChange?(change: EditorSessionChange): void;\n onChangeError?(error: unknown): void;\n cloneDocument?: (document: TDocument) => TDocument;\n compareDocuments?: (left: TDocument, right: TDocument) => boolean;\n reduceDocument?: (\n document: TDocument,\n command: DocumentCommand<TDocument, TPatch>,\n ) => TDocument;\n}\n\nexport interface UndoTransaction<TDocument> {\n id: string;\n label: string;\n commandType: string;\n beforeDocument: TDocument;\n afterDocument: TDocument;\n projectionImpact?: EditorProjectionImpact;\n createdAt: number;\n}\n\nexport type EditorProjectionImpact =\n | EditorProjectionIncrementalImpact\n | EditorProjectionRebuildImpact;\n\nexport interface EditorProjectionIncrementalImpact {\n type: 'incremental';\n syncTransformIds?: string[];\n reprojectIds?: string[];\n createdNodeIds?: string[];\n deletedNodeIds?: string[];\n}\n\nexport interface EditorProjectionRebuildImpact {\n type: 'rebuild';\n reason?: string;\n}\n\nexport interface EditorSessionHistoryEntry {\n id: string;\n label: string;\n commandType: string;\n createdAt: number;\n}\n\nexport interface EditorSessionHistoryView {\n entries: EditorSessionHistoryEntry[];\n}\n\nexport interface EditorSessionHistoryResult<TDocument> {\n transaction: UndoTransaction<TDocument>;\n workingDocument: TDocument;\n selection: EditorSelectionState;\n dirty: boolean;\n documentChanged: true;\n}\n\ntype StructuredCloneHost = typeof globalThis & {\n structuredClone?: <T>(value: T) => T;\n};\n\nfunction defaultCloneDocument<TDocument>(document: TDocument): TDocument {\n const structuredCloneFn = (globalThis as StructuredCloneHost).structuredClone;\n if (typeof structuredCloneFn === 'function') return structuredCloneFn(document);\n return JSON.parse(JSON.stringify(document)) as TDocument;\n}\n\nfunction defaultCompareDocuments<TDocument>(left: TDocument, right: TDocument): boolean {\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\nfunction normalizeSelection(selection?: Partial<EditorSelectionState>): EditorSelectionState {\n const selectedIds = uniqueIds(selection?.selectedIds ?? []);\n const activeId = selection?.activeId && selectedIds.includes(selection.activeId)\n ? selection.activeId\n : selectedIds[selectedIds.length - 1] ?? null;\n return {\n selectedIds,\n activeId,\n };\n}\n\nfunction uniqueIds(ids: readonly string[]): string[] {\n const result: string[] = [];\n const seen = new Set<string>();\n for (const id of ids) {\n if (!id || seen.has(id)) continue;\n seen.add(id);\n result.push(id);\n }\n return result;\n}\n\nfunction selectionEquals(left: EditorSelectionState, right: EditorSelectionState): boolean {\n if (left.activeId !== right.activeId) return false;\n if (left.selectedIds.length !== right.selectedIds.length) return false;\n return left.selectedIds.every((id, index) => right.selectedIds[index] === id);\n}\n\nfunction applySelectionCommand(\n selection: EditorSelectionState,\n command: SelectionCommand,\n): EditorSelectionState {\n if (command.type === 'selection.clear') return normalizeSelection();\n\n if (command.type === 'selection.replace') {\n return normalizeSelection({\n selectedIds: command.selectedIds,\n activeId: command.activeId,\n });\n }\n\n if (command.type === 'selection.add') {\n const selectedIds = uniqueIds([...selection.selectedIds, ...command.selectedIds]);\n return normalizeSelection({\n selectedIds,\n activeId: command.activeId ?? command.selectedIds[command.selectedIds.length - 1] ?? selection.activeId,\n });\n }\n\n if (command.type === 'selection.remove') {\n const removeIds = new Set(command.selectedIds);\n const selectedIds = selection.selectedIds.filter(id => !removeIds.has(id));\n return normalizeSelection({\n selectedIds,\n activeId: selection.activeId && selectedIds.includes(selection.activeId)\n ? selection.activeId\n : selectedIds[selectedIds.length - 1] ?? null,\n });\n }\n\n const selectedIds = [...selection.selectedIds];\n let activeId = selection.activeId;\n for (const id of command.selectedIds) {\n const index = selectedIds.indexOf(id);\n if (index >= 0) {\n selectedIds.splice(index, 1);\n if (activeId === id) activeId = selectedIds[selectedIds.length - 1] ?? null;\n } else if (id) {\n selectedIds.push(id);\n activeId = id;\n }\n }\n return normalizeSelection({\n selectedIds,\n activeId: command.activeId ?? activeId,\n });\n}\n\nexport class EditorSession<TDocument, TPatch = unknown> {\n private source?: AuthoringSourceDescriptor;\n private persistedDocument: TDocument;\n private workingDocument: TDocument;\n private selection: EditorSelectionState;\n private dirty: boolean;\n private readonly onChange?: (change: EditorSessionChange) => void;\n private readonly onChangeError?: (error: unknown) => void;\n private readonly cloneDocument: (document: TDocument) => TDocument;\n private readonly compareDocuments: (left: TDocument, right: TDocument) => boolean;\n private readonly reduceDocument?: (\n document: TDocument,\n command: DocumentCommand<TDocument, TPatch>,\n ) => TDocument;\n private undoStack: UndoTransaction<TDocument>[] = [];\n private redoStack: UndoTransaction<TDocument>[] = [];\n private nextTransactionId = 1;\n private documentRevision = 0;\n\n constructor(options: EditorSessionOptions<TDocument, TPatch>) {\n this.cloneDocument = options.cloneDocument ?? defaultCloneDocument;\n this.compareDocuments = options.compareDocuments ?? defaultCompareDocuments;\n this.reduceDocument = options.reduceDocument;\n this.source = cloneAuthoringSourceDescriptorOptional(options.source);\n this.persistedDocument = this.cloneDocument(options.persistedDocument);\n this.workingDocument = this.cloneDocument(options.workingDocument ?? options.persistedDocument);\n this.selection = normalizeSelection(options.selection);\n this.onChange = options.onChange;\n this.onChangeError = options.onChangeError;\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n }\n\n getState(options: EditorSessionStateOptions = {}): EditorSessionState<TDocument> {\n const cloneDocuments = options.cloneDocuments !== false;\n return {\n persistedDocument: cloneDocuments ? this.cloneDocument(this.persistedDocument) : this.persistedDocument,\n workingDocument: cloneDocuments ? this.cloneDocument(this.workingDocument) : this.workingDocument,\n source: cloneAuthoringSourceDescriptorOptional(this.source),\n selection: this.getSelection(),\n dirty: this.dirty,\n canUndo: this.canUndo(),\n canRedo: this.canRedo(),\n history: this.getHistoryView(),\n documentRevision: this.documentRevision,\n };\n }\n\n getWorkingDocument(): TDocument {\n return this.cloneDocument(this.workingDocument);\n }\n\n getSource(): AuthoringSourceDescriptor | undefined {\n return cloneAuthoringSourceDescriptorOptional(this.source);\n }\n\n getSelection(): EditorSelectionState {\n return {\n selectedIds: [...this.selection.selectedIds],\n activeId: this.selection.activeId,\n };\n }\n\n isDirty(): boolean {\n return this.dirty;\n }\n\n canUndo(): boolean {\n return this.undoStack.length > 0;\n }\n\n canRedo(): boolean {\n return this.redoStack.length > 0;\n }\n\n dispatch(\n command: EditorCommand<TDocument, TPatch>,\n options: EditorSessionDispatchOptions = {},\n ): EditorSessionDispatchResult<TDocument> {\n const beforeSelection = this.selection;\n if (isSelectionCommand(command)) {\n this.selection = applySelectionCommand(this.selection, command);\n const selectionChanged = !selectionEquals(beforeSelection, this.selection);\n this.emitChange('selection', false, selectionChanged, false);\n return {\n command,\n workingDocument: this.workingDocument,\n selection: this.getSelection(),\n dirty: this.dirty,\n documentChanged: false,\n selectionChanged,\n };\n }\n\n const useFastDocumentPatch = command.type === 'document.patch' && options.assumeDocumentChanged === true;\n const beforeDocument = useFastDocumentPatch ? this.workingDocument : this.cloneDocument(this.workingDocument);\n if (command.type === 'document.replace') {\n this.workingDocument = this.cloneDocument(command.document);\n } else if (command.type === 'document.patch') {\n if (!this.reduceDocument) {\n throw new Error('EditorSession requires reduceDocument to handle document.patch commands.');\n }\n this.workingDocument = this.reduceDocument(\n options.clonePatchInput === false ? this.workingDocument : this.cloneDocument(this.workingDocument),\n command,\n );\n }\n const documentChanged = options.assumeDocumentChanged === true\n ? true\n : !this.compareDocuments(beforeDocument, this.workingDocument);\n const selectionChanged = !selectionEquals(beforeSelection, this.selection);\n if (documentChanged) {\n this.documentRevision += 1;\n this.dirty = options.assumeDirty === true\n ? true\n : !this.compareDocuments(this.workingDocument, this.persistedDocument);\n }\n const transaction = documentChanged && isDocumentCommand(command)\n ? this.pushTransaction(command, beforeDocument, this.workingDocument, options)\n : undefined;\n this.emitChange('document', documentChanged, selectionChanged, !!transaction);\n return {\n command,\n workingDocument: options.cloneResultDocument === false\n ? this.workingDocument\n : this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged,\n selectionChanged,\n transaction,\n };\n }\n\n undo(): EditorSessionHistoryResult<TDocument> | null {\n const transaction = this.undoStack.pop();\n if (!transaction) return null;\n this.redoStack.push(transaction);\n this.workingDocument = this.cloneDocument(transaction.beforeDocument);\n this.documentRevision += 1;\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.emitChange('history', true, false, true);\n return {\n transaction,\n workingDocument: this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged: true,\n };\n }\n\n redo(): EditorSessionHistoryResult<TDocument> | null {\n const transaction = this.redoStack.pop();\n if (!transaction) return null;\n this.undoStack.push(transaction);\n this.workingDocument = this.cloneDocument(transaction.afterDocument);\n this.documentRevision += 1;\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.emitChange('history', true, false, true);\n return {\n transaction,\n workingDocument: this.cloneDocument(this.workingDocument),\n selection: this.getSelection(),\n dirty: this.isDirty(),\n documentChanged: true,\n };\n }\n\n markSaved(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument> {\n if (source) this.source = cloneAuthoringSourceDescriptorOptional(source);\n this.persistedDocument = this.cloneDocument(document);\n this.workingDocument = this.cloneDocument(document);\n this.documentRevision += 1;\n this.dirty = false;\n this.emitChange('saved', true, false, false);\n return this.getState();\n }\n\n reset(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument> {\n this.source = cloneAuthoringSourceDescriptorOptional(source);\n this.persistedDocument = this.cloneDocument(document);\n this.workingDocument = this.cloneDocument(document);\n this.documentRevision += 1;\n this.selection = normalizeSelection();\n this.dirty = false;\n this.undoStack = [];\n this.redoStack = [];\n this.emitChange('reset', true, true, true);\n return this.getState();\n }\n\n rebaseExternalDocuments(\n input: EditorSessionExternalRebaseInput<TDocument>,\n ): EditorSessionState<TDocument> {\n this.persistedDocument = this.cloneDocument(input.persistedDocument);\n this.workingDocument = this.cloneDocument(input.workingDocument);\n this.documentRevision += 1;\n this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);\n this.undoStack = [];\n this.redoStack = [];\n this.emitChange('rebase', true, false, true);\n return this.getState();\n }\n\n private emitChange(\n reason: EditorSessionChange['reason'],\n documentChanged: boolean,\n selectionChanged: boolean,\n historyChanged: boolean,\n ): void {\n try {\n this.onChange?.(Object.freeze({\n reason,\n dirty: this.dirty,\n documentChanged,\n selectionChanged,\n historyChanged,\n documentRevision: this.documentRevision,\n }));\n } catch (error) {\n try { this.onChangeError?.(error); }\n catch { /* Session observers cannot change an already-applied command. */ }\n }\n }\n\n private pushTransaction(\n command: DocumentCommand<TDocument, TPatch>,\n beforeDocument: TDocument,\n afterDocument: TDocument,\n options: EditorSessionDispatchOptions,\n ): UndoTransaction<TDocument> {\n const previous = options.mergeWithPrevious ? this.undoStack[this.undoStack.length - 1] : undefined;\n if (previous) {\n previous.afterDocument = this.cloneDocument(afterDocument);\n previous.projectionImpact = mergeProjectionImpact(previous.projectionImpact, command.projectionImpact);\n this.redoStack = [];\n return {\n ...previous,\n beforeDocument: this.cloneDocument(previous.beforeDocument),\n afterDocument: this.cloneDocument(previous.afterDocument),\n projectionImpact: cloneProjectionImpact(previous.projectionImpact),\n };\n }\n const transaction: UndoTransaction<TDocument> = {\n id: `transaction_${this.nextTransactionId++}`,\n label: command.label ?? command.type,\n commandType: command.type,\n beforeDocument: this.cloneDocument(beforeDocument),\n afterDocument: this.cloneDocument(afterDocument),\n ...(command.projectionImpact ? { projectionImpact: cloneProjectionImpact(command.projectionImpact) } : {}),\n createdAt: Date.now(),\n };\n this.undoStack.push(transaction);\n this.redoStack = [];\n return transaction;\n }\n\n private getHistoryView(): EditorSessionHistoryView {\n return {\n entries: [...this.undoStack, ...this.redoStack]\n .map(toHistoryEntry)\n .sort((left, right) => right.createdAt - left.createdAt),\n };\n }\n}\n\nfunction cloneProjectionImpact(\n impact: EditorProjectionImpact | undefined,\n): EditorProjectionImpact | undefined {\n if (!impact) return undefined;\n if (impact.type === 'rebuild') {\n return {\n type: 'rebuild',\n ...(impact.reason ? { reason: impact.reason } : {}),\n };\n }\n return {\n type: 'incremental',\n ...(impact.syncTransformIds ? { syncTransformIds: [...impact.syncTransformIds] } : {}),\n ...(impact.reprojectIds ? { reprojectIds: [...impact.reprojectIds] } : {}),\n ...(impact.createdNodeIds ? { createdNodeIds: [...impact.createdNodeIds] } : {}),\n ...(impact.deletedNodeIds ? { deletedNodeIds: [...impact.deletedNodeIds] } : {}),\n };\n}\n\nfunction mergeProjectionImpact(\n previous: EditorProjectionImpact | undefined,\n next: EditorProjectionImpact | undefined,\n): EditorProjectionImpact | undefined {\n if (!previous || !next) return undefined;\n if (previous.type === 'rebuild' || next.type === 'rebuild') {\n const reason = previous.type === 'rebuild'\n ? previous.reason\n : next.type === 'rebuild'\n ? next.reason\n : undefined;\n return {\n type: 'rebuild',\n ...(reason ? { reason } : {}),\n };\n }\n return {\n type: 'incremental',\n syncTransformIds: uniqueIds([\n ...(previous.syncTransformIds ?? []),\n ...(next.syncTransformIds ?? []),\n ]),\n reprojectIds: uniqueIds([\n ...(previous.reprojectIds ?? []),\n ...(next.reprojectIds ?? []),\n ]),\n createdNodeIds: uniqueIds([\n ...(previous.createdNodeIds ?? []),\n ...(next.createdNodeIds ?? []),\n ]),\n deletedNodeIds: uniqueIds([\n ...(previous.deletedNodeIds ?? []),\n ...(next.deletedNodeIds ?? []),\n ]),\n };\n}\n\nfunction toHistoryEntry<TDocument>(\n transaction: UndoTransaction<TDocument>,\n): EditorSessionHistoryEntry {\n return {\n id: transaction.id,\n label: transaction.label,\n commandType: transaction.commandType,\n createdAt: transaction.createdAt,\n };\n}\n\nfunction cloneAuthoringSourceDescriptorOptional(\n source: AuthoringSourceDescriptor | undefined,\n): AuthoringSourceDescriptor | undefined {\n if (!source) return undefined;\n return {\n ...source,\n ref: { ...source.ref },\n capabilities: source.capabilities ? { ...source.capabilities } : undefined,\n metadata: source.metadata ? { ...source.metadata } : undefined,\n };\n}\n\nfunction isDocumentCommand<TDocument, TPatch>(\n command: EditorCommand<TDocument, TPatch>,\n): command is DocumentCommand<TDocument, TPatch> {\n return command.type === 'document.patch' || command.type === 'document.replace';\n}\n\nfunction isSelectionCommand<TDocument, TPatch>(\n command: EditorCommand<TDocument, TPatch>,\n): command is SelectionCommand {\n return command.type === 'selection.replace'\n || command.type === 'selection.add'\n || command.type === 'selection.remove'\n || command.type === 'selection.toggle'\n || command.type === 'selection.clear';\n}\n\nexport function createEditorSession<TDocument>(\n options: EditorSessionOptions<TDocument>,\n): EditorSession<TDocument>;\nexport function createEditorSession<TDocument, TPatch>(\n options: EditorSessionOptions<TDocument, TPatch>,\n): EditorSession<TDocument, TPatch>;\nexport function createEditorSession<TDocument, TPatch = unknown>(\n options: EditorSessionOptions<TDocument, TPatch>,\n): EditorSession<TDocument, TPatch> {\n return new EditorSession(options);\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-core",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Core runtime shell and adapter contracts for fps-game-editor.",
@@ -30,10 +30,10 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@fps-games/plugin-api": "0.2.0-beta.3",
34
- "@fps-games/plugin-host": "0.2.0-beta.3",
35
- "@fps-games/playable-contracts": "0.2.0-beta.3",
36
- "@fps-games/playable-scene": "0.2.0-beta.3",
37
- "@fps-games/editor-protocol": "0.2.0-beta.3"
33
+ "@fps-games/plugin-api": "0.2.0-beta.4",
34
+ "@fps-games/plugin-host": "0.2.0-beta.4",
35
+ "@fps-games/playable-contracts": "0.2.0-beta.4",
36
+ "@fps-games/playable-scene": "0.2.0-beta.4",
37
+ "@fps-games/editor-protocol": "0.2.0-beta.4"
38
38
  }
39
39
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-forge-play",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Forge Play bridge adapter for fps-game-editor.",
@@ -14,6 +14,6 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/editor-protocol": "0.2.0-beta.3"
17
+ "@fps-games/editor-protocol": "0.2.0-beta.4"
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-playable-sdk",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Playable project integration SDK for fps-game-editor.",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/parser": "^7.28.5",
30
- "@fps-games/editor-core": "0.2.0-beta.3",
31
- "@fps-games/editor-protocol": "0.2.0-beta.3",
32
- "@fps-games/playable-assets": "0.2.0-beta.3",
33
- "@fps-games/playable-rendering": "0.2.0-beta.3",
34
- "@fps-games/plugin-api": "0.2.0-beta.3"
30
+ "@fps-games/editor-core": "0.2.0-beta.4",
31
+ "@fps-games/editor-protocol": "0.2.0-beta.4",
32
+ "@fps-games/playable-assets": "0.2.0-beta.4",
33
+ "@fps-games/playable-rendering": "0.2.0-beta.4",
34
+ "@fps-games/plugin-api": "0.2.0-beta.4"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "vite": "^5.4.21"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-protocol",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Shared protocol types for fps-game-editor runtimes, adapters, and Forge Play bridges.",
@@ -14,6 +14,6 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/playable-contracts": "0.2.0-beta.3"
17
+ "@fps-games/playable-contracts": "0.2.0-beta.4"
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/editor-tooling",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Static Plugin manifest planning and tooling host for fps-game-editor.",
@@ -22,8 +22,8 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@fps-games/plugin-api": "0.2.0-beta.3",
26
- "@fps-games/plugin-host": "0.2.0-beta.3"
25
+ "@fps-games/plugin-api": "0.2.0-beta.4",
26
+ "@fps-games/plugin-host": "0.2.0-beta.4"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "vite": "^5.4.21"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-assets",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Environment-neutral asset identity and catalog domain logic.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-contracts",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Environment-neutral data contracts shared by fps-games runtime, renderer, and editor packages.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-rendering",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Environment-neutral rendering and shadow contracts and resolution logic.",
@@ -18,6 +18,6 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@fps-games/playable-contracts": "0.2.0-beta.3"
21
+ "@fps-games/playable-contracts": "0.2.0-beta.4"
22
22
  }
23
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-runtime",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Plugin-based runtime host for fps-games playable projects.",
@@ -14,16 +14,16 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/playable-contracts": "0.2.0-beta.3",
18
- "@fps-games/playable-rendering": "0.2.0-beta.3",
19
- "@fps-games/playable-runtime-data": "0.2.0-beta.3",
20
- "@fps-games/plugin-assets": "0.2.0-beta.3",
21
- "@fps-games/plugin-materials": "0.2.0-beta.3",
22
- "@fps-games/plugin-markers": "0.2.0-beta.3",
23
- "@fps-games/plugin-rendering": "0.2.0-beta.3",
24
- "@fps-games/plugin-shadows": "0.2.0-beta.3",
25
- "@fps-games/plugin-scene": "0.2.0-beta.3",
26
- "@fps-games/plugin-api": "0.2.0-beta.3",
27
- "@fps-games/plugin-host": "0.2.0-beta.3"
17
+ "@fps-games/playable-contracts": "0.2.0-beta.4",
18
+ "@fps-games/playable-rendering": "0.2.0-beta.4",
19
+ "@fps-games/playable-runtime-data": "0.2.0-beta.4",
20
+ "@fps-games/plugin-assets": "0.2.0-beta.4",
21
+ "@fps-games/plugin-materials": "0.2.0-beta.4",
22
+ "@fps-games/plugin-markers": "0.2.0-beta.4",
23
+ "@fps-games/plugin-rendering": "0.2.0-beta.4",
24
+ "@fps-games/plugin-shadows": "0.2.0-beta.4",
25
+ "@fps-games/plugin-scene": "0.2.0-beta.4",
26
+ "@fps-games/plugin-api": "0.2.0-beta.4",
27
+ "@fps-games/plugin-host": "0.2.0-beta.4"
28
28
  }
29
29
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-runtime-data",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Strict validation and immutable snapshots for fps-games Runtime Data.",
@@ -14,8 +14,8 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/playable-contracts": "0.2.0-beta.3",
18
- "@fps-games/playable-rendering": "0.2.0-beta.3",
19
- "@fps-games/plugin-api": "0.2.0-beta.3"
17
+ "@fps-games/playable-contracts": "0.2.0-beta.4",
18
+ "@fps-games/playable-rendering": "0.2.0-beta.4",
19
+ "@fps-games/plugin-api": "0.2.0-beta.4"
20
20
  }
21
21
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/playable-scene",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Environment-neutral scene graph and transform domain logic.",
@@ -14,6 +14,6 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/playable-contracts": "0.2.0-beta.3"
17
+ "@fps-games/playable-contracts": "0.2.0-beta.4"
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/plugin-api",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Environment-neutral contracts for fps-games plugins and hosts.",
@@ -1,2 +1,2 @@
1
- export declare const FPS_PLUGIN_VERSION: "0.2.0-beta.3";
1
+ export declare const FPS_PLUGIN_VERSION: "0.2.0-beta.4";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const FPS_PLUGIN_VERSION = '0.2.0-beta.3';
1
+ export const FPS_PLUGIN_VERSION = '0.2.0-beta.4';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAuB,CAAC","sourcesContent":["export const FPS_PLUGIN_VERSION = '0.2.0-beta.3' as const;\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAuB,CAAC","sourcesContent":["export const FPS_PLUGIN_VERSION = '0.2.0-beta.4' as const;\n"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/plugin-assets",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party Assets Plugin for fps-games runtime and editor hosts.",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "fpsGamePlugin": {
21
21
  "id": "fps.plugin.assets",
22
- "version": "0.2.0-beta.3",
22
+ "version": "0.2.0-beta.4",
23
23
  "apiVersion": 1,
24
24
  "requires": {},
25
25
  "provides": {
@@ -46,8 +46,8 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@fps-games/playable-contracts": "0.2.0-beta.3",
50
- "@fps-games/playable-runtime-data": "0.2.0-beta.3",
51
- "@fps-games/plugin-api": "0.2.0-beta.3"
49
+ "@fps-games/playable-contracts": "0.2.0-beta.4",
50
+ "@fps-games/playable-runtime-data": "0.2.0-beta.4",
51
+ "@fps-games/plugin-api": "0.2.0-beta.4"
52
52
  }
53
53
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fps-games/plugin-host",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Lifecycle, dependency, scope, and registry runtime for fps-games plugins.",
@@ -14,7 +14,7 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@fps-games/plugin-api": "0.2.0-beta.3",
17
+ "@fps-games/plugin-api": "0.2.0-beta.4",
18
18
  "semver": "^7.8.5"
19
19
  }
20
20
  }
@@ -1,2 +1,2 @@
1
- export declare const FPS_PLUGIN_VERSION: "0.2.0-beta.3";
1
+ export declare const FPS_PLUGIN_VERSION: "0.2.0-beta.4";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const FPS_PLUGIN_VERSION = '0.2.0-beta.3';
1
+ export const FPS_PLUGIN_VERSION = '0.2.0-beta.4';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAuB,CAAC","sourcesContent":["export const FPS_PLUGIN_VERSION = '0.2.0-beta.3' as const;\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAuB,CAAC","sourcesContent":["export const FPS_PLUGIN_VERSION = '0.2.0-beta.4' as const;\n"]}