@ng-native/components 0.2.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.
Files changed (67) hide show
  1. package/dist/content-container.d.ts +25 -0
  2. package/dist/content-container.js +35 -0
  3. package/dist/content-container.js.map +1 -0
  4. package/dist/gestures-web.d.ts +12 -0
  5. package/dist/gestures-web.js +32 -0
  6. package/dist/gestures-web.js.map +1 -0
  7. package/dist/gestures.d.ts +0 -1
  8. package/dist/gestures.js +5 -4
  9. package/dist/gestures.js.map +1 -1
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/keyboard-avoiding-view.d.ts +6 -1
  13. package/dist/keyboard-avoiding-view.js +23 -6
  14. package/dist/keyboard-avoiding-view.js.map +1 -1
  15. package/dist/pressable.d.ts +56 -4
  16. package/dist/pressable.js +80 -7
  17. package/dist/pressable.js.map +1 -1
  18. package/dist/reanimated-web.d.ts +18 -0
  19. package/dist/reanimated-web.js +59 -0
  20. package/dist/reanimated-web.js.map +1 -0
  21. package/dist/reanimated.d.ts +4 -4
  22. package/dist/reanimated.js +3 -3
  23. package/dist/reanimated.js.map +1 -1
  24. package/dist/refresh-control.d.ts +4 -1
  25. package/dist/refresh-control.js +4 -1
  26. package/dist/refresh-control.js.map +1 -1
  27. package/dist/scroll-view.d.ts +17 -1
  28. package/dist/scroll-view.js +59 -6
  29. package/dist/scroll-view.js.map +1 -1
  30. package/dist/section-list.d.ts +14 -2
  31. package/dist/section-list.js +20 -4
  32. package/dist/section-list.js.map +1 -1
  33. package/dist/stand-ins/gesture-handler.d.ts +40 -0
  34. package/dist/stand-ins/gesture-handler.js +43 -0
  35. package/dist/stand-ins/gesture-handler.js.map +1 -0
  36. package/dist/stand-ins/reanimated.d.ts +62 -0
  37. package/dist/stand-ins/reanimated.js +95 -0
  38. package/dist/stand-ins/reanimated.js.map +1 -0
  39. package/dist/stand-ins/worklets.d.ts +11 -0
  40. package/dist/stand-ins/worklets.js +24 -0
  41. package/dist/stand-ins/worklets.js.map +1 -0
  42. package/dist/sticky-headers.d.ts +6 -0
  43. package/dist/sticky-headers.js +7 -2
  44. package/dist/sticky-headers.js.map +1 -1
  45. package/dist/switch.d.ts +11 -1
  46. package/dist/switch.js +16 -3
  47. package/dist/switch.js.map +1 -1
  48. package/dist/text.d.ts +11 -2
  49. package/dist/text.js +15 -1
  50. package/dist/text.js.map +1 -1
  51. package/dist/touchable-opacity.d.ts +2 -1
  52. package/dist/touchable-opacity.js +3 -0
  53. package/dist/touchable-opacity.js.map +1 -1
  54. package/dist/view-base.d.ts +36 -21
  55. package/dist/view-base.js +91 -23
  56. package/dist/view-base.js.map +1 -1
  57. package/dist/virtual-list.d.ts +52 -7
  58. package/dist/virtual-list.js +132 -44
  59. package/dist/virtual-list.js.map +1 -1
  60. package/dist/worklets.d.ts +11 -0
  61. package/dist/worklets.js.map +1 -1
  62. package/dist/written-props.js +1 -0
  63. package/dist/written-props.js.map +1 -1
  64. package/dist/zero-size-warning.d.ts +30 -0
  65. package/dist/zero-size-warning.js +58 -0
  66. package/dist/zero-size-warning.js.map +1 -0
  67. package/package.json +19 -4
package/dist/pressable.js CHANGED
@@ -5,7 +5,9 @@
5
5
  * press rectangle, delays and a long-press timer around them. This is that machine, on the same
6
6
  * responder negotiation, so a button and an enclosing scroll view agree on who owns a drag.
7
7
  */
8
- import { Directive, booleanAttribute, forwardRef, input, numberAttribute, output, signal, } from '@angular/core';
8
+ import { Directive, booleanAttribute, computed, forwardRef, input, numberAttribute, output, signal, } from '@angular/core';
9
+ import { nativePlatform } from '@ng-native/fabric';
10
+ import { optionalBoolean } from "./transforms.js";
9
11
  import { ViewBase } from "./view-base.js";
10
12
  import * as i0 from "@angular/core";
11
13
  /**
@@ -53,8 +55,11 @@ const now = () => globalThis.performance?.now?.() ?? Date.now();
53
55
  * every element that carries it, on every pass. The controls bind theirs through `ControlBase`.
54
56
  */
55
57
  export class TouchableBase extends ViewBase {
56
- /** Ignore touches entirely. */
57
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
58
+ /**
59
+ * Ignore touches entirely. Undefined until set, because React Native tells "not passed" from
60
+ * "passed false": only a passed `disabled` wins over `aria-disabled` in what is announced.
61
+ */
62
+ disabled = input(undefined, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
58
63
  /**
59
64
  * How far outside the hit area a touch may wander before the press is cancelled. Native's
60
65
  * `hitSlop` grows the area a touch can start in; this grows the area it may move within.
@@ -169,7 +174,22 @@ export class TouchableBase extends ViewBase {
169
174
  pressedChanged(_pressed) { }
170
175
  /** Whether a touch starting on this node should be claimed. `Text` narrows it. */
171
176
  claims() {
172
- return !this.disabled();
177
+ return !this.pressDisabled();
178
+ }
179
+ /**
180
+ * Whether presses are refused. `Pressable.js` gives Pressability `disabled` alone, so here
181
+ * `aria-disabled` and `accessibilityState.disabled` change what is announced and nothing else.
182
+ * `TouchableOpacity` and `Text` widen it.
183
+ */
184
+ pressDisabled() {
185
+ return !!this.disabled();
186
+ }
187
+ /**
188
+ * `TouchableOpacity.js` and `Text.js`: `disabled ?? aria-disabled ?? accessibilityState.disabled`,
189
+ * which is the merged announced state whenever `disabled` is unset.
190
+ */
191
+ disabledByAnyState() {
192
+ return (this.disabled() ?? this.accessibilityStateProp()?.disabled) === true;
173
193
  }
174
194
  /**
175
195
  * Whether the control's size should be tracked. Native only measures a view that asks, so
@@ -210,21 +230,53 @@ export class TouchableBase extends ViewBase {
210
230
  this.stopResponding?.();
211
231
  this.stopLayout?.();
212
232
  this.stopHover?.();
233
+ this.stopClick?.();
213
234
  }
214
235
  stopResponding = null;
215
236
  stopLayout = null;
216
237
  stopHover = null;
238
+ stopClick = null;
217
239
  ngOnInit() {
218
240
  super.ngOnInit();
219
241
  this.respondIfNeeded();
220
242
  this.measureIfNeeded();
221
243
  this.hoverIfNeeded();
244
+ this.clickIfNeeded();
222
245
  }
223
246
  ngOnChanges() {
224
247
  super.ngOnChanges();
225
248
  this.respondIfNeeded();
226
249
  this.measureIfNeeded();
227
250
  this.hoverIfNeeded();
251
+ this.clickIfNeeded();
252
+ }
253
+ /**
254
+ * A press with no touch: Android's `performClick()`, which is what Enter, the D-pad centre and
255
+ * TalkBack's double-tap do to a focused view, and which reaches us as `topClick` alone.
256
+ *
257
+ * `Pressability.js` answers it in `onClick`: `onPress` and nothing around it, not while disabled,
258
+ * and not for a click carrying a `pointerType`, which is the pointer event a touch already
259
+ * pressed through. It presses only the view that was clicked: a touchable the click only bubbled
260
+ * through stops it there, so neither it nor anything above it acts on a click meant for a
261
+ * focusable view inside it.
262
+ *
263
+ * Android only. iOS sends a click only as a pointer event, and the web host binds `topClick` to
264
+ * the DOM's own click, which a mouse press already reached through the responder.
265
+ */
266
+ clickIfNeeded() {
267
+ if (this.stopClick || !this.measures() || nativePlatform() !== 'android')
268
+ return;
269
+ this.stopClick = this.engine.setEventListener(this.node, 'topClick', (event) => {
270
+ const click = event;
271
+ if (!this.measures() || Object.hasOwn(click.nativeEvent ?? {}, 'pointerType'))
272
+ return;
273
+ if (click.target !== this.node) {
274
+ click.stopPropagation();
275
+ return;
276
+ }
277
+ if (this.claims())
278
+ this.press.emit(click);
279
+ });
228
280
  }
229
281
  /**
230
282
  * Join the responder negotiation, once this is something a touch can press.
@@ -407,7 +459,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
407
459
  */
408
460
  export class ControlBase extends TouchableBase {
409
461
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ControlBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
410
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: ControlBase, isStandalone: true, host: { properties: { "accessibilityState": "accessibilityStateProp()", "attr.data-disabled": "disabled() ? '' : null", "nativeBackgroundAndroid": "rippleBackground()", "nativeForegroundAndroid": "rippleForeground()" } }, usesInheritance: true, ngImport: i0 });
462
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: ControlBase, isStandalone: true, host: { properties: { "accessibilityState": "accessibilityStateProp()", "attr.data-disabled": "pressDisabled() ? '' : null", "nativeBackgroundAndroid": "rippleBackground()", "nativeForegroundAndroid": "rippleForeground()" } }, usesInheritance: true, ngImport: i0 });
411
463
  }
