@fps-games/editor 0.2.1-beta.3 → 0.2.1-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.
- package/dist/build-info.json +44 -44
- package/dist/editor-commands/capabilities/assets.d.ts +8 -0
- package/dist/editor-commands/capabilities/assets.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/assets.js +41 -41
- package/dist/editor-commands/capabilities/assets.js.map +1 -0
- package/dist/editor-commands/capabilities/editor-state.d.ts +5 -0
- package/dist/editor-commands/capabilities/editor-state.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/editor-state.js +22 -22
- package/dist/editor-commands/capabilities/editor-state.js.map +1 -0
- package/dist/editor-commands/capabilities/hierarchy.d.ts +4 -0
- package/dist/editor-commands/capabilities/hierarchy.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/hierarchy.js +5 -5
- package/dist/editor-commands/capabilities/hierarchy.js.map +1 -0
- package/dist/editor-commands/capabilities/host-lifecycle.d.ts +11 -0
- package/dist/editor-commands/capabilities/host-lifecycle.d.ts.map +1 -0
- package/dist/editor-commands/capabilities/host-lifecycle.js +149 -0
- package/dist/editor-commands/capabilities/host-lifecycle.js.map +1 -0
- package/dist/editor-commands/capabilities/prefabs.d.ts +5 -0
- package/dist/editor-commands/capabilities/prefabs.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/prefabs.js +93 -93
- package/dist/editor-commands/capabilities/prefabs.js.map +1 -0
- package/dist/editor-commands/capabilities/scene-objects.d.ts +8 -0
- package/dist/editor-commands/capabilities/scene-objects.d.ts.map +1 -0
- package/dist/editor-commands/capabilities/scene-objects.js +480 -0
- package/dist/editor-commands/capabilities/scene-objects.js.map +1 -0
- package/dist/editor-commands/capabilities/selection.d.ts +5 -0
- package/dist/editor-commands/capabilities/selection.d.ts.map +1 -0
- package/dist/editor-commands/capabilities/selection.js +60 -0
- package/dist/editor-commands/capabilities/selection.js.map +1 -0
- package/dist/editor-commands/capabilities/shadows.d.ts +5 -0
- package/dist/editor-commands/capabilities/shadows.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/shadows.js +74 -74
- package/dist/editor-commands/capabilities/shadows.js.map +1 -0
- package/dist/editor-commands/capabilities/transform.d.ts +5 -0
- package/dist/editor-commands/capabilities/transform.d.ts.map +1 -0
- package/dist/editor-commands/capabilities/transform.js +164 -0
- package/dist/editor-commands/capabilities/transform.js.map +1 -0
- package/dist/editor-commands/capabilities/ui-regions.d.ts +4 -0
- package/dist/editor-commands/capabilities/ui-regions.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/ui-regions.js +55 -57
- package/dist/editor-commands/capabilities/ui-regions.js.map +1 -0
- package/dist/editor-commands/capabilities/viewport.d.ts +5 -0
- package/dist/editor-commands/capabilities/viewport.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/capabilities/viewport.js +100 -100
- package/dist/editor-commands/capabilities/viewport.js.map +1 -0
- package/dist/editor-commands/command-sources.d.ts +7 -0
- package/dist/editor-commands/command-sources.d.ts.map +1 -0
- package/dist/editor-commands/command-sources.js +34 -0
- package/dist/editor-commands/command-sources.js.map +1 -0
- package/dist/editor-commands/diagnostics.d.ts +12 -0
- package/dist/editor-commands/diagnostics.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/diagnostics.js +4 -4
- package/dist/editor-commands/diagnostics.js.map +1 -0
- package/dist/{agent-bridge → editor-commands}/index.d.ts +1 -1
- package/dist/editor-commands/index.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/index.js +1 -1
- package/dist/editor-commands/index.js.map +1 -0
- package/dist/editor-commands/register.d.ts +4 -0
- package/dist/editor-commands/register.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/register.js +323 -286
- package/dist/editor-commands/register.js.map +1 -0
- package/dist/{agent-bridge → editor-commands}/shared.d.ts +80 -80
- package/dist/editor-commands/shared.d.ts.map +1 -0
- package/dist/{agent-bridge → editor-commands}/shared.js +29 -29
- package/dist/editor-commands/shared.js.map +1 -0
- package/dist/editor-commands/source-types.d.ts +110 -0
- package/dist/editor-commands/source-types.d.ts.map +1 -0
- package/dist/editor-commands/source-types.js.map +1 -0
- package/dist/editor-plugin-commands.d.ts +4 -0
- package/dist/editor-plugin-commands.d.ts.map +1 -0
- package/dist/editor-plugin-commands.js +18 -0
- package/dist/editor-plugin-commands.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/local-editor-commands.d.ts +2 -0
- package/dist/local-editor-commands.d.ts.map +1 -0
- package/dist/local-editor-commands.js +2 -0
- package/dist/local-editor-commands.js.map +1 -0
- package/dist/local-editor-harness.d.ts +35 -21
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +1721 -367
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-prefab-stage-transaction.d.ts +2 -1
- package/dist/local-editor-prefab-stage-transaction.d.ts.map +1 -1
- package/dist/local-editor-prefab-stage-transaction.js +6 -5
- package/dist/local-editor-prefab-stage-transaction.js.map +1 -1
- package/dist/local-editor-scene-view-interaction-runtime.d.ts.map +1 -1
- package/dist/local-editor-scene-view-interaction-runtime.js +2 -5
- package/dist/local-editor-scene-view-interaction-runtime.js.map +1 -1
- package/dist/playable-local-editor-entry.d.ts +10 -0
- package/dist/playable-local-editor-entry.d.ts.map +1 -1
- package/dist/playable-local-editor-entry.js +10 -2
- package/dist/playable-local-editor-entry.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +3 -32
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +6 -70
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-product-local-editor.d.ts +1 -2
- package/dist/playable-product-local-editor.d.ts.map +1 -1
- package/dist/playable-product-local-editor.js +0 -1
- package/dist/playable-product-local-editor.js.map +1 -1
- package/dist/playable-product-projection-preview.d.ts.map +1 -1
- package/dist/playable-product-projection-preview.js +1 -1
- package/dist/playable-product-projection-preview.js.map +1 -1
- package/dist/playable-product-scene-capabilities.d.ts +0 -2
- package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
- package/dist/playable-product-scene-capabilities.js +33 -6
- package/dist/playable-product-scene-capabilities.js.map +1 -1
- package/dist/playable-runtime-babylon.d.ts +4 -0
- package/dist/playable-runtime-babylon.d.ts.map +1 -1
- package/dist/playable-runtime-babylon.js +4 -0
- package/dist/playable-runtime-babylon.js.map +1 -1
- package/dist/playable-sdk.d.ts +1 -1
- package/dist/playable-sdk.d.ts.map +1 -1
- package/dist/playable-sdk.js.map +1 -1
- package/dist/playable-standard-project.d.ts +0 -2
- package/dist/playable-standard-project.d.ts.map +1 -1
- package/dist/playable-standard-project.js +1 -2
- package/dist/playable-standard-project.js.map +1 -1
- package/dist/project-service-projection.d.ts +16 -0
- package/dist/project-service-projection.d.ts.map +1 -0
- package/dist/project-service-projection.js +67 -0
- package/dist/project-service-projection.js.map +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts +18 -0
- package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js +54 -18
- package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +9 -9
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js +127 -13
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +66 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +6 -6
- package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts +32 -0
- package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js +254 -0
- package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +3 -1
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js +2 -0
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts +68 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js +650 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js +22 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +8 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +117 -6
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +14 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +100 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +8 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +75 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +37 -12
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +25 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +332 -107
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +7 -7
- package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts +107 -0
- package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js +1211 -0
- package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts +34 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js +260 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts +9 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js +14 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts +18 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js +113 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts +82 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-system.js +1098 -0
- package/node_modules/@fps-games/editor-core/dist/editor-command-system.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts +6 -7
- package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js +62 -103
- package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts +30 -0
- package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js +540 -0
- package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts +9 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js +61 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts +55 -0
- package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-session.js +247 -6
- package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.d.ts +6 -2
- package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.js +6 -2
- package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +6 -6
- package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts +0 -1
- package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-forge-play/dist/index.js +0 -1
- package/node_modules/@fps-games/editor-forge-play/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +41 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts +27 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js +214 -7
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js +11 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts +2 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js +77 -31
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts +8 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts +21 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js +90 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts +27 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js +161 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js +5 -92
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts +7 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js +26 -9
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js +19 -8
- package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js +16 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js +12 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js +10 -5
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts +17 -82
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js +53 -57
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js +3 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts +10 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js +256 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js +7 -5
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +8 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js +134 -12
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js +47 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts +27 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js +592 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js +61 -6
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts +0 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js +1 -10
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js +21 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts +13 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js +18 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts +28 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js +863 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts +1626 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/{agent-bridge.js → editor-command-capabilities.js} +766 -620
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts +69 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js +22 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts +136 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command.js +2 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-command.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts +225 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-service.js +4 -0
- package/node_modules/@fps-games/editor-protocol/dist/editor-service.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +6 -3
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/index.js +6 -3
- package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/package.json +2 -2
- package/node_modules/@fps-games/editor-tooling/package.json +3 -3
- package/node_modules/@fps-games/editor-ui/package.json +1 -1
- package/node_modules/@fps-games/playable-assets/package.json +1 -1
- package/node_modules/@fps-games/playable-contracts/package.json +1 -1
- package/node_modules/@fps-games/playable-rendering/package.json +2 -2
- package/node_modules/@fps-games/playable-runtime/package.json +12 -12
- package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
- package/node_modules/@fps-games/playable-scene/package.json +2 -2
- package/node_modules/@fps-games/plugin-api/package.json +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/package.json +6 -6
- package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts +1 -0
- package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts.map +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js +78 -4
- package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js.map +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/package.json +5 -5
- package/node_modules/@fps-games/plugin-host/package.json +2 -2
- package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-markers/package.json +5 -5
- package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-materials/package.json +5 -5
- package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
- package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-scene/package.json +5 -5
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/package.json +5 -5
- package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
- package/package.json +23 -23
- package/dist/agent-bridge/capabilities/assets.d.ts +0 -8
- package/dist/agent-bridge/capabilities/assets.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/assets.js.map +0 -1
- package/dist/agent-bridge/capabilities/editor-state.d.ts +0 -5
- package/dist/agent-bridge/capabilities/editor-state.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/editor-state.js.map +0 -1
- package/dist/agent-bridge/capabilities/hierarchy.d.ts +0 -4
- package/dist/agent-bridge/capabilities/hierarchy.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/hierarchy.js.map +0 -1
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +0 -11
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/host-lifecycle.js +0 -149
- package/dist/agent-bridge/capabilities/host-lifecycle.js.map +0 -1
- package/dist/agent-bridge/capabilities/prefabs.d.ts +0 -5
- package/dist/agent-bridge/capabilities/prefabs.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/prefabs.js.map +0 -1
- package/dist/agent-bridge/capabilities/scene-objects.d.ts +0 -8
- package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/scene-objects.js +0 -480
- package/dist/agent-bridge/capabilities/scene-objects.js.map +0 -1
- package/dist/agent-bridge/capabilities/selection.d.ts +0 -5
- package/dist/agent-bridge/capabilities/selection.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/selection.js +0 -60
- package/dist/agent-bridge/capabilities/selection.js.map +0 -1
- package/dist/agent-bridge/capabilities/shadows.d.ts +0 -5
- package/dist/agent-bridge/capabilities/shadows.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/shadows.js.map +0 -1
- package/dist/agent-bridge/capabilities/transform.d.ts +0 -5
- package/dist/agent-bridge/capabilities/transform.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/transform.js +0 -164
- package/dist/agent-bridge/capabilities/transform.js.map +0 -1
- package/dist/agent-bridge/capabilities/ui-regions.d.ts +0 -4
- package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/ui-regions.js.map +0 -1
- package/dist/agent-bridge/capabilities/viewport.d.ts +0 -5
- package/dist/agent-bridge/capabilities/viewport.d.ts.map +0 -1
- package/dist/agent-bridge/capabilities/viewport.js.map +0 -1
- package/dist/agent-bridge/capability-sources.d.ts +0 -7
- package/dist/agent-bridge/capability-sources.d.ts.map +0 -1
- package/dist/agent-bridge/capability-sources.js +0 -34
- package/dist/agent-bridge/capability-sources.js.map +0 -1
- package/dist/agent-bridge/diagnostics.d.ts +0 -12
- package/dist/agent-bridge/diagnostics.d.ts.map +0 -1
- package/dist/agent-bridge/diagnostics.js.map +0 -1
- package/dist/agent-bridge/index.d.ts.map +0 -1
- package/dist/agent-bridge/index.js.map +0 -1
- package/dist/agent-bridge/register.d.ts +0 -4
- package/dist/agent-bridge/register.d.ts.map +0 -1
- package/dist/agent-bridge/register.js.map +0 -1
- package/dist/agent-bridge/shared.d.ts.map +0 -1
- package/dist/agent-bridge/shared.js.map +0 -1
- package/dist/agent-bridge/source-types.d.ts +0 -110
- package/dist/agent-bridge/source-types.d.ts.map +0 -1
- package/dist/agent-bridge/source-types.js.map +0 -1
- package/dist/editor-plugin-agent-capabilities.d.ts +0 -4
- package/dist/editor-plugin-agent-capabilities.d.ts.map +0 -1
- package/dist/editor-plugin-agent-capabilities.js +0 -64
- package/dist/editor-plugin-agent-capabilities.js.map +0 -1
- package/dist/local-editor-agent-actions.d.ts +0 -43
- package/dist/local-editor-agent-actions.d.ts.map +0 -1
- package/dist/local-editor-agent-actions.js +0 -321
- package/dist/local-editor-agent-actions.js.map +0 -1
- package/dist/local-editor-agent-bridge-transport.d.ts +0 -129
- package/dist/local-editor-agent-bridge-transport.d.ts.map +0 -1
- package/dist/local-editor-agent-bridge-transport.js +0 -403
- package/dist/local-editor-agent-bridge-transport.js.map +0 -1
- package/dist/local-editor-agent-bridge.d.ts +0 -2
- package/dist/local-editor-agent-bridge.d.ts.map +0 -1
- package/dist/local-editor-agent-bridge.js +0 -2
- package/dist/local-editor-agent-bridge.js.map +0 -1
- package/dist/local-editor-agent-context.d.ts +0 -68
- package/dist/local-editor-agent-context.d.ts.map +0 -1
- package/dist/local-editor-agent-context.js +0 -716
- package/dist/local-editor-agent-context.js.map +0 -1
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +0 -22
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +0 -106
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +0 -1
- package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts +0 -17
- package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-core/dist/agent-interaction.js +0 -14
- package/node_modules/@fps-games/editor-core/dist/agent-interaction.js.map +0 -1
- package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts +0 -23
- package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js +0 -47
- package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js.map +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts +0 -112
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js +0 -159
- package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js.map +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts +0 -15
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js +0 -76
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +0 -1622
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +0 -68
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +0 -23
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +0 -187
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +0 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent.js +0 -5
- package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +0 -1
- /package/dist/{agent-bridge → editor-commands}/source-types.js +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function registerCanonicalEditorSession(session: object): void;
|
|
2
|
+
export declare function canExposeSharedEditorSessionDocuments(session: object): boolean;
|
|
3
|
+
export declare function claimEditorSessionWriteAuthority(session: object, authority: object): void;
|
|
4
|
+
export declare function releaseEditorSessionWriteAuthority(session: object, authority: object): void;
|
|
5
|
+
export declare function runWithEditorSessionWriteAuthority<TResult>(session: object, authority: object, handler: () => TResult): TResult;
|
|
6
|
+
/** Invokes only the synchronous prefix of a possibly-async trusted handler. */
|
|
7
|
+
export declare function callWithEditorSessionWriteAuthority<TResult>(session: object, authority: object, handler: () => TResult): TResult;
|
|
8
|
+
export declare function assertEditorSessionWriteAuthority(session: object): void;
|
|
9
|
+
//# sourceMappingURL=editor-session-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-session-authority.d.ts","sourceRoot":"","sources":["../src/editor-session-authority.ts"],"names":[],"mappings":"AAIA,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEpE;AAED,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG9E;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAMzF;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAI3F;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EACxD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,OAAO,GACrB,OAAO,CAOT;AAED,+EAA+E;AAC/E,wBAAgB,mCAAmC,CAAC,OAAO,EACzD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,OAAO,GACrB,OAAO,CAeT;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAQvE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const SESSION_WRITE_AUTHORITIES = new WeakMap();
|
|
2
|
+
const ACTIVE_SESSION_WRITE_AUTHORITIES = new WeakMap();
|
|
3
|
+
const CANONICAL_EDITOR_SESSIONS = new WeakSet();
|
|
4
|
+
export function registerCanonicalEditorSession(session) {
|
|
5
|
+
CANONICAL_EDITOR_SESSIONS.add(session);
|
|
6
|
+
}
|
|
7
|
+
export function canExposeSharedEditorSessionDocuments(session) {
|
|
8
|
+
if (!CANONICAL_EDITOR_SESSIONS.has(session))
|
|
9
|
+
return false;
|
|
10
|
+
return SESSION_WRITE_AUTHORITIES.get(session) === undefined;
|
|
11
|
+
}
|
|
12
|
+
export function claimEditorSessionWriteAuthority(session, authority) {
|
|
13
|
+
const existing = SESSION_WRITE_AUTHORITIES.get(session);
|
|
14
|
+
if (existing && existing !== authority) {
|
|
15
|
+
throw new Error('Editor Session already has a different write authority.');
|
|
16
|
+
}
|
|
17
|
+
SESSION_WRITE_AUTHORITIES.set(session, authority);
|
|
18
|
+
}
|
|
19
|
+
export function releaseEditorSessionWriteAuthority(session, authority) {
|
|
20
|
+
if (SESSION_WRITE_AUTHORITIES.get(session) === authority) {
|
|
21
|
+
SESSION_WRITE_AUTHORITIES.delete(session);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function runWithEditorSessionWriteAuthority(session, authority, handler) {
|
|
25
|
+
const result = callWithEditorSessionWriteAuthority(session, authority, handler);
|
|
26
|
+
if (result && typeof result === 'object' && 'then' in result
|
|
27
|
+
&& typeof result.then === 'function') {
|
|
28
|
+
throw new Error('Editor Session write authority handlers must be synchronous.');
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
/** Invokes only the synchronous prefix of a possibly-async trusted handler. */
|
|
33
|
+
export function callWithEditorSessionWriteAuthority(session, authority, handler) {
|
|
34
|
+
if (SESSION_WRITE_AUTHORITIES.get(session) !== authority) {
|
|
35
|
+
throw new Error('Editor Session write authority is unavailable.');
|
|
36
|
+
}
|
|
37
|
+
const previous = ACTIVE_SESSION_WRITE_AUTHORITIES.get(session);
|
|
38
|
+
if (previous && previous !== authority) {
|
|
39
|
+
throw new Error('Editor Session has a different active write authority.');
|
|
40
|
+
}
|
|
41
|
+
ACTIVE_SESSION_WRITE_AUTHORITIES.set(session, authority);
|
|
42
|
+
try {
|
|
43
|
+
return handler();
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
if (previous)
|
|
47
|
+
ACTIVE_SESSION_WRITE_AUTHORITIES.set(session, previous);
|
|
48
|
+
else
|
|
49
|
+
ACTIVE_SESSION_WRITE_AUTHORITIES.delete(session);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export function assertEditorSessionWriteAuthority(session) {
|
|
53
|
+
if (!CANONICAL_EDITOR_SESSIONS.has(session)) {
|
|
54
|
+
throw new Error('Editor Session mutations require the canonical Session instance.');
|
|
55
|
+
}
|
|
56
|
+
const authority = SESSION_WRITE_AUTHORITIES.get(session);
|
|
57
|
+
if (authority && ACTIVE_SESSION_WRITE_AUTHORITIES.get(session) !== authority) {
|
|
58
|
+
throw new Error('Editor Session document mutation requires its Authoring Host write authority.');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=editor-session-authority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-session-authority.js","sourceRoot":"","sources":["../src/editor-session-authority.ts"],"names":[],"mappings":"AAAA,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAkB,CAAC;AAChE,MAAM,gCAAgC,GAAG,IAAI,OAAO,EAAkB,CAAC;AACvE,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAU,CAAC;AAExD,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC5D,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,qCAAqC,CAAC,OAAe;IACnE,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1D,OAAO,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,OAAe,EAAE,SAAiB;IACjF,MAAM,QAAQ,GAAG,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,yBAAyB,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,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;AAED,MAAM,UAAU,iCAAiC,CAAC,OAAe;IAC/D,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzD,IAAI,SAAS,IAAI,gCAAgC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IACnG,CAAC;AACH,CAAC","sourcesContent":["const SESSION_WRITE_AUTHORITIES = new WeakMap<object, object>();\nconst ACTIVE_SESSION_WRITE_AUTHORITIES = new WeakMap<object, object>();\nconst CANONICAL_EDITOR_SESSIONS = new WeakSet<object>();\n\nexport function registerCanonicalEditorSession(session: object): void {\n CANONICAL_EDITOR_SESSIONS.add(session);\n}\n\nexport function canExposeSharedEditorSessionDocuments(session: object): boolean {\n if (!CANONICAL_EDITOR_SESSIONS.has(session)) return false;\n return SESSION_WRITE_AUTHORITIES.get(session) === undefined;\n}\n\nexport function claimEditorSessionWriteAuthority(session: object, authority: object): void {\n const existing = SESSION_WRITE_AUTHORITIES.get(session);\n if (existing && existing !== authority) {\n throw new Error('Editor Session already has a different write authority.');\n }\n SESSION_WRITE_AUTHORITIES.set(session, authority);\n}\n\nexport function releaseEditorSessionWriteAuthority(session: object, authority: object): void {\n if (SESSION_WRITE_AUTHORITIES.get(session) === authority) {\n SESSION_WRITE_AUTHORITIES.delete(session);\n }\n}\n\nexport function runWithEditorSessionWriteAuthority<TResult>(\n session: object,\n authority: object,\n handler: () => TResult,\n): TResult {\n const result = callWithEditorSessionWriteAuthority(session, authority, handler);\n if (result && typeof result === 'object' && 'then' in result\n && typeof result.then === 'function') {\n throw new Error('Editor Session write authority handlers must be synchronous.');\n }\n return result;\n}\n\n/** Invokes only the synchronous prefix of a possibly-async trusted handler. */\nexport function callWithEditorSessionWriteAuthority<TResult>(\n session: object,\n authority: object,\n handler: () => TResult,\n): TResult {\n if (SESSION_WRITE_AUTHORITIES.get(session) !== authority) {\n throw new Error('Editor Session write authority is unavailable.');\n }\n const previous = ACTIVE_SESSION_WRITE_AUTHORITIES.get(session);\n if (previous && previous !== authority) {\n throw new Error('Editor Session has a different active write authority.');\n }\n ACTIVE_SESSION_WRITE_AUTHORITIES.set(session, authority);\n try {\n return handler();\n } finally {\n if (previous) ACTIVE_SESSION_WRITE_AUTHORITIES.set(session, previous);\n else ACTIVE_SESSION_WRITE_AUTHORITIES.delete(session);\n }\n}\n\nexport function assertEditorSessionWriteAuthority(session: object): void {\n if (!CANONICAL_EDITOR_SESSIONS.has(session)) {\n throw new Error('Editor Session mutations require the canonical Session instance.');\n }\n const authority = SESSION_WRITE_AUTHORITIES.get(session);\n if (authority && ACTIVE_SESSION_WRITE_AUTHORITIES.get(session) !== authority) {\n throw new Error('Editor Session document mutation requires its Authoring Host write authority.');\n }\n}\n"]}
|
|
@@ -7,6 +7,8 @@ export interface EditorCommandBase {
|
|
|
7
7
|
type: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
projectionImpact?: EditorProjectionImpact;
|
|
10
|
+
/** Bounded UI invalidation metadata; unknown commands intentionally omit it. */
|
|
11
|
+
presentationImpact?: EditorPresentationImpact;
|
|
10
12
|
}
|
|
11
13
|
export interface DocumentPatchCommand<TPatch = unknown> extends EditorCommandBase {
|
|
12
14
|
type: 'document.patch';
|
|
@@ -117,6 +119,31 @@ export interface EditorSessionForkOptions {
|
|
|
117
119
|
selection?: Partial<EditorSelectionState>;
|
|
118
120
|
onChange?(change: EditorSessionChange): void;
|
|
119
121
|
onChangeError?(error: unknown): void;
|
|
122
|
+
/** Continue the parent revision sequence for a scope projected by the same service. */
|
|
123
|
+
preserveDocumentRevision?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface EditorSessionTransaction<TDocument, TPatch = unknown> {
|
|
126
|
+
readonly session: EditorSession<TDocument, TPatch>;
|
|
127
|
+
readonly baseDocumentRevision: number;
|
|
128
|
+
/**
|
|
129
|
+
* Stages every fallible clone without mutating the owner. Multiple prepared
|
|
130
|
+
* commits can therefore be validated and swapped synchronously as one
|
|
131
|
+
* higher-level authoring transaction.
|
|
132
|
+
*/
|
|
133
|
+
prepareCommit(reason?: EditorSessionChange['reason']): EditorSessionPreparedCommit<TDocument>;
|
|
134
|
+
commit(reason?: EditorSessionChange['reason']): EditorSessionState<TDocument>;
|
|
135
|
+
discard(): void;
|
|
136
|
+
}
|
|
137
|
+
export interface EditorSessionPreparedCommit<TDocument> {
|
|
138
|
+
assertReady(): void;
|
|
139
|
+
commit(options?: {
|
|
140
|
+
deferChangeNotification?: boolean;
|
|
141
|
+
}): EditorSessionPreparedCommitResult<TDocument>;
|
|
142
|
+
discard(): void;
|
|
143
|
+
}
|
|
144
|
+
export interface EditorSessionPreparedCommitResult<TDocument> {
|
|
145
|
+
readonly state: EditorSessionState<TDocument>;
|
|
146
|
+
notifyChange(): void;
|
|
120
147
|
}
|
|
121
148
|
export interface UndoTransaction<TDocument> {
|
|
122
149
|
id: string;
|
|
@@ -125,10 +152,18 @@ export interface UndoTransaction<TDocument> {
|
|
|
125
152
|
beforeDocument: TDocument;
|
|
126
153
|
afterDocument: TDocument;
|
|
127
154
|
projectionImpact?: EditorProjectionImpact;
|
|
155
|
+
presentationImpact?: EditorPresentationImpact;
|
|
128
156
|
structureChanged: boolean;
|
|
129
157
|
createdAt: number;
|
|
130
158
|
}
|
|
131
159
|
export type EditorProjectionImpact = EditorProjectionIncrementalImpact | EditorProjectionRebuildImpact;
|
|
160
|
+
export interface EditorPresentationImpact {
|
|
161
|
+
inspector?: 'full' | Array<'transform' | 'summary' | 'material'>;
|
|
162
|
+
hierarchy?: 'full' | {
|
|
163
|
+
labelIds: string[];
|
|
164
|
+
};
|
|
165
|
+
rendering?: boolean;
|
|
166
|
+
}
|
|
132
167
|
export interface EditorProjectionIncrementalImpact {
|
|
133
168
|
type: 'incremental';
|
|
134
169
|
syncTransformIds?: string[];
|
|
@@ -174,23 +209,43 @@ export declare class EditorSession<TDocument, TPatch = unknown> {
|
|
|
174
209
|
private nextTransactionId;
|
|
175
210
|
private documentRevision;
|
|
176
211
|
private documentStructureRevision;
|
|
212
|
+
private protectedWorkingDocument;
|
|
213
|
+
private protectedPersistedDocument;
|
|
177
214
|
constructor(options: EditorSessionOptions<TDocument, TPatch>);
|
|
178
215
|
getState(options?: EditorSessionStateOptions): EditorSessionState<TDocument>;
|
|
179
216
|
getWorkingDocument(): TDocument;
|
|
180
217
|
getSource(): AuthoringSourceDescriptor | undefined;
|
|
181
218
|
getSelection(): EditorSelectionState;
|
|
219
|
+
/** @internal Severs raw document references captured before a Host lease was installed. */
|
|
220
|
+
detachDocumentReferencesForWriteAuthority(): void;
|
|
182
221
|
isDirty(): boolean;
|
|
183
222
|
fork(options?: EditorSessionForkOptions): EditorSession<TDocument, TPatch>;
|
|
223
|
+
/**
|
|
224
|
+
* Creates an isolated, full-fidelity draft of the current session. Mutations
|
|
225
|
+
* become observable only when commit succeeds against the unchanged base
|
|
226
|
+
* revision; discard leaves the owner untouched.
|
|
227
|
+
*/
|
|
228
|
+
beginTransaction(): EditorSessionTransaction<TDocument, TPatch>;
|
|
184
229
|
canUndo(): boolean;
|
|
185
230
|
canRedo(): boolean;
|
|
186
231
|
dispatch(command: EditorCommand<TDocument, TPatch>, options?: EditorSessionDispatchOptions): EditorSessionDispatchResult<TDocument>;
|
|
187
232
|
undo(): EditorSessionHistoryResult<TDocument> | null;
|
|
188
233
|
redo(): EditorSessionHistoryResult<TDocument> | null;
|
|
189
234
|
markSaved(document: TDocument, source?: AuthoringSourceDescriptor, options?: EditorSessionMarkSavedOptions): EditorSessionState<TDocument>;
|
|
235
|
+
/** Records an externally persisted checkpoint without overwriting newer working edits. */
|
|
236
|
+
markPersistedCheckpoint(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument>;
|
|
190
237
|
reset(document: TDocument, source?: AuthoringSourceDescriptor): EditorSessionState<TDocument>;
|
|
191
238
|
rebaseExternalDocuments(input: EditorSessionExternalRebaseInput<TDocument>): EditorSessionState<TDocument>;
|
|
239
|
+
/**
|
|
240
|
+
* Host-only scope handoff primitive. A scope switch is a service-level
|
|
241
|
+
* authoring fact even when the target document itself is unchanged, so its
|
|
242
|
+
* revisions must not reuse values from an earlier active scope.
|
|
243
|
+
*/
|
|
244
|
+
advanceRevisionsForScopeSwitch(documentRevision: number, documentStructureRevision: number): void;
|
|
192
245
|
private emitChange;
|
|
246
|
+
private getProtectedDocumentSnapshot;
|
|
193
247
|
private pushTransaction;
|
|
248
|
+
private cloneTransactions;
|
|
194
249
|
private getHistoryView;
|
|
195
250
|
}
|
|
196
251
|
export declare function createEditorSession<TDocument>(options: EditorSessionOptions<TDocument>): EditorSession<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;
|
|
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;AAOpE,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;IAC1C,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,GAAG,OAAO,CAAE,SAAQ,iBAAiB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
|
|
|
1
|
+
import { assertEditorSessionWriteAuthority, canExposeSharedEditorSessionDocuments, registerCanonicalEditorSession, } from './editor-session-authority.js';
|
|
1
2
|
function defaultCloneDocument(document) {
|
|
2
3
|
const structuredCloneFn = globalThis.structuredClone;
|
|
3
4
|
if (typeof structuredCloneFn === 'function')
|
|
@@ -87,6 +88,9 @@ export class EditorSession {
|
|
|
87
88
|
this.nextTransactionId = 1;
|
|
88
89
|
this.documentRevision = 0;
|
|
89
90
|
this.documentStructureRevision = 0;
|
|
91
|
+
this.protectedWorkingDocument = null;
|
|
92
|
+
this.protectedPersistedDocument = null;
|
|
93
|
+
registerCanonicalEditorSession(this);
|
|
90
94
|
this.cloneDocument = options.cloneDocument ?? defaultCloneDocument;
|
|
91
95
|
this.compareDocuments = options.compareDocuments ?? defaultCompareDocuments;
|
|
92
96
|
this.reduceDocument = options.reduceDocument;
|
|
@@ -101,9 +105,18 @@ export class EditorSession {
|
|
|
101
105
|
}
|
|
102
106
|
getState(options = {}) {
|
|
103
107
|
const cloneDocuments = options.cloneDocuments !== false;
|
|
108
|
+
const exposeSharedDocuments = !cloneDocuments && canExposeSharedEditorSessionDocuments(this);
|
|
104
109
|
return {
|
|
105
|
-
persistedDocument: cloneDocuments
|
|
106
|
-
|
|
110
|
+
persistedDocument: cloneDocuments
|
|
111
|
+
? this.cloneDocument(this.persistedDocument)
|
|
112
|
+
: exposeSharedDocuments
|
|
113
|
+
? this.persistedDocument
|
|
114
|
+
: this.getProtectedDocumentSnapshot('persisted', this.persistedDocument),
|
|
115
|
+
workingDocument: cloneDocuments
|
|
116
|
+
? this.cloneDocument(this.workingDocument)
|
|
117
|
+
: exposeSharedDocuments
|
|
118
|
+
? this.workingDocument
|
|
119
|
+
: this.getProtectedDocumentSnapshot('working', this.workingDocument),
|
|
107
120
|
documentRevision: this.documentRevision,
|
|
108
121
|
documentStructureRevision: this.documentStructureRevision,
|
|
109
122
|
source: cloneAuthoringSourceDescriptorOptional(this.source),
|
|
@@ -126,11 +139,19 @@ export class EditorSession {
|
|
|
126
139
|
activeId: this.selection.activeId,
|
|
127
140
|
};
|
|
128
141
|
}
|
|
142
|
+
/** @internal Severs raw document references captured before a Host lease was installed. */
|
|
143
|
+
detachDocumentReferencesForWriteAuthority() {
|
|
144
|
+
assertEditorSessionWriteAuthority(this);
|
|
145
|
+
this.persistedDocument = this.cloneDocument(this.persistedDocument);
|
|
146
|
+
this.workingDocument = this.cloneDocument(this.workingDocument);
|
|
147
|
+
this.protectedWorkingDocument = null;
|
|
148
|
+
this.protectedPersistedDocument = null;
|
|
149
|
+
}
|
|
129
150
|
isDirty() {
|
|
130
151
|
return this.dirty;
|
|
131
152
|
}
|
|
132
153
|
fork(options = {}) {
|
|
133
|
-
|
|
154
|
+
const fork = new EditorSession({
|
|
134
155
|
source: this.source,
|
|
135
156
|
persistedDocument: this.workingDocument,
|
|
136
157
|
selection: options.selection,
|
|
@@ -141,6 +162,121 @@ export class EditorSession {
|
|
|
141
162
|
reduceDocument: this.reduceDocument,
|
|
142
163
|
isDocumentStructureChange: this.isDocumentStructureChange,
|
|
143
164
|
});
|
|
165
|
+
if (options.preserveDocumentRevision) {
|
|
166
|
+
fork.documentRevision = this.documentRevision;
|
|
167
|
+
fork.documentStructureRevision = this.documentStructureRevision;
|
|
168
|
+
}
|
|
169
|
+
return fork;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Creates an isolated, full-fidelity draft of the current session. Mutations
|
|
173
|
+
* become observable only when commit succeeds against the unchanged base
|
|
174
|
+
* revision; discard leaves the owner untouched.
|
|
175
|
+
*/
|
|
176
|
+
beginTransaction() {
|
|
177
|
+
const owner = this;
|
|
178
|
+
const baseDocumentRevision = this.documentRevision;
|
|
179
|
+
const baseSelection = normalizeSelection(this.selection);
|
|
180
|
+
const draft = new EditorSession({
|
|
181
|
+
source: this.source,
|
|
182
|
+
persistedDocument: this.persistedDocument,
|
|
183
|
+
workingDocument: this.workingDocument,
|
|
184
|
+
selection: this.selection,
|
|
185
|
+
cloneDocument: this.cloneDocument,
|
|
186
|
+
compareDocuments: this.compareDocuments,
|
|
187
|
+
reduceDocument: this.reduceDocument,
|
|
188
|
+
isDocumentStructureChange: this.isDocumentStructureChange,
|
|
189
|
+
});
|
|
190
|
+
draft.undoStack = this.cloneTransactions(this.undoStack);
|
|
191
|
+
draft.redoStack = this.cloneTransactions(this.redoStack);
|
|
192
|
+
draft.nextTransactionId = this.nextTransactionId;
|
|
193
|
+
draft.documentRevision = this.documentRevision;
|
|
194
|
+
draft.documentStructureRevision = this.documentStructureRevision;
|
|
195
|
+
draft.dirty = this.dirty;
|
|
196
|
+
let active = true;
|
|
197
|
+
const prepareCommit = (reason = 'document') => {
|
|
198
|
+
if (!active)
|
|
199
|
+
throw new Error('Editor Session transaction is no longer active.');
|
|
200
|
+
if (owner.documentRevision !== baseDocumentRevision) {
|
|
201
|
+
active = false;
|
|
202
|
+
throw new Error(`Editor Session transaction base revision changed: expected ${baseDocumentRevision}, received ${owner.documentRevision}.`);
|
|
203
|
+
}
|
|
204
|
+
const documentChanged = draft.documentRevision !== baseDocumentRevision;
|
|
205
|
+
const ownerSelectionChanged = !selectionEquals(owner.selection, baseSelection);
|
|
206
|
+
const nextSelection = normalizeSelection(ownerSelectionChanged ? owner.selection : draft.selection);
|
|
207
|
+
const selectionChanged = !selectionEquals(owner.selection, nextSelection);
|
|
208
|
+
const historyChanged = documentChanged
|
|
209
|
+
|| owner.undoStack.length !== draft.undoStack.length
|
|
210
|
+
|| owner.redoStack.length !== draft.redoStack.length;
|
|
211
|
+
// Stage every fallible clone before mutating the owner so commit is atomic
|
|
212
|
+
// even when a consumer-supplied cloneDocument throws.
|
|
213
|
+
const nextSource = cloneAuthoringSourceDescriptorOptional(draft.source);
|
|
214
|
+
const nextPersistedDocument = owner.cloneDocument(draft.persistedDocument);
|
|
215
|
+
const nextWorkingDocument = owner.cloneDocument(draft.workingDocument);
|
|
216
|
+
const nextUndoStack = owner.cloneTransactions(draft.undoStack);
|
|
217
|
+
const nextRedoStack = owner.cloneTransactions(draft.redoStack);
|
|
218
|
+
// The returned snapshot must also be prepared before the authoritative
|
|
219
|
+
// swap. getState() clones consumer documents and can therefore throw.
|
|
220
|
+
draft.selection = nextSelection;
|
|
221
|
+
const committedState = draft.getState();
|
|
222
|
+
let preparedActive = true;
|
|
223
|
+
let changeNotified = false;
|
|
224
|
+
const assertReady = () => {
|
|
225
|
+
if (!preparedActive || !active) {
|
|
226
|
+
throw new Error('Editor Session prepared commit is no longer active.');
|
|
227
|
+
}
|
|
228
|
+
if (owner.documentRevision !== baseDocumentRevision) {
|
|
229
|
+
preparedActive = false;
|
|
230
|
+
active = false;
|
|
231
|
+
throw new Error(`Editor Session transaction base revision changed: expected ${baseDocumentRevision}, received ${owner.documentRevision}.`);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const notifyChange = () => {
|
|
235
|
+
if (changeNotified)
|
|
236
|
+
return;
|
|
237
|
+
changeNotified = true;
|
|
238
|
+
if (documentChanged || selectionChanged || historyChanged) {
|
|
239
|
+
owner.emitChange(reason, documentChanged, selectionChanged, historyChanged);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
return {
|
|
243
|
+
assertReady,
|
|
244
|
+
commit(commitOptions = {}) {
|
|
245
|
+
assertEditorSessionWriteAuthority(owner);
|
|
246
|
+
assertReady();
|
|
247
|
+
owner.source = nextSource;
|
|
248
|
+
owner.persistedDocument = nextPersistedDocument;
|
|
249
|
+
owner.workingDocument = nextWorkingDocument;
|
|
250
|
+
owner.selection = nextSelection;
|
|
251
|
+
owner.dirty = draft.dirty;
|
|
252
|
+
owner.undoStack = nextUndoStack;
|
|
253
|
+
owner.redoStack = nextRedoStack;
|
|
254
|
+
owner.nextTransactionId = draft.nextTransactionId;
|
|
255
|
+
owner.documentRevision = draft.documentRevision;
|
|
256
|
+
owner.documentStructureRevision = draft.documentStructureRevision;
|
|
257
|
+
preparedActive = false;
|
|
258
|
+
active = false;
|
|
259
|
+
if (!commitOptions.deferChangeNotification)
|
|
260
|
+
notifyChange();
|
|
261
|
+
return { state: committedState, notifyChange };
|
|
262
|
+
},
|
|
263
|
+
discard() {
|
|
264
|
+
if (!preparedActive)
|
|
265
|
+
return;
|
|
266
|
+
preparedActive = false;
|
|
267
|
+
active = false;
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
return {
|
|
272
|
+
session: draft,
|
|
273
|
+
baseDocumentRevision,
|
|
274
|
+
prepareCommit,
|
|
275
|
+
commit(reason = 'document') {
|
|
276
|
+
return prepareCommit(reason).commit().state;
|
|
277
|
+
},
|
|
278
|
+
discard() { active = false; },
|
|
279
|
+
};
|
|
144
280
|
}
|
|
145
281
|
canUndo() {
|
|
146
282
|
return this.undoStack.length > 0;
|
|
@@ -156,13 +292,16 @@ export class EditorSession {
|
|
|
156
292
|
this.emitChange('selection', false, selectionChanged, false);
|
|
157
293
|
return {
|
|
158
294
|
command,
|
|
159
|
-
workingDocument: this
|
|
295
|
+
workingDocument: canExposeSharedEditorSessionDocuments(this)
|
|
296
|
+
? this.workingDocument
|
|
297
|
+
: this.getProtectedDocumentSnapshot('working', this.workingDocument),
|
|
160
298
|
selection: this.getSelection(),
|
|
161
299
|
dirty: this.dirty,
|
|
162
300
|
documentChanged: false,
|
|
163
301
|
selectionChanged,
|
|
164
302
|
};
|
|
165
303
|
}
|
|
304
|
+
assertEditorSessionWriteAuthority(this);
|
|
166
305
|
const structureChanged = this.isDocumentStructureChange(command);
|
|
167
306
|
const useFastDocumentPatch = command.type === 'document.patch' && options.assumeDocumentChanged === true;
|
|
168
307
|
const beforeDocument = useFastDocumentPatch ? this.workingDocument : this.cloneDocument(this.workingDocument);
|
|
@@ -194,7 +333,9 @@ export class EditorSession {
|
|
|
194
333
|
return {
|
|
195
334
|
command,
|
|
196
335
|
workingDocument: options.cloneResultDocument === false
|
|
197
|
-
? this
|
|
336
|
+
? canExposeSharedEditorSessionDocuments(this)
|
|
337
|
+
? this.workingDocument
|
|
338
|
+
: this.getProtectedDocumentSnapshot('working', this.workingDocument)
|
|
198
339
|
: this.cloneDocument(this.workingDocument),
|
|
199
340
|
selection: this.getSelection(),
|
|
200
341
|
dirty: this.isDirty(),
|
|
@@ -204,6 +345,7 @@ export class EditorSession {
|
|
|
204
345
|
};
|
|
205
346
|
}
|
|
206
347
|
undo() {
|
|
348
|
+
assertEditorSessionWriteAuthority(this);
|
|
207
349
|
const transaction = this.undoStack.pop();
|
|
208
350
|
if (!transaction)
|
|
209
351
|
return null;
|
|
@@ -223,6 +365,7 @@ export class EditorSession {
|
|
|
223
365
|
};
|
|
224
366
|
}
|
|
225
367
|
redo() {
|
|
368
|
+
assertEditorSessionWriteAuthority(this);
|
|
226
369
|
const transaction = this.redoStack.pop();
|
|
227
370
|
if (!transaction)
|
|
228
371
|
return null;
|
|
@@ -242,6 +385,7 @@ export class EditorSession {
|
|
|
242
385
|
};
|
|
243
386
|
}
|
|
244
387
|
markSaved(document, source, options = {}) {
|
|
388
|
+
assertEditorSessionWriteAuthority(this);
|
|
245
389
|
if (source)
|
|
246
390
|
this.source = cloneAuthoringSourceDescriptorOptional(source);
|
|
247
391
|
const structureChanged = !this.compareDocuments(this.workingDocument, document);
|
|
@@ -258,7 +402,19 @@ export class EditorSession {
|
|
|
258
402
|
this.emitChange('saved', true, false, options.resetHistory === true);
|
|
259
403
|
return this.getState();
|
|
260
404
|
}
|
|
405
|
+
/** Records an externally persisted checkpoint without overwriting newer working edits. */
|
|
406
|
+
markPersistedCheckpoint(document, source) {
|
|
407
|
+
assertEditorSessionWriteAuthority(this);
|
|
408
|
+
if (source)
|
|
409
|
+
this.source = cloneAuthoringSourceDescriptorOptional(source);
|
|
410
|
+
this.persistedDocument = this.cloneDocument(document);
|
|
411
|
+
this.documentRevision += 1;
|
|
412
|
+
this.dirty = !this.compareDocuments(this.workingDocument, this.persistedDocument);
|
|
413
|
+
this.emitChange('saved', true, false, false);
|
|
414
|
+
return this.getState();
|
|
415
|
+
}
|
|
261
416
|
reset(document, source) {
|
|
417
|
+
assertEditorSessionWriteAuthority(this);
|
|
262
418
|
this.source = cloneAuthoringSourceDescriptorOptional(source);
|
|
263
419
|
this.persistedDocument = this.cloneDocument(document);
|
|
264
420
|
this.workingDocument = this.cloneDocument(document);
|
|
@@ -272,6 +428,7 @@ export class EditorSession {
|
|
|
272
428
|
return this.getState();
|
|
273
429
|
}
|
|
274
430
|
rebaseExternalDocuments(input) {
|
|
431
|
+
assertEditorSessionWriteAuthority(this);
|
|
275
432
|
const nextPersistedDocument = this.cloneDocument(input.persistedDocument);
|
|
276
433
|
const nextWorkingDocument = this.cloneDocument(input.workingDocument);
|
|
277
434
|
const nextDirty = !this.compareDocuments(nextWorkingDocument, nextPersistedDocument);
|
|
@@ -303,6 +460,23 @@ export class EditorSession {
|
|
|
303
460
|
history: { entries: [] },
|
|
304
461
|
};
|
|
305
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* Host-only scope handoff primitive. A scope switch is a service-level
|
|
465
|
+
* authoring fact even when the target document itself is unchanged, so its
|
|
466
|
+
* revisions must not reuse values from an earlier active scope.
|
|
467
|
+
*/
|
|
468
|
+
advanceRevisionsForScopeSwitch(documentRevision, documentStructureRevision) {
|
|
469
|
+
assertEditorSessionWriteAuthority(this);
|
|
470
|
+
if (!Number.isSafeInteger(documentRevision) || documentRevision <= this.documentRevision) {
|
|
471
|
+
throw new Error('Scope switch document revision must advance the target Session.');
|
|
472
|
+
}
|
|
473
|
+
if (!Number.isSafeInteger(documentStructureRevision)
|
|
474
|
+
|| documentStructureRevision <= this.documentStructureRevision) {
|
|
475
|
+
throw new Error('Scope switch structure revision must advance the target Session.');
|
|
476
|
+
}
|
|
477
|
+
this.documentRevision = documentRevision;
|
|
478
|
+
this.documentStructureRevision = documentStructureRevision;
|
|
479
|
+
}
|
|
306
480
|
emitChange(reason, documentChanged, selectionChanged, historyChanged) {
|
|
307
481
|
try {
|
|
308
482
|
this.onChange?.(Object.freeze({
|
|
@@ -321,11 +495,24 @@ export class EditorSession {
|
|
|
321
495
|
catch { /* Session observers cannot change an already-applied command. */ }
|
|
322
496
|
}
|
|
323
497
|
}
|
|
498
|
+
getProtectedDocumentSnapshot(kind, source) {
|
|
499
|
+
const cached = kind === 'working' ? this.protectedWorkingDocument : this.protectedPersistedDocument;
|
|
500
|
+
if (cached?.revision === this.documentRevision && cached.source === source)
|
|
501
|
+
return cached.snapshot;
|
|
502
|
+
const snapshot = freezeDocumentSnapshot(this.cloneDocument(source));
|
|
503
|
+
const next = { revision: this.documentRevision, source, snapshot };
|
|
504
|
+
if (kind === 'working')
|
|
505
|
+
this.protectedWorkingDocument = next;
|
|
506
|
+
else
|
|
507
|
+
this.protectedPersistedDocument = next;
|
|
508
|
+
return snapshot;
|
|
509
|
+
}
|
|
324
510
|
pushTransaction(command, beforeDocument, afterDocument, options, structureChanged) {
|
|
325
511
|
const previous = options.mergeWithPrevious ? this.undoStack[this.undoStack.length - 1] : undefined;
|
|
326
512
|
if (previous) {
|
|
327
513
|
previous.afterDocument = this.cloneDocument(afterDocument);
|
|
328
514
|
previous.projectionImpact = mergeProjectionImpact(previous.projectionImpact, command.projectionImpact);
|
|
515
|
+
previous.presentationImpact = mergePresentationImpact(previous.presentationImpact, command.presentationImpact);
|
|
329
516
|
previous.structureChanged || (previous.structureChanged = structureChanged);
|
|
330
517
|
this.redoStack = [];
|
|
331
518
|
return {
|
|
@@ -333,6 +520,7 @@ export class EditorSession {
|
|
|
333
520
|
beforeDocument: this.cloneDocument(previous.beforeDocument),
|
|
334
521
|
afterDocument: this.cloneDocument(previous.afterDocument),
|
|
335
522
|
projectionImpact: cloneProjectionImpact(previous.projectionImpact),
|
|
523
|
+
presentationImpact: clonePresentationImpact(previous.presentationImpact),
|
|
336
524
|
};
|
|
337
525
|
}
|
|
338
526
|
const transaction = {
|
|
@@ -342,6 +530,7 @@ export class EditorSession {
|
|
|
342
530
|
beforeDocument: this.cloneDocument(beforeDocument),
|
|
343
531
|
afterDocument: this.cloneDocument(afterDocument),
|
|
344
532
|
...(command.projectionImpact ? { projectionImpact: cloneProjectionImpact(command.projectionImpact) } : {}),
|
|
533
|
+
...(command.presentationImpact ? { presentationImpact: clonePresentationImpact(command.presentationImpact) } : {}),
|
|
345
534
|
structureChanged,
|
|
346
535
|
createdAt: Date.now(),
|
|
347
536
|
};
|
|
@@ -349,6 +538,14 @@ export class EditorSession {
|
|
|
349
538
|
this.redoStack = [];
|
|
350
539
|
return transaction;
|
|
351
540
|
}
|
|
541
|
+
cloneTransactions(transactions) {
|
|
542
|
+
return transactions.map(transaction => ({
|
|
543
|
+
...transaction,
|
|
544
|
+
beforeDocument: this.cloneDocument(transaction.beforeDocument),
|
|
545
|
+
afterDocument: this.cloneDocument(transaction.afterDocument),
|
|
546
|
+
projectionImpact: cloneProjectionImpact(transaction.projectionImpact),
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
352
549
|
getHistoryView() {
|
|
353
550
|
return {
|
|
354
551
|
entries: [...this.undoStack, ...this.redoStack]
|
|
@@ -357,6 +554,24 @@ export class EditorSession {
|
|
|
357
554
|
};
|
|
358
555
|
}
|
|
359
556
|
}
|
|
557
|
+
function freezeDocumentSnapshot(value, seen = new WeakSet()) {
|
|
558
|
+
if (value === null || typeof value !== 'object')
|
|
559
|
+
return value;
|
|
560
|
+
const object = value;
|
|
561
|
+
if (seen.has(object))
|
|
562
|
+
return value;
|
|
563
|
+
seen.add(object);
|
|
564
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
565
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
566
|
+
if (descriptor && 'value' in descriptor)
|
|
567
|
+
freezeDocumentSnapshot(descriptor.value, seen);
|
|
568
|
+
}
|
|
569
|
+
try {
|
|
570
|
+
Object.freeze(object);
|
|
571
|
+
}
|
|
572
|
+
catch { /* Exotic structured values remain detached clones even if they cannot be frozen. */ }
|
|
573
|
+
return value;
|
|
574
|
+
}
|
|
360
575
|
function cloneProjectionImpact(impact) {
|
|
361
576
|
if (!impact)
|
|
362
577
|
return undefined;
|
|
@@ -413,6 +628,32 @@ function mergeProjectionImpact(previous, next) {
|
|
|
413
628
|
]),
|
|
414
629
|
};
|
|
415
630
|
}
|
|
631
|
+
function clonePresentationImpact(impact) {
|
|
632
|
+
if (!impact)
|
|
633
|
+
return undefined;
|
|
634
|
+
return {
|
|
635
|
+
...(impact.inspector ? { inspector: impact.inspector === 'full' ? 'full' : [...impact.inspector] } : {}),
|
|
636
|
+
...(impact.hierarchy ? { hierarchy: impact.hierarchy === 'full' ? 'full' : { labelIds: [...impact.hierarchy.labelIds] } } : {}),
|
|
637
|
+
...(impact.rendering ? { rendering: true } : {}),
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function mergePresentationImpact(previous, next) {
|
|
641
|
+
if (!previous || !next)
|
|
642
|
+
return undefined;
|
|
643
|
+
return {
|
|
644
|
+
...(previous.inspector || next.inspector ? {
|
|
645
|
+
inspector: previous.inspector === 'full' || next.inspector === 'full'
|
|
646
|
+
? 'full'
|
|
647
|
+
: [...new Set([...(previous.inspector ?? []), ...(next.inspector ?? [])])],
|
|
648
|
+
} : {}),
|
|
649
|
+
...(previous.hierarchy || next.hierarchy ? {
|
|
650
|
+
hierarchy: previous.hierarchy === 'full' || next.hierarchy === 'full'
|
|
651
|
+
? 'full'
|
|
652
|
+
: { labelIds: [...new Set([...(previous.hierarchy?.labelIds ?? []), ...(next.hierarchy?.labelIds ?? [])])] },
|
|
653
|
+
} : {}),
|
|
654
|
+
...(previous.rendering || next.rendering ? { rendering: true } : {}),
|
|
655
|
+
};
|
|
656
|
+
}
|
|
416
657
|
function toHistoryEntry(transaction) {
|
|
417
658
|
return {
|
|
418
659
|
id: transaction.id,
|
|
@@ -428,7 +669,7 @@ function cloneAuthoringSourceDescriptorOptional(source) {
|
|
|
428
669
|
...source,
|
|
429
670
|
ref: { ...source.ref },
|
|
430
671
|
capabilities: source.capabilities ? { ...source.capabilities } : undefined,
|
|
431
|
-
metadata: source.metadata ?
|
|
672
|
+
metadata: source.metadata ? structuredClone(source.metadata) : undefined,
|
|
432
673
|
};
|
|
433
674
|
}
|
|
434
675
|
function isDocumentCommand(command) {
|