@codellyson/framely 0.1.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/AbsoluteFill.d.ts +18 -0
- package/dist/AbsoluteFill.d.ts.map +1 -0
- package/dist/AbsoluteFill.js +25 -0
- package/dist/AbsoluteFill.js.map +1 -0
- package/dist/Audio.d.ts +80 -0
- package/dist/Audio.d.ts.map +1 -0
- package/dist/Audio.js +221 -0
- package/dist/Audio.js.map +1 -0
- package/dist/Composition.d.ts +208 -0
- package/dist/Composition.d.ts.map +1 -0
- package/dist/Composition.js +210 -0
- package/dist/Composition.js.map +1 -0
- package/dist/Easing.d.ts +88 -0
- package/dist/Easing.d.ts.map +1 -0
- package/dist/Easing.js +266 -0
- package/dist/Easing.js.map +1 -0
- package/dist/ErrorBoundary.d.ts +35 -0
- package/dist/ErrorBoundary.d.ts.map +1 -0
- package/dist/ErrorBoundary.js +74 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/Folder.d.ts +46 -0
- package/dist/Folder.d.ts.map +1 -0
- package/dist/Folder.js +44 -0
- package/dist/Folder.js.map +1 -0
- package/dist/Freeze.d.ts +35 -0
- package/dist/Freeze.d.ts.map +1 -0
- package/dist/Freeze.js +40 -0
- package/dist/Freeze.js.map +1 -0
- package/dist/IFrame.d.ts +28 -0
- package/dist/IFrame.d.ts.map +1 -0
- package/dist/IFrame.js +57 -0
- package/dist/IFrame.js.map +1 -0
- package/dist/Img.d.ts +36 -0
- package/dist/Img.d.ts.map +1 -0
- package/dist/Img.js +91 -0
- package/dist/Img.js.map +1 -0
- package/dist/Loop.d.ts +66 -0
- package/dist/Loop.d.ts.map +1 -0
- package/dist/Loop.js +79 -0
- package/dist/Loop.js.map +1 -0
- package/dist/Player.d.ts +118 -0
- package/dist/Player.d.ts.map +1 -0
- package/dist/Player.js +311 -0
- package/dist/Player.js.map +1 -0
- package/dist/Sequence.d.ts +25 -0
- package/dist/Sequence.d.ts.map +1 -0
- package/dist/Sequence.js +37 -0
- package/dist/Sequence.js.map +1 -0
- package/dist/Series.d.ts +52 -0
- package/dist/Series.d.ts.map +1 -0
- package/dist/Series.js +86 -0
- package/dist/Series.js.map +1 -0
- package/dist/Text.d.ts +129 -0
- package/dist/Text.d.ts.map +1 -0
- package/dist/Text.js +211 -0
- package/dist/Text.js.map +1 -0
- package/dist/Video.d.ts +75 -0
- package/dist/Video.d.ts.map +1 -0
- package/dist/Video.js +136 -0
- package/dist/Video.js.map +1 -0
- package/dist/config.d.ts +128 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +243 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +84 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +131 -0
- package/dist/context.js.map +1 -0
- package/dist/delayRender.d.ts +130 -0
- package/dist/delayRender.d.ts.map +1 -0
- package/dist/delayRender.js +197 -0
- package/dist/delayRender.js.map +1 -0
- package/dist/getInputProps.d.ts +118 -0
- package/dist/getInputProps.d.ts.map +1 -0
- package/dist/getInputProps.js +181 -0
- package/dist/getInputProps.js.map +1 -0
- package/dist/hooks/useDelayRender.d.ts +52 -0
- package/dist/hooks/useDelayRender.d.ts.map +1 -0
- package/dist/hooks/useDelayRender.js +92 -0
- package/dist/hooks/useDelayRender.js.map +1 -0
- package/dist/hooks.d.ts +19 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +17 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/interpolate.d.ts +80 -0
- package/dist/interpolate.d.ts.map +1 -0
- package/dist/interpolate.js +108 -0
- package/dist/interpolate.js.map +1 -0
- package/dist/interpolateColors.d.ts +50 -0
- package/dist/interpolateColors.d.ts.map +1 -0
- package/dist/interpolateColors.js +300 -0
- package/dist/interpolateColors.js.map +1 -0
- package/dist/makeTransform.d.ts +98 -0
- package/dist/makeTransform.d.ts.map +1 -0
- package/dist/makeTransform.js +287 -0
- package/dist/makeTransform.js.map +1 -0
- package/dist/measureSpring.d.ts +75 -0
- package/dist/measureSpring.d.ts.map +1 -0
- package/dist/measureSpring.js +108 -0
- package/dist/measureSpring.js.map +1 -0
- package/dist/noise.d.ts +110 -0
- package/dist/noise.d.ts.map +1 -0
- package/dist/noise.js +228 -0
- package/dist/noise.js.map +1 -0
- package/dist/preload.d.ts +145 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +225 -0
- package/dist/preload.js.map +1 -0
- package/dist/registerRoot.d.ts +140 -0
- package/dist/registerRoot.d.ts.map +1 -0
- package/dist/registerRoot.js +238 -0
- package/dist/registerRoot.js.map +1 -0
- package/dist/shapes/Circle.d.ts +15 -0
- package/dist/shapes/Circle.d.ts.map +1 -0
- package/dist/shapes/Circle.js +11 -0
- package/dist/shapes/Circle.js.map +1 -0
- package/dist/shapes/Ellipse.d.ts +16 -0
- package/dist/shapes/Ellipse.d.ts.map +1 -0
- package/dist/shapes/Ellipse.js +11 -0
- package/dist/shapes/Ellipse.js.map +1 -0
- package/dist/shapes/Line.d.ts +15 -0
- package/dist/shapes/Line.d.ts.map +1 -0
- package/dist/shapes/Line.js +11 -0
- package/dist/shapes/Line.js.map +1 -0
- package/dist/shapes/Path.d.ts +20 -0
- package/dist/shapes/Path.d.ts.map +1 -0
- package/dist/shapes/Path.js +14 -0
- package/dist/shapes/Path.js.map +1 -0
- package/dist/shapes/Polygon.d.ts +15 -0
- package/dist/shapes/Polygon.d.ts.map +1 -0
- package/dist/shapes/Polygon.js +16 -0
- package/dist/shapes/Polygon.js.map +1 -0
- package/dist/shapes/Rect.d.ts +18 -0
- package/dist/shapes/Rect.d.ts.map +1 -0
- package/dist/shapes/Rect.js +11 -0
- package/dist/shapes/Rect.js.map +1 -0
- package/dist/shapes/Svg.d.ts +16 -0
- package/dist/shapes/Svg.d.ts.map +1 -0
- package/dist/shapes/Svg.js +15 -0
- package/dist/shapes/Svg.js.map +1 -0
- package/dist/shapes/index.d.ts +16 -0
- package/dist/shapes/index.d.ts.map +1 -0
- package/dist/shapes/index.js +9 -0
- package/dist/shapes/index.js.map +1 -0
- package/dist/shapes/usePathLength.d.ts +24 -0
- package/dist/shapes/usePathLength.d.ts.map +1 -0
- package/dist/shapes/usePathLength.js +32 -0
- package/dist/shapes/usePathLength.js.map +1 -0
- package/dist/staticFile.d.ts +47 -0
- package/dist/staticFile.d.ts.map +1 -0
- package/dist/staticFile.js +105 -0
- package/dist/staticFile.js.map +1 -0
- package/dist/templates/api.d.ts +26 -0
- package/dist/templates/api.d.ts.map +1 -0
- package/dist/templates/api.js +142 -0
- package/dist/templates/api.js.map +1 -0
- package/dist/templates/index.d.ts +7 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +7 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/mockData.d.ts +7 -0
- package/dist/templates/mockData.d.ts.map +1 -0
- package/dist/templates/mockData.js +262 -0
- package/dist/templates/mockData.js.map +1 -0
- package/dist/templates/types.d.ts +104 -0
- package/dist/templates/types.d.ts.map +1 -0
- package/dist/templates/types.js +16 -0
- package/dist/templates/types.js.map +1 -0
- package/dist/transitions/TransitionSeries.d.ts +127 -0
- package/dist/transitions/TransitionSeries.d.ts.map +1 -0
- package/dist/transitions/TransitionSeries.js +190 -0
- package/dist/transitions/TransitionSeries.js.map +1 -0
- package/dist/transitions/index.d.ts +52 -0
- package/dist/transitions/index.d.ts.map +1 -0
- package/dist/transitions/index.js +31 -0
- package/dist/transitions/index.js.map +1 -0
- package/dist/transitions/presets/fade.d.ts +45 -0
- package/dist/transitions/presets/fade.d.ts.map +1 -0
- package/dist/transitions/presets/fade.js +56 -0
- package/dist/transitions/presets/fade.js.map +1 -0
- package/dist/transitions/presets/flip.d.ts +99 -0
- package/dist/transitions/presets/flip.d.ts.map +1 -0
- package/dist/transitions/presets/flip.js +153 -0
- package/dist/transitions/presets/flip.js.map +1 -0
- package/dist/transitions/presets/slide.d.ts +61 -0
- package/dist/transitions/presets/slide.d.ts.map +1 -0
- package/dist/transitions/presets/slide.js +116 -0
- package/dist/transitions/presets/slide.js.map +1 -0
- package/dist/transitions/presets/wipe.d.ts +69 -0
- package/dist/transitions/presets/wipe.d.ts.map +1 -0
- package/dist/transitions/presets/wipe.js +136 -0
- package/dist/transitions/presets/wipe.js.map +1 -0
- package/dist/transitions/presets/zoom.d.ts +76 -0
- package/dist/transitions/presets/zoom.d.ts.map +1 -0
- package/dist/transitions/presets/zoom.js +110 -0
- package/dist/transitions/presets/zoom.js.map +1 -0
- package/dist/useAudioData.d.ts +112 -0
- package/dist/useAudioData.d.ts.map +1 -0
- package/dist/useAudioData.js +183 -0
- package/dist/useAudioData.js.map +1 -0
- package/dist/useSpring.d.ts +79 -0
- package/dist/useSpring.d.ts.map +1 -0
- package/dist/useSpring.js +140 -0
- package/dist/useSpring.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* TransitionSeries Component
|
|
4
|
+
*
|
|
5
|
+
* A container for sequences with transitions between them.
|
|
6
|
+
* Unlike Series, TransitionSeries supports animated transitions
|
|
7
|
+
* that can overlap between consecutive sequences.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <TransitionSeries>
|
|
11
|
+
* <TransitionSeries.Sequence durationInFrames={60}>
|
|
12
|
+
* <SceneA />
|
|
13
|
+
* </TransitionSeries.Sequence>
|
|
14
|
+
* <TransitionSeries.Transition
|
|
15
|
+
* presentation={fade()}
|
|
16
|
+
* timing={{ durationInFrames: 30 }}
|
|
17
|
+
* />
|
|
18
|
+
* <TransitionSeries.Sequence durationInFrames={60}>
|
|
19
|
+
* <SceneB />
|
|
20
|
+
* </TransitionSeries.Sequence>
|
|
21
|
+
* </TransitionSeries>
|
|
22
|
+
*/
|
|
23
|
+
import React, { createContext, useContext, useMemo, Children, } from 'react';
|
|
24
|
+
import { useTimeline, TimelineContext } from '../context';
|
|
25
|
+
import { AbsoluteFill } from '../AbsoluteFill';
|
|
26
|
+
// ─── Context ─────────────────────────────────────────────────────────────────
|
|
27
|
+
const TransitionContext = createContext({
|
|
28
|
+
entering: false,
|
|
29
|
+
exiting: false,
|
|
30
|
+
progress: 0,
|
|
31
|
+
presentationDirection: 'entering',
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Hook to access transition state from within a sequence.
|
|
35
|
+
*/
|
|
36
|
+
export function useTransition() {
|
|
37
|
+
return useContext(TransitionContext);
|
|
38
|
+
}
|
|
39
|
+
// ─── TransitionSeries ────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* TransitionSeries - Container for sequences with transitions.
|
|
42
|
+
*/
|
|
43
|
+
const TransitionSeries = function TransitionSeries({ children, style, name, }) {
|
|
44
|
+
const parent = useTimeline();
|
|
45
|
+
const childArray = Children.toArray(children);
|
|
46
|
+
// Parse children into sequences and transitions
|
|
47
|
+
const { sequences, transitions } = useMemo(() => {
|
|
48
|
+
const seqs = [];
|
|
49
|
+
const trans = [];
|
|
50
|
+
childArray.forEach((child, index) => {
|
|
51
|
+
if (React.isValidElement(child) &&
|
|
52
|
+
child.type?.displayName ===
|
|
53
|
+
'TransitionSeries.Sequence') {
|
|
54
|
+
seqs.push({
|
|
55
|
+
element: child,
|
|
56
|
+
index,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else if (React.isValidElement(child) &&
|
|
60
|
+
child.type?.displayName ===
|
|
61
|
+
'TransitionSeries.Transition') {
|
|
62
|
+
trans.push({
|
|
63
|
+
element: child,
|
|
64
|
+
afterSequenceIndex: seqs.length - 1,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return { sequences: seqs, transitions: trans };
|
|
69
|
+
}, [childArray]);
|
|
70
|
+
// Calculate timing for each sequence considering transitions
|
|
71
|
+
const timings = useMemo(() => {
|
|
72
|
+
let currentFrame = 0;
|
|
73
|
+
const result = [];
|
|
74
|
+
sequences.forEach((seq, seqIndex) => {
|
|
75
|
+
const duration = seq.element.props.durationInFrames ?? 0;
|
|
76
|
+
const offset = seq.element.props.offset ?? 0;
|
|
77
|
+
// Find transition before this sequence
|
|
78
|
+
const transitionBefore = transitions.find((t) => t.afterSequenceIndex === seqIndex - 1);
|
|
79
|
+
const transitionAfter = transitions.find((t) => t.afterSequenceIndex === seqIndex);
|
|
80
|
+
// Transition overlap reduces the start time
|
|
81
|
+
const overlapBefore = transitionBefore?.element.props.timing?.durationInFrames ?? 0;
|
|
82
|
+
const overlapAfter = transitionAfter?.element.props.timing?.durationInFrames ?? 0;
|
|
83
|
+
const startFrame = currentFrame + offset - (seqIndex > 0 ? overlapBefore : 0);
|
|
84
|
+
result.push({
|
|
85
|
+
startFrame,
|
|
86
|
+
duration,
|
|
87
|
+
overlapBefore,
|
|
88
|
+
overlapAfter,
|
|
89
|
+
transitionBefore: transitionBefore?.element.props,
|
|
90
|
+
transitionAfter: transitionAfter?.element.props,
|
|
91
|
+
});
|
|
92
|
+
// Next sequence starts after this one (minus any overlap)
|
|
93
|
+
currentFrame = startFrame + duration;
|
|
94
|
+
});
|
|
95
|
+
return result;
|
|
96
|
+
}, [sequences, transitions]);
|
|
97
|
+
// Render sequences with transition effects
|
|
98
|
+
return (_jsx(AbsoluteFill, { style: style, "data-transition-series": name, children: sequences.map((seq, seqIndex) => {
|
|
99
|
+
const timing = timings[seqIndex];
|
|
100
|
+
const { startFrame, duration, overlapBefore, overlapAfter, transitionBefore, transitionAfter, } = timing;
|
|
101
|
+
// Check if this sequence is currently visible
|
|
102
|
+
const relativeFrame = parent.frame - startFrame;
|
|
103
|
+
const isVisible = relativeFrame >= -overlapBefore &&
|
|
104
|
+
relativeFrame < duration + overlapAfter;
|
|
105
|
+
if (!isVisible)
|
|
106
|
+
return null;
|
|
107
|
+
// Calculate transition states
|
|
108
|
+
const enteringProgress = transitionBefore
|
|
109
|
+
? Math.min(1, Math.max(0, relativeFrame / overlapBefore))
|
|
110
|
+
: 1;
|
|
111
|
+
const exitingProgress = transitionAfter
|
|
112
|
+
? Math.min(1, Math.max(0, (relativeFrame - (duration - overlapAfter)) / overlapAfter))
|
|
113
|
+
: 0;
|
|
114
|
+
const isEntering = enteringProgress < 1;
|
|
115
|
+
const isExiting = exitingProgress > 0;
|
|
116
|
+
// Determine presentation
|
|
117
|
+
let presentationStyle = {};
|
|
118
|
+
let presentationDirection = 'stable';
|
|
119
|
+
if (isEntering && transitionBefore?.presentation) {
|
|
120
|
+
presentationDirection = 'entering';
|
|
121
|
+
presentationStyle =
|
|
122
|
+
transitionBefore.presentation.entering?.(enteringProgress) ?? {};
|
|
123
|
+
}
|
|
124
|
+
else if (isExiting && transitionAfter?.presentation) {
|
|
125
|
+
presentationDirection = 'exiting';
|
|
126
|
+
presentationStyle =
|
|
127
|
+
transitionAfter.presentation.exiting?.(exitingProgress) ?? {};
|
|
128
|
+
}
|
|
129
|
+
const transitionState = {
|
|
130
|
+
entering: isEntering,
|
|
131
|
+
exiting: isExiting,
|
|
132
|
+
progress: isEntering
|
|
133
|
+
? enteringProgress
|
|
134
|
+
: isExiting
|
|
135
|
+
? exitingProgress
|
|
136
|
+
: 1,
|
|
137
|
+
presentationDirection,
|
|
138
|
+
};
|
|
139
|
+
// Create modified timeline context for this sequence
|
|
140
|
+
const sequenceFrame = Math.max(0, Math.min(duration - 1, relativeFrame));
|
|
141
|
+
const contextValue = {
|
|
142
|
+
...parent,
|
|
143
|
+
frame: sequenceFrame,
|
|
144
|
+
durationInFrames: duration,
|
|
145
|
+
};
|
|
146
|
+
return (_jsx(TransitionContext.Provider, { value: transitionState, children: _jsx(TimelineContext.Provider, { value: contextValue, children: _jsx(AbsoluteFill, { style: {
|
|
147
|
+
...presentationStyle,
|
|
148
|
+
zIndex: seqIndex,
|
|
149
|
+
}, children: seq.element.props.children }) }) }, seqIndex));
|
|
150
|
+
}) }));
|
|
151
|
+
};
|
|
152
|
+
TransitionSeries.displayName = 'TransitionSeries';
|
|
153
|
+
// ─── TransitionSeries.Sequence ───────────────────────────────────────────────
|
|
154
|
+
/**
|
|
155
|
+
* TransitionSeries.Sequence - A scene within a TransitionSeries.
|
|
156
|
+
* This component is used for configuration only.
|
|
157
|
+
* The actual rendering is handled by TransitionSeries.
|
|
158
|
+
*/
|
|
159
|
+
const TransitionSequence = function TransitionSequence(_props) {
|
|
160
|
+
return null;
|
|
161
|
+
};
|
|
162
|
+
TransitionSequence.displayName = 'TransitionSeries.Sequence';
|
|
163
|
+
TransitionSeries.Sequence = TransitionSequence;
|
|
164
|
+
// ─── TransitionSeries.Transition ─────────────────────────────────────────────
|
|
165
|
+
/**
|
|
166
|
+
* TransitionSeries.Transition - Defines a transition between sequences.
|
|
167
|
+
* This component is used for configuration only.
|
|
168
|
+
* The actual rendering is handled by TransitionSeries.
|
|
169
|
+
*/
|
|
170
|
+
const TransitionTransition = function TransitionTransition(_props) {
|
|
171
|
+
return null;
|
|
172
|
+
};
|
|
173
|
+
TransitionTransition.displayName = 'TransitionSeries.Transition';
|
|
174
|
+
TransitionSeries.Transition = TransitionTransition;
|
|
175
|
+
// ─── Helper functions ────────────────────────────────────────────────────────
|
|
176
|
+
/**
|
|
177
|
+
* Helper to create a transition presentation object.
|
|
178
|
+
*/
|
|
179
|
+
export function createPresentation(config) {
|
|
180
|
+
return { entering: config.entering, exiting: config.exiting };
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Helper to create transition timing.
|
|
184
|
+
*/
|
|
185
|
+
export function createTiming(config) {
|
|
186
|
+
return { durationInFrames: config.durationInFrames, easing: config.easing };
|
|
187
|
+
}
|
|
188
|
+
export { TransitionSeries };
|
|
189
|
+
export default TransitionSeries;
|
|
190
|
+
//# sourceMappingURL=TransitionSeries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransitionSeries.js","sourceRoot":"","sources":["../../src/trans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AAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAC9E,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transitions Package
|
|
3
|
+
*
|
|
4
|
+
* Provides TransitionSeries component and built-in transition presets.
|
|
5
|
+
*/
|
|
6
|
+
export { default as TransitionSeries, useTransition, createPresentation, createTiming, } from './TransitionSeries';
|
|
7
|
+
export { fade, crossfade } from './presets/fade';
|
|
8
|
+
export { slide, slideFromLeft, slideFromRight, slideFromTop, slideFromBottom, push, } from './presets/slide';
|
|
9
|
+
export { wipe, wipeLeft, wipeRight, wipeTop, wipeBottom, iris, diagonalWipe, } from './presets/wipe';
|
|
10
|
+
export { zoom, zoomInOut, zoomOutIn, kenBurns, zoomRotate, } from './presets/zoom';
|
|
11
|
+
export { flip, flipHorizontal, flipVertical, cardFlip, cube, door, } from './presets/flip';
|
|
12
|
+
export type { SlideDirection, SlideOptions, TransitionStyle, TransitionResult } from './presets/slide';
|
|
13
|
+
export type { FadeStyle, FadeOptions, FadeTransitionStyle, FadeTransitionResult } from './presets/fade';
|
|
14
|
+
export type { FlipDirection, CardFlipDirection, CubeDirection, DoorSide, FlipOptions, CardFlipOptions, CubeOptions, DoorOptions, FlipTransitionStyle, FlipTransitionResult, CubeTransitionStyle, CubeTransitionResult, DoorTransitionStyle, DoorTransitionResult, } from './presets/flip';
|
|
15
|
+
export type { WipeDirection, DiagonalCorner, WipeOptions, DiagonalWipeOptions, WipeTransitionStyle, WipeTransitionResult, } from './presets/wipe';
|
|
16
|
+
export type { ZoomDirection, ZoomOptions, KenBurnsOptions, ZoomRotateOptions, ZoomTransitionStyle, ZoomTransitionResult, KenBurnsStyle, } from './presets/zoom';
|
|
17
|
+
export type { TransitionPresentation } from './presets/slide';
|
|
18
|
+
import * as fadePresets from './presets/fade';
|
|
19
|
+
import * as slidePresets from './presets/slide';
|
|
20
|
+
import * as wipePresets from './presets/wipe';
|
|
21
|
+
import * as zoomPresets from './presets/zoom';
|
|
22
|
+
import * as flipPresets from './presets/flip';
|
|
23
|
+
export declare const presets: {
|
|
24
|
+
flip(options?: flipPresets.FlipOptions): flipPresets.FlipTransitionResult;
|
|
25
|
+
flipHorizontal(options?: Omit<flipPresets.FlipOptions, "direction">): flipPresets.FlipTransitionResult;
|
|
26
|
+
flipVertical(options?: Omit<flipPresets.FlipOptions, "direction">): flipPresets.FlipTransitionResult;
|
|
27
|
+
cardFlip(options?: flipPresets.CardFlipOptions): flipPresets.FlipTransitionResult;
|
|
28
|
+
cube(options?: flipPresets.CubeOptions): flipPresets.CubeTransitionResult;
|
|
29
|
+
door(options?: flipPresets.DoorOptions): flipPresets.DoorTransitionResult;
|
|
30
|
+
default: typeof flipPresets.flip;
|
|
31
|
+
zoom(options?: zoomPresets.ZoomOptions): zoomPresets.ZoomTransitionResult;
|
|
32
|
+
zoomInOut(options?: Omit<zoomPresets.ZoomOptions, "enterDirection" | "exitDirection">): zoomPresets.ZoomTransitionResult;
|
|
33
|
+
zoomOutIn(options?: Omit<zoomPresets.ZoomOptions, "enterDirection" | "exitDirection">): zoomPresets.ZoomTransitionResult;
|
|
34
|
+
kenBurns(options?: zoomPresets.KenBurnsOptions): (progress: number) => zoomPresets.KenBurnsStyle;
|
|
35
|
+
zoomRotate(options?: zoomPresets.ZoomRotateOptions): zoomPresets.ZoomTransitionResult;
|
|
36
|
+
wipe(options?: wipePresets.WipeOptions): wipePresets.WipeTransitionResult;
|
|
37
|
+
wipeLeft(options?: Omit<wipePresets.WipeOptions, "direction">): wipePresets.WipeTransitionResult;
|
|
38
|
+
wipeRight(options?: Omit<wipePresets.WipeOptions, "direction">): wipePresets.WipeTransitionResult;
|
|
39
|
+
wipeTop(options?: Omit<wipePresets.WipeOptions, "direction">): wipePresets.WipeTransitionResult;
|
|
40
|
+
wipeBottom(options?: Omit<wipePresets.WipeOptions, "direction">): wipePresets.WipeTransitionResult;
|
|
41
|
+
iris(options?: Omit<wipePresets.WipeOptions, "direction">): wipePresets.WipeTransitionResult;
|
|
42
|
+
diagonalWipe(options?: wipePresets.DiagonalWipeOptions): wipePresets.WipeTransitionResult;
|
|
43
|
+
slide(options?: slidePresets.SlideOptions): slidePresets.TransitionResult;
|
|
44
|
+
slideFromLeft(options?: Omit<slidePresets.SlideOptions, "direction">): slidePresets.TransitionResult;
|
|
45
|
+
slideFromRight(options?: Omit<slidePresets.SlideOptions, "direction">): slidePresets.TransitionResult;
|
|
46
|
+
slideFromTop(options?: Omit<slidePresets.SlideOptions, "direction">): slidePresets.TransitionResult;
|
|
47
|
+
slideFromBottom(options?: Omit<slidePresets.SlideOptions, "direction">): slidePresets.TransitionResult;
|
|
48
|
+
push(options?: Omit<slidePresets.SlideOptions, "exitOpposite">): slidePresets.TransitionResult;
|
|
49
|
+
fade(options?: fadePresets.FadeOptions): fadePresets.FadeTransitionResult;
|
|
50
|
+
crossfade(options?: Omit<fadePresets.FadeOptions, "enterStyle" | "exitStyle">): fadePresets.FadeTransitionResult;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,aAAa,EACb,kBAAkB,EAClB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,IAAI,GACL,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,IAAI,EACJ,YAAY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+1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transitions Package
|
|
3
|
+
*
|
|
4
|
+
* Provides TransitionSeries component and built-in transition presets.
|
|
5
|
+
*/
|
|
6
|
+
// Main component
|
|
7
|
+
export { default as TransitionSeries, useTransition, createPresentation, createTiming, } from './TransitionSeries';
|
|
8
|
+
// Fade transitions
|
|
9
|
+
export { fade, crossfade } from './presets/fade';
|
|
10
|
+
// Slide transitions
|
|
11
|
+
export { slide, slideFromLeft, slideFromRight, slideFromTop, slideFromBottom, push, } from './presets/slide';
|
|
12
|
+
// Wipe transitions
|
|
13
|
+
export { wipe, wipeLeft, wipeRight, wipeTop, wipeBottom, iris, diagonalWipe, } from './presets/wipe';
|
|
14
|
+
// Zoom transitions
|
|
15
|
+
export { zoom, zoomInOut, zoomOutIn, kenBurns, zoomRotate, } from './presets/zoom';
|
|
16
|
+
// Flip transitions
|
|
17
|
+
export { flip, flipHorizontal, flipVertical, cardFlip, cube, door, } from './presets/flip';
|
|
18
|
+
// Re-export presets as namespace
|
|
19
|
+
import * as fadePresets from './presets/fade';
|
|
20
|
+
import * as slidePresets from './presets/slide';
|
|
21
|
+
import * as wipePresets from './presets/wipe';
|
|
22
|
+
import * as zoomPresets from './presets/zoom';
|
|
23
|
+
import * as flipPresets from './presets/flip';
|
|
24
|
+
export const presets = {
|
|
25
|
+
...fadePresets,
|
|
26
|
+
...slidePresets,
|
|
27
|
+
...wipePresets,
|
|
28
|
+
...zoomPresets,
|
|
29
|
+
...flipPresets,
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iBAAiB;AACjB,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,aAAa,EACb,kBAAkB,EAClB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,mBAAmB;AACnB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjD,oBAAoB;AACpB,OAAO,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,IAAI,GACL,MAAM,iBAAiB,CAAC;AAEzB,mBAAmB;AACnB,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,IAAI,EACJ,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,mBAAmB;AACnB,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB,mBAAmB;AACnB,OAAO,EACL,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,IAAI,GACL,MAAM,gBAAgB,CAAC;AAwCxB,iCAAiC;AACjC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,WAAW;IACd,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,WAAW;IACd,GAAG,WAAW;CACf,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fade Transition
|
|
3
|
+
*
|
|
4
|
+
* Simple opacity-based transition between scenes.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* <TransitionSeries.Transition
|
|
8
|
+
* presentation={fade()}
|
|
9
|
+
* timing={{ durationInFrames: 30 }}
|
|
10
|
+
* />
|
|
11
|
+
*
|
|
12
|
+
* // With custom options
|
|
13
|
+
* <TransitionSeries.Transition
|
|
14
|
+
* presentation={fade({ enterStyle: 'in', exitStyle: 'out' })}
|
|
15
|
+
* timing={{ durationInFrames: 30 }}
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
18
|
+
import { EasingFunction } from '../../Easing';
|
|
19
|
+
export type FadeStyle = 'in' | 'out' | 'both';
|
|
20
|
+
export interface TransitionPresentation {
|
|
21
|
+
style: React.CSSProperties;
|
|
22
|
+
transform?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FadeOptions {
|
|
25
|
+
enterStyle?: FadeStyle;
|
|
26
|
+
exitStyle?: FadeStyle;
|
|
27
|
+
easing?: EasingFunction;
|
|
28
|
+
}
|
|
29
|
+
export interface FadeTransitionStyle {
|
|
30
|
+
opacity: number;
|
|
31
|
+
}
|
|
32
|
+
export interface FadeTransitionResult {
|
|
33
|
+
entering: (progress: number) => FadeTransitionStyle;
|
|
34
|
+
exiting: (progress: number) => FadeTransitionStyle;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a fade transition presentation.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fade(options?: FadeOptions): FadeTransitionResult;
|
|
40
|
+
/**
|
|
41
|
+
* Crossfade - both scenes fade simultaneously.
|
|
42
|
+
*/
|
|
43
|
+
export declare function crossfade(options?: Omit<FadeOptions, 'enterStyle' | 'exitStyle'>): FadeTransitionResult;
|
|
44
|
+
export default fade;
|
|
45
|
+
//# sourceMappingURL=fade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../../src/transitions/presets/fade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAU,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,mBAAmB,CAAC;IACpD,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,mBAAmB,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,oBAAoB,CAkCpE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,WAAW,CAAM,GAAG,oBAAoB,CAE3G;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fade Transition
|
|
3
|
+
*
|
|
4
|
+
* Simple opacity-based transition between scenes.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* <TransitionSeries.Transition
|
|
8
|
+
* presentation={fade()}
|
|
9
|
+
* timing={{ durationInFrames: 30 }}
|
|
10
|
+
* />
|
|
11
|
+
*
|
|
12
|
+
* // With custom options
|
|
13
|
+
* <TransitionSeries.Transition
|
|
14
|
+
* presentation={fade({ enterStyle: 'in', exitStyle: 'out' })}
|
|
15
|
+
* timing={{ durationInFrames: 30 }}
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
18
|
+
import { Easing } from '../../Easing';
|
|
19
|
+
/**
|
|
20
|
+
* Create a fade transition presentation.
|
|
21
|
+
*/
|
|
22
|
+
export function fade(options = {}) {
|
|
23
|
+
const { enterStyle = 'in', exitStyle = 'out', easing = Easing.ease, } = options;
|
|
24
|
+
return {
|
|
25
|
+
entering: (progress) => {
|
|
26
|
+
const easedProgress = easing(progress);
|
|
27
|
+
if (enterStyle === 'in') {
|
|
28
|
+
return { opacity: easedProgress };
|
|
29
|
+
}
|
|
30
|
+
if (enterStyle === 'out') {
|
|
31
|
+
return { opacity: 1 - easedProgress };
|
|
32
|
+
}
|
|
33
|
+
// both - crossfade
|
|
34
|
+
return { opacity: easedProgress };
|
|
35
|
+
},
|
|
36
|
+
exiting: (progress) => {
|
|
37
|
+
const easedProgress = easing(progress);
|
|
38
|
+
if (exitStyle === 'out') {
|
|
39
|
+
return { opacity: 1 - easedProgress };
|
|
40
|
+
}
|
|
41
|
+
if (exitStyle === 'in') {
|
|
42
|
+
return { opacity: easedProgress };
|
|
43
|
+
}
|
|
44
|
+
// both - crossfade
|
|
45
|
+
return { opacity: 1 - easedProgress };
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Crossfade - both scenes fade simultaneously.
|
|
51
|
+
*/
|
|
52
|
+
export function crossfade(options = {}) {
|
|
53
|
+
return fade({ ...options, enterStyle: 'both', exitStyle: 'both' });
|
|
54
|
+
}
|
|
55
|
+
export default fade;
|
|
56
|
+
//# sourceMappingURL=fade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fade.js","sourceRoot":"","sources":["../../../src/transitions/presets/fade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAC;AAwBtD;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,UAAuB,EAAE;IAC5C,MAAM,EACJ,UAAU,GAAG,IAAI,EACjB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,MAAM,CAAC,IAAI,GACrB,GAAG,OAAO,CAAC;IAEZ,OAAO;QACL,QAAQ,EAAE,CAAC,QAAgB,EAAuB,EAAE;YAClD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvC,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YACpC,CAAC;YACD,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;gBACzB,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC;YACxC,CAAC;YACD,mBAAmB;YACnB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;QACpC,CAAC;QAED,OAAO,EAAE,CAAC,QAAgB,EAAuB,EAAE;YACjD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvC,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBACxB,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC;YACxC,CAAC;YACD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACvB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YACpC,CAAC;YACD,mBAAmB;YACnB,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,UAAyD,EAAE;IACnF,OAAO,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flip Transition
|
|
3
|
+
*
|
|
4
|
+
* 3D flip/rotation transition between scenes.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* <TransitionSeries.Transition
|
|
8
|
+
* presentation={flip()}
|
|
9
|
+
* timing={{ durationInFrames: 30 }}
|
|
10
|
+
* />
|
|
11
|
+
*
|
|
12
|
+
* // Flip vertically
|
|
13
|
+
* <TransitionSeries.Transition
|
|
14
|
+
* presentation={flip({ direction: 'vertical' })}
|
|
15
|
+
* timing={{ durationInFrames: 30 }}
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
18
|
+
import { EasingFunction } from '../../Easing';
|
|
19
|
+
export type FlipDirection = 'horizontal' | 'vertical';
|
|
20
|
+
export type CardFlipDirection = 'left' | 'right' | 'up' | 'down';
|
|
21
|
+
export type CubeDirection = 'left' | 'right' | 'up' | 'down';
|
|
22
|
+
export type DoorSide = 'left' | 'right';
|
|
23
|
+
export interface TransitionPresentation {
|
|
24
|
+
style: React.CSSProperties;
|
|
25
|
+
transform?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface FlipOptions {
|
|
28
|
+
direction?: FlipDirection;
|
|
29
|
+
perspective?: number;
|
|
30
|
+
easing?: EasingFunction;
|
|
31
|
+
}
|
|
32
|
+
export interface CardFlipOptions {
|
|
33
|
+
flipDirection?: CardFlipDirection;
|
|
34
|
+
perspective?: number;
|
|
35
|
+
easing?: EasingFunction;
|
|
36
|
+
}
|
|
37
|
+
export interface CubeOptions {
|
|
38
|
+
direction?: CubeDirection;
|
|
39
|
+
perspective?: number;
|
|
40
|
+
easing?: EasingFunction;
|
|
41
|
+
}
|
|
42
|
+
export interface DoorOptions {
|
|
43
|
+
side?: DoorSide;
|
|
44
|
+
perspective?: number;
|
|
45
|
+
easing?: EasingFunction;
|
|
46
|
+
}
|
|
47
|
+
export interface FlipTransitionStyle {
|
|
48
|
+
transform: string;
|
|
49
|
+
backfaceVisibility: string;
|
|
50
|
+
opacity?: number;
|
|
51
|
+
transformStyle?: string;
|
|
52
|
+
transformOrigin?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface FlipTransitionResult {
|
|
55
|
+
entering: (progress: number) => FlipTransitionStyle;
|
|
56
|
+
exiting: (progress: number) => FlipTransitionStyle;
|
|
57
|
+
}
|
|
58
|
+
export interface CubeTransitionStyle {
|
|
59
|
+
transform: string;
|
|
60
|
+
transformOrigin: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CubeTransitionResult {
|
|
63
|
+
entering: (progress: number) => CubeTransitionStyle;
|
|
64
|
+
exiting: (progress: number) => CubeTransitionStyle;
|
|
65
|
+
}
|
|
66
|
+
export interface DoorTransitionStyle {
|
|
67
|
+
transform: string;
|
|
68
|
+
transformOrigin: string;
|
|
69
|
+
}
|
|
70
|
+
export interface DoorTransitionResult {
|
|
71
|
+
entering: (progress: number) => DoorTransitionStyle;
|
|
72
|
+
exiting: (progress: number) => DoorTransitionStyle;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a flip transition presentation.
|
|
76
|
+
*/
|
|
77
|
+
export declare function flip(options?: FlipOptions): FlipTransitionResult;
|
|
78
|
+
/**
|
|
79
|
+
* Horizontal flip (around Y axis).
|
|
80
|
+
*/
|
|
81
|
+
export declare function flipHorizontal(options?: Omit<FlipOptions, 'direction'>): FlipTransitionResult;
|
|
82
|
+
/**
|
|
83
|
+
* Vertical flip (around X axis).
|
|
84
|
+
*/
|
|
85
|
+
export declare function flipVertical(options?: Omit<FlipOptions, 'direction'>): FlipTransitionResult;
|
|
86
|
+
/**
|
|
87
|
+
* Card flip - like flipping a playing card.
|
|
88
|
+
*/
|
|
89
|
+
export declare function cardFlip(options?: CardFlipOptions): FlipTransitionResult;
|
|
90
|
+
/**
|
|
91
|
+
* Cube rotation - scenes appear on faces of a rotating cube.
|
|
92
|
+
*/
|
|
93
|
+
export declare function cube(options?: CubeOptions): CubeTransitionResult;
|
|
94
|
+
/**
|
|
95
|
+
* Door opening effect.
|
|
96
|
+
*/
|
|
97
|
+
export declare function door(options?: DoorOptions): DoorTransitionResult;
|
|
98
|
+
export default flip;
|
|
99
|
+
//# sourceMappingURL=flip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flip.d.ts","sourceRoot":"","sources":["../../../src/transitions/presets/flip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;G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