Blame view

天文台pc/tianwentai-ui/node_modules/framer-motion/dist/es/render/svg/use-props.mjs 879 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  "use client";
  import { buildSVGAttrs, isSVGTag } from 'motion-dom';
  import { useMemo } from 'react';
  import { copyRawValuesOnly } from '../html/use-props.mjs';
  import { createSvgRenderState } from './utils/create-render-state.mjs';
  
  function useSVGProps(props, visualState, _isStatic, Component) {
      const visualProps = useMemo(() => {
          const state = createSvgRenderState();
          buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
          return {
              ...state.attrs,
              style: { ...state.style },
          };
      }, [visualState]);
      if (props.style) {
          const rawStyles = {};
          copyRawValuesOnly(rawStyles, props.style, props);
          visualProps.style = { ...rawStyles, ...visualProps.style };
      }
      return visualProps;
  }
  
  export { useSVGProps };
  //# sourceMappingURL=use-props.mjs.map