@ng-native/components 0.3.0 → 0.4.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/gestures.d.ts +0 -1
- package/dist/gestures.js +5 -4
- package/dist/gestures.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pressable.d.ts +23 -0
- package/dist/pressable.js +25 -4
- package/dist/pressable.js.map +1 -1
- package/dist/reanimated-web.d.ts +2 -10
- package/dist/reanimated-web.js.map +1 -1
- package/dist/reanimated.d.ts +4 -4
- package/dist/reanimated.js +3 -3
- package/dist/reanimated.js.map +1 -1
- package/dist/stand-ins/gesture-handler.d.ts +40 -0
- package/dist/stand-ins/gesture-handler.js +43 -0
- package/dist/stand-ins/gesture-handler.js.map +1 -0
- package/dist/stand-ins/reanimated.d.ts +62 -0
- package/dist/stand-ins/reanimated.js +95 -0
- package/dist/stand-ins/reanimated.js.map +1 -0
- package/dist/stand-ins/worklets.d.ts +11 -0
- package/dist/stand-ins/worklets.js +24 -0
- package/dist/stand-ins/worklets.js.map +1 -0
- package/dist/text.d.ts +1 -1
- package/dist/view-base.d.ts +8 -3
- package/dist/view-base.js +55 -2
- package/dist/view-base.js.map +1 -1
- package/dist/virtual-list.d.ts +3 -2
- package/dist/virtual-list.js +3 -2
- package/dist/virtual-list.js.map +1 -1
- package/dist/worklets.d.ts +11 -0
- package/dist/worklets.js.map +1 -1
- package/dist/written-props.js +1 -0
- package/dist/written-props.js.map +1 -1
- package/package.json +15 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-native-gesture-handler` where there is no native recogniser: a browser build and a test,
|
|
3
|
+
* which resolve the library here (`ngNativeWeb()` and `@ng-native/testing`). Nothing is recognised.
|
|
4
|
+
*
|
|
5
|
+
* `Gesture.Pan()`, `Gesture.Tap()`, `Gesture.Simultaneous(...)` and every other builder returns a
|
|
6
|
+
* gesture that takes any configuration call, `.minDistance(10).onUpdate(...)`, and returns itself,
|
|
7
|
+
* so a component builds its gestures exactly as it does on a device. The callbacks it was
|
|
8
|
+
* given are kept on `callbacks`, by name, for a test that wants to call one. `State` and
|
|
9
|
+
* `Directions` are the library's own numbers.
|
|
10
|
+
*/
|
|
11
|
+
function gesture(kind, gestures) {
|
|
12
|
+
const callbacks = {};
|
|
13
|
+
const fields = { kind, gestures, callbacks };
|
|
14
|
+
const self = new Proxy(fields, {
|
|
15
|
+
get(target, key) {
|
|
16
|
+
if (typeof key === 'string' && key in fields)
|
|
17
|
+
return fields[key];
|
|
18
|
+
// Not a thenable, and nothing to say to a symbol such as `Symbol.toPrimitive`.
|
|
19
|
+
if (typeof key === 'symbol' || key === 'then')
|
|
20
|
+
return undefined;
|
|
21
|
+
return (...args) => {
|
|
22
|
+
if (key.startsWith('on') && typeof args[0] === 'function') {
|
|
23
|
+
callbacks[key] = args[0];
|
|
24
|
+
}
|
|
25
|
+
return self;
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
return self;
|
|
30
|
+
}
|
|
31
|
+
export const Gesture = new Proxy({}, {
|
|
32
|
+
get: (_target, kind) => (...gestures) => gesture(String(kind), gestures),
|
|
33
|
+
});
|
|
34
|
+
export const State = {
|
|
35
|
+
UNDETERMINED: 0,
|
|
36
|
+
FAILED: 1,
|
|
37
|
+
BEGAN: 2,
|
|
38
|
+
CANCELLED: 3,
|
|
39
|
+
ACTIVE: 4,
|
|
40
|
+
END: 5,
|
|
41
|
+
};
|
|
42
|
+
export const Directions = { RIGHT: 1, LEFT: 2, UP: 4, DOWN: 8 };
|
|
43
|
+
//# sourceMappingURL=gesture-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gesture-handler.js","sourceRoot":"","sources":["../../src/stand-ins/gesture-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6DH,SAAS,OAAO,CAAC,IAAY,EAAE,QAAmC;IAChE,MAAM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,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAW,CAAC","sourcesContent":["/**\n * `react-native-gesture-handler` where there is no native recogniser: a browser build and a test,\n * which resolve the library here (`ngNativeWeb()` and `@ng-native/testing`). Nothing is recognised.\n *\n * `Gesture.Pan()`, `Gesture.Tap()`, `Gesture.Simultaneous(...)` and every other builder returns a\n * gesture that takes any configuration call, `.minDistance(10).onUpdate(...)`, and returns itself,\n * so a component builds its gestures exactly as it does on a device. The callbacks it was\n * given are kept on `callbacks`, by name, for a test that wants to call one. `State` and\n * `Directions` are the library's own numbers.\n */\n\n/** The configuration and callback calls gestures take, as far as a test types them. */\ntype GestureMethod =\n | 'onBegin'\n | 'onStart'\n | 'onUpdate'\n | 'onChange'\n | 'onEnd'\n | 'onFinalize'\n | 'onTouchesDown'\n | 'onTouchesMove'\n | 'onTouchesUp'\n | 'onTouchesCancelled'\n | 'enabled'\n | 'runOnJS'\n | 'minDistance'\n | 'minPointers'\n | 'maxPointers'\n | 'numberOfTaps'\n | 'minDuration'\n | 'maxDuration'\n | 'direction'\n | 'activeOffsetX'\n | 'activeOffsetY'\n | 'failOffsetX'\n | 'failOffsetY'\n | 'hitSlop'\n | 'shouldCancelWhenOutside'\n | 'manualActivation'\n | 'simultaneousWithExternalGesture'\n | 'requireExternalGestureToFail'\n | 'blocksExternalGesture'\n | 'withRef'\n | 'withTestId';\n\n/**\n * A gesture built in a test: every configuration call returns it, and callbacks are kept. `kind`\n * is the builder that made it, `Pan` or `Race`, and `gestures` what a composed one was made of.\n */\nexport type StandInGesture = {\n readonly kind: string;\n readonly gestures: readonly StandInGesture[];\n readonly callbacks: Record<string, (...args: never[]) => unknown>;\n} & { readonly [M in GestureMethod]: (...args: readonly unknown[]) => StandInGesture };\n\ntype Builder =\n | 'Pan'\n | 'Tap'\n | 'LongPress'\n | 'Pinch'\n | 'Rotation'\n | 'Fling'\n | 'Hover'\n | 'Manual'\n | 'Native'\n | 'ForceTouch'\n | 'Race'\n | 'Simultaneous'\n | 'Exclusive';\n\nfunction gesture(kind: string, gestures: readonly StandInGesture[]): StandInGesture {\n const callbacks: Record<string, (...args: never[]) => unknown> = {};\n const fields: Record<string, unknown> = { kind, gestures, callbacks };\n const self = new Proxy(fields as StandInGesture, {\n get(target, key) {\n if (typeof key === 'string' && key in fields) return fields[key];\n // Not a thenable, and nothing to say to a symbol such as `Symbol.toPrimitive`.\n if (typeof key === 'symbol' || key === 'then') return undefined;\n return (...args: unknown[]) => {\n if (key.startsWith('on') && typeof args[0] === 'function') {\n callbacks[key] = args[0] as (...args: never[]) => unknown;\n }\n return self;\n };\n },\n });\n return self;\n}\n\nexport const Gesture = new Proxy(\n {},\n {\n get:\n (_target, kind) =>\n (...gestures: unknown[]) =>\n gesture(String(kind), gestures as StandInGesture[]),\n },\n) as Readonly<Record<Builder, (...gestures: readonly unknown[]) => StandInGesture>>;\n\nexport const State = {\n UNDETERMINED: 0,\n FAILED: 1,\n BEGAN: 2,\n CANCELLED: 3,\n ACTIVE: 4,\n END: 5,\n} as const;\n\nexport const Directions = { RIGHT: 1, LEFT: 2, UP: 4, DOWN: 8 } as const;\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-native-reanimated` where there is no UI-thread runtime: a browser build and a test, which
|
|
3
|
+
* resolve the library here (`ngNativeWeb()` and `@ng-native/testing`).
|
|
4
|
+
*
|
|
5
|
+
* An animation finishes the moment it is assigned: `withTiming(100)` is `100`, and its callback
|
|
6
|
+
* is called with `true` at once, so the value is where the animation ends and what ends it runs.
|
|
7
|
+
* `interpolate` and `Extrapolation` are the library's own arithmetic; `Easing` curves are the
|
|
8
|
+
* identity, since nothing is ever between an animation's ends.
|
|
9
|
+
*
|
|
10
|
+
* ponytail: the functions apps call from components, not the React hooks; add one when an app
|
|
11
|
+
* imports it.
|
|
12
|
+
*/
|
|
13
|
+
export { sharedValue as makeMutable } from '../reanimated-web.ts';
|
|
14
|
+
export type { MutableValue as SharedValue } from '../worklets.ts';
|
|
15
|
+
type Done = ((finished?: boolean) => void) | undefined;
|
|
16
|
+
export declare function withTiming<T>(to: T, _config?: object, callback?: Done): T;
|
|
17
|
+
export declare function withSpring<T>(to: T, _config?: object, callback?: Done): T;
|
|
18
|
+
export declare function withDecay(_config: {
|
|
19
|
+
velocity?: number;
|
|
20
|
+
}, callback?: Done): number;
|
|
21
|
+
export declare function withDelay<T>(_delay: number, animation: T): T;
|
|
22
|
+
export declare function withSequence<T>(...animations: T[]): T;
|
|
23
|
+
export declare function withRepeat<T>(animation: T, _times?: number, _reverse?: boolean, callback?: Done): T;
|
|
24
|
+
export declare function cancelAnimation(_value: unknown): void;
|
|
25
|
+
/** What `@ng-native/components/reanimated` itself starts a style with; nothing runs it here. */
|
|
26
|
+
export declare function startMapper(_worklet: () => void, _inputs?: unknown[]): number;
|
|
27
|
+
export declare function stopMapper(_id: number): void;
|
|
28
|
+
export declare const Extrapolation: {
|
|
29
|
+
readonly IDENTITY: "identity";
|
|
30
|
+
readonly CLAMP: "clamp";
|
|
31
|
+
readonly EXTEND: "extend";
|
|
32
|
+
};
|
|
33
|
+
type Extrapolate = (typeof Extrapolation)[keyof typeof Extrapolation];
|
|
34
|
+
export declare function interpolate(x: number, input: readonly number[], output: readonly number[], extrapolate?: Extrapolate | {
|
|
35
|
+
extrapolateLeft?: Extrapolate;
|
|
36
|
+
extrapolateRight?: Extrapolate;
|
|
37
|
+
}): number;
|
|
38
|
+
export declare const Easing: {
|
|
39
|
+
linear: (t: number) => number;
|
|
40
|
+
ease: (t: number) => number;
|
|
41
|
+
quad: (t: number) => number;
|
|
42
|
+
cubic: (t: number) => number;
|
|
43
|
+
sin: (t: number) => number;
|
|
44
|
+
circle: (t: number) => number;
|
|
45
|
+
exp: (t: number) => number;
|
|
46
|
+
bounce: (t: number) => number;
|
|
47
|
+
poly: () => (t: number) => number;
|
|
48
|
+
elastic: () => (t: number) => number;
|
|
49
|
+
back: () => (t: number) => number;
|
|
50
|
+
bezier: () => (t: number) => number;
|
|
51
|
+
bezierFn: () => (t: number) => number;
|
|
52
|
+
in: (easing: (t: number) => number) => (t: number) => number;
|
|
53
|
+
out: (easing: (t: number) => number) => (t: number) => number;
|
|
54
|
+
inOut: (easing: (t: number) => number) => (t: number) => number;
|
|
55
|
+
};
|
|
56
|
+
export declare const ReduceMotion: {
|
|
57
|
+
readonly System: "system";
|
|
58
|
+
readonly Always: "always";
|
|
59
|
+
readonly Never: "never";
|
|
60
|
+
};
|
|
61
|
+
export declare function runOnJS<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
62
|
+
export declare function runOnUI<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-native-reanimated` where there is no UI-thread runtime: a browser build and a test, which
|
|
3
|
+
* resolve the library here (`ngNativeWeb()` and `@ng-native/testing`).
|
|
4
|
+
*
|
|
5
|
+
* An animation finishes the moment it is assigned: `withTiming(100)` is `100`, and its callback
|
|
6
|
+
* is called with `true` at once, so the value is where the animation ends and what ends it runs.
|
|
7
|
+
* `interpolate` and `Extrapolation` are the library's own arithmetic; `Easing` curves are the
|
|
8
|
+
* identity, since nothing is ever between an animation's ends.
|
|
9
|
+
*
|
|
10
|
+
* ponytail: the functions apps call from components, not the React hooks; add one when an app
|
|
11
|
+
* imports it.
|
|
12
|
+
*/
|
|
13
|
+
export { sharedValue as makeMutable } from "../reanimated-web.js";
|
|
14
|
+
const settle = (to, callback) => {
|
|
15
|
+
callback?.(true);
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
export function withTiming(to, _config, callback) {
|
|
19
|
+
return settle(to, callback);
|
|
20
|
+
}
|
|
21
|
+
export function withSpring(to, _config, callback) {
|
|
22
|
+
return settle(to, callback);
|
|
23
|
+
}
|
|
24
|
+
export function withDecay(_config, callback) {
|
|
25
|
+
return settle(0, callback);
|
|
26
|
+
}
|
|
27
|
+
export function withDelay(_delay, animation) {
|
|
28
|
+
return animation;
|
|
29
|
+
}
|
|
30
|
+
export function withSequence(...animations) {
|
|
31
|
+
return animations[animations.length - 1];
|
|
32
|
+
}
|
|
33
|
+
export function withRepeat(animation, _times, _reverse, callback) {
|
|
34
|
+
return settle(animation, callback);
|
|
35
|
+
}
|
|
36
|
+
export function cancelAnimation(_value) { }
|
|
37
|
+
/** What `@ng-native/components/reanimated` itself starts a style with; nothing runs it here. */
|
|
38
|
+
export function startMapper(_worklet, _inputs) {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
export function stopMapper(_id) { }
|
|
42
|
+
export const Extrapolation = { IDENTITY: 'identity', CLAMP: 'clamp', EXTEND: 'extend' };
|
|
43
|
+
/** Past an end of the input range: the end's output, the input itself, or `undefined` to extend. */
|
|
44
|
+
function beyond(x, output, how) {
|
|
45
|
+
if (how === 'clamp')
|
|
46
|
+
return output;
|
|
47
|
+
if (how === 'identity')
|
|
48
|
+
return x;
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
export function interpolate(x, input, output, extrapolate) {
|
|
52
|
+
const left = typeof extrapolate === 'object' ? extrapolate.extrapolateLeft : extrapolate;
|
|
53
|
+
const right = typeof extrapolate === 'object' ? extrapolate.extrapolateRight : extrapolate;
|
|
54
|
+
const last = input.length - 1;
|
|
55
|
+
const outside = x < input[0]
|
|
56
|
+
? beyond(x, output[0], left)
|
|
57
|
+
: x > input[last]
|
|
58
|
+
? beyond(x, output[last], right)
|
|
59
|
+
: undefined;
|
|
60
|
+
if (outside !== undefined)
|
|
61
|
+
return outside;
|
|
62
|
+
let i = 0;
|
|
63
|
+
while (i < last - 1 && x > input[i + 1])
|
|
64
|
+
i++;
|
|
65
|
+
const [a, b, p, q] = [input[i], input[i + 1], output[i], output[i + 1]];
|
|
66
|
+
return b === a ? p : p + ((x - a) / (b - a)) * (q - p);
|
|
67
|
+
}
|
|
68
|
+
const identity = (t) => t;
|
|
69
|
+
const curve = () => identity;
|
|
70
|
+
export const Easing = {
|
|
71
|
+
linear: identity,
|
|
72
|
+
ease: identity,
|
|
73
|
+
quad: identity,
|
|
74
|
+
cubic: identity,
|
|
75
|
+
sin: identity,
|
|
76
|
+
circle: identity,
|
|
77
|
+
exp: identity,
|
|
78
|
+
bounce: identity,
|
|
79
|
+
poly: curve,
|
|
80
|
+
elastic: curve,
|
|
81
|
+
back: curve,
|
|
82
|
+
bezier: curve,
|
|
83
|
+
bezierFn: curve,
|
|
84
|
+
in: (easing) => easing,
|
|
85
|
+
out: (easing) => easing,
|
|
86
|
+
inOut: (easing) => easing,
|
|
87
|
+
};
|
|
88
|
+
export const ReduceMotion = { System: 'system', Always: 'always', Never: 'never' };
|
|
89
|
+
export function runOnJS(fn) {
|
|
90
|
+
return fn;
|
|
91
|
+
}
|
|
92
|
+
export function runOnUI(fn) {
|
|
93
|
+
return fn;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=reanimated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reanimated.js","sourceRoot":"","sources":["../../src/stand-ins/reanimated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKlE,MAAM,MAAM,GAAG,CAAI,EAAK,EAAE,QAAc,EAAK,EAAE;IAC7C,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,UAAU,UAAU,CAAI,EAAK,EAAE,OAAgB,EAAE,QAAe;IACpE,OAAO,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,UAAU,CAAI,EAAK,EAAE,OAAgB,EAAE,QAAe;IACpE,OAAO,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,S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AM,GAAG;IACpB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,EAAE,EAAE,CAAC,MAA6B,EAAE,EAAE,CAAC,MAAM;IAC7C,GAAG,EAAE,CAAC,MAA6B,EAAE,EAAE,CAAC,MAAM;IAC9C,KAAK,EAAE,CAAC,MAA6B,EAAE,EAAE,CAAC,MAAM;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAW,CAAC;AAE5F,MAAM,UAAU,OAAO,CAAyB,EAAqB;IACnE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,OAAO,CAAyB,EAAqB;IACnE,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/**\n * `react-native-reanimated` where there is no UI-thread runtime: a browser build and a test, which\n * resolve the library here (`ngNativeWeb()` and `@ng-native/testing`).\n *\n * An animation finishes the moment it is assigned: `withTiming(100)` is `100`, and its callback\n * is called with `true` at once, so the value is where the animation ends and what ends it runs.\n * `interpolate` and `Extrapolation` are the library's own arithmetic; `Easing` curves are the\n * identity, since nothing is ever between an animation's ends.\n *\n * ponytail: the functions apps call from components, not the React hooks; add one when an app\n * imports it.\n */\nexport { sharedValue as makeMutable } from '../reanimated-web.ts';\nexport type { MutableValue as SharedValue } from '../worklets.ts';\n\ntype Done = ((finished?: boolean) => void) | undefined;\n\nconst settle = <T>(to: T, callback: Done): T => {\n callback?.(true);\n return to;\n};\n\nexport function withTiming<T>(to: T, _config?: object, callback?: Done): T {\n return settle(to, callback);\n}\n\nexport function withSpring<T>(to: T, _config?: object, callback?: Done): T {\n return settle(to, callback);\n}\n\nexport function withDecay(_config: { velocity?: number }, callback?: Done): number {\n return settle(0, callback);\n}\n\nexport function withDelay<T>(_delay: number, animation: T): T {\n return animation;\n}\n\nexport function withSequence<T>(...animations: T[]): T {\n return animations[animations.length - 1]!;\n}\n\nexport function withRepeat<T>(\n animation: T,\n _times?: number,\n _reverse?: boolean,\n callback?: Done,\n): T {\n return settle(animation, callback);\n}\n\nexport function cancelAnimation(_value: unknown): void {}\n\n/** What `@ng-native/components/reanimated` itself starts a style with; nothing runs it here. */\nexport function startMapper(_worklet: () => void, _inputs?: unknown[]): number {\n return 0;\n}\n\nexport function stopMapper(_id: number): void {}\n\nexport const Extrapolation = { IDENTITY: 'identity', CLAMP: 'clamp', EXTEND: 'extend' } as const;\ntype Extrapolate = (typeof Extrapolation)[keyof typeof Extrapolation];\n\n/** Past an end of the input range: the end's output, the input itself, or `undefined` to extend. */\nfunction beyond(x: number, output: number, how: Extrapolate | undefined): number | undefined {\n if (how === 'clamp') return output;\n if (how === 'identity') return x;\n return undefined;\n}\n\nexport function interpolate(\n x: number,\n input: readonly number[],\n output: readonly number[],\n extrapolate?: Extrapolate | { extrapolateLeft?: Extrapolate; extrapolateRight?: Extrapolate },\n): number {\n const left = typeof extrapolate === 'object' ? extrapolate.extrapolateLeft : extrapolate;\n const right = typeof extrapolate === 'object' ? extrapolate.extrapolateRight : extrapolate;\n const last = input.length - 1;\n const outside =\n x < input[0]!\n ? beyond(x, output[0]!, left)\n : x > input[last]!\n ? beyond(x, output[last]!, right)\n : undefined;\n if (outside !== undefined) return outside;\n let i = 0;\n while (i < last - 1 && x > input[i + 1]!) i++;\n const [a, b, p, q] = [input[i]!, input[i + 1]!, output[i]!, output[i + 1]!];\n return b === a ? p : p + ((x - a) / (b - a)) * (q - p);\n}\n\nconst identity = (t: number) => t;\nconst curve = () => identity;\nexport const Easing = {\n linear: identity,\n ease: identity,\n quad: identity,\n cubic: identity,\n sin: identity,\n circle: identity,\n exp: identity,\n bounce: identity,\n poly: curve,\n elastic: curve,\n back: curve,\n bezier: curve,\n bezierFn: curve,\n in: (easing: (t: number) => number) => easing,\n out: (easing: (t: number) => number) => easing,\n inOut: (easing: (t: number) => number) => easing,\n};\n\nexport const ReduceMotion = { System: 'system', Always: 'always', Never: 'never' } as const;\n\nexport function runOnJS<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n return fn;\n}\n\nexport function runOnUI<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n return fn;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-native-worklets` where there is no UI-thread runtime: a browser build and a test, which
|
|
3
|
+
* resolve the library here (`ngNativeWeb()` and `@ng-native/testing`). There is one runtime, so
|
|
4
|
+
* scheduling a function on either calls it at once.
|
|
5
|
+
*/
|
|
6
|
+
export declare function scheduleOnRN<A extends unknown[]>(fn: (...args: A) => unknown, ...args: A): void;
|
|
7
|
+
export declare function scheduleOnUI<A extends unknown[]>(fn: (...args: A) => unknown, ...args: A): void;
|
|
8
|
+
export declare function runOnUISync<A extends unknown[], R>(fn: (...args: A) => R, ...args: A): R;
|
|
9
|
+
export declare function runOnJS<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
10
|
+
export declare function runOnUI<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
11
|
+
export declare function isWorkletFunction(_value: unknown): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-native-worklets` where there is no UI-thread runtime: a browser build and a test, which
|
|
3
|
+
* resolve the library here (`ngNativeWeb()` and `@ng-native/testing`). There is one runtime, so
|
|
4
|
+
* scheduling a function on either calls it at once.
|
|
5
|
+
*/
|
|
6
|
+
export function scheduleOnRN(fn, ...args) {
|
|
7
|
+
fn(...args);
|
|
8
|
+
}
|
|
9
|
+
export function scheduleOnUI(fn, ...args) {
|
|
10
|
+
fn(...args);
|
|
11
|
+
}
|
|
12
|
+
export function runOnUISync(fn, ...args) {
|
|
13
|
+
return fn(...args);
|
|
14
|
+
}
|
|
15
|
+
export function runOnJS(fn) {
|
|
16
|
+
return fn;
|
|
17
|
+
}
|
|
18
|
+
export function runOnUI(fn) {
|
|
19
|
+
return fn;
|
|
20
|
+
}
|
|
21
|
+
export function isWorkletFunction(_value) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=worklets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worklets.js","sourceRoot":"","sources":["../../src/stand-ins/worklets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAsB,EAA2B,EAAE,GAAG,IAAO;IACvF,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,YAAY,CAAsB,EAA2B,EAAE,GAAG,IAAO;IACvF,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,WAAW,CAAyB,EAAqB,EAAE,GAAG,IAAO;IACnF,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,OAAO,CAAyB,EAAqB;IACnE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,OAAO,CAAyB,EAAqB;IACnE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * `react-native-worklets` where there is no UI-thread runtime: a browser build and a test, which\n * resolve the library here (`ngNativeWeb()` and `@ng-native/testing`). There is one runtime, so\n * scheduling a function on either calls it at once.\n */\nexport function scheduleOnRN<A extends unknown[]>(fn: (...args: A) => unknown, ...args: A): void {\n fn(...args);\n}\n\nexport function scheduleOnUI<A extends unknown[]>(fn: (...args: A) => unknown, ...args: A): void {\n fn(...args);\n}\n\nexport function runOnUISync<A extends unknown[], R>(fn: (...args: A) => R, ...args: A): R {\n return fn(...args);\n}\n\nexport function runOnJS<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n return fn;\n}\n\nexport function runOnUI<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n return fn;\n}\n\nexport function isWorkletFunction(_value: unknown): boolean {\n return false;\n}\n"]}
|
package/dist/text.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare class Text extends TouchableBase {
|
|
|
63
63
|
/** Android: the line-breaking strategy. */
|
|
64
64
|
readonly textBreakStrategy: import("@angular/core").InputSignal<"simple" | "highQuality" | "balanced" | undefined>;
|
|
65
65
|
/** Android: turn phone numbers, links and addresses into tappable text. */
|
|
66
|
-
readonly dataDetectorType: import("@angular/core").InputSignal<"
|
|
66
|
+
readonly dataDetectorType: import("@angular/core").InputSignal<"link" | "none" | "phoneNumber" | "email" | "all" | undefined>;
|
|
67
67
|
/** Android: how often to hyphenate. */
|
|
68
68
|
readonly hyphenationFrequency: import("@angular/core").InputSignal<"none" | "normal" | "full" | undefined>;
|
|
69
69
|
/** Respond to presses. See the class note. */
|
package/dist/view-base.d.ts
CHANGED
|
@@ -17,7 +17,12 @@ import { type SimpleChanges } from '@angular/core';
|
|
|
17
17
|
import { HostEngine, type HostNode } from '@ng-native/fabric';
|
|
18
18
|
import type { Insets } from './events.ts';
|
|
19
19
|
import * as i0 from "@angular/core";
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The ARIA roles, which `role` takes as React Native's own `role` prop does. Native maps each to
|
|
22
|
+
* what the platform has.
|
|
23
|
+
*/
|
|
24
|
+
export type Role = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'meter' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'summary' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
25
|
+
/** The roles assistive technologies understand, as `accessibilityRole` names them. */
|
|
21
26
|
export type AccessibilityRole = 'none' | 'button' | 'togglebutton' | 'link' | 'search' | 'image' | 'keyboardkey' | 'text' | 'adjustable' | 'imagebutton' | 'header' | 'summary' | 'alert' | 'checkbox' | 'combobox' | 'menu' | 'menubar' | 'menuitem' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'spinbutton' | 'switch' | 'tab' | 'tabbar' | 'tablist' | 'timer' | 'list' | 'toolbar' | 'grid' | 'pager' | 'scrollview' | 'horizontalscrollview' | 'viewgroup' | 'webview' | 'drawerlayout' | 'slidingdrawer' | 'iconmenu';
|
|
22
27
|
export interface AccessibilityState {
|
|
23
28
|
readonly disabled?: boolean;
|
|
@@ -128,8 +133,8 @@ export declare abstract class ViewBase {
|
|
|
128
133
|
readonly accessibilityHint: import("@angular/core").InputSignal<string | undefined>;
|
|
129
134
|
/** The kind of control this is, for assistive technologies. */
|
|
130
135
|
readonly accessibilityRole: import("@angular/core").InputSignal<AccessibilityRole | undefined>;
|
|
131
|
-
/** `role`: the web spelling
|
|
132
|
-
readonly role: import("@angular/core").InputSignal<
|
|
136
|
+
/** `role`: the web spelling, which takes the ARIA roles as well as `accessibilityRole`'s. */
|
|
137
|
+
readonly role: import("@angular/core").InputSignal<"text" | "alert" | "alertdialog" | "application" | "article" | "banner" | "button" | "cell" | "checkbox" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "dialog" | "directory" | "document" | "feed" | "figure" | "form" | "grid" | "group" | "heading" | "img" | "link" | "list" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "meter" | "navigation" | "none" | "note" | "option" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "summary" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem" | "togglebutton" | "search" | "image" | "keyboardkey" | "adjustable" | "imagebutton" | "header" | "tabbar" | "pager" | "scrollview" | "horizontalscrollview" | "viewgroup" | "webview" | "drawerlayout" | "slidingdrawer" | "iconmenu" | undefined>;
|
|
133
138
|
/** Disabled, selected, checked, busy and expanded, as one object. */
|
|
134
139
|
readonly accessibilityState: import("@angular/core").InputSignal<AccessibilityState | undefined>;
|
|
135
140
|
/** `aria-busy`. */
|
package/dist/view-base.js
CHANGED
|
@@ -18,6 +18,55 @@ import { HostEngine, claimHost, declareNativeProps } from '@ng-native/fabric';
|
|
|
18
18
|
import { optionalBoolean, optionalNumber } from "./transforms.js";
|
|
19
19
|
import { WRITTEN_PROPS } from "./written-props.js";
|
|
20
20
|
import * as i0 from "@angular/core";
|
|
21
|
+
/**
|
|
22
|
+
* The ARIA roles `accessibilityRole` has no word for. One of these is committed as `role`, which
|
|
23
|
+
* native reads over `accessibilityRole`; any other is `accessibilityRole` under its web spelling.
|
|
24
|
+
*/
|
|
25
|
+
const ARIA_ONLY_ROLES = new Set([
|
|
26
|
+
'alertdialog',
|
|
27
|
+
'application',
|
|
28
|
+
'article',
|
|
29
|
+
'banner',
|
|
30
|
+
'cell',
|
|
31
|
+
'columnheader',
|
|
32
|
+
'complementary',
|
|
33
|
+
'contentinfo',
|
|
34
|
+
'definition',
|
|
35
|
+
'dialog',
|
|
36
|
+
'directory',
|
|
37
|
+
'document',
|
|
38
|
+
'feed',
|
|
39
|
+
'figure',
|
|
40
|
+
'form',
|
|
41
|
+
'group',
|
|
42
|
+
'heading',
|
|
43
|
+
'img',
|
|
44
|
+
'listitem',
|
|
45
|
+
'log',
|
|
46
|
+
'main',
|
|
47
|
+
'marquee',
|
|
48
|
+
'math',
|
|
49
|
+
'meter',
|
|
50
|
+
'navigation',
|
|
51
|
+
'note',
|
|
52
|
+
'option',
|
|
53
|
+
'presentation',
|
|
54
|
+
'region',
|
|
55
|
+
'row',
|
|
56
|
+
'rowgroup',
|
|
57
|
+
'rowheader',
|
|
58
|
+
'searchbox',
|
|
59
|
+
'separator',
|
|
60
|
+
'slider',
|
|
61
|
+
'status',
|
|
62
|
+
'table',
|
|
63
|
+
'tabpanel',
|
|
64
|
+
'term',
|
|
65
|
+
'tooltip',
|
|
66
|
+
'tree',
|
|
67
|
+
'treegrid',
|
|
68
|
+
'treeitem',
|
|
69
|
+
]);
|
|
21
70
|
/**
|
|
22
71
|
* Angular writes a static attribute to the element as well as feeding it to the input of the
|
|
23
72
|
* same name, so `<switch thumbColor="#fff">` leaves a stray `thumbColor` prop on the node next to
|
|
@@ -151,7 +200,7 @@ export class ViewBase {
|
|
|
151
200
|
/** The kind of control this is, for assistive technologies. */
|
|
152
201
|
accessibilityRole = input(/* @ts-ignore */
|
|
153
202
|
...(ngDevMode ? [undefined, { debugName: "accessibilityRole" }] : /* istanbul ignore next */ []));
|
|
154
|
-
/** `role`: the web spelling
|
|
203
|
+
/** `role`: the web spelling, which takes the ARIA roles as well as `accessibilityRole`'s. */
|
|
155
204
|
role = input(/* @ts-ignore */
|
|
156
205
|
...(ngDevMode ? [undefined, { debugName: "role" }] : /* istanbul ignore next */ []));
|
|
157
206
|
/** Disabled, selected, checked, busy and expanded, as one object. */
|
|
@@ -328,7 +377,11 @@ export class ViewBase {
|
|
|
328
377
|
write('accessibilityLabel', this.accessibilityLabel() ?? this.ariaLabel() ?? this.labelByDefault());
|
|
329
378
|
write('accessibilityLabelledBy', this.accessibilityLabelledBy() ?? this.ariaLabelledBy());
|
|
330
379
|
write('accessibilityHint', this.accessibilityHint());
|
|
331
|
-
|
|
380
|
+
const role = this.role();
|
|
381
|
+
const aria = role !== undefined && ARIA_ONLY_ROLES.has(role);
|
|
382
|
+
write('role', aria ? role : undefined);
|
|
383
|
+
// An ARIA role is the element's role whatever the component implies, as any explicit one is.
|
|
384
|
+
write('accessibilityRole', this.accessibilityRole() ?? (aria ? undefined : (role ?? this.impliedRole())));
|
|
332
385
|
write('accessibilityState', this.mergedAccessibilityState());
|
|
333
386
|
write('accessibilityValue', this.mergedAccessibilityValue());
|
|
334
387
|
write('accessibilityActions', this.accessibilityActions());
|