412
464
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ControlBase, decorators: [{
413
465
  type: Directive,
@@ -417,7 +469,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
417
469
  // the one binding that keeps the announced state in step with it.
418
470
  '[accessibilityState]': 'accessibilityStateProp()',
419
471
  // Nor is it left on the node for `:disabled` to read, so this is what a stylesheet matches.
420
- '[attr.data-disabled]': "disabled() ? '' : null",
472
+ '[attr.data-disabled]': "pressDisabled() ? '' : null",
421
473
  '[nativeBackgroundAndroid]': 'rippleBackground()',
422
474
  '[nativeForegroundAndroid]': 'rippleForeground()',
423
475
  },
@@ -436,14 +488,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
436
488
  * read `pressed` without caring whether it landed on this or on a real `<pressable>`.
437
489
  */
438
490
  export class PressBehavior extends ControlBase {
491
+ /** The conditions the composing component gave, any of which disables the control. */
492
+ conditions = signal([], /* @ts-ignore */
493
+ ...(ngDevMode ? [{ debugName: "conditions" }] : /* istanbul ignore next */ []));
494
+ held = computed(() => this.conditions().some((condition) => condition()), /* @ts-ignore */
495
+ ...(ngDevMode ? [{ debugName: "held" }] : /* istanbul ignore next */ []));
496
+ /**
497
+ * Disable the control while `condition` is true, from the component that composes this: a
498
+ * button that is loading, which its caller's `disabled` knows nothing of. Either one disables
499
+ * it, as `disabled={loading || disabled}` does on React Native's `Pressable`: presses are
500
+ * refused, a stylesheet sees `[data-disabled]`, and a screen reader is told.
501
+ *
502
+ * constructor() {
503
+ * inject(PressBehavior).disableWhile(this.loading);
504
+ * }
505
+ */
506
+ disableWhile(condition) {
507
+ this.conditions.update((conditions) => [...conditions, condition]);
508
+ }
439
509
  accessibleByDefault() {
440
510
  return true;
441
511
  }
442
512
  focusableByDefault() {
443
513
  return true;
444
514
  }
515
+ pressDisabled() {
516
+ return this.held() || super.pressDisabled();
517
+ }
445
518
  disabledForAccessibility() {
446
- return this.disabled();
519
+ return this.held() ? true : this.disabled();
447
520
  }
448
521
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: PressBehavior, deps: null, target: i0.ɵɵFactoryTarget.Directive });
449
522
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: PressBehavior, isStandalone: true, providers: [{ provide: TouchableBase, useExisting: forwardRef(() => PressBehavior) }], usesInheritance: true, ngImport: i0 });
@@ -1 +1 @@
1
- {"version":3,"file":"pressable.js","sourceRoot":"","sources":["../src/pressable.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,eAAe,EACf,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAe1C;;;GAGG;AACH,MAAM,uBAAuB,GAAqB,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC/F,0CAA0C;AAC1C,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,mGAAmG;AACnG,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,MAAM,GAAG,CAA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O,IAAI,CAAC;IACd,CAAC;IAEkB,wBAAwB;QACzC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;uGAXU,aAAa;2FAAb,aAAa,iCAFb,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;;2FAE1E,aAAa;kBAHzB,SAAS;mBAAC;oBACT,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,CAAC;iBACtF;;AAeD;;;;;;GAMG;AAMH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,4FAA4F;IACzE,mBAAmB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,kBAAkB;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,wBAAwB;QACzC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;uGAZU,SAAS;2FAAT,SAAS,wDAFT,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;;2FAEtE,SAAS;kBALrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,WAAW;oBACrB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;iBAClF","sourcesContent":["/**\n * Press handling, built on the engine's responder system as RN's `Pressability` is.\n *\n * `onPress` is not a native event: RN synthesises it in JS from the touch primitives, with a\n * press rectangle, delays and a long-press timer around them. This is that machine, on the same\n * responder negotiation, so a button and an enclosing scroll view agree on who owns a drag.\n */\nimport {\n Directive,\n booleanAttribute,\n forwardRef,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport type { NativeSyntheticEvent } from '@ng-native/fabric';\nimport type { Insets, TouchEvent } from './events.ts';\nimport { ViewBase } from './view-base.ts';\n\n/** What a press handler receives: RN's `{nativeEvent}` shape, passed straight through. */\nexport type PressEvent = TouchEvent;\n\n/**\n * Android's ripple, drawn natively. `foreground` paints it over the content rather than behind.\n */\nexport interface AndroidRipple {\n readonly color?: string | number;\n readonly borderless?: boolean;\n readonly radius?: number;\n readonly foreground?: boolean;\n}\n\n/**\n * How far outside its own bounds a control keeps a press: RN's `DEFAULT_PRESS_RECT_OFFSETS`.\n * More room below, because a thumb rolls downwards as it lifts.\n */\nconst DEFAULT_PRESS_RETENTION: Required<Insets> = { top: 20, left: 20, right: 20, bottom: 30 };\n/** RN's `DEFAULT_LONG_PRESS_DELAY_MS`. */\nconst DEFAULT_LONG_PRESS_DELAY = 500;\n/** RN's `DEFAULT_MIN_PRESS_DURATION`: the pressed look stays at least this long on a quick tap. */\nconst DEFAULT_MIN_PRESS_DURATION = 130;\n\n/**\n * Used only until a control has been measured. RN measures the view and cancels when the touch\n * leaves its bounds plus the retention offset; before the first layout arrives there are no\n * bounds to compare against, so fall back to a small movement threshold rather than treating a\n * drag of any length as a tap.\n */\nconst PRESS_CANCEL_DISTANCE = 15;\n\nconst insets = (value: Insets | number | undefined, fallback: Required<Insets>) => {\n if (value === undefined) return fallback;\n if (typeof value === 'number') return { top: value, left: value, right: value, bottom: value };\n return {\n top: value.top ?? 0,\n left: value.left ?? 0,\n right: value.right ?? 0,\n bottom: value.bottom ?? 0,\n };\n};\n\n/** Page-space touch point, tolerating the several shapes a Fabric touch payload can take. */\nfunction touchPoint(event: NativeSyntheticEvent): { x: number; y: number } {\n const native = (event.nativeEvent ?? {}) as {\n pageX?: number;\n pageY?: number;\n touches?: { pageX?: number; pageY?: number }[];\n };\n const touch = native.touches?.[0];\n return {\n x: native.pageX ?? touch?.pageX ?? 0,\n y: native.pageY ?? touch?.pageY ?? 0,\n };\n}\n\n/** What `rippleDrawable` builds: Android's `RippleAndroid` drawable description. */\ninterface RippleDrawable {\n readonly type: 'RippleAndroid';\n readonly color: unknown;\n readonly borderless: boolean;\n readonly rippleRadius: number | undefined;\n}\n\nconst now = (): number => globalThis.performance?.now?.() ?? Date.now();\n\n/**\n * The press machine, and the base of every primitive that takes a touch.\n *\n * It declares no host bindings of its own, because `Text` extends it and a host binding runs on\n * every element that carries it, on every pass. The controls bind theirs through `ControlBase`.\n */\n@Directive()\nexport abstract class TouchableBase extends ViewBase {\n /** Ignore touches entirely. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * How far outside the hit area a touch may wander before the press is cancelled. Native's\n * `hitSlop` grows the area a touch can start in; this grows the area it may move within.\n */\n readonly pressRetentionOffset = input<Insets | number>();\n /** Milliseconds a touch must be held before `(longPress)` fires. */\n readonly delayLongPress = input(DEFAULT_LONG_PRESS_DELAY, { transform: numberAttribute });\n /** Milliseconds between the touch landing and `(pressIn)`, so a scroll can start first. */\n readonly delayPressIn = input(0, { transform: numberAttribute });\n /** Milliseconds between the touch lifting and `(pressOut)`. */\n readonly delayPressOut = input(0, { transform: numberAttribute });\n /** The pressed state lasts at least this long, so a quick tap still shows it. */\n readonly minPressDuration = input(DEFAULT_MIN_PRESS_DURATION, { transform: numberAttribute });\n /** Whether a scrolling ancestor may take the gesture away mid-press. */\n readonly cancelable = input(true, { transform: booleanAttribute });\n /** Android: a native ripple on press. */\n readonly androidRipple = input<AndroidRipple>(undefined, { alias: 'android_ripple' });\n\n /** The touch lifted inside the press area. Not fired after a `(longPress)` that has a listener. */\n readonly press = output<PressEvent>();\n readonly pressIn = output<PressEvent>();\n readonly pressOut = output<PressEvent>();\n /**\n * The touch has been held for `delayLongPress`. With no listener there is no long press, as in\n * React Native, so a slow tap is still a `press`.\n */\n readonly longPress = output<PressEvent>();\n\n /** Whether a press is in progress, for the pressed look. */\n readonly pressed = signal(false);\n\n /**\n * Whether a pointer is over the control, which on this platform means an iPad with a trackpad\n * or a mouse. Always false on a phone, because a phone never sends a pointer event.\n *\n * Opted into by exactly the elements that opt into being measured, which is the same question\n * asked twice: is this a control, or is it a piece of text that merely inherits the machinery.\n * Registering on everything was the first attempt and put two props on every paragraph on\n * screen, which is the most numerous node in an app paying for a state a label cannot use.\n */\n readonly hovered = signal(false);\n\n /*\n * Methods rather than `computed()`s, because nearly every instance has no ripple and a computed\n * is an allocation per element whether or not it ever holds anything. The drawable is kept for as\n * long as the ripple it came from, which is the memo the computed was there to provide: a fresh\n * object on every pass would re-send the prop on every pass.\n */\n protected rippleBackground(): RippleDrawable | undefined {\n const ripple = this.androidRipple();\n return ripple && !ripple.foreground ? this.drawable(ripple) : undefined;\n }\n\n protected rippleForeground(): RippleDrawable | undefined {\n const ripple = this.androidRipple();\n return ripple?.foreground ? this.drawable(ripple) : undefined;\n }\n\n private drawn: { ripple: AndroidRipple; drawable: RippleDrawable } | null = null;\n\n private drawable(ripple: AndroidRipple): RippleDrawable {\n if (this.drawn?.ripple !== ripple)\n this.drawn = { ripple, drawable: this.rippleDrawable(ripple) };\n return this.drawn.drawable;\n }\n\n /**\n * The drawable description Android's `ReactDrawableHelper` reads.\n *\n * `color` goes through the engine the way every other colour prop does, and has to: the helper\n * switches on the value's runtime type and takes a number or a platform-colour map, and anything\n * else - a `'#ff0000'` written at the call site, say - falls through to `null` and the ripple\n * draws in the theme's own `colorControlHighlight` instead. Nothing is logged and nothing throws,\n * so the ripple appears and is simply the wrong colour. RN's own `TouchableNativeFeedback.Ripple`\n * calls `processColor` here for the same reason.\n */\n private rippleDrawable(ripple: AndroidRipple): RippleDrawable {\n return {\n type: 'RippleAndroid' as const,\n color: this.engine.color(ripple.color),\n borderless: ripple.borderless ?? false,\n rippleRadius: ripple.radius,\n };\n }\n\n /** Where the touch started, so a drag can be told apart from a tap. */\n private origin: { x: number; y: number } | null = null;\n /** The control's own size, from its last layout. Null until it has been measured once. */\n private size: { width: number; height: number } | null = null;\n private cancelled = false;\n private longPressed = false;\n /** How many `(longPress)` listeners there are; the long-press clock only runs with one. */\n private longPressListeners = 0;\n private pressedAt = 0;\n private pressInTimer: ReturnType<typeof setTimeout> | null = null;\n private longPressTimer: ReturnType<typeof setTimeout> | null = null;\n private pressOutTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n super();\n // output() has to be a member's own initializer for the compiler to see it, so its listeners\n // are counted here, through its public subscribe.\n const subscribe = this.longPress.subscribe.bind(this.longPress);\n this.longPress.subscribe = (callback) => {\n this.longPressListeners++;\n const subscription = subscribe(callback);\n let open = true;\n return {\n unsubscribe: () => {\n if (open) this.longPressListeners--;\n open = false;\n subscription.unsubscribe();\n },\n };\n };\n }\n\n /** Called as a press starts and ends, for a subclass that shows it natively. `Text` does. */\n protected pressedChanged(_pressed: boolean): void {}\n\n /** Whether a touch starting on this node should be claimed. `Text` narrows it. */\n protected claims(): boolean {\n return !this.disabled();\n }\n\n /**\n * Whether the control's size should be tracked. Native only measures a view that asks, so\n * this must not be true for every `<text>`: a pressable text opts in, a label never does.\n */\n protected measures(): boolean {\n return true;\n }\n\n /**\n * Whether a touch this far from where it started is still on the control.\n *\n * Distance from the origin is the wrong question on anything large: a thumb tap on a full-width\n * button easily travels twenty points without ever leaving it, and cancelling there reads as\n * \"the button doesn't work\", intermittently and only for some people. What matters is whether\n * the finger is still within the control plus its hit slop, plus the slop RN allows.\n *\n * The touch began somewhere inside the control but we do not know where, so the bound is the\n * full extent rather than half of it. That errs towards keeping the press, which is the right\n * way to be wrong: a press that survives a drag the user meant as a scroll is a smaller sin\n * than a tap that does nothing.\n */\n private stillOnControl(dx: number, dy: number): boolean {\n if (!this.size) return Math.hypot(dx, dy) <= PRESS_CANCEL_DISTANCE;\n const slop = insets(this.hitSlop(), { top: 0, left: 0, right: 0, bottom: 0 });\n const keep = insets(this.pressRetentionOffset(), DEFAULT_PRESS_RETENTION);\n const horizontal = dx < 0 ? slop.left + keep.left : slop.right + keep.right;\n const vertical = dy < 0 ? slop.top + keep.top : slop.bottom + keep.bottom;\n return (\n Math.abs(dx) <= this.size.width + horizontal && Math.abs(dy) <= this.size.height + vertical\n );\n }\n\n /**\n * A lifecycle hook rather than `inject(DestroyRef).onDestroy`: Angular registers a hook once per\n * directive type, where the callback was a closure and a lookup for every instance - and every\n * `<text>` on screen is one.\n */\n ngOnDestroy(): void {\n this.clearTimers();\n this.stopResponding?.();\n this.stopLayout?.();\n this.stopHover?.();\n }\n\n private stopResponding: (() => void) | null = null;\n private stopLayout: (() => void) | null = null;\n private stopHover: (() => void) | null = null;\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.respondIfNeeded();\n this.measureIfNeeded();\n this.hoverIfNeeded();\n }\n\n override ngOnChanges(): void {\n super.ngOnChanges();\n this.respondIfNeeded();\n this.measureIfNeeded();\n this.hoverIfNeeded();\n }\n\n /**\n * Join the responder negotiation, once this is something a touch can press.\n *\n * Behind `measures()` for the same reason as layout and hover: a `<text>` is the commonest node\n * on screen and almost never a control, and registering every one cost a handler object, six\n * closures and a responder entry apiece for a touch it would have refused anyway.\n */\n private respondIfNeeded(): void {\n if (this.stopResponding || !this.measures()) return;\n this.stopResponding = this.engine.setResponder(this.node, {\n // Claim the gesture on touch down unless disabled. Because this goes through the\n // negotiation, an ancestor can pre-empt us in the capture pass and a nested pressable\n // wins over us in the bubble pass, neither of which raw touch listeners could express.\n onStartShouldSetResponder: () => this.claims(),\n onResponderGrant: (event) => this.onGrant(event),\n onResponderMove: (event) => this.onMove(event),\n onResponderRelease: (event) => this.onRelease(event),\n onResponderTerminate: (event) => this.onTerminate(event),\n // Yield to an enclosing scroll view when it takes over the drag, unless told not to.\n onResponderTerminationRequest: () => this.cancelable(),\n });\n }\n\n /**\n * `onLayout` is opted into by the engine as soon as something listens for it, which is the only\n * way the native side reports a view's size at all, and the reason it is only asked for once\n * `measures()` says so - a `<text>` answers that from an input, and most of them say no.\n *\n * Called from the lifecycle rather than watched by an effect. An effect per element is an\n * allocation and a scheduler entry for every pressable and every piece of text on screen, to\n * notice a change these two hooks already see.\n */\n /**\n * Hover, on the same terms and behind the same question.\n *\n * Fabric will not dispatch a pointer event to a view whose props have not asked for one, and\n * the engine writes those props when something listens - so listening is the whole opt-in. The\n * gate is `measures()`, which is not what its name is about but is the right question underneath\n * it: is this an actual control, or a piece of text that merely inherits the machinery. A label\n * says no, and two props on every paragraph on screen is not a cost worth paying for a hover\n * state a label has no use for.\n *\n * Never true on a phone, which sends no pointer events at all. This is the one thing an iPad\n * with a trackpad has that a phone does not.\n */\n private hoverIfNeeded(): void {\n if (this.stopHover || !this.measures()) return;\n const enter = this.engine.setEventListener(this.node, 'topPointerEnter', () =>\n this.hovered.set(true),\n );\n const leave = this.engine.setEventListener(this.node, 'topPointerLeave', () =>\n this.hovered.set(false),\n );\n this.stopHover = () => {\n enter();\n leave();\n };\n }\n\n private measureIfNeeded(): void {\n if (this.stopLayout || !this.measures()) return;\n this.stopLayout = this.engine.setEventListener(this.node, 'topLayout', (event) => {\n const layout = (event as NativeSyntheticEvent<{ layout?: { width: number; height: number } }>)\n .nativeEvent?.layout;\n if (layout) this.size = { width: layout.width, height: layout.height };\n });\n }\n\n private onGrant(event: PressEvent): void {\n this.origin = touchPoint(event);\n this.cancelled = false;\n this.longPressed = false;\n this.clearTimers();\n if (this.androidRipple()) {\n const { x, y } = this.origin;\n this.engine.dispatchCommand(this.node, 'hotspotUpdate', [x, y]);\n this.engine.dispatchCommand(this.node, 'setPressed', [true]);\n }\n const delay = this.delayPressIn();\n if (delay > 0) this.pressInTimer = setTimeout(() => this.activate(event), delay);\n else this.activate(event);\n }\n\n /** `pressIn`, and the long-press clock starts from here. */\n private activate(event: PressEvent): void {\n this.pressInTimer = null;\n this.pressedAt = now();\n this.pressed.set(true);\n this.pressedChanged(true);\n this.pressIn.emit(event);\n if (!this.longPressListeners) return;\n this.longPressTimer = setTimeout(() => {\n this.longPressTimer = null;\n this.longPressed = true;\n this.longPress.emit(event);\n }, this.delayLongPress());\n }\n\n private onMove(event: PressEvent): void {\n if (this.cancelled || !this.origin) return;\n const point = touchPoint(event);\n if (this.stillOnControl(point.x - this.origin.x, point.y - this.origin.y)) return;\n // The finger has wandered: this is a drag, not a tap. Give up the press but stay the\n // responder, so a scroll view underneath still gets its gesture.\n this.cancelled = true;\n this.deactivate(event);\n }\n\n private onRelease(event: PressEvent): void {\n if (this.androidRipple()) this.engine.dispatchCommand(this.node, 'setPressed', [false]);\n if (this.cancelled) return;\n // Lifted before the press-in delay ran out: RN still reports a full press.\n if (this.pressInTimer) {\n clearTimeout(this.pressInTimer);\n this.activate(event);\n }\n const longPressed = this.longPressed;\n this.deactivate(event);\n if (!longPressed) this.press.emit(event);\n }\n\n private onTerminate(event: PressEvent): void {\n if (this.androidRipple()) this.engine.dispatchCommand(this.node, 'setPressed', [false]);\n if (this.cancelled) return;\n this.cancelled = true;\n this.deactivate(event);\n }\n\n /** `pressOut`, no sooner than `minPressDuration` after `pressIn` and after `delayPressOut`. */\n private deactivate(event: PressEvent): void {\n if (this.pressInTimer) {\n clearTimeout(this.pressInTimer);\n this.pressInTimer = null;\n return;\n }\n if (this.longPressTimer) {\n clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n }\n if (!this.pressed()) return;\n const held = now() - this.pressedAt;\n const delay = Math.max(this.delayPressOut(), this.minPressDuration() - held);\n const out = () => {\n this.pressOutTimer = null;\n this.pressed.set(false);\n this.pressedChanged(false);\n this.pressOut.emit(event);\n };\n if (delay > 0) this.pressOutTimer = setTimeout(out, delay);\n else out();\n }\n\n private clearTimers(): void {\n // Every touchable is destroyed through here, and nearly all of them were never pressed.\n if (!this.pressInTimer && !this.longPressTimer && !this.pressOutTimer) return;\n for (const timer of [this.pressInTimer, this.longPressTimer, this.pressOutTimer]) {\n if (timer) clearTimeout(timer);\n }\n this.pressInTimer = this.longPressTimer = this.pressOutTimer = null;\n }\n}\n\n/**\n * A touchable that is a control: `Pressable`, `TouchableOpacity` and `PressBehavior`.\n *\n * The host bindings every control needs live here rather than on `TouchableBase`, which `Text`\n * extends: the state that follows `disabled`, and the Android ripple. Controls are few enough on\n * a screen to pay for a binding on every pass; texts are not.\n */\n@Directive({\n host: {\n // `disabled` is an input of ours, so it cannot reach `ngOnChanges` on the base; this is\n // the one binding that keeps the announced state in step with it.\n '[accessibilityState]': 'accessibilityStateProp()',\n // Nor is it left on the node for `:disabled` to read, so this is what a stylesheet matches.\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[nativeBackgroundAndroid]': 'rippleBackground()',\n '[nativeForegroundAndroid]': 'rippleForeground()',\n },\n})\nexport abstract class ControlBase extends TouchableBase {}\n\n/**\n * The press machine on its own, for a component that wants to be pressable rather than to\n * contain something that is.\n *\n * No selector: this is only ever a `hostDirectives` entry. A component listing it gets the whole\n * of `TouchableBase` on its own host node - the responder negotiation, the press rectangle, the\n * delays and the long-press timer - instead of wrapping a `<pressable>` and paying for a second\n * native view.\n *\n * It provides `TouchableBase`, so a primitive on the same node can `inject(TouchableBase)` and\n * read `pressed` without caring whether it landed on this or on a real `<pressable>`.\n */\n@Directive({\n providers: [{ provide: TouchableBase, useExisting: forwardRef(() => PressBehavior) }],\n})\nexport class PressBehavior extends ControlBase {\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override disabledForAccessibility(): boolean {\n return this.disabled();\n }\n}\n\n/**\n * A view that responds to presses. RN's `Pressable`, with the same configuration: hit slop,\n * retention offset, press-in and press-out delays, long press, and an Android ripple.\n *\n * `pressed` is a public signal, so a template can style from it through a template reference:\n * `<pressable #p [style.opacity]=\"p.pressed() ? 0.5 : 1\">`.\n */\n@Directive({\n selector: 'pressable',\n exportAs: 'pressable',\n providers: [{ provide: TouchableBase, useExisting: forwardRef(() => Pressable) }],\n})\nexport class Pressable extends ControlBase {\n /** `Pressable.js`: a control is an accessibility element, and focusable, unless refused. */\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override disabledForAccessibility(): boolean {\n return this.disabled();\n }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;IAC9C,CAAC;uGAjCU,aAAa;2FAAb,aAAa,iCAFb,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;;2FAE1E,aAAa;kBAHzB,SAAS;mBAAC;oBACT,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,CAAC;iBACtF;;AAqCD;;;;;;GAMG;AAMH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,4FAA4F;IACzE,mBAAmB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,kBAAkB;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,wBAAwB;QACzC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;uGAZU,SAAS;2FAAT,SAAS,wDAFT,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;;2FAEtE,SAAS;kBALrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,WAAW;oBACrB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;iBAClF","sourcesContent":["/**\n * Press handling, built on the engine's responder system as RN's `Pressability` is.\n *\n * `onPress` is not a native event: RN synthesises it in JS from the touch primitives, with a\n * press rectangle, delays and a long-press timer around them. This is that machine, on the same\n * responder negotiation, so a button and an enclosing scroll view agree on who owns a drag.\n */\nimport {\n Directive,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n numberAttribute,\n output,\n signal,\n type Signal,\n} from '@angular/core';\nimport { nativePlatform, type NativeSyntheticEvent } from '@ng-native/fabric';\nimport type { Insets, TouchEvent } from './events.ts';\nimport { optionalBoolean } from './transforms.ts';\nimport { ViewBase } from './view-base.ts';\n\n/** What a press handler receives: RN's `{nativeEvent}` shape, passed straight through. */\nexport type PressEvent = TouchEvent;\n\n/**\n * Android's ripple, drawn natively. `foreground` paints it over the content rather than behind.\n */\nexport interface AndroidRipple {\n readonly color?: string | number;\n readonly borderless?: boolean;\n readonly radius?: number;\n readonly foreground?: boolean;\n}\n\n/**\n * How far outside its own bounds a control keeps a press: RN's `DEFAULT_PRESS_RECT_OFFSETS`.\n * More room below, because a thumb rolls downwards as it lifts.\n */\nconst DEFAULT_PRESS_RETENTION: Required<Insets> = { top: 20, left: 20, right: 20, bottom: 30 };\n/** RN's `DEFAULT_LONG_PRESS_DELAY_MS`. */\nconst DEFAULT_LONG_PRESS_DELAY = 500;\n/** RN's `DEFAULT_MIN_PRESS_DURATION`: the pressed look stays at least this long on a quick tap. */\nconst DEFAULT_MIN_PRESS_DURATION = 130;\n\n/**\n * Used only until a control has been measured. RN measures the view and cancels when the touch\n * leaves its bounds plus the retention offset; before the first layout arrives there are no\n * bounds to compare against, so fall back to a small movement threshold rather than treating a\n * drag of any length as a tap.\n */\nconst PRESS_CANCEL_DISTANCE = 15;\n\nconst insets = (value: Insets | number | undefined, fallback: Required<Insets>) => {\n if (value === undefined) return fallback;\n if (typeof value === 'number') return { top: value, left: value, right: value, bottom: value };\n return {\n top: value.top ?? 0,\n left: value.left ?? 0,\n right: value.right ?? 0,\n bottom: value.bottom ?? 0,\n };\n};\n\n/** Page-space touch point, tolerating the several shapes a Fabric touch payload can take. */\nfunction touchPoint(event: NativeSyntheticEvent): { x: number; y: number } {\n const native = (event.nativeEvent ?? {}) as {\n pageX?: number;\n pageY?: number;\n touches?: { pageX?: number; pageY?: number }[];\n };\n const touch = native.touches?.[0];\n return {\n x: native.pageX ?? touch?.pageX ?? 0,\n y: native.pageY ?? touch?.pageY ?? 0,\n };\n}\n\n/** What `rippleDrawable` builds: Android's `RippleAndroid` drawable description. */\ninterface RippleDrawable {\n readonly type: 'RippleAndroid';\n readonly color: unknown;\n readonly borderless: boolean;\n readonly rippleRadius: number | undefined;\n}\n\nconst now = (): number => globalThis.performance?.now?.() ?? Date.now();\n\n/**\n * The press machine, and the base of every primitive that takes a touch.\n *\n * It declares no host bindings of its own, because `Text` extends it and a host binding runs on\n * every element that carries it, on every pass. The controls bind theirs through `ControlBase`.\n */\n@Directive()\nexport abstract class TouchableBase extends ViewBase {\n /**\n * Ignore touches entirely. Undefined until set, because React Native tells \"not passed\" from\n * \"passed false\": only a passed `disabled` wins over `aria-disabled` in what is announced.\n */\n readonly disabled = input(undefined, { transform: optionalBoolean });\n\n /**\n * How far outside the hit area a touch may wander before the press is cancelled. Native's\n * `hitSlop` grows the area a touch can start in; this grows the area it may move within.\n */\n readonly pressRetentionOffset = input<Insets | number>();\n /** Milliseconds a touch must be held before `(longPress)` fires. */\n readonly delayLongPress = input(DEFAULT_LONG_PRESS_DELAY, { transform: numberAttribute });\n /** Milliseconds between the touch landing and `(pressIn)`, so a scroll can start first. */\n readonly delayPressIn = input(0, { transform: numberAttribute });\n /** Milliseconds between the touch lifting and `(pressOut)`. */\n readonly delayPressOut = input(0, { transform: numberAttribute });\n /** The pressed state lasts at least this long, so a quick tap still shows it. */\n readonly minPressDuration = input(DEFAULT_MIN_PRESS_DURATION, { transform: numberAttribute });\n /** Whether a scrolling ancestor may take the gesture away mid-press. */\n readonly cancelable = input(true, { transform: booleanAttribute });\n /** Android: a native ripple on press. */\n readonly androidRipple = input<AndroidRipple>(undefined, { alias: 'android_ripple' });\n\n /** The touch lifted inside the press area. Not fired after a `(longPress)` that has a listener. */\n readonly press = output<PressEvent>();\n readonly pressIn = output<PressEvent>();\n readonly pressOut = output<PressEvent>();\n /**\n * The touch has been held for `delayLongPress`. With no listener there is no long press, as in\n * React Native, so a slow tap is still a `press`.\n */\n readonly longPress = output<PressEvent>();\n\n /** Whether a press is in progress, for the pressed look. */\n readonly pressed = signal(false);\n\n /**\n * Whether a pointer is over the control, which on this platform means an iPad with a trackpad\n * or a mouse. Always false on a phone, because a phone never sends a pointer event.\n *\n * Opted into by exactly the elements that opt into being measured, which is the same question\n * asked twice: is this a control, or is it a piece of text that merely inherits the machinery.\n * Registering on everything was the first attempt and put two props on every paragraph on\n * screen, which is the most numerous node in an app paying for a state a label cannot use.\n */\n readonly hovered = signal(false);\n\n /*\n * Methods rather than `computed()`s, because nearly every instance has no ripple and a computed\n * is an allocation per element whether or not it ever holds anything. The drawable is kept for as\n * long as the ripple it came from, which is the memo the computed was there to provide: a fresh\n * object on every pass would re-send the prop on every pass.\n */\n protected rippleBackground(): RippleDrawable | undefined {\n const ripple = this.androidRipple();\n return ripple && !ripple.foreground ? this.drawable(ripple) : undefined;\n }\n\n protected rippleForeground(): RippleDrawable | undefined {\n const ripple = this.androidRipple();\n return ripple?.foreground ? this.drawable(ripple) : undefined;\n }\n\n private drawn: { ripple: AndroidRipple; drawable: RippleDrawable } | null = null;\n\n private drawable(ripple: AndroidRipple): RippleDrawable {\n if (this.drawn?.ripple !== ripple)\n this.drawn = { ripple, drawable: this.rippleDrawable(ripple) };\n return this.drawn.drawable;\n }\n\n /**\n * The drawable description Android's `ReactDrawableHelper` reads.\n *\n * `color` goes through the engine the way every other colour prop does, and has to: the helper\n * switches on the value's runtime type and takes a number or a platform-colour map, and anything\n * else - a `'#ff0000'` written at the call site, say - falls through to `null` and the ripple\n * draws in the theme's own `colorControlHighlight` instead. Nothing is logged and nothing throws,\n * so the ripple appears and is simply the wrong colour. RN's own `TouchableNativeFeedback.Ripple`\n * calls `processColor` here for the same reason.\n */\n private rippleDrawable(ripple: AndroidRipple): RippleDrawable {\n return {\n type: 'RippleAndroid' as const,\n color: this.engine.color(ripple.color),\n borderless: ripple.borderless ?? false,\n rippleRadius: ripple.radius,\n };\n }\n\n /** Where the touch started, so a drag can be told apart from a tap. */\n private origin: { x: number; y: number } | null = null;\n /** The control's own size, from its last layout. Null until it has been measured once. */\n private size: { width: number; height: number } | null = null;\n private cancelled = false;\n private longPressed = false;\n /** How many `(longPress)` listeners there are; the long-press clock only runs with one. */\n private longPressListeners = 0;\n private pressedAt = 0;\n private pressInTimer: ReturnType<typeof setTimeout> | null = null;\n private longPressTimer: ReturnType<typeof setTimeout> | null = null;\n private pressOutTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n super();\n // output() has to be a member's own initializer for the compiler to see it, so its listeners\n // are counted here, through its public subscribe.\n const subscribe = this.longPress.subscribe.bind(this.longPress);\n this.longPress.subscribe = (callback) => {\n this.longPressListeners++;\n const subscription = subscribe(callback);\n let open = true;\n return {\n unsubscribe: () => {\n if (open) this.longPressListeners--;\n open = false;\n subscription.unsubscribe();\n },\n };\n };\n }\n\n /** Called as a press starts and ends, for a subclass that shows it natively. `Text` does. */\n protected pressedChanged(_pressed: boolean): void {}\n\n /** Whether a touch starting on this node should be claimed. `Text` narrows it. */\n protected claims(): boolean {\n return !this.pressDisabled();\n }\n\n /**\n * Whether presses are refused. `Pressable.js` gives Pressability `disabled` alone, so here\n * `aria-disabled` and `accessibilityState.disabled` change what is announced and nothing else.\n * `TouchableOpacity` and `Text` widen it.\n */\n protected pressDisabled(): boolean {\n return !!this.disabled();\n }\n\n /**\n * `TouchableOpacity.js` and `Text.js`: `disabled ?? aria-disabled ?? accessibilityState.disabled`,\n * which is the merged announced state whenever `disabled` is unset.\n */\n protected disabledByAnyState(): boolean {\n return (this.disabled() ?? this.accessibilityStateProp()?.disabled) === true;\n }\n\n /**\n * Whether the control's size should be tracked. Native only measures a view that asks, so\n * this must not be true for every `<text>`: a pressable text opts in, a label never does.\n */\n protected measures(): boolean {\n return true;\n }\n\n /**\n * Whether a touch this far from where it started is still on the control.\n *\n * Distance from the origin is the wrong question on anything large: a thumb tap on a full-width\n * button easily travels twenty points without ever leaving it, and cancelling there reads as\n * \"the button doesn't work\", intermittently and only for some people. What matters is whether\n * the finger is still within the control plus its hit slop, plus the slop RN allows.\n *\n * The touch began somewhere inside the control but we do not know where, so the bound is the\n * full extent rather than half of it. That errs towards keeping the press, which is the right\n * way to be wrong: a press that survives a drag the user meant as a scroll is a smaller sin\n * than a tap that does nothing.\n */\n private stillOnControl(dx: number, dy: number): boolean {\n if (!this.size) return Math.hypot(dx, dy) <= PRESS_CANCEL_DISTANCE;\n const slop = insets(this.hitSlop(), { top: 0, left: 0, right: 0, bottom: 0 });\n const keep = insets(this.pressRetentionOffset(), DEFAULT_PRESS_RETENTION);\n const horizontal = dx < 0 ? slop.left + keep.left : slop.right + keep.right;\n const vertical = dy < 0 ? slop.top + keep.top : slop.bottom + keep.bottom;\n return (\n Math.abs(dx) <= this.size.width + horizontal && Math.abs(dy) <= this.size.height + vertical\n );\n }\n\n /**\n * A lifecycle hook rather than `inject(DestroyRef).onDestroy`: Angular registers a hook once per\n * directive type, where the callback was a closure and a lookup for every instance - and every\n * `<text>` on screen is one.\n */\n ngOnDestroy(): void {\n this.clearTimers();\n this.stopResponding?.();\n this.stopLayout?.();\n this.stopHover?.();\n this.stopClick?.();\n }\n\n private stopResponding: (() => void) | null = null;\n private stopLayout: (() => void) | null = null;\n private stopHover: (() => void) | null = null;\n private stopClick: (() => void) | null = null;\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.respondIfNeeded();\n this.measureIfNeeded();\n this.hoverIfNeeded();\n this.clickIfNeeded();\n }\n\n override ngOnChanges(): void {\n super.ngOnChanges();\n this.respondIfNeeded();\n this.measureIfNeeded();\n this.hoverIfNeeded();\n this.clickIfNeeded();\n }\n\n /**\n * A press with no touch: Android's `performClick()`, which is what Enter, the D-pad centre and\n * TalkBack's double-tap do to a focused view, and which reaches us as `topClick` alone.\n *\n * `Pressability.js` answers it in `onClick`: `onPress` and nothing around it, not while disabled,\n * and not for a click carrying a `pointerType`, which is the pointer event a touch already\n * pressed through. It presses only the view that was clicked: a touchable the click only bubbled\n * through stops it there, so neither it nor anything above it acts on a click meant for a\n * focusable view inside it.\n *\n * Android only. iOS sends a click only as a pointer event, and the web host binds `topClick` to\n * the DOM's own click, which a mouse press already reached through the responder.\n */\n private clickIfNeeded(): void {\n if (this.stopClick || !this.measures() || nativePlatform() !== 'android') return;\n this.stopClick = this.engine.setEventListener(this.node, 'topClick', (event) => {\n const click = event as PressEvent;\n if (!this.measures() || Object.hasOwn(click.nativeEvent ?? {}, 'pointerType')) return;\n if (click.target !== this.node) {\n click.stopPropagation();\n return;\n }\n if (this.claims()) this.press.emit(click);\n });\n }\n\n /**\n * Join the responder negotiation, once this is something a touch can press.\n *\n * Behind `measures()` for the same reason as layout and hover: a `<text>` is the commonest node\n * on screen and almost never a control, and registering every one cost a handler object, six\n * closures and a responder entry apiece for a touch it would have refused anyway.\n */\n private respondIfNeeded(): void {\n if (this.stopResponding || !this.measures()) return;\n this.stopResponding = this.engine.setResponder(this.node, {\n // Claim the gesture on touch down unless disabled. Because this goes through the\n // negotiation, an ancestor can pre-empt us in the capture pass and a nested pressable\n // wins over us in the bubble pass, neither of which raw touch listeners could express.\n onStartShouldSetResponder: () => this.claims(),\n onResponderGrant: (event) => this.onGrant(event),\n onResponderMove: (event) => this.onMove(event),\n onResponderRelease: (event) => this.onRelease(event),\n onResponderTerminate: (event) => this.onTerminate(event),\n // Yield to an enclosing scroll view when it takes over the drag, unless told not to.\n onResponderTerminationRequest: () => this.cancelable(),\n });\n }\n\n /**\n * `onLayout` is opted into by the engine as soon as something listens for it, which is the only\n * way the native side reports a view's size at all, and the reason it is only asked for once\n * `measures()` says so - a `<text>` answers that from an input, and most of them say no.\n *\n * Called from the lifecycle rather than watched by an effect. An effect per element is an\n * allocation and a scheduler entry for every pressable and every piece of text on screen, to\n * notice a change these two hooks already see.\n */\n /**\n * Hover, on the same terms and behind the same question.\n *\n * Fabric will not dispatch a pointer event to a view whose props have not asked for one, and\n * the engine writes those props when something listens - so listening is the whole opt-in. The\n * gate is `measures()`, which is not what its name is about but is the right question underneath\n * it: is this an actual control, or a piece of text that merely inherits the machinery. A label\n * says no, and two props on every paragraph on screen is not a cost worth paying for a hover\n * state a label has no use for.\n *\n * Never true on a phone, which sends no pointer events at all. This is the one thing an iPad\n * with a trackpad has that a phone does not.\n */\n private hoverIfNeeded(): void {\n if (this.stopHover || !this.measures()) return;\n const enter = this.engine.setEventListener(this.node, 'topPointerEnter', () =>\n this.hovered.set(true),\n );\n const leave = this.engine.setEventListener(this.node, 'topPointerLeave', () =>\n this.hovered.set(false),\n );\n this.stopHover = () => {\n enter();\n leave();\n };\n }\n\n private measureIfNeeded(): void {\n if (this.stopLayout || !this.measures()) return;\n this.stopLayout = this.engine.setEventListener(this.node, 'topLayout', (event) => {\n const layout = (event as NativeSyntheticEvent<{ layout?: { width: number; height: number } }>)\n .nativeEvent?.layout;\n if (layout) this.size = { width: layout.width, height: layout.height };\n });\n }\n\n private onGrant(event: PressEvent): void {\n this.origin = touchPoint(event);\n this.cancelled = false;\n this.longPressed = false;\n this.clearTimers();\n if (this.androidRipple()) {\n const { x, y } = this.origin;\n this.engine.dispatchCommand(this.node, 'hotspotUpdate', [x, y]);\n this.engine.dispatchCommand(this.node, 'setPressed', [true]);\n }\n const delay = this.delayPressIn();\n if (delay > 0) this.pressInTimer = setTimeout(() => this.activate(event), delay);\n else this.activate(event);\n }\n\n /** `pressIn`, and the long-press clock starts from here. */\n private activate(event: PressEvent): void {\n this.pressInTimer = null;\n this.pressedAt = now();\n this.pressed.set(true);\n this.pressedChanged(true);\n this.pressIn.emit(event);\n if (!this.longPressListeners) return;\n this.longPressTimer = setTimeout(() => {\n this.longPressTimer = null;\n this.longPressed = true;\n this.longPress.emit(event);\n }, this.delayLongPress());\n }\n\n private onMove(event: PressEvent): void {\n if (this.cancelled || !this.origin) return;\n const point = touchPoint(event);\n if (this.stillOnControl(point.x - this.origin.x, point.y - this.origin.y)) return;\n // The finger has wandered: this is a drag, not a tap. Give up the press but stay the\n // responder, so a scroll view underneath still gets its gesture.\n this.cancelled = true;\n this.deactivate(event);\n }\n\n private onRelease(event: PressEvent): void {\n if (this.androidRipple()) this.engine.dispatchCommand(this.node, 'setPressed', [false]);\n if (this.cancelled) return;\n // Lifted before the press-in delay ran out: RN still reports a full press.\n if (this.pressInTimer) {\n clearTimeout(this.pressInTimer);\n this.activate(event);\n }\n const longPressed = this.longPressed;\n this.deactivate(event);\n if (!longPressed) this.press.emit(event);\n }\n\n private onTerminate(event: PressEvent): void {\n if (this.androidRipple()) this.engine.dispatchCommand(this.node, 'setPressed', [false]);\n if (this.cancelled) return;\n this.cancelled = true;\n this.deactivate(event);\n }\n\n /** `pressOut`, no sooner than `minPressDuration` after `pressIn` and after `delayPressOut`. */\n private deactivate(event: PressEvent): void {\n if (this.pressInTimer) {\n clearTimeout(this.pressInTimer);\n this.pressInTimer = null;\n return;\n }\n if (this.longPressTimer) {\n clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n }\n if (!this.pressed()) return;\n const held = now() - this.pressedAt;\n const delay = Math.max(this.delayPressOut(), this.minPressDuration() - held);\n const out = () => {\n this.pressOutTimer = null;\n this.pressed.set(false);\n this.pressedChanged(false);\n this.pressOut.emit(event);\n };\n if (delay > 0) this.pressOutTimer = setTimeout(out, delay);\n else out();\n }\n\n private clearTimers(): void {\n // Every touchable is destroyed through here, and nearly all of them were never pressed.\n if (!this.pressInTimer && !this.longPressTimer && !this.pressOutTimer) return;\n for (const timer of [this.pressInTimer, this.longPressTimer, this.pressOutTimer]) {\n if (timer) clearTimeout(timer);\n }\n this.pressInTimer = this.longPressTimer = this.pressOutTimer = null;\n }\n}\n\n/**\n * A touchable that is a control: `Pressable`, `TouchableOpacity` and `PressBehavior`.\n *\n * The host bindings every control needs live here rather than on `TouchableBase`, which `Text`\n * extends: the state that follows `disabled`, and the Android ripple. Controls are few enough on\n * a screen to pay for a binding on every pass; texts are not.\n */\n@Directive({\n host: {\n // `disabled` is an input of ours, so it cannot reach `ngOnChanges` on the base; this is\n // the one binding that keeps the announced state in step with it.\n '[accessibilityState]': 'accessibilityStateProp()',\n // Nor is it left on the node for `:disabled` to read, so this is what a stylesheet matches.\n '[attr.data-disabled]': \"pressDisabled() ? '' : null\",\n '[nativeBackgroundAndroid]': 'rippleBackground()',\n '[nativeForegroundAndroid]': 'rippleForeground()',\n },\n})\nexport abstract class ControlBase extends TouchableBase {}\n\n/**\n * The press machine on its own, for a component that wants to be pressable rather than to\n * contain something that is.\n *\n * No selector: this is only ever a `hostDirectives` entry. A component listing it gets the whole\n * of `TouchableBase` on its own host node - the responder negotiation, the press rectangle, the\n * delays and the long-press timer - instead of wrapping a `<pressable>` and paying for a second\n * native view.\n *\n * It provides `TouchableBase`, so a primitive on the same node can `inject(TouchableBase)` and\n * read `pressed` without caring whether it landed on this or on a real `<pressable>`.\n */\n@Directive({\n providers: [{ provide: TouchableBase, useExisting: forwardRef(() => PressBehavior) }],\n})\nexport class PressBehavior extends ControlBase {\n /** The conditions the composing component gave, any of which disables the control. */\n private readonly conditions = signal<readonly Signal<boolean>[]>([]);\n private readonly held = computed(() => this.conditions().some((condition) => condition()));\n\n /**\n * Disable the control while `condition` is true, from the component that composes this: a\n * button that is loading, which its caller's `disabled` knows nothing of. Either one disables\n * it, as `disabled={loading || disabled}` does on React Native's `Pressable`: presses are\n * refused, a stylesheet sees `[data-disabled]`, and a screen reader is told.\n *\n * constructor() {\n * inject(PressBehavior).disableWhile(this.loading);\n * }\n */\n disableWhile(condition: Signal<boolean>): void {\n this.conditions.update((conditions) => [...conditions, condition]);\n }\n\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override pressDisabled(): boolean {\n return this.held() || super.pressDisabled();\n }\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.held() ? true : this.disabled();\n }\n}\n\n/**\n * A view that responds to presses. RN's `Pressable`, with the same configuration: hit slop,\n * retention offset, press-in and press-out delays, long press, and an Android ripple.\n *\n * `pressed` is a public signal, so a template can style from it through a template reference:\n * `<pressable #p [style.opacity]=\"p.pressed() ? 0.5 : 1\">`.\n */\n@Directive({\n selector: 'pressable',\n exportAs: 'pressable',\n providers: [{ provide: TouchableBase, useExisting: forwardRef(() => Pressable) }],\n})\nexport class Pressable extends ControlBase {\n /** `Pressable.js`: a control is an accessibility element, and focusable, unless refused. */\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.disabled();\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { MutableValue, WorkletScrollSpec, WorkletStyleSpec } from './worklets.ts';
2
+ import * as i0 from "@angular/core";
3
+ export { workletScroll, workletStyle, type SharedValue, type WorkletScrollSpec, type WorkletStyleSpec, } from './worklets.ts';
4
+ /**
5
+ * A shared value as a plain holder, with no second runtime to share it with. Every write reaches
6
+ * the listeners added with `addListener`.
7
+ */
8
+ export declare function sharedValue<T>(initial: T): MutableValue<T>;
9
+ export declare class WorkletStyle {
10
+ readonly workletStyle: import("@angular/core").InputSignal<WorkletStyleSpec>;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<WorkletStyle, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<WorkletStyle, "[workletStyle]", never, { "workletStyle": { "alias": "workletStyle"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
13
+ }
14
+ export declare class WorkletScroll {
15
+ readonly workletScroll: import("@angular/core").InputSignal<WorkletScrollSpec>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<WorkletScroll, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<WorkletScroll, "[workletScroll]", never, { "workletScroll": { "alias": "workletScroll"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * `reanimated.ts`, for a browser build.
3
+ *
4
+ * A web bundler resolves `@ng-native/components/reanimated` here, through the `browser` condition
5
+ * in this package's `exports`; Metro, on a device, never sets that condition and gets the native
6
+ * file. A browser has no UI-thread runtime to run a worklet on, so everything here is inert: the
7
+ * names are the same, a template that binds `[workletStyle]` or `[workletScroll]` still renders,
8
+ * and the directives do nothing.
9
+ */
10
+ import { Directive, input } from '@angular/core';
11
+ import * as i0 from "@angular/core";
12
+ export { workletScroll, workletStyle, } from "./worklets.js";
13
+ /**
14
+ * A shared value as a plain holder, with no second runtime to share it with. Every write reaches
15
+ * the listeners added with `addListener`.
16
+ */
17
+ export function sharedValue(initial) {
18
+ let current = initial;
19
+ const listeners = new Map();
20
+ const write = (next) => {
21
+ current = next;
22
+ for (const listener of listeners.values())
23
+ listener(next);
24
+ };
25
+ return {
26
+ get value() {
27
+ return current;
28
+ },
29
+ set value(next) {
30
+ write(next);
31
+ },
32
+ get: () => current,
33
+ set: (next) => write(typeof next === 'function' ? next(current) : next),
34
+ modify: (modifier = (value) => value) => write(modifier(current)),
35
+ addListener: (id, listener) => void listeners.set(id, listener),
36
+ removeListener: (id) => void listeners.delete(id),
37
+ };
38
+ }
39
+ export class WorkletStyle {
40
+ workletStyle = input.required(/* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "workletStyle" }] : /* istanbul ignore next */ []));
42
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: WorkletStyle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
43
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: WorkletStyle, isStandalone: true, selector: "[workletStyle]", inputs: { workletStyle: { classPropertyName: "workletStyle", publicName: "workletStyle", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: WorkletStyle, decorators: [{
46
+ type: Directive,
47
+ args: [{ selector: '[workletStyle]' }]
48
+ }], propDecorators: { workletStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "workletStyle", required: true }] }] } });
49
+ export class WorkletScroll {
50
+ workletScroll = input.required(/* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "workletScroll" }] : /* istanbul ignore next */ []));
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: WorkletScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive });
53
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: WorkletScroll, isStandalone: true, selector: "[workletScroll]", inputs: { workletScroll: { classPropertyName: "workletScroll", publicName: "workletScroll", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
54
+ }
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: WorkletScroll, decorators: [{
56
+ type: Directive,
57
+ args: [{ selector: '[workletScroll]' }]
58
+ }], propDecorators: { workletScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "workletScroll", required: true }] }] } });
59
+ //# sourceMappingURL=reanimated-web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reanimated-web.js","sourceRoot":"","sources":["../src/reanimated-web.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;AAGjD,OAAO,EACL,aAAa,EACb,YAAY,GAIb,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAI,OAAU;IACvC,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,MAAM,SAAS,GAAG,IAAI,GAAG,EAA8B,CAAC;IACxD,MAAM,KAAK,GAAG,CAAC,IAAO,EAAE,EAAE;QACxB,OAAO,GAAG,IAAI,CAAC;QACf,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;IACF,OAAO;QACL,IAAI,KAAK;YACP,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,KAAK,CAAC,IAAI;YACZ,KAAK,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO;QAClB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAE,IAAwB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5F,MAAM,EAAE,CAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjE,WAAW,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC;QAC/D,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC;AAGD,MAAM,OAAO,YAAY;IACd,YAAY,GAAG,KAAK,CAAC,QAAQ;qFAAoB,CAAC;uGADhD,YAAY;2FAAZ,YAAY;;2FAAZ,YAAY;kBADxB,SAAS;mBAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE;;AAMzC,MAAM,OAAO,aAAa;IACf,aAAa,GAAG,KAAK,CAAC,QAAQ;sFAAqB,CAAC;uGADlD,aAAa;2FAAb,aAAa;;2FAAb,aAAa;kBADzB,SAAS;mBAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE","sourcesContent":["/**\n * `reanimated.ts`, for a browser build.\n *\n * A web bundler resolves `@ng-native/components/reanimated` here, through the `browser` condition\n * in this package's `exports`; Metro, on a device, never sets that condition and gets the native\n * file. A browser has no UI-thread runtime to run a worklet on, so everything here is inert: the\n * names are the same, a template that binds `[workletStyle]` or `[workletScroll]` still renders,\n * and the directives do nothing.\n */\nimport { Directive, input } from '@angular/core';\nimport type { MutableValue, WorkletScrollSpec, WorkletStyleSpec } from './worklets.ts';\n\nexport {\n workletScroll,\n workletStyle,\n type SharedValue,\n type WorkletScrollSpec,\n type WorkletStyleSpec,\n} from './worklets.ts';\n\n/**\n * A shared value as a plain holder, with no second runtime to share it with. Every write reaches\n * the listeners added with `addListener`.\n */\nexport function sharedValue<T>(initial: T): MutableValue<T> {\n let current = initial;\n const listeners = new Map<number, (value: T) => void>();\n const write = (next: T) => {\n current = next;\n for (const listener of listeners.values()) listener(next);\n };\n return {\n get value() {\n return current;\n },\n set value(next) {\n write(next);\n },\n get: () => current,\n set: (next) => write(typeof next === 'function' ? (next as (value: T) => T)(current) : next),\n modify: (modifier = (value) => value) => write(modifier(current)),\n addListener: (id, listener) => void listeners.set(id, listener),\n removeListener: (id) => void listeners.delete(id),\n };\n}\n\n@Directive({ selector: '[workletStyle]' })\nexport class WorkletStyle {\n readonly workletStyle = input.required<WorkletStyleSpec>();\n}\n\n@Directive({ selector: '[workletScroll]' })\nexport class WorkletScroll {\n readonly workletScroll = input.required<WorkletScrollSpec>();\n}\n"]}
@@ -1,14 +1,14 @@
1
- import { type SharedValue as Mutable } from 'react-native-reanimated';
2
1
  import { WorkletScrollBase } from './worklet-scroll.ts';
