motion-dom 12.35.2 → 12.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +181 -75
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/animation/AsyncMotionValueAnimation.mjs +23 -7
- package/dist/es/animation/AsyncMotionValueAnimation.mjs.map +1 -1
- package/dist/es/animation/JSAnimation.mjs +16 -3
- package/dist/es/animation/JSAnimation.mjs.map +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs.map +1 -1
- package/dist/es/animation/keyframes/utils/unit-conversion.mjs +12 -2
- package/dist/es/animation/keyframes/utils/unit-conversion.mjs.map +1 -1
- package/dist/es/animation/utils/active-animations.mjs +5 -2
- package/dist/es/animation/utils/active-animations.mjs.map +1 -1
- package/dist/es/animation/utils/is-transition-defined.mjs +18 -2
- package/dist/es/animation/utils/is-transition-defined.mjs.map +1 -1
- package/dist/es/animation/waapi/supports/waapi.mjs +21 -12
- package/dist/es/animation/waapi/supports/waapi.mjs.map +1 -1
- package/dist/es/animation/waapi/utils/is-browser-color.mjs +13 -0
- package/dist/es/animation/waapi/utils/is-browser-color.mjs.map +1 -0
- package/dist/es/frameloop/batcher.mjs +3 -2
- package/dist/es/frameloop/batcher.mjs.map +1 -1
- package/dist/es/frameloop/render-step.mjs +5 -3
- package/dist/es/frameloop/render-step.mjs.map +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/layout/LayoutAnimationBuilder.mjs.map +1 -1
- package/dist/es/projection/animation/mix-values.mjs +8 -3
- package/dist/es/projection/animation/mix-values.mjs.map +1 -1
- package/dist/es/projection/geometry/delta-apply.mjs +4 -6
- package/dist/es/projection/geometry/delta-apply.mjs.map +1 -1
- package/dist/es/projection/node/create-projection-node.mjs +31 -10
- package/dist/es/projection/node/create-projection-node.mjs.map +1 -1
- package/dist/es/utils/is-html-element.mjs +3 -1
- package/dist/es/utils/is-html-element.mjs.map +1 -1
- package/dist/es/value/follow-value.mjs +13 -1
- package/dist/es/value/follow-value.mjs.map +1 -1
- package/dist/index.d.ts +28 -12
- package/dist/motion-dom.dev.js +181 -75
- package/dist/motion-dom.js +1 -1
- package/dist/size-rollup-motion-value.js +1 -1
- package/dist/size-rollup-motion-value.js.map +1 -1
- package/dist/size-rollup-style-effect.js +1 -1
- package/dist/size-rollup-style-effect.js.map +1 -1
- package/package.json +3 -3
- package/dist/es/animation/utils/get-final-keyframe.mjs +0 -13
- package/dist/es/animation/utils/get-final-keyframe.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;n<i;n++){const i=this.subscriptions[n];i&&i(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const s=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(e,i){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,
|
|
1
|
+
const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;n<i;n++){const i=this.subscriptions[n];i&&i(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const s=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(e,i){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=s.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,n=!1,a=!1)=>{const o=a&&i?e:s;return n&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,i)return void(n=!0);i=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),i=!1,n&&(n=!1,c.process(t))}};return c}(o),t),{}),{setup:h,read:d,resolveKeyframes:p,preUpdate:u,update:l,preRender:v,render:m,postRender:f}=c,g=()=>{const s=t.useManualTiming,o=s?a.timestamp:performance.now();n=!1,s||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,h.process(a),d.process(a),p.process(a),u.process(a),l.process(a),v.process(a),m.process(a),f.process(a),a.isProcessing=!1,n&&i&&(r=!1,e(g))};return{schedule:s.reduce((t,s)=>{const i=c[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||e(g)),i.schedule(t,s,o)),t},{}),cancel:t=>{for(let e=0;e<s.length;e++)c[s[e]].cancel(t)},state:a,steps:c}}const{schedule:n,state:r}=i("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);let a;function o(){a=void 0}const c={now:()=>(void 0===a&&c.set(r.isProcessing||t.useManualTiming?r.timestamp:performance.now()),a),set:t=>{a=t,queueMicrotask(o)}},h={current:void 0};class d{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=c.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=c.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new e);const i=this.events[t].add(s);return"change"===t?()=>{i(),n.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return h.current&&h.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=c.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(i=e)?s*(1e3/i):0;var s,i}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function p(t,e){return new d(t,e)}export{d as MotionValue,h as collectMotionValues,p as motionValue};
|
|
2
2
|
//# sourceMappingURL=size-rollup-motion-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size-rollup-motion-value.js","sources":["../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs"],"sourcesContent":["const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n"],"names":["MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","collectMotionValues","current","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","motionValue"],"mappings":"AAAA,MAAMA,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC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,OAAOmD,SAAS9H,SACrBX,KAAK+G,iBACL/G,KAAK8G,OACD9G,KAAKmH,mBACLnH,KAAKmH,mBAEb,EAEG,SAASuB,EAAYvD,EAAMC,GAC9B,OAAO,IAAIF,EAAYC,EAAMC,EACjC"}
|
|
1
|
+
{"version":3,"file":"size-rollup-motion-value.js","sources":["../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs"],"sourcesContent":["const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n"],"names":["MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","collectMotionValues","current","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","motionValue"],"mappings":"AAAA,MAAMA,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB,OCReD,EDODJ,KAAKC,cCPCI,EDOcF,GCNZ,IAAtBC,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,GDMF,ICJf,SAAoBD,EAAKC,GACrB,MAAMG,EAAQJ,EAAIE,QAAQD,GACtBG,GAAQ,GACRJ,EAAIK,OAAOD,EAAO,EAC1B,CDAqBE,CAAWV,KAAKC,cAAeE,EAChD,CACA,MAAAQ,CAAOC,EAAGC,EAAGC,GACT,MAAMC,EAAmBf,KAAKC,cAAce,OAC5C,GAAKD,EAEL,GAAyB,IAArBA,EAIAf,KAAKC,cAAc,GAAGW,EAAGC,EAAGC,QAG5B,IAAK,IAAIG,EAAI,EAAGA,EAAIF,EAAkBE,IAAK,CAKvC,MAAMd,EAAUH,KAAKC,cAAcgB,GACnCd,GAAWA,EAAQS,EAAGC,EAAGC,EAC7B,CAER,CACA,OAAAI,GACI,OAAOlB,KAAKC,cAAce,MAC9B,CACA,KAAAG,GACInB,KAAKC,cAAce,OAAS,CAChC,EEpCG,MAAMI,EAAa,CACtB,QACA,OACA,mBACA,YACA,SACA,YACA,SACA,cCJG,SAASC,EAAoBC,EAAmBC,GACnD,IAAIC,GAAe,EACfC,GAAoB,EACxB,MAAMC,EAAQ,CACVC,MAAO,EACPC,UAAW,EACXC,cAAc,GAEZC,EAAmB,IAAON,GAAe,EACzCO,EAAQX,EAAWY,OAAO,CAACC,EAAKC,KAClCD,EAAIC,GCbL,SAA0BV,GAK7B,IAAIW,EAAY,IAAIC,IAChBC,EAAY,IAAID,IAKhBP,GAAe,EACfS,GAAiB,EAIrB,MAA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B,OACX/G,KAAKuF,OAAOiD,iBACZxI,KAAKuF,OAAOiD,gBAAgB7H,UAGpCX,KAAKuI,gBACT,CAMA,WAAAE,GACI,QAASzI,KAAKmI,SAClB,CACA,cAAAI,UACWvI,KAAKmI,SAChB,CAUA,OAAAO,GACI1I,KAAKgG,YAAY7E,QACjBnB,KAAKuF,OAAOmD,SAAS/H,SACrBX,KAAKgH,iBACLhH,KAAK+G,OACD/G,KAAKoH,mBACLpH,KAAKoH,mBAEb,EAEG,SAASuB,EAAYvD,EAAMC,GAC9B,OAAO,IAAIF,EAAYC,EAAMC,EACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set(t))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function r(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=i.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.
|
|
1
|
+
const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set(t))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function r(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=i.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,c.process(t))}};return c}(o),t),{}),{setup:d,read:h,resolveKeyframes:l,preUpdate:p,update:u,preRender:f,render:m,postRender:g}=c,v=()=>{const i=s.useManualTiming,o=i?a.timestamp:performance.now();n=!1,i||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,d.process(a),h.process(a),l.process(a),p.process(a),u.process(a),f.process(a),m.process(a),g.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(v))};return{schedule:i.reduce((e,s)=>{const i=c[s];return e[s]=(e,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;e<i.length;e++)c[i[e]].cancel(t)},state:a,steps:c}}const{schedule:a,cancel:o,state:c}=r("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);let d;function h(){d=void 0}const l={now:()=>(void 0===d&&l.set(c.isProcessing||s.useManualTiming?c.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(h)}};class p{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=l.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=l.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),a.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=l.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u(t){return(e,s)=>{const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(e),i=[];for(const e of n){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}const f={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...f,transform:t=>((t,e,s)=>s>e?e:s<t?t:s)(0,1,t)},g={...f,default:1},v={...f,transform:Math.round},y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),w=y("deg"),b=y("%"),k=y("px"),A=(()=>({...b,parse:t=>b.parse(t)/100,transform:t=>b.transform(100*t)}))(),P={borderWidth:k,borderTopWidth:k,borderRightWidth:k,borderBottomWidth:k,borderLeftWidth:k,borderRadius:k,borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomRightRadius:k,borderBottomLeftRadius:k,width:k,maxWidth:k,height:k,maxHeight:k,top:k,right:k,bottom:k,left:k,inset:k,insetBlock:k,insetBlockStart:k,insetBlockEnd:k,insetInline:k,insetInlineStart:k,insetInlineEnd:k,padding:k,paddingTop:k,paddingRight:k,paddingBottom:k,paddingLeft:k,paddingBlock:k,paddingBlockStart:k,paddingBlockEnd:k,paddingInline:k,paddingInlineStart:k,paddingInlineEnd:k,margin:k,marginTop:k,marginRight:k,marginBottom:k,marginLeft:k,marginBlock:k,marginBlockStart:k,marginBlockEnd:k,marginInline:k,marginInlineStart:k,marginInlineEnd:k,fontSize:k,backgroundPositionX:k,backgroundPositionY:k,...{rotate:w,rotateX:w,rotateY:w,rotateZ:w,scale:g,scaleX:g,scaleY:g,scaleZ:g,skew:w,skewX:w,skewY:w,distance:k,translateX:k,translateY:k,translateZ:k,x:k,y:k,z:k,perspective:k,transformPerspective:k,opacity:m,originX:A,originY:A,originZ:k},zIndex:v,fillOpacity:m,strokeOpacity:m,numOctaves:v};class S{constructor(){this.latest={},this.values=new Map}set(t,e,s,n,i=!0){const r=this.values.get(t);r&&r.onRemove();const c=()=>{const n=e.get();this.latest[t]=i?((t,e)=>e&&"number"==typeof t?e.transform(t):t)(n,P[t]):n,s&&a.render(s)};c();const d=e.on("change",c);n&&e.addDependent(n);const h=()=>{d(),s&&o(s),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:h}),h}get(t){return this.values.get(t)?.value}}function E(t){const e=new WeakMap;return(s,n)=>{const i=e.get(s)??new S;e.set(s,i);const r=[];for(const e in n){const a=n[e],o=t(s,i,e,a);r.push(o)}return()=>{for(const t of r)t()}}}const B={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const R=new Set(["originX","originY","originZ"]),F=(s,n,i,r)=>{let a,o;return e.has(i)?(n.get("transform")||(function(t){return"object"==typeof(e=t)&&null!==e&&"offsetHeight"in t&&!("ownerSVGElement"in t);var e}(s)||n.get("transformBox")||F(s,n,"transformBox",new p("fill-box")),n.set("transform",new p("none"),()=>{s.style.transform=function(e){let s="",n=!0;for(let i=0;i<t.length;i++){const r=t[i],a=e.latest[r];if(void 0===a)continue;let o=!0;if("number"==typeof a)o=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);o=r.startsWith("scale")?1===t:0===t}o||(n=!1,s+=`${B[r]||r}(${a}) `)}return n?"none":s.trim()}(n)})),o=n.get("transform")):R.has(i)?(n.get("transformOrigin")||n.set("transformOrigin",new p(""),()=>{const t=n.latest.originX??"50%",e=n.latest.originY??"50%",i=n.latest.originZ??0;s.style.transformOrigin=`${t} ${e} ${i}`}),o=n.get("transformOrigin")):a=i.startsWith("--")?()=>{s.style.setProperty(i,n.latest[i])}:()=>{s.style[i]=n.latest[i]},n.set(i,r,a,o)},x=u(E(F));export{F as addStyleValue,x as styleEffect};
|
|
2
2
|
//# sourceMappingURL=size-rollup-style-effect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { resolveElements, } from \"../../utils/resolve-elements\";\nexport function createSelectorEffect(subjectEffect) {\n return (subject, values) => {\n const elements = resolveElements(subject);\n const subscriptions = [];\n for (const element of elements) {\n const remove = subjectEffect(element, values);\n subscriptions.push(remove);\n }\n return () => {\n for (const remove of subscriptions)\n remove();\n };\n };\n}\n//# sourceMappingURL=create-dom-effect.js.map","export function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n//# sourceMappingURL=resolve-elements.js.map","import { clamp } from \"motion-utils\";\nexport const number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nexport const alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nexport const scale = {\n ...number,\n default: 1,\n};\n//# sourceMappingURL=index.js.map","import { number } from \"./numbers\";\nexport const int = {\n ...number,\n transform: Math.round,\n};\n//# sourceMappingURL=int.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\");\nexport const percent = /*@__PURE__*/ createUnitType(\"%\");\nexport const px = /*@__PURE__*/ createUnitType(\"px\");\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\");\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\");\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n//# sourceMappingURL=units.js.map","import { int } from \"../int\";\nimport { alpha } from \"../numbers\";\nimport { px } from \"../numbers/units\";\nimport { transformValueTypes } from \"./transform\";\nexport const numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n//# sourceMappingURL=number.js.map","import { alpha, scale } from \"../numbers\";\nimport { degrees, progressPercentage, px } from \"../numbers/units\";\nexport const transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n//# sourceMappingURL=transform.js.map","import { cancelFrame, frame } from \"../frameloop/frame\";\nimport { numberValueTypes } from \"../value/types/maps/number\";\nimport { getValueAsType } from \"../value/types/utils/get-as-type\";\nexport class MotionValueState {\n constructor() {\n this.latest = {};\n this.values = new Map();\n }\n set(name, value, render, computed, useDefaultValueType = true) {\n const existingValue = this.values.get(name);\n if (existingValue) {\n existingValue.onRemove();\n }\n const onChange = () => {\n const v = value.get();\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name]);\n }\n else {\n this.latest[name] = v;\n }\n render && frame.render(render);\n };\n onChange();\n const cancelOnChange = value.on(\"change\", onChange);\n computed && value.addDependent(computed);\n const remove = () => {\n cancelOnChange();\n render && cancelFrame(render);\n this.values.delete(name);\n computed && value.removeDependent(computed);\n };\n this.values.set(name, { value, onRemove: remove });\n return remove;\n }\n get(name) {\n return this.values.get(name)?.value;\n }\n}\n//# sourceMappingURL=MotionValueState.js.map","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n//# sourceMappingURL=get-as-type.js.map","import { MotionValueState } from \"../MotionValueState\";\nexport function createEffect(addValue) {\n const stateCache = new WeakMap();\n return (subject, values) => {\n const state = stateCache.get(subject) ?? new MotionValueState();\n stateCache.set(subject, state);\n const subscriptions = [];\n for (const key in values) {\n const value = values[key];\n const remove = addValue(subject, state, key, value);\n subscriptions.push(remove);\n }\n return () => {\n for (const cancel of subscriptions)\n cancel();\n };\n };\n}\n//# sourceMappingURL=create-effect.js.map","import { transformPropOrder } from \"../../render/utils/keys-transform\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nexport function buildTransform(state) {\n let transform = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i];\n const value = state.latest[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transform += `${transformName}(${value}) `;\n }\n }\n return transformIsDefault ? \"none\" : transform.trim();\n}\n//# sourceMappingURL=transform.js.map","import { isCSSVar } from \"../../render/dom/is-css-var\";\nimport { transformProps } from \"../../render/utils/keys-transform\";\nimport { isHTMLElement } from \"../../utils/is-html-element\";\nimport { MotionValue } from \"../../value\";\nimport { createSelectorEffect } from \"../utils/create-dom-effect\";\nimport { createEffect } from \"../utils/create-effect\";\nimport { buildTransform } from \"./transform\";\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nexport const addStyleValue = (element, state, key, value) => {\n let render = undefined;\n let computed = undefined;\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(element, state, \"transformBox\", new MotionValue(\"fill-box\"));\n }\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state);\n });\n }\n computed = state.get(\"transform\");\n }\n else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\";\n const originY = state.latest.originY ?? \"50%\";\n const originZ = state.latest.originZ ?? 0;\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`;\n });\n }\n computed = state.get(\"transformOrigin\");\n }\n else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key]);\n };\n }\n else {\n render = () => {\n element.style[key] = state.latest[key];\n };\n }\n return state.set(key, value, render, computed);\n};\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n/*@__PURE__*/ createEffect(addStyleValue));\n//# sourceMappingURL=index.js.map","import { isObject } from \"motion-utils\";\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n//# sourceMappingURL=is-html-element.js.map","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n"],"names":["transformPropOrder","transformProps","Set","MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","current","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","createSelectorEffect","subjectEffect","subject","values","elements","elementOrSelector","EventTarget","document","querySelectorAll","Array","from","filter","element","resolveElements","remove","number","test","parse","transform","alpha","clamp","scale","default","int","round","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","MotionValueState","latest","Map","name","computed","useDefaultValueType","existingValue","onRemove","type","getValueAsType","cancelOnChange","createEffect","addValue","stateCache","WeakMap","translateAlias","originProps","addStyleValue","isHTMLElement","style","transformIsDefault","valueIsDefault","startsWith","parsed","trim","buildTransform","transformOrigin","setProperty","styleEffect"],"mappings":"AAAO,MCGMA,EAAqB,CAC9B,uBACA,IACA,IACA,IACA,aACA,aACA,aACA,QACA,SACA,SACA,SACA,UACA,UACA,UACA,OACA,QACA,SAKSC,EAA+B,KAAO,IAAIC,IAAIF,GAAf,GCzB5C,MCAMG,EAAqB,CAAA,ECE3B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuB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UxN,EAAM+N,OAAOP,SAAW,MAClCC,EAAUzN,EAAM+N,OAAON,SAAW,EACxC9F,EAAQsH,MAAMO,gBAAkB,GAAGjC,KAAWC,KAAWC,MAGjES,EAAWlO,EAAM8F,IAAI,oBAGrB3D,EADc3B,EzBnCiB4O,WAAW,MyBoCjC,KACLzH,EAAQsH,MAAMQ,YAAYjP,EAAKR,EAAM+N,OAAOvN,KAIvC,KACLmH,EAAQsH,MAAMzO,GAAOR,EAAM+N,OAAOvN,IAGnCR,EAAMmD,IAAI3C,EAAKiE,EAAOtC,EAAQ+L,IAE5BwB,EAA4B3I,EAC3B0H,EAAaM"}
|
|
1
|
+
{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { resolveElements, } from \"../../utils/resolve-elements\";\nexport function createSelectorEffect(subjectEffect) {\n return (subject, values) => {\n const elements = resolveElements(subject);\n const subscriptions = [];\n for (const element of elements) {\n const remove = subjectEffect(element, values);\n subscriptions.push(remove);\n }\n return () => {\n for (const remove of subscriptions)\n remove();\n };\n };\n}\n//# sourceMappingURL=create-dom-effect.js.map","export function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n//# sourceMappingURL=resolve-elements.js.map","import { clamp } from \"motion-utils\";\nexport const number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nexport const alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nexport const scale = {\n ...number,\n default: 1,\n};\n//# sourceMappingURL=index.js.map","import { number } from \"./numbers\";\nexport const int = {\n ...number,\n transform: Math.round,\n};\n//# sourceMappingURL=int.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\");\nexport const percent = /*@__PURE__*/ createUnitType(\"%\");\nexport const px = /*@__PURE__*/ createUnitType(\"px\");\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\");\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\");\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n//# sourceMappingURL=units.js.map","import { int } from \"../int\";\nimport { alpha } from \"../numbers\";\nimport { px } from \"../numbers/units\";\nimport { transformValueTypes } from \"./transform\";\nexport const numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n//# sourceMappingURL=number.js.map","import { alpha, scale } from \"../numbers\";\nimport { degrees, progressPercentage, px } from \"../numbers/units\";\nexport const transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n//# sourceMappingURL=transform.js.map","import { cancelFrame, frame } from \"../frameloop/frame\";\nimport { numberValueTypes } from \"../value/types/maps/number\";\nimport { getValueAsType } from \"../value/types/utils/get-as-type\";\nexport class MotionValueState {\n constructor() {\n this.latest = {};\n this.values = new Map();\n }\n set(name, value, render, computed, useDefaultValueType = true) {\n const existingValue = this.values.get(name);\n if (existingValue) {\n existingValue.onRemove();\n }\n const onChange = () => {\n const v = value.get();\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name]);\n }\n else {\n this.latest[name] = v;\n }\n render && frame.render(render);\n };\n onChange();\n const cancelOnChange = value.on(\"change\", onChange);\n computed && value.addDependent(computed);\n const remove = () => {\n cancelOnChange();\n render && cancelFrame(render);\n this.values.delete(name);\n computed && value.removeDependent(computed);\n };\n this.values.set(name, { value, onRemove: remove });\n return remove;\n }\n get(name) {\n return this.values.get(name)?.value;\n }\n}\n//# sourceMappingURL=MotionValueState.js.map","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n//# sourceMappingURL=get-as-type.js.map","import { MotionValueState } from \"../MotionValueState\";\nexport function createEffect(addValue) {\n const stateCache = new WeakMap();\n return (subject, values) => {\n const state = stateCache.get(subject) ?? new MotionValueState();\n stateCache.set(subject, state);\n const subscriptions = [];\n for (const key in values) {\n const value = values[key];\n const remove = addValue(subject, state, key, value);\n subscriptions.push(remove);\n }\n return () => {\n for (const cancel of subscriptions)\n cancel();\n };\n };\n}\n//# sourceMappingURL=create-effect.js.map","import { transformPropOrder } from \"../../render/utils/keys-transform\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nexport function buildTransform(state) {\n let transform = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i];\n const value = state.latest[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transform += `${transformName}(${value}) `;\n }\n }\n return transformIsDefault ? \"none\" : transform.trim();\n}\n//# sourceMappingURL=transform.js.map","import { isCSSVar } from \"../../render/dom/is-css-var\";\nimport { transformProps } from \"../../render/utils/keys-transform\";\nimport { isHTMLElement } from \"../../utils/is-html-element\";\nimport { MotionValue } from \"../../value\";\nimport { createSelectorEffect } from \"../utils/create-dom-effect\";\nimport { createEffect } from \"../utils/create-effect\";\nimport { buildTransform } from \"./transform\";\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nexport const addStyleValue = (element, state, key, value) => {\n let render = undefined;\n let computed = undefined;\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(element, state, \"transformBox\", new MotionValue(\"fill-box\"));\n }\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state);\n });\n }\n computed = state.get(\"transform\");\n }\n else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\";\n const originY = state.latest.originY ?? \"50%\";\n const originZ = state.latest.originZ ?? 0;\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`;\n });\n }\n computed = state.get(\"transformOrigin\");\n }\n else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key]);\n };\n }\n else {\n render = () => {\n element.style[key] = state.latest[key];\n };\n }\n return state.set(key, value, render, computed);\n};\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n/*@__PURE__*/ createEffect(addStyleValue));\n//# sourceMappingURL=index.js.map","import { isObject } from \"motion-utils\";\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n//# sourceMappingURL=is-html-element.js.map","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n"],"names":["transformPropOrder","transformProps","Set","MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","thisFrame","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","current","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","value","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","createSelectorEffect","subjectEffect","subject","values","elements","elementOrSelector","EventTarget","document","querySelectorAll","Array","from","filter","element","resolveElements","remove","number","test","parse","transform","alpha","clamp","scale","default","int","round","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","MotionValueState","latest","Map","name","computed","useDefaultValueType","existingValue","onRemove","type","getValueAsType","cancelOnChange","createEffect","addValue","stateCache","WeakMap","translateAlias","originProps","addStyleValue","isHTMLElement","style","transformIsDefault","valueIsDefault","startsWith","parsed","trim","buildTransform","transformOrigin","setProperty","styleEffect"],"mappings":"AAAO,MCGMA,EAAqB,C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AQA,KACZkE,MAEzC,CACA,OAAOyK,EAAqB,OAASjH,EAAUqH,MACnD,CCf0CC,CAAexP,MAGjDmO,EAAWnO,EAAM+F,IAAI,cAEhBgJ,EAAY9N,IAAIT,IAChBR,EAAM+F,IAAI,oBACX/F,EAAMoD,IAAI,kBAAmB,IAAIG,EAAY,IAAK,KAC9C,MAAMiK,EAAUxN,EAAMgO,OAAOR,SAAW,MAClCC,EAAUzN,EAAMgO,OAAOP,SAAW,MAClCC,EAAU1N,EAAMgO,OAAON,SAAW,EACxC9F,EAAQsH,MAAMO,gBAAkB,GAAGjC,KAAWC,KAAWC,MAGjES,EAAWnO,EAAM+F,IAAI,oBAGrB3D,EADc5B,EzBnCiB6O,WAAW,MyBoCjC,KACLzH,EAAQsH,MAAMQ,YAAYlP,EAAKR,EAAMgO,OAAOxN,KAIvC,KACLoH,EAAQsH,MAAM1O,GAAOR,EAAMgO,OAAOxN,IAGnCR,EAAMoD,IAAI5C,EAAKkE,EAAOtC,EAAQ+L,IAE5BwB,EAA4B3I,EAC3B0H,EAAaM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motion-dom",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.37.0",
|
|
4
4
|
"author": "Matt Perry",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/motiondivision/motion",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"motion-utils": "^12.
|
|
20
|
+
"motion-utils": "^12.36.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"clean": "rm -rf types dist lib",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"maxSize": "1.8 kB"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "41d720b7fe05d118e916b99b7be32e42ccc9cb9d"
|
|
40
40
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const isNotNull = (value) => value !== null;
|
|
2
|
-
function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) {
|
|
3
|
-
const resolvedKeyframes = keyframes.filter(isNotNull);
|
|
4
|
-
const index = repeat && repeatType !== "loop" && repeat % 2 === 1
|
|
5
|
-
? 0
|
|
6
|
-
: resolvedKeyframes.length - 1;
|
|
7
|
-
return !index || finalKeyframe === undefined
|
|
8
|
-
? resolvedKeyframes[index]
|
|
9
|
-
: finalKeyframe;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { getFinalKeyframe };
|
|
13
|
-
//# sourceMappingURL=get-final-keyframe.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-final-keyframe.mjs","sources":["../../../../src/animation/utils/get-final-keyframe.ts"],"sourcesContent":["import type { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe<T>(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const index =\n repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAAC,KAAc,KAAK,KAAK,KAAK,IAAI;AAE9C,SAAU,gBAAgB,CAC5B,SAAc,EACd,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAA4B,EACzD,aAAiB,EAAA;IAEjB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;AACrD,IAAA,MAAM,KAAK,GACP,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,MAAM,GAAG,CAAC,KAAK;AAC9C,UAAE;AACF,UAAE,iBAAiB,CAAC,MAAM,GAAG,CAAC;AAEtC,IAAA,OAAO,CAAC,KAAK,IAAI,aAAa,KAAK;AAC/B,UAAE,iBAAiB,CAAC,KAAK;UACvB,aAAa;AACvB;;;;"}
|