Files
ai-course/node_modules/.cache/babel-loader/719ad62a9976aa24d5a63153afa62f66bc3abaf41ebba7c0cd29474e754160fb.json

1 line
7.7 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 = [\"motionValue\", \"onUpdate\", \"onComplete\", \"element\"];\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n var _this$finishedTime;\n const _this$options = this.options,\n {\n motionValue,\n onUpdate,\n onComplete,\n element\n } = _this$options,\n options = _objectWithoutProperties(_this$options, _excluded);\n if (!motionValue) return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation(_objectSpread(_objectSpread({}, options), {}, {\n autoplay: false\n }));\n const sampleTime = secondsToMilliseconds((_this$finishedTime = this.finishedTime) !== null && _this$finishedTime !== void 0 ? _this$finishedTime : this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n sampleAnimation.stop();\n }\n}\nexport { NativeAnimationExtended };","map":{"version":3,"names":["secondsToMilliseconds","JSAnimation","NativeAnimation","replaceTransitionType","replaceStringEasing","sampleDelta","NativeAnimationExtended","constructor","options","startTime","updateMotionValue","value","_this$finishedTime","_this$options","motionValue","onUpdate","onComplete","element","_objectWithoutProperties","_excluded","undefined","set","sampleAnimation","_objectSpread","autoplay","sampleTime","finishedTime","time","setWithVelocity","sample","stop"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { secondsToMilliseconds } from 'motion-utils';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type