framer-motion 12.23.5 → 12.23.7
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/client.js +171 -167
- package/dist/cjs/dom.js +4 -1
- package/dist/cjs/{create-Ch9BUY4E.js → feature-bundle-BoyRwN0C.js} +2322 -2340
- package/dist/cjs/index.js +120 -119
- package/dist/cjs/m.js +803 -822
- package/dist/dom.js +1 -1
- package/dist/es/client.mjs +1 -1
- package/dist/es/components/AnimatePresence/PopChild.mjs +0 -1
- package/dist/es/index.mjs +0 -1
- package/dist/es/motion/index.mjs +13 -6
- package/dist/es/motion/utils/use-visual-element.mjs +4 -3
- package/dist/es/motion/utils/use-visual-state.mjs +6 -6
- package/dist/es/render/VisualElement.mjs +5 -2
- package/dist/es/render/components/create-proxy.mjs +14 -7
- package/dist/es/render/components/m/create.mjs +4 -3
- package/dist/es/render/components/m/proxy.mjs +2 -3
- package/dist/es/render/components/motion/create.mjs +6 -12
- package/dist/es/render/components/motion/elements.mjs +165 -165
- package/dist/es/render/components/motion/feature-bundle.mjs +13 -0
- package/dist/es/render/components/motion/proxy.mjs +4 -3
- package/dist/es/render/dom/use-render.mjs +19 -24
- package/dist/es/render/html/{config-motion.mjs → use-html-visual-state.mjs} +6 -8
- package/dist/es/render/svg/{config-motion.mjs → use-svg-visual-state.mjs} +5 -7
- package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -1
- package/dist/framer-motion.dev.js +2372 -2386
- package/dist/framer-motion.js +1 -1
- package/dist/m.d.ts +15 -13
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation-m.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/types/client.d.ts +5 -11
- package/dist/types/index.d.ts +7 -23
- package/dist/{types.d-D0HXPxHm.d.ts → types.d-Bq-Qm38R.d.ts} +263 -264
- package/package.json +4 -4
- package/dist/es/render/components/create-factory.mjs +0 -23
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react';
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
4
|
import * as motion_dom from 'motion-dom';
|
|
6
|
-
import { TransformProperties, MotionNodeOptions, MotionValue, SVGPathProperties,
|
|
5
|
+
import { Transition, TransformProperties, MotionNodeOptions, MotionValue, SVGPathProperties, JSAnimation, ValueTransition, TargetAndTransition, AnyResolvedKeyframe, KeyframeResolver, AnimationDefinition, Batcher } from 'motion-dom';
|
|
7
6
|
import { TransformPoint, Box, Delta, Point, Axis } from 'motion-utils';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
type ReducedMotionConfig = "always" | "never" | "user";
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
interface MotionConfigContext {
|
|
14
|
+
/**
|
|
15
|
+
* Internal, exported only for usage in Framer
|
|
16
|
+
*/
|
|
17
|
+
transformPagePoint: TransformPoint;
|
|
18
|
+
/**
|
|
19
|
+
* Internal. Determines whether this is a static context ie the Framer canvas. If so,
|
|
20
|
+
* it'll disable all dynamic functionality.
|
|
21
|
+
*/
|
|
22
|
+
isStatic: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Defines a new default transition for the entire tree.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
transition?: Transition;
|
|
29
|
+
/**
|
|
30
|
+
* If true, will respect the device prefersReducedMotion setting by switching
|
|
31
|
+
* transform animations off.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
reducedMotion?: ReducedMotionConfig;
|
|
36
|
+
/**
|
|
37
|
+
* A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).
|
|
38
|
+
* For more details see:
|
|
39
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
nonce?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
declare const MotionConfigContext: React$1.Context<MotionConfigContext>;
|
|
8
49
|
|
|
9
50
|
/**
|
|
10
51
|
* Either a string, or array of strings, that reference variants defined via the `variants` prop.
|
|
@@ -55,62 +96,232 @@ interface MotionProps extends MotionNodeOptions {
|
|
|
55
96
|
children?: React.ReactNode | MotionValueNumber | MotionValueString;
|
|
56
97
|
}
|
|
57
98
|
|
|
58
|
-
type ReducedMotionConfig = "always" | "never" | "user";
|
|
59
99
|
/**
|
|
60
100
|
* @public
|
|
61
101
|
*/
|
|
62
|
-
interface
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
102
|
+
interface PresenceContextProps {
|
|
103
|
+
id: string;
|
|
104
|
+
isPresent: boolean;
|
|
105
|
+
register: (id: string | number) => () => void;
|
|
106
|
+
onExitComplete?: (id: string | number) => void;
|
|
107
|
+
initial?: false | VariantLabels;
|
|
108
|
+
custom?: any;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
declare const PresenceContext: React$1.Context<PresenceContextProps | null>;
|
|
114
|
+
|
|
115
|
+
interface VisualState<Instance, RenderState> {
|
|
116
|
+
renderState: RenderState;
|
|
117
|
+
latestValues: ResolvedValues;
|
|
118
|
+
onMount?: (instance: Instance) => void;
|
|
119
|
+
}
|
|
120
|
+
type UseVisualState<Instance, RenderState> = (props: MotionProps, isStatic: boolean) => VisualState<Instance, RenderState>;
|
|
121
|
+
interface UseVisualStateConfig<RenderState> {
|
|
122
|
+
scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps;
|
|
123
|
+
createRenderState: () => RenderState;
|
|
124
|
+
}
|
|
125
|
+
declare const makeUseVisualState: <I, RS>(config: UseVisualStateConfig<RS>) => UseVisualState<I, RS>;
|
|
126
|
+
|
|
127
|
+
interface HTMLElements {
|
|
128
|
+
a: HTMLAnchorElement;
|
|
129
|
+
abbr: HTMLElement;
|
|
130
|
+
address: HTMLElement;
|
|
131
|
+
area: HTMLAreaElement;
|
|
132
|
+
article: HTMLElement;
|
|
133
|
+
aside: HTMLElement;
|
|
134
|
+
audio: HTMLAudioElement;
|
|
135
|
+
b: HTMLElement;
|
|
136
|
+
base: HTMLBaseElement;
|
|
137
|
+
bdi: HTMLElement;
|
|
138
|
+
bdo: HTMLElement;
|
|
139
|
+
big: HTMLElement;
|
|
140
|
+
blockquote: HTMLQuoteElement;
|
|
141
|
+
body: HTMLBodyElement;
|
|
142
|
+
br: HTMLBRElement;
|
|
143
|
+
button: HTMLButtonElement;
|
|
144
|
+
canvas: HTMLCanvasElement;
|
|
145
|
+
caption: HTMLElement;
|
|
146
|
+
center: HTMLElement;
|
|
147
|
+
cite: HTMLElement;
|
|
148
|
+
code: HTMLElement;
|
|
149
|
+
col: HTMLTableColElement;
|
|
150
|
+
colgroup: HTMLTableColElement;
|
|
151
|
+
data: HTMLDataElement;
|
|
152
|
+
datalist: HTMLDataListElement;
|
|
153
|
+
dd: HTMLElement;
|
|
154
|
+
del: HTMLModElement;
|
|
155
|
+
details: HTMLDetailsElement;
|
|
156
|
+
dfn: HTMLElement;
|
|
157
|
+
dialog: HTMLDialogElement;
|
|
158
|
+
div: HTMLDivElement;
|
|
159
|
+
dl: HTMLDListElement;
|
|
160
|
+
dt: HTMLElement;
|
|
161
|
+
em: HTMLElement;
|
|
162
|
+
embed: HTMLEmbedElement;
|
|
163
|
+
fieldset: HTMLFieldSetElement;
|
|
164
|
+
figcaption: HTMLElement;
|
|
165
|
+
figure: HTMLElement;
|
|
166
|
+
footer: HTMLElement;
|
|
167
|
+
form: HTMLFormElement;
|
|
168
|
+
h1: HTMLHeadingElement;
|
|
169
|
+
h2: HTMLHeadingElement;
|
|
170
|
+
h3: HTMLHeadingElement;
|
|
171
|
+
h4: HTMLHeadingElement;
|
|
172
|
+
h5: HTMLHeadingElement;
|
|
173
|
+
h6: HTMLHeadingElement;
|
|
174
|
+
head: HTMLHeadElement;
|
|
175
|
+
header: HTMLElement;
|
|
176
|
+
hgroup: HTMLElement;
|
|
177
|
+
hr: HTMLHRElement;
|
|
178
|
+
html: HTMLHtmlElement;
|
|
179
|
+
i: HTMLElement;
|
|
180
|
+
iframe: HTMLIFrameElement;
|
|
181
|
+
img: HTMLImageElement;
|
|
182
|
+
input: HTMLInputElement;
|
|
183
|
+
ins: HTMLModElement;
|
|
184
|
+
kbd: HTMLElement;
|
|
185
|
+
keygen: HTMLElement;
|
|
186
|
+
label: HTMLLabelElement;
|
|
187
|
+
legend: HTMLLegendElement;
|
|
188
|
+
li: HTMLLIElement;
|
|
189
|
+
link: HTMLLinkElement;
|
|
190
|
+
main: HTMLElement;
|
|
191
|
+
map: HTMLMapElement;
|
|
192
|
+
mark: HTMLElement;
|
|
193
|
+
menu: HTMLElement;
|
|
194
|
+
menuitem: HTMLElement;
|
|
195
|
+
meta: HTMLMetaElement;
|
|
196
|
+
meter: HTMLMeterElement;
|
|
197
|
+
nav: HTMLElement;
|
|
198
|
+
noindex: HTMLElement;
|
|
199
|
+
noscript: HTMLElement;
|
|
200
|
+
object: HTMLObjectElement;
|
|
201
|
+
ol: HTMLOListElement;
|
|
202
|
+
optgroup: HTMLOptGroupElement;
|
|
203
|
+
option: HTMLOptionElement;
|
|
204
|
+
output: HTMLOutputElement;
|
|
205
|
+
p: HTMLParagraphElement;
|
|
206
|
+
param: HTMLParamElement;
|
|
207
|
+
picture: HTMLElement;
|
|
208
|
+
pre: HTMLPreElement;
|
|
209
|
+
progress: HTMLProgressElement;
|
|
210
|
+
q: HTMLQuoteElement;
|
|
211
|
+
rp: HTMLElement;
|
|
212
|
+
rt: HTMLElement;
|
|
213
|
+
ruby: HTMLElement;
|
|
214
|
+
s: HTMLElement;
|
|
215
|
+
samp: HTMLElement;
|
|
216
|
+
search: HTMLElement;
|
|
217
|
+
slot: HTMLSlotElement;
|
|
218
|
+
script: HTMLScriptElement;
|
|
219
|
+
section: HTMLElement;
|
|
220
|
+
select: HTMLSelectElement;
|
|
221
|
+
small: HTMLElement;
|
|
222
|
+
source: HTMLSourceElement;
|
|
223
|
+
span: HTMLSpanElement;
|
|
224
|
+
strong: HTMLElement;
|
|
225
|
+
style: HTMLStyleElement;
|
|
226
|
+
sub: HTMLElement;
|
|
227
|
+
summary: HTMLElement;
|
|
228
|
+
sup: HTMLElement;
|
|
229
|
+
table: HTMLTableElement;
|
|
230
|
+
template: HTMLTemplateElement;
|
|
231
|
+
tbody: HTMLTableSectionElement;
|
|
232
|
+
td: HTMLTableDataCellElement;
|
|
233
|
+
textarea: HTMLTextAreaElement;
|
|
234
|
+
tfoot: HTMLTableSectionElement;
|
|
235
|
+
th: HTMLTableHeaderCellElement;
|
|
236
|
+
thead: HTMLTableSectionElement;
|
|
237
|
+
time: HTMLTimeElement;
|
|
238
|
+
title: HTMLTitleElement;
|
|
239
|
+
tr: HTMLTableRowElement;
|
|
240
|
+
track: HTMLTrackElement;
|
|
241
|
+
u: HTMLElement;
|
|
242
|
+
ul: HTMLUListElement;
|
|
243
|
+
var: HTMLElement;
|
|
244
|
+
video: HTMLVideoElement;
|
|
245
|
+
wbr: HTMLElement;
|
|
246
|
+
webview: HTMLWebViewElement;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface TransformOrigin {
|
|
250
|
+
originX?: number | string;
|
|
251
|
+
originY?: number | string;
|
|
252
|
+
originZ?: number | string;
|
|
253
|
+
}
|
|
254
|
+
interface HTMLRenderState {
|
|
67
255
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
256
|
+
* A mutable record of transforms we want to apply directly to the rendered Element
|
|
257
|
+
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
70
258
|
*/
|
|
71
|
-
|
|
259
|
+
transform: ResolvedValues;
|
|
72
260
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @public
|
|
261
|
+
* A mutable record of transform origins we want to apply directly to the rendered Element
|
|
262
|
+
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
76
263
|
*/
|
|
77
|
-
|
|
264
|
+
transformOrigin: TransformOrigin;
|
|
78
265
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* @public
|
|
266
|
+
* A mutable record of styles we want to apply directly to the rendered Element
|
|
267
|
+
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
83
268
|
*/
|
|
84
|
-
|
|
269
|
+
style: ResolvedValues;
|
|
85
270
|
/**
|
|
86
|
-
* A
|
|
87
|
-
*
|
|
88
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
271
|
+
* A mutable record of CSS variables we want to apply directly to the rendered Element
|
|
272
|
+
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
91
273
|
*/
|
|
92
|
-
|
|
274
|
+
vars: ResolvedValues;
|
|
93
275
|
}
|
|
94
276
|
/**
|
|
95
277
|
* @public
|
|
96
278
|
*/
|
|
97
|
-
|
|
279
|
+
type ForwardRefComponent<T, P> = {
|
|
280
|
+
readonly $$typeof: symbol;
|
|
281
|
+
} & ((props: PropsWithoutRef<P> & RefAttributes<T>) => JSX.Element);
|
|
282
|
+
type AttributesWithoutMotionProps<Attributes> = {
|
|
283
|
+
[K in Exclude<keyof Attributes, keyof MotionProps>]?: Attributes[K];
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* @public
|
|
287
|
+
*/
|
|
288
|
+
type HTMLMotionProps<Tag extends keyof HTMLElements> = AttributesWithoutMotionProps<JSX.IntrinsicElements[Tag]> & MotionProps;
|
|
289
|
+
/**
|
|
290
|
+
* Motion-optimised versions of React's HTML components.
|
|
291
|
+
*
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
type HTMLMotionComponents = {
|
|
295
|
+
[K in keyof HTMLElements]: ForwardRefComponent<HTMLElements[K], HTMLMotionProps<K>>;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
type UnionStringArray<T extends Readonly<string[]>> = T[number];
|
|
299
|
+
declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"];
|
|
300
|
+
type SVGElements = UnionStringArray<typeof svgElements>;
|
|
98
301
|
|
|
302
|
+
interface SVGAttributesWithoutMotionProps<T> extends Pick<SVGAttributes<T>, Exclude<keyof SVGAttributes<T>, keyof MotionProps>> {
|
|
303
|
+
}
|
|
99
304
|
/**
|
|
305
|
+
* Blanket-accept any SVG attribute as a `MotionValue`
|
|
100
306
|
* @public
|
|
101
307
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
custom?: any;
|
|
308
|
+
type SVGAttributesAsMotionValues<T> = MakeMotion<SVGAttributesWithoutMotionProps<T>>;
|
|
309
|
+
type UnwrapSVGFactoryElement<F> = F extends React.SVGProps<infer P> ? P : never;
|
|
310
|
+
/**
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
313
|
+
interface SVGMotionProps<T> extends SVGAttributesAsMotionValues<T>, MotionProps {
|
|
109
314
|
}
|
|
110
315
|
/**
|
|
316
|
+
* Motion-optimised versions of React's SVG components.
|
|
317
|
+
*
|
|
111
318
|
* @public
|
|
112
319
|
*/
|
|
113
|
-
|
|
320
|
+
type SVGMotionComponents = {
|
|
321
|
+
[K in SVGElements]: ForwardRefComponent<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>, SVGMotionProps<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>>>;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents;
|
|
114
325
|
|
|
115
326
|
interface SwitchLayoutGroup {
|
|
116
327
|
register?: (member: IProjectionNode) => void;
|
|
@@ -595,6 +806,7 @@ declare abstract class VisualElement<Instance = unknown, RenderState = unknown,
|
|
|
595
806
|
getBaseTarget(key: string): ResolvedValues[string] | undefined | null;
|
|
596
807
|
on<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction;
|
|
597
808
|
notify<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, ...args: any): void;
|
|
809
|
+
scheduleRenderMicrotask(): void;
|
|
598
810
|
}
|
|
599
811
|
|
|
600
812
|
type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => {
|
|
@@ -627,19 +839,7 @@ interface VisualElementEventCallbacks {
|
|
|
627
839
|
SetAxisTarget: () => void;
|
|
628
840
|
Unmount: () => void;
|
|
629
841
|
}
|
|
630
|
-
type CreateVisualElement<
|
|
631
|
-
|
|
632
|
-
interface VisualState<Instance, RenderState> {
|
|
633
|
-
renderState: RenderState;
|
|
634
|
-
latestValues: ResolvedValues;
|
|
635
|
-
onMount?: (instance: Instance) => void;
|
|
636
|
-
}
|
|
637
|
-
type UseVisualState<Instance, RenderState> = (props: MotionProps, isStatic: boolean) => VisualState<Instance, RenderState>;
|
|
638
|
-
interface UseVisualStateConfig<RenderState> {
|
|
639
|
-
scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps;
|
|
640
|
-
createRenderState: () => RenderState;
|
|
641
|
-
}
|
|
642
|
-
declare const makeUseVisualState: <I, RS>(config: UseVisualStateConfig<RS>) => UseVisualState<I, RS>;
|
|
842
|
+
type CreateVisualElement<Props = {}, TagName extends keyof DOMMotionComponents | string = "div"> = (Component: TagName | string | React.ComponentType<Props>, options: VisualElementOptions<HTMLElement | SVGElement>) => VisualElement<HTMLElement | SVGElement>;
|
|
643
843
|
|
|
644
844
|
declare abstract class Feature<T extends any = any> {
|
|
645
845
|
isMounted: boolean;
|
|
@@ -657,12 +857,12 @@ declare function MeasureLayout(props: MotionProps & {
|
|
|
657
857
|
interface FeatureClass<Props = unknown> {
|
|
658
858
|
new (props: Props): Feature<Props>;
|
|
659
859
|
}
|
|
660
|
-
|
|
860
|
+
interface HydratedFeatureDefinition {
|
|
661
861
|
isEnabled: (props: MotionProps) => boolean;
|
|
662
862
|
Feature: FeatureClass<unknown>;
|
|
663
863
|
ProjectionNode?: any;
|
|
664
864
|
MeasureLayout?: typeof MeasureLayout;
|
|
665
|
-
}
|
|
865
|
+
}
|
|
666
866
|
interface HydratedFeatureDefinitions {
|
|
667
867
|
animation?: HydratedFeatureDefinition;
|
|
668
868
|
exit?: HydratedFeatureDefinition;
|
|
@@ -674,236 +874,37 @@ interface HydratedFeatureDefinitions {
|
|
|
674
874
|
inView?: HydratedFeatureDefinition;
|
|
675
875
|
layout?: HydratedFeatureDefinition;
|
|
676
876
|
}
|
|
677
|
-
|
|
877
|
+
interface FeatureDefinition {
|
|
678
878
|
isEnabled: HydratedFeatureDefinition["isEnabled"];
|
|
679
879
|
Feature?: HydratedFeatureDefinition["Feature"];
|
|
680
880
|
ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
|
|
681
881
|
MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
|
|
682
|
-
}
|
|
882
|
+
}
|
|
683
883
|
type FeatureDefinitions = {
|
|
684
884
|
[K in keyof HydratedFeatureDefinitions]: FeatureDefinition;
|
|
685
885
|
};
|
|
686
|
-
|
|
886
|
+
interface FeaturePackage {
|
|
687
887
|
Feature?: HydratedFeatureDefinition["Feature"];
|
|
688
888
|
ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
|
|
689
889
|
MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
|
|
690
|
-
}
|
|
890
|
+
}
|
|
691
891
|
type FeaturePackages = {
|
|
692
892
|
[K in keyof HydratedFeatureDefinitions]: FeaturePackage;
|
|
693
893
|
};
|
|
694
894
|
interface FeatureBundle extends FeaturePackages {
|
|
695
|
-
renderer: CreateVisualElement
|
|
895
|
+
renderer: CreateVisualElement;
|
|
696
896
|
}
|
|
697
897
|
type LazyFeatureBundle = () => Promise<FeatureBundle>;
|
|
698
|
-
type RenderComponent<Instance, RenderState> = (Component: string | React$1.ComponentType<React$1.PropsWithChildren<unknown>>, props: MotionProps, ref: React$1.Ref<Instance>, visualState: VisualState<Instance, RenderState>, isStatic: boolean, visualElement?: VisualElement<Instance>) => any;
|
|
699
898
|
|
|
700
|
-
interface HTMLElements {
|
|
701
|
-
a: HTMLAnchorElement;
|
|
702
|
-
abbr: HTMLElement;
|
|
703
|
-
address: HTMLElement;
|
|
704
|
-
area: HTMLAreaElement;
|
|
705
|
-
article: HTMLElement;
|
|
706
|
-
aside: HTMLElement;
|
|
707
|
-
audio: HTMLAudioElement;
|
|
708
|
-
b: HTMLElement;
|
|
709
|
-
base: HTMLBaseElement;
|
|
710
|
-
bdi: HTMLElement;
|
|
711
|
-
bdo: HTMLElement;
|
|
712
|
-
big: HTMLElement;
|
|
713
|
-
blockquote: HTMLQuoteElement;
|
|
714
|
-
body: HTMLBodyElement;
|
|
715
|
-
br: HTMLBRElement;
|
|
716
|
-
button: HTMLButtonElement;
|
|
717
|
-
canvas: HTMLCanvasElement;
|
|
718
|
-
caption: HTMLElement;
|
|
719
|
-
center: HTMLElement;
|
|
720
|
-
cite: HTMLElement;
|
|
721
|
-
code: HTMLElement;
|
|
722
|
-
col: HTMLTableColElement;
|
|
723
|
-
colgroup: HTMLTableColElement;
|
|
724
|
-
data: HTMLDataElement;
|
|
725
|
-
datalist: HTMLDataListElement;
|
|
726
|
-
dd: HTMLElement;
|
|
727
|
-
del: HTMLModElement;
|
|
728
|
-
details: HTMLDetailsElement;
|
|
729
|
-
dfn: HTMLElement;
|
|
730
|
-
dialog: HTMLDialogElement;
|
|
731
|
-
div: HTMLDivElement;
|
|
732
|
-
dl: HTMLDListElement;
|
|
733
|
-
dt: HTMLElement;
|
|
734
|
-
em: HTMLElement;
|
|
735
|
-
embed: HTMLEmbedElement;
|
|
736
|
-
fieldset: HTMLFieldSetElement;
|
|
737
|
-
figcaption: HTMLElement;
|
|
738
|
-
figure: HTMLElement;
|
|
739
|
-
footer: HTMLElement;
|
|
740
|
-
form: HTMLFormElement;
|
|
741
|
-
h1: HTMLHeadingElement;
|
|
742
|
-
h2: HTMLHeadingElement;
|
|
743
|
-
h3: HTMLHeadingElement;
|
|
744
|
-
h4: HTMLHeadingElement;
|
|
745
|
-
h5: HTMLHeadingElement;
|
|
746
|
-
h6: HTMLHeadingElement;
|
|
747
|
-
head: HTMLHeadElement;
|
|
748
|
-
header: HTMLElement;
|
|
749
|
-
hgroup: HTMLElement;
|
|
750
|
-
hr: HTMLHRElement;
|
|
751
|
-
html: HTMLHtmlElement;
|
|
752
|
-
i: HTMLElement;
|
|
753
|
-
iframe: HTMLIFrameElement;
|
|
754
|
-
img: HTMLImageElement;
|
|
755
|
-
input: HTMLInputElement;
|
|
756
|
-
ins: HTMLModElement;
|
|
757
|
-
kbd: HTMLElement;
|
|
758
|
-
keygen: HTMLElement;
|
|
759
|
-
label: HTMLLabelElement;
|
|
760
|
-
legend: HTMLLegendElement;
|
|
761
|
-
li: HTMLLIElement;
|
|
762
|
-
link: HTMLLinkElement;
|
|
763
|
-
main: HTMLElement;
|
|
764
|
-
map: HTMLMapElement;
|
|
765
|
-
mark: HTMLElement;
|
|
766
|
-
menu: HTMLElement;
|
|
767
|
-
menuitem: HTMLElement;
|
|
768
|
-
meta: HTMLMetaElement;
|
|
769
|
-
meter: HTMLMeterElement;
|
|
770
|
-
nav: HTMLElement;
|
|
771
|
-
noindex: HTMLElement;
|
|
772
|
-
noscript: HTMLElement;
|
|
773
|
-
object: HTMLObjectElement;
|
|
774
|
-
ol: HTMLOListElement;
|
|
775
|
-
optgroup: HTMLOptGroupElement;
|
|
776
|
-
option: HTMLOptionElement;
|
|
777
|
-
output: HTMLOutputElement;
|
|
778
|
-
p: HTMLParagraphElement;
|
|
779
|
-
param: HTMLParamElement;
|
|
780
|
-
picture: HTMLElement;
|
|
781
|
-
pre: HTMLPreElement;
|
|
782
|
-
progress: HTMLProgressElement;
|
|
783
|
-
q: HTMLQuoteElement;
|
|
784
|
-
rp: HTMLElement;
|
|
785
|
-
rt: HTMLElement;
|
|
786
|
-
ruby: HTMLElement;
|
|
787
|
-
s: HTMLElement;
|
|
788
|
-
samp: HTMLElement;
|
|
789
|
-
search: HTMLElement;
|
|
790
|
-
slot: HTMLSlotElement;
|
|
791
|
-
script: HTMLScriptElement;
|
|
792
|
-
section: HTMLElement;
|
|
793
|
-
select: HTMLSelectElement;
|
|
794
|
-
small: HTMLElement;
|
|
795
|
-
source: HTMLSourceElement;
|
|
796
|
-
span: HTMLSpanElement;
|
|
797
|
-
strong: HTMLElement;
|
|
798
|
-
style: HTMLStyleElement;
|
|
799
|
-
sub: HTMLElement;
|
|
800
|
-
summary: HTMLElement;
|
|
801
|
-
sup: HTMLElement;
|
|
802
|
-
table: HTMLTableElement;
|
|
803
|
-
template: HTMLTemplateElement;
|
|
804
|
-
tbody: HTMLTableSectionElement;
|
|
805
|
-
td: HTMLTableDataCellElement;
|
|
806
|
-
textarea: HTMLTextAreaElement;
|
|
807
|
-
tfoot: HTMLTableSectionElement;
|
|
808
|
-
th: HTMLTableHeaderCellElement;
|
|
809
|
-
thead: HTMLTableSectionElement;
|
|
810
|
-
time: HTMLTimeElement;
|
|
811
|
-
title: HTMLTitleElement;
|
|
812
|
-
tr: HTMLTableRowElement;
|
|
813
|
-
track: HTMLTrackElement;
|
|
814
|
-
u: HTMLElement;
|
|
815
|
-
ul: HTMLUListElement;
|
|
816
|
-
var: HTMLElement;
|
|
817
|
-
video: HTMLVideoElement;
|
|
818
|
-
wbr: HTMLElement;
|
|
819
|
-
webview: HTMLWebViewElement;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
interface TransformOrigin {
|
|
823
|
-
originX?: number | string;
|
|
824
|
-
originY?: number | string;
|
|
825
|
-
originZ?: number | string;
|
|
826
|
-
}
|
|
827
|
-
interface HTMLRenderState {
|
|
828
|
-
/**
|
|
829
|
-
* A mutable record of transforms we want to apply directly to the rendered Element
|
|
830
|
-
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
831
|
-
*/
|
|
832
|
-
transform: ResolvedValues;
|
|
833
|
-
/**
|
|
834
|
-
* A mutable record of transform origins we want to apply directly to the rendered Element
|
|
835
|
-
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
836
|
-
*/
|
|
837
|
-
transformOrigin: TransformOrigin;
|
|
838
|
-
/**
|
|
839
|
-
* A mutable record of styles we want to apply directly to the rendered Element
|
|
840
|
-
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
841
|
-
*/
|
|
842
|
-
style: ResolvedValues;
|
|
843
|
-
/**
|
|
844
|
-
* A mutable record of CSS variables we want to apply directly to the rendered Element
|
|
845
|
-
* every frame. We use a mutable data structure to reduce GC during animations.
|
|
846
|
-
*/
|
|
847
|
-
vars: ResolvedValues;
|
|
848
|
-
}
|
|
849
|
-
/**
|
|
850
|
-
* @public
|
|
851
|
-
*/
|
|
852
|
-
type ForwardRefComponent<T, P> = {
|
|
853
|
-
readonly $$typeof: symbol;
|
|
854
|
-
} & ((props: PropsWithoutRef<P> & RefAttributes<T>) => JSX.Element);
|
|
855
|
-
type AttributesWithoutMotionProps<Attributes> = {
|
|
856
|
-
[K in Exclude<keyof Attributes, keyof MotionProps>]?: Attributes[K];
|
|
857
|
-
};
|
|
858
|
-
/**
|
|
859
|
-
* @public
|
|
860
|
-
*/
|
|
861
|
-
type HTMLMotionProps<Tag extends keyof HTMLElements> = AttributesWithoutMotionProps<JSX.IntrinsicElements[Tag]> & MotionProps;
|
|
862
|
-
/**
|
|
863
|
-
* Motion-optimised versions of React's HTML components.
|
|
864
|
-
*
|
|
865
|
-
* @public
|
|
866
|
-
*/
|
|
867
|
-
type HTMLMotionComponents = {
|
|
868
|
-
[K in keyof HTMLElements]: ForwardRefComponent<HTMLElements[K], HTMLMotionProps<K>>;
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
type UnionStringArray<T extends Readonly<string[]>> = T[number];
|
|
872
|
-
declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"];
|
|
873
|
-
type SVGElements = UnionStringArray<typeof svgElements>;
|
|
874
|
-
|
|
875
|
-
interface SVGAttributesWithoutMotionProps<T> extends Pick<SVGAttributes<T>, Exclude<keyof SVGAttributes<T>, keyof MotionProps>> {
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Blanket-accept any SVG attribute as a `MotionValue`
|
|
879
|
-
* @public
|
|
880
|
-
*/
|
|
881
|
-
type SVGAttributesAsMotionValues<T> = MakeMotion<SVGAttributesWithoutMotionProps<T>>;
|
|
882
|
-
type UnwrapSVGFactoryElement<F> = F extends React.SVGProps<infer P> ? P : never;
|
|
883
|
-
/**
|
|
884
|
-
* @public
|
|
885
|
-
*/
|
|
886
|
-
interface SVGMotionProps<T> extends SVGAttributesAsMotionValues<T>, MotionProps {
|
|
887
|
-
}
|
|
888
|
-
/**
|
|
889
|
-
* Motion-optimised versions of React's SVG components.
|
|
890
|
-
*
|
|
891
|
-
* @public
|
|
892
|
-
*/
|
|
893
|
-
type SVGMotionComponents = {
|
|
894
|
-
[K in SVGElements]: ForwardRefComponent<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>, SVGMotionProps<UnwrapSVGFactoryElement<JSX.IntrinsicElements[K]>>>;
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
interface MotionComponentConfig<Instance, RenderState> {
|
|
898
|
-
preloadedFeatures?: FeatureBundle;
|
|
899
|
-
createVisualElement?: CreateVisualElement<Instance>;
|
|
900
|
-
useRender: RenderComponent<Instance, RenderState>;
|
|
901
|
-
useVisualState: UseVisualState<Instance, RenderState>;
|
|
902
|
-
Component: string | React$1.ComponentType<React$1.PropsWithChildren<unknown>>;
|
|
903
|
-
}
|
|
904
899
|
type MotionComponentProps<Props> = {
|
|
905
900
|
[K in Exclude<keyof Props, keyof MotionProps>]?: Props[K];
|
|
906
901
|
} & MotionProps;
|
|
902
|
+
type MotionComponent<T, P> = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType<Omit<MotionComponentProps<P>, "children"> & {
|
|
903
|
+
children?: "children" extends keyof P ? P["children"] | MotionComponentProps<P>["children"] : MotionComponentProps<P>["children"];
|
|
904
|
+
}>;
|
|
905
|
+
interface MotionComponentOptions {
|
|
906
|
+
forwardMotionProps?: boolean;
|
|
907
|
+
}
|
|
907
908
|
/**
|
|
908
909
|
* Create a `motion` component.
|
|
909
910
|
*
|
|
@@ -913,7 +914,7 @@ type MotionComponentProps<Props> = {
|
|
|
913
914
|
* Alongside this is a config option which provides a way of rendering the provided
|
|
914
915
|
* component "offline", or outside the React render cycle.
|
|
915
916
|
*/
|
|
916
|
-
declare function
|
|
917
|
+
declare function createMotionComponent<Props, TagName extends keyof DOMMotionComponents | string = "div">(Component: TagName | string | React$1.ComponentType<Props>, { forwardMotionProps }?: MotionComponentOptions, preloadedFeatures?: FeaturePackages, createVisualElement?: CreateVisualElement<Props, TagName>): MotionComponent<TagName, Props>;
|
|
917
918
|
|
|
918
919
|
declare const optimizedAppearDataAttribute: "data-framer-appear-id";
|
|
919
920
|
|
|
@@ -946,6 +947,4 @@ declare global {
|
|
|
946
947
|
}
|
|
947
948
|
}
|
|
948
949
|
|
|
949
|
-
type DOMMotionComponents
|
|
950
|
-
|
|
951
|
-
export { type AnimationType as A, type CreateVisualElement as C, type DOMMotionComponents as D, type FeatureBundle as F, type HTMLMotionProps as H, type IProjectionNode as I, type LazyFeatureBundle as L, type MotionProps as M, PresenceContext as P, type ResolvedValues as R, type SVGMotionComponents as S, VisualElement as V, MotionConfigContext as a, type HTMLElements as b, type MotionComponentProps as c, type HTMLMotionComponents as d, type FeaturePackages as e, type VisualElementAnimationOptions as f, type HTMLRenderState as g, type ScrapeMotionValuesFromProps as h, type VisualState as i, createRendererMotionComponent as j, SwitchLayoutGroupContext as k, type MotionStyle as l, makeUseVisualState as m, type MotionTransform as n, optimizedAppearDataAttribute as o, type VariantLabels as p, type ForwardRefComponent as q, type SVGAttributesAsMotionValues as r, type SVGMotionProps as s, FlatTree as t, type HydratedFeatureDefinition as u, type HydratedFeatureDefinitions as v, type FeatureDefinition as w, type FeatureDefinitions as x, type FeaturePackage as y, type RenderComponent as z };
|
|
950
|
+
export { type AnimationType as A, type CreateVisualElement as C, type DOMMotionComponents as D, type FeatureBundle as F, type HTMLMotionProps as H, type IProjectionNode as I, type LazyFeatureBundle as L, type MotionProps as M, PresenceContext as P, type ResolvedValues as R, type SVGMotionComponents as S, VisualElement as V, MotionConfigContext as a, type HTMLElements as b, createMotionComponent as c, type HTMLMotionComponents as d, type FeaturePackages as e, type VisualElementAnimationOptions as f, type HTMLRenderState as g, type ScrapeMotionValuesFromProps as h, type VisualState as i, SwitchLayoutGroupContext as j, type MotionStyle as k, type MotionTransform as l, makeUseVisualState as m, type VariantLabels as n, optimizedAppearDataAttribute as o, type ForwardRefComponent as p, type SVGAttributesAsMotionValues as q, type SVGMotionProps as r, FlatTree as s, type HydratedFeatureDefinition as t, type HydratedFeatureDefinitions as u, type FeatureDefinition as v, type FeatureDefinitions as w, type FeaturePackage as x };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "12.23.
|
|
3
|
+
"version": "12.23.7",
|
|
4
4
|
"description": "A simple and powerful JavaScript animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"measure": "rollup -c ./rollup.size.config.mjs"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"motion-dom": "^12.23.
|
|
91
|
-
"motion-utils": "^12.23.
|
|
90
|
+
"motion-dom": "^12.23.7",
|
|
91
|
+
"motion-utils": "^12.23.6",
|
|
92
92
|
"tslib": "^2.4.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"maxSize": "2.26 kB"
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "5fb87429d0103ed17bf956e3af33804fb760d2f6"
|
|
146
146
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRendererMotionComponent } from '../../motion/index.mjs';
|
|
2
|
-
import { createUseRender } from '../dom/use-render.mjs';
|
|
3
|
-
import { isSVGComponent } from '../dom/utils/is-svg-component.mjs';
|
|
4
|
-
import { htmlMotionConfig } from '../html/config-motion.mjs';
|
|
5
|
-
import { svgMotionConfig } from '../svg/config-motion.mjs';
|
|
6
|
-
|
|
7
|
-
function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
|
|
8
|
-
return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) {
|
|
9
|
-
const baseConfig = isSVGComponent(Component)
|
|
10
|
-
? svgMotionConfig
|
|
11
|
-
: htmlMotionConfig;
|
|
12
|
-
const config = {
|
|
13
|
-
...baseConfig,
|
|
14
|
-
preloadedFeatures,
|
|
15
|
-
useRender: createUseRender(forwardMotionProps),
|
|
16
|
-
createVisualElement,
|
|
17
|
-
Component,
|
|
18
|
-
};
|
|
19
|
-
return createRendererMotionComponent(config);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { createMotionComponentFactory };
|