Files
ai-course/node_modules/.cache/babel-loader/e7f2912664c0af63b0f8beeb891e2e500b89a2ceb6f8915cac63f07a3687da3f.json

1 line
6.4 KiB
JSON
Raw Normal View History

{"ast":null,"code":"import _objectSpread from \"/Users/apple/Documents/cursor/Web\\u8BFE\\u4EF6/AI\\u8BFE/education_web_\\u591AAgent\\u534F\\u4F5C\\u7CFB\\u7EDF/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _objectWithoutProperties from \"/Users/apple/Documents/cursor/Web\\u8BFE\\u4EF6/AI\\u8BFE/education_web_\\u591AAgent\\u534F\\u4F5C\\u7CFB\\u7EDF/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nconst _excluded = [\"container\", \"target\", \"layoutEffect\"];\nimport { motionValue } from 'motion-dom';\nimport { warning } from 'motion-utils';\nimport { useEffect } from 'react';\nimport { scroll } from '../render/dom/scroll/index.mjs';\nimport { useConstant } from '../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\nfunction refWarning(name, ref) {\n warning(Boolean(!ref || ref.current), \"You have defined a \".concat(name, \" options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its `layoutEffect: false` option.\"));\n}\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0)\n});\nfunction useScroll() {\n let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n {\n container,\n target,\n layoutEffect = true\n } = _ref,\n options = _objectWithoutProperties(_ref, _excluded);\n const values = useConstant(createScrollMotionValues);\n const useLifecycleEffect = layoutEffect ? useIsomorphicLayoutEffect : useEffect;\n useLifecycleEffect(() => {\n refWarning(\"target\", target);\n refWarning(\"container\", container);\n return scroll((_progress, _ref2) => {\n let {\n x,\n y\n } = _ref2;\n values.scrollX.set(x.current);\n values.scrollXProgress.set(x.progress);\n values.scrollY.set(y.current);\n values.scrollYProgress.set(y.progress);\n }, _objectSpread(_objectSpread({}, options), {}, {\n container: (container === null || container === void 0 ? void 0 : container.current) || undefined,\n target: (target === null || target === void 0 ? void 0 : target.current) || undefined\n }));\n }, [container, target, JSON.stringify(options.offset)]);\n return values;\n}\nexport { useScroll };","map":{"version":3,"names":["motionValue","warning","useEffect","scroll","useConstant","useIsomorphicLayoutEffect","refWarning","name","ref","Boolean","current","concat","createScrollMotionValues","scrollX","scrollY","scrollXProgress","scrollYProgress","useScroll","_ref","arguments","length","undefined","container","target","layoutEffect","options","_objectWithoutProperties","_excluded","values","useLifecycleEffect","_progress","_ref2","x","y","set","progress","_objectSpread","JSON","stringify","offset"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/framer-motion/dist/es/value/use-scroll.mjs"],"sourcesContent":["import { motionValue } from 'motion-dom';\nimport { warning } from 'motion-utils';\nimport { useEffect } from 'react';\nimport { scroll } from '../render/dom/scroll/index.mjs';\nimport { useConstant } from '../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';\n\nfunction refWarning(name, ref) {\n warning(Boolean(!ref || ref.current), `You have defined a ${name} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \\`layoutEffect: false\\` option.`);\n}\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n});\nfunction useScroll({ container, target, layoutEffect = true, ...options } = {}) {\n const values = useConstant(createScrollMo