@react-three/fiber 8.15.5 → 8.15.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.
- package/CHANGELOG.md +12 -0
- package/dist/declarations/src/core/events.d.ts +1 -1
- package/dist/declarations/src/core/utils.d.ts +1 -1
- package/dist/{index-e6d64601.cjs.prod.js → index-66b6e976.cjs.prod.js} +15 -6
- package/dist/{index-d26c5c57.cjs.dev.js → index-9bf2e8aa.cjs.dev.js} +15 -6
- package/dist/{index-594193f5.esm.js → index-a2103d81.esm.js} +15 -6
- 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
|
@@ -86,7 +86,7 @@ export interface PointerCaptureTarget {
|
|
|
86
86
|
intersection: Intersection;
|
|
87
87
|
target: Element;
|
|
88
88
|
}
|
|
89
|
-
export declare function getEventPriority(): 1 |
|
|
89
|
+
export declare function getEventPriority(): 1 | 4 | 16;
|
|
90
90
|
export declare function removeInteractivity(store: UseBoundStore<RootState>, object: THREE.Object3D): void;
|
|
91
91
|
export declare function createEvents(store: UseBoundStore<RootState>): {
|
|
92
92
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -10,7 +10,7 @@ export declare type _XRFrame = THREE.WebGLRenderTargetOptions extends {
|
|
|
10
10
|
/**
|
|
11
11
|
* Returns `true` with correct TS type inference if an object has a configurable color space (since r152).
|
|
12
12
|
*/
|
|
13
|
-
export declare const hasColorSpace: <T extends object |
|
|
13
|
+
export declare const hasColorSpace: <T extends object | THREE.Texture | Renderer, P = T extends Renderer ? {
|
|
14
14
|
outputColorSpace: string;
|
|
15
15
|
} : {
|
|
16
16
|
colorSpace: string;
|
|
@@ -127,7 +127,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
127
127
|
parentInstance.children = [...restSiblings.slice(0, index), child, ...restSiblings.slice(index)];
|
|
128
128
|
added = true;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
const objects = (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects;
|
|
131
|
+
if (!added && objects) {
|
|
132
|
+
const index = objects.indexOf(beforeChild);
|
|
133
|
+
if (index !== -1) objects.splice(index, 0, child);else objects.push(child);
|
|
134
|
+
}
|
|
131
135
|
if (!child.__r3f) prepare(child, {});
|
|
132
136
|
child.__r3f.parent = parentInstance;
|
|
133
137
|
updateInstance(child);
|
|
@@ -143,7 +147,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
143
147
|
// Clear the parent reference
|
|
144
148
|
if (child.__r3f) child.__r3f.parent = null;
|
|
145
149
|
// Remove child from the parents objects
|
|
146
|
-
|
|
150
|
+
const objects = (_parentInstance$__r3f3 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f3.objects;
|
|
151
|
+
if (objects) {
|
|
152
|
+
const index = objects.indexOf(child);
|
|
153
|
+
if (index !== -1) objects.splice(index, 1);
|
|
154
|
+
}
|
|
147
155
|
// Remove attachment
|
|
148
156
|
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
149
157
|
detach(parentInstance, child, child.__r3f.attach);
|
|
@@ -209,13 +217,14 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
209
217
|
}
|
|
210
218
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
211
219
|
instance.__r3f.objects = [];
|
|
220
|
+
const autoRemovedBeforeAppend = !!newInstance.parent;
|
|
212
221
|
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
222
|
+
insertBefore(parent, newInstance, instance);
|
|
213
223
|
removeChild(parent, instance);
|
|
224
|
+
} else {
|
|
225
|
+
appendChild(parent, newInstance);
|
|
214
226
|
}
|
|
215
|
-
|
|
216
|
-
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
217
|
-
}
|
|
218
|
-
appendChild(parent, newInstance);
|
|
227
|
+
newInstance.__r3f.autoRemovedBeforeAppend = autoRemovedBeforeAppend;
|
|
219
228
|
|
|
220
229
|
// Re-bind event handlers
|
|
221
230
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -127,7 +127,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
127
127
|
parentInstance.children = [...restSiblings.slice(0, index), child, ...restSiblings.slice(index)];
|
|
128
128
|
added = true;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
const objects = (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects;
|
|
131
|
+
if (!added && objects) {
|
|
132
|
+
const index = objects.indexOf(beforeChild);
|
|
133
|
+
if (index !== -1) objects.splice(index, 0, child);else objects.push(child);
|
|
134
|
+
}
|
|
131
135
|
if (!child.__r3f) prepare(child, {});
|
|
132
136
|
child.__r3f.parent = parentInstance;
|
|
133
137
|
updateInstance(child);
|
|
@@ -143,7 +147,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
143
147
|
// Clear the parent reference
|
|
144
148
|
if (child.__r3f) child.__r3f.parent = null;
|
|
145
149
|
// Remove child from the parents objects
|
|
146
|
-
|
|
150
|
+
const objects = (_parentInstance$__r3f3 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f3.objects;
|
|
151
|
+
if (objects) {
|
|
152
|
+
const index = objects.indexOf(child);
|
|
153
|
+
if (index !== -1) objects.splice(index, 1);
|
|
154
|
+
}
|
|
147
155
|
// Remove attachment
|
|
148
156
|
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
149
157
|
detach(parentInstance, child, child.__r3f.attach);
|
|
@@ -209,13 +217,14 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
209
217
|
}
|
|
210
218
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
211
219
|
instance.__r3f.objects = [];
|
|
220
|
+
const autoRemovedBeforeAppend = !!newInstance.parent;
|
|
212
221
|
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
222
|
+
insertBefore(parent, newInstance, instance);
|
|
213
223
|
removeChild(parent, instance);
|
|
224
|
+
} else {
|
|
225
|
+
appendChild(parent, newInstance);
|
|
214
226
|
}
|
|
215
|
-
|
|
216
|
-
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
217
|
-
}
|
|
218
|
-
appendChild(parent, newInstance);
|
|
227
|
+
newInstance.__r3f.autoRemovedBeforeAppend = autoRemovedBeforeAppend;
|
|
219
228
|
|
|
220
229
|
// Re-bind event handlers
|
|
221
230
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -100,7 +100,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
100
100
|
parentInstance.children = [...restSiblings.slice(0, index), child, ...restSiblings.slice(index)];
|
|
101
101
|
added = true;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
const objects = (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects;
|
|
104
|
+
if (!added && objects) {
|
|
105
|
+
const index = objects.indexOf(beforeChild);
|
|
106
|
+
if (index !== -1) objects.splice(index, 0, child);else objects.push(child);
|
|
107
|
+
}
|
|
104
108
|
if (!child.__r3f) prepare(child, {});
|
|
105
109
|
child.__r3f.parent = parentInstance;
|
|
106
110
|
updateInstance(child);
|
|
@@ -116,7 +120,11 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
116
120
|
// Clear the parent reference
|
|
117
121
|
if (child.__r3f) child.__r3f.parent = null;
|
|
118
122
|
// Remove child from the parents objects
|
|
119
|
-
|
|
123
|
+
const objects = (_parentInstance$__r3f3 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f3.objects;
|
|
124
|
+
if (objects) {
|
|
125
|
+
const index = objects.indexOf(child);
|
|
126
|
+
if (index !== -1) objects.splice(index, 1);
|
|
127
|
+
}
|
|
120
128
|
// Remove attachment
|
|
121
129
|
if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
|
|
122
130
|
detach(parentInstance, child, child.__r3f.attach);
|
|
@@ -182,13 +190,14 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
182
190
|
}
|
|
183
191
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
184
192
|
instance.__r3f.objects = [];
|
|
193
|
+
const autoRemovedBeforeAppend = !!newInstance.parent;
|
|
185
194
|
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
195
|
+
insertBefore(parent, newInstance, instance);
|
|
186
196
|
removeChild(parent, instance);
|
|
197
|
+
} else {
|
|
198
|
+
appendChild(parent, newInstance);
|
|
187
199
|
}
|
|
188
|
-
|
|
189
|
-
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
190
|
-
}
|
|
191
|
-
appendChild(parent, newInstance);
|
|
200
|
+
newInstance.__r3f.autoRemovedBeforeAppend = autoRemovedBeforeAppend;
|
|
192
201
|
|
|
193
202
|
// Re-bind event handlers
|
|
194
203
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -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-9bf2e8aa.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-66b6e976.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 useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b 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, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-a2103d81.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b 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, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-a2103d81.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-9bf2e8aa.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-66b6e976.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, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
2
|
-
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b 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, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-a2103d81.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b 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, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-a2103d81.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';
|