@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,290 +0,0 @@
1
- // ImageBackground: the Angular lifecycle half. ImageBackground has NO native host of its own —
2
- // it composes an outer View, an absolute-fill Image behind the user children, and the children
3
- // on top. The composition math (the absolute-fill, the wrapper-dimension proxy onto the inner
4
- // image, the imageStyle merge) lives framework-agnostic in @symbiote-native/components/renderImageBackground
5
- // and is shared verbatim with React/Vue. React/Vue bridge the Descriptor it returns; Angular has
6
- // no hyperscript bridge, so it composes with a TEMPLATE instead and reuses renderImageBackground
7
- // ONLY to compute the inner image's merged style (read off the tree it returns) — the math stays
8
- // shared, never reimplemented. The inner <Image> is the adapter's own Image component, which owns
9
- // source resolution / a11y folding / event emission; ImageBackground forwards every Image prop onto
10
- // it. `style` is the WRAPPER View style; `imageStyle` targets the inner image. Children paint AFTER
11
- // the image (on top) via <ng-content>. The Angular twin of the React/Vue ImageBackground.
12
-
13
- import {
14
- CUSTOM_ELEMENTS_SCHEMA,
15
- ChangeDetectionStrategy,
16
- Component,
17
- ElementRef,
18
- EventEmitter,
19
- inject,
20
- Input,
21
- Output,
22
- } from '@angular/core';
23
- import {
24
- renderImageBackground,
25
- resolveAccessibilityProps,
26
- type IAccessibilityProps,
27
- type IAccessibilityStateValue,
28
- type IAriaProps,
29
- type IImageProps,
30
- type IImageSourceProp,
31
- type IResizeMode,
32
- } from '@symbiote-native/components';
33
- import {
34
- resolveClassName,
35
- type IStyleProp,
36
- type ISymbioteEvent,
37
- type IViewStyle,
38
- } from '@symbiote-native/engine';
39
- import { Image } from './image';
40
- import {
41
- anchorHostStyle,
42
- SymbioteStyleInputDirective,
43
- ViewHost,
44
- } from '../primitives';
45
-
46
- // Mirrors React's IImageBackgroundProps minus children (Angular takes children via <ng-content>):
47
- // every forwarding Image prop flows onto the inner image; `style` is the WRAPPER View style and
48
- // `imageStyle` the inner image's.
49
- export interface IAngularImageBackgroundProps extends Omit<
50
- IImageProps,
51
- 'style'
52
- > {
53
- style?: IStyleProp<IViewStyle>;
54
- // A bare string resolves through the shared style registry, like `class` on the wrapper.
55
- imageStyle?: IStyleProp<IViewStyle> | string;
56
- }
57
-
58
- // What the ImageBackground component itself takes as plain @Input()s: the full surface minus the
59
- // inner Image's callback-shaped events, which it exposes as real @Output() EventEmitters instead
60
- // (re-emitting the inner <Image>'s own already-converted outputs — see the template below).
61
- export type IAngularImageBackgroundInputs = Omit<
62
- IAngularImageBackgroundProps,
63
- | 'onAccessibilityAction'
64
- | 'onAccessibilityTap'
65
- | 'onMagicTap'
66
- | 'onAccessibilityEscape'
67
- | 'onLoadStart'
68
- | 'onLoad'
69
- | 'onLoadEnd'
70
- | 'onError'
71
- | 'onProgress'
72
- | 'onPartialLoad'
73
- >;
74
-
75
- @Component({
76
- selector: 'ImageBackground',
77
- standalone: true,
78
- hostDirectives: [
79
- { directive: SymbioteStyleInputDirective, inputs: ['style'] },
80
- ],
81
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
82
- imports: [Image, ViewHost],
83
- changeDetection: ChangeDetectionStrategy.OnPush,
84
- template: `
85
- <symbiote-view [style]="wrapperStyle">
86
- <Image
87
- [source]="source"
88
- [defaultSource]="defaultSource"
89
- [loadingIndicatorSource]="loadingIndicatorSource"
90
- [style]="imageStyle"
91
- [resizeMode]="resizeMode"
92
- [resizeMethod]="resizeMethod"
93
- [tintColor]="tintColor"
94
- [blurRadius]="blurRadius"
95
- [capInsets]="capInsets"
96
- [fadeDuration]="fadeDuration"
97
- [progressiveRenderingEnabled]="progressiveRenderingEnabled"
98
- [src]="src"
99
- [srcSet]="srcSet"
100
- [alt]="alt"
101
- [width]="width"
102
- [height]="height"
103
- [crossOrigin]="crossOrigin"
104
- [referrerPolicy]="referrerPolicy"
105
- [testID]="testID"
106
- [nativeID]="nativeID"
107
- [accessible]="accessible"
108
- [accessibilityLabel]="folded.accessibilityLabel"
109
- [accessibilityHint]="folded.accessibilityHint"
110
- [accessibilityRole]="folded.accessibilityRole"
111
- [accessibilityState]="folded.accessibilityState"
112
- [accessibilityValue]="folded.accessibilityValue"
113
- [accessibilityActions]="folded.accessibilityActions"
114
- [accessibilityLabelledBy]="folded.accessibilityLabelledBy"
115
- [importantForAccessibility]="folded.importantForAccessibility"
116
- [accessibilityLiveRegion]="folded.accessibilityLiveRegion"
117
- [screenReaderFocusable]="folded.screenReaderFocusable"
118
- [accessibilityViewIsModal]="folded.accessibilityViewIsModal"
119
- [accessibilityElementsHidden]="folded.accessibilityElementsHidden"
120
- [accessibilityIgnoresInvertColors]="
121
- folded.accessibilityIgnoresInvertColors
122
- "
123
- [accessibilityLanguage]="folded.accessibilityLanguage"
124
- [accessibilityRespondsToUserInteraction]="
125
- folded.accessibilityRespondsToUserInteraction
126
- "
127
- [accessibilityShowsLargeContentViewer]="
128
- folded.accessibilityShowsLargeContentViewer
129
- "
130
- [accessibilityLargeContentTitle]="folded.accessibilityLargeContentTitle"
131
- (loadStart)="loadStart.emit($event)"
132
- (load)="load.emit($event)"
133
- (loadEnd)="loadEnd.emit($event)"
134
- (error)="error.emit($event)"
135
- (progress)="progress.emit($event)"
136
- (partialLoad)="partialLoad.emit($event)"
137
- (accessibilityAction)="accessibilityAction.emit($event)"
138
- (accessibilityTap)="accessibilityTap.emit($event)"
139
- (magicTap)="magicTap.emit($event)"
140
- (accessibilityEscape)="accessibilityEscape.emit($event)"
141
- />
142
- <ng-content></ng-content>
143
- </symbiote-view>
144
- `,
145
- })
146
- export class ImageBackground implements IAngularImageBackgroundInputs {
147
- // The inner <Image>'s events as real Angular events, re-emitted verbatim through
148
- // ImageBackground's own outputs: `(load)="load.emit($event)"`, not `[onLoad]="onLoad"`.
149
- @Output() readonly accessibilityAction = new EventEmitter<ISymbioteEvent>();
150
- @Output() readonly accessibilityTap = new EventEmitter<ISymbioteEvent>();
151
- @Output() readonly magicTap = new EventEmitter<ISymbioteEvent>();
152
- @Output() readonly accessibilityEscape = new EventEmitter<ISymbioteEvent>();
153
- @Output() readonly loadStart = new EventEmitter<ISymbioteEvent>();
154
- @Output() readonly load = new EventEmitter<ISymbioteEvent>();
155
- @Output() readonly loadEnd = new EventEmitter<ISymbioteEvent>();
156
- @Output() readonly error = new EventEmitter<ISymbioteEvent>();
157
- @Output() readonly progress = new EventEmitter<ISymbioteEvent>();
158
- @Output() readonly partialLoad = new EventEmitter<ISymbioteEvent>();
159
- @Input() source?: IImageSourceProp;
160
- @Input() defaultSource?: IImageSourceProp;
161
- @Input() loadingIndicatorSource?: IImageSourceProp;
162
- @Input() style?: IStyleProp<IViewStyle>;
163
- @Input('imageStyle') imageStyleValue?: IStyleProp<IViewStyle> | string;
164
- @Input() resizeMode?: IResizeMode;
165
- @Input() resizeMethod?: IImageProps['resizeMethod'];
166
- @Input() tintColor?: string;
167
- @Input() blurRadius?: number;
168
- @Input() capInsets?: IImageProps['capInsets'];
169
- @Input() fadeDuration?: number;
170
- @Input() progressiveRenderingEnabled?: boolean;
171
- @Input() src?: string;
172
- @Input() srcSet?: string;
173
- @Input() alt?: string;
174
- @Input() width?: number;
175
- @Input() height?: number;
176
- @Input() crossOrigin?: 'anonymous' | 'use-credentials';
177
- @Input() referrerPolicy?: string;
178
- @Input() testID?: string;
179
- @Input() nativeID?: string;
180
- @Input() accessible?: boolean;
181
- @Input() accessibilityLabel?: string;
182
- @Input() accessibilityHint?: string;
183
- @Input() accessibilityRole?: IAccessibilityProps['accessibilityRole'];
184
- @Input() accessibilityState?: IAccessibilityStateValue;
185
- @Input() accessibilityValue?: IAccessibilityProps['accessibilityValue'];
186
- @Input() accessibilityActions?: IAccessibilityProps['accessibilityActions'];
187
- @Input() accessibilityLabelledBy?: string | string[];
188
- @Input()
189
- importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
190
- @Input()
191
- accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
192
- @Input() screenReaderFocusable?: boolean;
193
- @Input() accessibilityViewIsModal?: boolean;
194
- @Input() accessibilityElementsHidden?: boolean;
195
- @Input() accessibilityIgnoresInvertColors?: boolean;
196
- @Input() accessibilityLanguage?: string;
197
- @Input() accessibilityRespondsToUserInteraction?: boolean;
198
- @Input() accessibilityShowsLargeContentViewer?: boolean;
199
- @Input() accessibilityLargeContentTitle?: string;
200
- @Input() role?: IAriaProps['role'];
201
- @Input('aria-label') ariaLabel?: string;
202
- @Input('aria-labelledby') ariaLabelledBy?: string;
203
- @Input('aria-live') ariaLive?: IAriaProps['aria-live'];
204
- @Input('aria-hidden') ariaHidden?: boolean;
205
- @Input('aria-busy') ariaBusy?: boolean;
206
- @Input('aria-checked') ariaChecked?: boolean | 'mixed';
207
- @Input('aria-disabled') ariaDisabled?: boolean;
208
- @Input('aria-expanded') ariaExpanded?: boolean;
209
- @Input('aria-selected') ariaSelected?: boolean;
210
- @Input('aria-modal') ariaModal?: boolean;
211
- @Input('aria-valuemax') ariaValueMax?: number;
212
- @Input('aria-valuemin') ariaValueMin?: number;
213
- @Input('aria-valuenow') ariaValueNow?: number;
214
- @Input('aria-valuetext') ariaValueText?: string;
215
-
216
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
217
- // onto (see anchorHostStyle's doc comment) — NOT the inner `symbiote-view [style]="wrapperStyle"`
218
- // one level down. Merged FIRST so the explicit `style` @Input still wins (flattenStyle's
219
- // later-wins collapse), mirroring every other composed component's anchor merge. `imageStyle`
220
- // below stays untouched per the ImageBackground-specific nuance: it targets the inner image, not
221
- // this component's own root.
222
- private readonly elementRef = inject(ElementRef);
223
-
224
- get wrapperStyle(): unknown {
225
- return [anchorHostStyle(this.elementRef), this.style];
226
- }
227
-
228
- // renderImageBackground owns the absolute-fill + wrapper-dimension-proxy + imageStyle merge
229
- // (shared verbatim with React/Vue); read the inner image Descriptor's style off the tree it
230
- // returns rather than reimplementing it. Only style/imageStyle drive that merge, so the image
231
- // bag is empty here — the inner <Image> below resolves source / a11y / events on its own.
232
- get imageStyle(): IStyleProp<IViewStyle> | undefined {
233
- // imageStyle targets the INNER image (renderImageBackground's own field); resolve a
234
- // class-name string here, before it flows into the merge.
235
- const resolvedImageStyleValue =
236
- typeof this.imageStyleValue === 'string'
237
- ? resolveClassName(this.imageStyleValue)
238
- : this.imageStyleValue;
239
- const inner = renderImageBackground({
240
- style: this.style,
241
- imageStyle: resolvedImageStyleValue,
242
- image: { passthrough: {} },
243
- }).children[0];
244
- return typeof inner === 'string'
245
- ? undefined
246
- : (inner.props.style as IStyleProp<IViewStyle> | undefined);
247
- }
248
-
249
- // Fold the web aria-*/role aliases into the canonical accessibility* props once per render, so the
250
- // inner image never sees an aria-* key (native ignores them) — the shared transform every adapter
251
- // runs. The inner <Image> re-runs the same fold idempotently over the already-folded props.
252
- get folded(): Partial<IAngularImageBackgroundProps> {
253
- return resolveAccessibilityProps({
254
- accessibilityLabel: this.accessibilityLabel,
255
- accessibilityHint: this.accessibilityHint,
256
- accessibilityRole: this.accessibilityRole,
257
- accessibilityState: this.accessibilityState,
258
- accessibilityValue: this.accessibilityValue,
259
- accessibilityActions: this.accessibilityActions,
260
- accessibilityLabelledBy: this.accessibilityLabelledBy,
261
- importantForAccessibility: this.importantForAccessibility,
262
- accessibilityLiveRegion: this.accessibilityLiveRegion,
263
- screenReaderFocusable: this.screenReaderFocusable,
264
- accessibilityViewIsModal: this.accessibilityViewIsModal,
265
- accessibilityElementsHidden: this.accessibilityElementsHidden,
266
- accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
267
- accessibilityLanguage: this.accessibilityLanguage,
268
- accessibilityRespondsToUserInteraction:
269
- this.accessibilityRespondsToUserInteraction,
270
- accessibilityShowsLargeContentViewer:
271
- this.accessibilityShowsLargeContentViewer,
272
- accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
273
- role: this.role,
274
- 'aria-label': this.ariaLabel,
275
- 'aria-labelledby': this.ariaLabelledBy,
276
- 'aria-live': this.ariaLive,
277
- 'aria-hidden': this.ariaHidden,
278
- 'aria-busy': this.ariaBusy,
279
- 'aria-checked': this.ariaChecked,
280
- 'aria-disabled': this.ariaDisabled,
281
- 'aria-expanded': this.ariaExpanded,
282
- 'aria-selected': this.ariaSelected,
283
- 'aria-modal': this.ariaModal,
284
- 'aria-valuemax': this.ariaValueMax,
285
- 'aria-valuemin': this.ariaValueMin,
286
- 'aria-valuenow': this.ariaValueNow,
287
- 'aria-valuetext': this.ariaValueText,
288
- });
289
- }
290
- }
@@ -1,240 +0,0 @@
1
- // InputAccessoryView, the Angular lifecycle half (iOS). RCTInputAccessoryView is a real Fabric
2
- // host node that docks its content above the keyboard; a TextInput points at it by nativeID through
3
- // its inputAccessoryViewID. The host-node assembly (nativeID / backgroundColor / style /
4
- // accessibility forwarding) lives framework-agnostic in
5
- // @symbiote-native/components/renderInputAccessoryView and is shared verbatim with React/Vue; here
6
- // Angular supplies only the lifecycle — it folds aria/role, reads the resolved props off the
7
- // Descriptor, and nests the user children under the host via <ng-content>. The Angular twin of the
8
- // React/Vue InputAccessoryView. No platform branch, so this stays flat.
9
-
10
- import {
11
- CUSTOM_ELEMENTS_SCHEMA,
12
- ChangeDetectionStrategy,
13
- Component,
14
- computed,
15
- ElementRef,
16
- EventEmitter,
17
- inject,
18
- Input,
19
- Output,
20
- signal,
21
- type DoCheck,
22
- type OnChanges,
23
- } from '@angular/core';
24
- import {
25
- renderInputAccessoryView,
26
- resolveAccessibilityProps,
27
- type IAccessibilityProps,
28
- type IAccessibilityStateValue,
29
- type IAriaProps,
30
- } from '@symbiote-native/components';
31
- import {
32
- isSymbioteEvent,
33
- type IStyleProp,
34
- type ISymbioteEvent,
35
- type IViewStyle,
36
- } from '@symbiote-native/engine';
37
- import {
38
- anchorHostStyle,
39
- InputAccessoryViewHost,
40
- SymbioteHostPropsDirective,
41
- SymbioteStyleInputDirective,
42
- } from '../../primitives';
43
-
44
- // Mirrors React's IInputAccessoryViewProps minus children (Angular takes children via
45
- // <ng-content>), declared per-adapter over the shared a11y base.
46
- export interface IAngularInputAccessoryViewProps
47
- extends IAccessibilityProps, IAriaProps {
48
- // The id a TextInput's inputAccessoryViewID points at to dock above its keyboard.
49
- nativeID?: string;
50
- backgroundColor?: string;
51
- style?: IStyleProp<IViewStyle>;
52
- }
53
-
54
- // What the component itself takes as plain @Input()s: the full surface minus the accessibility
55
- // callbacks, which it exposes as real @Output() EventEmitters instead (see the class below),
56
- // mirroring Pressable's IAngularPressableInputs split.
57
- export type IAngularInputAccessoryViewInputs = Omit<
58
- IAngularInputAccessoryViewProps,
59
- | 'onAccessibilityAction'
60
- | 'onAccessibilityTap'
61
- | 'onMagicTap'
62
- | 'onAccessibilityEscape'
63
- >;
64
-
65
- @Component({
66
- selector: 'InputAccessoryView',
67
- standalone: true,
68
- hostDirectives: [
69
- { directive: SymbioteStyleInputDirective, inputs: ['style'] },
70
- ],
71
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
72
- imports: [InputAccessoryViewHost, SymbioteHostPropsDirective],
73
- changeDetection: ChangeDetectionStrategy.OnPush,
74
- template: `
75
- <symbiote-input-accessory-view
76
- [symbioteHostProps]="hostProps()"
77
- (accessibilityAction)="emit(accessibilityAction, $event)"
78
- (accessibilityTap)="emit(accessibilityTap, $event)"
79
- (magicTap)="emit(magicTap, $event)"
80
- (accessibilityEscape)="emit(accessibilityEscape, $event)"
81
- >
82
- <ng-content></ng-content>
83
- </symbiote-input-accessory-view>
84
- `,
85
- })
86
- export class InputAccessoryView
87
- implements IAngularInputAccessoryViewInputs, OnChanges, DoCheck
88
- {
89
- @Input() nativeID?: string;
90
- @Input() backgroundColor?: string;
91
- @Input() style?: IStyleProp<IViewStyle>;
92
- @Output() readonly accessibilityAction = new EventEmitter<ISymbioteEvent>();
93
- @Output() readonly accessibilityTap = new EventEmitter<ISymbioteEvent>();
94
- @Output() readonly magicTap = new EventEmitter<ISymbioteEvent>();
95
- @Output() readonly accessibilityEscape = new EventEmitter<ISymbioteEvent>();
96
- @Input() testID?: string;
97
- @Input() accessible?: boolean;
98
- @Input() accessibilityLabel?: string;
99
- @Input() accessibilityHint?: string;
100
- @Input() accessibilityRole?: IAccessibilityProps['accessibilityRole'];
101
- @Input() accessibilityState?: IAccessibilityStateValue;
102
- @Input() accessibilityValue?: IAccessibilityProps['accessibilityValue'];
103
- @Input() accessibilityActions?: IAccessibilityProps['accessibilityActions'];
104
- @Input() accessibilityLabelledBy?: string | string[];
105
- @Input()
106
- importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
107
- @Input()
108
- accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
109
- @Input() screenReaderFocusable?: boolean;
110
- @Input() accessibilityViewIsModal?: boolean;
111
- @Input() accessibilityElementsHidden?: boolean;
112
- @Input() accessibilityIgnoresInvertColors?: boolean;
113
- @Input() accessibilityLanguage?: string;
114
- @Input() accessibilityRespondsToUserInteraction?: boolean;
115
- @Input() accessibilityShowsLargeContentViewer?: boolean;
116
- @Input() accessibilityLargeContentTitle?: string;
117
- @Input() role?: IAriaProps['role'];
118
- @Input('aria-label') ariaLabel?: string;
119
- @Input('aria-labelledby') ariaLabelledBy?: string;
120
- @Input('aria-live') ariaLive?: IAriaProps['aria-live'];
121
- @Input('aria-hidden') ariaHidden?: boolean;
122
- @Input('aria-busy') ariaBusy?: boolean;
123
- @Input('aria-checked') ariaChecked?: boolean | 'mixed';
124
- @Input('aria-disabled') ariaDisabled?: boolean;
125
- @Input('aria-expanded') ariaExpanded?: boolean;
126
- @Input('aria-selected') ariaSelected?: boolean;
127
- @Input('aria-modal') ariaModal?: boolean;
128
- @Input('aria-valuemax') ariaValueMax?: number;
129
- @Input('aria-valuemin') ariaValueMin?: number;
130
- @Input('aria-valuenow') ariaValueNow?: number;
131
- @Input('aria-valuetext') ariaValueText?: string;
132
-
133
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
134
- // onto (see anchorHostStyle's doc comment). InputAccessoryView has no inner ViewChild, so this
135
- // is the only ElementRef in the class.
136
- private readonly elementRef = inject(ElementRef);
137
-
138
- // Forward an engine event to the matching @Output(), narrowing the template's untyped $event.
139
- emit(emitter: EventEmitter<ISymbioteEvent>, event: unknown): void {
140
- if (isSymbioteEvent(event)) emitter.emit(event);
141
- }
142
-
143
- // renderInputAccessoryView owns the host-node assembly (shared with React/Vue); the adapter reads
144
- // the resolved host props off the Descriptor it returns.
145
- private get descriptor() {
146
- return renderInputAccessoryView({
147
- nativeID: this.nativeID,
148
- backgroundColor: this.backgroundColor,
149
- style: this.style,
150
- passthrough: resolveAccessibilityProps(this.accessibilityInputs()),
151
- });
152
- }
153
-
154
- // Bridges the non-reactive fields `hostProps` reads into the reactive graph, so it can memoize.
155
- // Plain fields read inside a computed() are UNTRACKED - something must signal "a dependency
156
- // changed" or the bag goes stale. Signal inputs would do this natively, but `input()` is visible
157
- // only to the AOT compiler and this package's unit suite runs on JIT (see the
158
- // `angular-adapter-change-detection` skill, §6); `signal()`/`computed()` are plain runtime APIs.
159
- private readonly hostPropsRevision = signal(0);
160
- // What the anchor's class-derived style was when the bag was last built (identity, not value).
161
- private lastAnchorStyle: unknown;
162
-
163
- ngOnChanges(): void {
164
- // The single moment Angular has finished writing every changed @Input for this pass.
165
- this.hostPropsRevision.update(revision => revision + 1);
166
- }
167
-
168
- // The anchor's class-derived style is NOT an @Input: `class="..."`/`[ngClass]` at the use site
169
- // resolves through the renderer's addClass onto this component's anchor host (see
170
- // anchorHostStyle's doc comment), so it never shows up in SimpleChanges and ngOnChanges alone
171
- // would leave a later class toggle stranded. ngDoCheck runs at exactly the cadence the old
172
- // getter was re-read, and bumps only on a real identity change.
173
- ngDoCheck(): void {
174
- const anchorStyle = anchorHostStyle(this.elementRef);
175
- if (anchorStyle === this.lastAnchorStyle) return;
176
- this.lastAnchorStyle = anchorStyle;
177
- this.hostPropsRevision.update(revision => revision + 1);
178
- }
179
-
180
- // The anchor's class-derived style goes FIRST, the Descriptor's resolved style SECOND —
181
- // flattenStyle's later-wins collapse keeps an explicit [style] winning over its ambient class.
182
- //
183
- // A computed(), not a getter: Angular re-reads a template getter on every refresh of this view
184
- // and `[symbioteHostProps]` compares by REFERENCE, so a freshly rebuilt (but identical) bag
185
- // re-pushes every key through renderer.setProperty -> the engine's prop routing - and this one
186
- // re-runs renderInputAccessoryView to build it.
187
- readonly hostProps = computed<Record<string, unknown>>(() => {
188
- this.hostPropsRevision();
189
- const descriptorProps = this.descriptor.props;
190
- return {
191
- ...descriptorProps,
192
- style: [anchorHostStyle(this.elementRef), descriptorProps.style],
193
- };
194
- });
195
-
196
- // Typed as the a11y intersection WITH the string index (the bag renderInputAccessoryView spreads
197
- // into the host props), so resolveAccessibilityProps's result stays assignable to passthrough.
198
- private accessibilityInputs(): IAccessibilityProps &
199
- IAriaProps &
200
- Record<string, unknown> {
201
- return {
202
- testID: this.testID,
203
- accessible: this.accessible,
204
- accessibilityLabel: this.accessibilityLabel,
205
- accessibilityHint: this.accessibilityHint,
206
- accessibilityRole: this.accessibilityRole,
207
- accessibilityState: this.accessibilityState,
208
- accessibilityValue: this.accessibilityValue,
209
- accessibilityActions: this.accessibilityActions,
210
- accessibilityLabelledBy: this.accessibilityLabelledBy,
211
- importantForAccessibility: this.importantForAccessibility,
212
- accessibilityLiveRegion: this.accessibilityLiveRegion,
213
- screenReaderFocusable: this.screenReaderFocusable,
214
- accessibilityViewIsModal: this.accessibilityViewIsModal,
215
- accessibilityElementsHidden: this.accessibilityElementsHidden,
216
- accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
217
- accessibilityLanguage: this.accessibilityLanguage,
218
- accessibilityRespondsToUserInteraction:
219
- this.accessibilityRespondsToUserInteraction,
220
- accessibilityShowsLargeContentViewer:
221
- this.accessibilityShowsLargeContentViewer,
222
- accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
223
- role: this.role,
224
- 'aria-label': this.ariaLabel,
225
- 'aria-labelledby': this.ariaLabelledBy,
226
- 'aria-live': this.ariaLive,
227
- 'aria-hidden': this.ariaHidden,
228
- 'aria-busy': this.ariaBusy,
229
- 'aria-checked': this.ariaChecked,
230
- 'aria-disabled': this.ariaDisabled,
231
- 'aria-expanded': this.ariaExpanded,
232
- 'aria-selected': this.ariaSelected,
233
- 'aria-modal': this.ariaModal,
234
- 'aria-valuemax': this.ariaValueMax,
235
- 'aria-valuemin': this.ariaValueMin,
236
- 'aria-valuenow': this.ariaValueNow,
237
- 'aria-valuetext': this.ariaValueText,
238
- };
239
- }
240
- }