@symbiote-native/angular 0.6.0 → 0.6.2

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 (193) hide show
  1. package/README.md +1 -1
  2. package/babel-register-composed.cjs +11 -3
  3. package/build/angular/anchor-host-registry.d.ts +2 -0
  4. package/build/angular/anchor-host-registry.js +84 -0
  5. package/build/angular/anchor-host-registry.js.map +1 -0
  6. package/build/angular/components/input-accessory-view/index.d.ts +2 -1
  7. package/build/angular/components/input-accessory-view/index.js +28 -39
  8. package/build/angular/components/input-accessory-view/index.js.map +1 -1
  9. package/build/angular/components/scroll-view/projection.js +70 -48
  10. package/build/angular/components/scroll-view/projection.js.map +1 -1
  11. package/build/angular/components/scroll-view/shared.js +28 -25
  12. package/build/angular/components/scroll-view/shared.js.map +1 -1
  13. package/build/angular/components/scroll-view/sticky-header.d.ts +6 -7
  14. package/build/angular/components/scroll-view/sticky-header.js +82 -65
  15. package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
  16. package/build/angular/components/touchable/index.d.ts +2 -5
  17. package/build/angular/components/touchable/index.js +36 -56
  18. package/build/angular/components/touchable/index.js.map +1 -1
  19. package/build/angular/components/virtualized-list/index.d.ts +5 -20
  20. package/build/angular/components/virtualized-list/index.js +145 -275
  21. package/build/angular/components/virtualized-list/index.js.map +1 -1
  22. package/build/angular/components/virtualized-section-list/index.js +2 -4
  23. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  24. package/build/angular/index.d.ts +2 -1
  25. package/build/angular/index.js +6 -1
  26. package/build/angular/index.js.map +1 -1
  27. package/build/angular/renderer/index.d.ts +0 -1
  28. package/build/angular/renderer/index.js +5 -60
  29. package/build/angular/renderer/index.js.map +1 -1
  30. package/package.json +8 -4
  31. package/src/anchor-host-registry.ts +88 -0
  32. package/src/components/input-accessory-view/index.ts +30 -39
  33. package/src/components/scroll-view/projection.ts +76 -46
  34. package/src/components/scroll-view/shared.ts +27 -19
  35. package/src/components/scroll-view/sticky-header.ts +89 -64
  36. package/src/components/touchable/index.ts +52 -66
  37. package/src/components/virtualized-list/index.ts +157 -368
  38. package/src/components/virtualized-section-list/index.ts +6 -3
  39. package/src/index.ts +6 -1
  40. package/src/renderer/index.ts +5 -63
  41. package/build/bootstrap.d.ts +0 -7
  42. package/build/bootstrap.js +0 -14
  43. package/build/components/activity-indicator/index.android.d.ts +0 -9
  44. package/build/components/activity-indicator/index.android.js +0 -64
  45. package/build/components/activity-indicator/index.d.ts +0 -1
  46. package/build/components/activity-indicator/index.ios.d.ts +0 -5
  47. package/build/components/activity-indicator/index.ios.js +0 -64
  48. package/build/components/activity-indicator/index.js +0 -3
  49. package/build/components/activity-indicator/shared.d.ts +0 -64
  50. package/build/components/activity-indicator/shared.js +0 -424
  51. package/build/components/button.d.ts +0 -60
  52. package/build/components/button.js +0 -456
  53. package/build/components/flat-list/index.d.ts +0 -119
  54. package/build/components/flat-list/index.js +0 -691
  55. package/build/components/image/index.android.d.ts +0 -7
  56. package/build/components/image/index.android.js +0 -88
  57. package/build/components/image/index.d.ts +0 -1
  58. package/build/components/image/index.ios.d.ts +0 -7
  59. package/build/components/image/index.ios.js +0 -88
  60. package/build/components/image/index.js +0 -2
  61. package/build/components/image/shared.d.ts +0 -101
  62. package/build/components/image/shared.js +0 -405
  63. package/build/components/image-background.d.ts +0 -78
  64. package/build/components/image-background.js +0 -583
  65. package/build/components/input-accessory-view/index.d.ts +0 -56
  66. package/build/components/input-accessory-view/index.js +0 -403
  67. package/build/components/keyboard-avoiding-view/index.d.ts +0 -79
  68. package/build/components/keyboard-avoiding-view/index.js +0 -504
  69. package/build/components/modal/index.d.ts +0 -89
  70. package/build/components/modal/index.js +0 -529
  71. package/build/components/pressable/index.d.ts +0 -120
  72. package/build/components/pressable/index.js +0 -639
  73. package/build/components/refresh-control/index.d.ts +0 -83
  74. package/build/components/refresh-control/index.js +0 -509
  75. package/build/components/safe-area-view/index.d.ts +0 -54
  76. package/build/components/safe-area-view/index.js +0 -388
  77. package/build/components/scroll-view/index.android.d.ts +0 -16
  78. package/build/components/scroll-view/index.android.js +0 -228
  79. package/build/components/scroll-view/index.d.ts +0 -3
  80. package/build/components/scroll-view/index.ios.d.ts +0 -6
  81. package/build/components/scroll-view/index.ios.js +0 -113
  82. package/build/components/scroll-view/index.js +0 -5
  83. package/build/components/scroll-view/projection.d.ts +0 -32
  84. package/build/components/scroll-view/projection.js +0 -311
  85. package/build/components/scroll-view/shared.d.ts +0 -225
  86. package/build/components/scroll-view/shared.js +0 -757
  87. package/build/components/scroll-view/sticky-header.d.ts +0 -38
  88. package/build/components/scroll-view/sticky-header.js +0 -257
  89. package/build/components/section-list/index.d.ts +0 -113
  90. package/build/components/section-list/index.js +0 -768
  91. package/build/components/switch/index.android.d.ts +0 -17
  92. package/build/components/switch/index.android.js +0 -107
  93. package/build/components/switch/index.d.ts +0 -1
  94. package/build/components/switch/index.ios.d.ts +0 -16
  95. package/build/components/switch/index.ios.js +0 -106
  96. package/build/components/switch/index.js +0 -3
  97. package/build/components/switch/shared.d.ts +0 -37
  98. package/build/components/switch/shared.js +0 -176
  99. package/build/components/text-input.d.ts +0 -150
  100. package/build/components/text-input.js +0 -821
  101. package/build/components/touchable/index.d.ts +0 -241
  102. package/build/components/touchable/index.js +0 -1672
  103. package/build/components/touchable-native-feedback/index.d.ts +0 -80
  104. package/build/components/touchable-native-feedback/index.js +0 -545
  105. package/build/components/virtualized-list/directives.d.ts +0 -41
  106. package/build/components/virtualized-list/directives.js +0 -249
  107. package/build/components/virtualized-list/index.d.ts +0 -265
  108. package/build/components/virtualized-list/index.js +0 -1343
  109. package/build/components/virtualized-section-list/directives.d.ts +0 -28
  110. package/build/components/virtualized-section-list/directives.js +0 -148
  111. package/build/components/virtualized-section-list/index.d.ts +0 -175
  112. package/build/components/virtualized-section-list/index.js +0 -854
  113. package/build/components.d.ts +0 -39
  114. package/build/components.js +0 -37
  115. package/build/create-portal/index.d.ts +0 -17
  116. package/build/create-portal/index.js +0 -128
  117. package/build/create-tunnel/index.d.ts +0 -29
  118. package/build/create-tunnel/index.js +0 -181
  119. package/build/descriptor-to-angular/index.d.ts +0 -19
  120. package/build/descriptor-to-angular/index.js +0 -186
  121. package/build/host-instance/index.d.ts +0 -2
  122. package/build/host-instance/index.js +0 -36
  123. package/build/index.d.ts +0 -21
  124. package/build/index.js +0 -40
  125. package/build/modules/animated/animated-leaf-binder/index.d.ts +0 -14
  126. package/build/modules/animated/animated-leaf-binder/index.js +0 -90
  127. package/build/modules/animated/animated-leaf-binder.d.ts +0 -14
  128. package/build/modules/animated/animated-leaf-binder.js +0 -90
  129. package/build/modules/animated/create-animated-component.d.ts +0 -48
  130. package/build/modules/animated/create-animated-component.js +0 -425
  131. package/build/modules/animated/index.d.ts +0 -51
  132. package/build/modules/animated/index.js +0 -58
  133. package/build/modules/app-registry/index.d.ts +0 -7
  134. package/build/modules/app-registry/index.js +0 -22
  135. package/build/modules/status-bar/index.d.ts +0 -17
  136. package/build/modules/status-bar/index.js +0 -121
  137. package/build/primitives/index.d.ts +0 -32
  138. package/build/primitives/index.js +0 -386
  139. package/build/primitives/shared.d.ts +0 -83
  140. package/build/primitives/shared.js +0 -230
  141. package/build/render/index.d.ts +0 -11
  142. package/build/render/index.js +0 -170
  143. package/build/renderer/index.d.ts +0 -38
  144. package/build/renderer/index.js +0 -355
  145. package/build/services/color-scheme.service.d.ts +0 -13
  146. package/build/services/color-scheme.service.js +0 -72
  147. package/build/services/index.d.ts +0 -2
  148. package/build/services/index.js +0 -2
  149. package/build/services/window-dimensions.service.d.ts +0 -13
  150. package/build/services/window-dimensions.service.js +0 -83
  151. package/src/__tests__/responder-change-detection.test.ts +0 -102
  152. package/src/__tests__/responder-nested-cd.test.ts +0 -113
  153. package/src/angular-gaps.test.ts +0 -142
  154. package/src/angular-imports.test.ts +0 -100
  155. package/src/components/activity-indicator/activity-indicator-class-style.test.ts +0 -44
  156. package/src/components/activity-indicator/activity-indicator.test.ts +0 -131
  157. package/src/components/flat-list/column-wrapper-style-class.test.ts +0 -116
  158. package/src/components/flat-list/flat-list-array-style.test.ts +0 -131
  159. package/src/components/flat-list/flat-list-class-style.test.ts +0 -74
  160. package/src/components/flat-list/flat-list-scroll-containment.test.ts +0 -107
  161. package/src/components/flat-list/flat-list.test.ts +0 -99
  162. package/src/components/image/image-class-style.test.ts +0 -46
  163. package/src/components/image-background-class-style.test.ts +0 -48
  164. package/src/components/image-background-style-class.test.ts +0 -79
  165. package/src/components/input-accessory-view/input-accessory-view.test.ts +0 -43
  166. package/src/components/keyboard-avoiding-view/keyboard-avoiding-view.test.ts +0 -54
  167. package/src/components/modal/modal.test.ts +0 -43
  168. package/src/components/pressable/pressable.test.ts +0 -85
  169. package/src/components/refresh-control/refresh-control.test.ts +0 -41
  170. package/src/components/safe-area-view/safe-area-view.test.ts +0 -43
  171. package/src/components/scroll-view/android-scroll-view-axis-projection.test.ts +0 -123
  172. package/src/components/scroll-view/content-container-style-class.test.ts +0 -75
  173. package/src/components/scroll-view/scroll-view-class-style.test.ts +0 -134
  174. package/src/components/scroll-view/scroll-view-projection.test.ts +0 -194
  175. package/src/components/switch/android-switch-class.test.ts +0 -42
  176. package/src/components/switch/switch.test.ts +0 -92
  177. package/src/components/text-input-class-style.test.ts +0 -54
  178. package/src/components/touchable/touchable.test.ts +0 -102
  179. package/src/components/touchable-native-feedback/touchable-native-feedback.test.ts +0 -49
  180. package/src/components/virtualized-list/virtualized-list-class-style.test.ts +0 -76
  181. package/src/components/virtualized-section-list/virtualized-section-list-class-style.test.ts +0 -60
  182. package/src/create-portal/create-portal.test.ts +0 -90
  183. package/src/create-tunnel/create-tunnel.test.ts +0 -120
  184. package/src/descriptor-to-angular/descriptor-outlet.test.ts +0 -94
  185. package/src/host-instance/host-instance.test.ts +0 -49
  186. package/src/modules/animated/animated-leaf-binder/animated-leaf-binder.test.ts +0 -116
  187. package/src/modules/animated/animated-leaf-binder.test.ts +0 -116
  188. package/src/modules/animated/animated-scroll-view.test.ts +0 -102
  189. package/src/modules/app-registry/app-registry.test.ts +0 -106
  190. package/src/modules/status-bar/status-bar.test.ts +0 -50
  191. package/src/render/render.test.ts +0 -147
  192. package/src/renderer/renderer.test.ts +0 -202
  193. package/src/services/services.test.ts +0 -163
