@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.
- package/README.md +1 -1
- package/babel-register-composed.cjs +11 -3
- package/build/angular/anchor-host-registry.d.ts +2 -0
- package/build/angular/anchor-host-registry.js +84 -0
- package/build/angular/anchor-host-registry.js.map +1 -0
- package/build/angular/components/input-accessory-view/index.d.ts +2 -1
- package/build/angular/components/input-accessory-view/index.js +28 -39
- package/build/angular/components/input-accessory-view/index.js.map +1 -1
- package/build/angular/components/scroll-view/projection.js +70 -48
- package/build/angular/components/scroll-view/projection.js.map +1 -1
- package/build/angular/components/scroll-view/shared.js +28 -25
- package/build/angular/components/scroll-view/shared.js.map +1 -1
- package/build/angular/components/scroll-view/sticky-header.d.ts +6 -7
- package/build/angular/components/scroll-view/sticky-header.js +82 -65
- package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
- package/build/angular/components/touchable/index.d.ts +2 -5
- package/build/angular/components/touchable/index.js +36 -56
- package/build/angular/components/touchable/index.js.map +1 -1
- package/build/angular/components/virtualized-list/index.d.ts +5 -20
- package/build/angular/components/virtualized-list/index.js +145 -275
- package/build/angular/components/virtualized-list/index.js.map +1 -1
- package/build/angular/components/virtualized-section-list/index.js +2 -4
- package/build/angular/components/virtualized-section-list/index.js.map +1 -1
- package/build/angular/index.d.ts +2 -1
- package/build/angular/index.js +6 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/renderer/index.d.ts +0 -1
- package/build/angular/renderer/index.js +5 -60
- package/build/angular/renderer/index.js.map +1 -1
- package/package.json +8 -4
- package/src/anchor-host-registry.ts +88 -0
- package/src/components/input-accessory-view/index.ts +30 -39
- package/src/components/scroll-view/projection.ts +76 -46
- package/src/components/scroll-view/shared.ts +27 -19
- package/src/components/scroll-view/sticky-header.ts +89 -64
- package/src/components/touchable/index.ts +52 -66
- package/src/components/virtualized-list/index.ts +157 -368
- package/src/components/virtualized-section-list/index.ts +6 -3
- package/src/index.ts +6 -1
- package/src/renderer/index.ts +5 -63
- package/build/bootstrap.d.ts +0 -7
- package/build/bootstrap.js +0 -14
- package/build/components/activity-indicator/index.android.d.ts +0 -9
- package/build/components/activity-indicator/index.android.js +0 -64
- package/build/components/activity-indicator/index.d.ts +0 -1
- package/build/components/activity-indicator/index.ios.d.ts +0 -5
- package/build/components/activity-indicator/index.ios.js +0 -64
- package/build/components/activity-indicator/index.js +0 -3
- package/build/components/activity-indicator/shared.d.ts +0 -64
- package/build/components/activity-indicator/shared.js +0 -424
- package/build/components/button.d.ts +0 -60
- package/build/components/button.js +0 -456
- package/build/components/flat-list/index.d.ts +0 -119
- package/build/components/flat-list/index.js +0 -691
- package/build/components/image/index.android.d.ts +0 -7
- package/build/components/image/index.android.js +0 -88
- package/build/components/image/index.d.ts +0 -1
- package/build/components/image/index.ios.d.ts +0 -7
- package/build/components/image/index.ios.js +0 -88
- package/build/components/image/index.js +0 -2
- package/build/components/image/shared.d.ts +0 -101
- package/build/components/image/shared.js +0 -405
- package/build/components/image-background.d.ts +0 -78
- package/build/components/image-background.js +0 -583
- package/build/components/input-accessory-view/index.d.ts +0 -56
- package/build/components/input-accessory-view/index.js +0 -403
- package/build/components/keyboard-avoiding-view/index.d.ts +0 -79
- package/build/components/keyboard-avoiding-view/index.js +0 -504
- package/build/components/modal/index.d.ts +0 -89
- package/build/components/modal/index.js +0 -529
- package/build/components/pressable/index.d.ts +0 -120
- package/build/components/pressable/index.js +0 -639
- package/build/components/refresh-control/index.d.ts +0 -83
- package/build/components/refresh-control/index.js +0 -509
- package/build/components/safe-area-view/index.d.ts +0 -54
- package/build/components/safe-area-view/index.js +0 -388
- package/build/components/scroll-view/index.android.d.ts +0 -16
- package/build/components/scroll-view/index.android.js +0 -228
- package/build/components/scroll-view/index.d.ts +0 -3
- package/build/components/scroll-view/index.ios.d.ts +0 -6
- package/build/components/scroll-view/index.ios.js +0 -113
- package/build/components/scroll-view/index.js +0 -5
- package/build/components/scroll-view/projection.d.ts +0 -32
- package/build/components/scroll-view/projection.js +0 -311
- package/build/components/scroll-view/shared.d.ts +0 -225
- package/build/components/scroll-view/shared.js +0 -757
- package/build/components/scroll-view/sticky-header.d.ts +0 -38
- package/build/components/scroll-view/sticky-header.js +0 -257
- package/build/components/section-list/index.d.ts +0 -113
- package/build/components/section-list/index.js +0 -768
- package/build/components/switch/index.android.d.ts +0 -17
- package/build/components/switch/index.android.js +0 -107
- package/build/components/switch/index.d.ts +0 -1
- package/build/components/switch/index.ios.d.ts +0 -16
- package/build/components/switch/index.ios.js +0 -106
- package/build/components/switch/index.js +0 -3
- package/build/components/switch/shared.d.ts +0 -37
- package/build/components/switch/shared.js +0 -176
- package/build/components/text-input.d.ts +0 -150
- package/build/components/text-input.js +0 -821
- package/build/components/touchable/index.d.ts +0 -241
- package/build/components/touchable/index.js +0 -1672
- package/build/components/touchable-native-feedback/index.d.ts +0 -80
- package/build/components/touchable-native-feedback/index.js +0 -545
- package/build/components/virtualized-list/directives.d.ts +0 -41
- package/build/components/virtualized-list/directives.js +0 -249
- package/build/components/virtualized-list/index.d.ts +0 -265
- package/build/components/virtualized-list/index.js +0 -1343
- package/build/components/virtualized-section-list/directives.d.ts +0 -28
- package/build/components/virtualized-section-list/directives.js +0 -148
- package/build/components/virtualized-section-list/index.d.ts +0 -175
- package/build/components/virtualized-section-list/index.js +0 -854
- package/build/components.d.ts +0 -39
- package/build/components.js +0 -37
- package/build/create-portal/index.d.ts +0 -17
- package/build/create-portal/index.js +0 -128
- package/build/create-tunnel/index.d.ts +0 -29
- package/build/create-tunnel/index.js +0 -181
- package/build/descriptor-to-angular/index.d.ts +0 -19
- package/build/descriptor-to-angular/index.js +0 -186
- package/build/host-instance/index.d.ts +0 -2
- package/build/host-instance/index.js +0 -36
- package/build/index.d.ts +0 -21
- package/build/index.js +0 -40
- package/build/modules/animated/animated-leaf-binder/index.d.ts +0 -14
- package/build/modules/animated/animated-leaf-binder/index.js +0 -90
- package/build/modules/animated/animated-leaf-binder.d.ts +0 -14
- package/build/modules/animated/animated-leaf-binder.js +0 -90
- package/build/modules/animated/create-animated-component.d.ts +0 -48
- package/build/modules/animated/create-animated-component.js +0 -425
- package/build/modules/animated/index.d.ts +0 -51
- package/build/modules/animated/index.js +0 -58
- package/build/modules/app-registry/index.d.ts +0 -7
- package/build/modules/app-registry/index.js +0 -22
- package/build/modules/status-bar/index.d.ts +0 -17
- package/build/modules/status-bar/index.js +0 -121
- package/build/primitives/index.d.ts +0 -32
- package/build/primitives/index.js +0 -386
- package/build/primitives/shared.d.ts +0 -83
- package/build/primitives/shared.js +0 -230
- package/build/render/index.d.ts +0 -11
- package/build/render/index.js +0 -170
- package/build/renderer/index.d.ts +0 -38
- package/build/renderer/index.js +0 -355
- package/build/services/color-scheme.service.d.ts +0 -13
- package/build/services/color-scheme.service.js +0 -72
- package/build/services/index.d.ts +0 -2
- package/build/services/index.js +0 -2
- package/build/services/window-dimensions.service.d.ts +0 -13
- package/build/services/window-dimensions.service.js +0 -83
- package/src/__tests__/responder-change-detection.test.ts +0 -102
- package/src/__tests__/responder-nested-cd.test.ts +0 -113
- package/src/angular-gaps.test.ts +0 -142
- package/src/angular-imports.test.ts +0 -100
- package/src/components/activity-indicator/activity-indicator-class-style.test.ts +0 -44
- package/src/components/activity-indicator/activity-indicator.test.ts +0 -131
- package/src/components/flat-list/column-wrapper-style-class.test.ts +0 -116
- package/src/components/flat-list/flat-list-array-style.test.ts +0 -131
- package/src/components/flat-list/flat-list-class-style.test.ts +0 -74
- package/src/components/flat-list/flat-list-scroll-containment.test.ts +0 -107
- package/src/components/flat-list/flat-list.test.ts +0 -99
- package/src/components/image/image-class-style.test.ts +0 -46
- package/src/components/image-background-class-style.test.ts +0 -48
- package/src/components/image-background-style-class.test.ts +0 -79
- package/src/components/input-accessory-view/input-accessory-view.test.ts +0 -43
- package/src/components/keyboard-avoiding-view/keyboard-avoiding-view.test.ts +0 -54
- package/src/components/modal/modal.test.ts +0 -43
- package/src/components/pressable/pressable.test.ts +0 -85
- package/src/components/refresh-control/refresh-control.test.ts +0 -41
- package/src/components/safe-area-view/safe-area-view.test.ts +0 -43
- package/src/components/scroll-view/android-scroll-view-axis-projection.test.ts +0 -123
- package/src/components/scroll-view/content-container-style-class.test.ts +0 -75
- package/src/components/scroll-view/scroll-view-class-style.test.ts +0 -134
- package/src/components/scroll-view/scroll-view-projection.test.ts +0 -194
- package/src/components/switch/android-switch-class.test.ts +0 -42
- package/src/components/switch/switch.test.ts +0 -92
- package/src/components/text-input-class-style.test.ts +0 -54
- package/src/components/touchable/touchable.test.ts +0 -102
- package/src/components/touchable-native-feedback/touchable-native-feedback.test.ts +0 -49
- package/src/components/virtualized-list/virtualized-list-class-style.test.ts +0 -76
- package/src/components/virtualized-section-list/virtualized-section-list-class-style.test.ts +0 -60
- package/src/create-portal/create-portal.test.ts +0 -90
- package/src/create-tunnel/create-tunnel.test.ts +0 -120
- package/src/descriptor-to-angular/descriptor-outlet.test.ts +0 -94
- package/src/host-instance/host-instance.test.ts +0 -49
- package/src/modules/animated/animated-leaf-binder/animated-leaf-binder.test.ts +0 -116
- package/src/modules/animated/animated-leaf-binder.test.ts +0 -116
- package/src/modules/animated/animated-scroll-view.test.ts +0 -102
- package/src/modules/app-registry/app-registry.test.ts +0 -106
- package/src/modules/status-bar/status-bar.test.ts +0 -50
- package/src/render/render.test.ts +0 -147
- package/src/renderer/renderer.test.ts +0 -202
- 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
|
-
}
|