@symbiote-native/angular 3.1.3 → 3.3.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 (165) hide show
  1. package/babel-register-composed.cjs +1 -0
  2. package/build/angular/accessibility-events.d.ts +12 -0
  3. package/build/angular/accessibility-events.js +28 -0
  4. package/build/angular/accessibility-events.js.map +1 -0
  5. package/build/angular/accessibility-inputs.d.ts +40 -0
  6. package/build/angular/accessibility-inputs.js +130 -0
  7. package/build/angular/accessibility-inputs.js.map +1 -0
  8. package/build/angular/bootstrap.d.ts +3 -1
  9. package/build/angular/bootstrap.js +4 -1
  10. package/build/angular/bootstrap.js.map +1 -1
  11. package/build/angular/components/checkbox-props.d.ts +2 -0
  12. package/build/angular/components/checkbox-props.js +2 -0
  13. package/build/angular/components/checkbox-props.js.map +1 -0
  14. package/build/angular/components/flat-list/flat-list-template.d.ts +1 -0
  15. package/build/angular/components/flat-list/flat-list-template.js +158 -0
  16. package/build/angular/components/flat-list/flat-list-template.js.map +1 -0
  17. package/build/angular/components/flat-list/index.d.ts +6 -61
  18. package/build/angular/components/flat-list/index.js +26 -463
  19. package/build/angular/components/flat-list/index.js.map +1 -1
  20. package/build/angular/components/keyboard-avoiding-view/index.d.ts +4 -40
  21. package/build/angular/components/keyboard-avoiding-view/index.js +7 -131
  22. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  23. package/build/angular/components/modal/index.d.ts +5 -41
  24. package/build/angular/components/modal/index.js +8 -133
  25. package/build/angular/components/modal/index.js.map +1 -1
  26. package/build/angular/components/section-list/index.d.ts +4 -51
  27. package/build/angular/components/section-list/index.js +18 -335
  28. package/build/angular/components/section-list/index.js.map +1 -1
  29. package/build/angular/components/virtualized-list/cell-registry.d.ts +35 -0
  30. package/build/angular/components/virtualized-list/cell-registry.js +133 -0
  31. package/build/angular/components/virtualized-list/cell-registry.js.map +1 -0
  32. package/build/angular/components/virtualized-list/index.d.ts +18 -253
  33. package/build/angular/components/virtualized-list/index.js +112 -1178
  34. package/build/angular/components/virtualized-list/index.js.map +1 -1
  35. package/build/angular/components/virtualized-list/list-a11y-forward.d.ts +1 -0
  36. package/build/angular/components/virtualized-list/list-a11y-forward.js +42 -0
  37. package/build/angular/components/virtualized-list/list-a11y-forward.js.map +1 -0
  38. package/build/angular/components/virtualized-list/list-bags.d.ts +32 -0
  39. package/build/angular/components/virtualized-list/list-bags.js +120 -0
  40. package/build/angular/components/virtualized-list/list-bags.js.map +1 -0
  41. package/build/angular/components/virtualized-list/list-effects.d.ts +31 -0
  42. package/build/angular/components/virtualized-list/list-effects.js +83 -0
  43. package/build/angular/components/virtualized-list/list-effects.js.map +1 -0
  44. package/build/angular/components/virtualized-list/list-events.d.ts +17 -0
  45. package/build/angular/components/virtualized-list/list-events.js +34 -0
  46. package/build/angular/components/virtualized-list/list-events.js.map +1 -0
  47. package/build/angular/components/virtualized-list/list-handle.d.ts +35 -0
  48. package/build/angular/components/virtualized-list/list-handle.js +61 -0
  49. package/build/angular/components/virtualized-list/list-handle.js.map +1 -0
  50. package/build/angular/components/virtualized-list/list-inputs.d.ts +78 -0
  51. package/build/angular/components/virtualized-list/list-inputs.js +150 -0
  52. package/build/angular/components/virtualized-list/list-inputs.js.map +1 -0
  53. package/build/angular/components/virtualized-list/list-props.d.ts +58 -0
  54. package/build/angular/components/virtualized-list/list-props.js +3 -0
  55. package/build/angular/components/virtualized-list/list-props.js.map +1 -0
  56. package/build/angular/components/virtualized-list/list-styles.d.ts +23 -0
  57. package/build/angular/components/virtualized-list/list-styles.js +26 -0
  58. package/build/angular/components/virtualized-list/list-styles.js.map +1 -0
  59. package/build/angular/components/virtualized-list/list-template.d.ts +1 -0
  60. package/build/angular/components/virtualized-list/list-template.js +176 -0
  61. package/build/angular/components/virtualized-list/list-template.js.map +1 -0
  62. package/build/angular/components/virtualized-section-list/index.d.ts +13 -70
  63. package/build/angular/components/virtualized-section-list/index.js +22 -455
  64. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  65. package/build/angular/components/virtualized-section-list/section-list-template.d.ts +1 -0
  66. package/build/angular/components/virtualized-section-list/section-list-template.js +107 -0
  67. package/build/angular/components/virtualized-section-list/section-list-template.js.map +1 -0
  68. package/build/angular/components.d.ts +1 -0
  69. package/build/angular/components.js.map +1 -1
  70. package/build/angular/descriptor-to-angular/descriptor-host.d.ts +8 -0
  71. package/build/angular/descriptor-to-angular/descriptor-host.js +38 -0
  72. package/build/angular/descriptor-to-angular/descriptor-host.js.map +1 -0
  73. package/build/angular/descriptor-to-angular/index.d.ts +1 -0
  74. package/build/angular/descriptor-to-angular/index.js +4 -0
  75. package/build/angular/descriptor-to-angular/index.js.map +1 -1
  76. package/build/angular/element-base.d.ts +153 -0
  77. package/build/angular/element-base.js +272 -0
  78. package/build/angular/element-base.js.map +1 -0
  79. package/build/angular/elements-controls.d.ts +165 -0
  80. package/build/angular/elements-controls.js +382 -0
  81. package/build/angular/elements-controls.js.map +1 -0
  82. package/build/angular/elements-layout.d.ts +122 -0
  83. package/build/angular/elements-layout.js +242 -0
  84. package/build/angular/elements-layout.js.map +1 -0
  85. package/build/angular/elements-press.d.ts +96 -0
  86. package/build/angular/elements-press.js +227 -0
  87. package/build/angular/elements-press.js.map +1 -0
  88. package/build/angular/elements.d.ts +6 -516
  89. package/build/angular/elements.js +8 -1091
  90. package/build/angular/elements.js.map +1 -1
  91. package/build/angular/finalization-registry.d.ts +4 -0
  92. package/build/angular/finalization-registry.js +17 -0
  93. package/build/angular/finalization-registry.js.map +1 -0
  94. package/build/angular/host-instance/index.d.ts +2 -0
  95. package/build/angular/host-instance/index.js +4 -4
  96. package/build/angular/host-instance/index.js.map +1 -1
  97. package/build/angular/index.d.ts +9 -4
  98. package/build/angular/index.js +8 -3
  99. package/build/angular/index.js.map +1 -1
  100. package/build/angular/native-view-base.d.ts +27 -0
  101. package/build/angular/native-view-base.js +69 -0
  102. package/build/angular/native-view-base.js.map +1 -0
  103. package/build/angular/render/index.d.ts +2 -1
  104. package/build/angular/render/index.js +46 -73
  105. package/build/angular/render/index.js.map +1 -1
  106. package/build/angular/services/connect-watched-signal.d.ts +2 -0
  107. package/build/angular/services/connect-watched-signal.js +9 -0
  108. package/build/angular/services/connect-watched-signal.js.map +1 -0
  109. package/build/angular/services/create-event-value-hook.d.ts +3 -0
  110. package/build/angular/services/create-event-value-hook.js +17 -0
  111. package/build/angular/services/create-event-value-hook.js.map +1 -0
  112. package/build/angular/services/create-resource-hook.d.ts +7 -0
  113. package/build/angular/services/create-resource-hook.js +20 -0
  114. package/build/angular/services/create-resource-hook.js.map +1 -0
  115. package/build/angular/services/index.d.ts +5 -0
  116. package/build/angular/services/index.js +5 -0
  117. package/build/angular/services/index.js.map +1 -1
  118. package/build/angular/services/inject-event.d.ts +6 -0
  119. package/build/angular/services/inject-event.js +24 -0
  120. package/build/angular/services/inject-event.js.map +1 -0
  121. package/build/angular/services/permissions-service-base.d.ts +14 -0
  122. package/build/angular/services/permissions-service-base.js +38 -0
  123. package/build/angular/services/permissions-service-base.js.map +1 -0
  124. package/package.json +6 -6
  125. package/src/accessibility-events.ts +13 -0
  126. package/src/accessibility-inputs.ts +89 -0
  127. package/src/bootstrap.ts +6 -2
  128. package/src/components/checkbox-props.ts +12 -0
  129. package/src/components/flat-list/flat-list-template.ts +159 -0
  130. package/src/components/flat-list/index.ts +30 -307
  131. package/src/components/keyboard-avoiding-view/index.ts +4 -78
  132. package/src/components/modal/index.ts +7 -80
  133. package/src/components/section-list/index.ts +21 -172
  134. package/src/components/virtualized-list/cell-registry.ts +199 -0
  135. package/src/components/virtualized-list/index.ts +145 -1181
  136. package/src/components/virtualized-list/list-a11y-forward.ts +42 -0
  137. package/src/components/virtualized-list/list-bags.ts +142 -0
  138. package/src/components/virtualized-list/list-effects.ts +116 -0
  139. package/src/components/virtualized-list/list-events.ts +31 -0
  140. package/src/components/virtualized-list/list-handle.ts +92 -0
  141. package/src/components/virtualized-list/list-inputs.ts +149 -0
  142. package/src/components/virtualized-list/list-props.ts +81 -0
  143. package/src/components/virtualized-list/list-styles.ts +62 -0
  144. package/src/components/virtualized-list/list-template.ts +175 -0
  145. package/src/components/virtualized-section-list/index.ts +40 -351
  146. package/src/components/virtualized-section-list/section-list-template.ts +108 -0
  147. package/src/components.ts +1 -0
  148. package/src/descriptor-to-angular/descriptor-host.ts +27 -0
  149. package/src/descriptor-to-angular/index.ts +5 -0
  150. package/src/element-base.ts +272 -0
  151. package/src/elements-controls.ts +282 -0
  152. package/src/elements-layout.ts +141 -0
  153. package/src/elements-press.ts +145 -0
  154. package/src/elements.ts +73 -788
  155. package/src/finalization-registry.ts +18 -0
  156. package/src/host-instance/index.ts +4 -4
  157. package/src/index.ts +18 -2
  158. package/src/native-view-base.ts +86 -0
  159. package/src/render/index.ts +76 -77
  160. package/src/services/connect-watched-signal.ts +15 -0
  161. package/src/services/create-event-value-hook.ts +24 -0
  162. package/src/services/create-resource-hook.ts +32 -0
  163. package/src/services/index.ts +5 -0
  164. package/src/services/inject-event.ts +52 -0
  165. package/src/services/permissions-service-base.ts +46 -0
