@fps-games/editor 0.2.1-beta.1 → 0.2.1-beta.3
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/agent-bridge/capabilities/ui-regions.d.ts.map +1 -1
- package/dist/agent-bridge/capabilities/ui-regions.js +16 -0
- package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -1
- package/dist/build-info.json +46 -46
- package/dist/internal/material-preview.d.ts +22 -0
- package/dist/internal/material-preview.d.ts.map +1 -0
- package/dist/internal/material-preview.js +186 -0
- package/dist/internal/material-preview.js.map +1 -0
- package/dist/internal/project-model-preview.d.ts +4 -0
- package/dist/internal/project-model-preview.d.ts.map +1 -0
- package/dist/internal/project-model-preview.js +359 -0
- package/dist/internal/project-model-preview.js.map +1 -0
- package/dist/local-editor-agent-context.d.ts +12 -1
- package/dist/local-editor-agent-context.d.ts.map +1 -1
- package/dist/local-editor-agent-context.js +47 -0
- package/dist/local-editor-agent-context.js.map +1 -1
- package/dist/local-editor-harness.d.ts +15 -2
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +326 -28
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-tools.d.ts +1 -0
- package/dist/local-editor-tools.d.ts.map +1 -1
- package/dist/local-editor-tools.js +3 -0
- package/dist/local-editor-tools.js.map +1 -1
- package/dist/playable-babylon-rendering.d.ts +8 -7
- package/dist/playable-babylon-rendering.d.ts.map +1 -1
- package/dist/playable-babylon-rendering.js +77 -32
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +4 -0
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +27 -0
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-product-projection-preview.d.ts +2 -0
- package/dist/playable-product-projection-preview.d.ts.map +1 -1
- package/dist/playable-product-projection-preview.js +7 -4
- package/dist/playable-product-projection-preview.js.map +1 -1
- package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
- package/dist/playable-product-scene-capabilities.js +9 -3
- package/dist/playable-product-scene-capabilities.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 +1 -1
- package/dist/playable-sdk.js.map +1 -1
- package/dist/playable-standard-project.d.ts +0 -1
- package/dist/playable-standard-project.d.ts.map +1 -1
- package/dist/playable-standard-project.js +17 -5
- package/dist/playable-standard-project.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.d.ts +4 -2
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.js +301 -121
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/profile.js +5 -4
- package/node_modules/@fps-games/babylon-renderer/dist/environment/profile.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.d.ts +4 -4
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.js +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.d.ts +2 -0
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.js +12 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.d.ts +6 -3
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.js +100 -39
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/reference.d.ts +1 -3
- package/node_modules/@fps-games/babylon-renderer/dist/reference.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/reference.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +11 -8
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js +24 -0
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +10 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +96 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js +85 -22
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts +2 -0
- 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 +150 -4
- 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 +1 -0
- 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 +249 -15
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.d.ts +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +6 -6
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts +35 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js +136 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts +46 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js +283 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts +12 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js +67 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts +6 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts +7 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js +20 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js +219 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts +14 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js +42 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts +27 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js +288 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +29 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +20 -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 +321 -60
- 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-prefab-stage.d.ts +2 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +4 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +63 -3
- 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-workbench.d.ts +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +88 -16
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +2 -1
- 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 +1463 -356
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts +13 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js +15 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/package.json +7 -7
- package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-tools.js +3 -1
- package/node_modules/@fps-games/editor-core/dist/editor-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +11 -2
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js +12 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +6 -6
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js +10 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js +15 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts +6 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js +10 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js +86 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js +76 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts +34 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +4 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js +1 -5
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts +4 -0
- 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 +40 -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/upgrade-doctor/inspectors.js +53 -0
- 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/upgrade-doctor/types.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +1 -0
- 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 +1 -0
- 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/product-authoring-api.d.ts +1 -0
- 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 +94 -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-file-handle.d.ts +14 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js +101 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts +23 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js +180 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +23 -3
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent.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/dist/editor-ui-theme.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js +103 -10
- package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js.map +1 -1
- package/node_modules/@fps-games/editor-ui/package.json +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.d.ts +1 -0
- package/node_modules/@fps-games/playable-assets/dist/identity.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.js +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.js.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/playable-assets/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/index.js +1 -0
- package/node_modules/@fps-games/playable-assets/dist/index.js.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.d.ts +46 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.js +109 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.js.map +1 -0
- 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/dist/runtime.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/runtime.js +5 -0
- package/node_modules/@fps-games/playable-runtime/dist/runtime.js.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/types.d.ts +2 -0
- package/node_modules/@fps-games/playable-runtime/dist/types.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/types.js.map +1 -1
- 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/reference.d.ts.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/reference.js +11 -4
- package/node_modules/@fps-games/plugin-assets/dist/reference.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/renderer.d.ts +8 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.d.ts.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.js +13 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.js.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.d.ts +12 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.d.ts.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.js +8 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.js.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/runtime.d.ts +2 -1
- package/node_modules/@fps-games/plugin-assets/dist/runtime.d.ts.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/runtime.js +3 -0
- package/node_modules/@fps-games/plugin-assets/dist/runtime.js.map +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 +32 -8
- 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 +24 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aliases.js","sourceRoot":"","sources":["../../src/package-resolution/aliases.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,mBAAmB;IACnB,wBAAwB;IACxB,6BAA6B;IAC7B,oCAAoC;IACpC,sCAAsC;IACtC,2BAA2B;IAC3B,gCAAgC;IAChC,gCAAgC;IAChC,uBAAuB;IACvB,6BAA6B;IAC7B,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AM,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrG,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,QAAQ,IAAI,GAAG,CAAC;AACzB,CAAC","sourcesContent":["import type {\n PlayableEditorBundledPackageRoots,\n PlayableEditorBundledPackageRootsOptions,\n PlayableEditorBundledPackageAliasPlanOptions,\n PlayableEditorFileExists,\n PlayableEditorMissingPackageAliasFile,\n PlayableEditorPackageAliasPlan,\n PlayableEditorPackageAliasPlanEntry,\n PlayableEditorPathResolver,\n PlayableEditorSourcePackageAliasPlanOptions,\n PlayableEditorSourceTsconfigPathsPlanOptions,\n PlayableEditorTsconfigPathsPlan,\n} from './types';\n\nexport const PLAYABLE_EDITOR_PACKAGE_IDS = [\n '@fps-games/editor',\n '@fps-games/editor/vite',\n '@fps-games/babylon-renderer',\n '@fps-games/babylon-renderer/config',\n '@fps-games/babylon-renderer/renderer',\n '@fps-games/editor-tooling',\n '@fps-games/editor-tooling/node',\n '@fps-games/editor-tooling/vite',\n '@fps-games/plugin-api',\n '@fps-games/plugin-hierarchy',\n '@fps-games/plugin-hierarchy/editor',\n '@fps-games/plugin-assets',\n '@fps-games/plugin-assets/runtime',\n '@fps-games/plugin-materials',\n '@fps-games/plugin-materials/runtime',\n '@fps-games/plugin-markers',\n '@fps-games/plugin-markers/runtime',\n '@fps-games/plugin-rendering',\n '@fps-games/plugin-rendering/runtime',\n '@fps-games/plugin-shadows',\n '@fps-games/plugin-shadows/runtime',\n '@fps-games/plugin-shadow-map-experiment',\n '@fps-games/plugin-shadow-map-experiment/runtime',\n '@fps-games/plugin-host',\n '@fps-games/plugin-scene',\n '@fps-games/plugin-scene/runtime',\n '@fps-games/playable-assets',\n '@fps-games/playable-contracts',\n '@fps-games/playable-rendering',\n '@fps-games/playable-rendering/runtime',\n '@fps-games/playable-runtime',\n '@fps-games/playable-runtime-data',\n '@fps-games/playable-scene',\n '@fps-games/editor/playable-runtime',\n '@fps-games/editor/playable-runtime/babylon',\n '@fps-games/editor/playable-sdk',\n '@fps-games/editor/playable-sdk/upgrade-doctor',\n '@fps-games/editor/playable-sdk/vite',\n '@fps-games/editor-playable-sdk',\n '@fps-games/editor-playable-sdk/upgrade-doctor',\n '@fps-games/editor-playable-sdk/vite',\n '@fps-games/editor-babylon',\n '@fps-games/editor-browser',\n '@fps-games/editor-core',\n '@fps-games/editor-core/plugin-host',\n '@fps-games/editor-forge-play',\n '@fps-games/editor-protocol',\n '@fps-games/editor-ui',\n '@playcanvas/observer',\n '@playcanvas/pcui',\n 'semver',\n] as const;\n\nconst SOURCE_ALIAS_FILES = [\n ['@fps-games/editor/vite', 'packages/editor/src/vite.ts'],\n ['@fps-games/babylon-renderer/config', 'packages/babylon-renderer/src/reference.ts'],\n ['@fps-games/babylon-renderer/renderer', 'packages/babylon-renderer/src/plugin.ts'],\n ['@fps-games/editor-tooling/node', 'packages/editor-tooling/src/package-metadata-node.ts'],\n ['@fps-games/editor-tooling/vite', 'packages/editor-tooling/src/vite.ts'],\n ['@fps-games/editor-tooling', 'packages/editor-tooling/src/index.ts'],\n ['@fps-games/plugin-api', 'packages/plugin-api/src/index.ts'],\n ['@fps-games/plugin-hierarchy/editor', 'packages/plugin-hierarchy/src/editor.ts'],\n ['@fps-games/plugin-hierarchy', 'packages/plugin-hierarchy/src/reference.ts'],\n ['@fps-games/plugin-assets/runtime', 'packages/plugin-assets/src/runtime.ts'],\n ['@fps-games/plugin-assets', 'packages/plugin-assets/src/reference.ts'],\n ['@fps-games/plugin-materials/runtime', 'packages/plugin-materials/src/runtime.ts'],\n ['@fps-games/plugin-materials', 'packages/plugin-materials/src/reference.ts'],\n ['@fps-games/plugin-markers/runtime', 'packages/plugin-markers/src/runtime.ts'],\n ['@fps-games/plugin-markers', 'packages/plugin-markers/src/reference.ts'],\n ['@fps-games/plugin-rendering/runtime', 'packages/plugin-rendering/src/runtime.ts'],\n ['@fps-games/plugin-rendering', 'packages/plugin-rendering/src/reference.ts'],\n ['@fps-games/plugin-shadows/runtime', 'packages/plugin-shadows/src/runtime.ts'],\n ['@fps-games/plugin-shadows', 'packages/plugin-shadows/src/reference.ts'],\n ['@fps-games/plugin-shadow-map-experiment/runtime', 'packages/plugin-shadow-map-experiment/src/runtime.ts'],\n ['@fps-games/plugin-shadow-map-experiment', 'packages/plugin-shadow-map-experiment/src/reference.ts'],\n ['@fps-games/plugin-host', 'packages/plugin-host/src/index.ts'],\n ['@fps-games/plugin-scene/runtime', 'packages/plugin-scene/src/runtime.ts'],\n ['@fps-games/plugin-scene', 'packages/plugin-scene/src/reference.ts'],\n ['@fps-games/playable-assets', 'packages/playable-assets/src/index.ts'],\n ['@fps-games/playable-contracts', 'packages/playable-contracts/src/index.ts'],\n ['@fps-games/playable-rendering/runtime', 'packages/playable-rendering/src/runtime.ts'],\n ['@fps-games/playable-rendering', 'packages/playable-rendering/src/index.ts'],\n ['@fps-games/playable-runtime', 'packages/playable-runtime/src/index.ts'],\n ['@fps-games/playable-runtime-data', 'packages/playable-runtime-data/src/index.ts'],\n ['@fps-games/playable-scene', 'packages/playable-scene/src/index.ts'],\n ['@fps-games/editor/playable-runtime/babylon', 'packages/editor/src/playable-runtime-babylon.ts'],\n ['@fps-games/editor/playable-runtime', 'packages/editor/src/playable-runtime.ts'],\n ['@fps-games/editor/playable-sdk', 'packages/editor/src/playable-sdk.ts'],\n ['@fps-games/editor/playable-sdk/upgrade-doctor', 'packages/editor/src/playable-sdk-upgrade-doctor.ts'],\n ['@fps-games/editor/playable-sdk/vite', 'packages/editor/src/playable-sdk-vite.ts'],\n ['@fps-games/editor-playable-sdk', 'packages/editor-playable-sdk/src/index.ts'],\n ['@fps-games/editor-playable-sdk/upgrade-doctor', 'packages/editor-playable-sdk/src/upgrade-doctor/index.ts'],\n ['@fps-games/editor-playable-sdk/vite', 'packages/editor-playable-sdk/src/vite/index.ts'],\n ['@fps-games/babylon-renderer', 'packages/babylon-renderer/src/index.ts'],\n ['@fps-games/editor-babylon', 'packages/editor-babylon/src/index.ts'],\n ['@fps-games/editor-browser', 'packages/editor-browser/src/index.ts'],\n ['@fps-games/editor-core', 'packages/editor-core/src/index.ts'],\n ['@fps-games/editor-core/plugin-host', 'packages/editor-core/src/editor-plugin-host.ts'],\n ['@fps-games/editor-forge-play', 'packages/editor-forge-play/src/index.ts'],\n ['@fps-games/editor-protocol', 'packages/editor-protocol/src/index.ts'],\n ['@fps-games/editor-ui', 'packages/editor-ui/src/index.ts'],\n ['@fps-games/editor', 'packages/editor/src/index.ts'],\n] as const;\n\nconst SOURCE_RUNTIME_ALIAS_FILES = [\n ['semver', 'node_modules/semver/index.js'],\n] as const;\n\nconst BUNDLED_ALIAS_FILES = [\n ['@fps-games/plugin-hierarchy/editor', 'plugin-hierarchy/dist/editor.js'],\n ['@fps-games/plugin-hierarchy', 'plugin-hierarchy/dist/reference.js'],\n ['@fps-games/editor-playable-sdk/upgrade-doctor', 'editor-playable-sdk/dist/upgrade-doctor/index.js'],\n ['@fps-games/editor-playable-sdk/vite', 'editor-playable-sdk/dist/vite/index.js'],\n ['@fps-games/editor-babylon', 'editor-babylon/dist/index.js'],\n ['@fps-games/editor-browser', 'editor-browser/dist/index.js'],\n ['@fps-games/editor-core', 'editor-core/dist/index.js'],\n ['@fps-games/editor-core/plugin-host', 'editor-core/dist/editor-plugin-host.js'],\n ['@fps-games/editor-forge-play', 'editor-forge-play/dist/index.js'],\n ['@fps-games/editor-protocol', 'editor-protocol/dist/index.js'],\n ['@fps-games/editor-ui', 'editor-ui/dist/index.js'],\n] as const;\n\nexport const PLAYABLE_EDITOR_BUNDLED_ALIAS_PACKAGE_IDS = [\n '@fps-games/babylon-renderer',\n ...BUNDLED_ALIAS_FILES.map(([packageId]) => packageId),\n 'semver',\n] as const;\n\nexport function createPlayableEditorSourcePackageAliasPlan(\n repoRoot: string,\n options: PlayableEditorSourcePackageAliasPlanOptions = {},\n): PlayableEditorPackageAliasPlan {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n return {\n entries: [...SOURCE_ALIAS_FILES, ...SOURCE_RUNTIME_ALIAS_FILES].map(([packageId, file]) => ({\n packageId,\n file: resolvePath(repoRoot, ...file.split('/')),\n })),\n };\n}\n\nexport function createPlayableEditorSourceTsconfigPathsPlan(\n repoRoot: string,\n options: PlayableEditorSourceTsconfigPathsPlanOptions = {},\n): PlayableEditorTsconfigPathsPlan {\n const aliasPlan = createPlayableEditorSourcePackageAliasPlan(repoRoot, {\n resolvePath: options.resolvePath,\n });\n const relativePath = options.relativePath ?? relativePlayableEditorPath;\n const paths: Record<string, string[]> = {};\n for (const entry of aliasPlan.entries) {\n if (entry.packageId === 'semver') continue;\n const override = options.pathOverrides?.[entry.packageId];\n paths[entry.packageId] = override\n ? normalizeTsconfigPathList(override)\n : [\n options.projectRoot\n ? normalizePlayableEditorPath(relativePath(options.projectRoot, entry.file))\n : normalizePlayableEditorPath(entry.file),\n ];\n }\n return { paths };\n}\n\nexport function createPlayableEditorBundledPackageRoots(\n projectRoot: string,\n options: PlayableEditorBundledPackageRootsOptions = {},\n): PlayableEditorBundledPackageRoots {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n return {\n bundledEditorPackagesRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'node_modules', '@fps-games'),\n bundledEditorNodeModulesRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'node_modules'),\n directBabylonRendererPackageRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'babylon-renderer'),\n editorPackageJsonPath: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'package.json'),\n };\n}\n\nexport function createPlayableEditorBundledPackageAliasPlan(\n options: PlayableEditorBundledPackageAliasPlanOptions,\n): PlayableEditorPackageAliasPlan {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n const entries: PlayableEditorPackageAliasPlanEntry[] = BUNDLED_ALIAS_FILES.map(([packageId, file]) => ({\n packageId,\n file: resolvePath(options.bundledEditorPackagesRoot, ...file.split('/')),\n }));\n const rendererFile = resolveBundledBabylonRendererAliasFile(options, resolvePath);\n const rendererDirectory = rendererFile.slice(0, rendererFile.lastIndexOf('/'));\n const rendererSource = rendererFile.endsWith('/src/index.ts');\n entries.unshift(\n {\n packageId: '@fps-games/babylon-renderer/config',\n file: resolvePath(rendererDirectory, rendererSource ? 'reference.ts' : 'reference.js'),\n },\n {\n packageId: '@fps-games/babylon-renderer/renderer',\n file: resolvePath(rendererDirectory, rendererSource ? 'plugin.ts' : 'plugin.js'),\n },\n { packageId: '@fps-games/babylon-renderer', file: rendererFile },\n );\n entries.push({\n packageId: 'semver',\n file: resolvePath(\n options.bundledEditorNodeModulesRoot\n ?? parentPlayableEditorPath(options.bundledEditorPackagesRoot),\n 'semver',\n 'index.js',\n ),\n });\n return { entries };\n}\n\nexport function collectMissingPlayableEditorPackageAliasFiles(\n plan: PlayableEditorPackageAliasPlan,\n fileExists: PlayableEditorFileExists,\n): PlayableEditorMissingPackageAliasFile[] {\n return plan.entries\n .filter(entry => !fileExists(entry.file))\n .map(entry => ({ packageId: entry.packageId, file: entry.file }));\n}\n\nexport function formatPlayableEditorPackageAliasPlanError(\n missing: readonly PlayableEditorMissingPackageAliasFile[],\n intro = 'The @fps-games editor package aliases point to missing files.',\n): string {\n return [\n intro,\n ...missing.map(entry => `- ${entry.packageId}: ${entry.file}`),\n ].join('\\n');\n}\n\nfunction resolveBundledBabylonRendererAliasFile(\n options: PlayableEditorBundledPackageAliasPlanOptions,\n resolvePath: PlayableEditorPathResolver,\n): string {\n return resolvePath(options.bundledEditorPackagesRoot, 'babylon-renderer', 'dist', 'index.js');\n}\n\nfunction joinPlayableEditorPath(...segments: string[]): string {\n return segments\n .filter(segment => segment.length > 0)\n .join('/')\n .replace(/\\/+/g, '/');\n}\n\nfunction normalizePlayableEditorPath(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+/g, '/');\n}\n\nfunction parentPlayableEditorPath(value: string): string {\n const normalized = normalizePlayableEditorPath(value).replace(/\\/$/, '');\n const separator = normalized.lastIndexOf('/');\n return separator > 0 ? normalized.slice(0, separator) : '.';\n}\n\nfunction normalizeTsconfigPathList(value: string | string[]): string[] {\n return (Array.isArray(value) ? value : [value]).map(normalizePlayableEditorPath);\n}\n\nfunction relativePlayableEditorPath(from: string, to: string): string {\n const fromPath = normalizePlayableEditorPath(from).replace(/\\/$/, '');\n const toPath = normalizePlayableEditorPath(to).replace(/\\/$/, '');\n const fromParts = fromPath.split('/').filter(Boolean);\n const toParts = toPath.split('/').filter(Boolean);\n let common = 0;\n while (common < fromParts.length && common < toParts.length && fromParts[common] === toParts[common]) {\n common += 1;\n }\n const up = fromParts.slice(common).map(() => '..');\n const down = toParts.slice(common);\n const relative = [...up, ...down].join('/');\n return relative || '.';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aliases.js","sourceRoot":"","sources":["../../src/package-resolution/aliases.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,mBAAmB;IACnB,wBAAwB;IACxB,6BAA6B;IAC7B,oCAAoC;IACpC,sCAAsC;IACtC,2BAA2B;IAC3B,gCAAgC;IAChC,gCAAgC;IAChC,uBAAuB;IACvB,6BAA6B;IAC7B,oCAAoC;IACpC,0BAA0B;IAC1B,kCAAkC;IAClC,mCAAmC;IACnC,oCAAoC;IACpC,6BAA6B;IAC7B,qCAAqC;IACrC,2BAA2B;IAC3B,mCAAmC;IACnC,6BAA6B;IAC7B,qCAAqC;IAC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AC,MAAM,CAAC,EAAE,CAAC;QACrG,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,QAAQ,IAAI,GAAG,CAAC;AACzB,CAAC","sourcesContent":["import type {\n PlayableEditorBundledPackageRoots,\n PlayableEditorBundledPackageRootsOptions,\n PlayableEditorBundledPackageAliasPlanOptions,\n PlayableEditorFileExists,\n PlayableEditorMissingPackageAliasFile,\n PlayableEditorPackageAliasPlan,\n PlayableEditorPackageAliasPlanEntry,\n PlayableEditorPathResolver,\n PlayableEditorSourcePackageAliasPlanOptions,\n PlayableEditorSourceTsconfigPathsPlanOptions,\n PlayableEditorTsconfigPathsPlan,\n} from './types';\n\nexport const PLAYABLE_EDITOR_PACKAGE_IDS = [\n '@fps-games/editor',\n '@fps-games/editor/vite',\n '@fps-games/babylon-renderer',\n '@fps-games/babylon-renderer/config',\n '@fps-games/babylon-renderer/renderer',\n '@fps-games/editor-tooling',\n '@fps-games/editor-tooling/node',\n '@fps-games/editor-tooling/vite',\n '@fps-games/plugin-api',\n '@fps-games/plugin-hierarchy',\n '@fps-games/plugin-hierarchy/editor',\n '@fps-games/plugin-assets',\n '@fps-games/plugin-assets/runtime',\n '@fps-games/plugin-assets/renderer',\n '@fps-games/plugin-assets/resources',\n '@fps-games/plugin-materials',\n '@fps-games/plugin-materials/runtime',\n '@fps-games/plugin-markers',\n '@fps-games/plugin-markers/runtime',\n '@fps-games/plugin-rendering',\n '@fps-games/plugin-rendering/runtime',\n '@fps-games/plugin-shadows',\n '@fps-games/plugin-shadows/runtime',\n '@fps-games/plugin-shadow-map-experiment',\n '@fps-games/plugin-shadow-map-experiment/runtime',\n '@fps-games/plugin-host',\n '@fps-games/plugin-scene',\n '@fps-games/plugin-scene/runtime',\n '@fps-games/playable-assets',\n '@fps-games/playable-contracts',\n '@fps-games/playable-rendering',\n '@fps-games/playable-rendering/runtime',\n '@fps-games/playable-runtime',\n '@fps-games/playable-runtime-data',\n '@fps-games/playable-scene',\n '@fps-games/editor/playable-runtime',\n '@fps-games/editor/playable-runtime/babylon',\n '@fps-games/editor/playable-sdk',\n '@fps-games/editor/playable-sdk/upgrade-doctor',\n '@fps-games/editor/playable-sdk/vite',\n '@fps-games/editor-playable-sdk',\n '@fps-games/editor-playable-sdk/upgrade-doctor',\n '@fps-games/editor-playable-sdk/vite',\n '@fps-games/editor-babylon',\n '@fps-games/editor-browser',\n '@fps-games/editor-core',\n '@fps-games/editor-core/plugin-host',\n '@fps-games/editor-forge-play',\n '@fps-games/editor-protocol',\n '@fps-games/editor-ui',\n '@playcanvas/observer',\n '@playcanvas/pcui',\n 'semver',\n] as const;\n\nconst SOURCE_ALIAS_FILES = [\n ['@fps-games/editor/vite', 'packages/editor/src/vite.ts'],\n ['@fps-games/babylon-renderer/config', 'packages/babylon-renderer/src/reference.ts'],\n ['@fps-games/babylon-renderer/renderer', 'packages/babylon-renderer/src/plugin.ts'],\n ['@fps-games/editor-tooling/node', 'packages/editor-tooling/src/package-metadata-node.ts'],\n ['@fps-games/editor-tooling/vite', 'packages/editor-tooling/src/vite.ts'],\n ['@fps-games/editor-tooling', 'packages/editor-tooling/src/index.ts'],\n ['@fps-games/plugin-api', 'packages/plugin-api/src/index.ts'],\n ['@fps-games/plugin-hierarchy/editor', 'packages/plugin-hierarchy/src/editor.ts'],\n ['@fps-games/plugin-hierarchy', 'packages/plugin-hierarchy/src/reference.ts'],\n ['@fps-games/plugin-assets/runtime', 'packages/plugin-assets/src/runtime.ts'],\n ['@fps-games/plugin-assets/renderer', 'packages/plugin-assets/src/renderer.ts'],\n ['@fps-games/plugin-assets/resources', 'packages/plugin-assets/src/resources.ts'],\n ['@fps-games/plugin-assets', 'packages/plugin-assets/src/reference.ts'],\n ['@fps-games/plugin-materials/runtime', 'packages/plugin-materials/src/runtime.ts'],\n ['@fps-games/plugin-materials', 'packages/plugin-materials/src/reference.ts'],\n ['@fps-games/plugin-markers/runtime', 'packages/plugin-markers/src/runtime.ts'],\n ['@fps-games/plugin-markers', 'packages/plugin-markers/src/reference.ts'],\n ['@fps-games/plugin-rendering/runtime', 'packages/plugin-rendering/src/runtime.ts'],\n ['@fps-games/plugin-rendering', 'packages/plugin-rendering/src/reference.ts'],\n ['@fps-games/plugin-shadows/runtime', 'packages/plugin-shadows/src/runtime.ts'],\n ['@fps-games/plugin-shadows', 'packages/plugin-shadows/src/reference.ts'],\n ['@fps-games/plugin-shadow-map-experiment/runtime', 'packages/plugin-shadow-map-experiment/src/runtime.ts'],\n ['@fps-games/plugin-shadow-map-experiment', 'packages/plugin-shadow-map-experiment/src/reference.ts'],\n ['@fps-games/plugin-host', 'packages/plugin-host/src/index.ts'],\n ['@fps-games/plugin-scene/runtime', 'packages/plugin-scene/src/runtime.ts'],\n ['@fps-games/plugin-scene', 'packages/plugin-scene/src/reference.ts'],\n ['@fps-games/playable-assets', 'packages/playable-assets/src/index.ts'],\n ['@fps-games/playable-contracts', 'packages/playable-contracts/src/index.ts'],\n ['@fps-games/playable-rendering/runtime', 'packages/playable-rendering/src/runtime.ts'],\n ['@fps-games/playable-rendering', 'packages/playable-rendering/src/index.ts'],\n ['@fps-games/playable-runtime', 'packages/playable-runtime/src/index.ts'],\n ['@fps-games/playable-runtime-data', 'packages/playable-runtime-data/src/index.ts'],\n ['@fps-games/playable-scene', 'packages/playable-scene/src/index.ts'],\n ['@fps-games/editor/playable-runtime/babylon', 'packages/editor/src/playable-runtime-babylon.ts'],\n ['@fps-games/editor/playable-runtime', 'packages/editor/src/playable-runtime.ts'],\n ['@fps-games/editor/playable-sdk', 'packages/editor/src/playable-sdk.ts'],\n ['@fps-games/editor/playable-sdk/upgrade-doctor', 'packages/editor/src/playable-sdk-upgrade-doctor.ts'],\n ['@fps-games/editor/playable-sdk/vite', 'packages/editor/src/playable-sdk-vite.ts'],\n ['@fps-games/editor-playable-sdk', 'packages/editor-playable-sdk/src/index.ts'],\n ['@fps-games/editor-playable-sdk/upgrade-doctor', 'packages/editor-playable-sdk/src/upgrade-doctor/index.ts'],\n ['@fps-games/editor-playable-sdk/vite', 'packages/editor-playable-sdk/src/vite/index.ts'],\n ['@fps-games/babylon-renderer', 'packages/babylon-renderer/src/index.ts'],\n ['@fps-games/editor-babylon', 'packages/editor-babylon/src/index.ts'],\n ['@fps-games/editor-browser', 'packages/editor-browser/src/index.ts'],\n ['@fps-games/editor-core', 'packages/editor-core/src/index.ts'],\n ['@fps-games/editor-core/plugin-host', 'packages/editor-core/src/editor-plugin-host.ts'],\n ['@fps-games/editor-forge-play', 'packages/editor-forge-play/src/index.ts'],\n ['@fps-games/editor-protocol', 'packages/editor-protocol/src/index.ts'],\n ['@fps-games/editor-ui', 'packages/editor-ui/src/index.ts'],\n ['@fps-games/editor', 'packages/editor/src/index.ts'],\n] as const;\n\nconst SOURCE_RUNTIME_ALIAS_FILES = [\n ['semver', 'node_modules/semver/index.js'],\n] as const;\n\nconst BUNDLED_ALIAS_FILES = [\n ['@fps-games/plugin-hierarchy/editor', 'plugin-hierarchy/dist/editor.js'],\n ['@fps-games/plugin-hierarchy', 'plugin-hierarchy/dist/reference.js'],\n ['@fps-games/editor-playable-sdk/upgrade-doctor', 'editor-playable-sdk/dist/upgrade-doctor/index.js'],\n ['@fps-games/editor-playable-sdk/vite', 'editor-playable-sdk/dist/vite/index.js'],\n ['@fps-games/editor-babylon', 'editor-babylon/dist/index.js'],\n ['@fps-games/editor-browser', 'editor-browser/dist/index.js'],\n ['@fps-games/editor-core', 'editor-core/dist/index.js'],\n ['@fps-games/editor-core/plugin-host', 'editor-core/dist/editor-plugin-host.js'],\n ['@fps-games/editor-forge-play', 'editor-forge-play/dist/index.js'],\n ['@fps-games/editor-protocol', 'editor-protocol/dist/index.js'],\n ['@fps-games/editor-ui', 'editor-ui/dist/index.js'],\n] as const;\n\nexport const PLAYABLE_EDITOR_BUNDLED_ALIAS_PACKAGE_IDS = [\n '@fps-games/babylon-renderer',\n ...BUNDLED_ALIAS_FILES.map(([packageId]) => packageId),\n 'semver',\n] as const;\n\nexport function createPlayableEditorSourcePackageAliasPlan(\n repoRoot: string,\n options: PlayableEditorSourcePackageAliasPlanOptions = {},\n): PlayableEditorPackageAliasPlan {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n return {\n entries: [...SOURCE_ALIAS_FILES, ...SOURCE_RUNTIME_ALIAS_FILES].map(([packageId, file]) => ({\n packageId,\n file: resolvePath(repoRoot, ...file.split('/')),\n })),\n };\n}\n\nexport function createPlayableEditorSourceTsconfigPathsPlan(\n repoRoot: string,\n options: PlayableEditorSourceTsconfigPathsPlanOptions = {},\n): PlayableEditorTsconfigPathsPlan {\n const aliasPlan = createPlayableEditorSourcePackageAliasPlan(repoRoot, {\n resolvePath: options.resolvePath,\n });\n const relativePath = options.relativePath ?? relativePlayableEditorPath;\n const paths: Record<string, string[]> = {};\n for (const entry of aliasPlan.entries) {\n if (entry.packageId === 'semver') continue;\n const override = options.pathOverrides?.[entry.packageId];\n paths[entry.packageId] = override\n ? normalizeTsconfigPathList(override)\n : [\n options.projectRoot\n ? normalizePlayableEditorPath(relativePath(options.projectRoot, entry.file))\n : normalizePlayableEditorPath(entry.file),\n ];\n }\n return { paths };\n}\n\nexport function createPlayableEditorBundledPackageRoots(\n projectRoot: string,\n options: PlayableEditorBundledPackageRootsOptions = {},\n): PlayableEditorBundledPackageRoots {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n return {\n bundledEditorPackagesRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'node_modules', '@fps-games'),\n bundledEditorNodeModulesRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'node_modules'),\n directBabylonRendererPackageRoot: resolvePath(projectRoot, 'node_modules', '@fps-games', 'babylon-renderer'),\n editorPackageJsonPath: resolvePath(projectRoot, 'node_modules', '@fps-games', 'editor', 'package.json'),\n };\n}\n\nexport function createPlayableEditorBundledPackageAliasPlan(\n options: PlayableEditorBundledPackageAliasPlanOptions,\n): PlayableEditorPackageAliasPlan {\n const resolvePath = options.resolvePath ?? joinPlayableEditorPath;\n const entries: PlayableEditorPackageAliasPlanEntry[] = BUNDLED_ALIAS_FILES.map(([packageId, file]) => ({\n packageId,\n file: resolvePath(options.bundledEditorPackagesRoot, ...file.split('/')),\n }));\n const rendererFile = resolveBundledBabylonRendererAliasFile(options, resolvePath);\n const rendererDirectory = rendererFile.slice(0, rendererFile.lastIndexOf('/'));\n const rendererSource = rendererFile.endsWith('/src/index.ts');\n entries.unshift(\n {\n packageId: '@fps-games/babylon-renderer/config',\n file: resolvePath(rendererDirectory, rendererSource ? 'reference.ts' : 'reference.js'),\n },\n {\n packageId: '@fps-games/babylon-renderer/renderer',\n file: resolvePath(rendererDirectory, rendererSource ? 'plugin.ts' : 'plugin.js'),\n },\n { packageId: '@fps-games/babylon-renderer', file: rendererFile },\n );\n entries.push({\n packageId: 'semver',\n file: resolvePath(\n options.bundledEditorNodeModulesRoot\n ?? parentPlayableEditorPath(options.bundledEditorPackagesRoot),\n 'semver',\n 'index.js',\n ),\n });\n return { entries };\n}\n\nexport function collectMissingPlayableEditorPackageAliasFiles(\n plan: PlayableEditorPackageAliasPlan,\n fileExists: PlayableEditorFileExists,\n): PlayableEditorMissingPackageAliasFile[] {\n return plan.entries\n .filter(entry => !fileExists(entry.file))\n .map(entry => ({ packageId: entry.packageId, file: entry.file }));\n}\n\nexport function formatPlayableEditorPackageAliasPlanError(\n missing: readonly PlayableEditorMissingPackageAliasFile[],\n intro = 'The @fps-games editor package aliases point to missing files.',\n): string {\n return [\n intro,\n ...missing.map(entry => `- ${entry.packageId}: ${entry.file}`),\n ].join('\\n');\n}\n\nfunction resolveBundledBabylonRendererAliasFile(\n options: PlayableEditorBundledPackageAliasPlanOptions,\n resolvePath: PlayableEditorPathResolver,\n): string {\n return resolvePath(options.bundledEditorPackagesRoot, 'babylon-renderer', 'dist', 'index.js');\n}\n\nfunction joinPlayableEditorPath(...segments: string[]): string {\n return segments\n .filter(segment => segment.length > 0)\n .join('/')\n .replace(/\\/+/g, '/');\n}\n\nfunction normalizePlayableEditorPath(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+/g, '/');\n}\n\nfunction parentPlayableEditorPath(value: string): string {\n const normalized = normalizePlayableEditorPath(value).replace(/\\/$/, '');\n const separator = normalized.lastIndexOf('/');\n return separator > 0 ? normalized.slice(0, separator) : '.';\n}\n\nfunction normalizeTsconfigPathList(value: string | string[]): string[] {\n return (Array.isArray(value) ? value : [value]).map(normalizePlayableEditorPath);\n}\n\nfunction relativePlayableEditorPath(from: string, to: string): string {\n const fromPath = normalizePlayableEditorPath(from).replace(/\\/$/, '');\n const toPath = normalizePlayableEditorPath(to).replace(/\\/$/, '');\n const fromParts = fromPath.split('/').filter(Boolean);\n const toParts = toPath.split('/').filter(Boolean);\n let common = 0;\n while (common < fromParts.length && common < toParts.length && fromParts[common] === toParts[common]) {\n common += 1;\n }\n const up = fromParts.slice(common).map(() => '..');\n const down = toParts.slice(common);\n const relative = [...up, ...down].join('/');\n return relative || '.';\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AuthoringSourceDriver } from '@fps-games/editor-core';
|
|
2
2
|
import type { EditorSceneAssetLibraryItem, EditorSceneDocument } from '../document/index';
|
|
3
3
|
import { type SceneMainSourceDriverLoadResult, type SceneMainSourceCompanionConfig, type SceneMainSourceSaveOptions, type SceneMainSourceSaveResult, type SceneSourceFetchJson } from '../scene-source/index';
|
|
4
|
+
import type { EditorProjectFileContent, EditorProjectFileSnapshot, EditorProjectMediaSource } from '../project-files/index';
|
|
4
5
|
export interface FpsGameEditorCompanionDraft<TValue> {
|
|
5
6
|
isDirty(): boolean;
|
|
6
7
|
get(): TValue;
|
|
@@ -32,6 +33,9 @@ export interface FpsGameEditorSceneSourceServices<TDocument extends EditorSceneD
|
|
|
32
33
|
load(request?: SceneSourceFetchJson): Promise<SceneMainSourceDriverLoadResult<TDocument, TAsset>>;
|
|
33
34
|
save(document: TDocument, options?: SceneMainSourceSaveOptions): Promise<SceneMainSourceSaveResult<TDocument>>;
|
|
34
35
|
loadAssets(request?: SceneSourceFetchJson): Promise<TAsset[]>;
|
|
36
|
+
loadProjectFiles?(request?: SceneSourceFetchJson): Promise<EditorProjectFileSnapshot>;
|
|
37
|
+
loadProjectFile?(path: string, request?: SceneSourceFetchJson): Promise<EditorProjectFileContent>;
|
|
38
|
+
resolveProjectMedia?(path: string): EditorProjectMediaSource | null;
|
|
35
39
|
}
|
|
36
40
|
export declare function createFpsGameEditorSceneSourceServices<TDocument extends EditorSceneDocument, TRuntimeScene, TAsset = unknown>(options: FpsGameEditorSceneSourceServicesOptions<TDocument, TRuntimeScene, TAsset>): FpsGameEditorSceneSourceServices<TDocument, TAsset>;
|
|
37
41
|
//# sourceMappingURL=scene-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-source.d.ts","sourceRoot":"","sources":["../../src/product/scene-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"scene-source.d.ts","sourceRoot":"","sources":["../../src/product/scene-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OA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ifacts.js';
|
|
2
|
-
import { createSceneMainSourceDriver, loadEditorAssetLibrary, loadSceneMainSource, saveSceneMainSource, } from '../scene-source/index.js';
|
|
2
|
+
import { createSceneMainSourceDriver, loadEditorAssetLibrary, loadEditorProjectFile, loadEditorProjectFiles, resolveEditorProjectMediaSource, loadSceneMainSource, saveSceneMainSource, } from '../scene-source/index.js';
|
|
3
3
|
export function createFpsGameEditorSceneSourceServices(options) {
|
|
4
4
|
let lifecycleEpoch = 0;
|
|
5
5
|
const compileArtifact = (source, document) => (createRuntimeSceneCompiledArtifact({
|
|
@@ -125,6 +125,15 @@ export function createFpsGameEditorSceneSourceServices(options) {
|
|
|
125
125
|
const assets = await loadEditorAssetLibrary(request ? { fetchJson: request } : undefined);
|
|
126
126
|
return options.castAssets ? options.castAssets(assets) : assets;
|
|
127
127
|
},
|
|
128
|
+
loadProjectFiles(request) {
|
|
129
|
+
return loadEditorProjectFiles(request ? { fetchJson: request } : undefined);
|
|
130
|
+
},
|
|
131
|
+
loadProjectFile(path, request) {
|
|
132
|
+
return loadEditorProjectFile(path, request ? { fetchJson: request } : undefined);
|
|
133
|
+
},
|
|
134
|
+
resolveProjectMedia(path) {
|
|
135
|
+
return resolveEditorProjectMediaSource(path);
|
|
136
|
+
},
|
|
128
137
|
};
|
|
129
138
|
}
|
|
130
139
|
function draftSnapshotMatches(draft, prepared) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-source.js","sourceRoot":"","sources":["../../src/product/scene-source.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GAMpB,MAAM,uBAAuB,CAAC;AAgD/B,MAAM,UAAU,sCAAsC,CACpD,OAAkF;IAElF,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,MAAM,eAAe,GAAG,CAAC,MAAiC,EAAE,QAAmB,EAAo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ACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;QACnB,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AuthoringSourceDescriptor,\n AuthoringSourceDriver,\n CompiledArtifact,\n} from '@fps-games/editor-core';\nimport {\n createRuntimeSceneCompiledArtifact,\n} from '../scene-source/artifacts';\nimport type {\n EditorSceneAssetLibraryItem,\n EditorSceneDocument,\n} from '../document/index';\nimport {\n createSceneMainSourceDriver,\n loadEditorAssetLibrary,\n loadSceneMainSource,\n saveSceneMainSource,\n type SceneMainSourceDriverLoadResult,\n type SceneMainSourceCompanionConfig,\n type SceneMainSourceSaveOptions,\n type SceneMainSourceSaveResult,\n type SceneSourceFetchJson,\n} from '../scene-source/index';\n\nexport interface FpsGameEditorCompanionDraft<TValue> {\n isDirty(): boolean;\n get(): TValue;\n markSaved(value: TValue): void;\n setError?(error: unknown): void;\n clearError?(): void;\n}\n\nexport interface FpsGameEditorReadonlyConfigSnapshot<TValue> {\n get(): TValue | null;\n replace(value: TValue | null): void;\n}\n\nexport interface FpsGameEditorSceneSourceServicesOptions<\n TDocument extends EditorSceneDocument,\n TRuntimeScene,\n TAsset = EditorSceneAssetLibraryItem,\n> {\n compilerId: string;\n compilerVersion: string;\n compileRuntimeScene(document: TDocument): TRuntimeScene;\n isRuntimeScene(value: unknown): value is TRuntimeScene;\n onRuntimeScene(value: TRuntimeScene): void;\n renderingDraft?: FpsGameEditorCompanionDraft<Record<string, unknown>>;\n staticShadowDraft?: FpsGameEditorCompanionDraft<SceneMainSourceCompanionConfig>;\n shadowMapExperimentConfigSnapshot?: FpsGameEditorReadonlyConfigSnapshot<\n NonNullable<SceneMainSourceDriverLoadResult<TDocument>['shadowMapExperimentConfig']>\n >;\n artifactId?: string;\n castAssets?(assets: unknown[]): TAsset[];\n}\n\nexport interface FpsGameEditorSceneSourceServices<TDocument extends EditorSceneDocument, TAsset> {\n createDriver(options?: { endpointBase?: string; fetchJson?: SceneSourceFetchJson }): AuthoringSourceDriver<TDocument>;\n load(request?: SceneSourceFetchJson): Promise<SceneMainSourceDriverLoadResult<TDocument, TAsset>>;\n save(document: TDocument, options?: SceneMainSourceSaveOptions): Promise<SceneMainSourceSaveResult<TDocument>>;\n loadAssets(request?: SceneSourceFetchJson): Promise<TAsset[]>;\n}\n\ninterface PreparedCompanionSave {\n epoch: number;\n rendering: Record<string, unknown> | null;\n staticShadowDirty: boolean;\n staticShadows: SceneMainSourceCompanionConfig;\n}\n\nexport function createFpsGameEditorSceneSourceServices<TDocument extends EditorSceneDocument, TRuntimeScene, TAsset = unknown>(\n options: FpsGameEditorSceneSourceServicesOptions<TDocument, TRuntimeScene, TAsset>,\n): FpsGameEditorSceneSourceServices<TDocument, TAsset> {\n let lifecycleEpoch = 0;\n const compileArtifact = (source: AuthoringSourceDescriptor, document: TDocument): CompiledArtifact => (\n createRuntimeSceneCompiledArtifact({\n source,\n data: options.compileRuntimeScene(document),\n artifactId: options.artifactId ?? 'scene.json',\n fallbackCompilerId: options.compilerId,\n fallbackCompilerVersion: options.compilerVersion,\n })\n );\n const prepareSave = () => {\n const rendering = options.renderingDraft?.isDirty()\n ? cloneCompanionValue(options.renderingDraft.get())\n : null;\n const staticShadowDirty = options.staticShadowDraft?.isDirty() ?? false;\n const staticShadows = staticShadowDirty\n ? cloneCompanionValue(options.staticShadowDraft?.get() ?? null)\n : null;\n const context: PreparedCompanionSave = {\n epoch: ++lifecycleEpoch,\n rendering,\n staticShadowDirty,\n staticShadows,\n };\n return {\n saveOptions: rendering || staticShadowDirty ? {\n companionConfigs: {\n ...(rendering ? { rendering } : {}),\n ...(staticShadowDirty ? { staticShadows } : {}),\n },\n } : undefined,\n context,\n };\n };\n const reportSaveError = (error: unknown, prepared: PreparedCompanionSave | undefined) => {\n if (!prepared || prepared.epoch !== lifecycleEpoch) return;\n if (prepared.rendering && draftSnapshotMatches(options.renderingDraft, prepared.rendering)) {\n options.renderingDraft?.setError?.(error);\n }\n if (prepared.staticShadowDirty && draftSnapshotMatches(options.staticShadowDraft, prepared.staticShadows)) {\n options.staticShadowDraft?.setError?.(error);\n }\n };\n const completeSave = (\n saved: SceneMainSourceSaveResult<TDocument>,\n prepared: PreparedCompanionSave | undefined,\n ) => {\n if (!prepared || prepared.epoch !== lifecycleEpoch) return;\n if (prepared?.rendering) {\n if (draftSnapshotMatches(options.renderingDraft, prepared.rendering)) {\n options.renderingDraft?.markSaved(saved.renderingConfig ?? prepared.rendering);\n }\n options.renderingDraft?.clearError?.();\n }\n if (prepared?.staticShadowDirty) {\n if (draftSnapshotMatches(options.staticShadowDraft, prepared.staticShadows)) {\n options.staticShadowDraft?.markSaved(saved.companionConfigs?.staticShadows ?? prepared.staticShadows);\n }\n options.staticShadowDraft?.clearError?.();\n }\n options.shadowMapExperimentConfigSnapshot?.replace(saved.shadowMapExperimentConfig ?? null);\n };\n const prepareLoad = () => ++lifecycleEpoch;\n const completeLoad = (loaded: SceneMainSourceDriverLoadResult<TDocument>, epoch: number) => {\n if (epoch !== lifecycleEpoch) return;\n options.staticShadowDraft?.markSaved(loaded.companionConfigs?.staticShadows ?? null);\n options.staticShadowDraft?.clearError?.();\n options.shadowMapExperimentConfigSnapshot?.replace(loaded.shadowMapExperimentConfig ?? null);\n };\n const createDriver = (\n driverOptions: { endpointBase?: string; fetchJson?: SceneSourceFetchJson } = {},\n ): AuthoringSourceDriver<TDocument> => createSceneMainSourceDriver<TDocument>({\n ...driverOptions,\n prepareLoad,\n afterLoad({ loaded, context }) {\n completeLoad(loaded, context as number);\n },\n prepareSave,\n isSaveCurrent({ context }) {\n const prepared = context as PreparedCompanionSave | undefined;\n return !!prepared && prepared.epoch === lifecycleEpoch;\n },\n onSaveError({ error, context }) {\n reportSaveError(error, context as PreparedCompanionSave | undefined);\n },\n afterSave({ saved, context }) {\n completeSave(saved, context as PreparedCompanionSave | undefined);\n },\n compile: ({ source, document }) => [compileArtifact(source, document)],\n onRuntimeSceneArtifact({ artifact }) {\n if (options.isRuntimeScene(artifact.data)) options.onRuntimeScene(artifact.data);\n },\n });\n\n return {\n createDriver,\n async load(request) {\n const epoch = prepareLoad();\n const loaded = await loadSceneMainSource<TDocument>(request ? { fetchJson: request } : undefined);\n const { assets: loadedAssets, ...loadedSource } = loaded;\n const assets: TAsset[] | undefined = loadedAssets\n ? options.castAssets\n ? options.castAssets(loadedAssets)\n : loadedAssets as unknown as TAsset[]\n : undefined;\n completeLoad(loaded, epoch);\n return {\n ...loadedSource,\n ...(assets ? { assets } : {}),\n };\n },\n async save(document, requestedOptions) {\n const prepared = prepareSave();\n const mergedOptions = mergeSceneMainSourceSaveOptions(requestedOptions, prepared.saveOptions);\n try {\n const saved = await saveSceneMainSource<TDocument>(document, mergedOptions);\n completeSave(saved, prepared.context);\n return saved;\n } catch (error) {\n reportSaveError(error, prepared.context);\n throw error;\n }\n },\n async loadAssets(request) {\n const assets = await loadEditorAssetLibrary(request ? { fetchJson: request } : undefined);\n return options.castAssets ? options.castAssets(assets) : assets as TAsset[];\n },\n };\n}\n\nfunction draftSnapshotMatches<TValue>(\n draft: FpsGameEditorCompanionDraft<TValue> | undefined,\n prepared: TValue,\n): boolean {\n if (!draft) return false;\n return JSON.stringify(draft.get()) === JSON.stringify(prepared);\n}\n\nfunction cloneCompanionValue<TValue>(value: TValue): TValue {\n if (value === undefined) return value;\n return JSON.parse(JSON.stringify(value)) as TValue;\n}\n\nfunction mergeSceneMainSourceSaveOptions(\n requested: SceneMainSourceSaveOptions | undefined,\n prepared: SceneMainSourceSaveOptions | undefined,\n): SceneMainSourceSaveOptions {\n const companionConfigs = requested?.companionConfigs || prepared?.companionConfigs\n ? {\n ...(requested?.companionConfigs ?? {}),\n ...(prepared?.companionConfigs ?? {}),\n }\n : undefined;\n return {\n ...(requested ?? {}),\n ...(prepared ?? {}),\n ...(companionConfigs ? { companionConfigs } : {}),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scene-source.js","sourceRoot":"","sources":["../../src/product/scene-source.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,+BAA+B,EAC/B,mBAAmB,EACnB,mBAAmB,GAMpB,MAAM,uBAAuB,CAAC;AAoD/B,MAAM,UAAU,sCAAsC,CACpD,OAAkF;IAElF,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,MAAM,eAAe,GAAG,CAAC,MAAiC,EAAE,QAAmB,EAAoB,EAAE,CAAC,CACpG,kCAAkC,CAAC;QACjC,MAAM;QACN,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC;QAC3C,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,YAAY;QAC9C,kBAAkB,EAAE,OAAO,CAAC,UAAU;QACtC,uBAAuB,EAAE,OAAO,CAAC,eAAe;KACjD,CAAC,CACH,CAAC;IACF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE;YACjD,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;YACnD,CAAC,CAAC,IAAI,CAAC;QACT,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC;QACxE,MAAM,aAAa,GAAG,iBAAiB;YACrC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC;YAC/D,CAAC,CAAC,IAAI,CAAC;QACT,MAAM,OAAO,GAA0B;YACrC,KAAK,EAAE,EAAE,cAAc;YACvB,SAAS;YACT,iBAAiB;YACjB,aAAa;SACd,C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E,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACnF,CAAC;QACD,mBAAmB,CAAC,IAAI;YACtB,OAAO,+BAA+B,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,KAAsD,EACtD,QAAgB;IAEhB,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,mBAAmB,CAAS,KAAa;IAChD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAW,CAAC;AACrD,CAAC;AAED,SAAS,+BAA+B,CACtC,SAAiD,EACjD,QAAgD;IAEhD,MAAM,gBAAgB,GAAG,SAAS,EAAE,gBAAgB,IAAI,QAAQ,EAAE,gBAAgB;QAChF,CAAC,CAAC;YACE,GAAG,CAAC,SAAS,EAAE,gBAAgB,IAAI,EAAE,CAAC;YACtC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,IAAI,EAAE,CAAC;SACtC;QACH,CAAC,CAAC,SAAS,CAAC;IACd,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;QACnB,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AuthoringSourceDescriptor,\n AuthoringSourceDriver,\n CompiledArtifact,\n} from '@fps-games/editor-core';\nimport {\n createRuntimeSceneCompiledArtifact,\n} from '../scene-source/artifacts';\nimport type {\n EditorSceneAssetLibraryItem,\n EditorSceneDocument,\n} from '../document/index';\nimport {\n createSceneMainSourceDriver,\n loadEditorAssetLibrary,\n loadEditorProjectFile,\n loadEditorProjectFiles,\n resolveEditorProjectMediaSource,\n loadSceneMainSource,\n saveSceneMainSource,\n type SceneMainSourceDriverLoadResult,\n type SceneMainSourceCompanionConfig,\n type SceneMainSourceSaveOptions,\n type SceneMainSourceSaveResult,\n type SceneSourceFetchJson,\n} from '../scene-source/index';\nimport type { EditorProjectFileContent, EditorProjectFileSnapshot, EditorProjectMediaSource } from '../project-files/index';\n\nexport interface FpsGameEditorCompanionDraft<TValue> {\n isDirty(): boolean;\n get(): TValue;\n markSaved(value: TValue): void;\n setError?(error: unknown): void;\n clearError?(): void;\n}\n\nexport interface FpsGameEditorReadonlyConfigSnapshot<TValue> {\n get(): TValue | null;\n replace(value: TValue | null): void;\n}\n\nexport interface FpsGameEditorSceneSourceServicesOptions<\n TDocument extends EditorSceneDocument,\n TRuntimeScene,\n TAsset = EditorSceneAssetLibraryItem,\n> {\n compilerId: string;\n compilerVersion: string;\n compileRuntimeScene(document: TDocument): TRuntimeScene;\n isRuntimeScene(value: unknown): value is TRuntimeScene;\n onRuntimeScene(value: TRuntimeScene): void;\n renderingDraft?: FpsGameEditorCompanionDraft<Record<string, unknown>>;\n staticShadowDraft?: FpsGameEditorCompanionDraft<SceneMainSourceCompanionConfig>;\n shadowMapExperimentConfigSnapshot?: FpsGameEditorReadonlyConfigSnapshot<\n NonNullable<SceneMainSourceDriverLoadResult<TDocument>['shadowMapExperimentConfig']>\n >;\n artifactId?: string;\n castAssets?(assets: unknown[]): TAsset[];\n}\n\nexport interface FpsGameEditorSceneSourceServices<TDocument extends EditorSceneDocument, TAsset> {\n createDriver(options?: { endpointBase?: string; fetchJson?: SceneSourceFetchJson }): AuthoringSourceDriver<TDocument>;\n load(request?: SceneSourceFetchJson): Promise<SceneMainSourceDriverLoadResult<TDocument, TAsset>>;\n save(document: TDocument, options?: SceneMainSourceSaveOptions): Promise<SceneMainSourceSaveResult<TDocument>>;\n loadAssets(request?: SceneSourceFetchJson): Promise<TAsset[]>;\n loadProjectFiles?(request?: SceneSourceFetchJson): Promise<EditorProjectFileSnapshot>;\n loadProjectFile?(path: string, request?: SceneSourceFetchJson): Promise<EditorProjectFileContent>;\n resolveProjectMedia?(path: string): EditorProjectMediaSource | null;\n}\n\ninterface PreparedCompanionSave {\n epoch: number;\n rendering: Record<string, unknown> | null;\n staticShadowDirty: boolean;\n staticShadows: SceneMainSourceCompanionConfig;\n}\n\nexport function createFpsGameEditorSceneSourceServices<TDocument extends EditorSceneDocument, TRuntimeScene, TAsset = unknown>(\n options: FpsGameEditorSceneSourceServicesOptions<TDocument, TRuntimeScene, TAsset>,\n): FpsGameEditorSceneSourceServices<TDocument, TAsset> {\n let lifecycleEpoch = 0;\n const compileArtifact = (source: AuthoringSourceDescriptor, document: TDocument): CompiledArtifact => (\n createRuntimeSceneCompiledArtifact({\n source,\n data: options.compileRuntimeScene(document),\n artifactId: options.artifactId ?? 'scene.json',\n fallbackCompilerId: options.compilerId,\n fallbackCompilerVersion: options.compilerVersion,\n })\n );\n const prepareSave = () => {\n const rendering = options.renderingDraft?.isDirty()\n ? cloneCompanionValue(options.renderingDraft.get())\n : null;\n const staticShadowDirty = options.staticShadowDraft?.isDirty() ?? false;\n const staticShadows = staticShadowDirty\n ? cloneCompanionValue(options.staticShadowDraft?.get() ?? null)\n : null;\n const context: PreparedCompanionSave = {\n epoch: ++lifecycleEpoch,\n rendering,\n staticShadowDirty,\n staticShadows,\n };\n return {\n saveOptions: rendering || staticShadowDirty ? {\n companionConfigs: {\n ...(rendering ? { rendering } : {}),\n ...(staticShadowDirty ? { staticShadows } : {}),\n },\n } : undefined,\n context,\n };\n };\n const reportSaveError = (error: unknown, prepared: PreparedCompanionSave | undefined) => {\n if (!prepared || prepared.epoch !== lifecycleEpoch) return;\n if (prepared.rendering && draftSnapshotMatches(options.renderingDraft, prepared.rendering)) {\n options.renderingDraft?.setError?.(error);\n }\n if (prepared.staticShadowDirty && draftSnapshotMatches(options.staticShadowDraft, prepared.staticShadows)) {\n options.staticShadowDraft?.setError?.(error);\n }\n };\n const completeSave = (\n saved: SceneMainSourceSaveResult<TDocument>,\n prepared: PreparedCompanionSave | undefined,\n ) => {\n if (!prepared || prepared.epoch !== lifecycleEpoch) return;\n if (prepared?.rendering) {\n if (draftSnapshotMatches(options.renderingDraft, prepared.rendering)) {\n options.renderingDraft?.markSaved(saved.renderingConfig ?? prepared.rendering);\n }\n options.renderingDraft?.clearError?.();\n }\n if (prepared?.staticShadowDirty) {\n if (draftSnapshotMatches(options.staticShadowDraft, prepared.staticShadows)) {\n options.staticShadowDraft?.markSaved(saved.companionConfigs?.staticShadows ?? prepared.staticShadows);\n }\n options.staticShadowDraft?.clearError?.();\n }\n options.shadowMapExperimentConfigSnapshot?.replace(saved.shadowMapExperimentConfig ?? null);\n };\n const prepareLoad = () => ++lifecycleEpoch;\n const completeLoad = (loaded: SceneMainSourceDriverLoadResult<TDocument>, epoch: number) => {\n if (epoch !== lifecycleEpoch) return;\n options.staticShadowDraft?.markSaved(loaded.companionConfigs?.staticShadows ?? null);\n options.staticShadowDraft?.clearError?.();\n options.shadowMapExperimentConfigSnapshot?.replace(loaded.shadowMapExperimentConfig ?? null);\n };\n const createDriver = (\n driverOptions: { endpointBase?: string; fetchJson?: SceneSourceFetchJson } = {},\n ): AuthoringSourceDriver<TDocument> => createSceneMainSourceDriver<TDocument>({\n ...driverOptions,\n prepareLoad,\n afterLoad({ loaded, context }) {\n completeLoad(loaded, context as number);\n },\n prepareSave,\n isSaveCurrent({ context }) {\n const prepared = context as PreparedCompanionSave | undefined;\n return !!prepared && prepared.epoch === lifecycleEpoch;\n },\n onSaveError({ error, context }) {\n reportSaveError(error, context as PreparedCompanionSave | undefined);\n },\n afterSave({ saved, context }) {\n completeSave(saved, context as PreparedCompanionSave | undefined);\n },\n compile: ({ source, document }) => [compileArtifact(source, document)],\n onRuntimeSceneArtifact({ artifact }) {\n if (options.isRuntimeScene(artifact.data)) options.onRuntimeScene(artifact.data);\n },\n });\n\n return {\n createDriver,\n async load(request) {\n const epoch = prepareLoad();\n const loaded = await loadSceneMainSource<TDocument>(request ? { fetchJson: request } : undefined);\n const { assets: loadedAssets, ...loadedSource } = loaded;\n const assets: TAsset[] | undefined = loadedAssets\n ? options.castAssets\n ? options.castAssets(loadedAssets)\n : loadedAssets as unknown as TAsset[]\n : undefined;\n completeLoad(loaded, epoch);\n return {\n ...loadedSource,\n ...(assets ? { assets } : {}),\n };\n },\n async save(document, requestedOptions) {\n const prepared = prepareSave();\n const mergedOptions = mergeSceneMainSourceSaveOptions(requestedOptions, prepared.saveOptions);\n try {\n const saved = await saveSceneMainSource<TDocument>(document, mergedOptions);\n completeSave(saved, prepared.context);\n return saved;\n } catch (error) {\n reportSaveError(error, prepared.context);\n throw error;\n }\n },\n async loadAssets(request) {\n const assets = await loadEditorAssetLibrary(request ? { fetchJson: request } : undefined);\n return options.castAssets ? options.castAssets(assets) : assets as TAsset[];\n },\n loadProjectFiles(request) {\n return loadEditorProjectFiles(request ? { fetchJson: request } : undefined);\n },\n loadProjectFile(path, request) {\n return loadEditorProjectFile(path, request ? { fetchJson: request } : undefined);\n },\n resolveProjectMedia(path) {\n return resolveEditorProjectMediaSource(path);\n },\n };\n}\n\nfunction draftSnapshotMatches<TValue>(\n draft: FpsGameEditorCompanionDraft<TValue> | undefined,\n prepared: TValue,\n): boolean {\n if (!draft) return false;\n return JSON.stringify(draft.get()) === JSON.stringify(prepared);\n}\n\nfunction cloneCompanionValue<TValue>(value: TValue): TValue {\n if (value === undefined) return value;\n return JSON.parse(JSON.stringify(value)) as TValue;\n}\n\nfunction mergeSceneMainSourceSaveOptions(\n requested: SceneMainSourceSaveOptions | undefined,\n prepared: SceneMainSourceSaveOptions | undefined,\n): SceneMainSourceSaveOptions {\n const companionConfigs = requested?.companionConfigs || prepared?.companionConfigs\n ? {\n ...(requested?.companionConfigs ?? {}),\n ...(prepared?.companionConfigs ?? {}),\n }\n : undefined;\n return {\n ...(requested ?? {}),\n ...(prepared ?? {}),\n ...(companionConfigs ? { companionConfigs } : {}),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-files/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project-files/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC","sourcesContent":["export * from './types';\nexport * from './protocol';\nexport * from './support';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorProjectFileContent, EditorProjectFileSnapshot } from './types';
|
|
2
|
+
export declare function readEditorProjectFileSnapshot(value: unknown): EditorProjectFileSnapshot;
|
|
3
|
+
export declare function readEditorProjectFileContent(value: unknown): EditorProjectFileContent;
|
|
4
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/project-files/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAExB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAEjB,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,CAUvF;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAwBrF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export function readEditorProjectFileSnapshot(value) {
|
|
2
|
+
const record = readRecord(value);
|
|
3
|
+
const entries = Array.isArray(record?.entries)
|
|
4
|
+
? record.entries.flatMap(readEditorProjectFileEntry)
|
|
5
|
+
: [];
|
|
6
|
+
return {
|
|
7
|
+
rootName: readNonEmptyString(record?.rootName) ?? 'Project',
|
|
8
|
+
entries,
|
|
9
|
+
truncated: record?.truncated === true,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function readEditorProjectFileContent(value) {
|
|
13
|
+
const record = readRecord(value);
|
|
14
|
+
const path = readCanonicalProjectRelativePath(record?.path);
|
|
15
|
+
const name = readNonEmptyString(record?.name);
|
|
16
|
+
const extension = typeof record?.extension === 'string' ? record.extension : null;
|
|
17
|
+
const language = readNonEmptyString(record?.language);
|
|
18
|
+
const text = typeof record?.text === 'string' ? record.text : null;
|
|
19
|
+
const size = typeof record?.size === 'number' && Number.isSafeInteger(record.size) && record.size >= 0
|
|
20
|
+
? record.size
|
|
21
|
+
: null;
|
|
22
|
+
if (!path || !name || extension === null || !language || text === null || size === null) {
|
|
23
|
+
throw new Error('schema.invalidProjectFileContent');
|
|
24
|
+
}
|
|
25
|
+
const pathSegments = path.split('/');
|
|
26
|
+
if (name !== pathSegments[pathSegments.length - 1])
|
|
27
|
+
throw new Error('schema.invalidProjectFileContent');
|
|
28
|
+
return {
|
|
29
|
+
path,
|
|
30
|
+
name,
|
|
31
|
+
extension,
|
|
32
|
+
language,
|
|
33
|
+
text,
|
|
34
|
+
size,
|
|
35
|
+
truncated: record?.truncated === true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function readEditorProjectFileEntry(value) {
|
|
39
|
+
const record = readRecord(value);
|
|
40
|
+
if (!record)
|
|
41
|
+
return [];
|
|
42
|
+
const path = readCanonicalProjectRelativePath(record?.path);
|
|
43
|
+
const name = readNonEmptyString(record?.name);
|
|
44
|
+
const kind = record?.kind === 'directory' || record?.kind === 'file'
|
|
45
|
+
? record.kind
|
|
46
|
+
: null;
|
|
47
|
+
const pathSegments = path?.split('/') ?? [];
|
|
48
|
+
if (!path || !name || !kind || name !== pathSegments[pathSegments.length - 1])
|
|
49
|
+
return [];
|
|
50
|
+
if (!Object.prototype.hasOwnProperty.call(record, 'parentPath'))
|
|
51
|
+
return [];
|
|
52
|
+
const parentPath = record.parentPath === null
|
|
53
|
+
? null
|
|
54
|
+
: readCanonicalProjectRelativePath(record.parentPath);
|
|
55
|
+
const separatorIndex = path.lastIndexOf('/');
|
|
56
|
+
const expectedParentPath = separatorIndex >= 0 ? path.slice(0, separatorIndex) : null;
|
|
57
|
+
if (parentPath !== expectedParentPath)
|
|
58
|
+
return [];
|
|
59
|
+
const extension = readNonEmptyString(record?.extension);
|
|
60
|
+
return [{
|
|
61
|
+
path,
|
|
62
|
+
name,
|
|
63
|
+
parentPath,
|
|
64
|
+
kind,
|
|
65
|
+
...(extension ? { extension } : {}),
|
|
66
|
+
}];
|
|
67
|
+
}
|
|
68
|
+
function readRecord(value) {
|
|
69
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
70
|
+
? value
|
|
71
|
+
: null;
|
|
72
|
+
}
|
|
73
|
+
function readNonEmptyString(value) {
|
|
74
|
+
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
75
|
+
}
|
|
76
|
+
function readCanonicalProjectRelativePath(value) {
|
|
77
|
+
if (typeof value !== 'string' || !value || value !== value.trim())
|
|
78
|
+
return null;
|
|
79
|
+
if (value.includes('\0') || value.includes('\\') || value.startsWith('/') || /^[A-Za-z]:\//.test(value))
|
|
80
|
+
return null;
|
|
81
|
+
const segments = value.split('/');
|
|
82
|
+
if (segments.some(segment => !segment || segment === '.' || segment === '..'))
|
|
83
|
+
return null;
|
|
84
|
+
return segments.join('/');
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/project-files/protocol.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,6BAA6B,CAAC,KAAc;IAC1D,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,OA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CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrH,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type {\n EditorProjectFileContent,\n EditorProjectFileEntry,\n EditorProjectFileSnapshot,\n} from './types';\n\nexport function readEditorProjectFileSnapshot(value: unknown): EditorProjectFileSnapshot {\n const record = readRecord(value);\n const entries = Array.isArray(record?.entries)\n ? record.entries.flatMap(readEditorProjectFileEntry)\n : [];\n return {\n rootName: readNonEmptyString(record?.rootName) ?? 'Project',\n entries,\n truncated: record?.truncated === true,\n };\n}\n\nexport function readEditorProjectFileContent(value: unknown): EditorProjectFileContent {\n const record = readRecord(value);\n const path = readCanonicalProjectRelativePath(record?.path);\n const name = readNonEmptyString(record?.name);\n const extension = typeof record?.extension === 'string' ? record.extension : null;\n const language = readNonEmptyString(record?.language);\n const text = typeof record?.text === 'string' ? record.text : null;\n const size = typeof record?.size === 'number' && Number.isSafeInteger(record.size) && record.size >= 0\n ? record.size\n : null;\n if (!path || !name || extension === null || !language || text === null || size === null) {\n throw new Error('schema.invalidProjectFileContent');\n }\n const pathSegments = path.split('/');\n if (name !== pathSegments[pathSegments.length - 1]) throw new Error('schema.invalidProjectFileContent');\n return {\n path,\n name,\n extension,\n language,\n text,\n size,\n truncated: record?.truncated === true,\n };\n}\n\nfunction readEditorProjectFileEntry(value: unknown): EditorProjectFileEntry[] {\n const record = readRecord(value);\n if (!record) return [];\n const path = readCanonicalProjectRelativePath(record?.path);\n const name = readNonEmptyString(record?.name);\n const kind = record?.kind === 'directory' || record?.kind === 'file'\n ? record.kind\n : null;\n const pathSegments = path?.split('/') ?? [];\n if (!path || !name || !kind || name !== pathSegments[pathSegments.length - 1]) return [];\n if (!Object.prototype.hasOwnProperty.call(record, 'parentPath')) return [];\n const parentPath = record.parentPath === null\n ? null\n : readCanonicalProjectRelativePath(record.parentPath);\n const separatorIndex = path.lastIndexOf('/');\n const expectedParentPath = separatorIndex >= 0 ? path.slice(0, separatorIndex) : null;\n if (parentPath !== expectedParentPath) return [];\n const extension = readNonEmptyString(record?.extension);\n return [{\n path,\n name,\n parentPath,\n kind,\n ...(extension ? { extension } : {}),\n }];\n}\n\nfunction readRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? value as Record<string, unknown>\n : null;\n}\n\nfunction readNonEmptyString(value: unknown): string | null {\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n}\n\nfunction readCanonicalProjectRelativePath(value: unknown): string | null {\n if (typeof value !== 'string' || !value || value !== value.trim()) return null;\n if (value.includes('\\0') || value.includes('\\\\') || value.startsWith('/') || /^[A-Za-z]:\\//.test(value)) return null;\n const segments = value.split('/');\n if (segments.some(segment => !segment || segment === '.' || segment === '..')) return null;\n return segments.join('/');\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function resolveEditorProjectFileExtension(filePath: string): string;
|
|
2
|
+
export declare function resolveEditorProjectFileLanguage(filePath: string): string | null;
|
|
3
|
+
export declare function isEditorProjectFilePreviewable(filePath: string): boolean;
|
|
4
|
+
export declare function resolveEditorProjectMediaSupport(filePath: string): {
|
|
5
|
+
kind: 'image' | 'model' | 'audio';
|
|
6
|
+
mimeType: string;
|
|
7
|
+
} | null;
|
|
8
|
+
export declare function isEditorProjectMediaPreviewable(filePath: string): boolean;
|
|
9
|
+
//# sourceMappingURL=support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/project-files/support.ts"],"names":[],"mappings":"AAuDA,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhF;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG;IAClE,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAGP;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const PROJECT_FILE_LANGUAGE_BY_EXTENSION = Object.freeze({
|
|
2
|
+
bash: 'shell',
|
|
3
|
+
cjs: 'javascript',
|
|
4
|
+
conf: 'config',
|
|
5
|
+
config: 'config',
|
|
6
|
+
css: 'css',
|
|
7
|
+
env: 'dotenv',
|
|
8
|
+
htm: 'html',
|
|
9
|
+
html: 'html',
|
|
10
|
+
ini: 'config',
|
|
11
|
+
js: 'javascript',
|
|
12
|
+
json: 'json',
|
|
13
|
+
jsonc: 'jsonc',
|
|
14
|
+
jsx: 'javascript',
|
|
15
|
+
less: 'less',
|
|
16
|
+
md: 'markdown',
|
|
17
|
+
mjs: 'javascript',
|
|
18
|
+
scss: 'scss',
|
|
19
|
+
sh: 'shell',
|
|
20
|
+
toml: 'toml',
|
|
21
|
+
ts: 'typescript',
|
|
22
|
+
tsx: 'typescript',
|
|
23
|
+
txt: 'text',
|
|
24
|
+
xml: 'xml',
|
|
25
|
+
yaml: 'yaml',
|
|
26
|
+
yml: 'yaml',
|
|
27
|
+
zsh: 'shell',
|
|
28
|
+
});
|
|
29
|
+
const PROJECT_FILE_LANGUAGE_BY_NAME = Object.freeze({
|
|
30
|
+
'.env': 'dotenv',
|
|
31
|
+
'.eslintignore': 'config',
|
|
32
|
+
'.gitignore': 'config',
|
|
33
|
+
'.npmrc': 'config',
|
|
34
|
+
'.prettierignore': 'config',
|
|
35
|
+
dockerfile: 'dockerfile',
|
|
36
|
+
makefile: 'makefile',
|
|
37
|
+
});
|
|
38
|
+
const PROJECT_MEDIA_BY_EXTENSION = Object.freeze({
|
|
39
|
+
png: { kind: 'image', mimeType: 'image/png' },
|
|
40
|
+
jpg: { kind: 'image', mimeType: 'image/jpeg' },
|
|
41
|
+
jpeg: { kind: 'image', mimeType: 'image/jpeg' },
|
|
42
|
+
webp: { kind: 'image', mimeType: 'image/webp' },
|
|
43
|
+
gif: { kind: 'image', mimeType: 'image/gif' },
|
|
44
|
+
bmp: { kind: 'image', mimeType: 'image/bmp' },
|
|
45
|
+
glb: { kind: 'model', mimeType: 'model/gltf-binary' },
|
|
46
|
+
mp3: { kind: 'audio', mimeType: 'audio/mpeg' },
|
|
47
|
+
wav: { kind: 'audio', mimeType: 'audio/wav' },
|
|
48
|
+
ogg: { kind: 'audio', mimeType: 'audio/ogg' },
|
|
49
|
+
m4a: { kind: 'audio', mimeType: 'audio/mp4' },
|
|
50
|
+
aac: { kind: 'audio', mimeType: 'audio/aac' },
|
|
51
|
+
flac: { kind: 'audio', mimeType: 'audio/flac' },
|
|
52
|
+
});
|
|
53
|
+
export function resolveEditorProjectFileExtension(filePath) {
|
|
54
|
+
const segments = filePath.replace(/\\/g, '/').split('/');
|
|
55
|
+
const name = segments[segments.length - 1]?.toLowerCase() ?? '';
|
|
56
|
+
const dotIndex = name.lastIndexOf('.');
|
|
57
|
+
return dotIndex > 0 ? name.slice(dotIndex + 1) : '';
|
|
58
|
+
}
|
|
59
|
+
export function resolveEditorProjectFileLanguage(filePath) {
|
|
60
|
+
const segments = filePath.replace(/\\/g, '/').split('/');
|
|
61
|
+
const name = segments[segments.length - 1]?.toLowerCase() ?? '';
|
|
62
|
+
return PROJECT_FILE_LANGUAGE_BY_NAME[name]
|
|
63
|
+
?? PROJECT_FILE_LANGUAGE_BY_EXTENSION[resolveEditorProjectFileExtension(name)]
|
|
64
|
+
?? null;
|
|
65
|
+
}
|
|
66
|
+
export function isEditorProjectFilePreviewable(filePath) {
|
|
67
|
+
return resolveEditorProjectFileLanguage(filePath) !== null;
|
|
68
|
+
}
|
|
69
|
+
export function resolveEditorProjectMediaSupport(filePath) {
|
|
70
|
+
return PROJECT_MEDIA_BY_EXTENSION[resolveEditorProjectFileExtension(filePath)]
|
|
71
|
+
?? null;
|
|
72
|
+
}
|
|
73
|
+
export function isEditorProjectMediaPreviewable(filePath) {
|
|
74
|
+
return resolveEditorProjectMediaSupport(filePath) !== null;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/project-files/support.ts"],"names":[],"mappings":"AAAA,MAAM,kCAAkC,GAAqC,MAAM,CAAC,MAAM,CAAC;IACzF,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,QAAQ;IACb,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,UAAU;IACd,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,YAAY;IAChB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM;IACX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C9D,OAAO,gCAAgC,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AAC7D,CAAC","sourcesContent":["const PROJECT_FILE_LANGUAGE_BY_EXTENSION: Readonly<Record<string, string>> = Object.freeze({\n bash: 'shell',\n cjs: 'javascript',\n conf: 'config',\n config: 'config',\n css: 'css',\n env: 'dotenv',\n htm: 'html',\n html: 'html',\n ini: 'config',\n js: 'javascript',\n json: 'json',\n jsonc: 'jsonc',\n jsx: 'javascript',\n less: 'less',\n md: 'markdown',\n mjs: 'javascript',\n scss: 'scss',\n sh: 'shell',\n toml: 'toml',\n ts: 'typescript',\n tsx: 'typescript',\n txt: 'text',\n xml: 'xml',\n yaml: 'yaml',\n yml: 'yaml',\n zsh: 'shell',\n});\n\nconst PROJECT_FILE_LANGUAGE_BY_NAME: Readonly<Record<string, string>> = Object.freeze({\n '.env': 'dotenv',\n '.eslintignore': 'config',\n '.gitignore': 'config',\n '.npmrc': 'config',\n '.prettierignore': 'config',\n dockerfile: 'dockerfile',\n makefile: 'makefile',\n});\n\nconst PROJECT_MEDIA_BY_EXTENSION = Object.freeze({\n png: { kind: 'image', mimeType: 'image/png' },\n jpg: { kind: 'image', mimeType: 'image/jpeg' },\n jpeg: { kind: 'image', mimeType: 'image/jpeg' },\n webp: { kind: 'image', mimeType: 'image/webp' },\n gif: { kind: 'image', mimeType: 'image/gif' },\n bmp: { kind: 'image', mimeType: 'image/bmp' },\n glb: { kind: 'model', mimeType: 'model/gltf-binary' },\n mp3: { kind: 'audio', mimeType: 'audio/mpeg' },\n wav: { kind: 'audio', mimeType: 'audio/wav' },\n ogg: { kind: 'audio', mimeType: 'audio/ogg' },\n m4a: { kind: 'audio', mimeType: 'audio/mp4' },\n aac: { kind: 'audio', mimeType: 'audio/aac' },\n flac: { kind: 'audio', mimeType: 'audio/flac' },\n} satisfies Readonly<Record<string, { kind: 'image' | 'model' | 'audio'; mimeType: string }>>);\n\nexport function resolveEditorProjectFileExtension(filePath: string): string {\n const segments = filePath.replace(/\\\\/g, '/').split('/');\n const name = segments[segments.length - 1]?.toLowerCase() ?? '';\n const dotIndex = name.lastIndexOf('.');\n return dotIndex > 0 ? name.slice(dotIndex + 1) : '';\n}\n\nexport function resolveEditorProjectFileLanguage(filePath: string): string | null {\n const segments = filePath.replace(/\\\\/g, '/').split('/');\n const name = segments[segments.length - 1]?.toLowerCase() ?? '';\n return PROJECT_FILE_LANGUAGE_BY_NAME[name]\n ?? PROJECT_FILE_LANGUAGE_BY_EXTENSION[resolveEditorProjectFileExtension(name)]\n ?? null;\n}\n\nexport function isEditorProjectFilePreviewable(filePath: string): boolean {\n return resolveEditorProjectFileLanguage(filePath) !== null;\n}\n\nexport function resolveEditorProjectMediaSupport(filePath: string): {\n kind: 'image' | 'model' | 'audio';\n mimeType: string;\n} | null {\n return PROJECT_MEDIA_BY_EXTENSION[resolveEditorProjectFileExtension(filePath) as keyof typeof PROJECT_MEDIA_BY_EXTENSION]\n ?? null;\n}\n\nexport function isEditorProjectMediaPreviewable(filePath: string): boolean {\n return resolveEditorProjectMediaSupport(filePath) !== null;\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type EditorProjectFileEntryKind = 'directory' | 'file';
|
|
2
|
+
export interface EditorProjectFileEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
name: string;
|
|
5
|
+
parentPath: string | null;
|
|
6
|
+
kind: EditorProjectFileEntryKind;
|
|
7
|
+
extension?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EditorProjectFileSnapshot {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
rootName: string;
|
|
12
|
+
entries: EditorProjectFileEntry[];
|
|
13
|
+
truncated: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface EditorProjectFileContent {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
path: string;
|
|
18
|
+
name: string;
|
|
19
|
+
extension: string;
|
|
20
|
+
language: string;
|
|
21
|
+
text: string;
|
|
22
|
+
size: number;
|
|
23
|
+
truncated: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type EditorProjectMediaKind = 'image' | 'model' | 'audio';
|
|
26
|
+
export interface EditorProjectMediaSource {
|
|
27
|
+
path: string;
|
|
28
|
+
name: string;
|
|
29
|
+
extension: string;
|
|
30
|
+
kind: EditorProjectMediaKind;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
url: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project-files/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,WAAW,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,0BAA0B,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/project-files/types.ts"],"names":[],"mappings":"","sourcesContent":["export type EditorProjectFileEntryKind = 'directory' | 'file';\n\nexport interface EditorProjectFileEntry {\n path: string;\n name: string;\n parentPath: string | null;\n kind: EditorProjectFileEntryKind;\n extension?: string;\n}\n\nexport interface EditorProjectFileSnapshot {\n [key: string]: unknown;\n rootName: string;\n entries: EditorProjectFileEntry[];\n truncated: boolean;\n}\n\nexport interface EditorProjectFileContent {\n [key: string]: unknown;\n path: string;\n name: string;\n extension: string;\n language: string;\n text: string;\n size: number;\n truncated: boolean;\n}\n\nexport type EditorProjectMediaKind = 'image' | 'model' | 'audio';\n\nexport interface EditorProjectMediaSource {\n path: string;\n name: string;\n extension: string;\n kind: EditorProjectMediaKind;\n mimeType: string;\n url: string;\n}\n"]}
|
|
@@ -1232,15 +1232,15 @@ function isEditorSceneEnvironmentTextureAsset(texture) {
|
|
|
1232
1232
|
return false;
|
|
1233
1233
|
if (texture.usage === 'environment')
|
|
1234
1234
|
return true;
|
|
1235
|
-
return
|
|
1235
|
+
return isEnvironmentTextureFormat(texture.resource.format);
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return
|
|
1237
|
+
function isEnvironmentTextureFormat(format) {
|
|
1238
|
+
return /^\.(env|hdr|dds|ktx|ktx2)$/i.test(format);
|
|
1239
1239
|
}
|
|
1240
1240
|
function createRenderingTextureAssetPreview(texture) {
|
|
1241
1241
|
return {
|
|
1242
1242
|
kind: 'image',
|
|
1243
|
-
url: texture.url,
|
|
1243
|
+
url: texture.resource.url,
|
|
1244
1244
|
alt: texture.label,
|
|
1245
1245
|
fit: 'contain',
|
|
1246
1246
|
};
|