@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,650 @@
|
|
|
1
|
+
import {} from '@fps-games/editor-protocol';
|
|
2
|
+
export function listLocalEditorCommandMenuEntries(entries) {
|
|
3
|
+
return entries.flatMap(entry => {
|
|
4
|
+
const menu = entry.manifest.presentation?.menu;
|
|
5
|
+
return menu?.path.length ? [{
|
|
6
|
+
entry,
|
|
7
|
+
path: [...menu.path],
|
|
8
|
+
...(menu.group ? { group: menu.group } : {}),
|
|
9
|
+
order: menu.order ?? 0,
|
|
10
|
+
}] : [];
|
|
11
|
+
}).sort((left, right) => (left.path[0].localeCompare(right.path[0])
|
|
12
|
+
|| (left.group ?? '').localeCompare(right.group ?? '')
|
|
13
|
+
|| left.order - right.order
|
|
14
|
+
|| left.path.join('/').localeCompare(right.path.join('/'))
|
|
15
|
+
|| left.entry.manifest.id.localeCompare(right.entry.manifest.id)));
|
|
16
|
+
}
|
|
17
|
+
export function matchesLocalEditorCommandShortcut(shortcut, event) {
|
|
18
|
+
if (!shortcut?.trim())
|
|
19
|
+
return false;
|
|
20
|
+
return shortcut.split(/\s*\/\s*/).some(alternative => {
|
|
21
|
+
const tokens = alternative.split('+').map(token => token.trim().toLocaleLowerCase()).filter(Boolean);
|
|
22
|
+
const key = tokens[tokens.length - 1];
|
|
23
|
+
if (!key)
|
|
24
|
+
return false;
|
|
25
|
+
const modifiers = new Set(tokens.slice(0, -1));
|
|
26
|
+
const hasMod = modifiers.has('mod');
|
|
27
|
+
const requiresCtrl = modifiers.has('ctrl');
|
|
28
|
+
const requiresMeta = modifiers.has('meta') || modifiers.has('cmd');
|
|
29
|
+
if (hasMod ? !(event.metaKey || event.ctrlKey) : (!!event.ctrlKey !== requiresCtrl || !!event.metaKey !== requiresMeta))
|
|
30
|
+
return false;
|
|
31
|
+
if (!!event.shiftKey !== modifiers.has('shift'))
|
|
32
|
+
return false;
|
|
33
|
+
if (!!event.altKey !== modifiers.has('alt'))
|
|
34
|
+
return false;
|
|
35
|
+
return event.key.toLocaleLowerCase() === key;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function createLocalEditorCommandPresentationCatalog(loadEntries) {
|
|
39
|
+
let disposed = false;
|
|
40
|
+
let generation = 0;
|
|
41
|
+
let entries = new Map();
|
|
42
|
+
let pendingRefresh = null;
|
|
43
|
+
const catalog = Object.freeze({
|
|
44
|
+
get(commandId) {
|
|
45
|
+
return entries.get(commandId);
|
|
46
|
+
},
|
|
47
|
+
refresh() {
|
|
48
|
+
if (disposed)
|
|
49
|
+
return Promise.resolve(false);
|
|
50
|
+
if (pendingRefresh)
|
|
51
|
+
return pendingRefresh;
|
|
52
|
+
const refreshGeneration = generation;
|
|
53
|
+
const refresh = (async () => {
|
|
54
|
+
try {
|
|
55
|
+
const loadedEntries = await loadEntries();
|
|
56
|
+
if (disposed || refreshGeneration !== generation)
|
|
57
|
+
return false;
|
|
58
|
+
entries = new Map(loadedEntries.map(entry => [entry.manifest.id, entry]));
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Keep the last complete catalog for future shortcut matching, but
|
|
63
|
+
// fail this attempt closed because availability could be stale.
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
})();
|
|
67
|
+
pendingRefresh = refresh;
|
|
68
|
+
void refresh.finally(() => {
|
|
69
|
+
if (pendingRefresh === refresh)
|
|
70
|
+
pendingRefresh = null;
|
|
71
|
+
});
|
|
72
|
+
return refresh;
|
|
73
|
+
},
|
|
74
|
+
queueShortcut(commandId, event, canInvoke, invoke) {
|
|
75
|
+
if (disposed)
|
|
76
|
+
return false;
|
|
77
|
+
const currentEntry = entries.get(commandId);
|
|
78
|
+
if (!currentEntry) {
|
|
79
|
+
// An empty cache may be the result of a transient initial failure.
|
|
80
|
+
// Recover without guessing a literal shortcut or consuming the event.
|
|
81
|
+
void catalog.refresh();
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!matchesLocalEditorCommandShortcut(currentEntry.manifest.presentation?.shortcut, event)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
const shortcutEvent = {
|
|
89
|
+
key: event.key,
|
|
90
|
+
metaKey: event.metaKey,
|
|
91
|
+
ctrlKey: event.ctrlKey,
|
|
92
|
+
shiftKey: event.shiftKey,
|
|
93
|
+
altKey: event.altKey,
|
|
94
|
+
};
|
|
95
|
+
void catalog.refresh().then((refreshed) => {
|
|
96
|
+
if (!refreshed
|
|
97
|
+
|| disposed
|
|
98
|
+
|| !canInvoke()) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const refreshedEntry = entries.get(commandId);
|
|
102
|
+
if (refreshedEntry?.availability.available === true
|
|
103
|
+
&& matchesLocalEditorCommandShortcut(refreshedEntry.manifest.presentation?.shortcut, shortcutEvent)) {
|
|
104
|
+
invoke();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return true;
|
|
108
|
+
},
|
|
109
|
+
dispose() {
|
|
110
|
+
if (disposed)
|
|
111
|
+
return;
|
|
112
|
+
disposed = true;
|
|
113
|
+
generation += 1;
|
|
114
|
+
entries.clear();
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
return catalog;
|
|
118
|
+
}
|
|
119
|
+
export function applyLocalEditorCommandSelection(manifest, input, selection) {
|
|
120
|
+
const result = { ...input };
|
|
121
|
+
const binding = manifest.presentation?.selectionBinding;
|
|
122
|
+
if (binding?.selectedIds && selection.selectedIds.length)
|
|
123
|
+
result[binding.selectedIds] = [...selection.selectedIds];
|
|
124
|
+
if (binding?.activeId && selection.activeId)
|
|
125
|
+
result[binding.activeId] = selection.activeId;
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
export function formatLocalEditorCommandMetadata(manifest) {
|
|
129
|
+
const shortcut = manifest.presentation?.shortcut;
|
|
130
|
+
const menuPath = manifest.presentation?.menu?.path.join(' / ');
|
|
131
|
+
return `${manifest.presentation?.category ?? 'General'} · ${manifest.target} · ${manifest.access} · ${manifest.effects.persistence}${menuPath ? ` · ${menuPath}` : ''}${shortcut ? ` · ${shortcut}` : ''}`;
|
|
132
|
+
}
|
|
133
|
+
const HISTORY_LIMIT = 50;
|
|
134
|
+
export function parseLocalEditorCommandConsole(input) {
|
|
135
|
+
const source = input.trim();
|
|
136
|
+
if (!source)
|
|
137
|
+
throw new Error('Command Console input is empty.');
|
|
138
|
+
const firstSpace = source.search(/\s/);
|
|
139
|
+
const command = firstSpace < 0 ? source : source.slice(0, firstSpace);
|
|
140
|
+
const remainder = firstSpace < 0 ? '' : source.slice(firstSpace).trim();
|
|
141
|
+
if (command === 'help')
|
|
142
|
+
return { kind: 'help', ...(remainder ? { commandId: remainder } : {}) };
|
|
143
|
+
if (command === 'search') {
|
|
144
|
+
if (!remainder)
|
|
145
|
+
throw new Error('search requires a query.');
|
|
146
|
+
return { kind: 'search', query: remainder };
|
|
147
|
+
}
|
|
148
|
+
if (command === 'history') {
|
|
149
|
+
if (remainder)
|
|
150
|
+
throw new Error('history does not accept arguments.');
|
|
151
|
+
return { kind: 'history' };
|
|
152
|
+
}
|
|
153
|
+
if (command === 'rerun') {
|
|
154
|
+
const index = Number(remainder);
|
|
155
|
+
if (!Number.isSafeInteger(index) || index < 1)
|
|
156
|
+
throw new Error('rerun requires a positive history index.');
|
|
157
|
+
return { kind: 'rerun', index };
|
|
158
|
+
}
|
|
159
|
+
let parsed = {};
|
|
160
|
+
if (remainder) {
|
|
161
|
+
try {
|
|
162
|
+
parsed = JSON.parse(remainder);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw new Error(`Command input must be JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return { kind: 'invoke', commandId: command, input: toJsonValue(parsed) };
|
|
169
|
+
}
|
|
170
|
+
export function createLocalEditorCommandCenter(options) {
|
|
171
|
+
const doc = options.document;
|
|
172
|
+
const storageKey = `fps-editor-command-center:${options.client.serviceInstanceId}`;
|
|
173
|
+
const history = readHistory(doc, `${storageKey}:history`);
|
|
174
|
+
const favorites = new Set(readStringList(doc, `${storageKey}:favorites`));
|
|
175
|
+
let disposed = false;
|
|
176
|
+
let open = false;
|
|
177
|
+
let searchGeneration = 0;
|
|
178
|
+
let selectedIndex = 0;
|
|
179
|
+
let entries = [];
|
|
180
|
+
const root = doc.createElement('div');
|
|
181
|
+
root.className = 'fps-editor-ui-command-center';
|
|
182
|
+
root.dataset.editorCommandCenter = 'true';
|
|
183
|
+
root.dataset.editorWorkbenchRegion = 'modal';
|
|
184
|
+
root.style.cssText = [
|
|
185
|
+
'position:fixed', 'inset:0', 'z-index:2147483643', 'display:none',
|
|
186
|
+
'align-items:flex-start', 'justify-content:center', 'padding:10vh 24px 24px',
|
|
187
|
+
'background:rgba(0,0,0,.42)', 'font-family:var(--fps-editor-font)',
|
|
188
|
+
'color:var(--fps-editor-text)', 'pointer-events:auto',
|
|
189
|
+
].join(';');
|
|
190
|
+
const panel = doc.createElement('section');
|
|
191
|
+
panel.setAttribute('role', 'dialog');
|
|
192
|
+
panel.setAttribute('aria-modal', 'true');
|
|
193
|
+
panel.setAttribute('aria-label', 'Command Center');
|
|
194
|
+
panel.style.cssText = [
|
|
195
|
+
'width:min(760px,calc(100vw - 48px))', 'max-height:78vh', 'display:flex',
|
|
196
|
+
'flex-direction:column', 'overflow:hidden', 'border:1px solid var(--fps-editor-border)',
|
|
197
|
+
'border-radius:6px', 'background:var(--fps-editor-panel)',
|
|
198
|
+
'box-shadow:var(--fps-editor-shadow-modal)',
|
|
199
|
+
].join(';');
|
|
200
|
+
const search = doc.createElement('input');
|
|
201
|
+
search.type = 'search';
|
|
202
|
+
search.placeholder = '搜索命令,或按 Tab 打开 Console';
|
|
203
|
+
search.setAttribute('aria-label', '搜索编辑器命令');
|
|
204
|
+
search.style.cssText = [
|
|
205
|
+
'height:42px', 'padding:0 14px', 'border:0',
|
|
206
|
+
'border-bottom:1px solid var(--fps-editor-border)', 'outline:none',
|
|
207
|
+
'background:var(--fps-editor-field)', 'color:var(--fps-editor-text-strong)',
|
|
208
|
+
'font:inherit',
|
|
209
|
+
].join(';');
|
|
210
|
+
const tabs = doc.createElement('div');
|
|
211
|
+
tabs.style.cssText = 'display:flex;gap:4px;padding:6px 8px;border-bottom:1px solid var(--fps-editor-border-soft);background:var(--fps-editor-panel-soft)';
|
|
212
|
+
const paletteTab = button('Palette');
|
|
213
|
+
const menuTab = button('Menus');
|
|
214
|
+
const consoleTab = button('Console');
|
|
215
|
+
tabs.append(paletteTab, menuTab, consoleTab);
|
|
216
|
+
const list = doc.createElement('div');
|
|
217
|
+
list.setAttribute('role', 'listbox');
|
|
218
|
+
list.style.cssText = 'min-height:160px;overflow:auto;padding:6px';
|
|
219
|
+
const menuSurface = doc.createElement('div');
|
|
220
|
+
menuSurface.setAttribute('role', 'menu');
|
|
221
|
+
menuSurface.style.cssText = 'display:none;min-height:160px;overflow:auto;padding:8px';
|
|
222
|
+
const consoleSurface = doc.createElement('div');
|
|
223
|
+
consoleSurface.style.cssText = 'display:none;flex-direction:column;gap:8px;padding:10px';
|
|
224
|
+
const consoleInput = doc.createElement('textarea');
|
|
225
|
+
consoleInput.rows = 4;
|
|
226
|
+
consoleInput.placeholder = '<command-id> [JSON] · help · search · history · rerun';
|
|
227
|
+
consoleInput.setAttribute('aria-label', 'Command Console input');
|
|
228
|
+
consoleInput.style.cssText = [
|
|
229
|
+
'width:100%', 'box-sizing:border-box', 'resize:vertical', 'padding:9px',
|
|
230
|
+
'border:1px solid var(--fps-editor-editable-border)', 'border-radius:3px',
|
|
231
|
+
'background:var(--fps-editor-editable-bg)', 'color:var(--fps-editor-text)',
|
|
232
|
+
'font:12px/1.5 var(--fps-editor-mono-font,monospace)',
|
|
233
|
+
].join(';');
|
|
234
|
+
const consoleActions = doc.createElement('div');
|
|
235
|
+
consoleActions.style.cssText = 'display:flex;gap:6px;justify-content:flex-end';
|
|
236
|
+
const useSelectionButton = button('使用当前 Selection');
|
|
237
|
+
const runButton = button('运行');
|
|
238
|
+
consoleActions.append(useSelectionButton, runButton);
|
|
239
|
+
const output = doc.createElement('pre');
|
|
240
|
+
output.dataset.editorCommandOutput = 'true';
|
|
241
|
+
output.style.cssText = [
|
|
242
|
+
'min-height:90px', 'max-height:240px', 'overflow:auto', 'margin:0', 'padding:9px',
|
|
243
|
+
'border:1px solid var(--fps-editor-readonly-border)', 'border-radius:3px',
|
|
244
|
+
'background:var(--fps-editor-readonly-bg)', 'color:var(--fps-editor-readonly-text)',
|
|
245
|
+
'font:11px/1.45 var(--fps-editor-mono-font,monospace)', 'white-space:pre-wrap',
|
|
246
|
+
].join(';');
|
|
247
|
+
consoleSurface.append(consoleInput, consoleActions, output);
|
|
248
|
+
const footer = doc.createElement('div');
|
|
249
|
+
footer.style.cssText = 'display:flex;justify-content:space-between;padding:6px 10px;border-top:1px solid var(--fps-editor-border-soft);color:var(--fps-editor-muted);font-size:11px';
|
|
250
|
+
footer.textContent = '↑↓ 选择 · Enter 运行 · Tab Console · Esc 关闭';
|
|
251
|
+
panel.append(search, tabs, list, menuSurface, consoleSurface, footer);
|
|
252
|
+
root.appendChild(panel);
|
|
253
|
+
options.host.appendChild(root);
|
|
254
|
+
const onGlobalKeyDown = (event) => {
|
|
255
|
+
const key = event.key.toLocaleLowerCase();
|
|
256
|
+
if (!open && (event.metaKey || event.ctrlKey) && event.shiftKey && key === 'p') {
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
void controller.open();
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (!open)
|
|
262
|
+
return;
|
|
263
|
+
if (key === 'escape') {
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
controller.close();
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (key === 'tab') {
|
|
269
|
+
event.preventDefault();
|
|
270
|
+
showConsole(consoleSurface.style.display === 'none');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (consoleSurface.style.display !== 'none') {
|
|
274
|
+
if ((event.metaKey || event.ctrlKey) && key === 'enter') {
|
|
275
|
+
event.preventDefault();
|
|
276
|
+
void runConsole();
|
|
277
|
+
}
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (menuSurface.style.display !== 'none')
|
|
281
|
+
return;
|
|
282
|
+
if (key === 'arrowdown' || key === 'arrowup') {
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
if (entries.length)
|
|
285
|
+
selectedIndex = (selectedIndex + (key === 'arrowdown' ? 1 : -1) + entries.length) % entries.length;
|
|
286
|
+
renderEntries();
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (key === 'enter') {
|
|
290
|
+
event.preventDefault();
|
|
291
|
+
const entry = entries[selectedIndex];
|
|
292
|
+
if (entry)
|
|
293
|
+
void activateEntry(entry);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
const onSearchInput = () => { void refresh(search.value); };
|
|
297
|
+
const onRootClick = (event) => { if (event.target === root)
|
|
298
|
+
controller.close(); };
|
|
299
|
+
const onPaletteTab = () => showConsole(false);
|
|
300
|
+
const onMenuTab = () => showMenu();
|
|
301
|
+
const onConsoleTab = () => showConsole(true);
|
|
302
|
+
const onRun = () => { void runConsole(); };
|
|
303
|
+
const onUseSelection = () => { void injectSelection(); };
|
|
304
|
+
doc.addEventListener('keydown', onGlobalKeyDown);
|
|
305
|
+
search.addEventListener('input', onSearchInput);
|
|
306
|
+
root.addEventListener('click', onRootClick);
|
|
307
|
+
paletteTab.addEventListener('click', onPaletteTab);
|
|
308
|
+
menuTab.addEventListener('click', onMenuTab);
|
|
309
|
+
consoleTab.addEventListener('click', onConsoleTab);
|
|
310
|
+
runButton.addEventListener('click', onRun);
|
|
311
|
+
useSelectionButton.addEventListener('click', onUseSelection);
|
|
312
|
+
const controller = Object.freeze({
|
|
313
|
+
root,
|
|
314
|
+
async open(query = '') {
|
|
315
|
+
if (disposed)
|
|
316
|
+
throw new Error('Command Center is disposed.');
|
|
317
|
+
open = true;
|
|
318
|
+
root.style.display = 'flex';
|
|
319
|
+
options.onOpenChange?.(true);
|
|
320
|
+
search.value = query;
|
|
321
|
+
showConsole(false);
|
|
322
|
+
await refresh(query);
|
|
323
|
+
search.focus();
|
|
324
|
+
},
|
|
325
|
+
close() {
|
|
326
|
+
if (!open)
|
|
327
|
+
return;
|
|
328
|
+
open = false;
|
|
329
|
+
root.style.display = 'none';
|
|
330
|
+
options.onOpenChange?.(false);
|
|
331
|
+
},
|
|
332
|
+
dispose() {
|
|
333
|
+
if (disposed)
|
|
334
|
+
return;
|
|
335
|
+
disposed = true;
|
|
336
|
+
controller.close();
|
|
337
|
+
doc.removeEventListener('keydown', onGlobalKeyDown);
|
|
338
|
+
search.removeEventListener('input', onSearchInput);
|
|
339
|
+
root.removeEventListener('click', onRootClick);
|
|
340
|
+
paletteTab.removeEventListener('click', onPaletteTab);
|
|
341
|
+
menuTab.removeEventListener('click', onMenuTab);
|
|
342
|
+
consoleTab.removeEventListener('click', onConsoleTab);
|
|
343
|
+
runButton.removeEventListener('click', onRun);
|
|
344
|
+
useSelectionButton.removeEventListener('click', onUseSelection);
|
|
345
|
+
root.remove();
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
return controller;
|
|
349
|
+
async function refresh(query) {
|
|
350
|
+
const generation = ++searchGeneration;
|
|
351
|
+
const response = await options.client.request(query.trim()
|
|
352
|
+
? { kind: 'commands.search', query: query.trim(), limit: 100 }
|
|
353
|
+
: { kind: 'commands.list', limit: 100 });
|
|
354
|
+
if (generation !== searchGeneration || disposed || !response.ok || response.kind !== 'commands')
|
|
355
|
+
return;
|
|
356
|
+
entries = [...response.page.commands].sort((left, right) => {
|
|
357
|
+
const leftFavorite = favorites.has(left.manifest.id) ? 1 : 0;
|
|
358
|
+
const rightFavorite = favorites.has(right.manifest.id) ? 1 : 0;
|
|
359
|
+
return rightFavorite - leftFavorite || left.manifest.id.localeCompare(right.manifest.id);
|
|
360
|
+
});
|
|
361
|
+
selectedIndex = Math.min(selectedIndex, Math.max(0, entries.length - 1));
|
|
362
|
+
renderEntries();
|
|
363
|
+
renderMenus();
|
|
364
|
+
}
|
|
365
|
+
function renderMenus() {
|
|
366
|
+
menuSurface.replaceChildren();
|
|
367
|
+
let currentSection = '';
|
|
368
|
+
let section = null;
|
|
369
|
+
for (const item of listLocalEditorCommandMenuEntries(entries)) {
|
|
370
|
+
const sectionName = item.path[0];
|
|
371
|
+
if (sectionName !== currentSection) {
|
|
372
|
+
currentSection = sectionName;
|
|
373
|
+
section = doc.createElement('section');
|
|
374
|
+
section.style.cssText = 'display:flex;flex-direction:column;gap:3px;margin-bottom:10px';
|
|
375
|
+
const heading = doc.createElement('h3');
|
|
376
|
+
heading.textContent = sectionName;
|
|
377
|
+
heading.style.cssText = 'margin:0 0 3px;padding:0 6px;color:var(--fps-editor-muted-strong);font-size:11px;font-weight:800';
|
|
378
|
+
section.appendChild(heading);
|
|
379
|
+
menuSurface.appendChild(section);
|
|
380
|
+
}
|
|
381
|
+
const menuButton = button(item.path.slice(1).join(' / ') || item.entry.manifest.title);
|
|
382
|
+
menuButton.setAttribute('role', 'menuitem');
|
|
383
|
+
menuButton.disabled = !item.entry.availability.available;
|
|
384
|
+
menuButton.style.cssText += [
|
|
385
|
+
'width:100%',
|
|
386
|
+
'justify-content:space-between',
|
|
387
|
+
'text-align:left',
|
|
388
|
+
`opacity:${item.entry.availability.available ? '1' : '.45'}`,
|
|
389
|
+
].join(';');
|
|
390
|
+
const shortcut = item.entry.manifest.presentation?.shortcut;
|
|
391
|
+
if (shortcut) {
|
|
392
|
+
const shortcutLabel = doc.createElement('span');
|
|
393
|
+
shortcutLabel.textContent = shortcut;
|
|
394
|
+
shortcutLabel.style.cssText = 'margin-left:auto;color:var(--fps-editor-muted);font-size:10px';
|
|
395
|
+
menuButton.appendChild(shortcutLabel);
|
|
396
|
+
}
|
|
397
|
+
if (!item.entry.availability.available) {
|
|
398
|
+
menuButton.title = item.entry.availability.reasons.map(reason => reason.message).join('; ');
|
|
399
|
+
}
|
|
400
|
+
menuButton.addEventListener('click', () => { void activateEntry(item.entry); });
|
|
401
|
+
section?.appendChild(menuButton);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function renderEntries() {
|
|
405
|
+
list.replaceChildren();
|
|
406
|
+
entries.forEach((entry, index) => {
|
|
407
|
+
const row = doc.createElement('button');
|
|
408
|
+
row.type = 'button';
|
|
409
|
+
row.setAttribute('role', 'option');
|
|
410
|
+
row.setAttribute('aria-selected', index === selectedIndex ? 'true' : 'false');
|
|
411
|
+
row.disabled = !entry.availability.available;
|
|
412
|
+
row.style.cssText = [
|
|
413
|
+
'width:100%', 'display:grid', 'grid-template-columns:minmax(0,1fr) auto', 'gap:8px',
|
|
414
|
+
'padding:8px 10px', 'border:0', 'border-radius:3px', 'text-align:left',
|
|
415
|
+
`background:${index === selectedIndex ? 'var(--fps-editor-row-selected)' : 'transparent'}`,
|
|
416
|
+
`color:${index === selectedIndex ? 'var(--fps-editor-row-selected-text)' : 'var(--fps-editor-text)'}`,
|
|
417
|
+
`opacity:${entry.availability.available ? '1' : '.45'}`,
|
|
418
|
+
`cursor:${entry.availability.available ? 'pointer' : 'not-allowed'}`,
|
|
419
|
+
].join(';');
|
|
420
|
+
const main = doc.createElement('span');
|
|
421
|
+
main.style.cssText = 'min-width:0;display:flex;flex-direction:column;gap:2px';
|
|
422
|
+
const title = doc.createElement('strong');
|
|
423
|
+
title.textContent = `${favorites.has(entry.manifest.id) ? '★ ' : ''}${entry.manifest.title}`;
|
|
424
|
+
const id = doc.createElement('span');
|
|
425
|
+
id.textContent = entry.manifest.id;
|
|
426
|
+
id.style.cssText = 'color:var(--fps-editor-muted);font:11px var(--fps-editor-mono-font,monospace);overflow:hidden;text-overflow:ellipsis';
|
|
427
|
+
main.append(title, id);
|
|
428
|
+
if (!entry.availability.available) {
|
|
429
|
+
const reasonText = doc.createElement('span');
|
|
430
|
+
reasonText.textContent = entry.availability.reasons.map(item => item.message).join('; ');
|
|
431
|
+
reasonText.style.cssText = 'color:var(--fps-editor-disabled-text);font-size:10px';
|
|
432
|
+
main.append(reasonText);
|
|
433
|
+
}
|
|
434
|
+
const meta = doc.createElement('span');
|
|
435
|
+
meta.textContent = formatLocalEditorCommandMetadata(entry.manifest);
|
|
436
|
+
meta.style.cssText = 'align-self:center;color:var(--fps-editor-muted-strong);font-size:10px;white-space:nowrap';
|
|
437
|
+
row.append(main, meta);
|
|
438
|
+
if (!entry.availability.available) {
|
|
439
|
+
const reason = entry.availability.reasons.map(item => item.message).join('; ');
|
|
440
|
+
row.title = reason;
|
|
441
|
+
row.setAttribute('aria-description', reason);
|
|
442
|
+
}
|
|
443
|
+
row.addEventListener('pointerenter', () => { selectedIndex = index; }, { once: true });
|
|
444
|
+
row.addEventListener('click', () => { selectedIndex = index; void activateEntry(entry); });
|
|
445
|
+
row.addEventListener('contextmenu', (event) => {
|
|
446
|
+
event.preventDefault();
|
|
447
|
+
if (favorites.has(entry.manifest.id))
|
|
448
|
+
favorites.delete(entry.manifest.id);
|
|
449
|
+
else
|
|
450
|
+
favorites.add(entry.manifest.id);
|
|
451
|
+
writeStringList(doc, `${storageKey}:favorites`, [...favorites]);
|
|
452
|
+
void refresh(search.value);
|
|
453
|
+
});
|
|
454
|
+
list.appendChild(row);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
async function activateEntry(entry) {
|
|
458
|
+
if (!entry.availability.available)
|
|
459
|
+
return;
|
|
460
|
+
if (canInvokeWithoutInput(entry.manifest)) {
|
|
461
|
+
await invoke(entry.manifest, {});
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
showConsole(true);
|
|
465
|
+
consoleInput.value = `${entry.manifest.id} ${JSON.stringify(createSchemaInputTemplate(entry.manifest.inputSchema), null, 2)}`;
|
|
466
|
+
consoleInput.focus();
|
|
467
|
+
}
|
|
468
|
+
function showConsole(value) {
|
|
469
|
+
consoleSurface.style.display = value ? 'flex' : 'none';
|
|
470
|
+
menuSurface.style.display = 'none';
|
|
471
|
+
list.style.display = value ? 'none' : 'block';
|
|
472
|
+
search.style.display = value ? 'none' : 'block';
|
|
473
|
+
paletteTab.style.background = value ? 'var(--fps-editor-button)' : 'var(--fps-editor-button-active)';
|
|
474
|
+
menuTab.style.background = 'var(--fps-editor-button)';
|
|
475
|
+
consoleTab.style.background = value ? 'var(--fps-editor-button-active)' : 'var(--fps-editor-button)';
|
|
476
|
+
if (value)
|
|
477
|
+
consoleInput.focus();
|
|
478
|
+
else
|
|
479
|
+
search.focus();
|
|
480
|
+
}
|
|
481
|
+
function showMenu() {
|
|
482
|
+
consoleSurface.style.display = 'none';
|
|
483
|
+
list.style.display = 'none';
|
|
484
|
+
menuSurface.style.display = 'block';
|
|
485
|
+
search.style.display = 'none';
|
|
486
|
+
paletteTab.style.background = 'var(--fps-editor-button)';
|
|
487
|
+
menuTab.style.background = 'var(--fps-editor-button-active)';
|
|
488
|
+
consoleTab.style.background = 'var(--fps-editor-button)';
|
|
489
|
+
}
|
|
490
|
+
async function runConsole() {
|
|
491
|
+
try {
|
|
492
|
+
const instruction = parseLocalEditorCommandConsole(consoleInput.value);
|
|
493
|
+
if (instruction.kind === 'help') {
|
|
494
|
+
if (!instruction.commandId) {
|
|
495
|
+
output.textContent = '语法: <command-id> [JSON] | help [id] | search <query> | history | rerun <index>';
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
output.textContent = format(await options.client.request({ kind: 'commands.describe', commandId: instruction.commandId }));
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (instruction.kind === 'search') {
|
|
502
|
+
showConsole(false);
|
|
503
|
+
search.value = instruction.query;
|
|
504
|
+
await refresh(instruction.query);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (instruction.kind === 'history') {
|
|
508
|
+
output.textContent = format(history.map((entry, index) => ({ index: index + 1, commandId: entry.commandId, input: entry.input, status: entry.operation?.status, timestamp: entry.timestamp })));
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (instruction.kind === 'rerun') {
|
|
512
|
+
const previous = history[instruction.index - 1];
|
|
513
|
+
if (!previous)
|
|
514
|
+
throw new Error(`History entry does not exist: ${instruction.index}`);
|
|
515
|
+
const manifest = await describe(previous.commandId);
|
|
516
|
+
await invoke(manifest, previous.input);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const manifest = await describe(instruction.commandId);
|
|
520
|
+
await invoke(manifest, instruction.input);
|
|
521
|
+
}
|
|
522
|
+
catch (error) {
|
|
523
|
+
output.textContent = format({ ok: false, error: error instanceof Error ? error.message : String(error) });
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
async function describe(commandId) {
|
|
527
|
+
const response = await options.client.request({ kind: 'commands.describe', commandId });
|
|
528
|
+
if (!response.ok || response.kind !== 'command' || !response.command)
|
|
529
|
+
throw new Error(`Command is not registered: ${commandId}`);
|
|
530
|
+
if (!response.command.availability.available)
|
|
531
|
+
throw new Error(response.command.availability.reasons.map(reason => reason.message).join('; ') || `Command is unavailable: ${commandId}`);
|
|
532
|
+
return response.command.manifest;
|
|
533
|
+
}
|
|
534
|
+
async function invoke(manifest, input) {
|
|
535
|
+
const requestId = createId();
|
|
536
|
+
let expectedServiceRevision;
|
|
537
|
+
let expectedServiceInstanceId;
|
|
538
|
+
if (manifest.access === 'write') {
|
|
539
|
+
const status = await options.client.request({ kind: 'status' });
|
|
540
|
+
if (!status.ok || status.kind !== 'status')
|
|
541
|
+
throw new Error('Editor Service status is unavailable.');
|
|
542
|
+
expectedServiceRevision = status.status.documentRevision;
|
|
543
|
+
expectedServiceInstanceId = status.status.serviceInstanceId;
|
|
544
|
+
}
|
|
545
|
+
const invocation = {
|
|
546
|
+
commandId: manifest.id,
|
|
547
|
+
input,
|
|
548
|
+
requestId,
|
|
549
|
+
...(manifest.access === 'write' ? { idempotencyKey: createId() } : {}),
|
|
550
|
+
...(expectedServiceRevision !== undefined ? {
|
|
551
|
+
expectedRevision: {
|
|
552
|
+
serviceInstanceId: expectedServiceInstanceId,
|
|
553
|
+
document: expectedServiceRevision,
|
|
554
|
+
},
|
|
555
|
+
} : {}),
|
|
556
|
+
principal: { type: 'human' },
|
|
557
|
+
source: 'browser-ui',
|
|
558
|
+
...(options.clientId ? { clientId: options.clientId } : {}),
|
|
559
|
+
};
|
|
560
|
+
const response = await options.client.request({ kind: 'command.invoke', invocation, timeoutMs: 10000 });
|
|
561
|
+
const operation = response.ok && response.kind === 'operation' ? response.operation : null;
|
|
562
|
+
history.unshift({ commandId: manifest.id, input, operation, timestamp: Date.now() });
|
|
563
|
+
history.splice(HISTORY_LIMIT);
|
|
564
|
+
writeHistory(doc, `${storageKey}:history`, history);
|
|
565
|
+
output.textContent = format(response);
|
|
566
|
+
showConsole(true);
|
|
567
|
+
}
|
|
568
|
+
async function injectSelection() {
|
|
569
|
+
const selection = options.getSelectionIds?.();
|
|
570
|
+
if (!selection)
|
|
571
|
+
return;
|
|
572
|
+
let instruction;
|
|
573
|
+
try {
|
|
574
|
+
instruction = parseLocalEditorCommandConsole(consoleInput.value);
|
|
575
|
+
}
|
|
576
|
+
catch {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
if (instruction.kind !== 'invoke' || !instruction.input || typeof instruction.input !== 'object' || Array.isArray(instruction.input))
|
|
580
|
+
return;
|
|
581
|
+
const manifest = await describe(instruction.commandId);
|
|
582
|
+
const input = applyLocalEditorCommandSelection(manifest, instruction.input, selection);
|
|
583
|
+
consoleInput.value = `${instruction.commandId} ${JSON.stringify(input, null, 2)}`;
|
|
584
|
+
}
|
|
585
|
+
function button(label) {
|
|
586
|
+
const element = doc.createElement('button');
|
|
587
|
+
element.type = 'button';
|
|
588
|
+
element.textContent = label;
|
|
589
|
+
element.style.cssText = 'padding:5px 9px;border:1px solid var(--fps-editor-border);border-radius:3px;background:var(--fps-editor-button);color:var(--fps-editor-text);font:inherit;cursor:pointer';
|
|
590
|
+
return element;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function canInvokeWithoutInput(manifest) {
|
|
594
|
+
const required = manifest.inputSchema.required;
|
|
595
|
+
return manifest.presentation?.inputMode === 'none' || !Array.isArray(required) || required.length === 0;
|
|
596
|
+
}
|
|
597
|
+
function createSchemaInputTemplate(schema) {
|
|
598
|
+
const result = {};
|
|
599
|
+
const properties = schema.properties;
|
|
600
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
601
|
+
if (!properties || typeof properties !== 'object' || Array.isArray(properties))
|
|
602
|
+
return result;
|
|
603
|
+
for (const key of required) {
|
|
604
|
+
if (typeof key !== 'string')
|
|
605
|
+
continue;
|
|
606
|
+
const property = properties[key];
|
|
607
|
+
result[key] = property?.default ?? (property?.type === 'array' ? [] : property?.type === 'number' ? 0 : property?.type === 'boolean' ? false : property?.type === 'object' ? {} : '');
|
|
608
|
+
}
|
|
609
|
+
return result;
|
|
610
|
+
}
|
|
611
|
+
function readHistory(doc, key) {
|
|
612
|
+
try {
|
|
613
|
+
const value = JSON.parse(doc.defaultView?.localStorage.getItem(key) ?? '[]');
|
|
614
|
+
return Array.isArray(value) ? value.slice(0, HISTORY_LIMIT) : [];
|
|
615
|
+
}
|
|
616
|
+
catch {
|
|
617
|
+
return [];
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function writeHistory(doc, key, history) {
|
|
621
|
+
try {
|
|
622
|
+
doc.defaultView?.localStorage.setItem(key, JSON.stringify(history));
|
|
623
|
+
}
|
|
624
|
+
catch { /* client-local storage is optional */ }
|
|
625
|
+
}
|
|
626
|
+
function readStringList(doc, key) {
|
|
627
|
+
try {
|
|
628
|
+
const value = JSON.parse(doc.defaultView?.localStorage.getItem(key) ?? '[]');
|
|
629
|
+
return Array.isArray(value) ? value.filter(entry => typeof entry === 'string') : [];
|
|
630
|
+
}
|
|
631
|
+
catch {
|
|
632
|
+
return [];
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function writeStringList(doc, key, value) {
|
|
636
|
+
try {
|
|
637
|
+
doc.defaultView?.localStorage.setItem(key, JSON.stringify(value));
|
|
638
|
+
}
|
|
639
|
+
catch { /* client-local storage is optional */ }
|
|
640
|
+
}
|
|
641
|
+
function format(value) {
|
|
642
|
+
return JSON.stringify(value, null, 2);
|
|
643
|
+
}
|
|
644
|
+
function createId() {
|
|
645
|
+
return globalThis.crypto?.randomUUID?.() ?? `command-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
646
|
+
}
|
|
647
|
+
function toJsonValue(value) {
|
|
648
|
+
return JSON.parse(JSON.stringify(value ?? null));
|
|
649
|
+
}
|
|
650
|
+
//# sourceMappingURL=local-editor-command-center.js.map
|