@symbiote-native/angular 0.8.0 → 2.0.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 (256) hide show
  1. package/README.md +13 -10
  2. package/babel-register-composed.cjs +58 -18
  3. package/bin/symbiote-angular-dev.cjs +16 -4
  4. package/build/angular/anchor-host-registry.js +1 -15
  5. package/build/angular/anchor-host-registry.js.map +1 -1
  6. package/build/angular/change-detection-flush.d.ts +31 -0
  7. package/build/angular/change-detection-flush.js +110 -0
  8. package/build/angular/change-detection-flush.js.map +1 -0
  9. package/build/angular/components/activity-indicator-props.d.ts +2 -0
  10. package/build/angular/components/activity-indicator-props.js +2 -0
  11. package/build/angular/components/activity-indicator-props.js.map +1 -0
  12. package/build/angular/components/button-props.d.ts +2 -0
  13. package/build/angular/components/button-props.js +2 -0
  14. package/build/angular/components/button-props.js.map +1 -0
  15. package/build/angular/components/flat-list/index.d.ts +2 -1
  16. package/build/angular/components/flat-list/index.js +22 -10
  17. package/build/angular/components/flat-list/index.js.map +1 -1
  18. package/build/angular/components/image-background-props.d.ts +6 -0
  19. package/build/angular/components/image-background-props.js +2 -0
  20. package/build/angular/components/image-background-props.js.map +1 -0
  21. package/build/angular/components/{image/shared.d.ts → image-shared.d.ts} +4 -4
  22. package/build/angular/components/{image/shared.js → image-shared.js} +39 -28
  23. package/build/angular/components/image-shared.js.map +1 -0
  24. package/build/angular/components/input-accessory-view-props.d.ts +7 -0
  25. package/build/angular/components/input-accessory-view-props.js +9 -0
  26. package/build/angular/components/input-accessory-view-props.js.map +1 -0
  27. package/build/angular/components/keyboard-avoiding-view/index.d.ts +2 -1
  28. package/build/angular/components/keyboard-avoiding-view/index.js +28 -27
  29. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  30. package/build/angular/components/modal/index.d.ts +2 -0
  31. package/build/angular/components/modal/index.js +33 -20
  32. package/build/angular/components/modal/index.js.map +1 -1
  33. package/build/angular/components/pressable-props.d.ts +32 -0
  34. package/build/angular/components/pressable-props.js +11 -0
  35. package/build/angular/components/pressable-props.js.map +1 -0
  36. package/build/angular/components/refresh-control-props.d.ts +16 -0
  37. package/build/angular/components/refresh-control-props.js +14 -0
  38. package/build/angular/components/refresh-control-props.js.map +1 -0
  39. package/build/angular/components/safe-area-view-props.d.ts +7 -0
  40. package/build/angular/components/safe-area-view-props.js +11 -0
  41. package/build/angular/components/safe-area-view-props.js.map +1 -0
  42. package/build/angular/components/scroll-view-props.d.ts +76 -0
  43. package/build/angular/components/scroll-view-props.js +18 -0
  44. package/build/angular/components/scroll-view-props.js.map +1 -0
  45. package/build/angular/components/section-list/index.d.ts +3 -0
  46. package/build/angular/components/section-list/index.js +10 -1
  47. package/build/angular/components/section-list/index.js.map +1 -1
  48. package/build/angular/components/text-input-props.d.ts +45 -0
  49. package/build/angular/components/text-input-props.js +18 -0
  50. package/build/angular/components/text-input-props.js.map +1 -0
  51. package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +6 -0
  52. package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.js +2 -0
  53. package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.js.map +1 -0
  54. package/build/angular/components/touchable-props.d.ts +14 -0
  55. package/build/angular/components/touchable-props.js +13 -0
  56. package/build/angular/components/touchable-props.js.map +1 -0
  57. package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +3 -0
  58. package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.js +2 -0
  59. package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.js.map +1 -0
  60. package/build/angular/components/virtualized-list/index.d.ts +8 -1
  61. package/build/angular/components/virtualized-list/index.js +373 -278
  62. package/build/angular/components/virtualized-list/index.js.map +1 -1
  63. package/build/angular/components/virtualized-section-list/index.d.ts +3 -0
  64. package/build/angular/components/virtualized-section-list/index.js +10 -1
  65. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  66. package/build/angular/components.d.ts +21 -27
  67. package/build/angular/components.js +13 -15
  68. package/build/angular/components.js.map +1 -1
  69. package/build/angular/create-portal/index.d.ts +11 -2
  70. package/build/angular/create-portal/index.js +37 -11
  71. package/build/angular/create-portal/index.js.map +1 -1
  72. package/build/angular/create-tunnel/index.js +1 -1
  73. package/build/angular/element-props.d.ts +53 -0
  74. package/build/angular/element-props.js +2 -0
  75. package/build/angular/element-props.js.map +1 -0
  76. package/build/angular/elements.d.ts +528 -0
  77. package/build/angular/elements.js +1444 -0
  78. package/build/angular/elements.js.map +1 -0
  79. package/build/angular/gate-demand.d.ts +37 -0
  80. package/build/angular/gate-demand.js +84 -0
  81. package/build/angular/gate-demand.js.map +1 -0
  82. package/build/angular/host-instance/index.js +1 -1
  83. package/build/angular/index.d.ts +5 -2
  84. package/build/angular/index.js +16 -1
  85. package/build/angular/index.js.map +1 -1
  86. package/build/angular/modules/animated/create-animated-component.d.ts +6 -6
  87. package/build/angular/modules/animated/create-animated-component.js +73 -81
  88. package/build/angular/modules/animated/create-animated-component.js.map +1 -1
  89. package/build/angular/modules/animated/index.js +1 -1
  90. package/build/angular/modules/animated/index.js.map +1 -1
  91. package/build/angular/modules/image/index.d.ts +3 -0
  92. package/build/angular/modules/image/index.js +16 -0
  93. package/build/angular/modules/image/index.js.map +1 -0
  94. package/build/angular/primitives/index.d.ts +28 -16
  95. package/build/angular/primitives/index.js +77 -31
  96. package/build/angular/primitives/index.js.map +1 -1
  97. package/build/angular/primitives/shared.d.ts +2 -3
  98. package/build/angular/primitives/shared.js +8 -53
  99. package/build/angular/primitives/shared.js.map +1 -1
  100. package/build/angular/register.d.ts +1 -0
  101. package/build/angular/register.js +16 -0
  102. package/build/angular/register.js.map +1 -0
  103. package/build/angular/render/index.js +4 -2
  104. package/build/angular/render/index.js.map +1 -1
  105. package/build/angular/renderer/index.js +207 -60
  106. package/build/angular/renderer/index.js.map +1 -1
  107. package/build/angular/renderer/value-change.d.ts +2 -0
  108. package/build/angular/renderer/value-change.js +9 -0
  109. package/build/angular/renderer/value-change.js.map +1 -0
  110. package/metro-config.cjs +23 -5
  111. package/metro-css-parser.cjs +2 -1
  112. package/package.json +17 -7
  113. package/src/anchor-host-registry.ts +1 -15
  114. package/src/change-detection-flush.ts +120 -0
  115. package/src/components/activity-indicator-props.ts +21 -0
  116. package/src/components/button-props.ts +26 -0
  117. package/src/components/flat-list/index.ts +12 -4
  118. package/src/components/image-background-props.ts +24 -0
  119. package/src/components/{image/shared.ts → image-shared.ts} +57 -26
  120. package/src/components/input-accessory-view-props.ts +21 -0
  121. package/src/components/keyboard-avoiding-view/index.ts +27 -16
  122. package/src/components/modal/index.ts +32 -11
  123. package/src/components/pressable-props.ts +73 -0
  124. package/src/components/refresh-control-props.ts +43 -0
  125. package/src/components/safe-area-view-props.ts +28 -0
  126. package/src/components/scroll-view-props.ts +109 -0
  127. package/src/components/section-list/index.ts +18 -0
  128. package/src/components/text-input-props.ts +72 -0
  129. package/src/components/touchable-native-feedback/touchable-native-feedback-props.ts +23 -0
  130. package/src/components/touchable-props.ts +30 -0
  131. package/src/components/touchable-without-feedback/touchable-without-feedback-props.ts +21 -0
  132. package/src/components/virtualized-list/index.ts +254 -153
  133. package/src/components/virtualized-section-list/index.ts +18 -0
  134. package/src/components.ts +86 -35
  135. package/src/create-portal/index.ts +39 -9
  136. package/src/create-tunnel/index.ts +1 -1
  137. package/src/diagnostics.ts +1 -1
  138. package/src/element-props.ts +90 -0
  139. package/src/elements.ts +919 -0
  140. package/src/gate-demand.ts +109 -0
  141. package/src/host-instance/index.ts +1 -1
  142. package/src/index.ts +54 -15
  143. package/src/modules/animated/create-animated-component.ts +73 -59
  144. package/src/modules/animated/index.ts +1 -1
  145. package/src/modules/image/index.ts +18 -0
  146. package/src/primitives/index.ts +47 -16
  147. package/src/primitives/shared.ts +11 -44
  148. package/src/register.ts +15 -0
  149. package/src/render/index.ts +4 -2
  150. package/src/renderer/index.ts +239 -80
  151. package/src/renderer/value-change.ts +8 -0
  152. package/build/angular/components/activity-indicator/index.android.d.ts +0 -13
  153. package/build/angular/components/activity-indicator/index.android.js +0 -29
  154. package/build/angular/components/activity-indicator/index.android.js.map +0 -1
  155. package/build/angular/components/activity-indicator/index.d.ts +0 -1
  156. package/build/angular/components/activity-indicator/index.ios.d.ts +0 -9
  157. package/build/angular/components/activity-indicator/index.ios.js +0 -26
  158. package/build/angular/components/activity-indicator/index.ios.js.map +0 -1
  159. package/build/angular/components/activity-indicator/index.js +0 -4
  160. package/build/angular/components/activity-indicator/index.js.map +0 -1
  161. package/build/angular/components/activity-indicator/shared.d.ts +0 -67
  162. package/build/angular/components/activity-indicator/shared.js +0 -260
  163. package/build/angular/components/activity-indicator/shared.js.map +0 -1
  164. package/build/angular/components/button.d.ts +0 -65
  165. package/build/angular/components/button.js +0 -351
  166. package/build/angular/components/button.js.map +0 -1
  167. package/build/angular/components/image/index.android.d.ts +0 -15
  168. package/build/angular/components/image/index.android.js +0 -91
  169. package/build/angular/components/image/index.android.js.map +0 -1
  170. package/build/angular/components/image/index.d.ts +0 -1
  171. package/build/angular/components/image/index.ios.d.ts +0 -15
  172. package/build/angular/components/image/index.ios.js +0 -91
  173. package/build/angular/components/image/index.ios.js.map +0 -1
  174. package/build/angular/components/image/index.js +0 -3
  175. package/build/angular/components/image/index.js.map +0 -1
  176. package/build/angular/components/image/shared.js.map +0 -1
  177. package/build/angular/components/image-background.d.ts +0 -82
  178. package/build/angular/components/image-background.js +0 -434
  179. package/build/angular/components/image-background.js.map +0 -1
  180. package/build/angular/components/input-accessory-view/index.d.ts +0 -65
  181. package/build/angular/components/input-accessory-view/index.js +0 -290
  182. package/build/angular/components/input-accessory-view/index.js.map +0 -1
  183. package/build/angular/components/pressable/index.d.ts +0 -129
  184. package/build/angular/components/pressable/index.js +0 -473
  185. package/build/angular/components/pressable/index.js.map +0 -1
  186. package/build/angular/components/refresh-control/index.d.ts +0 -90
  187. package/build/angular/components/refresh-control/index.js +0 -380
  188. package/build/angular/components/refresh-control/index.js.map +0 -1
  189. package/build/angular/components/safe-area-view/index.d.ts +0 -62
  190. package/build/angular/components/safe-area-view/index.js +0 -287
  191. package/build/angular/components/safe-area-view/index.js.map +0 -1
  192. package/build/angular/components/scroll-view/index.android.d.ts +0 -20
  193. package/build/angular/components/scroll-view/index.android.js +0 -262
  194. package/build/angular/components/scroll-view/index.android.js.map +0 -1
  195. package/build/angular/components/scroll-view/index.d.ts +0 -3
  196. package/build/angular/components/scroll-view/index.ios.d.ts +0 -8
  197. package/build/angular/components/scroll-view/index.ios.js +0 -92
  198. package/build/angular/components/scroll-view/index.ios.js.map +0 -1
  199. package/build/angular/components/scroll-view/index.js +0 -6
  200. package/build/angular/components/scroll-view/index.js.map +0 -1
  201. package/build/angular/components/scroll-view/projection.d.ts +0 -67
  202. package/build/angular/components/scroll-view/projection.js +0 -560
  203. package/build/angular/components/scroll-view/projection.js.map +0 -1
  204. package/build/angular/components/scroll-view/shared.d.ts +0 -239
  205. package/build/angular/components/scroll-view/shared.js +0 -832
  206. package/build/angular/components/scroll-view/shared.js.map +0 -1
  207. package/build/angular/components/scroll-view/sticky-header.d.ts +0 -40
  208. package/build/angular/components/scroll-view/sticky-header.js +0 -224
  209. package/build/angular/components/scroll-view/sticky-header.js.map +0 -1
  210. package/build/angular/components/switch/index.android.d.ts +0 -24
  211. package/build/angular/components/switch/index.android.js +0 -112
  212. package/build/angular/components/switch/index.android.js.map +0 -1
  213. package/build/angular/components/switch/index.d.ts +0 -1
  214. package/build/angular/components/switch/index.ios.d.ts +0 -23
  215. package/build/angular/components/switch/index.ios.js +0 -111
  216. package/build/angular/components/switch/index.ios.js.map +0 -1
  217. package/build/angular/components/switch/index.js +0 -4
  218. package/build/angular/components/switch/index.js.map +0 -1
  219. package/build/angular/components/switch/shared.d.ts +0 -49
  220. package/build/angular/components/switch/shared.js +0 -191
  221. package/build/angular/components/switch/shared.js.map +0 -1
  222. package/build/angular/components/text-input.d.ts +0 -161
  223. package/build/angular/components/text-input.js +0 -659
  224. package/build/angular/components/text-input.js.map +0 -1
  225. package/build/angular/components/touchable/index.d.ts +0 -276
  226. package/build/angular/components/touchable/index.js +0 -1422
  227. package/build/angular/components/touchable/index.js.map +0 -1
  228. package/build/angular/components/touchable-native-feedback/index.d.ts +0 -86
  229. package/build/angular/components/touchable-native-feedback/index.js +0 -407
  230. package/build/angular/components/touchable-native-feedback/index.js.map +0 -1
  231. package/src/components/activity-indicator/index.android.ts +0 -23
  232. package/src/components/activity-indicator/index.ios.ts +0 -21
  233. package/src/components/activity-indicator/index.ts +0 -4
  234. package/src/components/activity-indicator/shared.ts +0 -225
  235. package/src/components/button.ts +0 -220
  236. package/src/components/image/index.android.ts +0 -99
  237. package/src/components/image/index.ios.ts +0 -99
  238. package/src/components/image/index.ts +0 -3
  239. package/src/components/image-background.ts +0 -290
  240. package/src/components/input-accessory-view/index.ts +0 -240
  241. package/src/components/pressable/index.ts +0 -462
  242. package/src/components/refresh-control/index.ts +0 -340
  243. package/src/components/safe-area-view/index.ts +0 -231
  244. package/src/components/scroll-view/index.android.ts +0 -205
  245. package/src/components/scroll-view/index.ios.ts +0 -81
  246. package/src/components/scroll-view/index.ts +0 -7
  247. package/src/components/scroll-view/projection.ts +0 -713
  248. package/src/components/scroll-view/shared.ts +0 -1066
  249. package/src/components/scroll-view/sticky-header.ts +0 -267
  250. package/src/components/switch/index.android.ts +0 -113
  251. package/src/components/switch/index.ios.ts +0 -112
  252. package/src/components/switch/index.ts +0 -4
  253. package/src/components/switch/shared.ts +0 -284
  254. package/src/components/text-input.ts +0 -613
  255. package/src/components/touchable/index.ts +0 -913
  256. package/src/components/touchable-native-feedback/index.ts +0 -317
