Files
ETB/ETB-FrontEnd/node_modules/.cache/babel-loader/47d40eb228a3a62db458e62c45af0a6011c4503c04f4b4554f072dd6fd616dfe.json
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

1 line
3.5 KiB
JSON

{"ast":null,"code":"import { motionValue } from 'motion-dom';\nimport { useContext, useState, useEffect } from 'react';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { useConstant } from '../utils/use-constant.mjs';\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return <motion.div style={{ scale }} />\n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nfunction useMotionValue(initial) {\n const value = useConstant(() => motionValue(initial));\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const {\n isStatic\n } = useContext(MotionConfigContext);\n if (isStatic) {\n const [, setLatest] = useState(initial);\n useEffect(() => value.on(\"change\", setLatest), []);\n }\n return value;\n}\nexport { useMotionValue };","map":{"version":3,"names":["motionValue","useContext","useState","useEffect","MotionConfigContext","useConstant","useMotionValue","initial","value","isStatic","setLatest","on"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/framer-motion/dist/es/value/use-motion-value.mjs"],"sourcesContent":["import { motionValue } from 'motion-dom';\nimport { useContext, useState, useEffect } from 'react';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { useConstant } from '../utils/use-constant.mjs';\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return <motion.div style={{ scale }} />\n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nfunction useMotionValue(initial) {\n const value = useConstant(() => motionValue(initial));\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext);\n if (isStatic) {\n const [, setLatest] = useState(initial);\n useEffect(() => value.on(\"change\", setLatest), []);\n }\n return value;\n}\n\nexport { useMotionValue };\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,YAAY;AACxC,SAASC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AACvD,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,OAAO,EAAE;EAC7B,MAAMC,KAAK,GAAGH,WAAW,CAAC,MAAML,WAAW,CAACO,OAAO,CAAC,CAAC;EACrD;AACJ;AACA;AACA;AACA;EACI,MAAM;IAAEE;EAAS,CAAC,GAAGR,UAAU,CAACG,mBAAmB,CAAC;EACpD,IAAIK,QAAQ,EAAE;IACV,MAAM,GAAGC,SAAS,CAAC,GAAGR,QAAQ,CAACK,OAAO,CAAC;IACvCJ,SAAS,CAAC,MAAMK,KAAK,CAACG,EAAE,CAAC,QAAQ,EAAED,SAAS,CAAC,EAAE,EAAE,CAAC;EACtD;EACA,OAAOF,KAAK;AAChB;AAEA,SAASF,cAAc","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}