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

1 line
5.1 KiB
JSON
Raw Normal View History

{"ast":null,"code":"import { isHTMLElement } from 'motion-dom';\nfunction calcInset(element, container) {\n const inset = {\n x: 0,\n y: 0\n };\n let current = element;\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft;\n inset.y += current.offsetTop;\n current = current.offsetParent;\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of <svg /> tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on <svg />. Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for <svg /> is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect();\n current = current.parentElement;\n const parentBoundingBox = current.getBoundingClientRect();\n inset.x += svgBoundingBox.left - parentBoundingBox.left;\n inset.y += svgBoundingBox.top - parentBoundingBox.top;\n } else if (current instanceof SVGGraphicsElement) {\n const {\n x,\n y\n } = current.getBBox();\n inset.x += x;\n inset.y += y;\n let svg = null;\n let parent = current.parentNode;\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent;\n }\n parent = current.parentNode;\n }\n current = svg;\n } else {\n break;\n }\n }\n return inset;\n}\nexport { calcInset };","map":{"version":3,"names":["isHTMLElement","calcInset","element","container","inset","x","y","current","offsetLeft","offsetTop","offsetParent","tagName","svgBoundingBox","getBoundingClientRect","parentElement","parentBoundingBox","left","top","SVGGraphicsElement","getBBox","svg","parent","parentNode"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs"],"sourcesContent":["import { isHTMLElement } from 'motion-dom';\n\nfunction calcInset(element, container) {\n const inset = { x: 0, y: 0 };\n let current = element;\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft;\n inset.y += current.offsetTop;\n current = current.offsetParent;\n }\n else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of <svg /> tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on <svg />. Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for <svg /> is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect();\n current = current.parentElement;\n const parentBoundingBox = current.getBoundingClientRect();\n inset.x += svgBoundingBox.left - parentBoundingBox.left;\n inset.y += svgBoundingBox.top - parentBoundingBox.top;\n }\n else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox();\n inset.x += x;\n inset.y += y;\n let svg = null;\n let parent = current.parentNode;\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent;\n }\n parent = current.parentNode;\n }\n current = svg;\n }\n else {\n break;\n }\n }\n return inset;\n}\n\nexport { calcInset };\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,YAAY;AAE1C,SAASC,SAASA,CAACC,OAAO,EAAEC,SAAS,EAAE;EACnC,MAAMC,KAAK,GAAG;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC;EAC5B,IAAIC,OAAO,GAAGL,OAAO;EACrB,OA