framer-motion 6.2.8 → 6.2.9-alpha

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/index.js CHANGED
@@ -33,6 +33,14 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
34
34
  var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync);
35
35
 
36
+ /**
37
+ * Browser-safe usage of process
38
+ */
39
+ var mockProcess = { env: { NODE_ENV: "production" } };
40
+ var safeProcess = typeof process === "undefined" ? mockProcess : process;
41
+ // eslint-disable-next-line import/no-default-export
42
+ var process$1 = safeProcess;
43
+
36
44
  var createDefinition = function (propNames) { return ({
37
45
  isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); },
38
46
  }); };
@@ -94,7 +102,7 @@ function useFeatures(props, visualElement, preloadedFeatures) {
94
102
  * If we're in development mode, check to make sure we're not rendering a motion component
95
103
  * as a child of LazyMotion, as this will break the file-size benefits of using it.
96
104
  */
97
- if (process.env.NODE_ENV !== "production" &&
105
+ if (process$1.env.NODE_ENV !== "production" &&
98
106
  preloadedFeatures &&
99
107
  lazyContext.strict) {
100
108
  heyListen.invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");
@@ -4316,7 +4324,7 @@ function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a)
4316
4324
  React.useEffect(function () {
4317
4325
  if (!shouldObserve || !fallback)
4318
4326
  return;
4319
- if (process.env.NODE_ENV !== "production") {
4327
+ if (process$1.env.NODE_ENV !== "production") {
4320
4328
  warnOnce(false, "IntersectionObserver not available on this device. whileInView animations will trigger on mount.");
4321
4329
  }
4322
4330
  /**
@@ -7193,7 +7201,7 @@ function newChildrenMap() {
7193
7201
  }
7194
7202
 
7195
7203
  var getChildKey = function (child) { return child.key || ""; };
7196
- var isDev = process.env.NODE_ENV !== "production";
7204
+ var isDev = process$1.env.NODE_ENV !== "production";
7197
7205
  function updateChildLookup(children, allChildren) {
7198
7206
  var seenChildren = isDev ? new Set() : null;
7199
7207
  children.forEach(function (child) {
@@ -7333,7 +7341,7 @@ var AnimatePresence = function (_a) {
7333
7341
  var key = child.key;
7334
7342
  return exiting.has(key) ? (child) : (React__namespace.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout }, child));
7335
7343
  });
7336
- if (process.env.NODE_ENV !== "production" &&
7344
+ if (process$1.env.NODE_ENV !== "production" &&
7337
7345
  exitBeforeEnter &&
7338
7346
  childrenToRender.length > 1) {
7339
7347
  console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour.");
@@ -1,6 +1,7 @@
1
1
  import { __read, __spreadArray } from 'tslib';
2
2
  import * as React from 'react';
3
3
  import { useContext, useRef, cloneElement, Children, isValidElement } from 'react';
4
+ import process from '../../utils/process.mjs';
4
5
  import { useForceUpdate } from '../../utils/use-force-update.mjs';
5
6
  import { useIsMounted } from '../../utils/use-is-mounted.mjs';
6
7
  import { PresenceChild } from './PresenceChild.mjs';
@@ -1,6 +1,7 @@
1
1
  import { __assign } from 'tslib';
2
2
  import * as React from 'react';
3
3
  import { useContext } from 'react';
4
+ import process from '../../utils/process.mjs';
4
5
  import { featureDefinitions } from './definitions.mjs';
5
6
  import { invariant } from 'hey-listen';
6
7
  import { LazyContext } from '../../context/LazyContext.mjs';
@@ -1,3 +1,4 @@
1
+ import process from '../../../utils/process.mjs';
1
2
  import { useRef, useEffect } from 'react';
2
3
  import { AnimationType } from '../../../render/utils/types.mjs';
3
4
  import { warnOnce } from '../../../utils/warn-once.mjs';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Browser-safe usage of process
3
+ */
4
+ var mockProcess = { env: { NODE_ENV: "production" } };
5
+ var safeProcess = typeof process === "undefined" ? mockProcess : process;
6
+ // eslint-disable-next-line import/no-default-export
7
+ var process$1 = safeProcess;
8
+
9
+ export { process$1 as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-motion",
3
- "version": "6.2.8",
3
+ "version": "6.2.9-alpha",
4
4
  "description": "A simple and powerful React animation library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -102,5 +102,5 @@
102
102
  "maxSize": "31.5 kB"
103
103
  }
104
104
  ],
105
- "gitHead": "140d787d9edc21c9ad63629d536207e7e07a8e91"
105
+ "gitHead": "e631ca754e32eca6763220c626db5f47264df7fa"
106
106
  }
@@ -0,0 +1,7 @@
1
+ /// <reference types="node" />
2
+ declare const safeProcess: {
3
+ env: {
4
+ NODE_ENV: string;
5
+ };
6
+ } | NodeJS.Process;
7
+ export default safeProcess;