1 line
5.7 KiB
JSON
1 line
5.7 KiB
JSON
{"ast":null,"code":"import { warnOnce } from 'motion-utils';\nimport { updateScrollInfo } from './info.mjs';\nimport { resolveOffsets } from './offsets/index.mjs';\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 = 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, options = {}) {\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","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":["/home/gnx/Desktop/ETB/ETB-FrontEnd/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, onScroll, info, options = {}) {\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}\n\nexport { createOnScrollHandler };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,SAASC,OAAOA,CAACC,SAAS,EAAEC,MAAM,GAAGD,SAAS,EAAEE,IAAI,EAAE;EAClD;AACJ;AACA;EACIA,IAAI,CAACC,CAAC,CAACC,YAAY,GAAG,CAAC;EACvBF,IAAI,CAACG,CAAC,CAACD,YAAY,GAAG,CAAC;EACvB,IAAIH,MAAM,KAAKD,SAAS,EAAE;IACtB,IAAIM,IAAI,GAAGL,MAAM;IACjB,OAAOK,IAAI,IAAIA,IAAI,KAAKN,SAAS,EAAE;MAC/BE,IAAI,CAACC,CAAC,CAACC,YAAY,IAAIE,IAAI,CAACC,UAAU;MACtCL,IAAI,CAACG,CAAC,CAACD,YAAY,IAAIE,IAAI,CAACE,SAAS;MACrCF,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