- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL - 修复 HomePage.tsx 中所有图片引用 - 修复 CoursePage.tsx 中所有图片引用 - 确保图片在 GitHub Pages 上正确加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 line
20 KiB
JSON
1 line
20 KiB
JSON
{"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 { secondsToMilliseconds } from 'motion-utils';\nimport { GroupAnimation } from '../animation/GroupAnimation.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs';\nimport { getValueTransition } from '../animation/utils/get-value-transition.mjs';\nimport { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs';\nimport { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs';\nimport { chooseLayerType } from './utils/choose-layer-type.mjs';\nimport { css } from './utils/css.mjs';\nimport { getLayerName } from './utils/get-layer-name.mjs';\nimport { getViewAnimations } from './utils/get-view-animations.mjs';\nimport { hasTarget } from './utils/has-target.mjs';\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"];\nfunction startViewAnimation(builder) {\n const {\n update,\n targets,\n options: defaultOptions\n } = builder;\n if (!document.startViewTransition) {\n return new Promise(async resolve => {\n await update();\n resolve(new GroupAnimation([]));\n });\n }\n // TODO: Go over existing targets and ensure they all have ids\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\"\n });\n }\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\", {\n \"animation-timing-function\": \"linear !important\"\n });\n css.commit(); // Write\n const transition = document.startViewTransition(async () => {\n await update();\n // TODO: Go over new targets and ensure they all have ids\n });\n transition.finished.finally(() => {\n css.remove(); // Write\n });\n return new Promise(resolve => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations();\n const animations = [];\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key]) continue;\n const {\n keyframes,\n options\n } = definition[key];\n for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {\n if (!valueKeyframes) continue;\n const valueOptions = _objectSpread(_objectSpread({}, getValueTransition(defaultOptions, valueName)), getValueTransition(options, valueName));\n const type = chooseLayerType(key);\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (valueName === \"opacity\" && !Array.isArray(valueKeyframes)) {\n const initialValue = type === \"new\" ? 0 : 1;\n valueKeyframes = [initialValue, valueKeyframes];\n }\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1);\n }\n valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));\n valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));\n const animation = new NativeAnimation(_objectSpread(_objectSpread({}, valueOptions), {}, {\n element: document.documentElement,\n name: valueName,\n pseudoElement: \"::view-transition-\".concat(type, \"(\").concat(target, \")\"),\n keyframes: valueKeyframes\n }));\n animations.push(animation);\n }\n }\n });\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue;\n const {\n effect\n } = animation;\n if (!effect || !(effect instanceof KeyframeEffect)) continue;\n const {\n pseudoElement\n } = effect;\n if (!pseudoElement) continue;\n const name = getLayerName(pseudoElement);\n if (!name) continue;\n const targetDefinition = targets.get(name.layer);\n if (!targetDefinition) {\n var _animationTransition$;\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\";\n let animationTransition = _objectSpread({}, getValueTransition(defaultOptions, transitionName));\n animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));\n animationTransition = applyGeneratorOptions(animationTransition);\n const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);\n effect.updateTiming({\n delay: secondsToMilliseconds((_animationTransition$ = animationTransition.delay) !== null && _animationTransition$ !== void 0 ? _animationTransition$ : 0),\n duration: animationTransition.duration,\n easing\n });\n animations.push(new NativeAnimationWrapper(animation));\n } else if (hasOpacity(targetDefinition, \"enter\") && hasOpacity(targetDefinition, \"exit\") && effect.getKeyframes().some(keyframe => keyframe.mixBlendMode)) {\n animations.push(new NativeAnimationWrapper(animation));\n } else {\n animation.cancel();\n }\n }\n resolve(new GroupAnimation(animations));\n });\n });\n}\nfunction hasOpacity(target, key) {\n var _target$key;\n return target === null || target === void 0 || (_target$key = target[key]) === null || _target$key === void 0 ? void 0 : _target$key.keyframes.opacity;\n}\nexport { startViewAnimation };","map":{"version":3,"names":["secondsToMilliseconds","GroupAnimation","NativeAnimation","NativeAnimationWrapper","getValueTransition","mapEasingToNativeEasing","applyGeneratorOptions","chooseLayerType","css","getLayerName","getViewAnimations","hasTarget","definitionNames","startViewAnimation","builder","update","targets","options","defaultOptions","document","startViewTransition","Promise","resolve","set","commit","transition","finished","finally","remove","ready","then","generatedViewAnimations","animations","forEach","definition","target","key","keyframes","valueName","valueKeyframes","Object","entries","valueOptions","_objectSpread","type","Array","isArray","initialValue","delay","duration","animation","element","documentElement","name","pseudoElement","concat","push","playState","effect","KeyframeEffect","targetDefinition","get","layer","_animationTransition$","transitionName","animationTransition","easing","ease","updateTiming","hasOpacity","getKeyframes","some","keyframe","mixBlendMode","cancel","_target$key","opacity"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/motion-dom/dist/es/view/start.mjs"],"sourcesContent":["import { secondsToMilliseconds } from 'motion-utils';\nimport { GroupAnimation } from '../animation/GroupAnimation.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs';\nimport { getValueTransition } from '../animation/utils/get-value-transition.mjs';\nimport { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs';\nimport { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs';\nimport { chooseLayerType } from './utils/choose-layer-type.mjs';\nimport { css } from './utils/css.mjs';\nimport { getLayerName } from './utils/get-layer-name.mjs';\nimport { getViewAnimations } from './utils/get-view-animations.mjs';\nimport { hasTarget } from './utils/has-target.mjs';\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"];\nfunction startViewAnimation(builder) {\n const { update, targets, options: defaultOptions } = builder;\n if (!document.startViewTransition) {\n return new Promise(async (resolve) => {\n await update();\n resolve(new GroupAnimation([]));\n });\n }\n // TODO: Go over existing targets and ensure they all have ids\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\",\n });\n }\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\", { \"animation-timing-function\": \"linear !important\" });\n css.commit(); // Write\n const transition = document.startViewTransition(async () => {\n await update();\n // TODO: Go over new targets and ensure they all have ids\n });\n transition.finished.finally(() => {\n css.remove(); // Write\n });\n return new Promise((resolve) => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations();\n const animations = [];\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key])\n continue;\n const { keyframes, options } = definition[key];\n for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {\n if (!valueKeyframes)\n continue;\n const valueOptions = {\n ...getValueTransition(defaultOptions, valueName),\n ...getValueTransition(options, valueName),\n };\n const type = chooseLayerType(key);\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (valueName === \"opacity\" &&\n !Array.isArray(valueKeyframes)) {\n const initialValue = type === \"new\" ? 0 : 1;\n valueKeyframes = [initialValue, valueKeyframes];\n }\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1);\n }\n valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));\n valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));\n const animation = new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${target})`,\n keyframes: valueKeyframes,\n });\n animations.push(animation);\n }\n }\n });\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\")\n continue;\n const { effect } = animation;\n if (!effect || !(effect instanceof KeyframeEffect))\n continue;\n const { pseudoElement } = effect;\n if (!pseudoElement)\n continue;\n const name = getLayerName(pseudoElement);\n if (!name)\n continue;\n const targetDefinition = targets.get(name.layer);\n if (!targetDefinition) {\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\";\n let animationTransition = {\n ...getValueTransition(defaultOptions, transitionName),\n };\n animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));\n animationTransition =\n applyGeneratorOptions(animationTransition);\n const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);\n effect.updateTiming({\n delay: secondsToMilliseconds(animationTransition.delay ?? 0),\n duration: animationTransition.duration,\n easing,\n });\n animations.push(new NativeAnimationWrapper(animation));\n }\n else if (hasOpacity(targetDefinition, \"enter\") &&\n hasOpacity(targetDefinition, \"exit\") &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)) {\n animations.push(new NativeAnimationWrapper(animation));\n }\n else {\n animation.cancel();\n }\n }\n resolve(new GroupAnimation(animations));\n });\n });\n}\nfunction hasOpacity(target, key) {\n return target?.[key]?.keyframes.opacity;\n}\n\nexport { startViewAnimation };\n"],"mappings":";AAAA,SAASA,qBAAqB,QAAQ,cAAc;AACpD,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,eAAe,QAAQ,kCAAkC;AAClE,SAASC,sBAAsB,QAAQ,yCAAyC;AAChF,SAASC,kBAAkB,QAAQ,6CAA6C;AAChF,SAASC,uBAAuB,QAAQ,0CAA0C;AAClF,SAASC,qBAAqB,QAAQ,8CAA8C;AACpF,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,SAASC,GAAG,QAAQ,iBAAiB;AACrC,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,SAAS,QAAQ,wBAAwB;AAElD,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;AACjE,SAASC,kBAAkBA,CAACC,OAAO,EAAE;EACjC,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC,OAAO,EAAEC;EAAe,CAAC,GAAGJ,OAAO;EAC5D,IAAI,CAACK,QAAQ,CAACC,mBAAmB,EAAE;IAC/B,OAAO,IAAIC,OAAO,CAAC,MAAOC,OAAO,IAAK;MAClC,MAAMP,MAAM,CAAC,CAAC;MACdO,OAAO,CAAC,IAAIrB,cAAc,CAAC,EAAE,CAAC,CAAC;IACnC,C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