1 line
7.5 KiB
JSON
1 line
7.5 KiB
JSON
|
|
{"ast":null,"code":"\"use client\";\n\nimport _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 = [\"children\", \"style\", \"value\", \"as\", \"onDrag\", \"layout\"];\nimport { jsx } from 'react/jsx-runtime';\nimport { isMotionValue } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\nimport { motion } from '../../render/components/motion/proxy.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useMotionValue } from '../../value/use-motion-value.mjs';\nimport { useTransform } from '../../value/use-transform.mjs';\nfunction useDefaultMotionValue(value) {\n let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return isMotionValue(value) ? value : useMotionValue(defaultValue);\n}\nfunction ReorderItemComponent(_ref, externalRef) {\n let {\n children,\n style = {},\n value,\n as = \"li\",\n onDrag,\n layout = true\n } = _ref,\n props = _objectWithoutProperties(_ref, _excluded);\n const Component = useConstant(() => motion[as]);\n const context = useContext(ReorderContext);\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y)\n };\n const zIndex = useTransform([point.x, point.y], _ref2 => {\n let [latestX, latestY] = _ref2;\n return latestX || latestY ? 1 : \"unset\";\n });\n invariant(Boolean(context), \"Reorder.Item must be a child of Reorder.Group\");\n const {\n axis,\n registerItem,\n updateOrder\n } = context;\n return jsx(Component, _objectSpread(_objectSpread({\n drag: axis\n }, props), {}, {\n dragSnapToOrigin: true,\n style: _objectSpread(_objectSpread({}, style), {}, {\n x: point.x,\n y: point.y,\n zIndex\n }),\n layout: layout,\n onDrag: (event, gesturePoint) => {\n const {\n velocity\n } = gesturePoint;\n velocity[axis] && updateOrder(value, point[axis].get(), velocity[axis]);\n onDrag && onDrag(event, gesturePoint);\n },\n onLayoutMeasure: measured => registerItem(value, measured),\n ref: externalRef,\n ignoreStrict: true,\n children: children\n }));\n}\nconst ReorderItem = /*@__PURE__*/forwardRef(ReorderItemComponent);\nexport { ReorderItem, ReorderItemComponent };","map":{"version":3,"names":["_objectSpread","_objectWithoutProperties","_excluded","jsx","isMotionValue","invariant","forwardRef","useContext","ReorderContext","motion","useConstant","useMotionValue","useTransform","useDefaultMotionValue","value","defaultValue","arguments","length","undefined","ReorderItemComponent","_ref","externalRef","children","style","as","onDrag","layout","props","Component","context","point","x","y","zIndex","_ref2","latestX","latestY","Boolean","axis","registerItem","updateOrder","drag","dragSnapToOrigin","event","gesturePoint","velocity","get","onLayoutMeasure","measured","ref","ignoreStrict","ReorderItem"],"sources":["/Users/apple/Documents/cursor/Web课件/AI课/education_web_多Agent协作系统/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { isMotionValue } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { ReorderContext } from '../../context/ReorderContext.mjs';\nimport { motion } from '../../render/components/motion/proxy.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useMotionValue } from '../../value/use-motion-value.mjs';\nimport { useTransform } from '../../value
|