@react-three/fiber 10.0.0-canary.98da52a → 10.0.0-canary.a056612
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/extension.cjs +8 -8
- package/dist/extension.d.cts +4 -4
- package/dist/extension.d.mts +4 -4
- package/dist/extension.d.ts +4 -4
- package/dist/extension.mjs +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +3 -3
- package/dist/legacy.cjs +13 -13
- package/dist/legacy.d.cts +10 -7
- package/dist/legacy.d.mts +10 -7
- package/dist/legacy.d.ts +10 -7
- package/dist/legacy.mjs +4 -4
- package/dist/shared/{fiber.DNehrxK5.d.ts → fiber.3jeDXXYd.d.mts} +150 -457
- package/dist/shared/{fiber.11sXr8Eb.d.cts → fiber.B_KQAb3I.d.ts} +150 -457
- package/dist/shared/{fiber.CT-cCVjA.mjs → fiber.BdXKJXa0.mjs} +2116 -1559
- package/dist/shared/{fiber.Cn-vxHMl.cjs → fiber.Bzw3s8zU.cjs} +2228 -1671
- package/dist/shared/{fiber.DAl4H27x.d.cts → fiber.C6hitYDY.d.cts} +1 -1
- package/dist/shared/{fiber.I5Q4dVvl.d.cts → fiber.C_MFx7We.d.cts} +479 -20
- package/dist/shared/{fiber.I5Q4dVvl.d.mts → fiber.C_MFx7We.d.mts} +479 -20
- package/dist/shared/{fiber.I5Q4dVvl.d.ts → fiber.C_MFx7We.d.ts} +479 -20
- package/dist/shared/{fiber.khFlPHPf.cjs → fiber.CsZ092z_.cjs} +84 -55
- package/dist/shared/{fiber.BU0vBHc9.d.mts → fiber.D4fD6H74.d.mts} +1 -1
- package/dist/shared/{fiber.B0oukOFO.mjs → fiber.DlH05gco.mjs} +84 -57
- package/dist/shared/{fiber.Cx-UAmMb.d.ts → fiber.YgTUGbja.d.ts} +1 -1
- package/dist/shared/{fiber.TWXdbcWP.d.mts → fiber.fR3DaJb1.d.cts} +150 -457
- package/dist/webgpu/index.cjs +13 -13
- package/dist/webgpu/index.d.cts +5 -5
- package/dist/webgpu/index.d.mts +5 -5
- package/dist/webgpu/index.d.ts +5 -5
- package/dist/webgpu/index.mjs +4 -4
- package/package.json +3 -3
|
@@ -28,16 +28,18 @@ function useMutableCallback(fn) {
|
|
|
28
28
|
useIsomorphicLayoutEffect(() => void (ref.current = fn), [fn]);
|
|
29
29
|
return ref;
|
|
30
30
|
}
|
|
31
|
+
const useActivityBridge = React__namespace["Activity"] ? itsFine.useActivityBridge : () => React__namespace.Fragment;
|
|
31
32
|
function useBridge() {
|
|
32
33
|
const fiber = itsFine.useFiber();
|
|
33
34
|
const ContextBridge = itsFine.useContextBridge();
|
|
35
|
+
const ActivityBridge = useActivityBridge();
|
|
34
36
|
return React__namespace.useMemo(
|
|
35
37
|
() => ({ children }) => {
|
|
36
38
|
const strict = !!itsFine.traverseFiber(fiber, true, (node) => node.type === React__namespace.StrictMode);
|
|
37
39
|
const Root = strict ? React__namespace.StrictMode : React__namespace.Fragment;
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root, { children: /* @__PURE__ */ jsxRuntime.jsx(ContextBridge, { children }) });
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root, { children: /* @__PURE__ */ jsxRuntime.jsx(ActivityBridge, { children: /* @__PURE__ */ jsxRuntime.jsx(ContextBridge, { children }) }) });
|
|
39
41
|
},
|
|
40
|
-
[fiber, ContextBridge]
|
|
42
|
+
[fiber, ContextBridge, ActivityBridge]
|
|
41
43
|
);
|
|
42
44
|
}
|
|
43
45
|
function Block({ set }) {
|
|
@@ -62,6 +64,23 @@ const ErrorBoundary = /* @__PURE__ */ (() => {
|
|
|
62
64
|
}
|
|
63
65
|
}, __publicField(_a, "getDerivedStateFromError", () => ({ error: true })), _a;
|
|
64
66
|
})();
|
|
67
|
+
const noop = () => {
|
|
68
|
+
};
|
|
69
|
+
function Gate({ promise, onSettled }) {
|
|
70
|
+
React__namespace.use(promise);
|
|
71
|
+
useIsomorphicLayoutEffect(onSettled, [onSettled]);
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function useGate() {
|
|
75
|
+
const [promise, setPromise] = React__namespace.useState(null);
|
|
76
|
+
const onSettled = React__namespace.useCallback(() => setPromise(null), []);
|
|
77
|
+
const waitFor = React__namespace.useCallback(
|
|
78
|
+
(next) => setPromise((current) => current ?? Promise.resolve(next).then(noop, noop)),
|
|
79
|
+
[]
|
|
80
|
+
);
|
|
81
|
+
const gate = promise ? /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(Gate, { promise, onSettled }) }) : null;
|
|
82
|
+
return [gate, waitFor];
|
|
83
|
+
}
|
|
65
84
|
|
|
66
85
|
const shownNotices = /* @__PURE__ */ new Set();
|
|
67
86
|
function notifyDepreciated({ heading, body, link }) {
|
|
@@ -119,10 +138,67 @@ function notifyAlpha({ message, link }) {
|
|
|
119
138
|
console.log(`%cMore info: ${link}`, "color: #6366f1; font-weight: normal;");
|
|
120
139
|
}
|
|
121
140
|
}
|
|
141
|
+
function isDevelopment() {
|
|
142
|
+
try {
|
|
143
|
+
return process.env.NODE_ENV !== "production";
|
|
144
|
+
} catch {
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
122
148
|
|
|
123
149
|
const R3F_CONTEXT = Symbol.for("@react-three/fiber.context");
|
|
124
150
|
const context = globalThis[R3F_CONTEXT] ?? (globalThis[R3F_CONTEXT] = React__namespace.createContext(null));
|
|
125
151
|
|
|
152
|
+
const R3F_EXTENSIONS = Symbol.for("@react-three/fiber.extensions");
|
|
153
|
+
function getRegistry() {
|
|
154
|
+
return globalThis[R3F_EXTENSIONS] ?? (globalThis[R3F_EXTENSIONS] = {
|
|
155
|
+
extensions: /* @__PURE__ */ new Map(),
|
|
156
|
+
roots: /* @__PURE__ */ new Set(),
|
|
157
|
+
applied: /* @__PURE__ */ new WeakMap()
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function setupRoot(registry, store, extension) {
|
|
161
|
+
let applied = registry.applied.get(store);
|
|
162
|
+
if (!applied) registry.applied.set(store, applied = /* @__PURE__ */ new Map());
|
|
163
|
+
if (applied.has(extension.name)) return;
|
|
164
|
+
applied.set(extension.name, extension);
|
|
165
|
+
const patch = extension.setup?.(store);
|
|
166
|
+
if (patch) store.setState(patch);
|
|
167
|
+
}
|
|
168
|
+
function registerRootExtension(extension) {
|
|
169
|
+
const registry = getRegistry();
|
|
170
|
+
registry.extensions.set(extension.name, extension);
|
|
171
|
+
for (const store of registry.roots) setupRoot(registry, store, extension);
|
|
172
|
+
return () => {
|
|
173
|
+
if (registry.extensions.get(extension.name) === extension) registry.extensions.delete(extension.name);
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function setRenderOverride(store, render) {
|
|
177
|
+
store.getState().internal.renderOverride = render;
|
|
178
|
+
}
|
|
179
|
+
function attachRootExtensions(store) {
|
|
180
|
+
const registry = getRegistry();
|
|
181
|
+
registry.roots.add(store);
|
|
182
|
+
for (const extension of registry.extensions.values()) setupRoot(registry, store, extension);
|
|
183
|
+
}
|
|
184
|
+
function current(registry, setUpBy) {
|
|
185
|
+
return registry.extensions.get(setUpBy.name) ?? setUpBy;
|
|
186
|
+
}
|
|
187
|
+
function detachRootExtensions(store) {
|
|
188
|
+
const registry = getRegistry();
|
|
189
|
+
if (!registry.roots.delete(store)) return;
|
|
190
|
+
const applied = registry.applied.get(store);
|
|
191
|
+
registry.applied.delete(store);
|
|
192
|
+
if (!applied) return;
|
|
193
|
+
for (const setUpBy of applied.values()) current(registry, setUpBy).dispose?.(store);
|
|
194
|
+
}
|
|
195
|
+
function notifyRootExtensionsHmr(store) {
|
|
196
|
+
const registry = getRegistry();
|
|
197
|
+
const applied = registry.applied.get(store);
|
|
198
|
+
if (!applied) return;
|
|
199
|
+
for (const setUpBy of applied.values()) current(registry, setUpBy).hmr?.(store);
|
|
200
|
+
}
|
|
201
|
+
|
|
126
202
|
function useStore() {
|
|
127
203
|
const store = React.useContext(context);
|
|
128
204
|
if (!store) throw new Error("R3F: Hooks can only be used within the Canvas component!");
|
|
@@ -149,8 +225,8 @@ function useFrame(callback, priorityOrOptions) {
|
|
|
149
225
|
const options = React__namespace.useMemo(() => {
|
|
150
226
|
return typeof priorityOrOptions === "number" ? { priority: priorityOrOptions } : priorityOrOptions ?? {};
|
|
151
227
|
}, [optionsKey]);
|
|
152
|
-
const
|
|
153
|
-
const id = options.id ??
|
|
228
|
+
const [generatedId] = React__namespace.useState(() => scheduler$1.generateJobId());
|
|
229
|
+
const id = options.id ?? generatedId;
|
|
154
230
|
const callbackRef = useMutableCallback(callback);
|
|
155
231
|
const isLegacyPriority = typeof priorityOrOptions === "number" && priorityOrOptions > 0;
|
|
156
232
|
const isLegacyOrdering = typeof priorityOrOptions === "number" && priorityOrOptions < 0;
|
|
@@ -187,7 +263,8 @@ function useFrame(callback, priorityOrOptions) {
|
|
|
187
263
|
time: frameState.time,
|
|
188
264
|
delta: frameState.delta,
|
|
189
265
|
elapsed: frameState.elapsed,
|
|
190
|
-
frame: frameState.frame
|
|
266
|
+
frame: frameState.frame,
|
|
267
|
+
overstep: frameState.overstep
|
|
191
268
|
};
|
|
192
269
|
callbackRef.current?.(mergedState, delta);
|
|
193
270
|
};
|
|
@@ -326,62 +403,13 @@ function getTextureView(store) {
|
|
|
326
403
|
return view;
|
|
327
404
|
}
|
|
328
405
|
|
|
329
|
-
const R3F_EXTENSIONS = Symbol.for("@react-three/fiber.extensions");
|
|
330
|
-
function getRegistry() {
|
|
331
|
-
return globalThis[R3F_EXTENSIONS] ?? (globalThis[R3F_EXTENSIONS] = {
|
|
332
|
-
extensions: /* @__PURE__ */ new Map(),
|
|
333
|
-
roots: /* @__PURE__ */ new Set(),
|
|
334
|
-
applied: /* @__PURE__ */ new WeakMap()
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
function setupRoot(registry, store, extension) {
|
|
338
|
-
let applied = registry.applied.get(store);
|
|
339
|
-
if (!applied) registry.applied.set(store, applied = /* @__PURE__ */ new Map());
|
|
340
|
-
if (applied.has(extension.name)) return;
|
|
341
|
-
applied.set(extension.name, extension);
|
|
342
|
-
const patch = extension.setup?.(store);
|
|
343
|
-
if (patch) store.setState(patch);
|
|
344
|
-
}
|
|
345
|
-
function registerRootExtension(extension) {
|
|
346
|
-
const registry = getRegistry();
|
|
347
|
-
registry.extensions.set(extension.name, extension);
|
|
348
|
-
for (const store of registry.roots) setupRoot(registry, store, extension);
|
|
349
|
-
return () => {
|
|
350
|
-
if (registry.extensions.get(extension.name) === extension) registry.extensions.delete(extension.name);
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
function setRenderOverride(store, render) {
|
|
354
|
-
store.getState().internal.renderOverride = render;
|
|
355
|
-
}
|
|
356
|
-
function attachRootExtensions(store) {
|
|
357
|
-
const registry = getRegistry();
|
|
358
|
-
registry.roots.add(store);
|
|
359
|
-
for (const extension of registry.extensions.values()) setupRoot(registry, store, extension);
|
|
360
|
-
}
|
|
361
|
-
function current(registry, setUpBy) {
|
|
362
|
-
return registry.extensions.get(setUpBy.name) ?? setUpBy;
|
|
363
|
-
}
|
|
364
|
-
function detachRootExtensions(store) {
|
|
365
|
-
const registry = getRegistry();
|
|
366
|
-
if (!registry.roots.delete(store)) return;
|
|
367
|
-
const applied = registry.applied.get(store);
|
|
368
|
-
registry.applied.delete(store);
|
|
369
|
-
if (!applied) return;
|
|
370
|
-
for (const setUpBy of applied.values()) current(registry, setUpBy).dispose?.(store);
|
|
371
|
-
}
|
|
372
|
-
function notifyRootExtensionsHmr(store) {
|
|
373
|
-
const registry = getRegistry();
|
|
374
|
-
const applied = registry.applied.get(store);
|
|
375
|
-
if (!applied) return;
|
|
376
|
-
for (const setUpBy of applied.values()) current(registry, setUpBy).hmr?.(store);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
406
|
exports.Block = Block;
|
|
380
407
|
exports.ErrorBoundary = ErrorBoundary;
|
|
381
408
|
exports.attachRootExtensions = attachRootExtensions;
|
|
382
409
|
exports.context = context;
|
|
383
410
|
exports.detachRootExtensions = detachRootExtensions;
|
|
384
411
|
exports.getTextureView = getTextureView;
|
|
412
|
+
exports.isDevelopment = isDevelopment;
|
|
385
413
|
exports.notifyAlpha = notifyAlpha;
|
|
386
414
|
exports.notifyDepreciated = notifyDepreciated;
|
|
387
415
|
exports.notifyRootExtensionsHmr = notifyRootExtensionsHmr;
|
|
@@ -391,6 +419,7 @@ exports.stageTextures = stageTextures;
|
|
|
391
419
|
exports.unstageTextures = unstageTextures;
|
|
392
420
|
exports.useBridge = useBridge;
|
|
393
421
|
exports.useFrame = useFrame;
|
|
422
|
+
exports.useGate = useGate;
|
|
394
423
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
395
424
|
exports.useMutableCallback = useMutableCallback;
|
|
396
425
|
exports.useStore = useStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { useFiber, useContextBridge, traverseFiber } from 'its-fine';
|
|
4
|
+
import { useFiber, useContextBridge, useActivityBridge as useActivityBridge$1, traverseFiber } from 'its-fine';
|
|
5
5
|
import { getScheduler } from '@pmndrs/scheduler';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -13,16 +13,18 @@ function useMutableCallback(fn) {
|
|
|
13
13
|
useIsomorphicLayoutEffect(() => void (ref.current = fn), [fn]);
|
|
14
14
|
return ref;
|
|
15
15
|
}
|
|
16
|
+
const useActivityBridge = React["Activity"] ? useActivityBridge$1 : () => React.Fragment;
|
|
16
17
|
function useBridge() {
|
|
17
18
|
const fiber = useFiber();
|
|
18
19
|
const ContextBridge = useContextBridge();
|
|
20
|
+
const ActivityBridge = useActivityBridge();
|
|
19
21
|
return React.useMemo(
|
|
20
22
|
() => ({ children }) => {
|
|
21
23
|
const strict = !!traverseFiber(fiber, true, (node) => node.type === React.StrictMode);
|
|
22
24
|
const Root = strict ? React.StrictMode : React.Fragment;
|
|
23
|
-
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsx(ContextBridge, { children }) });
|
|
25
|
+
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsx(ActivityBridge, { children: /* @__PURE__ */ jsx(ContextBridge, { children }) }) });
|
|
24
26
|
},
|
|
25
|
-
[fiber, ContextBridge]
|
|
27
|
+
[fiber, ContextBridge, ActivityBridge]
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
30
|
function Block({ set }) {
|
|
@@ -47,6 +49,23 @@ const ErrorBoundary = /* @__PURE__ */ (() => {
|
|
|
47
49
|
}
|
|
48
50
|
}, __publicField(_a, "getDerivedStateFromError", () => ({ error: true })), _a;
|
|
49
51
|
})();
|
|
52
|
+
const noop = () => {
|
|
53
|
+
};
|
|
54
|
+
function Gate({ promise, onSettled }) {
|
|
55
|
+
React.use(promise);
|
|
56
|
+
useIsomorphicLayoutEffect(onSettled, [onSettled]);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function useGate() {
|
|
60
|
+
const [promise, setPromise] = React.useState(null);
|
|
61
|
+
const onSettled = React.useCallback(() => setPromise(null), []);
|
|
62
|
+
const waitFor = React.useCallback(
|
|
63
|
+
(next) => setPromise((current) => current ?? Promise.resolve(next).then(noop, noop)),
|
|
64
|
+
[]
|
|
65
|
+
);
|
|
66
|
+
const gate = promise ? /* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Gate, { promise, onSettled }) }) : null;
|
|
67
|
+
return [gate, waitFor];
|
|
68
|
+
}
|
|
50
69
|
|
|
51
70
|
const shownNotices = /* @__PURE__ */ new Set();
|
|
52
71
|
function notifyDepreciated({ heading, body, link }) {
|
|
@@ -104,10 +123,67 @@ function notifyAlpha({ message, link }) {
|
|
|
104
123
|
console.log(`%cMore info: ${link}`, "color: #6366f1; font-weight: normal;");
|
|
105
124
|
}
|
|
106
125
|
}
|
|
126
|
+
function isDevelopment() {
|
|
127
|
+
try {
|
|
128
|
+
return process.env.NODE_ENV !== "production";
|
|
129
|
+
} catch {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
107
133
|
|
|
108
134
|
const R3F_CONTEXT = Symbol.for("@react-three/fiber.context");
|
|
109
135
|
const context = globalThis[R3F_CONTEXT] ?? (globalThis[R3F_CONTEXT] = React.createContext(null));
|
|
110
136
|
|
|
137
|
+
const R3F_EXTENSIONS = Symbol.for("@react-three/fiber.extensions");
|
|
138
|
+
function getRegistry() {
|
|
139
|
+
return globalThis[R3F_EXTENSIONS] ?? (globalThis[R3F_EXTENSIONS] = {
|
|
140
|
+
extensions: /* @__PURE__ */ new Map(),
|
|
141
|
+
roots: /* @__PURE__ */ new Set(),
|
|
142
|
+
applied: /* @__PURE__ */ new WeakMap()
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function setupRoot(registry, store, extension) {
|
|
146
|
+
let applied = registry.applied.get(store);
|
|
147
|
+
if (!applied) registry.applied.set(store, applied = /* @__PURE__ */ new Map());
|
|
148
|
+
if (applied.has(extension.name)) return;
|
|
149
|
+
applied.set(extension.name, extension);
|
|
150
|
+
const patch = extension.setup?.(store);
|
|
151
|
+
if (patch) store.setState(patch);
|
|
152
|
+
}
|
|
153
|
+
function registerRootExtension(extension) {
|
|
154
|
+
const registry = getRegistry();
|
|
155
|
+
registry.extensions.set(extension.name, extension);
|
|
156
|
+
for (const store of registry.roots) setupRoot(registry, store, extension);
|
|
157
|
+
return () => {
|
|
158
|
+
if (registry.extensions.get(extension.name) === extension) registry.extensions.delete(extension.name);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function setRenderOverride(store, render) {
|
|
162
|
+
store.getState().internal.renderOverride = render;
|
|
163
|
+
}
|
|
164
|
+
function attachRootExtensions(store) {
|
|
165
|
+
const registry = getRegistry();
|
|
166
|
+
registry.roots.add(store);
|
|
167
|
+
for (const extension of registry.extensions.values()) setupRoot(registry, store, extension);
|
|
168
|
+
}
|
|
169
|
+
function current(registry, setUpBy) {
|
|
170
|
+
return registry.extensions.get(setUpBy.name) ?? setUpBy;
|
|
171
|
+
}
|
|
172
|
+
function detachRootExtensions(store) {
|
|
173
|
+
const registry = getRegistry();
|
|
174
|
+
if (!registry.roots.delete(store)) return;
|
|
175
|
+
const applied = registry.applied.get(store);
|
|
176
|
+
registry.applied.delete(store);
|
|
177
|
+
if (!applied) return;
|
|
178
|
+
for (const setUpBy of applied.values()) current(registry, setUpBy).dispose?.(store);
|
|
179
|
+
}
|
|
180
|
+
function notifyRootExtensionsHmr(store) {
|
|
181
|
+
const registry = getRegistry();
|
|
182
|
+
const applied = registry.applied.get(store);
|
|
183
|
+
if (!applied) return;
|
|
184
|
+
for (const setUpBy of applied.values()) current(registry, setUpBy).hmr?.(store);
|
|
185
|
+
}
|
|
186
|
+
|
|
111
187
|
function useStore() {
|
|
112
188
|
const store = useContext(context);
|
|
113
189
|
if (!store) throw new Error("R3F: Hooks can only be used within the Canvas component!");
|
|
@@ -134,8 +210,8 @@ function useFrame(callback, priorityOrOptions) {
|
|
|
134
210
|
const options = React.useMemo(() => {
|
|
135
211
|
return typeof priorityOrOptions === "number" ? { priority: priorityOrOptions } : priorityOrOptions ?? {};
|
|
136
212
|
}, [optionsKey]);
|
|
137
|
-
const
|
|
138
|
-
const id = options.id ??
|
|
213
|
+
const [generatedId] = React.useState(() => scheduler.generateJobId());
|
|
214
|
+
const id = options.id ?? generatedId;
|
|
139
215
|
const callbackRef = useMutableCallback(callback);
|
|
140
216
|
const isLegacyPriority = typeof priorityOrOptions === "number" && priorityOrOptions > 0;
|
|
141
217
|
const isLegacyOrdering = typeof priorityOrOptions === "number" && priorityOrOptions < 0;
|
|
@@ -172,7 +248,8 @@ function useFrame(callback, priorityOrOptions) {
|
|
|
172
248
|
time: frameState.time,
|
|
173
249
|
delta: frameState.delta,
|
|
174
250
|
elapsed: frameState.elapsed,
|
|
175
|
-
frame: frameState.frame
|
|
251
|
+
frame: frameState.frame,
|
|
252
|
+
overstep: frameState.overstep
|
|
176
253
|
};
|
|
177
254
|
callbackRef.current?.(mergedState, delta);
|
|
178
255
|
};
|
|
@@ -311,54 +388,4 @@ function getTextureView(store) {
|
|
|
311
388
|
return view;
|
|
312
389
|
}
|
|
313
390
|
|
|
314
|
-
|
|
315
|
-
function getRegistry() {
|
|
316
|
-
return globalThis[R3F_EXTENSIONS] ?? (globalThis[R3F_EXTENSIONS] = {
|
|
317
|
-
extensions: /* @__PURE__ */ new Map(),
|
|
318
|
-
roots: /* @__PURE__ */ new Set(),
|
|
319
|
-
applied: /* @__PURE__ */ new WeakMap()
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
function setupRoot(registry, store, extension) {
|
|
323
|
-
let applied = registry.applied.get(store);
|
|
324
|
-
if (!applied) registry.applied.set(store, applied = /* @__PURE__ */ new Map());
|
|
325
|
-
if (applied.has(extension.name)) return;
|
|
326
|
-
applied.set(extension.name, extension);
|
|
327
|
-
const patch = extension.setup?.(store);
|
|
328
|
-
if (patch) store.setState(patch);
|
|
329
|
-
}
|
|
330
|
-
function registerRootExtension(extension) {
|
|
331
|
-
const registry = getRegistry();
|
|
332
|
-
registry.extensions.set(extension.name, extension);
|
|
333
|
-
for (const store of registry.roots) setupRoot(registry, store, extension);
|
|
334
|
-
return () => {
|
|
335
|
-
if (registry.extensions.get(extension.name) === extension) registry.extensions.delete(extension.name);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
function setRenderOverride(store, render) {
|
|
339
|
-
store.getState().internal.renderOverride = render;
|
|
340
|
-
}
|
|
341
|
-
function attachRootExtensions(store) {
|
|
342
|
-
const registry = getRegistry();
|
|
343
|
-
registry.roots.add(store);
|
|
344
|
-
for (const extension of registry.extensions.values()) setupRoot(registry, store, extension);
|
|
345
|
-
}
|
|
346
|
-
function current(registry, setUpBy) {
|
|
347
|
-
return registry.extensions.get(setUpBy.name) ?? setUpBy;
|
|
348
|
-
}
|
|
349
|
-
function detachRootExtensions(store) {
|
|
350
|
-
const registry = getRegistry();
|
|
351
|
-
if (!registry.roots.delete(store)) return;
|
|
352
|
-
const applied = registry.applied.get(store);
|
|
353
|
-
registry.applied.delete(store);
|
|
354
|
-
if (!applied) return;
|
|
355
|
-
for (const setUpBy of applied.values()) current(registry, setUpBy).dispose?.(store);
|
|
356
|
-
}
|
|
357
|
-
function notifyRootExtensionsHmr(store) {
|
|
358
|
-
const registry = getRegistry();
|
|
359
|
-
const applied = registry.applied.get(store);
|
|
360
|
-
if (!applied) return;
|
|
361
|
-
for (const setUpBy of applied.values()) current(registry, setUpBy).hmr?.(store);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
export { Block as B, ErrorBoundary as E, useThree as a, useFrame as b, context as c, useIsomorphicLayoutEffect as d, useMutableCallback as e, useBridge as f, getTextureView as g, unstageTextures as h, stageTextures as i, detachRootExtensions as j, attachRootExtensions as k, notifyAlpha as l, notifyRootExtensionsHmr as m, notifyDepreciated as n, registerRootExtension as r, setRenderOverride as s, useStore as u };
|
|
391
|
+
export { Block as B, ErrorBoundary as E, useThree as a, useFrame as b, context as c, useIsomorphicLayoutEffect as d, useMutableCallback as e, useBridge as f, getTextureView as g, detachRootExtensions as h, isDevelopment as i, attachRootExtensions as j, unstageTextures as k, stageTextures as l, useGate as m, notifyDepreciated as n, notifyAlpha as o, notifyRootExtensionsHmr as p, registerRootExtension as r, setRenderOverride as s, useStore as u };
|