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

1 line
6.1 KiB
JSON
Raw Normal View History

{"ast":null,"code":"import { warnOnce } from 'motion-utils';\nimport { updateScrollInfo } from './info.mjs';\nimport { resolveOffsets } from './offsets/index.mjs';\nfunction measure(container) {\n let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : container;\n let info = arguments.length > 2 ? arguments[2] : undefined;\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0;\n info.y.targetOffset = 0;\n if (target !== container) {\n let node = target;\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\n }\n }\n info.x.targetLength = target === container ? target.scrollWidth : target.clientWidth;\n info.y.targetLength = target === container ? target.scrollHeight : target.clientHeight;\n info.x.containerLength = container.clientWidth;\n info.y.containerLength = container.clientHeight;\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(getComputedStyle(container).position !== \"static\", \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\");\n }\n }\n}\nfunction createOnScrollHandler(element, onScroll, info) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return {\n measure: time => {\n measure(element, options.target, info);\n updateScrollInfo(element, info, time);\n if (options.offset || options.target) {\n resolveOffsets(element, info, options);\n }\n },\n notify: () => onScroll(info)\n };\n}\nexport { createOnScrollHandler };","map":{"version":3,"names":["warnOnce","updateScrollInfo","resolveOffsets","measure","container","target","arguments","length","undefined","info","x","targetOffset","y","node","offsetLeft","offsetTop","offsetParent","targetLength","scrollWidth","clientWidth","scrollHeight","clientHeight","containerLength","process","env","NODE_ENV","getComputedStyle","position","createOnScrollHandler","element","onScroll","options","time","offset","notify"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs"],"sourcesContent":["import { warnOnce } from 'motion-utils';\nimport { updateScrollInfo } from './info.mjs';\nimport { resolveOffsets } from './offsets/index.mjs';\n\nfunction measure(container, target = container, info) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0;\n info.y.targetOffset = 0;\n if (target !== container) {\n let node = target;\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\n }\n }\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth;\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight;\n info.x.containerLength = container.clientWidth;\n info.y.containerLength = container.clientHeight;\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(getComputedStyle(container).position !== \"static\", \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\");\n }\n }\n}\nfunction createOnScrollHandler(element, onScr