@fps-games/editor 0.2.1-beta.1 → 0.2.1-beta.2
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 +43 -43
- 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 +310 -21
- 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-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-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-standard-project.d.ts.map +1 -1
- package/dist/playable-standard-project.js +5 -2
- package/dist/playable-standard-project.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +7 -7
- 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-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/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/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/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/package.json +1 -1
- package/node_modules/@fps-games/playable-contracts/package.json +1 -1
- package/node_modules/@fps-games/playable-rendering/package.json +2 -2
- package/node_modules/@fps-games/playable-runtime/package.json +12 -12
- package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
- package/node_modules/@fps-games/playable-scene/package.json +2 -2
- package/node_modules/@fps-games/plugin-api/package.json +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/package.json +5 -5
- 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 +22 -22
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
let projectModelThumbnailQueue = Promise.resolve();
|
|
2
|
+
export function resolveLocalEditorProjectModelThumbnail(source, signal) {
|
|
3
|
+
let cleanupPublished = false;
|
|
4
|
+
let publishCleanupReady;
|
|
5
|
+
const cleanupReady = new Promise((resolve) => {
|
|
6
|
+
publishCleanupReady = resolve;
|
|
7
|
+
});
|
|
8
|
+
const publishAbortCleanup = (completion) => {
|
|
9
|
+
if (cleanupPublished)
|
|
10
|
+
return;
|
|
11
|
+
cleanupPublished = true;
|
|
12
|
+
publishCleanupReady({ completion });
|
|
13
|
+
};
|
|
14
|
+
const rendering = projectModelThumbnailQueue.then(() => {
|
|
15
|
+
if (signal?.aborted) {
|
|
16
|
+
publishAbortCleanup(Promise.resolve());
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return renderLocalEditorProjectModelThumbnail(source, signal, publishAbortCleanup);
|
|
20
|
+
});
|
|
21
|
+
void rendering.then(() => publishAbortCleanup(Promise.resolve()), () => publishAbortCleanup(Promise.resolve()));
|
|
22
|
+
projectModelThumbnailQueue = rendering.then(() => undefined, () => undefined);
|
|
23
|
+
return raceProjectModelThumbnailWithAbort(rendering, signal, cleanupReady);
|
|
24
|
+
}
|
|
25
|
+
export async function mountLocalEditorProjectModelPreview(source, canvas, signal) {
|
|
26
|
+
let engine = null;
|
|
27
|
+
let scene = null;
|
|
28
|
+
let camera = null;
|
|
29
|
+
let container = null;
|
|
30
|
+
let resizeObserver = null;
|
|
31
|
+
let disposed = signal?.aborted === true;
|
|
32
|
+
const disposeResources = () => {
|
|
33
|
+
if (disposed && !container && !engine && !scene && !camera && !resizeObserver)
|
|
34
|
+
return;
|
|
35
|
+
disposed = true;
|
|
36
|
+
const errors = [];
|
|
37
|
+
try {
|
|
38
|
+
container?.dispose?.();
|
|
39
|
+
container = null;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
errors.push(error);
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
resizeObserver?.disconnect();
|
|
46
|
+
resizeObserver = null;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
errors.push(error);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
engine?.stopRenderLoop?.();
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
errors.push(error);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
camera?.detachControl?.();
|
|
59
|
+
camera = null;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
errors.push(error);
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
scene?.dispose?.();
|
|
66
|
+
scene = null;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
errors.push(error);
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
engine?.dispose?.();
|
|
73
|
+
engine = null;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
errors.push(error);
|
|
77
|
+
}
|
|
78
|
+
if (errors.length > 0) {
|
|
79
|
+
const error = new Error('Project model preview cleanup failed.');
|
|
80
|
+
error.errors = errors;
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const onAbort = () => {
|
|
85
|
+
try {
|
|
86
|
+
disposeResources();
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
try {
|
|
90
|
+
disposeResources();
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.error('[fps-editor:model-preview] abort cleanup failed', error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const cleanup = () => {
|
|
98
|
+
signal?.removeEventListener('abort', onAbort);
|
|
99
|
+
disposeResources();
|
|
100
|
+
};
|
|
101
|
+
await import('@babylonjs/loaders/glTF');
|
|
102
|
+
const [{ Engine }, { Scene }, { ArcRotateCamera }, { HemisphericLight }, { Vector3 }, { Color4 }, { SceneLoader },] = await Promise.all([
|
|
103
|
+
import('@babylonjs/core/Engines/engine'),
|
|
104
|
+
import('@babylonjs/core/scene'),
|
|
105
|
+
import('@babylonjs/core/Cameras/arcRotateCamera'),
|
|
106
|
+
import('@babylonjs/core/Lights/hemisphericLight'),
|
|
107
|
+
import('@babylonjs/core/Maths/math.vector'),
|
|
108
|
+
import('@babylonjs/core/Maths/math.color'),
|
|
109
|
+
import('@babylonjs/core/Loading/sceneLoader'),
|
|
110
|
+
]);
|
|
111
|
+
if (signal?.aborted || disposed) {
|
|
112
|
+
try {
|
|
113
|
+
disposeResources();
|
|
114
|
+
}
|
|
115
|
+
catch { }
|
|
116
|
+
return cleanup;
|
|
117
|
+
}
|
|
118
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
119
|
+
try {
|
|
120
|
+
engine = new Engine(canvas, true, {
|
|
121
|
+
antialias: true,
|
|
122
|
+
preserveDrawingBuffer: true,
|
|
123
|
+
stencil: true,
|
|
124
|
+
limitDeviceRatio: 2,
|
|
125
|
+
}, true);
|
|
126
|
+
scene = new Scene(engine);
|
|
127
|
+
scene.clearColor = new Color4(0.055, 0.061, 0.07, 1);
|
|
128
|
+
camera = new ArcRotateCamera('project-model-preview-camera', -Math.PI / 2, Math.PI / 2.4, 4, Vector3.Zero(), scene);
|
|
129
|
+
camera.lowerRadiusLimit = 0.05;
|
|
130
|
+
camera.wheelPrecision = 40;
|
|
131
|
+
camera.pinchPrecision = 120;
|
|
132
|
+
camera.attachControl(canvas, true);
|
|
133
|
+
const light = new HemisphericLight('project-model-preview-light', new Vector3(0.2, 1, -0.25), scene);
|
|
134
|
+
light.intensity = 1.25;
|
|
135
|
+
container = await SceneLoader.LoadAssetContainerAsync('', source.url, scene, undefined, '.glb');
|
|
136
|
+
if (disposed) {
|
|
137
|
+
disposeResources();
|
|
138
|
+
return cleanup;
|
|
139
|
+
}
|
|
140
|
+
container.addAllToScene();
|
|
141
|
+
frameProjectModelPreview(container.meshes, camera, Vector3);
|
|
142
|
+
engine.runRenderLoop(() => scene.render());
|
|
143
|
+
resizeObserver = typeof ResizeObserver === 'function'
|
|
144
|
+
? new ResizeObserver(() => engine.resize())
|
|
145
|
+
: null;
|
|
146
|
+
resizeObserver?.observe(canvas);
|
|
147
|
+
engine.resize();
|
|
148
|
+
return cleanup;
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
const cleanupWasAlreadyRequested = signal?.aborted === true || disposed;
|
|
152
|
+
let cleanupError = null;
|
|
153
|
+
try {
|
|
154
|
+
cleanup();
|
|
155
|
+
}
|
|
156
|
+
catch (caught) {
|
|
157
|
+
cleanupError = caught;
|
|
158
|
+
}
|
|
159
|
+
if (cleanupError && cleanupWasAlreadyRequested) {
|
|
160
|
+
return cleanup;
|
|
161
|
+
}
|
|
162
|
+
if (cleanupError) {
|
|
163
|
+
const aggregate = new Error('Project model preview initialization cleanup failed.');
|
|
164
|
+
aggregate.errors = [error, cleanupError];
|
|
165
|
+
throw aggregate;
|
|
166
|
+
}
|
|
167
|
+
if (signal?.aborted)
|
|
168
|
+
return cleanup;
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async function renderLocalEditorProjectModelThumbnail(source, signal, publishAbortCleanup = () => undefined) {
|
|
173
|
+
if (source.kind !== 'model' || typeof document === 'undefined')
|
|
174
|
+
return null;
|
|
175
|
+
if (signal?.aborted) {
|
|
176
|
+
publishAbortCleanup(Promise.resolve());
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
await import('@babylonjs/loaders/glTF');
|
|
180
|
+
const [{ Engine }, { Scene }, { ArcRotateCamera }, { DirectionalLight }, { HemisphericLight }, { Vector3 }, { Color3, Color4 }, { SceneLoader },] = await Promise.all([
|
|
181
|
+
import('@babylonjs/core/Engines/engine'),
|
|
182
|
+
import('@babylonjs/core/scene'),
|
|
183
|
+
import('@babylonjs/core/Cameras/arcRotateCamera'),
|
|
184
|
+
import('@babylonjs/core/Lights/directionalLight'),
|
|
185
|
+
import('@babylonjs/core/Lights/hemisphericLight'),
|
|
186
|
+
import('@babylonjs/core/Maths/math.vector'),
|
|
187
|
+
import('@babylonjs/core/Maths/math.color'),
|
|
188
|
+
import('@babylonjs/core/Loading/sceneLoader'),
|
|
189
|
+
]);
|
|
190
|
+
if (signal?.aborted)
|
|
191
|
+
return null;
|
|
192
|
+
const canvas = document.createElement('canvas');
|
|
193
|
+
canvas.width = 256;
|
|
194
|
+
canvas.height = 160;
|
|
195
|
+
let engine = null;
|
|
196
|
+
let scene = null;
|
|
197
|
+
let container = null;
|
|
198
|
+
let disposeRequested = false;
|
|
199
|
+
let disposePromise = null;
|
|
200
|
+
const dispose = () => {
|
|
201
|
+
disposeRequested = true;
|
|
202
|
+
if (disposePromise)
|
|
203
|
+
return disposePromise;
|
|
204
|
+
disposePromise = (async () => {
|
|
205
|
+
const errors = [];
|
|
206
|
+
for (let attempt = 0; attempt < 2 && (container || scene || engine); attempt += 1) {
|
|
207
|
+
if (container) {
|
|
208
|
+
try {
|
|
209
|
+
container.dispose?.();
|
|
210
|
+
container = null;
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
errors.push(error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (scene) {
|
|
217
|
+
try {
|
|
218
|
+
scene.dispose?.();
|
|
219
|
+
scene = null;
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
errors.push(error);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (engine) {
|
|
226
|
+
try {
|
|
227
|
+
engine.dispose?.();
|
|
228
|
+
engine = null;
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
errors.push(error);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (container || scene || engine)
|
|
235
|
+
await Promise.resolve();
|
|
236
|
+
}
|
|
237
|
+
if (container || scene || engine) {
|
|
238
|
+
const error = new Error('Project model thumbnail cleanup failed.');
|
|
239
|
+
error.errors = errors;
|
|
240
|
+
throw error;
|
|
241
|
+
}
|
|
242
|
+
})().finally(() => {
|
|
243
|
+
disposePromise = null;
|
|
244
|
+
});
|
|
245
|
+
return disposePromise;
|
|
246
|
+
};
|
|
247
|
+
const onAbort = () => { publishAbortCleanup(dispose()); };
|
|
248
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
249
|
+
try {
|
|
250
|
+
engine = new Engine(canvas, true, {
|
|
251
|
+
antialias: true,
|
|
252
|
+
premultipliedAlpha: true,
|
|
253
|
+
preserveDrawingBuffer: true,
|
|
254
|
+
stencil: true,
|
|
255
|
+
limitDeviceRatio: 1,
|
|
256
|
+
}, true);
|
|
257
|
+
scene = new Scene(engine);
|
|
258
|
+
const camera = new ArcRotateCamera('project-model-thumbnail-camera', -Math.PI / 3, Math.PI / 2.45, 4, Vector3.Zero(), scene);
|
|
259
|
+
scene.clearColor = new Color4(0, 0, 0, 0);
|
|
260
|
+
scene.ambientColor = new Color3(0.08, 0.09, 0.1);
|
|
261
|
+
const fillLight = new HemisphericLight('project-model-thumbnail-fill', new Vector3(0.15, 1, -0.2), scene);
|
|
262
|
+
fillLight.intensity = 1.15;
|
|
263
|
+
fillLight.diffuse = new Color3(0.84, 0.88, 0.94);
|
|
264
|
+
fillLight.groundColor = new Color3(0.08, 0.09, 0.11);
|
|
265
|
+
const keyLight = new DirectionalLight('project-model-thumbnail-key', new Vector3(0.55, -0.8, 0.65), scene);
|
|
266
|
+
keyLight.intensity = 1.55;
|
|
267
|
+
keyLight.diffuse = new Color3(1, 0.96, 0.9);
|
|
268
|
+
container = await SceneLoader.LoadAssetContainerAsync('', source.url, scene, undefined, '.glb');
|
|
269
|
+
if (disposeRequested || signal?.aborted) {
|
|
270
|
+
await dispose();
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
container.addAllToScene();
|
|
274
|
+
frameProjectModelPreview(container.meshes, camera, Vector3);
|
|
275
|
+
engine.resize();
|
|
276
|
+
await scene.whenReadyAsync();
|
|
277
|
+
scene.render();
|
|
278
|
+
return canvas.toDataURL('image/png');
|
|
279
|
+
}
|
|
280
|
+
finally {
|
|
281
|
+
signal?.removeEventListener('abort', onAbort);
|
|
282
|
+
await dispose();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function raceProjectModelThumbnailWithAbort(pending, signal, cleanupReady) {
|
|
286
|
+
if (!signal)
|
|
287
|
+
return pending;
|
|
288
|
+
if (signal.aborted) {
|
|
289
|
+
return cleanupReady
|
|
290
|
+
? cleanupReady.then(({ completion }) => settleAbortedProjectModelThumbnail(pending, completion))
|
|
291
|
+
: Promise.resolve(null);
|
|
292
|
+
}
|
|
293
|
+
return new Promise((resolve, reject) => {
|
|
294
|
+
const onAbort = () => {
|
|
295
|
+
signal.removeEventListener('abort', onAbort);
|
|
296
|
+
if (!cleanupReady) {
|
|
297
|
+
resolve(null);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
void cleanupReady
|
|
301
|
+
.then(({ completion }) => settleAbortedProjectModelThumbnail(pending, completion))
|
|
302
|
+
.then(resolve, reject);
|
|
303
|
+
};
|
|
304
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
305
|
+
pending.then(value => {
|
|
306
|
+
signal.removeEventListener('abort', onAbort);
|
|
307
|
+
resolve(value);
|
|
308
|
+
}, error => {
|
|
309
|
+
signal.removeEventListener('abort', onAbort);
|
|
310
|
+
reject(error);
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
async function settleAbortedProjectModelThumbnail(pending, cleanupCompletion) {
|
|
315
|
+
const [rendering, cleanup] = await Promise.allSettled([pending, cleanupCompletion]);
|
|
316
|
+
if (rendering.status === 'rejected' && cleanup.status === 'rejected') {
|
|
317
|
+
const error = new Error('Project model thumbnail abort cleanup failed.');
|
|
318
|
+
error.errors = [rendering.reason, cleanup.reason];
|
|
319
|
+
throw error;
|
|
320
|
+
}
|
|
321
|
+
if (rendering.status === 'rejected')
|
|
322
|
+
throw rendering.reason;
|
|
323
|
+
if (cleanup.status === 'rejected')
|
|
324
|
+
throw cleanup.reason;
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
function frameProjectModelPreview(meshes, camera, Vector3) {
|
|
328
|
+
let minX = Number.POSITIVE_INFINITY;
|
|
329
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
330
|
+
let minZ = Number.POSITIVE_INFINITY;
|
|
331
|
+
let maxX = Number.NEGATIVE_INFINITY;
|
|
332
|
+
let maxY = Number.NEGATIVE_INFINITY;
|
|
333
|
+
let maxZ = Number.NEGATIVE_INFINITY;
|
|
334
|
+
for (const mesh of meshes) {
|
|
335
|
+
if (typeof mesh?.getBoundingInfo !== 'function')
|
|
336
|
+
continue;
|
|
337
|
+
mesh.computeWorldMatrix?.(true);
|
|
338
|
+
const box = mesh.getBoundingInfo()?.boundingBox;
|
|
339
|
+
const min = box?.minimumWorld;
|
|
340
|
+
const max = box?.maximumWorld;
|
|
341
|
+
if (![min?.x, min?.y, min?.z, max?.x, max?.y, max?.z].every(Number.isFinite))
|
|
342
|
+
continue;
|
|
343
|
+
minX = Math.min(minX, min.x);
|
|
344
|
+
minY = Math.min(minY, min.y);
|
|
345
|
+
minZ = Math.min(minZ, min.z);
|
|
346
|
+
maxX = Math.max(maxX, max.x);
|
|
347
|
+
maxY = Math.max(maxY, max.y);
|
|
348
|
+
maxZ = Math.max(maxZ, max.z);
|
|
349
|
+
}
|
|
350
|
+
if (!Number.isFinite(minX))
|
|
351
|
+
return;
|
|
352
|
+
const center = new Vector3((minX + maxX) / 2, (minY + maxY) / 2, (minZ + maxZ) / 2);
|
|
353
|
+
const diameter = Math.max(maxX - minX, maxY - minY, maxZ - minZ, 0.1);
|
|
354
|
+
camera.setTarget(center);
|
|
355
|
+
camera.radius = diameter * 1.6;
|
|
356
|
+
camera.minZ = Math.max(diameter / 10000, 0.001);
|
|
357
|
+
camera.maxZ = Math.max(diameter * 100, 100);
|
|
358
|
+
}
|
|
359
|
+
//# sourceMappingURL=project-model-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-model-preview.js","sourceRoot":"","sources":["../../src/internal/project-model-preview.ts"],"names":[],"mappings":"AAMA,IAAI,0BAA0B,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;AAElE,MAAM,UAAU,uCAAuC,CACrD,MAA4C,EAC5C,MAAoB;IAEpB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,mBAAoE,CAAC;IACzE,MAAM,YAAY,GAAG,IAAI,OAAO,CAAgC,CAAC,OAAO,EAAE,EAAE;QAC1E,mBAAmB,GAAG,OAAO,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG,CAAC,UAAyB,EAAQ,EAAE;QAC9D,IAAI,gBAAgB;YAAE,OAAO;QAC7B,gBAAgB,GAAG,IAAI,CAAC;QACxB,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,MAAM,SAAS,GAAG,0BAA0B,CAAC,IAAI,CAAC,GAAG,EAAE;QACrD,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,mBAAmB,CAAC,OAAO,CAAC,OAAO,EA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AAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,KAAM,EAAE,KAAK,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import type {\n LocalEditorBrowserProjectMediaSource,\n LocalEditorBrowserProjectModelPreviewCleanup,\n LocalEditorBrowserProjectModelThumbnail,\n} from '@fps-games/editor-browser';\n\nlet projectModelThumbnailQueue: Promise<void> = Promise.resolve();\n\nexport function resolveLocalEditorProjectModelThumbnail(\n source: LocalEditorBrowserProjectMediaSource,\n signal?: AbortSignal,\n): Promise<LocalEditorBrowserProjectModelThumbnail> {\n let cleanupPublished = false;\n let publishCleanupReady!: (value: { completion: Promise<void> }) => void;\n const cleanupReady = new Promise<{ completion: Promise<void> }>((resolve) => {\n publishCleanupReady = resolve;\n });\n const publishAbortCleanup = (completion: Promise<void>): void => {\n if (cleanupPublished) return;\n cleanupPublished = true;\n publishCleanupReady({ completion });\n };\n const rendering = projectModelThumbnailQueue.then(() => {\n if (signal?.aborted) {\n publishAbortCleanup(Promise.resolve());\n return null;\n }\n return renderLocalEditorProjectModelThumbnail(source, signal, publishAbortCleanup);\n });\n void rendering.then(\n () => publishAbortCleanup(Promise.resolve()),\n () => publishAbortCleanup(Promise.resolve()),\n );\n projectModelThumbnailQueue = rendering.then(() => undefined, () => undefined);\n return raceProjectModelThumbnailWithAbort(rendering, signal, cleanupReady);\n}\n\nexport async function mountLocalEditorProjectModelPreview(\n source: LocalEditorBrowserProjectMediaSource,\n canvas: HTMLCanvasElement,\n signal?: AbortSignal,\n): Promise<LocalEditorBrowserProjectModelPreviewCleanup> {\n let engine: any = null;\n let scene: any = null;\n let camera: any = null;\n let container: any = null;\n let resizeObserver: ResizeObserver | null = null;\n let disposed = signal?.aborted === true;\n const disposeResources = (): void => {\n if (disposed && !container && !engine && !scene && !camera && !resizeObserver) return;\n disposed = true;\n const errors: unknown[] = [];\n try {\n container?.dispose?.();\n container = null;\n } catch (error) { errors.push(error); }\n try {\n resizeObserver?.disconnect();\n resizeObserver = null;\n } catch (error) { errors.push(error); }\n try { engine?.stopRenderLoop?.(); } catch (error) { errors.push(error); }\n try {\n camera?.detachControl?.();\n camera = null;\n } catch (error) { errors.push(error); }\n try {\n scene?.dispose?.();\n scene = null;\n } catch (error) { errors.push(error); }\n try {\n engine?.dispose?.();\n engine = null;\n } catch (error) { errors.push(error); }\n if (errors.length > 0) {\n const error = new Error('Project model preview cleanup failed.') as Error & { errors: unknown[] };\n error.errors = errors;\n throw error;\n }\n };\n const onAbort = (): void => {\n try {\n disposeResources();\n } catch {\n try {\n disposeResources();\n } catch (error) {\n console.error('[fps-editor:model-preview] abort cleanup failed', error);\n }\n }\n };\n const cleanup = (): void => {\n signal?.removeEventListener('abort', onAbort);\n disposeResources();\n };\n\n await import('@babylonjs/loaders/glTF');\n const [\n { Engine },\n { Scene },\n { ArcRotateCamera },\n { HemisphericLight },\n { Vector3 },\n { Color4 },\n { SceneLoader },\n ] = await Promise.all([\n import('@babylonjs/core/Engines/engine'),\n import('@babylonjs/core/scene'),\n import('@babylonjs/core/Cameras/arcRotateCamera'),\n import('@babylonjs/core/Lights/hemisphericLight'),\n import('@babylonjs/core/Maths/math.vector'),\n import('@babylonjs/core/Maths/math.color'),\n import('@babylonjs/core/Loading/sceneLoader'),\n ]);\n\n if (signal?.aborted || disposed) {\n try { disposeResources(); } catch {}\n return cleanup;\n }\n signal?.addEventListener('abort', onAbort, { once: true });\n try {\n engine = new Engine(canvas, true, {\n antialias: true,\n preserveDrawingBuffer: true,\n stencil: true,\n limitDeviceRatio: 2,\n }, true);\n scene = new Scene(engine);\n scene.clearColor = new Color4(0.055, 0.061, 0.07, 1);\n camera = new ArcRotateCamera('project-model-preview-camera', -Math.PI / 2, Math.PI / 2.4, 4, Vector3.Zero(), scene);\n camera.lowerRadiusLimit = 0.05;\n camera.wheelPrecision = 40;\n camera.pinchPrecision = 120;\n camera.attachControl(canvas, true);\n const light = new HemisphericLight('project-model-preview-light', new Vector3(0.2, 1, -0.25), scene);\n light.intensity = 1.25;\n container = await SceneLoader.LoadAssetContainerAsync('', source.url, scene, undefined, '.glb');\n if (disposed) {\n disposeResources();\n return cleanup;\n }\n container.addAllToScene();\n frameProjectModelPreview(container.meshes, camera, Vector3);\n engine.runRenderLoop(() => scene.render());\n resizeObserver = typeof ResizeObserver === 'function'\n ? new ResizeObserver(() => engine.resize())\n : null;\n resizeObserver?.observe(canvas);\n engine.resize();\n return cleanup;\n } catch (error) {\n const cleanupWasAlreadyRequested = signal?.aborted === true || disposed;\n let cleanupError: unknown = null;\n try { cleanup(); } catch (caught) { cleanupError = caught; }\n if (cleanupError && cleanupWasAlreadyRequested) {\n return cleanup;\n }\n if (cleanupError) {\n const aggregate = new Error('Project model preview initialization cleanup failed.') as Error & { errors: unknown[] };\n aggregate.errors = [error, cleanupError];\n throw aggregate;\n }\n if (signal?.aborted) return cleanup;\n throw error;\n }\n}\n\nasync function renderLocalEditorProjectModelThumbnail(\n source: LocalEditorBrowserProjectMediaSource,\n signal?: AbortSignal,\n publishAbortCleanup: (completion: Promise<void>) => void = () => undefined,\n): Promise<LocalEditorBrowserProjectModelThumbnail> {\n if (source.kind !== 'model' || typeof document === 'undefined') return null;\n if (signal?.aborted) {\n publishAbortCleanup(Promise.resolve());\n return null;\n }\n await import('@babylonjs/loaders/glTF');\n const [\n { Engine },\n { Scene },\n { ArcRotateCamera },\n { DirectionalLight },\n { HemisphericLight },\n { Vector3 },\n { Color3, Color4 },\n { SceneLoader },\n ] = await Promise.all([\n import('@babylonjs/core/Engines/engine'),\n import('@babylonjs/core/scene'),\n import('@babylonjs/core/Cameras/arcRotateCamera'),\n import('@babylonjs/core/Lights/directionalLight'),\n import('@babylonjs/core/Lights/hemisphericLight'),\n import('@babylonjs/core/Maths/math.vector'),\n import('@babylonjs/core/Maths/math.color'),\n import('@babylonjs/core/Loading/sceneLoader'),\n ]);\n if (signal?.aborted) return null;\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 160;\n let engine: any = null;\n let scene: any = null;\n let container: any = null;\n let disposeRequested = false;\n let disposePromise: Promise<void> | null = null;\n const dispose = (): Promise<void> => {\n disposeRequested = true;\n if (disposePromise) return disposePromise;\n disposePromise = (async () => {\n const errors: unknown[] = [];\n for (let attempt = 0; attempt < 2 && (container || scene || engine); attempt += 1) {\n if (container) {\n try {\n container.dispose?.();\n container = null;\n } catch (error) { errors.push(error); }\n }\n if (scene) {\n try {\n scene.dispose?.();\n scene = null;\n } catch (error) { errors.push(error); }\n }\n if (engine) {\n try {\n engine.dispose?.();\n engine = null;\n } catch (error) { errors.push(error); }\n }\n if (container || scene || engine) await Promise.resolve();\n }\n if (container || scene || engine) {\n const error = new Error('Project model thumbnail cleanup failed.') as Error & { errors: unknown[] };\n error.errors = errors;\n throw error;\n }\n })().finally(() => {\n disposePromise = null;\n });\n return disposePromise;\n };\n const onAbort = (): void => { publishAbortCleanup(dispose()); };\n signal?.addEventListener('abort', onAbort, { once: true });\n\n try {\n engine = new Engine(canvas, true, {\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n stencil: true,\n limitDeviceRatio: 1,\n }, true);\n scene = new Scene(engine);\n const camera = new ArcRotateCamera(\n 'project-model-thumbnail-camera',\n -Math.PI / 3,\n Math.PI / 2.45,\n 4,\n Vector3.Zero(),\n scene,\n );\n scene.clearColor = new Color4(0, 0, 0, 0);\n scene.ambientColor = new Color3(0.08, 0.09, 0.1);\n const fillLight = new HemisphericLight('project-model-thumbnail-fill', new Vector3(0.15, 1, -0.2), scene);\n fillLight.intensity = 1.15;\n fillLight.diffuse = new Color3(0.84, 0.88, 0.94);\n fillLight.groundColor = new Color3(0.08, 0.09, 0.11);\n const keyLight = new DirectionalLight('project-model-thumbnail-key', new Vector3(0.55, -0.8, 0.65), scene);\n keyLight.intensity = 1.55;\n keyLight.diffuse = new Color3(1, 0.96, 0.9);\n container = await SceneLoader.LoadAssetContainerAsync('', source.url, scene, undefined, '.glb');\n if (disposeRequested || signal?.aborted) {\n await dispose();\n return null;\n }\n container.addAllToScene();\n frameProjectModelPreview(container.meshes, camera, Vector3);\n engine.resize();\n await scene.whenReadyAsync();\n scene.render();\n return canvas.toDataURL('image/png');\n } finally {\n signal?.removeEventListener('abort', onAbort);\n await dispose();\n }\n}\n\nfunction raceProjectModelThumbnailWithAbort<T>(\n pending: Promise<T>,\n signal?: AbortSignal,\n cleanupReady?: Promise<{ completion: Promise<void> }>,\n): Promise<T | null> {\n if (!signal) return pending;\n if (signal.aborted) {\n return cleanupReady\n ? cleanupReady.then(({ completion }) => settleAbortedProjectModelThumbnail(pending, completion))\n : Promise.resolve(null);\n }\n return new Promise<T | null>((resolve, reject) => {\n const onAbort = (): void => {\n signal.removeEventListener('abort', onAbort);\n if (!cleanupReady) {\n resolve(null);\n return;\n }\n void cleanupReady\n .then(({ completion }) => settleAbortedProjectModelThumbnail(pending, completion))\n .then(resolve, reject);\n };\n signal.addEventListener('abort', onAbort, { once: true });\n pending.then(\n value => {\n signal.removeEventListener('abort', onAbort);\n resolve(value);\n },\n error => {\n signal.removeEventListener('abort', onAbort);\n reject(error);\n },\n );\n });\n}\n\nasync function settleAbortedProjectModelThumbnail<T>(\n pending: Promise<T>,\n cleanupCompletion: Promise<void>,\n): Promise<null> {\n const [rendering, cleanup] = await Promise.allSettled([pending, cleanupCompletion]);\n if (rendering.status === 'rejected' && cleanup.status === 'rejected') {\n const error = new Error('Project model thumbnail abort cleanup failed.') as Error & { errors: unknown[] };\n error.errors = [rendering.reason, cleanup.reason];\n throw error;\n }\n if (rendering.status === 'rejected') throw rendering.reason;\n if (cleanup.status === 'rejected') throw cleanup.reason;\n return null;\n}\n\nfunction frameProjectModelPreview(\n meshes: readonly any[],\n camera: any,\n Vector3: { new(x: number, y: number, z: number): any },\n): void {\n let minX = Number.POSITIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let minZ = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n let maxZ = Number.NEGATIVE_INFINITY;\n for (const mesh of meshes) {\n if (typeof mesh?.getBoundingInfo !== 'function') continue;\n mesh.computeWorldMatrix?.(true);\n const box = mesh.getBoundingInfo()?.boundingBox;\n const min = box?.minimumWorld;\n const max = box?.maximumWorld;\n if (![min?.x, min?.y, min?.z, max?.x, max?.y, max?.z].every(Number.isFinite)) continue;\n minX = Math.min(minX, min.x);\n minY = Math.min(minY, min.y);\n minZ = Math.min(minZ, min.z);\n maxX = Math.max(maxX, max.x);\n maxY = Math.max(maxY, max.y);\n maxZ = Math.max(maxZ, max.z);\n }\n if (!Number.isFinite(minX)) return;\n const center = new Vector3((minX + maxX) / 2, (minY + maxY) / 2, (minZ + maxZ) / 2);\n const diameter = Math.max(maxX - minX, maxY - minY, maxZ - minZ, 0.1);\n camera.setTarget(center);\n camera.radius = diameter * 1.6;\n camera.minZ = Math.max(diameter / 10_000, 0.001);\n camera.maxZ = Math.max(diameter * 100, 100);\n}\n"]}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { SceneGraphTreeItem } from '@fps-games/editor-core';
|
|
2
|
-
import { type EditorAgentContextSemantics, type EditorAgentRegionBindingContext, type EditorAgentSceneObjectContext, type EditorAgentSceneObjectSetContext, type EditorAgentSpatialMarkerContext, type EditorAgentSpatialRelationGraphContext, type EditorAgentSource, type ResolvedSpatialMarkerGraph, type ResolvedSpatialMarkerNode, type SpatialMarkerTypeDefinition, type SpatialRelation, type SpatialRelationTypeDefinition } from '@fps-games/editor-protocol';
|
|
2
|
+
import { type EditorAgentContextSemantics, type EditorAgentProjectDirectoryContext, type EditorAgentProjectFileContext, type EditorAgentRegionBindingContext, type EditorAgentSceneObjectContext, type EditorAgentSceneObjectSetContext, type EditorAgentSpatialMarkerContext, type EditorAgentSpatialRelationGraphContext, type EditorAgentSource, type ResolvedSpatialMarkerGraph, type ResolvedSpatialMarkerNode, type SpatialMarkerTypeDefinition, type SpatialRelation, type SpatialRelationTypeDefinition } from '@fps-games/editor-protocol';
|
|
3
|
+
export interface LocalEditorAgentContextProjectEntryInput {
|
|
4
|
+
path: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
entryKind: 'file' | 'directory';
|
|
7
|
+
extension?: string;
|
|
8
|
+
assetId?: string;
|
|
9
|
+
assetKind?: string;
|
|
10
|
+
source?: Partial<EditorAgentSource>;
|
|
11
|
+
createdAt?: number;
|
|
12
|
+
}
|
|
3
13
|
export interface LocalEditorAgentContextObjectInput<TDocument = unknown> {
|
|
4
14
|
document: TDocument;
|
|
5
15
|
objectId: string;
|
|
@@ -49,6 +59,7 @@ export interface LocalEditorAgentContextSpatialRelationGraphInput<TDocument = un
|
|
|
49
59
|
createdAt?: number;
|
|
50
60
|
semantics?: EditorAgentContextSemantics | null;
|
|
51
61
|
}
|
|
62
|
+
export declare function createLocalEditorProjectEntryAgentContext(input: LocalEditorAgentContextProjectEntryInput): EditorAgentProjectFileContext | EditorAgentProjectDirectoryContext | null;
|
|
52
63
|
export declare function createLocalEditorSceneObjectAgentContext<TDocument>(input: LocalEditorAgentContextObjectInput<TDocument>): EditorAgentSceneObjectContext | null;
|
|
53
64
|
export declare function createLocalEditorSceneObjectSetAgentContext<TDocument>(input: LocalEditorAgentContextObjectSetInput<TDocument>): EditorAgentSceneObjectSetContext | null;
|
|
54
65
|
export declare function createLocalEditorRegionBindingAgentContext<TDocument>(input: LocalEditorAgentContextRegionBindingInput<TDocument>): EditorAgentRegionBindingContext | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-editor-agent-context.d.ts","sourceRoot":"","sources":["../src/local-editor-agent-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EAEpC,KAAK,6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AgB,2CAA2C,CAAC,SAAS,EACnE,KAAK,EAAE,qCAAqC,CAAC,SAAS,CAAC,GACtD,gCAAgC,GAAG,IAAI,CAiBzC;AAED,wBAAgB,0CAA0C,CAAC,SAAS,EAClE,KAAK,EAAE,yCAAyC,CAAC,SAAS,CAAC,GAC1D,+BAA+B,GAAG,IAAI,CA4BxC;AAED,wBAAgB,0CAA0C,CAAC,SAAS,EAClE,KAAK,EAAE,yCAAyC,CAAC,SAAS,CAAC,GAC1D,+BAA+B,GAAG,IAAI,CAyCxC;AAED,wBAAgB,iDAAiD,CAAC,SAAS,EACzE,KAAK,EAAE,gDAAgD,CAAC,SAAS,CAAC,GACjE,sCAAsC,GAAG,IAAI,CAkC/C"}
|
|
1
|
+
{"version":3,"file":"local-editor-agent-context.d.ts","sourceRoot":"","sources":["../src/local-editor-agent-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EAEpC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAC3C,KAAK,iBAAiB,EAGtB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,6BAA6B,EACnC,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,wCAAwC;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,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G,IAAI,CAiBzC;AAED,wBAAgB,0CAA0C,CAAC,SAAS,EAClE,KAAK,EAAE,yCAAyC,CAAC,SAAS,CAAC,GAC1D,+BAA+B,GAAG,IAAI,CA4BxC;AAED,wBAAgB,0CAA0C,CAAC,SAAS,EAClE,KAAK,EAAE,yCAAyC,CAAC,SAAS,CAAC,GAC1D,+BAA+B,GAAG,IAAI,CAyCxC;AAED,wBAAgB,iDAAiD,CAAC,SAAS,EACzE,KAAK,EAAE,gDAAgD,CAAC,SAAS,CAAC,GACjE,sCAAsC,GAAG,IAAI,CAkC/C"}
|
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
import { EDITOR_AGENT_CONTEXT_SCHEMA_VERSION, } from '@fps-games/editor-protocol';
|
|
2
|
+
export function createLocalEditorProjectEntryAgentContext(input) {
|
|
3
|
+
const path = normalizeProjectEntryPath(input.path);
|
|
4
|
+
if (!path)
|
|
5
|
+
return null;
|
|
6
|
+
const segments = path.split('/');
|
|
7
|
+
const name = input.name?.trim() || segments[segments.length - 1] || path;
|
|
8
|
+
const extension = input.entryKind === 'file'
|
|
9
|
+
? input.extension?.trim().toLowerCase() || undefined
|
|
10
|
+
: undefined;
|
|
11
|
+
const entry = {
|
|
12
|
+
path,
|
|
13
|
+
name,
|
|
14
|
+
entryKind: input.entryKind,
|
|
15
|
+
...(extension ? { extension } : {}),
|
|
16
|
+
...(input.assetId?.trim() ? { assetId: input.assetId.trim() } : {}),
|
|
17
|
+
...(input.assetKind?.trim() ? { assetKind: input.assetKind.trim() } : {}),
|
|
18
|
+
};
|
|
19
|
+
const kind = input.entryKind === 'directory' ? 'project-directory' : 'project-file';
|
|
20
|
+
const base = {
|
|
21
|
+
schemaVersion: EDITOR_AGENT_CONTEXT_SCHEMA_VERSION,
|
|
22
|
+
id: createAgentContextId(kind, [path], input.createdAt),
|
|
23
|
+
label: name,
|
|
24
|
+
summary: [
|
|
25
|
+
input.entryKind === 'directory' ? `Project Directory: ${name}` : `Project File: ${name}`,
|
|
26
|
+
`path: ${path}`,
|
|
27
|
+
...(extension ? [`type: ${extension}`] : []),
|
|
28
|
+
...(entry.assetId ? [`assetId: ${entry.assetId}`] : []),
|
|
29
|
+
].join('\n'),
|
|
30
|
+
createdAt: input.createdAt ?? Date.now(),
|
|
31
|
+
source: createAgentSource('project-files', input.source),
|
|
32
|
+
};
|
|
33
|
+
return input.entryKind === 'directory'
|
|
34
|
+
? { ...base, kind: 'project-directory', entry: { ...entry, entryKind: 'directory' } }
|
|
35
|
+
: { ...base, kind: 'project-file', entry: { ...entry, entryKind: 'file' } };
|
|
36
|
+
}
|
|
2
37
|
export function createLocalEditorSceneObjectAgentContext(input) {
|
|
3
38
|
const objectId = normalizeId(input.objectId);
|
|
4
39
|
if (!objectId)
|
|
@@ -295,6 +330,18 @@ function normalizeId(value) {
|
|
|
295
330
|
const id = value.trim();
|
|
296
331
|
return id || null;
|
|
297
332
|
}
|
|
333
|
+
function normalizeProjectEntryPath(value) {
|
|
334
|
+
const rawPath = value.trim().replace(/\\/g, '/');
|
|
335
|
+
if (rawPath === '/' || rawPath === '.')
|
|
336
|
+
return '.';
|
|
337
|
+
const path = rawPath.replace(/^\/+/, '');
|
|
338
|
+
if (!path || /^[A-Za-z]:\//.test(path))
|
|
339
|
+
return null;
|
|
340
|
+
const segments = path.split('/');
|
|
341
|
+
return segments.some(segment => !segment || segment === '.' || segment === '..')
|
|
342
|
+
? null
|
|
343
|
+
: segments.join('/');
|
|
344
|
+
}
|
|
298
345
|
function normalizeIds(values) {
|
|
299
346
|
return [...new Set(values.map(value => value.trim()).filter(Boolean))];
|
|
300
347
|
}
|