@symbiote-native/angular 0.5.0 → 0.6.1

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 (151) hide show
  1. package/babel-register-composed.cjs +11 -3
  2. package/build/angular/anchor-host-registry.d.ts +2 -0
  3. package/build/angular/anchor-host-registry.js +84 -0
  4. package/build/angular/anchor-host-registry.js.map +1 -0
  5. package/build/angular/components/input-accessory-view/index.d.ts +2 -1
  6. package/build/angular/components/input-accessory-view/index.js +28 -39
  7. package/build/angular/components/input-accessory-view/index.js.map +1 -1
  8. package/build/angular/components/scroll-view/projection.js +70 -48
  9. package/build/angular/components/scroll-view/projection.js.map +1 -1
  10. package/build/angular/components/scroll-view/shared.js +28 -25
  11. package/build/angular/components/scroll-view/shared.js.map +1 -1
  12. package/build/angular/components/scroll-view/sticky-header.d.ts +6 -7
  13. package/build/angular/components/scroll-view/sticky-header.js +82 -65
  14. package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
  15. package/build/angular/components/touchable/index.d.ts +2 -5
  16. package/build/angular/components/touchable/index.js +36 -56
  17. package/build/angular/components/touchable/index.js.map +1 -1
  18. package/build/angular/components/virtualized-list/index.d.ts +5 -20
  19. package/build/angular/components/virtualized-list/index.js +145 -275
  20. package/build/angular/components/virtualized-list/index.js.map +1 -1
  21. package/build/angular/components/virtualized-section-list/index.js +2 -4
  22. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  23. package/build/angular/index.d.ts +2 -1
  24. package/build/angular/index.js +6 -1
  25. package/build/angular/index.js.map +1 -1
  26. package/build/angular/renderer/index.d.ts +0 -1
  27. package/build/angular/renderer/index.js +5 -60
  28. package/build/angular/renderer/index.js.map +1 -1
  29. package/package.json +9 -7
  30. package/src/__tests__/responder-nested-cd.test.ts +1 -1
  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/src/renderer/renderer.test.ts +2 -1
  42. package/build/bootstrap.d.ts +0 -7
  43. package/build/bootstrap.js +0 -14
  44. package/build/components/activity-indicator/index.android.d.ts +0 -9
  45. package/build/components/activity-indicator/index.android.js +0 -64
  46. package/build/components/activity-indicator/index.d.ts +0 -1
  47. package/build/components/activity-indicator/index.ios.d.ts +0 -5
  48. package/build/components/activity-indicator/index.ios.js +0 -64
  49. package/build/components/activity-indicator/index.js +0 -3
  50. package/build/components/activity-indicator/shared.d.ts +0 -64
  51. package/build/components/activity-indicator/shared.js +0 -424
  52. package/build/components/button.d.ts +0 -60
  53. package/build/components/button.js +0 -456
  54. package/build/components/flat-list/index.d.ts +0 -119
  55. package/build/components/flat-list/index.js +0 -691
  56. package/build/components/image/index.android.d.ts +0 -7
  57. package/build/components/image/index.android.js +0 -88
  58. package/build/components/image/index.d.ts +0 -1
  59. package/build/components/image/index.ios.d.ts +0 -7
  60. package/build/components/image/index.ios.js +0 -88
  61. package/build/components/image/index.js +0 -2
  62. package/build/components/image/shared.d.ts +0 -101
  63. package/build/components/image/shared.js +0 -405
  64. package/build/components/image-background.d.ts +0 -78
  65. package/build/components/image-background.js +0 -583
  66. package/build/components/input-accessory-view/index.d.ts +0 -56
  67. package/build/components/input-accessory-view/index.js +0 -403
  68. package/build/components/keyboard-avoiding-view/index.d.ts +0 -79
  69. package/build/components/keyboard-avoiding-view/index.js +0 -504
  70. package/build/components/modal/index.d.ts +0 -89
  71. package/build/components/modal/index.js +0 -529
  72. package/build/components/pressable/index.d.ts +0 -120
  73. package/build/components/pressable/index.js +0 -639
  74. package/build/components/refresh-control/index.d.ts +0 -83
  75. package/build/components/refresh-control/index.js +0 -509
  76. package/build/components/safe-area-view/index.d.ts +0 -54
  77. package/build/components/safe-area-view/index.js +0 -388
  78. package/build/components/scroll-view/index.android.d.ts +0 -16
  79. package/build/components/scroll-view/index.android.js +0 -228
  80. package/build/components/scroll-view/index.d.ts +0 -3
  81. package/build/components/scroll-view/index.ios.d.ts +0 -6
  82. package/build/components/scroll-view/index.ios.js +0 -113
  83. package/build/components/scroll-view/index.js +0 -5
  84. package/build/components/scroll-view/projection.d.ts +0 -32
  85. package/build/components/scroll-view/projection.js +0 -311
  86. package/build/components/scroll-view/shared.d.ts +0 -225
  87. package/build/components/scroll-view/shared.js +0 -757
  88. package/build/components/scroll-view/sticky-header.d.ts +0 -38
  89. package/build/components/scroll-view/sticky-header.js +0 -257
  90. package/build/components/section-list/index.d.ts +0 -113
  91. package/build/components/section-list/index.js +0 -768
  92. package/build/components/switch/index.android.d.ts +0 -17
  93. package/build/components/switch/index.android.js +0 -107
  94. package/build/components/switch/index.d.ts +0 -1
  95. package/build/components/switch/index.ios.d.ts +0 -16
  96. package/build/components/switch/index.ios.js +0 -106
  97. package/build/components/switch/index.js +0 -3
  98. package/build/components/switch/shared.d.ts +0 -37
  99. package/build/components/switch/shared.js +0 -176
  100. package/build/components/text-input.d.ts +0 -150
  101. package/build/components/text-input.js +0 -821
  102. package/build/components/touchable/index.d.ts +0 -241
  103. package/build/components/touchable/index.js +0 -1672
  104. package/build/components/touchable-native-feedback/index.d.ts +0 -80
  105. package/build/components/touchable-native-feedback/index.js +0 -545
  106. package/build/components/virtualized-list/directives.d.ts +0 -41
  107. package/build/components/virtualized-list/directives.js +0 -249
  108. package/build/components/virtualized-list/index.d.ts +0 -265
  109. package/build/components/virtualized-list/index.js +0 -1343
  110. package/build/components/virtualized-section-list/directives.d.ts +0 -28
  111. package/build/components/virtualized-section-list/directives.js +0 -148
  112. package/build/components/virtualized-section-list/index.d.ts +0 -175
  113. package/build/components/virtualized-section-list/index.js +0 -854
  114. package/build/components.d.ts +0 -39
  115. package/build/components.js +0 -37
  116. package/build/create-portal/index.d.ts +0 -17
  117. package/build/create-portal/index.js +0 -128
  118. package/build/create-tunnel/index.d.ts +0 -29
  119. package/build/create-tunnel/index.js +0 -181
  120. package/build/descriptor-to-angular/index.d.ts +0 -19
  121. package/build/descriptor-to-angular/index.js +0 -186
  122. package/build/host-instance/index.d.ts +0 -2
  123. package/build/host-instance/index.js +0 -36
  124. package/build/index.d.ts +0 -21
  125. package/build/index.js +0 -40
  126. package/build/modules/animated/animated-leaf-binder/index.d.ts +0 -14
  127. package/build/modules/animated/animated-leaf-binder/index.js +0 -90
  128. package/build/modules/animated/animated-leaf-binder.d.ts +0 -14
  129. package/build/modules/animated/animated-leaf-binder.js +0 -90
  130. package/build/modules/animated/create-animated-component.d.ts +0 -48
  131. package/build/modules/animated/create-animated-component.js +0 -425
  132. package/build/modules/animated/index.d.ts +0 -51
  133. package/build/modules/animated/index.js +0 -58
  134. package/build/modules/app-registry/index.d.ts +0 -7
  135. package/build/modules/app-registry/index.js +0 -22
  136. package/build/modules/status-bar/index.d.ts +0 -17
  137. package/build/modules/status-bar/index.js +0 -121
  138. package/build/primitives/index.d.ts +0 -32
  139. package/build/primitives/index.js +0 -386
  140. package/build/primitives/shared.d.ts +0 -83
  141. package/build/primitives/shared.js +0 -230
  142. package/build/render/index.d.ts +0 -11
  143. package/build/render/index.js +0 -170
  144. package/build/renderer/index.d.ts +0 -38
  145. package/build/renderer/index.js +0 -355
  146. package/build/services/color-scheme.service.d.ts +0 -13
  147. package/build/services/color-scheme.service.js +0 -72
  148. package/build/services/index.d.ts +0 -2
  149. package/build/services/index.js +0 -2
  150. package/build/services/window-dimensions.service.d.ts +0 -13
  151. package/build/services/window-dimensions.service.js +0 -83
