motion 12.22.0 → 12.23.1

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.
Files changed (2) hide show
  1. package/dist/motion.dev.js +13 -8
  2. package/package.json +3 -3
@@ -35,14 +35,19 @@
35
35
  exports.warning = () => { };
36
36
  exports.invariant = () => { };
37
37
  {
38
- exports.warning = (check, message) => {
38
+ const formatMessage = (message, errorCode) => {
39
+ return errorCode
40
+ ? `${message}. For more information and steps for solving, visit https://motion.dev/error/${errorCode}`
41
+ : message;
42
+ };
43
+ exports.warning = (check, message, errorCode) => {
39
44
  if (!check && typeof console !== "undefined") {
40
- console.warn(message);
45
+ console.warn(formatMessage(message, errorCode));
41
46
  }
42
47
  };
43
- exports.invariant = (check, message) => {
48
+ exports.invariant = (check, message, errorCode) => {
44
49
  if (!check) {
45
- throw new Error(message);
50
+ throw new Error(formatMessage(message, errorCode));
46
51
  }
47
52
  };
48
53
  }
@@ -1633,7 +1638,7 @@
1633
1638
  let { keyframes: keyframes$1 } = options;
1634
1639
  const generatorFactory = type || keyframes;
1635
1640
  if (generatorFactory !== keyframes) {
1636
- exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);
1641
+ exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames");
1637
1642
  }
1638
1643
  if (generatorFactory !== keyframes &&
1639
1644
  typeof keyframes$1[0] !== "number") {
@@ -5134,7 +5139,7 @@
5134
5139
  * Handle repeat options
5135
5140
  */
5136
5141
  if (repeat) {
5137
- exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
5142
+ exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high");
5138
5143
  duration = calculateRepeatDuration(duration, repeat);
5139
5144
  const originalKeyframes = [...valueKeyframesAsList];
5140
5145
  const originalTimes = [...times];
@@ -6710,7 +6715,7 @@
6710
6715
  else {
6711
6716
  const subjects = resolveSubjects(subject, keyframes, scope);
6712
6717
  const numSubjects = subjects.length;
6713
- exports.invariant(Boolean(numSubjects), "No valid elements provided.");
6718
+ exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements");
6714
6719
  for (let i = 0; i < numSubjects; i++) {
6715
6720
  const thisSubject = subjects[i];
6716
6721
  const createVisualElement = thisSubject instanceof Element
@@ -6778,7 +6783,7 @@
6778
6783
  function animateElements(elementOrSelector, keyframes, options, scope) {
6779
6784
  const elements = resolveElements(elementOrSelector, scope);
6780
6785
  const numElements = elements.length;
6781
- exports.invariant(Boolean(numElements), "No valid element provided.");
6786
+ exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
6782
6787
  /**
6783
6788
  * WAAPI doesn't support interrupting animations.
6784
6789
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.22.0",
3
+ "version": "12.23.1",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -76,7 +76,7 @@
76
76
  "postpublish": "git push --tags"
77
77
  },
78
78
  "dependencies": {
79
- "framer-motion": "^12.22.0",
79
+ "framer-motion": "^12.23.1",
80
80
  "tslib": "^2.4.0"
81
81
  },
82
82
  "peerDependencies": {
@@ -95,5 +95,5 @@
95
95
  "optional": true
96
96
  }
97
97
  },
98
- "gitHead": "17b2e79a8f6ae3f8d15e884fef821bfdeafc31c4"
98
+ "gitHead": "6cd3f6ce7b40efb7d50d95f252ec44a31edceee7"
99
99
  }