@react-three/fiber 8.11.1 → 8.11.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/CHANGELOG.md +6 -0
- package/dist/declarations/src/core/utils.d.ts +1 -0
- package/dist/{index-73d51a81.esm.js → index-3c94c6e9.esm.js} +12 -8
- package/dist/{index-d9aa5cee.cjs.dev.js → index-b2f18198.cjs.dev.js} +12 -8
- package/dist/{index-2929b2e6.cjs.prod.js → index-ce6281d5.cjs.prod.js} +12 -8
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -29,6 +29,7 @@ export declare class ErrorBoundary extends React.Component<{
|
|
|
29
29
|
render(): React.ReactNode;
|
|
30
30
|
}
|
|
31
31
|
export declare const DEFAULT = "__default";
|
|
32
|
+
export declare const DEFAULTS: Map<any, any>;
|
|
32
33
|
export declare type DiffSet = {
|
|
33
34
|
memoized: {
|
|
34
35
|
[key: string]: any;
|
|
@@ -56,6 +56,7 @@ ErrorBoundary.getDerivedStateFromError = () => ({
|
|
|
56
56
|
error: true
|
|
57
57
|
});
|
|
58
58
|
const DEFAULT = '__default';
|
|
59
|
+
const DEFAULTS = new Map();
|
|
59
60
|
const isDiffSet = def => def && !!def.memoized && !!def.changes;
|
|
60
61
|
function calculateDpr(dpr) {
|
|
61
62
|
const target = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
|
|
@@ -293,13 +294,14 @@ function applyProps$1(instance, data) {
|
|
|
293
294
|
// For removed props, try to set default values, if possible
|
|
294
295
|
if (value === DEFAULT + 'remove') {
|
|
295
296
|
if (currentInstance.constructor) {
|
|
296
|
-
var _currentInstance$__r;
|
|
297
297
|
// create a blank slate of the instance and copy the particular parameter.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
299
|
+
if (!ctor) {
|
|
300
|
+
// @ts-ignore
|
|
301
|
+
ctor = new currentInstance.constructor();
|
|
302
|
+
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
303
|
+
}
|
|
304
|
+
value = ctor[key];
|
|
303
305
|
} else {
|
|
304
306
|
// instance does not have constructor, just set it to 0
|
|
305
307
|
value = 0;
|
|
@@ -318,7 +320,7 @@ function applyProps$1(instance, data) {
|
|
|
318
320
|
if (targetProp.fromArray) targetProp.fromArray(value);else targetProp.set(...value);
|
|
319
321
|
}
|
|
320
322
|
// Test again target.copy(class) next ...
|
|
321
|
-
else if (targetProp.copy && value && value.constructor && targetProp.constructor
|
|
323
|
+
else if (targetProp.copy && value && value.constructor && targetProp.constructor === value.constructor) {
|
|
322
324
|
targetProp.copy(value);
|
|
323
325
|
}
|
|
324
326
|
// If nothing else fits, just set the single value, ignore undefined
|
|
@@ -342,7 +344,9 @@ function applyProps$1(instance, data) {
|
|
|
342
344
|
currentInstance[key] = value;
|
|
343
345
|
// Auto-convert sRGB textures, for now ...
|
|
344
346
|
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
345
|
-
if (!rootState.linear && currentInstance[key] instanceof THREE.Texture
|
|
347
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE.Texture &&
|
|
348
|
+
// sRGB textures must be RGBA8 since r137 https://github.com/mrdoob/three.js/pull/23129
|
|
349
|
+
currentInstance[key].format === THREE.RGBAFormat && currentInstance[key].type === THREE.UnsignedByteType) {
|
|
346
350
|
currentInstance[key].encoding = THREE.sRGBEncoding;
|
|
347
351
|
}
|
|
348
352
|
}
|
|
@@ -83,6 +83,7 @@ ErrorBoundary.getDerivedStateFromError = () => ({
|
|
|
83
83
|
error: true
|
|
84
84
|
});
|
|
85
85
|
const DEFAULT = '__default';
|
|
86
|
+
const DEFAULTS = new Map();
|
|
86
87
|
const isDiffSet = def => def && !!def.memoized && !!def.changes;
|
|
87
88
|
function calculateDpr(dpr) {
|
|
88
89
|
const target = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
|
|
@@ -320,13 +321,14 @@ function applyProps$1(instance, data) {
|
|
|
320
321
|
// For removed props, try to set default values, if possible
|
|
321
322
|
if (value === DEFAULT + 'remove') {
|
|
322
323
|
if (currentInstance.constructor) {
|
|
323
|
-
var _currentInstance$__r;
|
|
324
324
|
// create a blank slate of the instance and copy the particular parameter.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
326
|
+
if (!ctor) {
|
|
327
|
+
// @ts-ignore
|
|
328
|
+
ctor = new currentInstance.constructor();
|
|
329
|
+
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
330
|
+
}
|
|
331
|
+
value = ctor[key];
|
|
330
332
|
} else {
|
|
331
333
|
// instance does not have constructor, just set it to 0
|
|
332
334
|
value = 0;
|
|
@@ -345,7 +347,7 @@ function applyProps$1(instance, data) {
|
|
|
345
347
|
if (targetProp.fromArray) targetProp.fromArray(value);else targetProp.set(...value);
|
|
346
348
|
}
|
|
347
349
|
// Test again target.copy(class) next ...
|
|
348
|
-
else if (targetProp.copy && value && value.constructor && targetProp.constructor
|
|
350
|
+
else if (targetProp.copy && value && value.constructor && targetProp.constructor === value.constructor) {
|
|
349
351
|
targetProp.copy(value);
|
|
350
352
|
}
|
|
351
353
|
// If nothing else fits, just set the single value, ignore undefined
|
|
@@ -369,7 +371,9 @@ function applyProps$1(instance, data) {
|
|
|
369
371
|
currentInstance[key] = value;
|
|
370
372
|
// Auto-convert sRGB textures, for now ...
|
|
371
373
|
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
372
|
-
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture
|
|
374
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture &&
|
|
375
|
+
// sRGB textures must be RGBA8 since r137 https://github.com/mrdoob/three.js/pull/23129
|
|
376
|
+
currentInstance[key].format === THREE__namespace.RGBAFormat && currentInstance[key].type === THREE__namespace.UnsignedByteType) {
|
|
373
377
|
currentInstance[key].encoding = THREE__namespace.sRGBEncoding;
|
|
374
378
|
}
|
|
375
379
|
}
|
|
@@ -83,6 +83,7 @@ ErrorBoundary.getDerivedStateFromError = () => ({
|
|
|
83
83
|
error: true
|
|
84
84
|
});
|
|
85
85
|
const DEFAULT = '__default';
|
|
86
|
+
const DEFAULTS = new Map();
|
|
86
87
|
const isDiffSet = def => def && !!def.memoized && !!def.changes;
|
|
87
88
|
function calculateDpr(dpr) {
|
|
88
89
|
const target = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
|
|
@@ -320,13 +321,14 @@ function applyProps$1(instance, data) {
|
|
|
320
321
|
// For removed props, try to set default values, if possible
|
|
321
322
|
if (value === DEFAULT + 'remove') {
|
|
322
323
|
if (currentInstance.constructor) {
|
|
323
|
-
var _currentInstance$__r;
|
|
324
324
|
// create a blank slate of the instance and copy the particular parameter.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
let ctor = DEFAULTS.get(currentInstance.constructor);
|
|
326
|
+
if (!ctor) {
|
|
327
|
+
// @ts-ignore
|
|
328
|
+
ctor = new currentInstance.constructor();
|
|
329
|
+
DEFAULTS.set(currentInstance.constructor, ctor);
|
|
330
|
+
}
|
|
331
|
+
value = ctor[key];
|
|
330
332
|
} else {
|
|
331
333
|
// instance does not have constructor, just set it to 0
|
|
332
334
|
value = 0;
|
|
@@ -345,7 +347,7 @@ function applyProps$1(instance, data) {
|
|
|
345
347
|
if (targetProp.fromArray) targetProp.fromArray(value);else targetProp.set(...value);
|
|
346
348
|
}
|
|
347
349
|
// Test again target.copy(class) next ...
|
|
348
|
-
else if (targetProp.copy && value && value.constructor && targetProp.constructor
|
|
350
|
+
else if (targetProp.copy && value && value.constructor && targetProp.constructor === value.constructor) {
|
|
349
351
|
targetProp.copy(value);
|
|
350
352
|
}
|
|
351
353
|
// If nothing else fits, just set the single value, ignore undefined
|
|
@@ -369,7 +371,9 @@ function applyProps$1(instance, data) {
|
|
|
369
371
|
currentInstance[key] = value;
|
|
370
372
|
// Auto-convert sRGB textures, for now ...
|
|
371
373
|
// https://github.com/pmndrs/react-three-fiber/issues/344
|
|
372
|
-
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture
|
|
374
|
+
if (!rootState.linear && currentInstance[key] instanceof THREE__namespace.Texture &&
|
|
375
|
+
// sRGB textures must be RGBA8 since r137 https://github.com/mrdoob/three.js/pull/23129
|
|
376
|
+
currentInstance[key].format === THREE__namespace.RGBAFormat && currentInstance[key].type === THREE__namespace.UnsignedByteType) {
|
|
373
377
|
currentInstance[key].encoding = THREE__namespace.sRGBEncoding;
|
|
374
378
|
}
|
|
375
379
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-b2f18198.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-ce6281d5.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-3c94c6e9.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-3c94c6e9.esm.js';
|
|
3
3
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as THREE from 'three';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-b2f18198.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-ce6281d5.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
2
|
-
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-3c94c6e9.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-3c94c6e9.esm.js';
|
|
3
3
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as THREE from 'three';
|