Files
ai-course/node_modules/.cache/babel-loader/21ad9be7ab2ab70e1f058517d951e99b451260465ba36196701531fe3318beee.json

1 line
8.4 KiB
JSON
Raw Normal View History

{"ast":null,"code":"import { percent, mixNumber } from 'motion-dom';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis) {\n let translate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let scale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n let origin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5;\n let boxScale = arguments.length > 4 ? arguments[4] : undefined;\n let originAxis = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : axis;\n let sourceAxis = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : axis;\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\") return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis) originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, _ref, origin, sourceAxis) {\n let [key, scaleKey, originKey] = _ref;\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };","map":{"version":3,"names":["percent","mixNumber","scalePoint","removePointDelta","point","translate","scale","originPoint","boxScale","undefined","removeAxisDelta","axis","arguments","length","origin","originAxis","sourceAxis","test","parseFloat","relativeProgress","min","max","removeAxisTransforms","transforms","_ref","key","scaleKey","originKey","xKeys","yKeys","removeBoxTransforms","box","originBox","sourceBox","x","y"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs"],"sourcesContent":["import { percent, mixNumber } from 'motion-dom';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of a