3
2
  import { WorkletStyleBase } from './worklet-style.ts';
3
+ import { type MutableValue } from './worklets.ts';
4
4
  import * as i0 from "@angular/core";
5
5
  export { workletScroll, workletStyle, type SharedValue, type WorkletScrollSpec, type WorkletStyleSpec, } from './worklets.ts';
6
6
  /**
7
7
  * A value both runtimes can see. Reanimated's own `useSharedValue` is this plus a React ref, and
8
- * the ref is the half that does not apply here. Typed as Reanimated's own, so it goes to
9
- * `cancelAnimation` and the rest of the library as one of theirs would.
8
+ * the ref is the half that does not apply here. Typed with the shape of Reanimated's own, so it
9
+ * goes to `cancelAnimation` and the rest of the library as one of theirs would.
10
10
  */
11
- export declare function sharedValue<T>(initial: T): Mutable<T>;
11
+ export declare function sharedValue<T>(initial: T): MutableValue<T>;
12
12
  export declare class WorkletStyle extends WorkletStyleBase {
13
13
  static ɵfac: i0.ɵɵFactoryDeclaration<WorkletStyle, never>;
14
14
  static ɵdir: i0.ɵɵDirectiveDeclaration<WorkletStyle, "[workletStyle]", never, {}, {}, never, never, true, never>;
@@ -31,7 +31,7 @@
31
31
  * them, and re-exporting them here would only add a name to keep in step.
32
32
  */
33
33
  import { Directive } from '@angular/core';
34
- import { makeMutable, startMapper, stopMapper, } from 'react-native-reanimated';
34
+ import { makeMutable, startMapper, stopMapper } from 'react-native-reanimated';
35
35
  import { WorkletScrollBase } from "./worklet-scroll.js";
36
36
  import { WorkletStyleBase } from "./worklet-style.js";
37
37
  import { WORKLETS } from "./worklets.js";
@@ -50,8 +50,8 @@ const { updateProps } = require('react-native-reanimated/src/updateProps/index.t
50
50
  export { workletScroll, workletStyle, } from "./worklets.js";
51
51
  /**
52
52
  * A value both runtimes can see. Reanimated's own `useSharedValue` is this plus a React ref, and
53
- * the ref is the half that does not apply here. Typed as Reanimated's own, so it goes to
54
- * `cancelAnimation` and the rest of the library as one of theirs would.
53
+ * the ref is the half that does not apply here. Typed with the shape of Reanimated's own, so it
54
+ * goes to `cancelAnimation` and the rest of the library as one of theirs would.
55
55
  */
56
56
  export function sharedValue(initial) {
57
57
  return makeMutable(initial);
@@ -1 +1 @@
1
- {"version":3,"file":"reanimated.js","sourceRoot":"","sources":["../src/reanimated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAuB,MAAM,eAAe,CAAC;;AAf9D;;;;;;;;;GASG;AACH,MAAM,EAAE,WAAW,EAAE,GAAG,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AE,oBAAoB,EAAE,sBAAsB,EAAE,GACpD,OAAO,CAAC,qCAAqC,CAO5C,CAAC;AAMJ,MAAM,OAAO,YAAa,SAAQ,gBAAgB;uGAArC,YAAY;2FAAZ,YAAY,6DAFZ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;2FAE1C,YAAY;kBAJxB,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;iBACtD;;AAOD,MAAM,OAAO,aAAc,SAAQ,iBAAiB;uGAAvC,aAAa;2FAAb,aAAa,8DAFb,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;2FAE1C,aAAa;kBAJzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;iBACtD","sourcesContent":["/**\n * Reanimated, without React: a style computed on the UI thread, bound to one of our nodes.\n *\n * ```ts\n * import { WorkletStyle, sharedValue, workletStyle } from '@ng-native/components/reanimated';\n *\n * protected readonly offset = sharedValue(0);\n * protected readonly slide = workletStyle([this.offset], (offset) => {\n * 'worklet';\n * return { transform: [{ translateX: offset.value }] };\n * });\n * ```\n * ```html\n * <view [workletStyle]=\"slide\">\n * ```\n *\n * Deliberately outside the barrel: everything here reaches React Native's\n * Flow source, which Node cannot parse, and the rest of the package has to stay loadable in the\n * test suite.\n *\n * What makes this work at all is that Reanimated addresses a view by its **shadow node**, not by a\n * React instance. `getShadowNodeWrapperFromRef` digs one out of a fiber; our engine has held the\n * same object since it created the node, so there is nothing to dig for. `startMapper` and\n * `makeMutable` are public, and the whole React half of `useAnimatedStyle` - refs, effects, the\n * animated component wrapper - is what an Angular directive replaces.\n *\n * An app installs `react-native-reanimated` and `react-native-worklets` itself, and gets the\n * worklet Babel plugin from `babel-preset-expo`, which adds it as soon as the package is present.\n * Everything else an animation needs - `withTiming`, `withSpring`, `interpolate`, `Easing` - is\n * imported from `react-native-reanimated` directly: they are plain functions with no React in\n * them, and re-exporting them here would only add a name to keep in step.\n */\nimport { Directive } from '@angular/core';\nimport {\n makeMutable,\n startMapper,\n stopMapper,\n type SharedValue as Mutable,\n} from 'react-native-reanimated';\n/**\n * `updateProps` is what every animated style in Reanimated goes through, and there is no exported\n * equivalent. It is a worklet, so it is called from ours rather than from here.\n *\n * Two things about the import. It goes through `src/` because that is where the package's own\n * `react-native` field points and Metro prefers that field: the built `lib/` copy would be a\n * second Reanimated in the bundle, with module state of its own. And it is a `require`, so that\n * these sources stay out of our type-checking program, where they fail against settings they were\n * never written for.\n */\nconst { updateProps } = require('react-native-reanimated/src/updateProps/index.ts') as {\n updateProps(descriptors: object, updates: Record<string, unknown>): void;\n};\nimport { WorkletScrollBase } from './worklet-scroll.ts';\nimport { WorkletStyleBase } from './worklet-style.ts';\nimport { WORKLETS, type WorkletBackend } from './worklets.ts';\n\nexport {\n workletScroll,\n workletStyle,\n type SharedValue,\n type WorkletScrollSpec,\n type WorkletStyleSpec,\n} from './worklets.ts';\n\n/**\n * A value both runtimes can see. Reanimated's own `useSharedValue` is this plus a React ref, and\n * the ref is the half that does not apply here. Typed as Reanimated's own, so it goes to\n * `cancelAnimation` and the rest of the library as one of theirs would.\n */\nexport function sharedValue<T>(initial: T): Mutable<T> {\n return makeMutable(initial);\n}\n\nconst backend: WorkletBackend = {\n bind: (target, style) => {\n // The shape `updateProps` takes: a `{ value }` holder of descriptors, so that the set of\n // views a style drives can change without the worklet being rebuilt. Ours never does - one\n // directive drives one node - so a plain object is enough.\n const descriptors = { value: [{ tag: target.tag, shadowNodeWrapper: target.shadowNode }] };\n const { values, updater } = style;\n const id = startMapper(() => {\n 'worklet';\n updateProps(descriptors, updater(...values));\n }, values as unknown[]);\n return () => stopMapper(id);\n },\n\n scroll: (target, spec) => {\n const { values, handler } = spec;\n // The same registration a gesture uses, on the name React Native's scroll views emit. The\n // event still reaches our own listeners: Reanimated observes it rather than consuming it.\n const id = registerEventHandler(\n (event: never) => {\n 'worklet';\n handler(event, ...values);\n },\n 'onScroll',\n target.tag,\n );\n return () => unregisterEventHandler(id);\n },\n};\n\n/**\n * Not public, and the same call Reanimated's own `WorkletEventHandler` makes. Reached through\n * `src/` for the reason `updateProps` is, and required rather than imported so that those sources\n * stay out of our type-checking program.\n */\nconst { registerEventHandler, unregisterEventHandler } =\n require('react-native-reanimated/src/core.ts') as {\n registerEventHandler(\n worklet: (event: never) => void,\n eventName: string,\n emitterReactTag: number,\n ): number;\n unregisterEventHandler(id: number): void;\n };\n\n@Directive({\n selector: '[workletStyle]',\n providers: [{ provide: WORKLETS, useValue: backend }],\n})\nexport class WorkletStyle extends WorkletStyleBase {}\n\n@Directive({\n selector: '[workletScroll]',\n providers: [{ provide: WORKLETS, useValue: backend }],\n})\nexport class WorkletScroll extends WorkletScrollBase {}\n"]}
1
+ {"version":3,"file":"reanimated.js","sourceRoot":"","sources":["../src/reanimated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAc/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAA0C,MAAM,eAAe,CAAC;;AAfjF;;;;;;;;;GASG;AACH,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,kDAAkD,CAEjF,CAAC;AAKF,OAAO,EACL,aAAa,EACb,YAAY,GAIb,MAAM,eAAe,CAAC;AAEvB;;;;GAIG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AAgB;uGAArC,YAAY;2FAAZ,YAAY,6DAFZ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;2FAE1C,YAAY;kBAJxB,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;iBACtD;;AAOD,MAAM,OAAO,aAAc,SAAQ,iBAAiB;uGAAvC,aAAa;2FAAb,aAAa,8DAFb,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;2FAE1C,aAAa;kBAJzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;iBACtD","sourcesContent":["/**\n * Reanimated, without React: a style computed on the UI thread, bound to one of our nodes.\n *\n * ```ts\n * import { WorkletStyle, sharedValue, workletStyle } from '@ng-native/components/reanimated';\n *\n * protected readonly offset = sharedValue(0);\n * protected readonly slide = workletStyle([this.offset], (offset) => {\n * 'worklet';\n * return { transform: [{ translateX: offset.value }] };\n * });\n * ```\n * ```html\n * <view [workletStyle]=\"slide\">\n * ```\n *\n * Deliberately outside the barrel: everything here reaches React Native's\n * Flow source, which Node cannot parse, and the rest of the package has to stay loadable in the\n * test suite.\n *\n * What makes this work at all is that Reanimated addresses a view by its **shadow node**, not by a\n * React instance. `getShadowNodeWrapperFromRef` digs one out of a fiber; our engine has held the\n * same object since it created the node, so there is nothing to dig for. `startMapper` and\n * `makeMutable` are public, and the whole React half of `useAnimatedStyle` - refs, effects, the\n * animated component wrapper - is what an Angular directive replaces.\n *\n * An app installs `react-native-reanimated` and `react-native-worklets` itself, and gets the\n * worklet Babel plugin from `babel-preset-expo`, which adds it as soon as the package is present.\n * Everything else an animation needs - `withTiming`, `withSpring`, `interpolate`, `Easing` - is\n * imported from `react-native-reanimated` directly: they are plain functions with no React in\n * them, and re-exporting them here would only add a name to keep in step.\n */\nimport { Directive } from '@angular/core';\nimport { makeMutable, startMapper, stopMapper } from 'react-native-reanimated';\n/**\n * `updateProps` is what every animated style in Reanimated goes through, and there is no exported\n * equivalent. It is a worklet, so it is called from ours rather than from here.\n *\n * Two things about the import. It goes through `src/` because that is where the package's own\n * `react-native` field points and Metro prefers that field: the built `lib/` copy would be a\n * second Reanimated in the bundle, with module state of its own. And it is a `require`, so that\n * these sources stay out of our type-checking program, where they fail against settings they were\n * never written for.\n */\nconst { updateProps } = require('react-native-reanimated/src/updateProps/index.ts') as {\n updateProps(descriptors: object, updates: Record<string, unknown>): void;\n};\nimport { WorkletScrollBase } from './worklet-scroll.ts';\nimport { WorkletStyleBase } from './worklet-style.ts';\nimport { WORKLETS, type MutableValue, type WorkletBackend } from './worklets.ts';\n\nexport {\n workletScroll,\n workletStyle,\n type SharedValue,\n type WorkletScrollSpec,\n type WorkletStyleSpec,\n} from './worklets.ts';\n\n/**\n * A value both runtimes can see. Reanimated's own `useSharedValue` is this plus a React ref, and\n * the ref is the half that does not apply here. Typed with the shape of Reanimated's own, so it\n * goes to `cancelAnimation` and the rest of the library as one of theirs would.\n */\nexport function sharedValue<T>(initial: T): MutableValue<T> {\n return makeMutable(initial);\n}\n\nconst backend: WorkletBackend = {\n bind: (target, style) => {\n // The shape `updateProps` takes: a `{ value }` holder of descriptors, so that the set of\n // views a style drives can change without the worklet being rebuilt. Ours never does - one\n // directive drives one node - so a plain object is enough.\n const descriptors = { value: [{ tag: target.tag, shadowNodeWrapper: target.shadowNode }] };\n const { values, updater } = style;\n const id = startMapper(() => {\n 'worklet';\n updateProps(descriptors, updater(...values));\n }, values as unknown[]);\n return () => stopMapper(id);\n },\n\n scroll: (target, spec) => {\n const { values, handler } = spec;\n // The same registration a gesture uses, on the name React Native's scroll views emit. The\n // event still reaches our own listeners: Reanimated observes it rather than consuming it.\n const id = registerEventHandler(\n (event: never) => {\n 'worklet';\n handler(event, ...values);\n },\n 'onScroll',\n target.tag,\n );\n return () => unregisterEventHandler(id);\n },\n};\n\n/**\n * Not public, and the same call Reanimated's own `WorkletEventHandler` makes. Reached through\n * `src/` for the reason `updateProps` is, and required rather than imported so that those sources\n * stay out of our type-checking program.\n */\nconst { registerEventHandler, unregisterEventHandler } =\n require('react-native-reanimated/src/core.ts') as {\n registerEventHandler(\n worklet: (event: never) => void,\n eventName: string,\n emitterReactTag: number,\n ): number;\n unregisterEventHandler(id: number): void;\n };\n\n@Directive({\n selector: '[workletStyle]',\n providers: [{ provide: WORKLETS, useValue: backend }],\n})\nexport class WorkletStyle extends WorkletStyleBase {}\n\n@Directive({\n selector: '[workletScroll]',\n providers: [{ provide: WORKLETS, useValue: backend }],\n})\nexport class WorkletScroll extends WorkletScrollBase {}\n"]}
@@ -16,7 +16,10 @@ import * as i0 from "@angular/core";
16
16
  * the same, like on iOS, and moved into place after each pass; see `SwipeRefreshLayout`.
17
17
  */
18
18
  export declare class RefreshControl extends ViewBase implements AfterViewChecked {
19
- /** Whether the spinner shows. Two-way: `[(refreshing)]`. */
19
+ /**
20
+ * Whether the spinner shows. Only the app changes it: a pull fires `(refresh)` and leaves this
21
+ * alone, so `[(refreshing)]` and `[refreshing]` behave the same.
22
+ */
20
23
  readonly refreshing: import("@angular/core").ModelSignal<boolean>;
21
24
  /** How far from the top the spinner sits. */
22
25
  readonly progressViewOffset: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
@@ -19,7 +19,10 @@ import * as i0 from "@angular/core";
19
19
  * the same, like on iOS, and moved into place after each pass; see `SwipeRefreshLayout`.
20
20
  */
21
21
  export class RefreshControl extends ViewBase {
22
- /** Whether the spinner shows. Two-way: `[(refreshing)]`. */
22
+ /**
23
+ * Whether the spinner shows. Only the app changes it: a pull fires `(refresh)` and leaves this
24
+ * alone, so `[(refreshing)]` and `[refreshing]` behave the same.
25
+ */
23
26
  refreshing = model(false, /* @ts-ignore */
24
27
  ...(ngDevMode ? [{ debugName: "refreshing" }] : /* istanbul ignore next */ []));
25
28
  /** How far from the top the spinner sits. */
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-control.js","sourceRoot":"","sources":["../src/refresh-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAE1C;;;;;;;;;;;;;GAaG;AAgBH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAC1C,4DAA4D;IACnD,UAAU,GAAG,KAAK,CAAC,KAAK;mFAAC,CAAC;IACnC,6CAA6C;IACpC,kBAAkB,GAAG,KAAK,CAAC,SAAS,0FAAI,SAAS,EAAE,cAAc,GAAG,CAAC;IAC9E,iCAAiC;IACxB,SAAS,GAAG,KAAK;6FAAU,CAAC;IACrC,sCAAsC;IAC7B,KAAK,GAAG,KAAK;yFAAU,CAAC;IACjC,+BAA+B;IACtB,UAAU,GAAG,KAAK;8FAAU,CAAC;IACtC,uDAAuD;IAC9C,MAAM,GAAG,KAAK;0FAAqB,CAAC;IAC7C,gEAAgE;IACvD,OAAO,GAAG,KAAK,CAAC,SAAS,+EAAI,SAAS,EAAE,eAAe,GAAG,CAAC;IACpE,yCAAyC;IAChC,uBAAuB,GAAG,KAAK;2GAAU,CAAC;IACnD,mCAAmC;IAC1B,IAAI,GAAG,KAAK;wFAAuB,CAAC;IAE5B,gBAAgB,GAAG,MAAM,CAAiB,IAAI;yFAAC,CAAC;I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wBACJ,cAAc,EAAE,cAAc;wBAC9B,sBAAsB,EAAE,sBAAsB;wBAC9C,aAAa,EAAE,aAAa;wBAC5B,SAAS,EAAE,SAAS;wBACpB,cAAc,EAAE,cAAc;wBAC9B,UAAU,EAAE,UAAU;wBACtB,WAAW,EAAE,WAAW;wBACxB,2BAA2B,EAAE,2BAA2B;wBACxD,QAAQ,EAAE,QAAQ;wBAClB,WAAW,EAAE,mBAAmB;qBACjC;iBACF","sourcesContent":["import {\n type AfterViewChecked,\n Directive,\n DestroyRef,\n afterEveryRender,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { Engine, type EngineNode, nativePlatform } from '@ng-native/fabric';\nimport { SwipeRefreshLayout } from './swipe-refresh-layout.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { ViewBase } from './view-base.ts';\n\n/**\n * Pull to refresh, as a child of a scroll view. Commits as `PullToRefreshView` on iOS and\n * `AndroidSwipeRefreshLayout` on Android.\n *\n * `refreshing` is a model: the pull fires `(refresh)`, the app sets `refreshing` to true while\n * it works and back to false when done. Native shows the spinner the instant the user pulls,\n * before the app has said anything, so the two can disagree. RN's wrapper reconciles them with\n * `setNativeRefreshing`; so does this. If the app never sets `refreshing` after a pull, the\n * spinner is stopped again, which is what RN's documentation warns about.\n *\n * On Android the swipe layout has to be the scroll view's *parent*, as RN's `ScrollView.js` makes\n * it, with the layout half of the scroll view's style moved onto it. It is written as a child all\n * the same, like on iOS, and moved into place after each pass; see `SwipeRefreshLayout`.\n */\n@Directive({\n selector: 'refresh-control',\n host: {\n '[refreshing]': 'refreshing()',\n '[progressViewOffset]': 'progressViewOffset()',\n '[tintColor]': 'tintColor()',\n '[title]': 'title()',\n '[titleColor]': 'titleColor()',\n '[colors]': 'colors()',\n '[enabled]': 'enabled()',\n '[progressBackgroundColor]': 'progressBackgroundColor()',\n '[size]': 'size()',\n '(refresh)': 'onNativeRefresh()',\n },\n})\nexport class RefreshControl extends ViewBase implements AfterViewChecked {\n /** Whether the spinner shows. Two-way: `[(refreshing)]`. */\n readonly refreshing = model(false);\n /** How far from the top the spinner sits. */\n readonly progressViewOffset = input(undefined, { transform: optionalNumber });\n /** iOS: the spinner's colour. */\n readonly tintColor = input<string>();\n /** iOS: a label under the spinner. */\n readonly title = input<string>();\n /** iOS: the label's colour. */\n readonly titleColor = input<string>();\n /** Android: the colours the spinner cycles through. */\n readonly colors = input<readonly string[]>();\n /** Android: whether pulling does anything. Defaults to true. */\n readonly enabled = input(undefined, { transform: optionalBoolean });\n /** Android: the spinner's background. */\n readonly progressBackgroundColor = input<string>();\n /** Android: the spinner's size. */\n readonly size = input<'default' | 'large'>();\n\n private readonly nativeRefreshing = signal<boolean | null>(null);\n\n /** Android only: what moves this control's node to wrap the scroll view. */\n private readonly wrap =\n nativePlatform() === 'android'\n ? new SwipeRefreshLayout(inject(Engine), this.node as EngineNode)\n : null;\n\n constructor() {\n super();\n const wrap = this.wrap;\n if (wrap) {\n // After every render as well as after this control's own pass: Angular moving the scroll\n // view happens in some other component's pass, and this one's hooks would not see it.\n afterEveryRender(() => wrap.sync());\n inject(DestroyRef).onDestroy(() => wrap.unwrap());\n }\n effect(() => {\n const desired = this.refreshing();\n const native = this.nativeRefreshing();\n if (native !== null && native !== desired) {\n this.nativeRefreshing.set(desired);\n this.engine.dispatchCommand(this.node, 'setNativeRefreshing', [desired]);\n }\n });\n }\n\n /**\n * The scroll view's style is written in the pass that declared this control, so splitting it\n * here reaches native in the same commit.\n */\n ngAfterViewChecked(): void {\n this.wrap?.sync();\n }\n\n /** Native has already started spinning; the app is told and expected to set `refreshing`. */\n protected onNativeRefresh(): void {\n this.nativeRefreshing.set(true);\n }\n}\n"]}
1
+ {"version":3,"file":"refresh-control.js","sourceRoot":"","sources":["../src/refresh-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,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["import {\n type AfterViewChecked,\n Directive,\n DestroyRef,\n afterEveryRender,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { Engine, type EngineNode, nativePlatform } from '@ng-native/fabric';\nimport { SwipeRefreshLayout } from './swipe-refresh-layout.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { ViewBase } from './view-base.ts';\n\n/**\n * Pull to refresh, as a child of a scroll view. Commits as `PullToRefreshView` on iOS and\n * `AndroidSwipeRefreshLayout` on Android.\n *\n * `refreshing` is a model: the pull fires `(refresh)`, the app sets `refreshing` to true while\n * it works and back to false when done. Native shows the spinner the instant the user pulls,\n * before the app has said anything, so the two can disagree. RN's wrapper reconciles them with\n * `setNativeRefreshing`; so does this. If the app never sets `refreshing` after a pull, the\n * spinner is stopped again, which is what RN's documentation warns about.\n *\n * On Android the swipe layout has to be the scroll view's *parent*, as RN's `ScrollView.js` makes\n * it, with the layout half of the scroll view's style moved onto it. It is written as a child all\n * the same, like on iOS, and moved into place after each pass; see `SwipeRefreshLayout`.\n */\n@Directive({\n selector: 'refresh-control',\n host: {\n '[refreshing]': 'refreshing()',\n '[progressViewOffset]': 'progressViewOffset()',\n '[tintColor]': 'tintColor()',\n '[title]': 'title()',\n '[titleColor]': 'titleColor()',\n '[colors]': 'colors()',\n '[enabled]': 'enabled()',\n '[progressBackgroundColor]': 'progressBackgroundColor()',\n '[size]': 'size()',\n '(refresh)': 'onNativeRefresh()',\n },\n})\nexport class RefreshControl extends ViewBase implements AfterViewChecked {\n /**\n * Whether the spinner shows. Only the app changes it: a pull fires `(refresh)` and leaves this\n * alone, so `[(refreshing)]` and `[refreshing]` behave the same.\n */\n readonly refreshing = model(false);\n /** How far from the top the spinner sits. */\n readonly progressViewOffset = input(undefined, { transform: optionalNumber });\n /** iOS: the spinner's colour. */\n readonly tintColor = input<string>();\n /** iOS: a label under the spinner. */\n readonly title = input<string>();\n /** iOS: the label's colour. */\n readonly titleColor = input<string>();\n /** Android: the colours the spinner cycles through. */\n readonly colors = input<readonly string[]>();\n /** Android: whether pulling does anything. Defaults to true. */\n readonly enabled = input(undefined, { transform: optionalBoolean });\n /** Android: the spinner's background. */\n readonly progressBackgroundColor = input<string>();\n /** Android: the spinner's size. */\n readonly size = input<'default' | 'large'>();\n\n private readonly nativeRefreshing = signal<boolean | null>(null);\n\n /** Android only: what moves this control's node to wrap the scroll view. */\n private readonly wrap =\n nativePlatform() === 'android'\n ? new SwipeRefreshLayout(inject(Engine), this.node as EngineNode)\n : null;\n\n constructor() {\n super();\n const wrap = this.wrap;\n if (wrap) {\n // After every render as well as after this control's own pass: Angular moving the scroll\n // view happens in some other component's pass, and this one's hooks would not see it.\n afterEveryRender(() => wrap.sync());\n inject(DestroyRef).onDestroy(() => wrap.unwrap());\n }\n effect(() => {\n const desired = this.refreshing();\n const native = this.nativeRefreshing();\n if (native !== null && native !== desired) {\n this.nativeRefreshing.set(desired);\n this.engine.dispatchCommand(this.node, 'setNativeRefreshing', [desired]);\n }\n });\n }\n\n /**\n * The scroll view's style is written in the pass that declared this control, so splitting it\n * here reaches native in the same commit.\n */\n ngAfterViewChecked(): void {\n this.wrap?.sync();\n }\n\n /** Native has already started spinning; the app is told and expected to set `refreshing`. */\n protected onNativeRefresh(): void {\n this.nativeRefreshing.set(true);\n }\n}\n"]}
@@ -33,6 +33,12 @@ import * as i0 from "@angular/core";
33
33
  export declare class ScrollView extends ScrollViewProps {
34
34
  /** Styles for the view that holds the children, e.g. padding and gap. */
35
35
  readonly contentContainerStyle: import("@angular/core").InputSignal<Record<string, unknown> | undefined>;
36
+ /**
37
+ * Classes for the view that holds the children, matched as if the view were written in the
38
+ * template the scroll view is. See `ContentContainer`. `contentContainerStyle` wins over it, as
39
+ * an inline style does over a class.
40
+ */
41
+ readonly contentContainerClass: import("@angular/core").InputSignal<string | undefined>;
36
42
  /**
37
43
  * The content view's style, with the row direction a horizontal scroll view needs.
38
44
  *
@@ -69,6 +75,16 @@ export declare class ScrollView extends ScrollViewProps {
69
75
  */
70
76
  protected readonly resolvedNestedScroll: import("@angular/core").Signal<boolean | undefined>;
71
77
  constructor();
78
+ /** The content's extent along the axis, and the scroll view's own, for `checkZeroSize`. */
79
+ private contentExtent;
80
+ private ownExtent;
81
+ private zeroSize;
82
+ /**
83
+ * In development only, the scroll view's own layout, to say when it stays at zero size with
84
+ * content in it. A release build listens for nothing, so it commits no `onLayout`.
85
+ */
86
+ private checkZeroSize;
87
+ private extent;
72
88
  /**
73
89
  * Sticky children are found again after each pass, because a pass can add or move them, and the
74
90
  * scroll offset is listened for only while there are any.
@@ -91,5 +107,5 @@ export declare class ScrollView extends ScrollViewProps {
91
107
  layout?: Size;
92
108
  }>): void;
93
109
  static ɵfac: i0.ɵɵFactoryDeclaration<ScrollView, never>;
94
- static ɵcmp: i0.ɵɵComponentDeclaration<ScrollView, "scroll-view", ["scrollView"], { "contentContainerStyle": { "alias": "contentContainerStyle"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "contentOffset": { "alias": "contentOffset"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "nestedScrollEnabled": { "alias": "nestedScrollEnabled"; "required": false; "isSignal": true; }; "stickyHeaderIndices": { "alias": "stickyHeaderIndices"; "required": false; "isSignal": true; }; }, { "contentSizeChange": "contentSizeChange"; }, ["refreshControl"], ["refresh-control", "*"], true, never>;
110
+ static ɵcmp: i0.ɵɵComponentDeclaration<ScrollView, "scroll-view", ["scrollView"], { "contentContainerStyle": { "alias": "contentContainerStyle"; "required": false; "isSignal": true; }; "contentContainerClass": { "alias": "contentContainerClass"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "contentOffset": { "alias": "contentOffset"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "nestedScrollEnabled": { "alias": "nestedScrollEnabled"; "required": false; "isSignal": true; }; "stickyHeaderIndices": { "alias": "stickyHeaderIndices"; "required": false; "isSignal": true; }; }, { "contentSizeChange": "contentSizeChange"; }, ["refreshControl"], ["refresh-control", "*"], true, never>;
95
111
  }