Skip to content

Commit 5952b13

Browse files
committed
chore: pretty
1 parent 1e8ee1e commit 5952b13

File tree

30 files changed

+180
-174
lines changed

30 files changed

+180
-174
lines changed

demo/src/sandboxes/notification-hub/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function MessageHub({
4848
})
4949
)
5050
},
51-
config: (item, index, phase) => key => phase === 'enter' && key === 'life' ? { duration: timeout } : config,
51+
config: (item, index, phase) => key => (phase === 'enter' && key === 'life' ? { duration: timeout } : config),
5252
})
5353

5454
React.useEffect(() => {

docs/app/components/Code/H.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface HProps {
66
export const H = ({ index, id, ...props }: HProps) => {
77
const getHighlightedWords = (): [
88
targetIndex: number[],
9-
allHighlightWords: Element[]
9+
allHighlightWords: Element[],
1010
] => {
1111
const codeBlock = document.getElementById(id)
1212
if (!codeBlock) return [[], []]

docs/app/helpers/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export enum EventNames {
77

88
type EventFactory<
99
TEventName extends EventNames,
10-
TAdditionalProps extends object = object
10+
TAdditionalProps extends object = object,
1111
> = {
1212
name: TEventName
1313
additionalProps?: TAdditionalProps

docs/app/hooks/useAnimatedHeader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const useAnimatedHeader = ({
1717
styles: { top: SpringValue<number> },
1818
isStuck: boolean,
1919
scrollTop: number,
20-
direction: SCROLL_DIR | undefined
20+
direction: SCROLL_DIR | undefined,
2121
] => {
2222
const [direction, scrollTop] = useWindowScrolling({
2323
active: true,

packages/animated/src/AnimatedArray.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Source = AnimatedValue<Value>[]
88

99
/** An array of animated nodes */
1010
export class AnimatedArray<
11-
T extends ReadonlyArray<Value> = Value[]
11+
T extends ReadonlyArray<Value> = Value[],
1212
> extends AnimatedObject {
1313
protected declare source: Source
1414
constructor(source: T) {

packages/animated/src/createHost.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ const getDisplayName = (arg: AnimatableComponent) =>
6969
is.str(arg)
7070
? arg
7171
: arg && is.str(arg.displayName)
72-
? arg.displayName
73-
: (is.fun(arg) && arg.name) || null
72+
? arg.displayName
73+
: (is.fun(arg) && arg.name) || null

packages/animated/src/getAnimatedType.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export function getAnimatedType(value: any): AnimatedType {
1111
return parentNode
1212
? (parentNode.constructor as any)
1313
: is.arr(value)
14-
? AnimatedArray
15-
: isAnimatedString(value)
16-
? AnimatedString
17-
: AnimatedValue
14+
? AnimatedArray
15+
: isAnimatedString(value)
16+
? AnimatedString
17+
: AnimatedValue
1818
}

packages/animated/src/withAnimated.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ export const withAnimated = (Component: any, host: HostConfig) => {
9898
}
9999

100100
class PropsObserver {
101-
constructor(readonly update: () => void, readonly deps: Set<FluidValue>) {}
101+
constructor(
102+
readonly update: () => void,
103+
readonly deps: Set<FluidValue>
104+
) {}
102105
eventObserved(event: FluidEvent) {
103106
if (event.type == 'change') {
104107
raf.write(this.update)

packages/core/src/AnimationResult.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export const getCombinedResult = <T extends Readable>(
99
results.length == 1
1010
? results[0]
1111
: results.some(result => result.cancelled)
12-
? getCancelledResult(target.get())
13-
: results.every(result => result.noop)
14-
? getNoopResult(target.get())
15-
: getFinishedResult(
16-
target.get(),
17-
results.every(result => result.finished)
18-
)
12+
? getCancelledResult(target.get())
13+
: results.every(result => result.noop)
14+
? getNoopResult(target.get())
15+
: getFinishedResult(
16+
target.get(),
17+
results.every(result => result.finished)
18+
)
1919

2020
/** No-op results are for updates that never start an animation. */
2121
export const getNoopResult = (value: any) => ({

packages/core/src/Interpolation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
*/
3535
export class Interpolation<
3636
Input = any,
37-
Output = any
37+
Output = any,
3838
> extends FrameValue<Output> {
3939
/** Useful for debugging. */
4040
key?: string

packages/core/src/SpringRef.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export interface ControllerUpdateFn<State extends Lookup = Lookup> {
88
}
99

1010
export interface SpringRef<State extends Lookup = Lookup> {
11-
(props?: ControllerUpdate<State> | ControllerUpdateFn<State>): AsyncResult<
12-
Controller<State>
13-
>[]
11+
(
12+
props?: ControllerUpdate<State> | ControllerUpdateFn<State>
13+
): AsyncResult<Controller<State>>[]
1414
current: Controller<State>[]
1515

1616
/** Add a controller to this ref */
@@ -77,7 +77,7 @@ export interface SpringRef<State extends Lookup = Lookup> {
7777
}
7878

7979
export const SpringRef = <
80-
State extends Lookup = Lookup
80+
State extends Lookup = Lookup,
8181
>(): SpringRef<State> => {
8282
const current: Controller<State>[] = []
8383

packages/core/src/SpringValue.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ export class SpringValue<T = any> extends FrameValue<T> {
190190
node.constructor == AnimatedString
191191
? 1
192192
: payload
193-
? payload[i].lastPosition
194-
: toValues![i]
193+
? payload[i].lastPosition
194+
: toValues![i]
195195

196196
let finished = anim.immediate
197197
let position = to
@@ -800,8 +800,8 @@ export class SpringValue<T = any> extends FrameValue<T> {
800800
anim.toValues = hasFluidValue(to)
801801
? null
802802
: goalType == AnimatedString
803-
? [1]
804-
: toArray(goal)
803+
? [1]
804+
: toArray(goal)
805805
}
806806

807807
if (anim.immediate != immediate) {

packages/core/src/helpers.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export const getDefaultProp = <T extends Lookup, P extends keyof T>(
5151
props.default === true
5252
? props[key]
5353
: props.default
54-
? props.default[key]
55-
: undefined
54+
? props.default[key]
55+
: undefined
5656

5757
const noopTransform = (value: any) => value
5858

@@ -187,11 +187,11 @@ export function computeGoal<T>(value: T | FluidValue<T>): T {
187187
return is.arr(value)
188188
? value.map(computeGoal)
189189
: isAnimatedString(value)
190-
? (G.createStringInterpolator({
191-
range: [0, 1],
192-
output: [value, value] as any,
193-
})(1) as any)
194-
: value
190+
? (G.createStringInterpolator({
191+
range: [0, 1],
192+
output: [value, value] as any,
193+
})(1) as any)
194+
: value
195195
}
196196

197197
export function hasProps(props: object) {

packages/core/src/types/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export type RawValues<T extends object> = {
2929
export type IsPlainObject<T> = T extends ReadonlyArray<any>
3030
? Any
3131
: T extends object
32-
? object
33-
: Any
32+
? object
33+
: Any
3434

3535
export type StringKeys<T> = T extends IsPlainObject<T>
3636
? string & keyof T

packages/core/src/types/functions.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type SpringUpdateFn<T = any> = T extends IsPlainObject<T>
4848
interface AnyUpdateFn<
4949
T extends SpringValue | Controller<any>,
5050
Props extends object = InferProps<T>,
51-
State = InferState<T>
51+
State = InferState<T>,
5252
> {
5353
(to: SpringTo<State>, props?: Props): AsyncResult<T>
5454
(props: { to?: SpringToFn<T> | Falsy } & Props): AsyncResult<T>
@@ -82,7 +82,7 @@ interface UpdateValueFn<T = any> extends AnyUpdateFn<SpringValue<T>> {
8282
type EventHandler<
8383
TResult extends Readable = any,
8484
TSource = unknown,
85-
Item = undefined
85+
Item = undefined,
8686
> = Item extends undefined
8787
? (result: AnimationResult<TResult>, ctrl: TSource, item?: Item) => void
8888
: (result: AnimationResult<TResult>, ctrl: TSource, item: Item) => void
@@ -94,39 +94,39 @@ type EventHandler<
9494
export type OnStart<
9595
TResult extends Readable,
9696
TSource,
97-
Item = undefined
97+
Item = undefined,
9898
> = EventHandler<TResult, TSource, Item>
9999

100100
/** Called when a `SpringValue` changes */
101101
export type OnChange<
102102
TResult extends Readable,
103103
TSource,
104-
Item = undefined
104+
Item = undefined,
105105
> = EventHandler<TResult, TSource, Item>
106106

107107
export type OnPause<
108108
TResult extends Readable,
109109
TSource,
110-
Item = undefined
110+
Item = undefined,
111111
> = EventHandler<TResult, TSource, Item>
112112

113113
export type OnResume<
114114
TResult extends Readable,
115115
TSource,
116-
Item = undefined
116+
Item = undefined,
117117
> = EventHandler<TResult, TSource, Item>
118118

119119
/** Called once the animation comes to a halt */
120120
export type OnRest<
121121
TResult extends Readable,
122122
TSource,
123-
Item = undefined
123+
Item = undefined,
124124
> = EventHandler<TResult, TSource, Item>
125125

126126
export type OnResolve<
127127
TResult extends Readable,
128128
TSource,
129-
Item = undefined
129+
Item = undefined,
130130
> = EventHandler<TResult, TSource, Item>
131131

132132
/**

packages/core/src/types/internal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ export interface Readable<T = any> {
1818
export type InferState<T extends Readable> = T extends Controller<infer State>
1919
? State
2020
: T extends SpringValue<infer U>
21-
? U
22-
: unknown
21+
? U
22+
: unknown
2323

2424
/** @internal */
2525
export type InferProps<T extends Readable> = T extends Controller<infer State>
2626
? ControllerUpdate<State>
2727
: T extends SpringValue<infer U>
28-
? SpringUpdate<U>
29-
: Lookup
28+
? SpringUpdate<U>
29+
: Lookup
3030

3131
/** @internal */
3232
export type InferTarget<T> = T extends object

packages/core/src/types/objects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type SpringValues<T extends Lookup = any> = [T] extends [Any]
3838
// Wrap a type with `SpringValue`
3939
type SpringWrap<T> = [
4040
Exclude<T, FluidValue>,
41-
Extract<T, readonly any[]> // Arrays are animated.
41+
Extract<T, readonly any[]>, // Arrays are animated.
4242
] extends [object | void, never]
4343
? never // Object literals cannot be animated.
4444
: SpringValue<Exclude<T, FluidValue | void>> | Extract<T, void>

packages/core/src/types/props.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ export type SpringTo<T = any> =
143143

144144
export type ControllerUpdate<
145145
State extends Lookup = Lookup,
146-
Item = undefined
146+
Item = undefined,
147147
> = unknown & ToProps<State> & ControllerProps<State, Item>
148148

149149
/**
150150
* Props for `Controller` methods and constructor.
151151
*/
152152
export interface ControllerProps<
153153
State extends Lookup = Lookup,
154-
Item = undefined
154+
Item = undefined,
155155
> extends AnimationProps<State> {
156156
ref?: SpringRef<State>
157157
from?: GoalValues<State> | Falsy
@@ -350,16 +350,16 @@ export type PickAnimated<Props extends object, Fwd = true> = unknown &
350350
([Props] extends [Any]
351351
? Lookup // Preserve "any" instead of resolving to "{}"
352352
: [object] extends [Props]
353-
? Lookup
354-
: ObjectFromUnion<
355-
Props extends { from: infer From } // extract prop from the `from` prop if it exists
356-
? From extends () => any
357-
? ReturnType<From>
358-
: ObjectType<From>
359-
: TransitionKey & keyof Props extends never
360-
? ToValues<Props, Fwd>
361-
: TransitionValues<Props>
362-
>)
353+
? Lookup
354+
: ObjectFromUnion<
355+
Props extends { from: infer From } // extract prop from the `from` prop if it exists
356+
? From extends () => any
357+
? ReturnType<From>
358+
: ObjectType<From>
359+
: TransitionKey & keyof Props extends never
360+
? ToValues<Props, Fwd>
361+
: TransitionValues<Props>
362+
>)
363363

364364
/**
365365
* Pick the values of the `to` prop. Forward props are *not* included.

packages/core/src/types/transition.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ export type TransitionValues<Props extends object> = unknown &
4141
? T extends ReadonlyArray<infer Element>
4242
? Element
4343
: T extends (...args: any[]) => infer Return
44-
? Return extends ReadonlyArray<infer ReturnElement>
45-
? ReturnElement
46-
: Return
47-
: T
44+
? Return extends ReadonlyArray<infer ReturnElement>
45+
? ReturnElement
46+
: Return
47+
: T
4848
: never
4949
>,
5050
{}
@@ -97,7 +97,7 @@ export type UseTransitionProps<Item = any> = Merge<
9797

9898
export type TransitionComponentProps<
9999
Item,
100-
Props extends object = any
100+
Props extends object = any,
101101
> = unknown &
102102
UseTransitionProps<Item> & {
103103
keys?: ItemKeys<NoInfer<Item>>

packages/shared/src/easings.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ export const easings: EasingDictionary = {
106106
x === 0
107107
? 0
108108
: x === 1
109-
? 1
110-
: x < 0.5
111-
? Math.pow(2, 20 * x - 10) / 2
112-
: (2 - Math.pow(2, -20 * x + 10)) / 2,
109+
? 1
110+
: x < 0.5
111+
? Math.pow(2, 20 * x - 10) / 2
112+
: (2 - Math.pow(2, -20 * x + 10)) / 2,
113113
easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)),
114114
easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)),
115115
easeInOutCirc: x =>
@@ -126,22 +126,23 @@ export const easings: EasingDictionary = {
126126
x === 0
127127
? 0
128128
: x === 1
129-
? 1
130-
: -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
129+
? 1
130+
: -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
131131
easeOutElastic: x =>
132132
x === 0
133133
? 0
134134
: x === 1
135-
? 1
136-
: Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
135+
? 1
136+
: Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
137137
easeInOutElastic: x =>
138138
x === 0
139139
? 0
140140
: x === 1
141-
? 1
142-
: x < 0.5
143-
? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2
144-
: (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1,
141+
? 1
142+
: x < 0.5
143+
? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2
144+
: (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 +
145+
1,
145146
easeInBounce: x => 1 - bounceOut(1 - x),
146147
easeOutBounce: bounceOut,
147148
easeInOutBounce: x =>

0 commit comments

Comments
 (0)