heartbeat-monitor/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map

1 line
1.7 KiB
Plaintext

{"version":3,"file":"is-animatable.mjs","sources":["../../../../src/animation/utils/is-animatable.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;AAQG;MACU,YAAY,GAAG,CACxB,KAA+B,EAC/B,IAAa,KACb;;IAEA,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;;;;IAKnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI,CAAA;AAElE,IAAA,IACI,OAAO,KAAK,KAAK,QAAQ;AACzB,SAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC;AACtC,QAAA,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;MAC3B;AACE,QAAA,OAAO,IAAI,CAAA;KACd;AAED,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"}