framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 1.32 kB
Source Map (JSON)
{"version":3,"file":"utils.mjs","sources":["../../../../src/context/MotionContext/utils.ts"],"sourcesContent":["import type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { isControllingVariants } from \"../../render/utils/is-controlling-variants\"\nimport { isVariantLabel } from \"../../render/utils/is-variant-label\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n"],"names":[],"mappings":";;;AAKgB,SAAA,sBAAsB,CAClC,KAAkB,EAClB,OAA2B,EAAA;AAE3B,IAAA,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QAClC,OAAO;YACH,OAAO,EACH,OAAO,KAAK,KAAK,IAAI,cAAc,CAAC,OAAO,CAAC;AACxC,kBAAG,OAAe;AAClB,kBAAE,SAAS;AACnB,YAAA,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS;SACzD,CAAA;KACJ;AACD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,KAAK,GAAG,OAAO,GAAG,EAAE,CAAA;AACjD;;;;"}