@selvajs/visualization 1.7.1-beta.0 → 1.8.0-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/render.d.cts CHANGED
@@ -91,7 +91,11 @@ type LightingConfig = {
91
91
  hemisphereIntensity?: number;
92
92
  };
93
93
  type EnvironmentConfig = {
94
- hdrPath?: string;
94
+ /**
95
+ * Default `/baseHDR.hdr`. `false` loads none, leaving the generated reflection environment to
96
+ * light the scene: for a page that may not fetch, such as an MCP App view.
97
+ */
98
+ hdrPath?: string | false;
95
99
  backgroundColor?: THREE.Color | string;
96
100
  enableEnvironmentLighting?: boolean;
97
101
  /**
package/dist/render.d.ts CHANGED
@@ -91,7 +91,11 @@ type LightingConfig = {
91
91
  hemisphereIntensity?: number;
92
92
  };
93
93
  type EnvironmentConfig = {
94
- hdrPath?: string;
94
+ /**
95
+ * Default `/baseHDR.hdr`. `false` loads none, leaving the generated reflection environment to
96
+ * light the scene: for a page that may not fetch, such as an MCP App view.
97
+ */
98
+ hdrPath?: string | false;
95
99
  backgroundColor?: THREE.Color | string;
96
100
  enableEnvironmentLighting?: boolean;
97
101
  /**
package/dist/render.js CHANGED
@@ -345,7 +345,7 @@ function applyDefaults(options) {
345
345
  hemisphereIntensity: options.lighting?.hemisphereIntensity ?? preset.hemisphereIntensity
346
346
  },
347
347
  environment: {
348
- hdrPath: options.environment?.hdrPath || "/baseHDR.hdr",
348
+ hdrPath: options.environment?.hdrPath === false ? false : options.environment?.hdrPath || "/baseHDR.hdr",
349
349
  backgroundColor: options.environment?.backgroundColor || new THREE.Color(15790320),
350
350
  enableEnvironmentLighting: options.environment?.enableEnvironmentLighting ?? true,
351
351
  sceneUp: options.environment?.sceneUp || defaultUp,
@@ -3745,6 +3745,10 @@ function setupControls(camera, canvas, config) {
3745
3745
  function setupEnvironment(scene, renderer, config, isDisposed) {
3746
3746
  if (config.environment.enableEnvironmentLighting) {
3747
3747
  createReflectionEnvironment(scene, renderer, environmentRotationFor(config.environment.sceneUp ?? defaultUp));
3748
+ if (config.environment.hdrPath === false) {
3749
+ config.events.onReady?.();
3750
+ return;
3751
+ }
3748
3752
  new HDRLoader().load(config.environment.hdrPath || "/baseHDR.hdr", function(envMap) {
3749
3753
  if (isDisposed()) {
3750
3754
  envMap.dispose();