@ng-native/components 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
- package/android/src/main/java/dev/ngnative/components/ContextMenuPopup.kt +61 -19
- package/android/src/main/java/dev/ngnative/components/MenusModule.kt +22 -0
- package/android/src/main/java/dev/ngnative/components/Shortcut.kt +13 -4
- package/dist/context-menu.d.ts +14 -6
- package/dist/context-menu.js +30 -28
- package/dist/context-menu.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/menu.d.ts +17 -8
- package/dist/menu.js +22 -36
- package/dist/menu.js.map +1 -1
- package/dist/modal.d.ts +6 -2
- package/dist/modal.js.map +1 -1
- package/dist/native-button.d.ts +31 -2
- package/dist/native-button.js +104 -6
- package/dist/native-button.js.map +1 -1
- package/dist/press-menu.d.ts +60 -0
- package/dist/press-menu.js +116 -0
- package/dist/press-menu.js.map +1 -0
- package/dist/pressable.d.ts +3 -0
- package/dist/pressable.js +7 -1
- package/dist/pressable.js.map +1 -1
- package/dist/reanimated.js +27 -3
- package/dist/reanimated.js.map +1 -1
- package/dist/scroll-view.d.ts +3 -1
- package/dist/scroll-view.js +7 -2
- package/dist/scroll-view.js.map +1 -1
- package/dist/settled-updates.d.ts +55 -0
- package/dist/settled-updates.js +77 -0
- package/dist/settled-updates.js.map +1 -0
- package/dist/sidebar-item.d.ts +18 -3
- package/dist/sidebar-item.js +29 -3
- package/dist/sidebar-item.js.map +1 -1
- package/dist/sidebar.js +4 -3
- package/dist/sidebar.js.map +1 -1
- package/dist/split-view.d.ts +23 -2
- package/dist/split-view.js +32 -5
- package/dist/split-view.js.map +1 -1
- package/dist/stand-ins/reanimated.d.ts +5 -0
- package/dist/stand-ins/reanimated.js +7 -0
- package/dist/stand-ins/reanimated.js.map +1 -1
- package/dist/sticky-headers.d.ts +19 -0
- package/dist/sticky-headers.js +67 -10
- package/dist/sticky-headers.js.map +1 -1
- package/dist/sticky-rows.d.ts +123 -26
- package/dist/sticky-rows.js +285 -71
- package/dist/sticky-rows.js.map +1 -1
- package/dist/svg-icon.d.ts +23 -0
- package/dist/svg-icon.js +53 -0
- package/dist/svg-icon.js.map +1 -0
- package/dist/tray-icon.d.ts +7 -1
- package/dist/tray-icon.js +15 -3
- package/dist/tray-icon.js.map +1 -1
- package/dist/virtual-list-sticky-level.d.ts +33 -0
- package/dist/virtual-list-sticky-level.js +58 -0
- package/dist/virtual-list-sticky-level.js.map +1 -0
- package/dist/virtual-list-sticky.d.ts +19 -0
- package/dist/virtual-list-sticky.js +13 -0
- package/dist/virtual-list-sticky.js.map +1 -0
- package/dist/virtual-list.d.ts +29 -7
- package/dist/virtual-list.js +127 -59
- package/dist/virtual-list.js.map +1 -1
- package/dist/worklet-style.d.ts +11 -0
- package/dist/worklet-style.js +15 -1
- package/dist/worklet-style.js.map +1 -1
- package/dist/worklets.d.ts +5 -1
- package/dist/worklets.js.map +1 -1
- package/dist/written-props.js +3 -0
- package/dist/written-props.js.map +1 -1
- package/ios/NgNativeButtonComponentView.mm +8 -4
- package/ios/NgNativeButtonMetrics.h +9 -2
- package/ios/NgNativeButtonMetrics.mm +33 -4
- package/ios/NgNativeButtonShadowNode.h +2 -0
- package/ios/NgNativeButtonShadowNode.mm +5 -1
- package/ios/NgNativeMenus.mm +42 -2
- package/ios/NgNativePressMenu.h +28 -0
- package/ios/NgNativePressMenu.mm +45 -0
- package/package.json +3 -3
package/dist/sticky-rows.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { type Signal } from '@angular/core';
|
|
2
2
|
import { type HostEngine, type HostNode, type StaticTransform } from '@ng-native/fabric';
|
|
3
|
+
import type { VirtualListSticky } from './virtual-list-sticky.ts';
|
|
3
4
|
/** What `StickyRows` needs of the list whose rows it pins. */
|
|
4
5
|
export interface StickyRowsList {
|
|
5
6
|
/** The sticky rows' indices, as `stickyIndices` gives them. */
|
|
6
7
|
readonly indices: Signal<readonly number[]>;
|
|
8
|
+
/** The rows' levels, when a directive on the list gives them, read from the items. */
|
|
9
|
+
readonly levels: VirtualListSticky | null;
|
|
10
|
+
readonly items: Signal<readonly unknown[]>;
|
|
7
11
|
/** Whether the list header is pinned too, as `stickyHeader` says. */
|
|
8
12
|
readonly header: Signal<boolean>;
|
|
9
13
|
readonly headerHeight: Signal<number>;
|
|
@@ -25,34 +29,62 @@ interface Row {
|
|
|
25
29
|
readonly index: number;
|
|
26
30
|
readonly parked?: boolean;
|
|
27
31
|
}
|
|
32
|
+
/** A sticky row: how deep it is, the rows it pins under, and the row that pushes it off. */
|
|
33
|
+
interface StickyRow {
|
|
34
|
+
/** 0 for the outermost. The rows of `stickyIndices` are all at 0. */
|
|
35
|
+
readonly level: number;
|
|
36
|
+
/** The nearest row before it of each level further out, outermost first. */
|
|
37
|
+
readonly above: readonly number[];
|
|
38
|
+
/** The next row at its level or further out, if there is one. */
|
|
39
|
+
next: number | undefined;
|
|
40
|
+
}
|
|
28
41
|
/**
|
|
29
|
-
* `<virtual-list>`'s sticky rows: which
|
|
42
|
+
* `<virtual-list>`'s sticky rows: which hold the leading edge, the style that pins each, the
|
|
30
43
|
* header's pinned style, and, where the host moves views by the scroll on the native side, what
|
|
31
44
|
* native is moving. The list's own share of `stickyIndices` and `stickyHeader`, as `StickyHeaders`
|
|
32
45
|
* is `<scroll-view>`'s.
|
|
33
46
|
*
|
|
47
|
+
* Rows pin at levels, when `virtualListStickyLevel` gives them: a row holds the edge under the
|
|
48
|
+
* rows of the levels further out than its own, and the next row at its level or further out pushes
|
|
49
|
+
* it off. Without levels every sticky row is at level 0, each pushed off by the next.
|
|
50
|
+
*
|
|
34
51
|
* Pinning is not native: RN's `ScrollView.js` translates a sticky child against the scroll offset
|
|
35
52
|
* in JavaScript, and a row here follows the offset the same way while it is the current one, by
|
|
36
53
|
* its `top` when absolutely positioned and by a transform when in flow. Where native can move a
|
|
37
|
-
* view by the scroll, each sticky row instead stays at its own place in the
|
|
38
|
-
* translates it on every frame the list scrolls, as RN's `ScrollViewStickyHeader`
|
|
39
|
-
* translate committed from each scroll event lands a frame or more late, and on a fast
|
|
40
|
-
* row shudders and comes away from the edge.
|
|
54
|
+
* view by the scroll, each sticky row, and a pinned header, instead stays at its own place in the
|
|
55
|
+
* list and native translates it on every frame the list scrolls, as RN's `ScrollViewStickyHeader`
|
|
56
|
+
* does; a translate committed from each scroll event lands a frame or more late, and on a fast
|
|
57
|
+
* fling the row shudders and comes away from the edge.
|
|
41
58
|
*/
|
|
42
59
|
export declare class StickyRows {
|
|
43
|
-
/** Whether native moves sticky rows. */
|
|
60
|
+
/** Whether native moves sticky rows and the pinned header. */
|
|
44
61
|
readonly native: boolean;
|
|
45
|
-
/**
|
|
46
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Where the scroll view is along its axis, header and all: 0 until native says otherwise, since
|
|
64
|
+
* Android sends no scroll event until the list moves.
|
|
65
|
+
*/
|
|
66
|
+
private readonly along;
|
|
67
|
+
/** The leading edge of the viewport in content space, past the header at its current size. */
|
|
47
68
|
readonly offset: Signal<number>;
|
|
48
69
|
private readonly engine;
|
|
49
70
|
private readonly node;
|
|
50
71
|
private readonly list;
|
|
51
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Where the scroll view is once scrolling pauses, header and all, which the settled translate of
|
|
74
|
+
* a native-moved row is from.
|
|
75
|
+
*/
|
|
52
76
|
private readonly settled;
|
|
53
77
|
private settleTimer;
|
|
54
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* What native is moving, by row view: the axis with the transform kept beside the translate,
|
|
80
|
+
* and the range it moves the row by.
|
|
81
|
+
*/
|
|
55
82
|
private readonly drives;
|
|
83
|
+
/**
|
|
84
|
+
* What native moves the header by, once it has been pinned. Kept, moving it nowhere, when it no
|
|
85
|
+
* longer is: native goes on drawing a translate it set after its drive is gone.
|
|
86
|
+
*/
|
|
87
|
+
private headerDrive;
|
|
56
88
|
/** The list scrolled itself, and native has not drawn its sticky rows there yet. */
|
|
57
89
|
private jumped;
|
|
58
90
|
/** Native has reported reaching the target, so this pass's drives are the last to need telling. */
|
|
@@ -65,6 +97,10 @@ export declare class StickyRows {
|
|
|
65
97
|
private reported;
|
|
66
98
|
/** Where native's latest event of all said it was, header and all. */
|
|
67
99
|
private nativeAt;
|
|
100
|
+
/** The axis the list scrolled along when native said so, until then none. */
|
|
101
|
+
private nativeAxis;
|
|
102
|
+
/** No scroll event has come for `STICKY_SETTLE_MS`, so none is on its way to draw a new graph. */
|
|
103
|
+
private resting;
|
|
68
104
|
/**
|
|
69
105
|
* Scroll end events still to come, one for each jump that moved native, as iOS sends one. Kept
|
|
70
106
|
* across jumps: one that landed has its end still to come, and must not be taken for the next's.
|
|
@@ -76,16 +112,30 @@ export declare class StickyRows {
|
|
|
76
112
|
constructor(engine: HostEngine, node: HostNode, list: StickyRowsList);
|
|
77
113
|
/** Whether the scroll offset is needed as a signal, which only pinning needs. */
|
|
78
114
|
private readonly pinning;
|
|
79
|
-
/** Each sticky row, and the one after it, which pushes it off. */
|
|
80
|
-
readonly next: Signal<Map<number, number>>;
|
|
81
115
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
116
|
+
* Each sticky row's level, in list order: the rows of `stickyIndices` at level 0, and with a
|
|
117
|
+
* level function every row it gives one. A sticky index given for rows not there yet pins
|
|
118
|
+
* nothing and pushes nothing off until its row arrives.
|
|
119
|
+
*/
|
|
120
|
+
private readonly levels;
|
|
121
|
+
/** Each sticky row, with the rows it pins under and the one that pushes it off. */
|
|
122
|
+
readonly rows: Signal<Map<number, StickyRow>>;
|
|
123
|
+
/**
|
|
124
|
+
* For each sticky row in list order, the least offset that reaches it or a row after it. Where a
|
|
125
|
+
* row starts to hold never comes before where the row before it does, unless a negative `rowGap`
|
|
126
|
+
* overlaps the rows, and this stays in order either way, so `pinned` can halve over it.
|
|
84
127
|
*/
|
|
85
|
-
readonly
|
|
128
|
+
private readonly reach;
|
|
129
|
+
/**
|
|
130
|
+
* The sticky rows currently holding the leading edge, outermost first: the last one the offset
|
|
131
|
+
* has reached, under the rows it pins under. Empty when the list has scrolled back above the
|
|
132
|
+
* first of them.
|
|
133
|
+
*/
|
|
134
|
+
readonly pinned: Signal<readonly number[]>;
|
|
86
135
|
/**
|
|
87
136
|
* The header's translation while it is pinned: the scroll position, held back at zero by an
|
|
88
|
-
* overscroll and at the first sticky row, which pushes it off.
|
|
137
|
+
* overscroll and at the first sticky row, which pushes it off. Where native moves it, the
|
|
138
|
+
* translate native had reached when scrolling paused, as for a sticky row.
|
|
89
139
|
*/
|
|
90
140
|
readonly headerStyle: Signal<{
|
|
91
141
|
transform: string;
|
|
@@ -97,8 +147,16 @@ export declare class StickyRows {
|
|
|
97
147
|
zIndex: number;
|
|
98
148
|
transform?: undefined;
|
|
99
149
|
} | undefined>;
|
|
100
|
-
/**
|
|
101
|
-
|
|
150
|
+
/**
|
|
151
|
+
* A pinned row in flow, moved by a transform from `at`, where flow put it, to where it holds:
|
|
152
|
+
* under the rows it pins under, until the next row at its level or further out pushes it off.
|
|
153
|
+
*/
|
|
154
|
+
flowStyle(index: number, at: number): Record<string, unknown>;
|
|
155
|
+
/**
|
|
156
|
+
* A pinned row placed by its `top`: under the rows it pins under, until the next row at its
|
|
157
|
+
* level or further out reaches it there and pushes it off.
|
|
158
|
+
*/
|
|
159
|
+
slotStyle(index: number): Record<string, unknown>;
|
|
102
160
|
/**
|
|
103
161
|
* A sticky row native moves: at its own place, with the translate native had reached when
|
|
104
162
|
* scrolling paused, so the props agree with what is on screen.
|
|
@@ -112,8 +170,8 @@ export declare class StickyRows {
|
|
|
112
170
|
recyclingType(index: number, kind: unknown): unknown;
|
|
113
171
|
/** Whether a recycling type is a sticky row's. */
|
|
114
172
|
isType(type: unknown): boolean;
|
|
115
|
-
/** The list scrolled, to `
|
|
116
|
-
scrolled(
|
|
173
|
+
/** The list scrolled, to `along` in the scroll view. */
|
|
174
|
+
scrolled(along: number): void;
|
|
117
175
|
/** The list is scrolling itself, to `to` in the scroll view, where native has not drawn yet. */
|
|
118
176
|
jumping(to: number, animated: boolean): void;
|
|
119
177
|
/** The user took the scroll over: native's own events move the rows from here. */
|
|
@@ -125,17 +183,56 @@ export declare class StickyRows {
|
|
|
125
183
|
*/
|
|
126
184
|
rested(): void;
|
|
127
185
|
/**
|
|
128
|
-
* Hand each rendered sticky row's view to native to move, and let go of the rest
|
|
129
|
-
*
|
|
130
|
-
* drive to make or let go.
|
|
186
|
+
* Hand each rendered sticky row's view to native to move, and let go of the rest, and the
|
|
187
|
+
* header's view, `header`, while it is pinned. `views` are the rendered rows' views in the same
|
|
188
|
+
* order as `rows`. Each is only asked for where there is a drive to make or let go.
|
|
189
|
+
*/
|
|
190
|
+
drive(rows: () => readonly Row[], views: () => readonly HostNode[], header: () => HostNode): void;
|
|
191
|
+
/**
|
|
192
|
+
* Hand the header to native to move while it is pinned, by the scroll view's offset until the
|
|
193
|
+
* first sticky row pushes it off. Unpinned, it is moved nowhere.
|
|
194
|
+
*/
|
|
195
|
+
private driveHeader;
|
|
196
|
+
/**
|
|
197
|
+
* Where native is told the scroll view is for the header's drive, `pinned` and moved by the range
|
|
198
|
+
* `moved`. Pinned, let go, or moved by a new range at rest, native has no new scroll event to draw
|
|
199
|
+
* it from: it is told where it last said it was. Mid-scroll the next event draws it, and what
|
|
200
|
+
* native last said trails it, and what it said along the other axis says nothing of `axis`. After a
|
|
201
|
+
* jump, `from`, where the list scrolled itself.
|
|
202
|
+
*/
|
|
203
|
+
private headerFrom;
|
|
204
|
+
/**
|
|
205
|
+
* Where native is told the scroll view is for a drive made, or moved by a new range, along
|
|
206
|
+
* `axis`. Native draws a graph when the offset changes, and at rest no scroll event comes to draw
|
|
207
|
+
* it: it is told where native last said it was, unless that was along the other axis. Mid-scroll
|
|
208
|
+
* the next event draws it. After a jump, `from`.
|
|
131
209
|
*/
|
|
132
|
-
|
|
210
|
+
private drawnFrom;
|
|
211
|
+
/** How native moves the pinned header. A first sticky row at the very top holds it in place. */
|
|
212
|
+
private headerRange;
|
|
213
|
+
/** How far the header moves before the first sticky row pushes it off: to that row's top. */
|
|
214
|
+
private headerLimit;
|
|
133
215
|
destroy(): void;
|
|
134
|
-
/**
|
|
216
|
+
/** The size of the rows a sticky row pins under, which is how far from the edge it holds. */
|
|
217
|
+
private above;
|
|
218
|
+
/**
|
|
219
|
+
* A deeper row is drawn under the rows it pins under, and every sticky row over the rest. See
|
|
220
|
+
* `FRONT`. Without levels a sticky row's zIndex is 1, as it was before there were any.
|
|
221
|
+
*/
|
|
222
|
+
private zIndexOf;
|
|
223
|
+
/** The offset a sticky row starts to hold from: where its top meets the rows it pins under. */
|
|
224
|
+
private startOf;
|
|
225
|
+
/**
|
|
226
|
+
* The offset a sticky row stops holding at, pushed off by the next: where that row's top meets
|
|
227
|
+
* this row's far edge.
|
|
228
|
+
*/
|
|
135
229
|
private stopOf;
|
|
136
230
|
/**
|
|
137
231
|
* How native moves a rendered row, or null when it does not: along the scroll view's own
|
|
138
|
-
* offset, which counts the header, from the row
|
|
232
|
+
* offset, which counts the header, from where the row meets the rows it pins under until the
|
|
233
|
+
* next sticky row pushes it off. A row the next one follows with no space between them holds
|
|
234
|
+
* nowhere, so native moves it nowhere: it is not let go, since native keeps the translate it
|
|
235
|
+
* had moved a row by.
|
|
139
236
|
*/
|
|
140
237
|
private driveOf;
|
|
141
238
|
}
|