@@ -0,0 +1,282 @@
1
+ import {
2
+ Directive,
3
+ ElementRef,
4
+ EventEmitter,
5
+ Input,
6
+ Output,
7
+ Renderer2,
8
+ forwardRef,
9
+ inject,
10
+ } from '@angular/core';
11
+ import type { OnDestroy } from '@angular/core';
12
+ import { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';
13
+ import { VALUE_CHANGE_EVENT } from './renderer/value-change';
14
+ import type {
15
+ IActivityIndicatorProps,
16
+ IInputAccessoryViewViewProps,
17
+ IModalViewProps,
18
+ ISwitchProps,
19
+ ITextInputProps,
20
+ } from '@symbiote-native/components';
21
+ import type { IStickyHeaderElementProps } from './element-props';
22
+ import type { IAngularRefreshControlProps } from './components/refresh-control-props';
23
+ import {
24
+ ReadBackElement,
25
+ SymbioteElement,
26
+ ValueChangeElement,
27
+ } from './element-base';
28
+
29
+ @Directive({ selector: 'text-input', standalone: true })
30
+ export class TextInputElement extends ValueChangeElement {
31
+ @Input() value?: ITextInputProps['value'];
32
+ @Input() defaultValue?: ITextInputProps['defaultValue'];
33
+ @Input() placeholder?: ITextInputProps['placeholder'];
34
+ @Input() placeholderTextColor?: ITextInputProps['placeholderTextColor'];
35
+ @Input() multiline?: ITextInputProps['multiline'];
36
+ @Input() numberOfLines?: ITextInputProps['numberOfLines'];
37
+ @Input() maxLength?: ITextInputProps['maxLength'];
38
+ @Input() editable?: ITextInputProps['editable'];
39
+ @Input() readOnly?: ITextInputProps['readOnly'];
40
+ @Input() autoFocus?: ITextInputProps['autoFocus'];
41
+ @Input() autoCapitalize?: ITextInputProps['autoCapitalize'];
42
+ @Input() autoComplete?: ITextInputProps['autoComplete'];
43
+ @Input() autoCorrect?: ITextInputProps['autoCorrect'];
44
+ @Input() blurOnSubmit?: ITextInputProps['blurOnSubmit'];
45
+ @Input() submitBehavior?: ITextInputProps['submitBehavior'];
46
+ @Input() cursorColor?: ITextInputProps['cursorColor'];
47
+ @Input() enterKeyHint?: ITextInputProps['enterKeyHint'];
48
+ @Input() returnKeyType?: ITextInputProps['returnKeyType'];
49
+ @Input() inputMode?: ITextInputProps['inputMode'];
50
+ @Input() keyboardType?: ITextInputProps['keyboardType'];
51
+ @Input() inputAccessoryViewID?: ITextInputProps['inputAccessoryViewID'];
52
+ @Input() scrollEnabled?: ITextInputProps['scrollEnabled'];
53
+ @Input() secureTextEntry?: ITextInputProps['secureTextEntry'];
54
+ @Input() selectTextOnFocus?: ITextInputProps['selectTextOnFocus'];
55
+ @Input() selection?: ITextInputProps['selection'];
56
+ @Input() selectionColor?: ITextInputProps['selectionColor'];
57
+ @Input() selectionHandleColor?: ITextInputProps['selectionHandleColor'];
58
+ @Input() showSoftInputOnFocus?: ITextInputProps['showSoftInputOnFocus'];
59
+ @Input() textAlign?: ITextInputProps['textAlign'];
60
+ @Input() textContentType?: ITextInputProps['textContentType'];
61
+ @Input() underlineColorAndroid?: ITextInputProps['underlineColorAndroid'];
62
+ @Input() onValueChange?: ITextInputProps['onValueChange'];
63
+ @Input() onChangeText?: ITextInputProps['onChangeText'];
64
+ @Input() onContentSizeChange?: ITextInputProps['onContentSizeChange'];
65
+ @Input() onEndEditing?: ITextInputProps['onEndEditing'];
66
+ @Input() onKeyPress?: ITextInputProps['onKeyPress'];
67
+ @Input() onSelectionChange?: ITextInputProps['onSelectionChange'];
68
+ @Input() onSubmitEditing?: ITextInputProps['onSubmitEditing'];
69
+
70
+ // NonNullable, not the prop type: `[(value)]="name"` binds a `string`, and an emitter that can
71
+ // also emit `undefined` fails the two-way assignability check ngtsc runs on the event half.
72
+ @Output() readonly valueChange = new EventEmitter<
73
+ NonNullable<ITextInputProps['value']>
74
+ >();
75
+
76
+ protected hasValueSubscriber(): boolean {
77
+ return this.valueChange.observed;
78
+ }
79
+
80
+ protected emitValue(value: unknown): void {
81
+ if (typeof value === 'string') this.valueChange.emit(value);
82
+ }
83
+ }
84
+
85
+ @Directive({ selector: 'text-input-multiline', standalone: true })
86
+ export class MultilineTextInputElement extends TextInputElement {}
87
+
88
+ @Directive({ selector: 'switch, symbiote-switch', standalone: true })
89
+ export class SwitchElement extends ValueChangeElement {
90
+ @Input() value?: ISwitchProps['value'];
91
+ @Input() disabled?: ISwitchProps['disabled'];
92
+ @Input() trackColor?: ISwitchProps['trackColor'];
93
+ @Input() thumbColor?: ISwitchProps['thumbColor'];
94
+ @Input() ios_backgroundColor?: ISwitchProps['ios_backgroundColor'];
95
+ @Input() onValueChange?: ISwitchProps['onValueChange'];
96
+
97
+ @Output() readonly valueChange = new EventEmitter<
98
+ NonNullable<ISwitchProps['value']>
99
+ >();
100
+
101
+ protected hasValueSubscriber(): boolean {
102
+ return this.valueChange.observed;
103
+ }
104
+
105
+ protected emitValue(value: unknown): void {
106
+ if (typeof value === 'boolean') this.valueChange.emit(value);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * `[(ngModel)]` / `formControlName` on a `<text-input>` or a `<switch>`.
112
+ *
113
+ * The wrappers provided `NG_VALUE_ACCESSOR` themselves; a tag has no class for @angular/forms to
114
+ * call into, so the accessor moves onto a directive of its own rather than being dropped — the
115
+ * shape Angular's own `DefaultValueAccessor` takes for `<input>`. Providing it unconditionally is
116
+ * safe: @angular/forms looks the accessor up only when an `ngModel` / `formControl*` directive sits
117
+ * on the SAME element, so a plain `<switch [(value)]>` never reaches it.
118
+ *
119
+ * Everything below goes through `Renderer2`, which is the adapter's own — `setProperty` lands in
120
+ * `routeProp` and `listen('valueChange')` is already unwrapped to a bare value there, so this
121
+ * directive holds no fold of its own.
122
+ */
123
+ @Directive()
124
+ abstract class SymbioteValueAccessor
125
+ implements ControlValueAccessor, OnDestroy
126
+ {
127
+ private readonly renderer = inject(Renderer2);
128
+ private readonly host = inject(ElementRef);
129
+ private unlisten?: () => void;
130
+
131
+ // The prop that spells "not editable" for this tag: RN's TextInput has no `disabled`, it has
132
+ // `editable` (inverted), while Switch takes `disabled` straight.
133
+ protected abstract writeDisabled(isDisabled: boolean): void;
134
+
135
+ protected setProp(name: string, value: unknown): void {
136
+ this.renderer.setProperty(this.host.nativeElement, name, value);
137
+ }
138
+
139
+ writeValue(value: unknown): void {
140
+ this.setProp('value', value ?? undefined);
141
+ }
142
+
143
+ registerOnChange(fn: (value: unknown) => void): void {
144
+ this.unlisten?.();
145
+ this.unlisten = this.renderer.listen(
146
+ this.host.nativeElement,
147
+ VALUE_CHANGE_EVENT,
148
+ (value: unknown) => {
149
+ // THE HALF THE DOM DOES FOR FREE, and without it a controlled input undoes every
150
+ // keystroke. `<text-input>`'s behavior re-commands the native text whenever `props.value`
151
+ // disagrees with what native last reported — that is what makes it controlled — and the
152
+ // read-back flush exists so the app's new value is on the node by the time the commit runs.
153
+ // @angular/forms does not reach the node in that window: `NgModel.ngOnChanges` defers
154
+ // `_updateValue` through `resolvedPromise.then`, so `writeValue` lands a MICROTASK after
155
+ // the flush, and the commit in between still reads the value from before the keystroke.
156
+ //
157
+ // In a browser there is nothing to do here: `input.value` already holds what the user
158
+ // typed. `node.props.value` is the same slot, and nothing else writes it — so the accessor
159
+ // mirrors it, which is the shape rather than a workaround. A later `writeValue` still wins,
160
+ // so an app that transforms or refuses the value keeps doing so, one microtask on.
161
+ //
162
+ // Without this, every character snaps the field back to its mounted text.
163
+ this.setProp('value', value);
164
+ fn(value);
165
+ },
166
+ );
167
+ }
168
+
169
+ // Native has no blur-driven "touched" signal distinct from `blur`, and RN's own onBlur is what an
170
+ // app binds — so touched is driven off the same event rather than a second channel.
171
+ registerOnTouched(fn: () => void): void {
172
+ this.setProp('onBlur', () => fn());
173
+ }
174
+
175
+ setDisabledState(isDisabled: boolean): void {
176
+ this.writeDisabled(isDisabled);
177
+ }
178
+
179
+ ngOnDestroy(): void {
180
+ this.unlisten?.();
181
+ }
182
+ }
183
+
184
+ @Directive({
185
+ selector:
186
+ 'text-input[ngModel], text-input[formControl], text-input[formControlName], text-input-multiline[ngModel], text-input-multiline[formControl], text-input-multiline[formControlName]',
187
+ standalone: true,
188
+ providers: [
189
+ {
190
+ provide: NG_VALUE_ACCESSOR,
191
+ useExisting: forwardRef(() => TextInputValueAccessor),
192
+ multi: true,
193
+ },
194
+ ],
195
+ })
196
+ export class TextInputValueAccessor extends SymbioteValueAccessor {
197
+ protected override writeDisabled(isDisabled: boolean): void {
198
+ this.setProp('editable', !isDisabled);
199
+ }
200
+ }
201
+
202
+ @Directive({
203
+ selector: 'switch[ngModel], switch[formControl], switch[formControlName]',
204
+ standalone: true,
205
+ providers: [
206
+ {
207
+ provide: NG_VALUE_ACCESSOR,
208
+ useExisting: forwardRef(() => SwitchValueAccessor),
209
+ multi: true,
210
+ },
211
+ ],
212
+ })
213
+ export class SwitchValueAccessor extends SymbioteValueAccessor {
214
+ protected override writeDisabled(isDisabled: boolean): void {
215
+ this.setProp('disabled', isDisabled);
216
+ }
217
+ }
218
+
219
+ // The HOST — RN's centering RCTView (ActivityIndicator.js:112), which is the tag an app writes.
220
+ // The four spinner props are declared here because that is where the app writes them; the engine's
221
+ // behavior redirects them onto the spinner it builds underneath (`slotProps`).
222
+ @Directive({ selector: 'activity-indicator', standalone: true })
223
+ export class ActivityIndicatorElement extends SymbioteElement {
224
+ @Input() animating?: IActivityIndicatorProps['animating'];
225
+ @Input() color?: IActivityIndicatorProps['color'];
226
+ @Input() size?: IActivityIndicatorProps['size'];
227
+ @Input() hidesWhenStopped?: IActivityIndicatorProps['hidesWhenStopped'];
228
+ }
229
+
230
+ // The native spinner. Built by the behavior's `buildStructure` and by the wrapper's render fn, never
231
+ // written in an app template — declared only so the tag alphabet stays covered, the same as
232
+ // `scroll-content`.
233
+ @Directive({ selector: 'activity-indicator-spinner', standalone: true })
234
+ export class ActivityIndicatorSpinnerElement extends ActivityIndicatorElement {}
235
+
236
+ @Directive({ selector: 'safe-area-view', standalone: true })
237
+ export class SafeAreaViewElement extends SymbioteElement {}
238
+
239
+ @Directive({ selector: 'modal, symbiote-modal', standalone: true })
240
+ export class ModalElement extends SymbioteElement {
241
+ @Input() visible?: IModalViewProps['visible'];
242
+ @Input() transparent?: IModalViewProps['transparent'];
243
+ @Input() animationType?: IModalViewProps['animationType'];
244
+ @Input() presentationStyle?: IModalViewProps['presentationStyle'];
245
+ @Input() supportedOrientations?: IModalViewProps['supportedOrientations'];
246
+ @Input() hardwareAccelerated?: IModalViewProps['hardwareAccelerated'];
247
+ @Input() statusBarTranslucent?: IModalViewProps['statusBarTranslucent'];
248
+ @Input()
249
+ navigationBarTranslucent?: IModalViewProps['navigationBarTranslucent'];
250
+ @Input() allowSwipeDismissal?: IModalViewProps['allowSwipeDismissal'];
251
+ @Input() backdropColor?: IModalViewProps['backdropColor'];
252
+ }
253
+
254
+ @Directive({ selector: 'refresh-control', standalone: true })
255
+ export class RefreshControlElement extends ReadBackElement {
256
+ @Input() refreshing?: IAngularRefreshControlProps['refreshing'];
257
+ @Input() enabled?: IAngularRefreshControlProps['enabled'];
258
+ @Input() colors?: IAngularRefreshControlProps['colors'];
259
+ @Input() tintColor?: IAngularRefreshControlProps['tintColor'];
260
+ @Input() title?: IAngularRefreshControlProps['title'];
261
+ @Input() titleColor?: IAngularRefreshControlProps['titleColor'];
262
+ @Input() size?: IAngularRefreshControlProps['size'];
263
+ @Input()
264
+ progressBackgroundColor?: IAngularRefreshControlProps['progressBackgroundColor'];
265
+ @Input()
266
+ progressViewOffset?: IAngularRefreshControlProps['progressViewOffset'];
267
+ @Input() onRefresh?: IAngularRefreshControlProps['onRefresh'];
268
+ }
269
+
270
+ @Directive({ selector: 'sticky-header', standalone: true })
271
+ export class StickyHeaderElement extends SymbioteElement {
272
+ @Input() inverted?: IStickyHeaderElementProps['inverted'];
273
+ @Input() nextHeaderLayoutY?: IStickyHeaderElementProps['nextHeaderLayoutY'];
274
+ @Input()
275
+ scrollAnimatedValue?: IStickyHeaderElementProps['scrollAnimatedValue'];
276
+ @Input() scrollViewHeight?: IStickyHeaderElementProps['scrollViewHeight'];
277
+ }
278
+
279
+ @Directive({ selector: 'input-accessory-view', standalone: true })
280
+ export class InputAccessoryViewElement extends SymbioteElement {
281
+ @Input() backgroundColor?: IInputAccessoryViewViewProps['backgroundColor'];
282
+ }
@@ -0,0 +1,141 @@
1
+ import { Directive, Input } from '@angular/core';
2
+ import type { IImageProps } from '@symbiote-native/components';
3
+ import type { IAngularImageBackgroundProps } from './components/image-background-props';
4
+ import type { IAngularScrollViewProps } from './components/scroll-view-props';
5
+ import { SymbioteElement } from './element-base';
6
+
7
+ @Directive({ selector: 'image, symbiote-image', standalone: true })
8
+ export class ImageElement extends SymbioteElement {
9
+ @Input() source?: IImageProps['source'];
10
+ @Input() src?: IImageProps['src'];
11
+ @Input() srcSet?: IImageProps['srcSet'];
12
+ @Input() alt?: IImageProps['alt'];
13
+ @Input() width?: IImageProps['width'];
14
+ @Input() height?: IImageProps['height'];
15
+ @Input() resizeMode?: IImageProps['resizeMode'];
16
+ @Input() resizeMethod?: IImageProps['resizeMethod'];
17
+ @Input() defaultSource?: IImageProps['defaultSource'];
18
+ @Input() loadingIndicatorSource?: IImageProps['loadingIndicatorSource'];
19
+ @Input() blurRadius?: IImageProps['blurRadius'];
20
+ @Input() capInsets?: IImageProps['capInsets'];
21
+ @Input() crossOrigin?: IImageProps['crossOrigin'];
22
+ @Input() referrerPolicy?: IImageProps['referrerPolicy'];
23
+ @Input() fadeDuration?: IImageProps['fadeDuration'];
24
+ @Input()
25
+ progressiveRenderingEnabled?: IImageProps['progressiveRenderingEnabled'];
26
+ @Input() tintColor?: IImageProps['tintColor'];
27
+ @Input() onLoad?: IImageProps['onLoad'];
28
+ @Input() onLoadStart?: IImageProps['onLoadStart'];
29
+ @Input() onLoadEnd?: IImageProps['onLoadEnd'];
30
+ @Input() onError?: IImageProps['onError'];
31
+ @Input() onProgress?: IImageProps['onProgress'];
32
+ @Input() onPartialLoad?: IImageProps['onPartialLoad'];
33
+ }
34
+
35
+ // The box, not the image. Every Image prop below rides the engine's `slotPropsExcept` redirect onto
36
+ // the absolutely-filled image the behavior builds, exactly as RN's own `...props` spread does
37
+ // (ImageBackground.js:81) — so this directive declares them to make the BINDING legal, and the
38
+ // engine decides which node each lands on.
39
+ @Directive({ selector: 'image-background', standalone: true })
40
+ export class ImageBackgroundElement extends SymbioteElement {
41
+ @Input() imageStyle?: IAngularImageBackgroundProps['imageStyle'];
42
+ @Input() source?: IImageProps['source'];
43
+ @Input() src?: IImageProps['src'];
44
+ @Input() srcSet?: IImageProps['srcSet'];
45
+ @Input() alt?: IImageProps['alt'];
46
+ @Input() width?: IImageProps['width'];
47
+ @Input() height?: IImageProps['height'];
48
+ @Input() resizeMode?: IImageProps['resizeMode'];
49
+ @Input() resizeMethod?: IImageProps['resizeMethod'];
50
+ @Input() defaultSource?: IImageProps['defaultSource'];
51
+ @Input() loadingIndicatorSource?: IImageProps['loadingIndicatorSource'];
52
+ @Input() blurRadius?: IImageProps['blurRadius'];
53
+ @Input() capInsets?: IImageProps['capInsets'];
54
+ @Input() crossOrigin?: IImageProps['crossOrigin'];
55
+ @Input() referrerPolicy?: IImageProps['referrerPolicy'];
56
+ @Input() fadeDuration?: IImageProps['fadeDuration'];
57
+ @Input()
58
+ progressiveRenderingEnabled?: IImageProps['progressiveRenderingEnabled'];
59
+ @Input() tintColor?: IImageProps['tintColor'];
60
+ @Input() onLoad?: IImageProps['onLoad'];
61
+ @Input() onLoadStart?: IImageProps['onLoadStart'];
62
+ @Input() onLoadEnd?: IImageProps['onLoadEnd'];
63
+ @Input() onError?: IImageProps['onError'];
64
+ @Input() onProgress?: IImageProps['onProgress'];
65
+ @Input() onPartialLoad?: IImageProps['onPartialLoad'];
66
+ }
67
+
68
+ @Directive({ selector: 'scroll-view', standalone: true })
69
+ export class ScrollViewElement extends SymbioteElement {
70
+ // No `horizontal` @Input: the axis is the TAG you write, never a prop — see
71
+ // `../components/scroll-view-props.ts`'s header. `HorizontalScrollViewElement` below is the
72
+ // other spelling, not a variant of this one.
73
+ @Input() scrollEnabled?: IAngularScrollViewProps['scrollEnabled'];
74
+ @Input() scrollEventThrottle?: IAngularScrollViewProps['scrollEventThrottle'];
75
+ @Input()
76
+ contentContainerStyle?: IAngularScrollViewProps['contentContainerStyle'];
77
+ @Input() contentInset?: IAngularScrollViewProps['contentInset'];
78
+ @Input()
79
+ contentInsetAdjustmentBehavior?: IAngularScrollViewProps['contentInsetAdjustmentBehavior'];
80
+ @Input() contentOffset?: IAngularScrollViewProps['contentOffset'];
81
+ @Input()
82
+ scrollIndicatorInsets?: IAngularScrollViewProps['scrollIndicatorInsets'];
83
+ @Input()
84
+ showsHorizontalScrollIndicator?: IAngularScrollViewProps['showsHorizontalScrollIndicator'];
85
+ @Input()
86
+ showsVerticalScrollIndicator?: IAngularScrollViewProps['showsVerticalScrollIndicator'];
87
+ @Input()
88
+ alwaysBounceHorizontal?: IAngularScrollViewProps['alwaysBounceHorizontal'];
89
+ @Input()
90
+ alwaysBounceVertical?: IAngularScrollViewProps['alwaysBounceVertical'];
91
+ @Input() bounces?: IAngularScrollViewProps['bounces'];
92
+ @Input() bouncesZoom?: IAngularScrollViewProps['bouncesZoom'];
93
+ @Input() centerContent?: IAngularScrollViewProps['centerContent'];
94
+ @Input() decelerationRate?: IAngularScrollViewProps['decelerationRate'];
95
+ @Input()
96
+ directionalLockEnabled?: IAngularScrollViewProps['directionalLockEnabled'];
97
+ @Input()
98
+ disableIntervalMomentum?: IAngularScrollViewProps['disableIntervalMomentum'];
99
+ @Input() endFillColor?: IAngularScrollViewProps['endFillColor'];
100
+ @Input() fadingEdgeLength?: IAngularScrollViewProps['fadingEdgeLength'];
101
+ @Input() indicatorStyle?: IAngularScrollViewProps['indicatorStyle'];
102
+ @Input() invertStickyHeaders?: IAngularScrollViewProps['invertStickyHeaders'];
103
+ @Input() keyboardDismissMode?: IAngularScrollViewProps['keyboardDismissMode'];
104
+ @Input()
105
+ keyboardShouldPersistTaps?: IAngularScrollViewProps['keyboardShouldPersistTaps'];
106
+ @Input()
107
+ automaticallyAdjustKeyboardInsets?: IAngularScrollViewProps['automaticallyAdjustKeyboardInsets'];
108
+ @Input()
109
+ maintainVisibleContentPosition?: IAngularScrollViewProps['maintainVisibleContentPosition'];
110
+ @Input() maximumZoomScale?: IAngularScrollViewProps['maximumZoomScale'];
111
+ @Input() minimumZoomScale?: IAngularScrollViewProps['minimumZoomScale'];
112
+ @Input() zoomScale?: IAngularScrollViewProps['zoomScale'];
113
+ @Input() nestedScrollEnabled?: IAngularScrollViewProps['nestedScrollEnabled'];
114
+ @Input() overScrollMode?: IAngularScrollViewProps['overScrollMode'];
115
+ @Input() pagingEnabled?: IAngularScrollViewProps['pagingEnabled'];
116
+ @Input() persistentScrollbar?: IAngularScrollViewProps['persistentScrollbar'];
117
+ @Input() pinchGestureEnabled?: IAngularScrollViewProps['pinchGestureEnabled'];
118
+ @Input() snapToAlignment?: IAngularScrollViewProps['snapToAlignment'];
119
+ @Input() snapToEnd?: IAngularScrollViewProps['snapToEnd'];
120
+ @Input() snapToInterval?: IAngularScrollViewProps['snapToInterval'];
121
+ @Input() snapToOffsets?: IAngularScrollViewProps['snapToOffsets'];
122
+ @Input() snapToStart?: IAngularScrollViewProps['snapToStart'];
123
+ @Input() stickyHeaderIndices?: IAngularScrollViewProps['stickyHeaderIndices'];
124
+ @Input() onScroll?: IAngularScrollViewProps['onScroll'];
125
+ @Input() onScrollBeginDrag?: IAngularScrollViewProps['onScrollBeginDrag'];
126
+ @Input() onScrollEndDrag?: IAngularScrollViewProps['onScrollEndDrag'];
127
+ @Input()
128
+ onMomentumScrollBegin?: IAngularScrollViewProps['onMomentumScrollBegin'];
129
+ @Input() onMomentumScrollEnd?: IAngularScrollViewProps['onMomentumScrollEnd'];
130
+ @Input() onScrollToTop?: IAngularScrollViewProps['onScrollToTop'];
131
+ @Input() onContentSizeChange?: IAngularScrollViewProps['onContentSizeChange'];
132
+ }
133
+
134
+ @Directive({ selector: 'horizontal-scroll-view', standalone: true })
135
+ export class HorizontalScrollViewElement extends ScrollViewElement {}
136
+
137
+ @Directive({ selector: 'scroll-content', standalone: true })
138
+ export class ScrollContentElement extends SymbioteElement {}
139
+
140
+ @Directive({ selector: 'horizontal-scroll-content', standalone: true })
141
+ export class HorizontalScrollContentElement extends SymbioteElement {}
@@ -0,0 +1,145 @@
1
+ import { Directive, Input } from '@angular/core';
2
+ import type { INativeFeedbackBackground } from '@symbiote-native/components';
3
+ import type { ITextElementProps } from './element-props';
4
+ import type { ICheckboxProps } from './components/checkbox-props';
5
+ import type { IAngularPressableProps } from './components/pressable-props';
6
+ import type {
7
+ IAngularTouchableHighlightProps,
8
+ IAngularTouchableOpacityProps,
9
+ } from './components/touchable-props';
10
+ import { SymbioteElement } from './element-base';
11
+
12
+ // BOTH SPELLINGS ON THE SEVEN DASHLESS TAGS, and it is a correctness fix rather than a convenience.
13
+ //
14
+ // The renderer has always mapped `symbiote-view` onto `view` (`PRIMITIVE_SELECTOR_ALIAS`), because
15
+ // `CUSTOM_ELEMENTS_SCHEMA` admits an unknown element only when the name carries a hyphen — so the
16
+ // hyphenated form is the spelling an app WITHOUT these directives has to use. It is the same tag and
17
+ // commits the same node.
18
+ //
19
+ // It was not the same tag HERE. A selector of `view` alone meant an app that imports
20
+ // `SYMBIOTE_ELEMENTS` and writes `<symbiote-view>` matched nothing: no type check on its props, no
21
+ // declared inputs, none of `SymbioteElement`'s forwarding or callback wrapping — silently, with the
22
+ // tree still looking right. Measured, that shape also ran ~8.6 us per element FASTER, which is what
23
+ // made it look like an optimization instead of a hole (`angular-directive-cost.itest.ts`).
24
+ //
25
+ // Only the seven dashless tags need it: `hyphenatedIntrinsicAliases` skips any tag that already
26
+ // carries a dash, so `symbiote-scroll-view` resolves nowhere on either side and the two halves agree
27
+ // already.
28
+ @Directive({ selector: 'view, symbiote-view', standalone: true })
29
+ export class ViewElement extends SymbioteElement {}
30
+
31
+ @Directive({ selector: 'pressable, symbiote-pressable', standalone: true })
32
+ export class PressableElement extends SymbioteElement {
33
+ @Input() disabled?: IAngularPressableProps['disabled'];
34
+ @Input() cancelable?: IAngularPressableProps['cancelable'];
35
+ @Input()
36
+ blockNativeResponder?: IAngularPressableProps['blockNativeResponder'];
37
+ @Input() delayLongPress?: IAngularPressableProps['delayLongPress'];
38
+ @Input() delayHoverIn?: IAngularPressableProps['delayHoverIn'];
39
+ @Input() delayHoverOut?: IAngularPressableProps['delayHoverOut'];
40
+ @Input() onHoverIn?: IAngularPressableProps['onHoverIn'];
41
+ @Input() onHoverOut?: IAngularPressableProps['onHoverOut'];
42
+ @Input()
43
+ pressRetentionOffset?: IAngularPressableProps['pressRetentionOffset'];
44
+ @Input() unstable_pressDelay?: IAngularPressableProps['unstable_pressDelay'];
45
+ @Input() android_ripple?: IAngularPressableProps['android_ripple'];
46
+ // ON THE BASE, so both touchables inherit it — the prop is Pressable's AND
47
+ // TouchableHighlight's upstream, and they extend this rather than repeat its surface.
48
+ @Input() testOnly_pressed?: IAngularPressableProps['testOnly_pressed'];
49
+ @Input()
50
+ android_disableSound?: IAngularPressableProps['android_disableSound'];
51
+ @Input() hasTVPreferredFocus?: IAngularPressableProps['hasTVPreferredFocus'];
52
+ @Input() nextFocusDown?: IAngularPressableProps['nextFocusDown'];
53
+ @Input() nextFocusForward?: IAngularPressableProps['nextFocusForward'];
54
+ @Input() nextFocusLeft?: IAngularPressableProps['nextFocusLeft'];
55
+ @Input() nextFocusRight?: IAngularPressableProps['nextFocusRight'];
56
+ @Input() nextFocusUp?: IAngularPressableProps['nextFocusUp'];
57
+ }
58
+
59
+ // RN's TouchableOpacity is a Pressable that also fades, and both halves are on the engine node —
60
+ // so it takes the same inputs and adds only the fade's own knob.
61
+ @Directive({ selector: 'touchable-opacity', standalone: true })
62
+ export class TouchableOpacityElement extends PressableElement {
63
+ @Input() activeOpacity?: number;
64
+ @Input() delayPressIn?: number;
65
+ @Input() delayPressOut?: number;
66
+ @Input() minPressDuration?: number;
67
+ }
68
+
69
+ // RN's TouchableHighlight is a Pressable that swaps its own background while pressed
70
+ // (TouchableHighlight.js), and the underlay machine runs on the engine node — so the tag takes the
71
+ // press surface plus the two knobs that describe the underlay. `onShowUnderlay`/`onHideUnderlay`
72
+ // need no @Input: they are events, bound as `(showUnderlay)` through the renderer's own listen.
73
+ @Directive({ selector: 'touchable-highlight', standalone: true })
74
+ export class TouchableHighlightElement extends PressableElement {
75
+ @Input() activeOpacity?: number;
76
+ @Input() underlayColor?: string;
77
+ @Input() delayPressIn?: number;
78
+ @Input() delayPressOut?: number;
79
+ @Input() minPressDuration?: number;
80
+ // TouchableHighlight.js:205 — forwarded to Pressability as `android_disableSound`.
81
+ @Input() touchSoundDisabled?: boolean;
82
+ }
83
+
84
+ // RN's TouchableNativeFeedback is a Pressable that CLONES onto its single child instead of
85
+ // rendering anything (TouchableNativeFeedback.js:339) — so the tag takes the press surface plus the
86
+ // two props that pick the Android ripple drawable. The tag itself commits no native view; the
87
+ // behavior configures the child, which is why `elements.test.ts` reads it as an anchor.
88
+ @Directive({ selector: 'touchable-native-feedback', standalone: true })
89
+ export class TouchableNativeFeedbackElement extends PressableElement {
90
+ @Input() background?: INativeFeedbackBackground;
91
+ @Input() useForeground?: boolean;
92
+ // TouchableNativeFeedback.js:228 — forwarded to Pressability as `android_disableSound`.
93
+ @Input() touchSoundDisabled?: boolean;
94
+ }
95
+
96
+ // RN's TouchableWithoutFeedback clones onto its single child the same way
97
+ // (TouchableWithoutFeedback.js:286) and installs no drawable, so it takes the press surface plus the
98
+ // three timing knobs it forwards to Pressability (:186-190) and nothing else. Like the tag above it
99
+ // commits no native view; `elements.test.ts` reads it as an anchor.
100
+ @Directive({ selector: 'touchable-without-feedback', standalone: true })
101
+ export class TouchableWithoutFeedbackElement extends PressableElement {
102
+ @Input() delayPressIn?: number;
103
+ @Input() delayPressOut?: number;
104
+ @Input() minPressDuration?: number;
105
+ // TouchableWithoutFeedback.js:199 — forwarded to Pressability as `android_disableSound`.
106
+ @Input() touchSoundDisabled?: boolean;
107
+ }
108
+
109
+ // RN's Button IS a TouchableOpacity (Button.js:384), and the behavior builds the view and the
110
+ // label under it — so the tag takes the touchable's surface plus the four props Button owns. There
111
+ // is no `style`: RN's Button has no such prop, and the label/background come from `color`.
112
+ @Directive({ selector: 'button, symbiote-button', standalone: true })
113
+ export class ButtonElement extends TouchableOpacityElement {
114
+ @Input() title?: string;
115
+ @Input() color?: string;
116
+ @Input() touchSoundDisabled?: boolean;
117
+ }
118
+
119
+ // expo-checkbox: View-like box plus the toggle on the engine node, поэтому только свои пять полей
120
+ // Нет `(valueChange)`: тоггл зовёт `onValueChange` как проп, он не engine-событие с read-back
121
+ @Directive({ selector: 'checkbox, symbiote-checkbox', standalone: true })
122
+ export class CheckboxElement extends SymbioteElement {
123
+ @Input() value?: ICheckboxProps['value'];
124
+ @Input() disabled?: ICheckboxProps['disabled'];
125
+ @Input() color?: ICheckboxProps['color'];
126
+ @Input() onValueChange?: ICheckboxProps['onValueChange'];
127
+ }
128
+
129
+ @Directive({ selector: 'text, symbiote-text', standalone: true })
130
+ export class TextElement extends SymbioteElement {
131
+ // Narrows the inherited input to a TEXT style so `fontSize`/`fontWeight` type-check here. The
132
+ // initializer is what TS2612 asks for to accept a redeclaration as deliberate; `declare` would
133
+ // be the other answer and cannot carry a decorator.
134
+ @Input() override style?: ITextElementProps['style'] = undefined;
135
+ @Input() override styleProp?: ITextElementProps['styleProp'] = undefined;
136
+ @Input() numberOfLines?: ITextElementProps['numberOfLines'];
137
+ @Input() ellipsizeMode?: ITextElementProps['ellipsizeMode'];
138
+ @Input() selectable?: ITextElementProps['selectable'];
139
+ @Input() adjustsFontSizeToFit?: ITextElementProps['adjustsFontSizeToFit'];
140
+ @Input() minimumFontScale?: ITextElementProps['minimumFontScale'];
141
+ @Input() allowFontScaling?: ITextElementProps['allowFontScaling'];
142
+ @Input() maxFontSizeMultiplier?: ITextElementProps['maxFontSizeMultiplier'];
143
+ @Input() selectionColor?: ITextElementProps['selectionColor'];
144
+ @Input() disabled?: ITextElementProps['disabled'];
145
+ }