1 line
76 KiB
Plaintext
1 line
76 KiB
Plaintext
|
|
{"version":3,"sources":["../../src/index.ts","../../src/globals.ts","../../src/helpers.ts","../../src/FrameLoop.ts","../../src/clamp.ts","../../src/colors.ts","../../src/colorMatchers.ts","../../src/normalizeColor.ts","../../src/colorToRgba.ts","../../src/createInterpolator.ts","../../src/easings.ts","../../src/fluids.ts","../../src/regexs.ts","../../src/variableToRgba.ts","../../src/stringInterpolation.ts","../../src/deprecations.ts","../../src/isAnimatedString.ts","../../src/dom-events/scroll/index.ts","../../src/dom-events/resize/resizeElement.ts","../../src/dom-events/resize/resizeWindow.ts","../../src/dom-events/resize/index.ts","../../src/progress.ts","../../src/dom-events/scroll/ScrollHandler.ts","../../src/hooks/useConstant.ts","../../src/hooks/useForceUpdate.ts","../../src/hooks/useIsMounted.ts","../../src/hooks/useIsomorphicLayoutEffect.ts","../../src/hooks/useMemoOne.ts","../../src/hooks/useOnce.ts","../../src/hooks/usePrev.ts","../../src/hooks/useReducedMotion.ts"],"sourcesContent":["import * as Globals from './globals'\nexport { Globals }\n\nexport * from './FrameLoop'\nexport * from './clamp'\nexport * from './colors'\nexport * from './colorToRgba'\nexport * from './colorMatchers'\nexport * from './createInterpolator'\nexport * from './easings'\nexport * from './stringInterpolation'\nexport * from './deprecations'\nexport * from './helpers'\nexport * from './isAnimatedString'\n/**\n * Should these be moved to a DOM only\n * package to avoid native issues?\n */\nexport * from './dom-events/scroll'\nexport * from './dom-events/resize'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useForceUpdate'\nexport * from './hooks/useMemoOne'\nexport * from './hooks/useOnce'\nexport * from './hooks/usePrev'\nexport * from './hooks/useIsomorphicLayoutEffect'\nexport * from './hooks/useReducedMotion'\n\nexport * from './fluids'\n\nexport { raf } from '@react-spring/rafz'\nexport type { Timeout } from '@react-spring/rafz'\n","import { raf, Rafz } from '@react-spring/rafz'\nimport {\n OneOrMore,\n InterpolatorConfig,\n InterpolatorArgs,\n} from '@react-spring/types'\n\nimport { FluidValue } from './fluids'\nimport type { OpaqueAnimation } from './FrameLoop'\nimport { noop } from './helpers'\n\n//\n// Required\n//\n\nexport let createStringInterpolator: (\n config: InterpolatorConfig<string>\n) => (input: number) => string\n\n//\n// Optional\n//\n\nexport let to: <Input, Output>(\n source: OneOrMore<FluidValue>,\n args: InterpolatorArgs<Input, Output>\n) => FluidValue<Output>\n\nexport let colors = null as { [key: string]: number } | null\n\nexport let skipAnimation = false as boolean\n\nexport let willAdvance: (animation: OpaqueAnimation) => void = noop\n\n//\n// Configuration\n//\n\nexport interface AnimatedGlobals {\n /** Returns a new `Interpolation` object */\n to?: typeof to\n /** Used to measure frame length. Read more [here](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) */\n now?: typeof raf.now\n /** Provide custom color names for interpolation */\n colors?: typeof colors\n /** Make all animations instant and skip the frameloop entirely */\n skipAnimation?: typeof skipAnimation\n /** Provide custom logic for string interpolation */\n createStringInterpolator?: typeof createStringInterpolator\n /** Schedule a function to run on the next frame */\n requestAnimationFrame?: (cb: () => void) => void\n /** Event props are called with `batchedUpdates` to reduce extraneous renders */\n batchedUpdates?: typeof raf.batchedUpdates\n /** @internal Exposed for testing purposes */\n willAdvance?: typeof willAdvance\n /** sets the global frameLoop setting for the global raf instance */\n frameLoop?: Rafz['frameLoop']\n}\n\nexport const assign = (globals: AnimatedGlobals) => {\n if (globals.to) to = globals.to\n if (globals.now) raf.now = globals.now\n if (globals.colors !== undefined) colors = globals.colors\n if (globals.skipAnimation != null) skipAnimation = globals.skipAnimation\n if (globals.createStringInterpolator)\n createStringInterpolator = globals.creat
|