@gtkx/animated 2.0.0-beta.3 → 2.0.0-beta.4
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/types.d.ts +2 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -6
- package/src/types.ts +3 -10
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type * as Gtk from "@gtkx/gi/gtk";
|
|
2
1
|
import type { FluidValue } from "@react-spring/shared";
|
|
3
|
-
import type { ComponentPropsWithRef, ElementType, FunctionComponent, JSX
|
|
2
|
+
import type { ComponentPropsWithRef, ElementType, FunctionComponent, JSX } from "react";
|
|
4
3
|
/** An array-valued prop whose items may each be a spring or an interpolation, such as mixed text children. */
|
|
5
4
|
type AnimatedItems<T> = [Exclude<Extract<T, Iterable<unknown>>, string>] extends [never] ? never : Exclude<Extract<T, Iterable<unknown>>, string> extends Iterable<infer Item> ? Iterable<AnimatedProp<Item>> : never;
|
|
6
5
|
/** A prop value that an animated component also accepts as a spring or an interpolation. */
|
|
@@ -27,9 +26,7 @@ type AnimatedComponent<T extends Exclude<ElementType, string>> = FunctionCompone
|
|
|
27
26
|
* Only elements whose `ref` exposes a `Gtk.Widget` subclass are included.
|
|
28
27
|
*/
|
|
29
28
|
type AnimatedElementMap = {
|
|
30
|
-
readonly [K in keyof JSX.IntrinsicElements as JSX.IntrinsicElements[K] extends
|
|
31
|
-
ref?: Ref<infer Instance> | undefined;
|
|
32
|
-
} ? [NonNullable<Instance>] extends [never] ? never : NonNullable<Instance> extends Gtk.Widget ? K : never : never]: JSX.IntrinsicElements[K] extends object ? FunctionComponent<AnimatedProps<JSX.IntrinsicElements[K]>> : never;
|
|
29
|
+
readonly [K in keyof JSX.IntrinsicElements as "cssClasses" extends keyof JSX.IntrinsicElements[K] ? K : never]: JSX.IntrinsicElements[K] extends object ? FunctionComponent<AnimatedProps<JSX.IntrinsicElements[K]>> : never;
|
|
33
30
|
};
|
|
34
31
|
export type { AnimatedComponent, AnimatedElementMap, AnimatedItems, AnimatedProp, AnimatedProps, AnimatedStyle, };
|
|
35
32
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAExF,8GAA8G;AAC9G,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAClF,KAAK,GACL,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,QAAQ,CAAC,MAAM,IAAI,CAAC,GACvE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAC5B,KAAK,CAAC;AAEhB,4FAA4F;AAC5F,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AAEpG;;;GAGG;AACH,KAAK,aAAa,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GACz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["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { FluidValue } from \"@react-spring/shared\";\nimport type { ComponentPropsWithRef, ElementType, FunctionComponent, JSX } from \"react\";\n\n/** An array-valued prop whose items may each be a spring or an interpolation, such as mixed text children. */\ntype AnimatedItems<T> = [Exclude<Extract<T, Iterable<unknown>>, string>] extends [never]\n ? never\n : Exclude<Extract<T, Iterable<unknown>>, string> extends Iterable<infer Item>\n ? Iterable<AnimatedProp<Item>>\n : never;\n\n/** A prop value that an animated component also accepts as a spring or an interpolation. */\ntype AnimatedProp<T> = T | FluidValue<Exclude<T, undefined>> | AnimatedItems<Exclude<T, undefined>>;\n\n/**\n * A `style` object whose declarations may each be a spring or an interpolation, nested blocks\n * included, so the object a spring hook returns can be handed to `style` as it is.\n */\ntype AnimatedStyle<T> = {\n [K in keyof T]: T[K] extends string | number | undefined | null\n ? AnimatedProp<T[K]>\n : AnimatedProp<T[K]> | AnimatedStyle<NonNullable<T[K]>>;\n};\n\n/**\n * The props of an animated component: every prop of the wrapped component, each also accepting a\n * {@link FluidValue} such as a `SpringValue` or an `Interpolation`, while `ref` and `key` keep\n * their original types.\n */\ntype AnimatedProps<Props extends object> = {\n [P in keyof Props]: P extends \"key\" | \"ref\"\n ? Props[P]\n : P extends \"style\"\n ? AnimatedProp<Props[P]> | AnimatedStyle<NonNullable<Props[P]>>\n : AnimatedProp<Props[P]>;\n};\n\n/** A component returned by {@link animated}: the wrapped component with animated props. */\ntype AnimatedComponent<T extends Exclude<ElementType, string>> = FunctionComponent<\n AnimatedProps<ComponentPropsWithRef<T>>\n>;\n\n/**\n * The generated JSX intrinsic elements, keyed by element name, as components accepting animated props.\n * Only elements whose `ref` exposes a `Gtk.Widget` subclass are included.\n */\ntype AnimatedElementMap = {\n readonly [K in keyof JSX.IntrinsicElements as \"cssClasses\" extends keyof JSX.IntrinsicElements[K]\n ? K\n : never]: JSX.IntrinsicElements[K] extends object\n ? FunctionComponent<AnimatedProps<JSX.IntrinsicElements[K]>>\n : never;\n};\n\nexport type {\n AnimatedComponent,\n AnimatedElementMap,\n AnimatedItems,\n AnimatedProp,\n AnimatedProps,\n AnimatedStyle,\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/animated",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
4
4
|
"description": "Spring animations for GTK widgets, driven by the GTK4 frame clock.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"node": ">=26.7.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@gtkx/react": "2.0.0-beta.
|
|
62
|
-
"@gtkx/runtime": "2.0.0-beta.
|
|
61
|
+
"@gtkx/react": "2.0.0-beta.4",
|
|
62
|
+
"@gtkx/runtime": "2.0.0-beta.4",
|
|
63
63
|
"@react-spring/core": "^10.1.2",
|
|
64
64
|
"@react-spring/shared": "^10.1.2",
|
|
65
65
|
"@react-spring/types": "^10.1.2"
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"react": "^19.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@gtkx/config": "2.0.0-beta.
|
|
72
|
-
"@gtkx/testing": "2.0.0-beta.
|
|
73
|
-
"@gtkx/vitest": "2.0.0-beta.
|
|
71
|
+
"@gtkx/config": "2.0.0-beta.4",
|
|
72
|
+
"@gtkx/testing": "2.0.0-beta.4",
|
|
73
|
+
"@gtkx/vitest": "2.0.0-beta.4",
|
|
74
74
|
"vitest": "^4.1.11"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type * as Gtk from "@gtkx/gi/gtk";
|
|
2
1
|
import type { FluidValue } from "@react-spring/shared";
|
|
3
|
-
import type { ComponentPropsWithRef, ElementType, FunctionComponent, JSX
|
|
2
|
+
import type { ComponentPropsWithRef, ElementType, FunctionComponent, JSX } from "react";
|
|
4
3
|
|
|
5
4
|
/** An array-valued prop whose items may each be a spring or an interpolation, such as mixed text children. */
|
|
6
5
|
type AnimatedItems<T> = [Exclude<Extract<T, Iterable<unknown>>, string>] extends [never]
|
|
@@ -45,14 +44,8 @@ type AnimatedComponent<T extends Exclude<ElementType, string>> = FunctionCompone
|
|
|
45
44
|
* Only elements whose `ref` exposes a `Gtk.Widget` subclass are included.
|
|
46
45
|
*/
|
|
47
46
|
type AnimatedElementMap = {
|
|
48
|
-
readonly [K in keyof JSX.IntrinsicElements as JSX.IntrinsicElements[K]
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
? [NonNullable<Instance>] extends [never]
|
|
52
|
-
? never
|
|
53
|
-
: NonNullable<Instance> extends Gtk.Widget
|
|
54
|
-
? K
|
|
55
|
-
: never
|
|
47
|
+
readonly [K in keyof JSX.IntrinsicElements as "cssClasses" extends keyof JSX.IntrinsicElements[K]
|
|
48
|
+
? K
|
|
56
49
|
: never]: JSX.IntrinsicElements[K] extends object
|
|
57
50
|
? FunctionComponent<AnimatedProps<JSX.IntrinsicElements[K]>>
|
|
58
51
|
: never;
|