@@ -1,1422 +0,0 @@
1
- // The Touchable* family for Angular, all built on Pressable (the Angular twin of the React/Vue
2
- // adapter). The press-timing constants and the deactivation-floor math are shared with every
3
- // adapter (@symbiote-native/components/state/touchable); here Angular owns only the Animated wiring + the
4
- // press scheduling state:
5
- // TouchableOpacity: animate an Animated.Value opacity toward activeOpacity on press-in and back
6
- // to 1 on press-out, driven from Pressable's onPressIn/onPressOut. The opacity Value is held by
7
- // IDENTITY as a plain field (an engine object, never an @Input / reactive wrap) and the
8
- // <symbiote-animated-view> leaf commits it every frame.
9
- // TouchableHighlight: paint underlayColor + lower child opacity while the underlay is SHOWN.
10
- // RN drives that from onPressIn/onPress/onPressOut and holds it past the tap for delayPressOut,
11
- // NOT from Pressable's pressed flag — a tap too fast to see is already un-pressed by then.
12
- // TouchableWithoutFeedback: no visual change, but RN still runs the full press-timing machine.
13
- //
14
- // Every Touchable's own press/hover/accessibility events are now real @Output() EventEmitters too,
15
- // matching Pressable (which they wrap) — `(press)="handler($event)"`, never `[onPress]="handler"`.
16
- // Non-event config (delayLongPress, hitSlop, ...) still rides down as plain @Input() bindings.
17
- // Accessibility EVENTS forward straight through to Pressable's own outputs
18
- // (`(accessibilityAction)="accessibilityAction.emit($event)"`); accessibility STATE folds the web
19
- // aria-*/role aliases and merges `disabled` into the a11y state on Pressable's own host — no re-fold
20
- // here (the a11y host is Pressable's view, mirroring React's `...rest` -> Pressable). No JS-side
21
- // platform branch, so this stays a flat single file, mirroring React/Vue. Each Touchable
22
- // forwards the Angular Pressable surface verbatim; parity is against that surface, exactly as
23
- // React's Touchable parity is against
24
- // the React Pressable surface.
25
- import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, computed, ElementRef, EventEmitter, inject, Input, Output, signal, } from '@angular/core';
26
- import { createHighlightUnderlayHandlers, createHighlightUnderlayRuntime, createTouchableFeedbackHandlers, createTouchableFeedbackRuntime, hasTouchablePressHandler, resolveHighlightExtraStyles, restingOpacityFromStyle, DEFAULT_ACTIVE_OPACITY, OPACITY_ACTIVE_GRANT_DURATION_MS, OPACITY_INACTIVE_DURATION_MS, RESTING_OPACITY, TOUCHABLE_MIN_PRESS_DURATION_MS, } from '@symbiote-native/components';
27
- import {} from '@symbiote-native/engine';
28
- import { anchorHostStyle, anchorStyleProp, SymbioteStyleInputDirective, } from '../../primitives';
29
- import { Pressable } from '../pressable';
30
- import { Animated, AnimatedView } from '../../modules/animated';
31
- import * as i0 from "@angular/core";
32
- import * as i1 from "../../primitives/shared";
33
- function createTimerScheduler() {
34
- const pending = new Set();
35
- return {
36
- schedule(callback, ms) {
37
- const id = setTimeout(() => {
38
- pending.delete(cancel);
39
- callback();
40
- }, ms);
41
- const cancel = () => {
42
- clearTimeout(id);
43
- pending.delete(cancel);
44
- };
45
- pending.add(cancel);
46
- return cancel;
47
- },
48
- cancelAll() {
49
- for (const cancel of [...pending])
50
- cancel();
51
- pending.clear();
52
- },
53
- };
54
- }
55
- export class TouchableOpacity {
56
- press = new EventEmitter();
57
- pressIn = new EventEmitter();
58
- pressOut = new EventEmitter();
59
- pressMove = new EventEmitter();
60
- longPress = new EventEmitter();
61
- hoverIn = new EventEmitter();
62
- hoverOut = new EventEmitter();
63
- accessibilityAction = new EventEmitter();
64
- accessibilityTap = new EventEmitter();
65
- magicTap = new EventEmitter();
66
- accessibilityEscape = new EventEmitter();
67
- activeOpacity;
68
- delayPressIn;
69
- delayPressOut;
70
- minPressDuration;
71
- style;
72
- delayLongPress;
73
- delayHoverIn;
74
- delayHoverOut;
75
- disabled;
76
- cancelable;
77
- hitSlop;
78
- pressRetentionOffset;
79
- unstable_pressDelay;
80
- android_ripple;
81
- android_disableSound;
82
- testID;
83
- nativeID;
84
- hasTVPreferredFocus;
85
- nextFocusDown;
86
- nextFocusForward;
87
- nextFocusLeft;
88
- nextFocusRight;
89
- nextFocusUp;
90
- accessible;
91
- accessibilityLabel;
92
- accessibilityHint;
93
- accessibilityRole;
94
- accessibilityState;
95
- accessibilityValue;
96
- accessibilityActions;
97
- accessibilityLabelledBy;
98
- importantForAccessibility;
99
- accessibilityLiveRegion;
100
- screenReaderFocusable;
101
- accessibilityViewIsModal;
102
- accessibilityElementsHidden;
103
- accessibilityIgnoresInvertColors;
104
- accessibilityLanguage;
105
- accessibilityRespondsToUserInteraction;
106
- accessibilityShowsLargeContentViewer;
107
- accessibilityLargeContentTitle;
108
- ariaLabel;
109
- ariaBusy;
110
- ariaChecked;
111
- ariaDisabled;
112
- ariaExpanded;
113
- ariaHidden;
114
- ariaLabelledBy;
115
- ariaLive;
116
- ariaSelected;
117
- ariaModal;
118
- ariaValueMax;
119
- ariaValueMin;
120
- ariaValueNow;
121
- ariaValueText;
122
- id;
123
- role;
124
- // One Animated.Value per mount. Held by IDENTITY as a plain field (an engine object, never an
125
- // @Input / reactive wrap); the <symbiote-animated-view> leaf rasterizes it for the first paint
126
- // and drives it through setNativeProps every frame.
127
- //
128
- // RN seeds it from _getChildStyleOpacityWithDefault(props.style). Angular writes @Input()s AFTER
129
- // the field initializers run, so `style` is still undefined here — the real resting value is
130
- // seeded by the first ngOnChanges below, which still precedes the first template pass.
131
- opacity = new Animated.Value(RESTING_OPACITY);
132
- // The shared press-scheduling cell (delayPressIn timer + activation clock), persisted on the
133
- // instance; the machine's handlers are rebuilt per event over live @Input()s.
134
- runtime = createTouchableFeedbackRuntime();
135
- timers = createTimerScheduler();
136
- // What the last settle ran for. Undefined until the first ngOnChanges, which is the MOUNT.
137
- settled;
138
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
139
- // onto (see anchorHostStyle's doc comment) — NOT the <symbiote-animated-view> leaf one level down.
140
- elementRef = inject(ElementRef);
141
- // The (possibly animated) style the leaf reduces: the anchor's class-derived style first, then
142
- // the user's explicit style, then the live opacity layered on top (last wins via the style array
143
- // the commit layer flattens). `unknown` because the array mixes a plain style with an
144
- // AnimatedNode, exactly the bag AnimatedView's `style` input accepts.
145
- get animatedStyle() {
146
- return [this.anchorStyle(), this.style, { opacity: this.opacity }];
147
- }
148
- // The anchor's class-derived style is written by the renderer's addClass/removeClass at the USE
149
- // SITE - it never appears in SimpleChanges, and nothing about it dirties THIS component's view.
150
- // A `class=` present at creation therefore worked, while one toggled later did not: the parent
151
- // refreshed, the class landed on the anchor, and this component's own view was never refreshed,
152
- // so whatever merged the anchor style in was never re-evaluated. Polling it into a signal from
153
- // ngDoCheck fixes both halves: ngDoCheck runs during the PARENT's refresh even when this view is
154
- // skipped, and the signal write is what then marks this view for refresh. `signal.set`'s own
155
- // Object.is makes an unchanged poll a no-op, so there is no loop.
156
- anchorStyle = signal(undefined, /* @ts-ignore */
157
- ...(ngDevMode ? [{ debugName: "anchorStyle" }] : /* istanbul ignore next */ []));
158
- ngDoCheck() {
159
- this.anchorStyle.set(anchorHostStyle(this.elementRef));
160
- }
161
- // RN's componentDidUpdate: a changed `disabled` or a changed style opacity re-settles the view,
162
- // so a Touchable disabled mid-press does not stay stuck at its active opacity. The FIRST call is
163
- // the mount (ngOnChanges runs before ngOnInit and before the first template pass), so it seeds
164
- // the Value instead of animating — RN does this on update only, and a fade at mount would animate
165
- // away from the value the leaf is about to paint. A use site with no bindings gets no ngOnChanges
166
- // at all, and there the RESTING_OPACITY seed is already the right answer.
167
- ngOnChanges() {
168
- const settled = { disabled: this.disabled, resting: this.restingOpacity() };
169
- if (this.settled === undefined) {
170
- this.opacity.setValue(settled.resting);
171
- }
172
- else if (this.settled.disabled !== settled.disabled ||
173
- this.settled.resting !== settled.resting) {
174
- this.setOpacityTo(settled.resting, OPACITY_INACTIVE_DURATION_MS);
175
- }
176
- this.settled = settled;
177
- }
178
- // RN's componentWillUnmount: stop the animation so a teardown mid-fade leaves no driver running
179
- // against a node that is gone, and drop any press-out still deferred behind a timer.
180
- ngOnDestroy() {
181
- this.timers.cancelAll();
182
- this.opacity.resetAnimation();
183
- }
184
- // RN's _getChildStyleOpacityWithDefault: the fade settles at the opacity the CALLER's style asks
185
- // for, not at a hard 1 — a Touchable styled `opacity: 0.6` must come back to 0.6.
186
- restingOpacity() {
187
- return restingOpacityFromStyle(this.style);
188
- }
189
- setOpacityTo(toValue, duration) {
190
- Animated.timing(this.opacity, {
191
- toValue,
192
- duration,
193
- easing: Animated.Easing.inOut(Animated.Easing.quad),
194
- // RN's own (TouchableOpacity.js:242). opacity is natively drivable, so the fade survives a
195
- // busy JS thread — which is the entire point of press feedback.
196
- useNativeDriver: true,
197
- }).start();
198
- }
199
- // Built per event so the machine reads live @Input()s (delay/opacity); the runtime persists across
200
- // calls. The shared machine owns the scheduling — the adapter supplies only the native seam: the
201
- // Animated opacity fade + the @Output() emit, as activate/deactivate.
202
- feedbackHandlers() {
203
- return createTouchableFeedbackHandlers({
204
- delayPressIn: this.delayPressIn ?? 0,
205
- delayPressOut: this.delayPressOut ?? 0,
206
- // RN's Touchables override Pressability's own 130ms floor with 0; what holds the active
207
- // visual there is the fade's own duration, not a press-duration floor.
208
- minPressDuration: this.minPressDuration ?? TOUCHABLE_MIN_PRESS_DURATION_MS,
209
- schedule: this.timers.schedule,
210
- now: Date.now,
211
- }, this.runtime, {
212
- activate: (event) => {
213
- this.setOpacityTo(this.activeOpacity ?? DEFAULT_ACTIVE_OPACITY, OPACITY_ACTIVE_GRANT_DURATION_MS);
214
- this.pressIn.emit(event);
215
- },
216
- deactivate: (event) => {
217
- this.setOpacityTo(this.restingOpacity(), OPACITY_INACTIVE_DURATION_MS);
218
- this.pressOut.emit(event);
219
- },
220
- });
221
- }
222
- // Arrow fields (stable identity for OnPush, `this` intact when Pressable's `(pressIn)` invokes
223
- // them). The delayPressIn defer + minPressDuration/delayPressOut hold live in the shared machine.
224
- handlePressIn = (event) => {
225
- this.feedbackHandlers().handlePressIn(event);
226
- };
227
- handlePressOut = (event) => {
228
- this.feedbackHandlers().handlePressOut(event);
229
- };
230
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableOpacity, deps: [], target: i0.ɵɵFactoryTarget.Component });
231
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TouchableOpacity, isStandalone: true, selector: "TouchableOpacity", inputs: { activeOpacity: "activeOpacity", delayPressIn: "delayPressIn", delayPressOut: "delayPressOut", minPressDuration: "minPressDuration", style: "style", delayLongPress: "delayLongPress", delayHoverIn: "delayHoverIn", delayHoverOut: "delayHoverOut", disabled: "disabled", cancelable: "cancelable", hitSlop: "hitSlop", pressRetentionOffset: "pressRetentionOffset", unstable_pressDelay: "unstable_pressDelay", android_ripple: "android_ripple", android_disableSound: "android_disableSound", testID: "testID", nativeID: "nativeID", hasTVPreferredFocus: "hasTVPreferredFocus", nextFocusDown: "nextFocusDown", nextFocusForward: "nextFocusForward", nextFocusLeft: "nextFocusLeft", nextFocusRight: "nextFocusRight", nextFocusUp: "nextFocusUp", accessible: "accessible", accessibilityLabel: "accessibilityLabel", accessibilityHint: "accessibilityHint", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityActions: "accessibilityActions", accessibilityLabelledBy: "accessibilityLabelledBy", importantForAccessibility: "importantForAccessibility", accessibilityLiveRegion: "accessibilityLiveRegion", screenReaderFocusable: "screenReaderFocusable", accessibilityViewIsModal: "accessibilityViewIsModal", accessibilityElementsHidden: "accessibilityElementsHidden", accessibilityIgnoresInvertColors: "accessibilityIgnoresInvertColors", accessibilityLanguage: "accessibilityLanguage", accessibilityRespondsToUserInteraction: "accessibilityRespondsToUserInteraction", accessibilityShowsLargeContentViewer: "accessibilityShowsLargeContentViewer", accessibilityLargeContentTitle: "accessibilityLargeContentTitle", ariaLabel: "ariaLabel", ariaBusy: "ariaBusy", ariaChecked: "ariaChecked", ariaDisabled: "ariaDisabled", ariaExpanded: "ariaExpanded", ariaHidden: "ariaHidden", ariaLabelledBy: "ariaLabelledBy", ariaLive: "ariaLive", ariaSelected: "ariaSelected", ariaModal: "ariaModal", ariaValueMax: "ariaValueMax", ariaValueMin: "ariaValueMin", ariaValueNow: "ariaValueNow", ariaValueText: "ariaValueText", id: "id", role: "role" }, outputs: { press: "press", pressIn: "pressIn", pressOut: "pressOut", pressMove: "pressMove", longPress: "longPress", hoverIn: "hoverIn", hoverOut: "hoverOut", accessibilityAction: "accessibilityAction", accessibilityTap: "accessibilityTap", magicTap: "magicTap", accessibilityEscape: "accessibilityEscape" }, usesOnChanges: true, hostDirectives: [{ directive: i1.SymbioteStyleInputDirective, inputs: ["style", "style"] }], ngImport: i0, template: `
232
- <Pressable
233
- (press)="press.emit($event)"
234
- (pressIn)="handlePressIn($event)"
235
- (pressOut)="handlePressOut($event)"
236
- (pressMove)="pressMove.emit($event)"
237
- (longPress)="longPress.emit($event)"
238
- (hoverIn)="hoverIn.emit($event)"
239
- (hoverOut)="hoverOut.emit($event)"
240
- [delayLongPress]="delayLongPress"
241
- [delayHoverIn]="delayHoverIn"
242
- [delayHoverOut]="delayHoverOut"
243
- [disabled]="disabled"
244
- [cancelable]="cancelable"
245
- [hitSlop]="hitSlop"
246
- [pressRetentionOffset]="pressRetentionOffset"
247
- [unstable_pressDelay]="unstable_pressDelay"
248
- [android_ripple]="android_ripple"
249
- [android_disableSound]="android_disableSound"
250
- [testID]="testID"
251
- [nativeID]="nativeID"
252
- [hasTVPreferredFocus]="hasTVPreferredFocus"
253
- [nextFocusDown]="nextFocusDown"
254
- [nextFocusForward]="nextFocusForward"
255
- [nextFocusLeft]="nextFocusLeft"
256
- [nextFocusRight]="nextFocusRight"
257
- [nextFocusUp]="nextFocusUp"
258
- [accessible]="accessible"
259
- [accessibilityLabel]="accessibilityLabel"
260
- [accessibilityHint]="accessibilityHint"
261
- [accessibilityRole]="accessibilityRole"
262
- [accessibilityState]="accessibilityState"
263
- [accessibilityValue]="accessibilityValue"
264
- [accessibilityActions]="accessibilityActions"
265
- [accessibilityLabelledBy]="accessibilityLabelledBy"
266
- [importantForAccessibility]="importantForAccessibility"
267
- [accessibilityLiveRegion]="accessibilityLiveRegion"
268
- [screenReaderFocusable]="screenReaderFocusable"
269
- [accessibilityViewIsModal]="accessibilityViewIsModal"
270
- [accessibilityElementsHidden]="accessibilityElementsHidden"
271
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
272
- [accessibilityLanguage]="accessibilityLanguage"
273
- [accessibilityRespondsToUserInteraction]="
274
- accessibilityRespondsToUserInteraction
275
- "
276
- [accessibilityShowsLargeContentViewer]="
277
- accessibilityShowsLargeContentViewer
278
- "
279
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
280
- (accessibilityAction)="accessibilityAction.emit($event)"
281
- (accessibilityTap)="accessibilityTap.emit($event)"
282
- (magicTap)="magicTap.emit($event)"
283
- (accessibilityEscape)="accessibilityEscape.emit($event)"
284
- [ariaLabel]="ariaLabel"
285
- [ariaBusy]="ariaBusy"
286
- [ariaChecked]="ariaChecked"
287
- [ariaDisabled]="ariaDisabled"
288
- [ariaExpanded]="ariaExpanded"
289
- [ariaHidden]="ariaHidden"
290
- [ariaLabelledBy]="ariaLabelledBy"
291
- [ariaLive]="ariaLive"
292
- [ariaSelected]="ariaSelected"
293
- [ariaModal]="ariaModal"
294
- [ariaValueMax]="ariaValueMax"
295
- [ariaValueMin]="ariaValueMin"
296
- [ariaValueNow]="ariaValueNow"
297
- [ariaValueText]="ariaValueText"
298
- [id]="id"
299
- [role]="role"
300
- >
301
- <symbiote-animated-view [style]="animatedStyle">
302
- <ng-content></ng-content>
303
- </symbiote-animated-view>
304
- </Pressable>
305
- `, isInline: true, dependencies: [{ kind: "component", type: Pressable, selector: "Pressable, symbiote-pressable", inputs: ["delayLongPress", "disabled", "cancelable", "hitSlop", "pressRetentionOffset", "unstable_pressDelay", "android_ripple", "android_disableSound", "delayHoverIn", "delayHoverOut", "testID", "nativeID", "hasTVPreferredFocus", "nextFocusDown", "nextFocusForward", "nextFocusLeft", "nextFocusRight", "nextFocusUp", "style", "accessible", "accessibilityLabel", "accessibilityHint", "accessibilityRole", "accessibilityState", "accessibilityValue", "accessibilityActions", "accessibilityLabelledBy", "importantForAccessibility", "accessibilityLiveRegion", "screenReaderFocusable", "accessibilityViewIsModal", "accessibilityElementsHidden", "accessibilityIgnoresInvertColors", "accessibilityLanguage", "accessibilityRespondsToUserInteraction", "accessibilityShowsLargeContentViewer", "accessibilityLargeContentTitle", "ariaLabel", "ariaBusy", "ariaChecked", "ariaDisabled", "ariaExpanded", "ariaHidden", "ariaLabelledBy", "ariaLive", "ariaSelected", "ariaModal", "ariaValueMax", "ariaValueMin", "ariaValueNow", "ariaValueText", "id", "role"], outputs: ["press", "pressIn", "pressOut", "pressMove", "longPress", "hoverIn", "hoverOut", "accessibilityAction", "accessibilityTap", "magicTap", "accessibilityEscape"] }, { kind: "component", type: AnimatedView, selector: "AnimatedView, symbiote-animated-view", inputs: ["style", "animatedProps", "passthroughAnimatedPropExplicitValues"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
306
- }
307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableOpacity, decorators: [{
308
- type: Component,
309
- args: [{
310
- selector: 'TouchableOpacity',
311
- standalone: true,
312
- hostDirectives: [
313
- { directive: SymbioteStyleInputDirective, inputs: ['style'] },
314
- ],
315
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
316
- imports: [Pressable, AnimatedView],
317
- changeDetection: ChangeDetectionStrategy.OnPush,
318
- template: `
319
- <Pressable
320
- (press)="press.emit($event)"
321
- (pressIn)="handlePressIn($event)"
322
- (pressOut)="handlePressOut($event)"
323
- (pressMove)="pressMove.emit($event)"
324
- (longPress)="longPress.emit($event)"
325
- (hoverIn)="hoverIn.emit($event)"
326
- (hoverOut)="hoverOut.emit($event)"
327
- [delayLongPress]="delayLongPress"
328
- [delayHoverIn]="delayHoverIn"
329
- [delayHoverOut]="delayHoverOut"
330
- [disabled]="disabled"
331
- [cancelable]="cancelable"
332
- [hitSlop]="hitSlop"
333
- [pressRetentionOffset]="pressRetentionOffset"
334
- [unstable_pressDelay]="unstable_pressDelay"
335
- [android_ripple]="android_ripple"
336
- [android_disableSound]="android_disableSound"
337
- [testID]="testID"
338
- [nativeID]="nativeID"
339
- [hasTVPreferredFocus]="hasTVPreferredFocus"
340
- [nextFocusDown]="nextFocusDown"
341
- [nextFocusForward]="nextFocusForward"
342
- [nextFocusLeft]="nextFocusLeft"
343
- [nextFocusRight]="nextFocusRight"
344
- [nextFocusUp]="nextFocusUp"
345
- [accessible]="accessible"
346
- [accessibilityLabel]="accessibilityLabel"
347
- [accessibilityHint]="accessibilityHint"
348
- [accessibilityRole]="accessibilityRole"
349
- [accessibilityState]="accessibilityState"
350
- [accessibilityValue]="accessibilityValue"
351
- [accessibilityActions]="accessibilityActions"
352
- [accessibilityLabelledBy]="accessibilityLabelledBy"
353
- [importantForAccessibility]="importantForAccessibility"
354
- [accessibilityLiveRegion]="accessibilityLiveRegion"
355
- [screenReaderFocusable]="screenReaderFocusable"
356
- [accessibilityViewIsModal]="accessibilityViewIsModal"
357
- [accessibilityElementsHidden]="accessibilityElementsHidden"
358
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
359
- [accessibilityLanguage]="accessibilityLanguage"
360
- [accessibilityRespondsToUserInteraction]="
361
- accessibilityRespondsToUserInteraction
362
- "
363
- [accessibilityShowsLargeContentViewer]="
364
- accessibilityShowsLargeContentViewer
365
- "
366
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
367
- (accessibilityAction)="accessibilityAction.emit($event)"
368
- (accessibilityTap)="accessibilityTap.emit($event)"
369
- (magicTap)="magicTap.emit($event)"
370
- (accessibilityEscape)="accessibilityEscape.emit($event)"
371
- [ariaLabel]="ariaLabel"
372
- [ariaBusy]="ariaBusy"
373
- [ariaChecked]="ariaChecked"
374
- [ariaDisabled]="ariaDisabled"
375
- [ariaExpanded]="ariaExpanded"
376
- [ariaHidden]="ariaHidden"
377
- [ariaLabelledBy]="ariaLabelledBy"
378
- [ariaLive]="ariaLive"
379
- [ariaSelected]="ariaSelected"
380
- [ariaModal]="ariaModal"
381
- [ariaValueMax]="ariaValueMax"
382
- [ariaValueMin]="ariaValueMin"
383
- [ariaValueNow]="ariaValueNow"
384
- [ariaValueText]="ariaValueText"
385
- [id]="id"
386
- [role]="role"
387
- >
388
- <symbiote-animated-view [style]="animatedStyle">
389
- <ng-content></ng-content>
390
- </symbiote-animated-view>
391
- </Pressable>
392
- `,
393
- }]
394
- }], propDecorators: { press: [{
395
- type: Output
396
- }], pressIn: [{
397
- type: Output
398
- }], pressOut: [{
399
- type: Output
400
- }], pressMove: [{
401
- type: Output
402
- }], longPress: [{
403
- type: Output
404
- }], hoverIn: [{
405
- type: Output
406
- }], hoverOut: [{
407
- type: Output
408
- }], accessibilityAction: [{
409
- type: Output
410
- }], accessibilityTap: [{
411
- type: Output
412
- }], magicTap: [{
413
- type: Output
414
- }], accessibilityEscape: [{
415
- type: Output
416
- }], activeOpacity: [{
417
- type: Input
418
- }], delayPressIn: [{
419
- type: Input
420
- }], delayPressOut: [{
421
- type: Input
422
- }], minPressDuration: [{
423
- type: Input
424
- }], style: [{
425
- type: Input
426
- }], delayLongPress: [{
427
- type: Input
428
- }], delayHoverIn: [{
429
- type: Input
430
- }], delayHoverOut: [{
431
- type: Input
432
- }], disabled: [{
433
- type: Input
434
- }], cancelable: [{
435
- type: Input
436
- }], hitSlop: [{
437
- type: Input
438
- }], pressRetentionOffset: [{
439
- type: Input
440
- }], unstable_pressDelay: [{
441
- type: Input
442
- }], android_ripple: [{
443
- type: Input
444
- }], android_disableSound: [{
445
- type: Input
446
- }], testID: [{
447
- type: Input
448
- }], nativeID: [{
449
- type: Input
450
- }], hasTVPreferredFocus: [{
451
- type: Input
452
- }], nextFocusDown: [{
453
- type: Input
454
- }], nextFocusForward: [{
455
- type: Input
456
- }], nextFocusLeft: [{
457
- type: Input
458
- }], nextFocusRight: [{
459
- type: Input
460
- }], nextFocusUp: [{
461
- type: Input
462
- }], accessible: [{
463
- type: Input
464
- }], accessibilityLabel: [{
465
- type: Input
466
- }], accessibilityHint: [{
467
- type: Input
468
- }], accessibilityRole: [{
469
- type: Input
470
- }], accessibilityState: [{
471
- type: Input
472
- }], accessibilityValue: [{
473
- type: Input
474
- }], accessibilityActions: [{
475
- type: Input
476
- }], accessibilityLabelledBy: [{
477
- type: Input
478
- }], importantForAccessibility: [{
479
- type: Input
480
- }], accessibilityLiveRegion: [{
481
- type: Input
482
- }], screenReaderFocusable: [{
483
- type: Input
484
- }], accessibilityViewIsModal: [{
485
- type: Input
486
- }], accessibilityElementsHidden: [{
487
- type: Input
488
- }], accessibilityIgnoresInvertColors: [{
489
- type: Input
490
- }], accessibilityLanguage: [{
491
- type: Input
492
- }], accessibilityRespondsToUserInteraction: [{
493
- type: Input
494
- }], accessibilityShowsLargeContentViewer: [{
495
- type: Input
496
- }], accessibilityLargeContentTitle: [{
497
- type: Input
498
- }], ariaLabel: [{
499
- type: Input
500
- }], ariaBusy: [{
501
- type: Input
502
- }], ariaChecked: [{
503
- type: Input
504
- }], ariaDisabled: [{
505
- type: Input
506
- }], ariaExpanded: [{
507
- type: Input
508
- }], ariaHidden: [{
509
- type: Input
510
- }], ariaLabelledBy: [{
511
- type: Input
512
- }], ariaLive: [{
513
- type: Input
514
- }], ariaSelected: [{
515
- type: Input
516
- }], ariaModal: [{
517
- type: Input
518
- }], ariaValueMax: [{
519
- type: Input
520
- }], ariaValueMin: [{
521
- type: Input
522
- }], ariaValueNow: [{
523
- type: Input
524
- }], ariaValueText: [{
525
- type: Input
526
- }], id: [{
527
- type: Input
528
- }], role: [{
529
- type: Input
530
- }] } });
531
- export class TouchableHighlight {
532
- press = new EventEmitter();
533
- pressIn = new EventEmitter();
534
- pressOut = new EventEmitter();
535
- pressMove = new EventEmitter();
536
- longPress = new EventEmitter();
537
- hoverIn = new EventEmitter();
538
- hoverOut = new EventEmitter();
539
- accessibilityAction = new EventEmitter();
540
- accessibilityTap = new EventEmitter();
541
- magicTap = new EventEmitter();
542
- accessibilityEscape = new EventEmitter();
543
- // RN's onShowUnderlay / onHideUnderlay — fired on a real transition only, never on a repeat.
544
- showUnderlay = new EventEmitter();
545
- hideUnderlay = new EventEmitter();
546
- activeOpacity;
547
- underlayColor;
548
- delayPressIn;
549
- delayPressOut;
550
- minPressDuration;
551
- style;
552
- delayLongPress;
553
- delayHoverIn;
554
- delayHoverOut;
555
- disabled;
556
- cancelable;
557
- hitSlop;
558
- pressRetentionOffset;
559
- unstable_pressDelay;
560
- android_ripple;
561
- android_disableSound;
562
- testID;
563
- nativeID;
564
- hasTVPreferredFocus;
565
- nextFocusDown;
566
- nextFocusForward;
567
- nextFocusLeft;
568
- nextFocusRight;
569
- nextFocusUp;
570
- accessible;
571
- accessibilityLabel;
572
- accessibilityHint;
573
- accessibilityRole;
574
- accessibilityState;
575
- accessibilityValue;
576
- accessibilityActions;
577
- accessibilityLabelledBy;
578
- importantForAccessibility;
579
- accessibilityLiveRegion;
580
- screenReaderFocusable;
581
- accessibilityViewIsModal;
582
- accessibilityElementsHidden;
583
- accessibilityIgnoresInvertColors;
584
- accessibilityLanguage;
585
- accessibilityRespondsToUserInteraction;
586
- accessibilityShowsLargeContentViewer;
587
- accessibilityLargeContentTitle;
588
- ariaLabel;
589
- ariaBusy;
590
- ariaChecked;
591
- ariaDisabled;
592
- ariaExpanded;
593
- ariaHidden;
594
- ariaLabelledBy;
595
- ariaLive;
596
- ariaSelected;
597
- ariaModal;
598
- ariaValueMax;
599
- ariaValueMin;
600
- ariaValueNow;
601
- ariaValueText;
602
- id;
603
- role;
604
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
605
- // onto (see anchorHostStyle's doc comment) — NOT the Pressable one level down.
606
- elementRef = inject(ElementRef);
607
- // `shown` is NOT Pressable's `pressed`. RN holds the underlay for delayPressOut past the tap so a
608
- // press too fast to see still flashes, and the pressed flag is already false by then. A SIGNAL,
609
- // because the hide fires from a timer — outside any Angular listener, so under zoneless CD
610
- // nothing else would mark this view. A signal write both notifies the change-detection scheduler
611
- // (markAncestorsForTraversal) and dirties this template's own reactive consumer, which is the one
612
- // thing honored in Targeted mode; markForCheck from a plain field would not be reachable here.
613
- shown = signal(false, /* @ts-ignore */
614
- ...(ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []));
615
- underlayRuntime = createHighlightUnderlayRuntime();
616
- timers = createTimerScheduler();
617
- // The container style Pressable paints.
618
- //
619
- // POINT-7 DECISION — both halves stay on the CONTAINER, deliberately. RN's _createExtraStyles
620
- // keeps them apart: `underlay` (the backgroundColor) on the container, `child` (the lowered
621
- // opacity) cloned onto the single child. Angular has no cloneElement and no way to reach a
622
- // projected <ng-content> node, so the only path to the child is a permanent wrapper View — which
623
- // inserts a node into the flex chain and silently re-parents any `flex` a child declares. The
624
- // fake Fabric runs no Yoga, so no headless test can measure that damage, only assert the extra
625
- // node exists; shipping an unmeasurable layout change is worse than the visual approximation.
626
- // Same call, same reason, as the Solid adapter. resolveHighlightExtraStyles keeps the two styles
627
- // SEPARATE regardless, so a layout-safe fix (which needs a device check, not a test) stays open.
628
- //
629
- // Returns a NEW ARRAY whenever a dependency moves: Pressable's `style` @Input then reports an
630
- // ordinary change. A stable reference was the earlier bug — Pressable's view never refreshed, so
631
- // a class or [style] toggled after mount never reached the committed view.
632
- containerStyle = computed(() => {
633
- this.inputsRevision();
634
- const base = [this.anchorStyle(), this.style];
635
- const extra = resolveHighlightExtraStyles({
636
- shown: this.shown(),
637
- hasPressHandler: this.hasPressHandler(),
638
- underlayColor: this.underlayColor,
639
- activeOpacity: this.activeOpacity,
640
- });
641
- return extra === undefined ? base : [base, extra.underlay, extra.child];
642
- }, /* @ts-ignore */
643
- ...(ngDevMode ? [{ debugName: "containerStyle" }] : /* istanbul ignore next */ []));
644
- // RN's _hasPressHandler: a Touchable that handles no press paints no underlay. Angular exposes
645
- // the press lifecycle as @Output()s, so "a handler is present" is "something is subscribed" — the
646
- // same `.observed` test Pressable uses to decide whether to arm its long-press timer at all.
647
- hasPressHandler() {
648
- return hasTouchablePressHandler({
649
- onPress: this.press.observed ? this.press : undefined,
650
- onPressIn: this.pressIn.observed ? this.pressIn : undefined,
651
- onPressOut: this.pressOut.observed ? this.pressOut : undefined,
652
- onLongPress: this.longPress.observed ? this.longPress : undefined,
653
- });
654
- }
655
- // Built per event so the machine reads live @Input()s (delayPressOut, the has-handler gate); the
656
- // runtime persists across calls, which is what lets handlePressOut see the timer handlePress set.
657
- underlayHandlers() {
658
- return createHighlightUnderlayHandlers({
659
- delayPressOut: this.delayPressOut ?? 0,
660
- hasPressHandler: this.hasPressHandler(),
661
- schedule: this.timers.schedule,
662
- }, this.underlayRuntime, {
663
- setShown: (shown) => this.shown.set(shown),
664
- onShowUnderlay: () => this.showUnderlay.emit(),
665
- onHideUnderlay: () => this.hideUnderlay.emit(),
666
- });
667
- }
668
- // Visual first, then the caller's own event — RN's order in _createPressabilityConfig.
669
- // onLongPress is deliberately NOT intercepted (Pressable emits it straight through); it is only
670
- // READ, by the has-press-handler gate above.
671
- handlePressIn(event) {
672
- this.underlayHandlers().handlePressIn(event);
673
- this.pressIn.emit(event);
674
- }
675
- handlePress(event) {
676
- this.underlayHandlers().handlePress(event);
677
- this.press.emit(event);
678
- }
679
- handlePressOut(event) {
680
- this.underlayHandlers().handlePressOut(event);
681
- this.pressOut.emit(event);
682
- }
683
- ngOnDestroy() {
684
- this.timers.cancelAll();
685
- }
686
- // `style`, `underlayColor` and `activeOpacity` are read untracked inside containerStyle, so the
687
- // bump is what tells it they moved. See the ngDoCheck note below for the anchor half, which
688
- // ngOnChanges cannot cover.
689
- inputsRevision = signal(0, /* @ts-ignore */
690
- ...(ngDevMode ? [{ debugName: "inputsRevision" }] : /* istanbul ignore next */ []));
691
- anchorStyle = signal(undefined, /* @ts-ignore */
692
- ...(ngDevMode ? [{ debugName: "anchorStyle" }] : /* istanbul ignore next */ []));
693
- ngOnChanges() {
694
- this.inputsRevision.update(revision => revision + 1);
695
- }
696
- // The anchor's class-derived style is written by the renderer's addClass/removeClass at the USE
697
- // SITE - it never appears in SimpleChanges, and nothing about it dirties THIS component's view.
698
- // ngDoCheck runs during the PARENT's refresh even when this view is skipped, and the signal
699
- // write is what then marks this view for refresh. `signal.set`'s own Object.is makes an
700
- // unchanged poll a no-op, so there is no loop.
701
- ngDoCheck() {
702
- this.anchorStyle.set(anchorStyleProp(this.elementRef));
703
- }
704
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableHighlight, deps: [], target: i0.ɵɵFactoryTarget.Component });
705
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TouchableHighlight, isStandalone: true, selector: "TouchableHighlight", inputs: { activeOpacity: "activeOpacity", underlayColor: "underlayColor", delayPressIn: "delayPressIn", delayPressOut: "delayPressOut", minPressDuration: "minPressDuration", style: "style", delayLongPress: "delayLongPress", delayHoverIn: "delayHoverIn", delayHoverOut: "delayHoverOut", disabled: "disabled", cancelable: "cancelable", hitSlop: "hitSlop", pressRetentionOffset: "pressRetentionOffset", unstable_pressDelay: "unstable_pressDelay", android_ripple: "android_ripple", android_disableSound: "android_disableSound", testID: "testID", nativeID: "nativeID", hasTVPreferredFocus: "hasTVPreferredFocus", nextFocusDown: "nextFocusDown", nextFocusForward: "nextFocusForward", nextFocusLeft: "nextFocusLeft", nextFocusRight: "nextFocusRight", nextFocusUp: "nextFocusUp", accessible: "accessible", accessibilityLabel: "accessibilityLabel", accessibilityHint: "accessibilityHint", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityActions: "accessibilityActions", accessibilityLabelledBy: "accessibilityLabelledBy", importantForAccessibility: "importantForAccessibility", accessibilityLiveRegion: "accessibilityLiveRegion", screenReaderFocusable: "screenReaderFocusable", accessibilityViewIsModal: "accessibilityViewIsModal", accessibilityElementsHidden: "accessibilityElementsHidden", accessibilityIgnoresInvertColors: "accessibilityIgnoresInvertColors", accessibilityLanguage: "accessibilityLanguage", accessibilityRespondsToUserInteraction: "accessibilityRespondsToUserInteraction", accessibilityShowsLargeContentViewer: "accessibilityShowsLargeContentViewer", accessibilityLargeContentTitle: "accessibilityLargeContentTitle", ariaLabel: "ariaLabel", ariaBusy: "ariaBusy", ariaChecked: "ariaChecked", ariaDisabled: "ariaDisabled", ariaExpanded: "ariaExpanded", ariaHidden: "ariaHidden", ariaLabelledBy: "ariaLabelledBy", ariaLive: "ariaLive", ariaSelected: "ariaSelected", ariaModal: "ariaModal", ariaValueMax: "ariaValueMax", ariaValueMin: "ariaValueMin", ariaValueNow: "ariaValueNow", ariaValueText: "ariaValueText", id: "id", role: "role" }, outputs: { press: "press", pressIn: "pressIn", pressOut: "pressOut", pressMove: "pressMove", longPress: "longPress", hoverIn: "hoverIn", hoverOut: "hoverOut", accessibilityAction: "accessibilityAction", accessibilityTap: "accessibilityTap", magicTap: "magicTap", accessibilityEscape: "accessibilityEscape", showUnderlay: "showUnderlay", hideUnderlay: "hideUnderlay" }, usesOnChanges: true, hostDirectives: [{ directive: i1.SymbioteStyleInputDirective, inputs: ["style", "style"] }], ngImport: i0, template: `
706
- <Pressable
707
- [style]="containerStyle()"
708
- (press)="handlePress($event)"
709
- (pressIn)="handlePressIn($event)"
710
- (pressOut)="handlePressOut($event)"
711
- (pressMove)="pressMove.emit($event)"
712
- (longPress)="longPress.emit($event)"
713
- (hoverIn)="hoverIn.emit($event)"
714
- (hoverOut)="hoverOut.emit($event)"
715
- [delayLongPress]="delayLongPress"
716
- [delayHoverIn]="delayHoverIn"
717
- [delayHoverOut]="delayHoverOut"
718
- [disabled]="disabled"
719
- [cancelable]="cancelable"
720
- [hitSlop]="hitSlop"
721
- [pressRetentionOffset]="pressRetentionOffset"
722
- [unstable_pressDelay]="unstable_pressDelay"
723
- [android_ripple]="android_ripple"
724
- [android_disableSound]="android_disableSound"
725
- [testID]="testID"
726
- [nativeID]="nativeID"
727
- [hasTVPreferredFocus]="hasTVPreferredFocus"
728
- [nextFocusDown]="nextFocusDown"
729
- [nextFocusForward]="nextFocusForward"
730
- [nextFocusLeft]="nextFocusLeft"
731
- [nextFocusRight]="nextFocusRight"
732
- [nextFocusUp]="nextFocusUp"
733
- [accessible]="accessible"
734
- [accessibilityLabel]="accessibilityLabel"
735
- [accessibilityHint]="accessibilityHint"
736
- [accessibilityRole]="accessibilityRole"
737
- [accessibilityState]="accessibilityState"
738
- [accessibilityValue]="accessibilityValue"
739
- [accessibilityActions]="accessibilityActions"
740
- [accessibilityLabelledBy]="accessibilityLabelledBy"
741
- [importantForAccessibility]="importantForAccessibility"
742
- [accessibilityLiveRegion]="accessibilityLiveRegion"
743
- [screenReaderFocusable]="screenReaderFocusable"
744
- [accessibilityViewIsModal]="accessibilityViewIsModal"
745
- [accessibilityElementsHidden]="accessibilityElementsHidden"
746
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
747
- [accessibilityLanguage]="accessibilityLanguage"
748
- [accessibilityRespondsToUserInteraction]="
749
- accessibilityRespondsToUserInteraction
750
- "
751
- [accessibilityShowsLargeContentViewer]="
752
- accessibilityShowsLargeContentViewer
753
- "
754
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
755
- (accessibilityAction)="accessibilityAction.emit($event)"
756
- (accessibilityTap)="accessibilityTap.emit($event)"
757
- (magicTap)="magicTap.emit($event)"
758
- (accessibilityEscape)="accessibilityEscape.emit($event)"
759
- [ariaLabel]="ariaLabel"
760
- [ariaBusy]="ariaBusy"
761
- [ariaChecked]="ariaChecked"
762
- [ariaDisabled]="ariaDisabled"
763
- [ariaExpanded]="ariaExpanded"
764
- [ariaHidden]="ariaHidden"
765
- [ariaLabelledBy]="ariaLabelledBy"
766
- [ariaLive]="ariaLive"
767
- [ariaSelected]="ariaSelected"
768
- [ariaModal]="ariaModal"
769
- [ariaValueMax]="ariaValueMax"
770
- [ariaValueMin]="ariaValueMin"
771
- [ariaValueNow]="ariaValueNow"
772
- [ariaValueText]="ariaValueText"
773
- [id]="id"
774
- [role]="role"
775
- >
776
- <ng-content></ng-content>
777
- </Pressable>
778
- `, isInline: true, dependencies: [{ kind: "component", type: Pressable, selector: "Pressable, symbiote-pressable", inputs: ["delayLongPress", "disabled", "cancelable", "hitSlop", "pressRetentionOffset", "unstable_pressDelay", "android_ripple", "android_disableSound", "delayHoverIn", "delayHoverOut", "testID", "nativeID", "hasTVPreferredFocus", "nextFocusDown", "nextFocusForward", "nextFocusLeft", "nextFocusRight", "nextFocusUp", "style", "accessible", "accessibilityLabel", "accessibilityHint", "accessibilityRole", "accessibilityState", "accessibilityValue", "accessibilityActions", "accessibilityLabelledBy", "importantForAccessibility", "accessibilityLiveRegion", "screenReaderFocusable", "accessibilityViewIsModal", "accessibilityElementsHidden", "accessibilityIgnoresInvertColors", "accessibilityLanguage", "accessibilityRespondsToUserInteraction", "accessibilityShowsLargeContentViewer", "accessibilityLargeContentTitle", "ariaLabel", "ariaBusy", "ariaChecked", "ariaDisabled", "ariaExpanded", "ariaHidden", "ariaLabelledBy", "ariaLive", "ariaSelected", "ariaModal", "ariaValueMax", "ariaValueMin", "ariaValueNow", "ariaValueText", "id", "role"], outputs: ["press", "pressIn", "pressOut", "pressMove", "longPress", "hoverIn", "hoverOut", "accessibilityAction", "accessibilityTap", "magicTap", "accessibilityEscape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
779
- }
780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableHighlight, decorators: [{
781
- type: Component,
782
- args: [{
783
- selector: 'TouchableHighlight',
784
- standalone: true,
785
- hostDirectives: [
786
- { directive: SymbioteStyleInputDirective, inputs: ['style'] },
787
- ],
788
- imports: [Pressable],
789
- changeDetection: ChangeDetectionStrategy.OnPush,
790
- template: `
791
- <Pressable
792
- [style]="containerStyle()"
793
- (press)="handlePress($event)"
794
- (pressIn)="handlePressIn($event)"
795
- (pressOut)="handlePressOut($event)"
796
- (pressMove)="pressMove.emit($event)"
797
- (longPress)="longPress.emit($event)"
798
- (hoverIn)="hoverIn.emit($event)"
799
- (hoverOut)="hoverOut.emit($event)"
800
- [delayLongPress]="delayLongPress"
801
- [delayHoverIn]="delayHoverIn"
802
- [delayHoverOut]="delayHoverOut"
803
- [disabled]="disabled"
804
- [cancelable]="cancelable"
805
- [hitSlop]="hitSlop"
806
- [pressRetentionOffset]="pressRetentionOffset"
807
- [unstable_pressDelay]="unstable_pressDelay"
808
- [android_ripple]="android_ripple"
809
- [android_disableSound]="android_disableSound"
810
- [testID]="testID"
811
- [nativeID]="nativeID"
812
- [hasTVPreferredFocus]="hasTVPreferredFocus"
813
- [nextFocusDown]="nextFocusDown"
814
- [nextFocusForward]="nextFocusForward"
815
- [nextFocusLeft]="nextFocusLeft"
816
- [nextFocusRight]="nextFocusRight"
817
- [nextFocusUp]="nextFocusUp"
818
- [accessible]="accessible"
819
- [accessibilityLabel]="accessibilityLabel"
820
- [accessibilityHint]="accessibilityHint"
821
- [accessibilityRole]="accessibilityRole"
822
- [accessibilityState]="accessibilityState"
823
- [accessibilityValue]="accessibilityValue"
824
- [accessibilityActions]="accessibilityActions"
825
- [accessibilityLabelledBy]="accessibilityLabelledBy"
826
- [importantForAccessibility]="importantForAccessibility"
827
- [accessibilityLiveRegion]="accessibilityLiveRegion"
828
- [screenReaderFocusable]="screenReaderFocusable"
829
- [accessibilityViewIsModal]="accessibilityViewIsModal"
830
- [accessibilityElementsHidden]="accessibilityElementsHidden"
831
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
832
- [accessibilityLanguage]="accessibilityLanguage"
833
- [accessibilityRespondsToUserInteraction]="
834
- accessibilityRespondsToUserInteraction
835
- "
836
- [accessibilityShowsLargeContentViewer]="
837
- accessibilityShowsLargeContentViewer
838
- "
839
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
840
- (accessibilityAction)="accessibilityAction.emit($event)"
841
- (accessibilityTap)="accessibilityTap.emit($event)"
842
- (magicTap)="magicTap.emit($event)"
843
- (accessibilityEscape)="accessibilityEscape.emit($event)"
844
- [ariaLabel]="ariaLabel"
845
- [ariaBusy]="ariaBusy"
846
- [ariaChecked]="ariaChecked"
847
- [ariaDisabled]="ariaDisabled"
848
- [ariaExpanded]="ariaExpanded"
849
- [ariaHidden]="ariaHidden"
850
- [ariaLabelledBy]="ariaLabelledBy"
851
- [ariaLive]="ariaLive"
852
- [ariaSelected]="ariaSelected"
853
- [ariaModal]="ariaModal"
854
- [ariaValueMax]="ariaValueMax"
855
- [ariaValueMin]="ariaValueMin"
856
- [ariaValueNow]="ariaValueNow"
857
- [ariaValueText]="ariaValueText"
858
- [id]="id"
859
- [role]="role"
860
- >
861
- <ng-content></ng-content>
862
- </Pressable>
863
- `,
864
- }]
865
- }], propDecorators: { press: [{
866
- type: Output
867
- }], pressIn: [{
868
- type: Output
869
- }], pressOut: [{
870
- type: Output
871
- }], pressMove: [{
872
- type: Output
873
- }], longPress: [{
874
- type: Output
875
- }], hoverIn: [{
876
- type: Output
877
- }], hoverOut: [{
878
- type: Output
879
- }], accessibilityAction: [{
880
- type: Output
881
- }], accessibilityTap: [{
882
- type: Output
883
- }], magicTap: [{
884
- type: Output
885
- }], accessibilityEscape: [{
886
- type: Output
887
- }], showUnderlay: [{
888
- type: Output
889
- }], hideUnderlay: [{
890
- type: Output
891
- }], activeOpacity: [{
892
- type: Input
893
- }], underlayColor: [{
894
- type: Input
895
- }], delayPressIn: [{
896
- type: Input
897
- }], delayPressOut: [{
898
- type: Input
899
- }], minPressDuration: [{
900
- type: Input
901
- }], style: [{
902
- type: Input
903
- }], delayLongPress: [{
904
- type: Input
905
- }], delayHoverIn: [{
906
- type: Input
907
- }], delayHoverOut: [{
908
- type: Input
909
- }], disabled: [{
910
- type: Input
911
- }], cancelable: [{
912
- type: Input
913
- }], hitSlop: [{
914
- type: Input
915
- }], pressRetentionOffset: [{
916
- type: Input
917
- }], unstable_pressDelay: [{
918
- type: Input
919
- }], android_ripple: [{
920
- type: Input
921
- }], android_disableSound: [{
922
- type: Input
923
- }], testID: [{
924
- type: Input
925
- }], nativeID: [{
926
- type: Input
927
- }], hasTVPreferredFocus: [{
928
- type: Input
929
- }], nextFocusDown: [{
930
- type: Input
931
- }], nextFocusForward: [{
932
- type: Input
933
- }], nextFocusLeft: [{
934
- type: Input
935
- }], nextFocusRight: [{
936
- type: Input
937
- }], nextFocusUp: [{
938
- type: Input
939
- }], accessible: [{
940
- type: Input
941
- }], accessibilityLabel: [{
942
- type: Input
943
- }], accessibilityHint: [{
944
- type: Input
945
- }], accessibilityRole: [{
946
- type: Input
947
- }], accessibilityState: [{
948
- type: Input
949
- }], accessibilityValue: [{
950
- type: Input
951
- }], accessibilityActions: [{
952
- type: Input
953
- }], accessibilityLabelledBy: [{
954
- type: Input
955
- }], importantForAccessibility: [{
956
- type: Input
957
- }], accessibilityLiveRegion: [{
958
- type: Input
959
- }], screenReaderFocusable: [{
960
- type: Input
961
- }], accessibilityViewIsModal: [{
962
- type: Input
963
- }], accessibilityElementsHidden: [{
964
- type: Input
965
- }], accessibilityIgnoresInvertColors: [{
966
- type: Input
967
- }], accessibilityLanguage: [{
968
- type: Input
969
- }], accessibilityRespondsToUserInteraction: [{
970
- type: Input
971
- }], accessibilityShowsLargeContentViewer: [{
972
- type: Input
973
- }], accessibilityLargeContentTitle: [{
974
- type: Input
975
- }], ariaLabel: [{
976
- type: Input
977
- }], ariaBusy: [{
978
- type: Input
979
- }], ariaChecked: [{
980
- type: Input
981
- }], ariaDisabled: [{
982
- type: Input
983
- }], ariaExpanded: [{
984
- type: Input
985
- }], ariaHidden: [{
986
- type: Input
987
- }], ariaLabelledBy: [{
988
- type: Input
989
- }], ariaLive: [{
990
- type: Input
991
- }], ariaSelected: [{
992
- type: Input
993
- }], ariaModal: [{
994
- type: Input
995
- }], ariaValueMax: [{
996
- type: Input
997
- }], ariaValueMin: [{
998
- type: Input
999
- }], ariaValueNow: [{
1000
- type: Input
1001
- }], ariaValueText: [{
1002
- type: Input
1003
- }], id: [{
1004
- type: Input
1005
- }], role: [{
1006
- type: Input
1007
- }] } });
1008
- export class TouchableWithoutFeedback {
1009
- // RN's TouchableWithoutFeedback builds a FULL Pressability config with delayPressIn /
1010
- // delayPressOut / minPressDuration: 0 — "without feedback" means no VISUAL, not no timing. So the
1011
- // same shared machine TouchableOpacity uses runs here, with the visual half left empty: the
1012
- // pressIn/pressOut EMIT is what gets deferred and floored.
1013
- press = new EventEmitter();
1014
- pressIn = new EventEmitter();
1015
- pressOut = new EventEmitter();
1016
- pressMove = new EventEmitter();
1017
- longPress = new EventEmitter();
1018
- hoverIn = new EventEmitter();
1019
- hoverOut = new EventEmitter();
1020
- accessibilityAction = new EventEmitter();
1021
- accessibilityTap = new EventEmitter();
1022
- magicTap = new EventEmitter();
1023
- accessibilityEscape = new EventEmitter();
1024
- delayPressIn;
1025
- delayPressOut;
1026
- minPressDuration;
1027
- style;
1028
- delayLongPress;
1029
- delayHoverIn;
1030
- delayHoverOut;
1031
- disabled;
1032
- cancelable;
1033
- hitSlop;
1034
- pressRetentionOffset;
1035
- unstable_pressDelay;
1036
- android_ripple;
1037
- android_disableSound;
1038
- testID;
1039
- nativeID;
1040
- hasTVPreferredFocus;
1041
- nextFocusDown;
1042
- nextFocusForward;
1043
- nextFocusLeft;
1044
- nextFocusRight;
1045
- nextFocusUp;
1046
- accessible;
1047
- accessibilityLabel;
1048
- accessibilityHint;
1049
- accessibilityRole;
1050
- accessibilityState;
1051
- accessibilityValue;
1052
- accessibilityActions;
1053
- accessibilityLabelledBy;
1054
- importantForAccessibility;
1055
- accessibilityLiveRegion;
1056
- screenReaderFocusable;
1057
- accessibilityViewIsModal;
1058
- accessibilityElementsHidden;
1059
- accessibilityIgnoresInvertColors;
1060
- accessibilityLanguage;
1061
- accessibilityRespondsToUserInteraction;
1062
- accessibilityShowsLargeContentViewer;
1063
- accessibilityLargeContentTitle;
1064
- ariaLabel;
1065
- ariaBusy;
1066
- ariaChecked;
1067
- ariaDisabled;
1068
- ariaExpanded;
1069
- ariaHidden;
1070
- ariaLabelledBy;
1071
- ariaLive;
1072
- ariaSelected;
1073
- ariaModal;
1074
- ariaValueMax;
1075
- ariaValueMin;
1076
- ariaValueNow;
1077
- ariaValueText;
1078
- id;
1079
- role;
1080
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
1081
- // onto (see anchorHostStyle's doc comment) — NOT the Pressable one level down.
1082
- elementRef = inject(ElementRef);
1083
- // The shared press-scheduling cell (delayPressIn timer + activation clock), persisted on the
1084
- // instance; the machine's handlers are rebuilt per event over live @Input()s.
1085
- runtime = createTouchableFeedbackRuntime();
1086
- timers = createTimerScheduler();
1087
- // The anchor's class-derived style goes first, then the explicit style, so an explicit [style]
1088
- // still beats the ambient class.
1089
- get mergedStyle() {
1090
- return [this.anchorStyle(), this.style];
1091
- }
1092
- feedbackHandlers() {
1093
- return createTouchableFeedbackHandlers({
1094
- delayPressIn: this.delayPressIn ?? 0,
1095
- delayPressOut: this.delayPressOut ?? 0,
1096
- minPressDuration: this.minPressDuration ?? TOUCHABLE_MIN_PRESS_DURATION_MS,
1097
- schedule: this.timers.schedule,
1098
- now: Date.now,
1099
- }, this.runtime, {
1100
- activate: (event) => this.pressIn.emit(event),
1101
- deactivate: (event) => this.pressOut.emit(event),
1102
- });
1103
- }
1104
- handlePressIn(event) {
1105
- this.feedbackHandlers().handlePressIn(event);
1106
- }
1107
- handlePressOut(event) {
1108
- this.feedbackHandlers().handlePressOut(event);
1109
- }
1110
- ngOnDestroy() {
1111
- this.timers.cancelAll();
1112
- }
1113
- // The anchor's class-derived style is written by the renderer's addClass/removeClass at the USE
1114
- // SITE - it never appears in SimpleChanges, and nothing about it dirties THIS component's view.
1115
- // A `class=` present at creation therefore worked, while one toggled later did not: the parent
1116
- // refreshed, the class landed on the anchor, and this component's own view was never refreshed,
1117
- // so whatever merged the anchor style in was never re-evaluated. Polling it into a signal from
1118
- // ngDoCheck fixes both halves: ngDoCheck runs during the PARENT's refresh even when this view is
1119
- // skipped, and the signal write is what then marks this view for refresh. `signal.set`'s own
1120
- // Object.is makes an unchanged poll a no-op, so there is no loop.
1121
- anchorStyle = signal(undefined, /* @ts-ignore */
1122
- ...(ngDevMode ? [{ debugName: "anchorStyle" }] : /* istanbul ignore next */ []));
1123
- ngDoCheck() {
1124
- this.anchorStyle.set(anchorStyleProp(this.elementRef));
1125
- }
1126
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableWithoutFeedback, deps: [], target: i0.ɵɵFactoryTarget.Component });
1127
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TouchableWithoutFeedback, isStandalone: true, selector: "TouchableWithoutFeedback", inputs: { delayPressIn: "delayPressIn", delayPressOut: "delayPressOut", minPressDuration: "minPressDuration", style: "style", delayLongPress: "delayLongPress", delayHoverIn: "delayHoverIn", delayHoverOut: "delayHoverOut", disabled: "disabled", cancelable: "cancelable", hitSlop: "hitSlop", pressRetentionOffset: "pressRetentionOffset", unstable_pressDelay: "unstable_pressDelay", android_ripple: "android_ripple", android_disableSound: "android_disableSound", testID: "testID", nativeID: "nativeID", hasTVPreferredFocus: "hasTVPreferredFocus", nextFocusDown: "nextFocusDown", nextFocusForward: "nextFocusForward", nextFocusLeft: "nextFocusLeft", nextFocusRight: "nextFocusRight", nextFocusUp: "nextFocusUp", accessible: "accessible", accessibilityLabel: "accessibilityLabel", accessibilityHint: "accessibilityHint", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityActions: "accessibilityActions", accessibilityLabelledBy: "accessibilityLabelledBy", importantForAccessibility: "importantForAccessibility", accessibilityLiveRegion: "accessibilityLiveRegion", screenReaderFocusable: "screenReaderFocusable", accessibilityViewIsModal: "accessibilityViewIsModal", accessibilityElementsHidden: "accessibilityElementsHidden", accessibilityIgnoresInvertColors: "accessibilityIgnoresInvertColors", accessibilityLanguage: "accessibilityLanguage", accessibilityRespondsToUserInteraction: "accessibilityRespondsToUserInteraction", accessibilityShowsLargeContentViewer: "accessibilityShowsLargeContentViewer", accessibilityLargeContentTitle: "accessibilityLargeContentTitle", ariaLabel: "ariaLabel", ariaBusy: "ariaBusy", ariaChecked: "ariaChecked", ariaDisabled: "ariaDisabled", ariaExpanded: "ariaExpanded", ariaHidden: "ariaHidden", ariaLabelledBy: "ariaLabelledBy", ariaLive: "ariaLive", ariaSelected: "ariaSelected", ariaModal: "ariaModal", ariaValueMax: "ariaValueMax", ariaValueMin: "ariaValueMin", ariaValueNow: "ariaValueNow", ariaValueText: "ariaValueText", id: "id", role: "role" }, outputs: { press: "press", pressIn: "pressIn", pressOut: "pressOut", pressMove: "pressMove", longPress: "longPress", hoverIn: "hoverIn", hoverOut: "hoverOut", accessibilityAction: "accessibilityAction", accessibilityTap: "accessibilityTap", magicTap: "magicTap", accessibilityEscape: "accessibilityEscape" }, hostDirectives: [{ directive: i1.SymbioteStyleInputDirective, inputs: ["style", "style"] }], ngImport: i0, template: `
1128
- <Pressable
1129
- [style]="mergedStyle"
1130
- (press)="press.emit($event)"
1131
- (pressIn)="handlePressIn($event)"
1132
- (pressOut)="handlePressOut($event)"
1133
- (pressMove)="pressMove.emit($event)"
1134
- (longPress)="longPress.emit($event)"
1135
- (hoverIn)="hoverIn.emit($event)"
1136
- (hoverOut)="hoverOut.emit($event)"
1137
- [delayLongPress]="delayLongPress"
1138
- [delayHoverIn]="delayHoverIn"
1139
- [delayHoverOut]="delayHoverOut"
1140
- [disabled]="disabled"
1141
- [cancelable]="cancelable"
1142
- [hitSlop]="hitSlop"
1143
- [pressRetentionOffset]="pressRetentionOffset"
1144
- [unstable_pressDelay]="unstable_pressDelay"
1145
- [android_ripple]="android_ripple"
1146
- [android_disableSound]="android_disableSound"
1147
- [testID]="testID"
1148
- [nativeID]="nativeID"
1149
- [hasTVPreferredFocus]="hasTVPreferredFocus"
1150
- [nextFocusDown]="nextFocusDown"
1151
- [nextFocusForward]="nextFocusForward"
1152
- [nextFocusLeft]="nextFocusLeft"
1153
- [nextFocusRight]="nextFocusRight"
1154
- [nextFocusUp]="nextFocusUp"
1155
- [accessible]="accessible"
1156
- [accessibilityLabel]="accessibilityLabel"
1157
- [accessibilityHint]="accessibilityHint"
1158
- [accessibilityRole]="accessibilityRole"
1159
- [accessibilityState]="accessibilityState"
1160
- [accessibilityValue]="accessibilityValue"
1161
- [accessibilityActions]="accessibilityActions"
1162
- [accessibilityLabelledBy]="accessibilityLabelledBy"
1163
- [importantForAccessibility]="importantForAccessibility"
1164
- [accessibilityLiveRegion]="accessibilityLiveRegion"
1165
- [screenReaderFocusable]="screenReaderFocusable"
1166
- [accessibilityViewIsModal]="accessibilityViewIsModal"
1167
- [accessibilityElementsHidden]="accessibilityElementsHidden"
1168
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
1169
- [accessibilityLanguage]="accessibilityLanguage"
1170
- [accessibilityRespondsToUserInteraction]="
1171
- accessibilityRespondsToUserInteraction
1172
- "
1173
- [accessibilityShowsLargeContentViewer]="
1174
- accessibilityShowsLargeContentViewer
1175
- "
1176
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
1177
- (accessibilityAction)="accessibilityAction.emit($event)"
1178
- (accessibilityTap)="accessibilityTap.emit($event)"
1179
- (magicTap)="magicTap.emit($event)"
1180
- (accessibilityEscape)="accessibilityEscape.emit($event)"
1181
- [ariaLabel]="ariaLabel"
1182
- [ariaBusy]="ariaBusy"
1183
- [ariaChecked]="ariaChecked"
1184
- [ariaDisabled]="ariaDisabled"
1185
- [ariaExpanded]="ariaExpanded"
1186
- [ariaHidden]="ariaHidden"
1187
- [ariaLabelledBy]="ariaLabelledBy"
1188
- [ariaLive]="ariaLive"
1189
- [ariaSelected]="ariaSelected"
1190
- [ariaModal]="ariaModal"
1191
- [ariaValueMax]="ariaValueMax"
1192
- [ariaValueMin]="ariaValueMin"
1193
- [ariaValueNow]="ariaValueNow"
1194
- [ariaValueText]="ariaValueText"
1195
- [id]="id"
1196
- [role]="role"
1197
- >
1198
- <ng-content></ng-content>
1199
- </Pressable>
1200
- `, isInline: true, dependencies: [{ kind: "component", type: Pressable, selector: "Pressable, symbiote-pressable", inputs: ["delayLongPress", "disabled", "cancelable", "hitSlop", "pressRetentionOffset", "unstable_pressDelay", "android_ripple", "android_disableSound", "delayHoverIn", "delayHoverOut", "testID", "nativeID", "hasTVPreferredFocus", "nextFocusDown", "nextFocusForward", "nextFocusLeft", "nextFocusRight", "nextFocusUp", "style", "accessible", "accessibilityLabel", "accessibilityHint", "accessibilityRole", "accessibilityState", "accessibilityValue", "accessibilityActions", "accessibilityLabelledBy", "importantForAccessibility", "accessibilityLiveRegion", "screenReaderFocusable", "accessibilityViewIsModal", "accessibilityElementsHidden", "accessibilityIgnoresInvertColors", "accessibilityLanguage", "accessibilityRespondsToUserInteraction", "accessibilityShowsLargeContentViewer", "accessibilityLargeContentTitle", "ariaLabel", "ariaBusy", "ariaChecked", "ariaDisabled", "ariaExpanded", "ariaHidden", "ariaLabelledBy", "ariaLive", "ariaSelected", "ariaModal", "ariaValueMax", "ariaValueMin", "ariaValueNow", "ariaValueText", "id", "role"], outputs: ["press", "pressIn", "pressOut", "pressMove", "longPress", "hoverIn", "hoverOut", "accessibilityAction", "accessibilityTap", "magicTap", "accessibilityEscape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1201
- }
1202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TouchableWithoutFeedback, decorators: [{
1203
- type: Component,
1204
- args: [{
1205
- selector: 'TouchableWithoutFeedback',
1206
- standalone: true,
1207
- hostDirectives: [
1208
- { directive: SymbioteStyleInputDirective, inputs: ['style'] },
1209
- ],
1210
- imports: [Pressable],
1211
- changeDetection: ChangeDetectionStrategy.OnPush,
1212
- template: `
1213
- <Pressable
1214
- [style]="mergedStyle"
1215
- (press)="press.emit($event)"
1216
- (pressIn)="handlePressIn($event)"
1217
- (pressOut)="handlePressOut($event)"
1218
- (pressMove)="pressMove.emit($event)"
1219
- (longPress)="longPress.emit($event)"
1220
- (hoverIn)="hoverIn.emit($event)"
1221
- (hoverOut)="hoverOut.emit($event)"
1222
- [delayLongPress]="delayLongPress"
1223
- [delayHoverIn]="delayHoverIn"
1224
- [delayHoverOut]="delayHoverOut"
1225
- [disabled]="disabled"
1226
- [cancelable]="cancelable"
1227
- [hitSlop]="hitSlop"
1228
- [pressRetentionOffset]="pressRetentionOffset"
1229
- [unstable_pressDelay]="unstable_pressDelay"
1230
- [android_ripple]="android_ripple"
1231
- [android_disableSound]="android_disableSound"
1232
- [testID]="testID"
1233
- [nativeID]="nativeID"
1234
- [hasTVPreferredFocus]="hasTVPreferredFocus"
1235
- [nextFocusDown]="nextFocusDown"
1236
- [nextFocusForward]="nextFocusForward"
1237
- [nextFocusLeft]="nextFocusLeft"
1238
- [nextFocusRight]="nextFocusRight"
1239
- [nextFocusUp]="nextFocusUp"
1240
- [accessible]="accessible"
1241
- [accessibilityLabel]="accessibilityLabel"
1242
- [accessibilityHint]="accessibilityHint"
1243
- [accessibilityRole]="accessibilityRole"
1244
- [accessibilityState]="accessibilityState"
1245
- [accessibilityValue]="accessibilityValue"
1246
- [accessibilityActions]="accessibilityActions"
1247
- [accessibilityLabelledBy]="accessibilityLabelledBy"
1248
- [importantForAccessibility]="importantForAccessibility"
1249
- [accessibilityLiveRegion]="accessibilityLiveRegion"
1250
- [screenReaderFocusable]="screenReaderFocusable"
1251
- [accessibilityViewIsModal]="accessibilityViewIsModal"
1252
- [accessibilityElementsHidden]="accessibilityElementsHidden"
1253
- [accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
1254
- [accessibilityLanguage]="accessibilityLanguage"
1255
- [accessibilityRespondsToUserInteraction]="
1256
- accessibilityRespondsToUserInteraction
1257
- "
1258
- [accessibilityShowsLargeContentViewer]="
1259
- accessibilityShowsLargeContentViewer
1260
- "
1261
- [accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
1262
- (accessibilityAction)="accessibilityAction.emit($event)"
1263
- (accessibilityTap)="accessibilityTap.emit($event)"
1264
- (magicTap)="magicTap.emit($event)"
1265
- (accessibilityEscape)="accessibilityEscape.emit($event)"
1266
- [ariaLabel]="ariaLabel"
1267
- [ariaBusy]="ariaBusy"
1268
- [ariaChecked]="ariaChecked"
1269
- [ariaDisabled]="ariaDisabled"
1270
- [ariaExpanded]="ariaExpanded"
1271
- [ariaHidden]="ariaHidden"
1272
- [ariaLabelledBy]="ariaLabelledBy"
1273
- [ariaLive]="ariaLive"
1274
- [ariaSelected]="ariaSelected"
1275
- [ariaModal]="ariaModal"
1276
- [ariaValueMax]="ariaValueMax"
1277
- [ariaValueMin]="ariaValueMin"
1278
- [ariaValueNow]="ariaValueNow"
1279
- [ariaValueText]="ariaValueText"
1280
- [id]="id"
1281
- [role]="role"
1282
- >
1283
- <ng-content></ng-content>
1284
- </Pressable>
1285
- `,
1286
- }]
1287
- }], propDecorators: { press: [{
1288
- type: Output
1289
- }], pressIn: [{
1290
- type: Output
1291
- }], pressOut: [{
1292
- type: Output
1293
- }], pressMove: [{
1294
- type: Output
1295
- }], longPress: [{
1296
- type: Output
1297
- }], hoverIn: [{
1298
- type: Output
1299
- }], hoverOut: [{
1300
- type: Output
1301
- }], accessibilityAction: [{
1302
- type: Output
1303
- }], accessibilityTap: [{
1304
- type: Output
1305
- }], magicTap: [{
1306
- type: Output
1307
- }], accessibilityEscape: [{
1308
- type: Output
1309
- }], delayPressIn: [{
1310
- type: Input
1311
- }], delayPressOut: [{
1312
- type: Input
1313
- }], minPressDuration: [{
1314
- type: Input
1315
- }], style: [{
1316
- type: Input
1317
- }], delayLongPress: [{
1318
- type: Input
1319
- }], delayHoverIn: [{
1320
- type: Input
1321
- }], delayHoverOut: [{
1322
- type: Input
1323
- }], disabled: [{
1324
- type: Input
1325
- }], cancelable: [{
1326
- type: Input
1327
- }], hitSlop: [{
1328
- type: Input
1329
- }], pressRetentionOffset: [{
1330
- type: Input
1331
- }], unstable_pressDelay: [{
1332
- type: Input
1333
- }], android_ripple: [{
1334
- type: Input
1335
- }], android_disableSound: [{
1336
- type: Input
1337
- }], testID: [{
1338
- type: Input
1339
- }], nativeID: [{
1340
- type: Input
1341
- }], hasTVPreferredFocus: [{
1342
- type: Input
1343
- }], nextFocusDown: [{
1344
- type: Input
1345
- }], nextFocusForward: [{
1346
- type: Input
1347
- }], nextFocusLeft: [{
1348
- type: Input
1349
- }], nextFocusRight: [{
1350
- type: Input
1351
- }], nextFocusUp: [{
1352
- type: Input
1353
- }], accessible: [{
1354
- type: Input
1355
- }], accessibilityLabel: [{
1356
- type: Input
1357
- }], accessibilityHint: [{
1358
- type: Input
1359
- }], accessibilityRole: [{
1360
- type: Input
1361
- }], accessibilityState: [{
1362
- type: Input
1363
- }], accessibilityValue: [{
1364
- type: Input
1365
- }], accessibilityActions: [{
1366
- type: Input
1367
- }], accessibilityLabelledBy: [{
1368
- type: Input
1369
- }], importantForAccessibility: [{
1370
- type: Input
1371
- }], accessibilityLiveRegion: [{
1372
- type: Input
1373
- }], screenReaderFocusable: [{
1374
- type: Input
1375
- }], accessibilityViewIsModal: [{
1376
- type: Input
1377
- }], accessibilityElementsHidden: [{
1378
- type: Input
1379
- }], accessibilityIgnoresInvertColors: [{
1380
- type: Input
1381
- }], accessibilityLanguage: [{
1382
- type: Input
1383
- }], accessibilityRespondsToUserInteraction: [{
1384
- type: Input
1385
- }], accessibilityShowsLargeContentViewer: [{
1386
- type: Input
1387
- }], accessibilityLargeContentTitle: [{
1388
- type: Input
1389
- }], ariaLabel: [{
1390
- type: Input
1391
- }], ariaBusy: [{
1392
- type: Input
1393
- }], ariaChecked: [{
1394
- type: Input
1395
- }], ariaDisabled: [{
1396
- type: Input
1397
- }], ariaExpanded: [{
1398
- type: Input
1399
- }], ariaHidden: [{
1400
- type: Input
1401
- }], ariaLabelledBy: [{
1402
- type: Input
1403
- }], ariaLive: [{
1404
- type: Input
1405
- }], ariaSelected: [{
1406
- type: Input
1407
- }], ariaModal: [{
1408
- type: Input
1409
- }], ariaValueMax: [{
1410
- type: Input
1411
- }], ariaValueMin: [{
1412
- type: Input
1413
- }], ariaValueNow: [{
1414
- type: Input
1415
- }], ariaValueText: [{
1416
- type: Input
1417
- }], id: [{
1418
- type: Input
1419
- }], role: [{
1420
- type: Input
1421
- }] } });
1422
- //# sourceMappingURL=index.js.map