motion-dom 12.42.2 → 12.43.0
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 +17 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/animation/waapi/supports/waapi.mjs +7 -5
- package/dist/es/animation/waapi/supports/waapi.mjs.map +1 -1
- package/dist/es/animation/waapi/utils/accelerated-values.mjs +1 -3
- package/dist/es/animation/waapi/utils/accelerated-values.mjs.map +1 -1
- package/dist/es/render/html/HTMLVisualElement.mjs +10 -0
- package/dist/es/render/html/HTMLVisualElement.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/motion-dom.dev.js +17 -8
- package/dist/motion-dom.js +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -2478,9 +2478,7 @@ const acceleratedValues = new Set([
|
|
|
2478
2478
|
"clipPath",
|
|
2479
2479
|
"filter",
|
|
2480
2480
|
"transform",
|
|
2481
|
-
|
|
2482
|
-
// or until we implement support for linear() easing.
|
|
2483
|
-
// "background-color"
|
|
2481
|
+
"backgroundColor",
|
|
2484
2482
|
]);
|
|
2485
2483
|
|
|
2486
2484
|
const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;
|
|
@@ -2511,12 +2509,14 @@ function supportsBrowserAnimation(options) {
|
|
|
2511
2509
|
const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;
|
|
2512
2510
|
const subject = motionValue?.owner?.current;
|
|
2513
2511
|
/**
|
|
2514
|
-
* We use
|
|
2515
|
-
* **don't** want elements in different timing
|
|
2516
|
-
* to be accelerated, as it's not possible to sync
|
|
2517
|
-
* properly with those driven from the main window
|
|
2512
|
+
* We use instanceof checks instead of isHTMLElement()/isSVGElement()
|
|
2513
|
+
* because we explicitly **don't** want elements in different timing
|
|
2514
|
+
* contexts (i.e. popups) to be accelerated, as it's not possible to sync
|
|
2515
|
+
* these animations properly with those driven from the main window
|
|
2516
|
+
* frameloop.
|
|
2518
2517
|
*/
|
|
2519
|
-
if (!(subject instanceof HTMLElement)
|
|
2518
|
+
if (!(subject instanceof HTMLElement) &&
|
|
2519
|
+
!(subject instanceof SVGElement)) {
|
|
2520
2520
|
return false;
|
|
2521
2521
|
}
|
|
2522
2522
|
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
|
|
@@ -7590,6 +7590,15 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
7590
7590
|
this.type = "html";
|
|
7591
7591
|
this.renderInstance = renderHTML;
|
|
7592
7592
|
}
|
|
7593
|
+
mount(instance) {
|
|
7594
|
+
/**
|
|
7595
|
+
* If a custom component forwards its ref to something other than a
|
|
7596
|
+
* HTML/SVG element (a class instance, an imperative handle) there's
|
|
7597
|
+
* nothing for Motion to style, measure or attach gestures to. #2777
|
|
7598
|
+
*/
|
|
7599
|
+
motionUtils.invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref");
|
|
7600
|
+
super.mount(instance);
|
|
7601
|
+
}
|
|
7593
7602
|
readValueFromInstance(instance, key) {
|
|
7594
7603
|
if (transformProps.has(key)) {
|
|
7595
7604
|
return this.projection?.isProjecting
|