framer-motion 5.4.4 → 5.4.5
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/cjs/three-entry.js
CHANGED
|
@@ -326,6 +326,7 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
326
326
|
function SyncCanvasComponent(_a, forwardedRef) {
|
|
327
327
|
var children = _a.children, fallback = _a.fallback, tabIndex = _a.tabIndex, resize = _a.resize, id = _a.id, style = _a.style, className = _a.className, events = _a.events, props = tslib.__rest(_a, ["children", "fallback", "tabIndex", "resize", "id", "style", "className", "events"]);
|
|
328
328
|
var motionContext = React.useContext(useMotionValue.MotionContext);
|
|
329
|
+
var configContext = React.useContext(useMotionValue.MotionConfigContext);
|
|
329
330
|
var _b = tslib.__read(useMeasure__default["default"](tslib.__assign({ scroll: true, debounce: { scroll: 50, resize: 0 } }, resize)), 2), containerRef = _b[0], _c = _b[1], width = _c.width, height = _c.height;
|
|
330
331
|
var canvasRef = React__namespace.useRef(null);
|
|
331
332
|
var _d = tslib.__read(React__namespace.useState(false), 2), block = _d[0], setBlock = _d[1];
|
|
@@ -340,7 +341,8 @@ function SyncCanvasComponent(_a, forwardedRef) {
|
|
|
340
341
|
if (width > 0 && height > 0) {
|
|
341
342
|
fiber.render(React__namespace.createElement(ErrorBoundary, { set: setError },
|
|
342
343
|
React__namespace.createElement(React__namespace.Suspense, { fallback: React__namespace.createElement(Block, { set: setBlock }) },
|
|
343
|
-
React__namespace.createElement(useMotionValue.
|
|
344
|
+
React__namespace.createElement(useMotionValue.MotionConfigContext.Provider, { value: configContext },
|
|
345
|
+
React__namespace.createElement(useMotionValue.MotionContext.Provider, { value: motionContext }, children)))), canvasRef.current, tslib.__assign(tslib.__assign({}, props), { size: { width: width, height: height }, events: events || fiber.events }));
|
|
344
346
|
}
|
|
345
347
|
useMotionValue.useIsomorphicLayoutEffect(function () {
|
|
346
348
|
var container = canvasRef.current;
|
|
@@ -6,6 +6,7 @@ import mergeRefs from 'react-merge-refs';
|
|
|
6
6
|
import useMeasure from 'react-use-measure';
|
|
7
7
|
import { render, events, unmountComponentAtNode } from '@react-three/fiber';
|
|
8
8
|
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
|
|
9
|
+
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
|
|
9
10
|
|
|
10
11
|
function Block(_a) {
|
|
11
12
|
var set = _a.set;
|
|
@@ -40,6 +41,7 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
40
41
|
function SyncCanvasComponent(_a, forwardedRef) {
|
|
41
42
|
var children = _a.children, fallback = _a.fallback, tabIndex = _a.tabIndex, resize = _a.resize, id = _a.id, style = _a.style, className = _a.className, events$1 = _a.events, props = __rest(_a, ["children", "fallback", "tabIndex", "resize", "id", "style", "className", "events"]);
|
|
42
43
|
var motionContext = useContext(MotionContext);
|
|
44
|
+
var configContext = useContext(MotionConfigContext);
|
|
43
45
|
var _b = __read(useMeasure(__assign({ scroll: true, debounce: { scroll: 50, resize: 0 } }, resize)), 2), containerRef = _b[0], _c = _b[1], width = _c.width, height = _c.height;
|
|
44
46
|
var canvasRef = React.useRef(null);
|
|
45
47
|
var _d = __read(React.useState(false), 2), block = _d[0], setBlock = _d[1];
|
|
@@ -54,7 +56,8 @@ function SyncCanvasComponent(_a, forwardedRef) {
|
|
|
54
56
|
if (width > 0 && height > 0) {
|
|
55
57
|
render(React.createElement(ErrorBoundary, { set: setError },
|
|
56
58
|
React.createElement(React.Suspense, { fallback: React.createElement(Block, { set: setBlock }) },
|
|
57
|
-
React.createElement(
|
|
59
|
+
React.createElement(MotionConfigContext.Provider, { value: configContext },
|
|
60
|
+
React.createElement(MotionContext.Provider, { value: motionContext }, children)))), canvasRef.current, __assign(__assign({}, props), { size: { width: width, height: height }, events: events$1 || events }));
|
|
58
61
|
}
|
|
59
62
|
useIsomorphicLayoutEffect(function () {
|
|
60
63
|
var container = canvasRef.current;
|