framer-motion 12.9.5 → 12.9.7

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.
@@ -161,7 +161,9 @@
161
161
  `);
162
162
  }
163
163
  return () => {
164
- document.head.removeChild(style);
164
+ if (document.head.contains(style)) {
165
+ document.head.removeChild(style);
166
+ }
165
167
  };
166
168
  }, [isPresent]);
167
169
  return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React__namespace.cloneElement(children, { ref }) }));
@@ -10925,7 +10927,7 @@
10925
10927
  */
10926
10928
  function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0,
10927
10929
  // This is object creation, which we try to avoid per-frame.
10928
- ...latest }, isSVGTag, transformTemplate) {
10930
+ ...latest }, isSVGTag, transformTemplate, styleProp) {
10929
10931
  buildHTMLStyles(state, latest, transformTemplate);
10930
10932
  /**
10931
10933
  * For svg tags we just want to make sure viewBox is animatable and treat all the styles
@@ -10957,7 +10959,7 @@
10957
10959
  * SVG's element transform-origin uses its own median as a reference.
10958
10960
  * Therefore, transformBox becomes a fill-box
10959
10961
  */
10960
- style.transformBox = "fill-box";
10962
+ style.transformBox = styleProp?.transformBox ?? "fill-box";
10961
10963
  delete attrs.transformBox;
10962
10964
  }
10963
10965
  // Render attrX/attrY/attrScale as attributes
@@ -10983,7 +10985,7 @@
10983
10985
  function useSVGProps(props, visualState, _isStatic, Component) {
10984
10986
  const visualProps = React$1.useMemo(() => {
10985
10987
  const state = createSvgRenderState();
10986
- buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
10988
+ buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
10987
10989
  return {
10988
10990
  ...state.attrs,
10989
10991
  style: { ...state.style },
@@ -11193,7 +11195,7 @@
11193
11195
  return scrapeMotionValuesFromProps(props, prevProps, visualElement);
11194
11196
  }
11195
11197
  build(renderState, latestValues, props) {
11196
- buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
11198
+ buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);
11197
11199
  }
11198
11200
  renderInstance(instance, renderState, styleProp, projection) {
11199
11201
  renderSVG(instance, renderState, styleProp, projection);