@@ -1,38 +0,0 @@
1
- import { EventEmitter, type OnChanges, type OnDestroy, type OnInit } from '@angular/core';
2
- import { AnimatedValue, type ISymbioteEvent } from '@symbiote-native/engine';
3
- import { type IStickyHeaderProps } from '@symbiote-native/components';
4
- export type IStickyHeaderComponentType = unknown;
5
- export declare class ScrollViewStickyHeader implements Omit<IStickyHeaderProps, 'onLayout'>, OnInit, OnChanges, OnDestroy {
6
- scrollAnimatedValue: AnimatedValue;
7
- nextHeaderLayoutY: number | undefined;
8
- inverted: boolean | undefined;
9
- scrollViewHeight: number | undefined;
10
- readonly layout: EventEmitter<ISymbioteEvent>;
11
- private measured;
12
- private layoutY;
13
- private layoutHeight;
14
- private animatedTranslateY;
15
- private translateY;
16
- private haveReceivedInitialZeroTranslateY;
17
- private debounceTimer;
18
- private listenerId;
19
- private readonly changeDetector;
20
- private readonly elementRef;
21
- ngOnInit(): void;
22
- ngOnChanges(): void;
23
- ngOnDestroy(): void;
24
- get headerStyle(): unknown;
25
- private readonly onHostLayout;
26
- readonly headerAnimatedProps: Record<string, unknown>;
27
- get passthrough(): {
28
- style: {
29
- transform: Array<{
30
- translateY: number;
31
- }>;
32
- };
33
- } | null;
34
- private handleLayout;
35
- private readonly animatedValueListener;
36
- private rebuildInterpolation;
37
- private teardownInterpolation;
38
- }
@@ -1,257 +0,0 @@
1
- // Sticky headers: the Angular twin of adapters/{react,vue}/src/components/scroll-view/
2
- // sticky-header.{tsx,ts}, the JS layer RN implements in ScrollView.js / ScrollViewStickyHeader.js.
3
- //
4
- // Source-based: RN does stickiness PURELY IN JS. A single `_scrollAnimatedValue` an Animated.event
5
- // drives from `onScroll` feeds each flagged header's translateY through an interpolation that pins
6
- // it to the top (or bottom, inverted) until the next header collides with it. The native Fabric
7
- // scroll view does NOT honor `stickyHeaderIndices` on its own. The load-bearing top/inverted
8
- // interpolation math (computeStickyInterpolation) lives framework-agnostic in @symbiote-native/components
9
- // this file holds the Angular component shell, the layout state, and the interpolation
10
- // build, sharing the math verbatim with React/Vue. Angular supplies only the lifecycle (inputs +
11
- // manual change detection instead of useState/useEffect or refs/watch).
12
- //
13
- // This is the public sticky-header WRAPPER for explicit composition. ScrollView also auto-wraps
14
- // projected direct children named by stickyHeaderIndices through its projection bridge (see
15
- // projection.ts), because Angular templates cannot map <ng-content> children directly; that auto
16
- // path intentionally uses this built-in wrapper rather than dynamically instantiating arbitrary
17
- // custom component classes.
18
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
19
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
20
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
21
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
22
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
23
- var _, done = false;
24
- for (var i = decorators.length - 1; i >= 0; i--) {
25
- var context = {};
26
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
27
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
28
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
29
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
30
- if (kind === "accessor") {
31
- if (result === void 0) continue;
32
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
33
- if (_ = accept(result.get)) descriptor.get = _;
34
- if (_ = accept(result.set)) descriptor.set = _;
35
- if (_ = accept(result.init)) initializers.unshift(_);
36
- }
37
- else if (_ = accept(result)) {
38
- if (kind === "field") initializers.unshift(_);
39
- else descriptor[key] = _;
40
- }
41
- }
42
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
43
- done = true;
44
- };
45
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
46
- var useValue = arguments.length > 2;
47
- for (var i = 0; i < initializers.length; i++) {
48
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
49
- }
50
- return useValue ? value : void 0;
51
- };
52
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, inject, } from '@angular/core';
53
- import { AnimatedValue, Platform, dlog, } from '@symbiote-native/engine';
54
- import { computeStickyInterpolation, readLayoutNumber, stickyDebounceMs, STICKY_HEADER_Z_INDEX, } from '@symbiote-native/components';
55
- import { AnimatedView } from '../../modules/animated';
56
- import { anchorHostStyle } from '../../primitives';
57
- // One sticky header. Measures its own y/height via onLayout, interpolates the shared scroll offset
58
- // into a translateY that keeps it pinned to the top (or bottom, inverted) until the next header
59
- // collides with it, and drives that translate through the native driver when available so the pin
60
- // tracks scroll on the UI thread (no JS jitter). Ported from ScrollViewStickyHeader.js, including
61
- // the Fabric ShadowTree debounce path. The inputs (scrollAnimatedValue/nextHeaderLayoutY/…) never
62
- // reach the host node: they configure the interpolation; only the resolved transform reaches
63
- // AnimatedView (a scrollAnimatedValue on a host node would crash Android's folly::dynamic).
64
- let ScrollViewStickyHeader = (() => {
65
- let _classDecorators = [Component({
66
- selector: 'ScrollViewStickyHeader, symbiote-sticky-header',
67
- standalone: true,
68
- imports: [AnimatedView],
69
- changeDetection: ChangeDetectionStrategy.OnPush,
70
- template: `
71
- <AnimatedView
72
- [style]="headerStyle"
73
- [animatedProps]="headerAnimatedProps"
74
- [passthroughAnimatedPropExplicitValues]="passthrough"
75
- >
76
- <ng-content></ng-content>
77
- </AnimatedView>
78
- `,
79
- })];
80
- let _classDescriptor;
81
- let _classExtraInitializers = [];
82
- let _classThis;
83
- let _scrollAnimatedValue_decorators;
84
- let _scrollAnimatedValue_initializers = [];
85
- let _scrollAnimatedValue_extraInitializers = [];
86
- let _nextHeaderLayoutY_decorators;
87
- let _nextHeaderLayoutY_initializers = [];
88
- let _nextHeaderLayoutY_extraInitializers = [];
89
- let _inverted_decorators;
90
- let _inverted_initializers = [];
91
- let _inverted_extraInitializers = [];
92
- let _scrollViewHeight_decorators;
93
- let _scrollViewHeight_initializers = [];
94
- let _scrollViewHeight_extraInitializers = [];
95
- let _layout_decorators;
96
- let _layout_initializers = [];
97
- let _layout_extraInitializers = [];
98
- var ScrollViewStickyHeader = class {
99
- static { _classThis = this; }
100
- static {
101
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
102
- _scrollAnimatedValue_decorators = [Input()];
103
- _nextHeaderLayoutY_decorators = [Input()];
104
- _inverted_decorators = [Input()];
105
- _scrollViewHeight_decorators = [Input()];
106
- _layout_decorators = [Output()];
107
- __esDecorate(null, null, _scrollAnimatedValue_decorators, { kind: "field", name: "scrollAnimatedValue", static: false, private: false, access: { has: obj => "scrollAnimatedValue" in obj, get: obj => obj.scrollAnimatedValue, set: (obj, value) => { obj.scrollAnimatedValue = value; } }, metadata: _metadata }, _scrollAnimatedValue_initializers, _scrollAnimatedValue_extraInitializers);
108
- __esDecorate(null, null, _nextHeaderLayoutY_decorators, { kind: "field", name: "nextHeaderLayoutY", static: false, private: false, access: { has: obj => "nextHeaderLayoutY" in obj, get: obj => obj.nextHeaderLayoutY, set: (obj, value) => { obj.nextHeaderLayoutY = value; } }, metadata: _metadata }, _nextHeaderLayoutY_initializers, _nextHeaderLayoutY_extraInitializers);
109
- __esDecorate(null, null, _inverted_decorators, { kind: "field", name: "inverted", static: false, private: false, access: { has: obj => "inverted" in obj, get: obj => obj.inverted, set: (obj, value) => { obj.inverted = value; } }, metadata: _metadata }, _inverted_initializers, _inverted_extraInitializers);
110
- __esDecorate(null, null, _scrollViewHeight_decorators, { kind: "field", name: "scrollViewHeight", static: false, private: false, access: { has: obj => "scrollViewHeight" in obj, get: obj => obj.scrollViewHeight, set: (obj, value) => { obj.scrollViewHeight = value; } }, metadata: _metadata }, _scrollViewHeight_initializers, _scrollViewHeight_extraInitializers);
111
- __esDecorate(null, null, _layout_decorators, { kind: "field", name: "layout", static: false, private: false, access: { has: obj => "layout" in obj, get: obj => obj.layout, set: (obj, value) => { obj.layout = value; } }, metadata: _metadata }, _layout_initializers, _layout_extraInitializers);
112
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
113
- ScrollViewStickyHeader = _classThis = _classDescriptor.value;
114
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
115
- __runInitializers(_classThis, _classExtraInitializers);
116
- }
117
- // A fresh fallback AnimatedValue keeps the component working if the parent ever fails to supply
118
- // one (the wrap invariant); held by IDENTITY in a plain field (Angular does not proxy fields).
119
- scrollAnimatedValue = __runInitializers(this, _scrollAnimatedValue_initializers, new AnimatedValue(0));
120
- nextHeaderLayoutY = (__runInitializers(this, _scrollAnimatedValue_extraInitializers), __runInitializers(this, _nextHeaderLayoutY_initializers, undefined));
121
- inverted = (__runInitializers(this, _nextHeaderLayoutY_extraInitializers), __runInitializers(this, _inverted_initializers, undefined));
122
- scrollViewHeight = (__runInitializers(this, _inverted_extraInitializers), __runInitializers(this, _scrollViewHeight_initializers, undefined));
123
- // The parent's layout recorder (RN _onStickyHeaderLayout): records this header's own y so the
124
- // previous header learns its collision point. Called after the header measures.
125
- layout = (__runInitializers(this, _scrollViewHeight_extraInitializers), __runInitializers(this, _layout_initializers, new EventEmitter()));
126
- measured = (__runInitializers(this, _layout_extraInitializers), false);
127
- layoutY = 0;
128
- layoutHeight = 0;
129
- // The animated node driving the transform (RN's animatedTranslateY). When the scroll value is
130
- // native (attachStickyScroll), this interpolation runs on the UI thread: the smooth pin.
131
- animatedTranslateY = new AnimatedValue(0).interpolate({
132
- inputRange: [-1, 0],
133
- outputRange: [0, 0],
134
- });
135
- // The debounced EXPLICIT translateY pushed to the committed transform via the passthrough, so the
136
- // Fabric ShadowTree (hit-testing) knows the pinned position while the native driver animates.
137
- translateY = null;
138
- haveReceivedInitialZeroTranslateY = true;
139
- debounceTimer;
140
- listenerId;
141
- changeDetector = inject(ChangeDetectorRef);
142
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
143
- // onto (see anchorHostStyle's doc comment in primitives/shared.ts) — NOT the inner AnimatedView
144
- // one level down.
145
- elementRef = inject(ElementRef);
146
- ngOnInit() {
147
- this.animatedTranslateY = this.scrollAnimatedValue.interpolate({
148
- inputRange: [-1, 0],
149
- outputRange: [0, 0],
150
- });
151
- this.rebuildInterpolation();
152
- }
153
- // Rebuild on any layout/collision input change (RN's effect deps: measured, layoutY, layoutHeight,
154
- // scrollViewHeight, nextHeaderLayoutY, inverted). scrollAnimatedValue is stable for one ScrollView.
155
- ngOnChanges() {
156
- this.rebuildInterpolation();
157
- }
158
- ngOnDestroy() {
159
- this.teardownInterpolation();
160
- }
161
- get headerStyle() {
162
- // collapsable:false keeps the wrapper a real Yoga node; zIndex paints the pinned header OVER the
163
- // rows scrolling under it. The interpolation node rides inside the transform; AnimatedView's
164
- // reduceProps rasterizes it into a numeric translateY for the committed tree. This component is
165
- // its own ANCHOR_HOST_COMPONENTS entry, so a `class="..."` at its use site resolves onto
166
- // `elementRef`, not the inner AnimatedView — merge it back in (anchorHostStyle's doc comment),
167
- // anchor style first so the fixed transform/zIndex below still wins on conflict.
168
- return [
169
- anchorHostStyle(this.elementRef),
170
- { transform: [{ translateY: this.animatedTranslateY }], zIndex: STICKY_HEADER_Z_INDEX },
171
- ];
172
- }
173
- // Stable reference (bound once) so AnimatedView's directive does not re-wire the layout listener
174
- // every change-detection pass.
175
- onHostLayout = (event) => this.handleLayout(event);
176
- // Also a stable reference, not a getter: jsonEqual (commit.ts) can't structurally compare the
177
- // embedded onLayout function, so a fresh object here would read as "props changed" on every
178
- // change-detection pass and force a real Fabric re-clone that cascades up every ancestor to the
179
- // root (see AnimatedComponentBase.reconcile()'s identical warning) — every unrelated press
180
- // anywhere in the app, not just this header's own layout events. Not `private`: the template
181
- // binds it directly (`strictTemplates` requires template-bound members stay accessible).
182
- headerAnimatedProps = {
183
- onLayout: this.onHostLayout,
184
- collapsable: false,
185
- };
186
- // The EXPLICIT debounced translateY overrides the committed transform for hit-testing while
187
- // animatedTranslateY does the smooth (native-driven) pin (RN ScrollViewStickyHeader.js).
188
- get passthrough() {
189
- return this.translateY !== null
190
- ? { style: { transform: [{ translateY: this.translateY }] } }
191
- : null;
192
- }
193
- // Record own y/height, mark measured, rebuild the interpolation, then fire the parent's recorder
194
- // (RN ScrollViewStickyHeader.js._onLayout order). The wrapped child keeps its own onLayout binding
195
- // (it is projected with its bindings intact), so unlike React/Vue we do not forward to it here.
196
- handleLayout(event) {
197
- const y = readLayoutNumber(event, 'y');
198
- const height = readLayoutNumber(event, 'height');
199
- if (y !== undefined)
200
- this.layoutY = y;
201
- if (height !== undefined)
202
- this.layoutHeight = height;
203
- this.measured = true;
204
- this.rebuildInterpolation();
205
- this.layout.emit(event);
206
- this.changeDetector.markForCheck();
207
- }
208
- // The animated value updates several times per frame during scroll; debounce it and push the
209
- // settled value into the committed transform so hit detection stays current (a Fabric-only issue,
210
- // worse on Android). A freshly-rebuilt interpolation re-emits 0; swallow that first zero (RN).
211
- animatedValueListener = ({ value }) => {
212
- if (typeof value !== 'number')
213
- return;
214
- if (value === 0 && !this.haveReceivedInitialZeroTranslateY) {
215
- this.haveReceivedInitialZeroTranslateY = true;
216
- return;
217
- }
218
- if (this.debounceTimer !== undefined)
219
- clearTimeout(this.debounceTimer);
220
- this.debounceTimer = setTimeout(() => {
221
- this.translateY = value;
222
- if (value !== 0)
223
- this.haveReceivedInitialZeroTranslateY = false;
224
- this.changeDetector.markForCheck();
225
- }, stickyDebounceMs(Platform.OS));
226
- };
227
- rebuildInterpolation() {
228
- this.teardownInterpolation();
229
- const { inputRange, outputRange } = computeStickyInterpolation({
230
- measured: this.measured,
231
- inverted: this.inverted,
232
- scrollViewHeight: this.scrollViewHeight,
233
- layoutY: this.layoutY,
234
- layoutHeight: this.layoutHeight,
235
- nextHeaderLayoutY: this.nextHeaderLayoutY,
236
- });
237
- const interpolation = this.scrollAnimatedValue.interpolate({ inputRange, outputRange });
238
- // symbiote is always Fabric: listen to the settled value to keep the ShadowTree transform
239
- // current for hit-testing (RN attaches this listener only under Fabric).
240
- this.listenerId = interpolation.addListener(this.animatedValueListener);
241
- this.animatedTranslateY = interpolation;
242
- dlog(`Angular ScrollViewStickyHeader interpolation measured=${this.measured} y=${this.layoutY}`);
243
- }
244
- teardownInterpolation() {
245
- if (this.listenerId !== undefined) {
246
- this.animatedTranslateY.removeListener(this.listenerId);
247
- this.listenerId = undefined;
248
- }
249
- if (this.debounceTimer !== undefined) {
250
- clearTimeout(this.debounceTimer);
251
- this.debounceTimer = undefined;
252
- }
253
- }
254
- };
255
- return ScrollViewStickyHeader = _classThis;
256
- })();
257
- export { ScrollViewStickyHeader };
@@ -1,113 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import type { IAccessibilityProps, IAccessibilityStateValue, IAriaProps, IScrollViewHandle, ISection, IVirtualizedSectionListHandle } from '@symbiote-native/components';
3
- import { type IStyleProp, type ISymbioteEvent, type ISymbioteNode, type IViewStyle } from '@symbiote-native/engine';
4
- import { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListSeparatorDirective, type IVListSeparatorContext } from '../virtualized-list';
5
- import { VSectionFooterDirective, VSectionHeaderDirective, VSectionItemDirective, VSectionSeparatorDirective, type IVirtualizedSectionListProps } from '../virtualized-section-list';
6
- export type { ISection } from '@symbiote-native/components';
7
- export type ISectionListHandle = IVirtualizedSectionListHandle;
8
- export { VSectionFooterDirective, VSectionHeaderDirective, VSectionItemDirective, VSectionSeparatorDirective, } from '../virtualized-section-list';
9
- export { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListSeparatorDirective, } from '../virtualized-list';
10
- export type ISectionListProps<ItemT> = IVirtualizedSectionListProps<ItemT>;
11
- export type ISectionListInputs<ItemT> = Omit<ISectionListProps<ItemT>, 'onEndReached' | 'onStartReached' | 'onRefresh' | 'onAccessibilityAction' | 'onAccessibilityTap' | 'onMagicTap' | 'onAccessibilityEscape'>;
12
- export declare class SectionList<ItemT = unknown> implements ISectionListInputs<ItemT>, IVirtualizedSectionListHandle {
13
- sections: ReadonlyArray<ISection<ItemT>>;
14
- keyExtractor?: (item: ItemT, index: number) => string;
15
- stickySectionHeadersEnabled?: boolean;
16
- extraData?: unknown;
17
- readonly endReached: EventEmitter<{
18
- distanceFromEnd: number;
19
- }>;
20
- onEndReachedThreshold?: number;
21
- readonly startReached: EventEmitter<{
22
- distanceFromStart: number;
23
- }>;
24
- onStartReachedThreshold?: number;
25
- readonly refresh: EventEmitter<void>;
26
- refreshing?: boolean | null;
27
- progressViewOffset?: number;
28
- initialNumToRender?: number;
29
- initialScrollIndex?: number;
30
- maxToRenderPerBatch?: number;
31
- updateCellsBatchingPeriod?: number;
32
- windowSize?: number;
33
- inverted?: boolean;
34
- maintainVisibleContentPosition?: {
35
- minIndexForVisible: number;
36
- autoscrollToTopThreshold?: number;
37
- };
38
- onScroll?: (event: ISymbioteEvent) => void;
39
- onScrollBeginDrag?: (event: ISymbioteEvent) => void;
40
- onScrollEndDrag?: (event: ISymbioteEvent) => void;
41
- onMomentumScrollBegin?: (event: ISymbioteEvent) => void;
42
- onMomentumScrollEnd?: (event: ISymbioteEvent) => void;
43
- scrollEventThrottle?: number;
44
- keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
45
- keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
46
- style?: IStyleProp<IViewStyle>;
47
- contentContainerStyle?: IStyleProp<IViewStyle>;
48
- testID?: string;
49
- nativeID?: string;
50
- private cachedResolvedStyle;
51
- get resolvedStyle(): IViewStyle;
52
- accessible?: boolean;
53
- accessibilityLabel?: string;
54
- accessibilityHint?: string;
55
- accessibilityRole?: IAccessibilityProps['accessibilityRole'];
56
- accessibilityState?: IAccessibilityStateValue;
57
- accessibilityValue?: IAccessibilityProps['accessibilityValue'];
58
- accessibilityActions?: IAccessibilityProps['accessibilityActions'];
59
- accessibilityLabelledBy?: string | string[];
60
- importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
61
- accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
62
- screenReaderFocusable?: boolean;
63
- accessibilityViewIsModal?: boolean;
64
- accessibilityElementsHidden?: boolean;
65
- accessibilityIgnoresInvertColors?: boolean;
66
- accessibilityLanguage?: string;
67
- accessibilityRespondsToUserInteraction?: boolean;
68
- accessibilityShowsLargeContentViewer?: boolean;
69
- accessibilityLargeContentTitle?: string;
70
- readonly accessibilityAction: EventEmitter<ISymbioteEvent>;
71
- readonly accessibilityTap: EventEmitter<ISymbioteEvent>;
72
- readonly magicTap: EventEmitter<ISymbioteEvent>;
73
- readonly accessibilityEscape: EventEmitter<ISymbioteEvent>;
74
- role?: IAriaProps['role'];
75
- ariaLabel?: string;
76
- ariaLabelledBy?: string;
77
- ariaLive?: IAriaProps['aria-live'];
78
- ariaHidden?: boolean;
79
- ariaBusy?: boolean;
80
- ariaChecked?: boolean | 'mixed';
81
- ariaDisabled?: boolean;
82
- ariaExpanded?: boolean;
83
- ariaSelected?: boolean;
84
- ariaModal?: boolean;
85
- ariaValueMax?: number;
86
- ariaValueMin?: number;
87
- ariaValueNow?: number;
88
- ariaValueText?: string;
89
- sectionItemDir?: VSectionItemDirective<ItemT>;
90
- sectionHeaderDir?: VSectionHeaderDirective<ItemT>;
91
- sectionFooterDir?: VSectionFooterDirective<ItemT>;
92
- sectionSeparatorDir?: VSectionSeparatorDirective;
93
- listHeaderDir?: VListHeaderDirective;
94
- listFooterDir?: VListFooterDirective;
95
- listEmptyDir?: VListEmptyDirective;
96
- itemSeparatorDir?: VListSeparatorDirective<ItemT>;
97
- private list?;
98
- private readonly elementRef;
99
- itemSeparatorContext(highlighted: unknown, leadingItem: unknown, trailingItem: unknown): IVListSeparatorContext<ItemT>;
100
- scrollToLocation(params: {
101
- sectionIndex: number;
102
- itemIndex: number;
103
- viewOffset?: number;
104
- viewPosition?: number;
105
- animated?: boolean;
106
- }): void;
107
- flashScrollIndicators(): void;
108
- getNativeScrollRef(): IScrollViewHandle | null;
109
- getScrollableNode(): IScrollViewHandle | null;
110
- getScrollResponder(): IScrollViewHandle | null;
111
- getScrollNode(): ISymbioteNode | null;
112
- recordInteraction(): void;
113
- }