@bendyline/molen-client 0.0.6 → 0.0.7
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.
|
@@ -7,8 +7,12 @@ import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
|
|
7
7
|
* starting with "./" / "http(s):" pass through as URLs, so manifest-less demos stay trivial.
|
|
8
8
|
*/
|
|
9
9
|
interface AssetProvider {
|
|
10
|
-
load(ref: string
|
|
11
|
-
|
|
10
|
+
load(ref: string, options?: {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}): Promise<ArrayBuffer>;
|
|
13
|
+
loadText(ref: string, options?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): Promise<string>;
|
|
12
16
|
}
|
|
13
17
|
interface UrlAssetProviderOptions {
|
|
14
18
|
/**
|
package/dist/audio.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AssetProvider } from "./assets-
|
|
1
|
+
import { n as AssetProvider } from "./assets-IbO4GJpF.mjs";
|
|
2
2
|
import { AudioEnvironmentData, AudioScalar, AudioWhen, EngineEvent, EntityId, JsonObject, SoundEntry, SoundbankDoc, WeatherData } from "@bendyline/molen-schema";
|
|
3
3
|
|
|
4
4
|
//#region src/audio/types.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as readModelSignals, n as ModelSignals, r as createModelSignalVisual, t as ModelSignalVisual } from "./model-signals-DVlLyP-w.mjs";
|
|
2
|
-
import { a as createUrlAssetProvider, i as UrlAssetProviderOptions, n as AssetProvider, r as LoadedGltf, t as AssetCache } from "./assets-
|
|
2
|
+
import { a as createUrlAssetProvider, i as UrlAssetProviderOptions, n as AssetProvider, r as LoadedGltf, t as AssetCache } from "./assets-IbO4GJpF.mjs";
|
|
3
3
|
import { A as createWebGlSkyReflectionFilter, C as EarthSkyState, D as SkyReflectionFilter, E as starDirection, F as FrameAdmissionQueue, I as SceneAdmission, M as AdmissionOptions, N as AdmissionSample, O as SkyReflectionState, P as FrameAdmissionOptions, S as CelestialPosition, T as skyTimeMs, _ as SkyFrame, a as RendererBackendPreference, b as SkyVisualOptions, c as TopDownOrtho, d as ShadowFocus, f as ShadowQuality, g as WeatherVisual, h as createGpuFrameTimer, i as RendererBackend, j as reflectionStateFromLights, k as SkyReflections, l as nextWorldOrigin, m as GpuFrameTimerOptions, n as CameraPose, o as RendererOptions, p as GpuFrameTimer, r as Renderer, s as ThreeRenderer, t as AutoWorldOriginOptions, u as orthoFrustum, v as SkyStar, w as evaluateEarthSky, x as defaultSkyPalette, y as SkyVisual } from "./renderer-DNXUCuIZ.mjs";
|
|
4
4
|
import { a as normalizeInputAxis, i as InputMapOptions, n as InputGamepad, o as resolveAction, r as InputMap, t as InputBindings } from "./input-CD-dHuv0.mjs";
|
|
5
5
|
import { Command, ControlAction, CustomSkyData, Delta, DiagMessage, EarthObserver, EarthSkyData, EngineEvent, EntityId, JsonObject, JsonValue, Keyframe, MessageLink, ModelSignalSpec, Quat, ResolvedWeather, SceneCamera, SceneInput, SceneManifest, SkyAppearance, SkyBodyData, SkyData, SkyData as SkyData$1, SkyPalette, SkyTime, Vec3, WeatherData, WeatherProfile, resolveWeather, weatherProfile } from "@bendyline/molen-schema";
|
package/dist/index.mjs
CHANGED
|
@@ -229,22 +229,22 @@ function createUrlAssetProvider(baseUrl, index, options = {}) {
|
|
|
229
229
|
if (options.variant !== void 0) urls.unshift(new URL(`${dir}/model.${options.variant}.glb`, baseUrl).href);
|
|
230
230
|
return urls;
|
|
231
231
|
};
|
|
232
|
-
const fetchFirst = async (ref) => {
|
|
232
|
+
const fetchFirst = async (ref, signal) => {
|
|
233
233
|
const urls = candidates(ref);
|
|
234
234
|
for (let i = 0; i < urls.length; i++) {
|
|
235
235
|
const url = urls[i];
|
|
236
|
-
const res = await fetch(url);
|
|
236
|
+
const res = await fetch(url, signal ? { signal } : void 0);
|
|
237
237
|
if (res.ok) return res;
|
|
238
238
|
if (res.status !== 404 || i === urls.length - 1) throw new Error(`asset "${ref}": HTTP ${res.status} for ${url}`);
|
|
239
239
|
}
|
|
240
240
|
throw new Error(`asset "${ref}": no candidate URL`);
|
|
241
241
|
};
|
|
242
242
|
return {
|
|
243
|
-
async load(ref) {
|
|
244
|
-
return (await fetchFirst(ref)).arrayBuffer();
|
|
243
|
+
async load(ref, options) {
|
|
244
|
+
return (await fetchFirst(ref, options?.signal)).arrayBuffer();
|
|
245
245
|
},
|
|
246
|
-
async loadText(ref) {
|
|
247
|
-
return (await fetchFirst(ref)).text();
|
|
246
|
+
async loadText(ref, options) {
|
|
247
|
+
return (await fetchFirst(ref, options?.signal)).text();
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
250
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/molen-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"zod": "^4.6.5",
|
|
71
|
-
"@bendyline/molen-materials": "0.0.
|
|
72
|
-
"@bendyline/molen-schema": "0.0.
|
|
71
|
+
"@bendyline/molen-materials": "0.0.6",
|
|
72
|
+
"@bendyline/molen-schema": "0.0.5"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@types/three": ">=0.184.0 <0.187.0",
|