motion-dom 12.24.10 → 12.26.2

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 (79) hide show
  1. package/dist/cjs/index.js +6214 -1836
  2. package/dist/es/animation/NativeAnimation.mjs +10 -2
  3. package/dist/es/animation/NativeAnimationExtended.mjs +11 -4
  4. package/dist/es/animation/animate/single-value.mjs +11 -0
  5. package/dist/es/animation/interfaces/motion-value.mjs +102 -0
  6. package/dist/es/animation/interfaces/visual-element-target.mjs +85 -0
  7. package/dist/es/animation/interfaces/visual-element-variant.mjs +59 -0
  8. package/dist/es/animation/interfaces/visual-element.mjs +26 -0
  9. package/dist/es/animation/optimized-appear/data-id.mjs +6 -0
  10. package/dist/es/animation/optimized-appear/get-appear-id.mjs +7 -0
  11. package/dist/es/animation/utils/calc-child-stagger.mjs +15 -0
  12. package/dist/es/animation/utils/default-transitions.mjs +40 -0
  13. package/dist/es/animation/utils/get-final-keyframe.mjs +12 -0
  14. package/dist/es/animation/utils/is-transition-defined.mjs +10 -0
  15. package/dist/es/events/add-dom-event.mjs +6 -0
  16. package/dist/es/index.mjs +71 -0
  17. package/dist/es/projection/animation/mix-values.mjs +66 -0
  18. package/dist/es/projection/geometry/conversion.mjs +33 -0
  19. package/dist/es/projection/geometry/copy.mjs +31 -0
  20. package/dist/es/projection/geometry/delta-apply.mjs +119 -0
  21. package/dist/es/projection/geometry/delta-calc.mjs +52 -0
  22. package/dist/es/projection/geometry/delta-remove.mjs +54 -0
  23. package/dist/es/projection/geometry/models.mjs +17 -0
  24. package/dist/es/projection/geometry/utils.mjs +31 -0
  25. package/dist/es/projection/node/DocumentProjectionNode.mjs +13 -0
  26. package/dist/es/projection/node/HTMLProjectionNode.mjs +27 -0
  27. package/dist/es/projection/node/create-projection-node.mjs +1628 -0
  28. package/dist/es/projection/node/group.mjs +24 -0
  29. package/dist/es/projection/node/state.mjs +19 -0
  30. package/dist/es/projection/shared/stack.mjs +100 -0
  31. package/dist/es/projection/styles/scale-border-radius.mjs +41 -0
  32. package/dist/es/projection/styles/scale-box-shadow.mjs +35 -0
  33. package/dist/es/projection/styles/scale-correction.mjs +30 -0
  34. package/dist/es/projection/styles/transform.mjs +49 -0
  35. package/dist/es/projection/utils/compare-by-depth.mjs +3 -0
  36. package/dist/es/projection/utils/each-axis.mjs +5 -0
  37. package/dist/es/projection/utils/flat-tree.mjs +24 -0
  38. package/dist/es/projection/utils/has-transform.mjs +26 -0
  39. package/dist/es/projection/utils/measure.mjs +17 -0
  40. package/dist/es/render/Feature.mjs +14 -0
  41. package/dist/es/render/VisualElement.mjs +510 -0
  42. package/dist/es/render/dom/DOMVisualElement.mjs +42 -0
  43. package/dist/es/render/html/HTMLVisualElement.mjs +44 -0
  44. package/dist/es/render/html/utils/build-styles.mjs +65 -0
  45. package/dist/es/render/html/utils/build-transform.mjs +62 -0
  46. package/dist/es/render/html/utils/render.mjs +17 -0
  47. package/dist/es/render/html/utils/scrape-motion-values.mjs +21 -0
  48. package/dist/es/render/object/ObjectVisualElement.mjs +41 -0
  49. package/dist/es/render/store.mjs +3 -0
  50. package/dist/es/render/svg/SVGVisualElement.mjs +45 -0
  51. package/dist/es/render/svg/utils/build-attrs.mjs +72 -0
  52. package/dist/es/render/svg/utils/camel-case-attrs.mjs +30 -0
  53. package/dist/es/render/svg/utils/is-svg-tag.mjs +3 -0
  54. package/dist/es/render/svg/utils/path.mjs +32 -0
  55. package/dist/es/render/svg/utils/render.mjs +12 -0
  56. package/dist/es/render/svg/utils/scrape-motion-values.mjs +19 -0
  57. package/dist/es/render/utils/animation-state.mjs +364 -0
  58. package/dist/es/render/utils/get-variant-context.mjs +32 -0
  59. package/dist/es/render/utils/is-animation-controls.mjs +7 -0
  60. package/dist/es/render/utils/is-controlling-variants.mjs +13 -0
  61. package/dist/es/render/utils/is-forced-motion-value.mjs +12 -0
  62. package/dist/es/render/utils/is-keyframes-target.mjs +5 -0
  63. package/dist/es/render/utils/is-variant-label.mjs +8 -0
  64. package/dist/es/render/utils/motion-values.mjs +55 -0
  65. package/dist/es/render/utils/reduced-motion/index.mjs +19 -0
  66. package/dist/es/render/utils/reduced-motion/state.mjs +5 -0
  67. package/dist/es/render/utils/resolve-dynamic-variants.mjs +8 -0
  68. package/dist/es/render/utils/resolve-variants.mjs +36 -0
  69. package/dist/es/render/utils/setters.mjs +31 -0
  70. package/dist/es/render/utils/shallow-compare.mjs +14 -0
  71. package/dist/es/render/utils/variant-props.mjs +12 -0
  72. package/dist/es/utils/delay.mjs +24 -0
  73. package/dist/es/value/utils/resolve-motion-value.mjs +10 -0
  74. package/dist/es/value/will-change/add-will-change.mjs +20 -0
  75. package/dist/es/value/will-change/is.mjs +7 -0
  76. package/dist/index.d.ts +3851 -2128
  77. package/dist/motion-dom.dev.js +6214 -1836
  78. package/dist/motion-dom.js +1 -1
  79. package/package.json +2 -2
@@ -0,0 +1,20 @@
1
+ import { MotionGlobalConfig } from 'motion-utils';
2
+ import { isWillChangeMotionValue } from './is.mjs';
3
+
4
+ function addValueToWillChange(visualElement, key) {
5
+ const willChange = visualElement.getValue("willChange");
6
+ /**
7
+ * It could be that a user has set willChange to a regular MotionValue,
8
+ * in which case we can't add the value to it.
9
+ */
10
+ if (isWillChangeMotionValue(willChange)) {
11
+ return willChange.add(key);
12
+ }
13
+ else if (!willChange && MotionGlobalConfig.WillChange) {
14
+ const newWillChange = new MotionGlobalConfig.WillChange("auto");
15
+ visualElement.addValue("willChange", newWillChange);
16
+ newWillChange.add(key);
17
+ }
18
+ }
19
+
20
+ export { addValueToWillChange };
@@ -0,0 +1,7 @@
1
+ import { isMotionValue } from '../utils/is-motion-value.mjs';
2
+
3
+ function isWillChangeMotionValue(value) {
4
+ return Boolean(isMotionValue(value) && value.add);
5
+ }
6
+
7
+ export { isWillChangeMotionValue };