@@ -1,228 +0,0 @@
1
- // ScrollView on Android. An Android ScrollView accepts only ONE child, so a
2
- // RefreshControl can't be a sibling of the content the way iOS allows ("addViewAt: failed to insert
3
- // view ... at index 1"). RN solves this by having the RefreshControl (AndroidSwipeRefreshLayout)
4
- // WRAP the scroll view (cloneElement(refreshControl, {style}, scrollView)). Angular mirrors that
5
- // shape by querying a projected <RefreshControl>, re-rendering its native prop surface as the outer
6
- // wrapper, and projecting every non-RefreshControl child into the inner scroll content.
7
- //
8
- // Android genuinely needs a different Fabric view per
9
- // axis for BOTH the outer scroll container (RCTScrollView is vertical-only; AndroidHorizontalScrollView
10
- // is a dedicated ViewManager) AND the inner content view (vertical content is a plain Android View,
11
- // horizontal content is AndroidHorizontalScrollContentView, which carries its own ShadowNode::
12
- // layout() override). So the content tag differs by axis — but Angular only reliably projects into a
13
- // component's LAST-declared <ng-content> when 2+ DISTINCT declarations exist (angular/angular#22972),
14
- // which an earlier 4-call-site template (one <ng-content> per axis x refresh-control branch) tripped.
15
- // Fix: exactly ONE `<ng-content>` textually, inside a single top-level `<ng-template>`, re-instantiated
16
- // into whichever branch is active via a local template-outlet directive (SymbioteTemplateOutletDirective
17
- // below, `@angular/common`-free per this adapter's dependency policy — see package.json). Only one
18
- // branch is ever live at a time, and the `<ng-content>` DECLARATION COUNT stays at one, so the "last
19
- // one wins" limitation never triggers. Covered by `android-scroll-view-axis-projection.test.ts` (all
20
- // four axis x refresh combos, plus a runtime axis switch) and `flat-list-scroll-containment.test.ts`.
21
- //
22
- // Metro picks this on an Android host; no Platform.OS read.
23
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
24
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
25
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
26
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
27
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
28
- var _, done = false;
29
- for (var i = decorators.length - 1; i >= 0; i--) {
30
- var context = {};
31
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
32
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
33
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
34
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
35
- if (kind === "accessor") {
36
- if (result === void 0) continue;
37
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
38
- if (_ = accept(result.get)) descriptor.get = _;
39
- if (_ = accept(result.set)) descriptor.set = _;
40
- if (_ = accept(result.init)) initializers.unshift(_);
41
- }
42
- else if (_ = accept(result)) {
43
- if (kind === "field") initializers.unshift(_);
44
- else descriptor[key] = _;
45
- }
46
- }
47
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
48
- done = true;
49
- };
50
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
51
- var useValue = arguments.length > 2;
52
- for (var i = 0; i < initializers.length; i++) {
53
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
54
- }
55
- return useValue ? value : void 0;
56
- };
57
- import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, Directive, ElementRef, Input, TemplateRef, ViewContainerRef, inject, } from '@angular/core';
58
- import { anchorHostStyle, HorizontalScrollView, HorizontalScrollContentView, RefreshControlHost, ScrollContentView, ScrollViewHost, SymbioteHostPropsDirective, } from '../../primitives';
59
- import { ScrollViewBase, ScrollViewProjectionDirective, SCROLL_VIEW_INPUTS } from './shared';
60
- // Minimal local twin of `@angular/common`'s NgTemplateOutlet (this adapter deliberately has no
61
- // @angular/common dependency — see package.json): re-instantiates the SAME TemplateRef into
62
- // whichever structural branch below is currently active, so the component's compiled template
63
- // keeps exactly ONE <ng-content> declaration regardless of how many places reference it.
64
- let SymbioteTemplateOutletDirective = (() => {
65
- let _classDecorators = [Directive({
66
- selector: '[symbioteTemplateOutlet]',
67
- standalone: true,
68
- })];
69
- let _classDescriptor;
70
- let _classExtraInitializers = [];
71
- let _classThis;
72
- let _symbioteTemplateOutlet_decorators;
73
- let _symbioteTemplateOutlet_initializers = [];
74
- let _symbioteTemplateOutlet_extraInitializers = [];
75
- var SymbioteTemplateOutletDirective = class {
76
- static { _classThis = this; }
77
- static {
78
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
79
- _symbioteTemplateOutlet_decorators = [Input()];
80
- __esDecorate(null, null, _symbioteTemplateOutlet_decorators, { kind: "field", name: "symbioteTemplateOutlet", static: false, private: false, access: { has: obj => "symbioteTemplateOutlet" in obj, get: obj => obj.symbioteTemplateOutlet, set: (obj, value) => { obj.symbioteTemplateOutlet = value; } }, metadata: _metadata }, _symbioteTemplateOutlet_initializers, _symbioteTemplateOutlet_extraInitializers);
81
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
82
- SymbioteTemplateOutletDirective = _classThis = _classDescriptor.value;
83
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
84
- __runInitializers(_classThis, _classExtraInitializers);
85
- }
86
- symbioteTemplateOutlet = __runInitializers(this, _symbioteTemplateOutlet_initializers, null);
87
- viewContainerRef = (__runInitializers(this, _symbioteTemplateOutlet_extraInitializers), inject(ViewContainerRef));
88
- viewRef;
89
- ngOnChanges() {
90
- if (this.viewRef !== undefined) {
91
- this.viewRef.destroy();
92
- this.viewRef = undefined;
93
- }
94
- if (this.symbioteTemplateOutlet !== null) {
95
- this.viewRef = this.viewContainerRef.createEmbeddedView(this.symbioteTemplateOutlet);
96
- }
97
- }
98
- ngOnDestroy() {
99
- this.viewRef?.destroy();
100
- }
101
- };
102
- return SymbioteTemplateOutletDirective = _classThis;
103
- })();
104
- export { SymbioteTemplateOutletDirective };
105
- // anchorHostStyle returns `unknown` (the anchor's already-resolved style, any shape); narrowed
106
- // here (mirrors the identical `asStyle` in image/shared.ts) rather than `as`-cast to satisfy
107
- // `IStyleProp<IViewStyle>`'s stricter array-element union.
108
- function asStyle(value) {
109
- return typeof value === 'object' && value !== null ? value : undefined;
110
- }
111
- // The symbiote-* host elements are imported as standalone components; the props directive is
112
- // applied as a template directive and the projection directive manages sticky-header wrapping.
113
- let ScrollView = (() => {
114
- let _classDecorators = [Component({
115
- selector: 'ScrollView',
116
- standalone: true,
117
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
118
- imports: [
119
- ScrollViewHost,
120
- ScrollContentView,
121
- HorizontalScrollView,
122
- HorizontalScrollContentView,
123
- RefreshControlHost,
124
- SymbioteHostPropsDirective,
125
- ScrollViewProjectionDirective,
126
- SymbioteTemplateOutletDirective,
127
- ],
128
- changeDetection: ChangeDetectionStrategy.OnPush,
129
- inputs: SCROLL_VIEW_INPUTS,
130
- template: `
131
- <ng-template #sharedContent>
132
- <ng-content></ng-content>
133
- </ng-template>
134
- @if (isHorizontal) {
135
- @if (hasProjectedRefreshControl) {
136
- <symbiote-refresh-control
137
- #refreshHost="symbioteHost"
138
- [symbioteHostProps]="androidRefreshControlProps"
139
- (refresh)="handleProjectedRefresh(refreshHost.node)"
140
- >
141
- <symbiote-horizontal-scroll-view
142
- #host="symbioteHost"
143
- [symbioteHostProps]="androidWrappedScrollProps"
144
- >
145
- <symbiote-horizontal-scroll-content
146
- [symbioteHostProps]="contentProps"
147
- [symbioteScrollViewProjection]="projectionController"
148
- >
149
- <ng-container [symbioteTemplateOutlet]="sharedContent"></ng-container>
150
- </symbiote-horizontal-scroll-content>
151
- </symbiote-horizontal-scroll-view>
152
- </symbiote-refresh-control>
153
- } @else {
154
- <symbiote-horizontal-scroll-view #host="symbioteHost" [symbioteHostProps]="scrollProps">
155
- <symbiote-horizontal-scroll-content
156
- [symbioteHostProps]="contentProps"
157
- [symbioteScrollViewProjection]="projectionController"
158
- >
159
- <ng-container [symbioteTemplateOutlet]="sharedContent"></ng-container>
160
- </symbiote-horizontal-scroll-content>
161
- </symbiote-horizontal-scroll-view>
162
- }
163
- } @else {
164
- @if (hasProjectedRefreshControl) {
165
- <symbiote-refresh-control
166
- #refreshHost="symbioteHost"
167
- [symbioteHostProps]="androidRefreshControlProps"
168
- (refresh)="handleProjectedRefresh(refreshHost.node)"
169
- >
170
- <symbiote-scroll-view
171
- #host="symbioteHost"
172
- [symbioteHostProps]="androidWrappedScrollProps"
173
- >
174
- <symbiote-scroll-content
175
- [symbioteHostProps]="contentProps"
176
- [symbioteScrollViewProjection]="projectionController"
177
- >
178
- <ng-container [symbioteTemplateOutlet]="sharedContent"></ng-container>
179
- </symbiote-scroll-content>
180
- </symbiote-scroll-view>
181
- </symbiote-refresh-control>
182
- } @else {
183
- <symbiote-scroll-view #host="symbioteHost" [symbioteHostProps]="scrollProps">
184
- <symbiote-scroll-content
185
- [symbioteHostProps]="contentProps"
186
- [symbioteScrollViewProjection]="projectionController"
187
- >
188
- <ng-container [symbioteTemplateOutlet]="sharedContent"></ng-container>
189
- </symbiote-scroll-content>
190
- </symbiote-scroll-view>
191
- }
192
- }
193
- `,
194
- })];
195
- let _classDescriptor;
196
- let _classExtraInitializers = [];
197
- let _classThis;
198
- let _classSuper = ScrollViewBase;
199
- var ScrollView = class extends _classSuper {
200
- static { _classThis = this; }
201
- static {
202
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
203
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
204
- ScrollView = _classThis = _classDescriptor.value;
205
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
206
- __runInitializers(_classThis, _classExtraInitializers);
207
- }
208
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
209
- // onto (see anchorHostStyle's doc comment) — NOT `#host` in the template above, which targets
210
- // the real inner `symbiote-scroll-view`/`symbiote-horizontal-scroll-view` one level down.
211
- elementRef = inject(ElementRef);
212
- get scrollProps() {
213
- const props = super.scrollProps;
214
- return { ...props, style: [anchorHostStyle(this.elementRef), props.style] };
215
- }
216
- // Feeds the anchor's class-derived style INTO the base class's own `splitLayoutProps` call
217
- // (shared.ts's `androidWrappedScrollProps`/`androidRefreshControlProps`), not tacked on after —
218
- // a class-only layout style (flex/height/gap/…) must be visible to the split itself, or the
219
- // Android outer refresh-control wrapper never receives its share and collapses to zero size
220
- // (a real device bug: the whole ScrollView renders nothing). See layoutSplitStyle's doc comment
221
- // in shared.ts and the identical fix already shipped in the Vue adapter's scroll-view.
222
- get layoutSplitStyle() {
223
- return [asStyle(anchorHostStyle(this.elementRef)), this.style];
224
- }
225
- };
226
- return ScrollView = _classThis;
227
- })();
228
- export { ScrollView };
@@ -1,3 +0,0 @@
1
- export * from './index.ios';
2
- export { ScrollViewStickyHeader } from './sticky-header';
3
- export type { IStickyHeaderComponentType } from './sticky-header';
@@ -1,6 +0,0 @@
1
- import { ScrollViewBase } from './shared';
2
- export type { IAngularScrollViewProps, IScrollViewHandle } from './shared';
3
- export declare class ScrollView extends ScrollViewBase {
4
- private readonly elementRef;
5
- get scrollProps(): Record<string, unknown>;
6
- }
@@ -1,113 +0,0 @@
1
- // ScrollView on iOS. The RefreshControl is a CHILD of the scroll view, rendered
2
- // as a SIBLING BEFORE the content container (RN ScrollView.js: {refreshControl}{contentContainer}).
3
- // The developer composes it as a projected child of <ScrollView>; this template selects it into the
4
- // sibling slot before the scroll-content. Also the base (index.ts re-exports it) for headless /
5
- // web. Metro picks this on an iOS host; no Platform.OS read. Mirrors the React/Vue iOS binding.
6
- //
7
- // UNLIKE Android, iOS has only ONE host intrinsic pair regardless of axis (both horizontal and
8
- // vertical map to RCTScrollView / RCTScrollContentView) — `shared.ts`'s `scrollProps` already
9
- // forwards `horizontal` as a plain prop ("iOS needs `horizontal` to flip RCTScrollView's axis").
10
- // So, unlike `index.android.ts`, this file does NOT branch the host tag on `isHorizontal` — doing
11
- // so anyway (mirroring Android's shape for symmetry) used to declare `<ng-content>` once per
12
- // `@if`/`@else` branch, which trips a documented Angular limitation: content projected into the
13
- // FIRST (`@if`) branch never receives Angular's native catch-up placement, only the SECOND
14
- // (`@else`) branch does (angular/angular#53310, #54840 — Angular's own docs: "You should not
15
- // conditionally include <ng-content> with @if, @for, or @switch"). Symptom here was axis-specific:
16
- // a horizontal FlatList's cells landed outside the ScrollView entirely. Fix: single unconditional
17
- // `<ng-content>` call site.
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 { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, ElementRef, inject, } from '@angular/core';
53
- import { anchorHostStyle, RefreshControlHost, ScrollContentView, ScrollViewHost, SymbioteHostPropsDirective, } from '../../primitives';
54
- import { ScrollViewBase, ScrollViewProjectionDirective, SCROLL_VIEW_INPUTS } from './shared';
55
- // The symbiote-* host elements are imported as standalone components; the props directive is
56
- // applied as a template directive and the projection directive manages sticky-header wrapping.
57
- let ScrollView = (() => {
58
- let _classDecorators = [Component({
59
- selector: 'ScrollView',
60
- standalone: true,
61
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
62
- imports: [
63
- ScrollViewHost,
64
- ScrollContentView,
65
- RefreshControlHost,
66
- SymbioteHostPropsDirective,
67
- ScrollViewProjectionDirective,
68
- ],
69
- changeDetection: ChangeDetectionStrategy.OnPush,
70
- inputs: SCROLL_VIEW_INPUTS,
71
- template: `
72
- <symbiote-scroll-view #host="symbioteHost" [symbioteHostProps]="scrollProps">
73
- @if (hasProjectedRefreshControl) {
74
- <symbiote-refresh-control
75
- #refreshHost="symbioteHost"
76
- [symbioteHostProps]="iosRefreshControlProps"
77
- (refresh)="handleProjectedRefresh(refreshHost.node)"
78
- ></symbiote-refresh-control>
79
- }
80
- <symbiote-scroll-content
81
- [symbioteHostProps]="contentProps"
82
- [symbioteScrollViewProjection]="projectionController"
83
- >
84
- <ng-content></ng-content>
85
- </symbiote-scroll-content>
86
- </symbiote-scroll-view>
87
- `,
88
- })];
89
- let _classDescriptor;
90
- let _classExtraInitializers = [];
91
- let _classThis;
92
- let _classSuper = ScrollViewBase;
93
- var ScrollView = class extends _classSuper {
94
- static { _classThis = this; }
95
- static {
96
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
97
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
98
- ScrollView = _classThis = _classDescriptor.value;
99
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
100
- __runInitializers(_classThis, _classExtraInitializers);
101
- }
102
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
103
- // onto (see anchorHostStyle's doc comment) — NOT `#host` in the template above, which targets
104
- // the real inner `symbiote-scroll-view` one level down.
105
- elementRef = inject(ElementRef);
106
- get scrollProps() {
107
- const props = super.scrollProps;
108
- return { ...props, style: [anchorHostStyle(this.elementRef), props.style] };
109
- }
110
- };
111
- return ScrollView = _classThis;
112
- })();
113
- export { ScrollView };
@@ -1,5 +0,0 @@
1
- // Base / default ScrollView. Re-exports the iOS build. Metro overrides this with index.ios.ts /
2
- // index.android.ts on a real host; under tsx / tsc / web the host resolves here. Filename is the
3
- // selector, no Platform.OS read.
4
- export * from './index.ios';
5
- export { ScrollViewStickyHeader } from './sticky-header';
@@ -1,32 +0,0 @@
1
- import { type AnimatedValue, type ISymbioteNode } from '@symbiote-native/engine';
2
- type IInsert = (parent: ISymbioteNode, child: ISymbioteNode, beforeChild?: ISymbioteNode) => void;
3
- type IRemove = (parent: ISymbioteNode, child: ISymbioteNode) => void;
4
- export interface IScrollViewProjectionConfig {
5
- stickyHeaderIndices: readonly number[] | undefined;
6
- invertStickyHeaders: boolean | undefined;
7
- scrollViewHeight: number | undefined;
8
- scrollAnimatedValue: AnimatedValue;
9
- customStickyHeaderComponent: unknown;
10
- excludeRefreshControl: boolean;
11
- }
12
- export declare class ScrollViewProjectionController {
13
- config: IScrollViewProjectionConfig;
14
- private contentNode;
15
- private readonly records;
16
- private readonly headerLayoutYs;
17
- constructor(config: IScrollViewProjectionConfig);
18
- update(config: IScrollViewProjectionConfig): void;
19
- bindContentNode(node: ISymbioteNode): void;
20
- appendProjectedChild(parent: ISymbioteNode, child: ISymbioteNode, insert: IInsert): void;
21
- insertProjectedChild(parent: ISymbioteNode, child: ISymbioteNode, beforeChild: ISymbioteNode | null, insert: IInsert): void;
22
- removeProjectedChild(child: ISymbioteNode, remove: IRemove): boolean;
23
- nextStickyHeaderY(index: number): number | undefined;
24
- recordHeaderLayoutY(index: number, y: number): void;
25
- private insertRecord;
26
- private reconcileStickyRecords;
27
- private wrapRecord;
28
- private unwrapRecord;
29
- }
30
- export declare function getScrollViewProjection(node: ISymbioteNode): ScrollViewProjectionController | undefined;
31
- export declare function removeScrollViewProjectedChild(child: ISymbioteNode, remove: IRemove): boolean;
32
- export {};