@gjsify/adwaita-core 0.35.0 → 0.37.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/lib/esm/conformance/index.js +1 -1
- package/lib/esm/conformance/shortcut-label.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/shortcut-label.js +1 -0
- package/lib/types/about-dialog.d.ts +92 -98
- package/lib/types/action-row.d.ts +95 -125
- package/lib/types/avatar.d.ts +30 -37
- package/lib/types/banner.d.ts +25 -53
- package/lib/types/breakpoint.d.ts +6 -7
- package/lib/types/button-content.d.ts +41 -80
- package/lib/types/carousel.d.ts +175 -252
- package/lib/types/checks.d.ts +13 -30
- package/lib/types/chrome.d.ts +90 -136
- package/lib/types/color-scheme.d.ts +5 -6
- package/lib/types/conformance/about-dialog.d.ts +64 -91
- package/lib/types/conformance/action-row.d.ts +26 -46
- package/lib/types/conformance/avatar.d.ts +8 -10
- package/lib/types/conformance/banner.d.ts +17 -37
- package/lib/types/conformance/button-content.d.ts +24 -46
- package/lib/types/conformance/carousel.d.ts +35 -75
- package/lib/types/conformance/checks.d.ts +0 -4
- package/lib/types/conformance/chrome.d.ts +28 -36
- package/lib/types/conformance/data-grid.d.ts +28 -47
- package/lib/types/conformance/dialog.d.ts +4 -9
- package/lib/types/conformance/entry-row.d.ts +20 -39
- package/lib/types/conformance/index.d.ts +2 -0
- package/lib/types/conformance/navigation-view.d.ts +0 -4
- package/lib/types/conformance/popover.d.ts +4 -9
- package/lib/types/conformance/preferences.d.ts +15 -28
- package/lib/types/conformance/rows.d.ts +5 -12
- package/lib/types/conformance/shortcut-label.d.ts +34 -0
- package/lib/types/conformance/sidebar.d.ts +28 -49
- package/lib/types/conformance/spinner.d.ts +21 -27
- package/lib/types/conformance/split-button.d.ts +21 -43
- package/lib/types/conformance/split-view.d.ts +29 -36
- package/lib/types/conformance/tab-view.d.ts +32 -73
- package/lib/types/conformance/view-stack.d.ts +0 -12
- package/lib/types/conformance/view-switcher.d.ts +46 -114
- package/lib/types/conformance/wrap-box.d.ts +40 -63
- package/lib/types/data-grid.d.ts +38 -48
- package/lib/types/dialog.d.ts +39 -51
- package/lib/types/easing.d.ts +6 -12
- package/lib/types/entry-row.d.ts +94 -123
- package/lib/types/glib.d.ts +17 -25
- package/lib/types/index.d.ts +2 -0
- package/lib/types/length-unit.d.ts +7 -12
- package/lib/types/navigation-view.d.ts +62 -68
- package/lib/types/popover.d.ts +39 -66
- package/lib/types/preferences.d.ts +83 -100
- package/lib/types/rows.d.ts +45 -63
- package/lib/types/shortcut-label.d.ts +79 -0
- package/lib/types/shortcut-label.spec.d.ts +2 -0
- package/lib/types/sidebar.d.ts +95 -121
- package/lib/types/spinner.d.ts +39 -61
- package/lib/types/split-button.d.ts +78 -134
- package/lib/types/split-view.d.ts +74 -89
- package/lib/types/tab-view.d.ts +174 -256
- package/lib/types/view-stack.d.ts +87 -129
- package/lib/types/view-switcher.d.ts +126 -211
- package/lib/types/wrap-box.d.ts +62 -123
- package/package.json +3 -3
|
@@ -3,12 +3,12 @@ export interface AdwNavigationPageProps {
|
|
|
3
3
|
/**
|
|
4
4
|
* `AdwNavigationPage:tag` — unique within one view, or `null` for untagged.
|
|
5
5
|
* `''` is a legal tag: the C tag table is a plain `g_str_hash` table and only
|
|
6
|
-
* a NULL tag is skipped (add_page
|
|
6
|
+
* a NULL tag is skipped (add_page).
|
|
7
7
|
*/
|
|
8
8
|
tag?: string | null;
|
|
9
|
-
/** `AdwNavigationPage:title` — defaults to `''`, never null (adw_navigation_page_init
|
|
9
|
+
/** `AdwNavigationPage:title` — defaults to `''`, never null (adw_navigation_page_init). */
|
|
10
10
|
title?: string;
|
|
11
|
-
/** `AdwNavigationPage:can-pop` — defaults to `true` (adw_navigation_page_init
|
|
11
|
+
/** `AdwNavigationPage:can-pop` — defaults to `true` (adw_navigation_page_init). */
|
|
12
12
|
canPop?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -16,7 +16,7 @@ export interface AdwNavigationPageProps {
|
|
|
16
16
|
* them without re-deriving the cause: `'add'`/`'push'` → `::pushed`, `'pop'` →
|
|
17
17
|
* one `::popped` per entry in {@link NavigationStackChange.popped}, `'replace'` →
|
|
18
18
|
* `::replaced`. `'add'` is split out from `'push'` only because it is the
|
|
19
|
-
* auto-push add_page
|
|
19
|
+
* auto-push add_page performs, which is never animated.
|
|
20
20
|
*/
|
|
21
21
|
export type NavigationChangeReason = 'add' | 'push' | 'pop' | 'replace';
|
|
22
22
|
/** One stack mutation, as a single payload. */
|
|
@@ -31,14 +31,14 @@ export interface NavigationStackChange<P> {
|
|
|
31
31
|
* The page that was visible before this mutation. `previousVisiblePage !==
|
|
32
32
|
* visiblePage` is exactly the condition under which libadwaita notifies
|
|
33
33
|
* `visible-page` — including the `replace()` corner where the old visible
|
|
34
|
-
* page was destroyed rather than switched away from (replace
|
|
34
|
+
* page was destroyed rather than switched away from (replace).
|
|
35
35
|
*/
|
|
36
36
|
previousVisiblePage: P | null;
|
|
37
37
|
/** Why the stack moved. */
|
|
38
38
|
reason: NavigationChangeReason;
|
|
39
39
|
/**
|
|
40
40
|
* The popped pages, TOP-FIRST — `::popped` is emitted in this order.
|
|
41
|
-
* pop_from_stack
|
|
41
|
+
* pop_from_stack builds the list with `g_slist_prepend` while walking
|
|
42
42
|
* bottom-up, then iterates it forward. Always empty unless `reason` is `'pop'`.
|
|
43
43
|
*/
|
|
44
44
|
popped: readonly P[];
|
|
@@ -46,20 +46,20 @@ export interface NavigationStackChange<P> {
|
|
|
46
46
|
removed: readonly P[];
|
|
47
47
|
/**
|
|
48
48
|
* The outgoing visible page, destroyed only once the transition finishes
|
|
49
|
-
* (pop_from_stack
|
|
49
|
+
* (pop_from_stack skips it; transition_done_cb does it). The
|
|
50
50
|
* renderer hands it back by calling {@link NavigationViewState.finishTransition}.
|
|
51
51
|
*/
|
|
52
52
|
removeAfterTransition: P | null;
|
|
53
53
|
/**
|
|
54
|
-
* Whether this transition animates. `false` for the auto-push (add_page
|
|
55
|
-
* for every `replace()` (replace
|
|
56
|
-
* to slide away from (switch_page
|
|
54
|
+
* Whether this transition animates. `false` for the auto-push (add_page),
|
|
55
|
+
* for every `replace()` (replace), and whenever there is no outgoing page
|
|
56
|
+
* to slide away from (switch_page).
|
|
57
57
|
*/
|
|
58
58
|
animate: boolean;
|
|
59
59
|
/** Transition direction: `true` when the new page comes from BELOW (pop/replace). */
|
|
60
60
|
pop: boolean;
|
|
61
61
|
/**
|
|
62
|
-
* Whether `visible-page-tag` re-notifies: switch_page
|
|
62
|
+
* Whether `visible-page-tag` re-notifies: switch_page notifies only
|
|
63
63
|
* when the outgoing OR the incoming page carries a tag.
|
|
64
64
|
*/
|
|
65
65
|
tagNotify: boolean;
|
|
@@ -93,14 +93,14 @@ export type NavigationPagePropsResolver<P> = (page: P) => AdwNavigationPageProps
|
|
|
93
93
|
* What a shortcut handler must do with the key event. `'stop'` is
|
|
94
94
|
* `GDK_EVENT_STOP` — notably also returned WITHOUT popping when the visible page
|
|
95
95
|
* has `can-pop = FALSE`, so the key is not forwarded to an enclosing navigation
|
|
96
|
-
* view (pop_shortcut_cb
|
|
96
|
+
* view (pop_shortcut_cb).
|
|
97
97
|
*/
|
|
98
98
|
export type NavigationShortcutResult = 'stop' | 'propagate';
|
|
99
99
|
/** Construction defaults + the diagnostic seam. */
|
|
100
100
|
export interface NavigationViewOptions {
|
|
101
|
-
/** `AdwNavigationView:animate-transitions`, default `true` (init
|
|
101
|
+
/** `AdwNavigationView:animate-transitions`, default `true` (init). */
|
|
102
102
|
animateTransitions?: boolean;
|
|
103
|
-
/** `AdwNavigationView:pop-on-escape`, default `true` (init
|
|
103
|
+
/** `AdwNavigationView:pop-on-escape`, default `true` (init). */
|
|
104
104
|
popOnEscape?: boolean;
|
|
105
105
|
/** Where rejected mutations are reported. Unset = silent. */
|
|
106
106
|
onDiagnostic?: NavigationDiagnosticListener;
|
|
@@ -136,9 +136,9 @@ export declare class NavigationViewState<P = unknown> {
|
|
|
136
136
|
get depth(): number;
|
|
137
137
|
/** Every registered page (static + dynamically pushed), in registration order. */
|
|
138
138
|
get pages(): readonly P[];
|
|
139
|
-
/** The top of the stack, or `null` when the stack is empty (get_visible_page
|
|
139
|
+
/** The top of the stack, or `null` when the stack is empty (get_visible_page). */
|
|
140
140
|
get visiblePage(): P | null;
|
|
141
|
-
/** The visible page's tag, or `null` — never `''` for an untagged page (get_visible_page_tag
|
|
141
|
+
/** The visible page's tag, or `null` — never `''` for an untagged page (get_visible_page_tag). */
|
|
142
142
|
get visiblePageTag(): string | null;
|
|
143
143
|
/** Whether push/pop transitions animate. */
|
|
144
144
|
get animateTransitions(): boolean;
|
|
@@ -161,89 +161,85 @@ export declare class NavigationViewState<P = unknown> {
|
|
|
161
161
|
/** `page`'s `can-pop`. `true` for an unregistered page, matching the property default. */
|
|
162
162
|
canPopOf(page: P): boolean;
|
|
163
163
|
/**
|
|
164
|
-
* The page with this tag, or `null` (find_page
|
|
164
|
+
* The page with this tag, or `null` (find_page).
|
|
165
165
|
*
|
|
166
166
|
* Byte-exact: the C table is `g_str_hash`/`g_str_equal`, so NFC and NFD
|
|
167
167
|
* spellings of the same word are DIFFERENT keys and `''` is a valid one.
|
|
168
168
|
* Dynamically-pushed pages are found too — `maybe_add_page` routes through
|
|
169
|
-
* `add_page`, which indexes the tag
|
|
169
|
+
* `add_page`, which indexes the tag.
|
|
170
170
|
*/
|
|
171
171
|
findPage(tag: string): P | null;
|
|
172
172
|
/**
|
|
173
|
-
* The page popping `page` would reveal (get_previous_page
|
|
173
|
+
* The page popping `page` would reveal (get_previous_page) — `null` when
|
|
174
174
|
* `page` is the root page or is not on the stack.
|
|
175
175
|
*/
|
|
176
176
|
getPreviousPage(page: P): P | null;
|
|
177
177
|
/**
|
|
178
|
-
* Permanently add `page` (adw_navigation_view_add
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* move and no change is emitted.
|
|
185
|
-
* 2. The auto-push fires whenever the stack is EMPTY, not only for the very
|
|
186
|
-
* first page ever added (add_page:1284) — so `add()` after `replace([])`
|
|
187
|
-
* pushes again.
|
|
178
|
+
* Permanently add `page` (`adw_navigation_view_add`); a page added this way survives
|
|
179
|
+
* being popped. Two easily-missed rules:
|
|
180
|
+
* 1. adding a page that is on the stack as a DYNAMIC page converts it to a permanent
|
|
181
|
+
* one and does nothing else — the stack does not move and nothing is emitted;
|
|
182
|
+
* 2. the auto-push fires whenever the stack is EMPTY, not only for the first page
|
|
183
|
+
* ever added, so `add()` after `replace([])` pushes again.
|
|
188
184
|
*
|
|
189
185
|
* Returns `false` (with a `duplicate-tag` diagnostic) when the tag collides.
|
|
190
186
|
*/
|
|
191
187
|
add(page: P, props?: AdwNavigationPageProps): boolean;
|
|
192
188
|
/**
|
|
193
|
-
* Remove `page` (adw_navigation_view_remove
|
|
189
|
+
* Remove `page` (adw_navigation_view_remove → remove_page).
|
|
194
190
|
*
|
|
195
191
|
* If the page is on the stack the removal is DEFERRED: the page is marked
|
|
196
|
-
* remove-on-pop and destroyed when it is popped
|
|
192
|
+
* remove-on-pop and destroyed when it is popped. Otherwise it is
|
|
197
193
|
* unregistered immediately and its tag freed. Returns `false` only for a page
|
|
198
194
|
* this view does not know.
|
|
199
195
|
*/
|
|
200
196
|
remove(page: P): boolean;
|
|
201
197
|
/**
|
|
202
|
-
* Set `page`'s tag (adw_navigation_page_set_tag
|
|
203
|
-
* unchanged
|
|
204
|
-
* owns the tag, in which case the OLD tag is kept
|
|
198
|
+
* Set `page`'s tag (adw_navigation_page_set_tag). Silent no-op when
|
|
199
|
+
* unchanged; rejected with `duplicate-tag` when another page already
|
|
200
|
+
* owns the tag, in which case the OLD tag is kept.
|
|
205
201
|
*/
|
|
206
202
|
setTag(page: P, tag: string | null): boolean;
|
|
207
203
|
/**
|
|
208
|
-
* Set `page`'s title (adw_navigation_page_set_title
|
|
204
|
+
* Set `page`'s title (adw_navigation_page_set_title). Drives the header-bar
|
|
209
205
|
* title and the NEXT page's back-button tooltip. `null`/`undefined` is rejected
|
|
210
|
-
* — the C has `g_return_if_fail (title != NULL)
|
|
206
|
+
* — the C has `g_return_if_fail (title != NULL)`.
|
|
211
207
|
*/
|
|
212
208
|
setTitle(page: P, title: string): boolean;
|
|
213
209
|
/**
|
|
214
|
-
* Set `page`'s `can-pop` (adw_navigation_page_set_can_pop
|
|
210
|
+
* Set `page`'s `can-pop` (adw_navigation_page_set_can_pop). Gates
|
|
215
211
|
* shortcuts, gestures and the back button — deliberately NOT {@link pop}.
|
|
216
212
|
*/
|
|
217
213
|
setCanPop(page: P, canPop: boolean): boolean;
|
|
218
214
|
/**
|
|
219
|
-
* Push `page` onto the stack (adw_navigation_view_push
|
|
215
|
+
* Push `page` onto the stack (adw_navigation_view_push).
|
|
220
216
|
*
|
|
221
217
|
* A page the view has never seen is registered as DYNAMIC (destroyed when
|
|
222
|
-
* popped, maybe_add_page
|
|
223
|
-
* permanence, because maybe_add_page returns early for it
|
|
218
|
+
* popped, maybe_add_page); an already-registered one keeps its
|
|
219
|
+
* permanence, because maybe_add_page returns early for it. That
|
|
224
220
|
* asymmetry is why a static page survives a push/pop round trip.
|
|
225
221
|
*
|
|
226
222
|
* Returns `false` with `already-in-stack` when the page is already on the
|
|
227
|
-
* stack (push_to_stack
|
|
223
|
+
* stack (push_to_stack), or with `duplicate-tag` when its tag collides.
|
|
228
224
|
*/
|
|
229
225
|
push(page: P, props?: AdwNavigationPageProps): boolean;
|
|
230
226
|
/**
|
|
231
|
-
* Push the page carrying `tag` (adw_navigation_view_push_by_tag
|
|
227
|
+
* Push the page carrying `tag` (adw_navigation_view_push_by_tag). An
|
|
232
228
|
* unknown tag is rejected with `tag-not-found` and changes nothing.
|
|
233
229
|
*/
|
|
234
230
|
pushByTag(tag: string): boolean;
|
|
235
231
|
/**
|
|
236
|
-
* Pop the visible page (adw_navigation_view_pop
|
|
232
|
+
* Pop the visible page (adw_navigation_view_pop). `false` when there is
|
|
237
233
|
* no visible page or no page beneath it.
|
|
238
234
|
*
|
|
239
235
|
* Deliberately IGNORES `can-pop`: the C function contains no such test and the
|
|
240
236
|
* property docs say so in as many words — "Manually calling
|
|
241
|
-
* [method@NavigationView.pop] […] will still work"
|
|
237
|
+
* [method@NavigationView.pop] […] will still work". Use
|
|
242
238
|
* {@link popFromShortcut} for the gated path.
|
|
243
239
|
*/
|
|
244
240
|
pop(): boolean;
|
|
245
241
|
/**
|
|
246
|
-
* Pop until `page` is visible (adw_navigation_view_pop_to_page
|
|
242
|
+
* Pop until `page` is visible (adw_navigation_view_pop_to_page) — ONE
|
|
247
243
|
* atomic splice, so ONE visible-page notification carrying every popped page,
|
|
248
244
|
* not N sequential pops. Ignores `can-pop` on the pages it passes.
|
|
249
245
|
*
|
|
@@ -252,18 +248,18 @@ export declare class NavigationViewState<P = unknown> {
|
|
|
252
248
|
*/
|
|
253
249
|
popToPage(page: P): boolean;
|
|
254
250
|
/**
|
|
255
|
-
* Pop until the page carrying `tag` is visible (adw_navigation_view_pop_to_tag
|
|
251
|
+
* Pop until the page carrying `tag` is visible (adw_navigation_view_pop_to_tag).
|
|
256
252
|
* An unknown tag yields `tag-not-found`; a known but off-stack one yields
|
|
257
253
|
* `not-in-stack`.
|
|
258
254
|
*/
|
|
259
255
|
popToTag(tag: string): boolean;
|
|
260
256
|
/**
|
|
261
|
-
* Replace the whole stack (adw_navigation_view_replace
|
|
262
|
-
*
|
|
257
|
+
* Replace the whole stack (adw_navigation_view_replace). Never animates
|
|
258
|
+
* and emits no `popped` — `::replaced` is its own signal.
|
|
263
259
|
*
|
|
264
|
-
* `null` entries are skipped
|
|
265
|
-
* rejected on its second occurrence
|
|
266
|
-
* destroyed only when they are absent from the new set
|
|
260
|
+
* `null` entries are skipped and a page listed twice is
|
|
261
|
+
* rejected on its second occurrence. Old DYNAMIC pages are
|
|
262
|
+
* destroyed only when they are absent from the new set; that
|
|
267
263
|
* guard is what makes replacing the stack with the tag of a pushed page work.
|
|
268
264
|
* An empty array leaves no visible page.
|
|
269
265
|
*
|
|
@@ -272,16 +268,14 @@ export declare class NavigationViewState<P = unknown> {
|
|
|
272
268
|
replace(pages: readonly (P | null)[], props?: NavigationPagePropsResolver<P>): void;
|
|
273
269
|
/**
|
|
274
270
|
* Replace the stack with the pages carrying `tags`
|
|
275
|
-
* (adw_navigation_view_replace_with_tags
|
|
271
|
+
* (adw_navigation_view_replace_with_tags).
|
|
276
272
|
*
|
|
277
|
-
* Every tag is resolved BEFORE any mutation; an unknown one reports
|
|
278
|
-
*
|
|
279
|
-
* than aborting the call. Resolving up front is exactly what the web port's
|
|
280
|
-
* `replace()` failed to do.
|
|
273
|
+
* Every tag is resolved BEFORE any mutation; an unknown one reports `tag-not-found`
|
|
274
|
+
* and becomes a null slot {@link replace} then skips, rather than aborting the call.
|
|
281
275
|
*/
|
|
282
276
|
replaceWithTags(tags: readonly string[]): void;
|
|
283
277
|
/**
|
|
284
|
-
* Report that the outgoing transition finished (transition_done_cb
|
|
278
|
+
* Report that the outgoing transition finished (transition_done_cb),
|
|
285
279
|
* and receive the pages the renderer must now destroy.
|
|
286
280
|
*
|
|
287
281
|
* This is the injected timing seam replacing `AdwAnimation`'s "done" callback.
|
|
@@ -289,52 +283,52 @@ export declare class NavigationViewState<P = unknown> {
|
|
|
289
283
|
* is precisely what `adw_animation_skip` does in the C when `animate` is FALSE.
|
|
290
284
|
* A page pushed back onto the stack before the transition finished survives,
|
|
291
285
|
* because the C routes this through `adw_navigation_view_remove` and its
|
|
292
|
-
* on-the-stack check (:1042 → remove_page
|
|
286
|
+
* on-the-stack check (:1042 → remove_page).
|
|
293
287
|
*/
|
|
294
288
|
finishTransition(): readonly P[];
|
|
295
289
|
/**
|
|
296
290
|
* Whether the automatic back button is shown — `get_previous_page(visible) !==
|
|
297
|
-
* null && can_pop(visible)` (adw-back-button.c update_page
|
|
291
|
+
* null && can_pop(visible)` (adw-back-button.c update_page). This is the
|
|
298
292
|
* ONLY place `can-pop` decides whether a page can be left.
|
|
299
293
|
*/
|
|
300
294
|
canGoBack(): boolean;
|
|
301
295
|
/**
|
|
302
296
|
* The back button's tooltip: the title of the page the button would reveal,
|
|
303
297
|
* falling back to `fallback` only when that title is empty
|
|
304
|
-
* (adw-back-button.c query_tooltip
|
|
298
|
+
* (adw-back-button.c query_tooltip). `null` when there is no back
|
|
305
299
|
* button at all.
|
|
306
300
|
*/
|
|
307
301
|
backButtonTooltip(fallback?: string): string | null;
|
|
308
302
|
/**
|
|
309
303
|
* The `can-pop`-aware pop behind Alt+Left and the back mouse button
|
|
310
|
-
* (pop_shortcut_cb
|
|
304
|
+
* (pop_shortcut_cb).
|
|
311
305
|
*
|
|
312
306
|
* Returns `'stop'` WITHOUT popping when the visible page has `can-pop = FALSE`
|
|
313
307
|
* — deliberately, so the key is not forwarded to an enclosing navigation view.
|
|
314
308
|
*/
|
|
315
309
|
popFromShortcut(): NavigationShortcutResult;
|
|
316
|
-
/** Escape-to-pop: {@link popFromShortcut} gated on `pop-on-escape` (escape_shortcut_cb
|
|
310
|
+
/** Escape-to-pop: {@link popFromShortcut} gated on `pop-on-escape` (escape_shortcut_cb). */
|
|
317
311
|
popFromEscape(): NavigationShortcutResult;
|
|
318
312
|
private _diagnose;
|
|
319
313
|
private _emit;
|
|
320
314
|
private _emitChange;
|
|
321
|
-
/** `add_page`
|
|
315
|
+
/** `add_page` — register, index the tag, and auto-push into an empty stack. */
|
|
322
316
|
private _addPage;
|
|
323
|
-
/** `maybe_add_page`
|
|
317
|
+
/** `maybe_add_page` — register an unknown page as DYNAMIC; keep a known one as it is. */
|
|
324
318
|
private _maybeAddPage;
|
|
325
|
-
/** `push_to_stack`
|
|
319
|
+
/** `push_to_stack` — the append plus its already-in-stack guard. */
|
|
326
320
|
private _pushToStack;
|
|
327
|
-
/** `pop_from_stack`
|
|
321
|
+
/** `pop_from_stack` — one splice, one switch, then the per-page destroys. */
|
|
328
322
|
private _popFromStack;
|
|
329
323
|
/**
|
|
330
|
-
* `switch_page
|
|
324
|
+
* `switch_page`, minus the rendering: flush a still-pending deferred
|
|
331
325
|
* destroy, decide whether this transition animates, and queue the new one.
|
|
332
326
|
*/
|
|
333
327
|
private _beginSwitch;
|
|
334
328
|
/**
|
|
335
329
|
* Settle the deferred destroy owed by the last pop — the shared body of
|
|
336
330
|
* {@link finishTransition} and the mid-transition flush in {@link _beginSwitch}.
|
|
337
|
-
* Both go through `adw_navigation_view_remove` in the C
|
|
331
|
+
* Both go through `adw_navigation_view_remove` in the C, so both
|
|
338
332
|
* inherit `remove_page`'s on-the-stack check: a page pushed BACK before the
|
|
339
333
|
* transition ended survives and is merely re-marked remove-on-pop.
|
|
340
334
|
*/
|
package/lib/types/popover.d.ts
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Padding inside a popover's content box, in px — `popover > contents { padding: 8px }
|
|
3
|
-
* (_popovers.scss:14).
|
|
2
|
+
* Padding inside a popover's content box, in px — `popover > contents { padding: 8px }`.
|
|
4
3
|
*
|
|
5
|
-
* NOT what a MENU popover uses: `popover.menu > contents` re-declares
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* decided by the `.menu` class, not by this constant. See {@link POPOVER_MENU_PADDING}.
|
|
4
|
+
* NOT what a MENU popover uses: `popover.menu > contents` re-declares `padding: 0` and
|
|
5
|
+
* moves the inset onto the item box as `$menu_margin` (6px) — two element selectors
|
|
6
|
+
* plus a class, so it wins over the plain `popover > contents`. Both numbers are real;
|
|
7
|
+
* the `.menu` class decides which applies. See {@link POPOVER_MENU_PADDING}.
|
|
10
8
|
*/
|
|
11
9
|
export declare const POPOVER_PADDING = 8;
|
|
12
10
|
/**
|
|
13
|
-
* Padding around the item box of a MENU popover, in px — `$menu_margin
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* This is the number the three hand-rolled copies actually used (`--spacing-xs`,
|
|
18
|
-
* 6px). They were not wrong about the inset — they were wrong about the radius,
|
|
19
|
-
* and one of them about the shadow.
|
|
11
|
+
* Padding around the item box of a MENU popover, in px — `$menu_margin`, applied by
|
|
12
|
+
* `popover.menu > contents > … > stack > box` after that same rule zeroes the contents
|
|
13
|
+
* padding.
|
|
20
14
|
*/
|
|
21
15
|
export declare const POPOVER_MENU_PADDING = 6;
|
|
22
16
|
/**
|
|
23
17
|
* Corner radius of a popover surface, in px — `$popover_radius`, defined as
|
|
24
|
-
* `$menu_radius + 6` = `9 + 6` (
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* All three copies got this wrong: two used `--card-radius` (12px, `$card_radius`)
|
|
28
|
-
* and one `--button-radius` (9px, `$button_radius`).
|
|
18
|
+
* `$menu_radius + 6` = `9 + 6`. Not `$card_radius` (12px) and not `$button_radius`
|
|
19
|
+
* (9px), the two values a hand-rolled popover reaches for.
|
|
29
20
|
*/
|
|
30
21
|
export declare const POPOVER_RADIUS = 15;
|
|
31
|
-
/**
|
|
32
|
-
* Corner radius of a menu item row, in px — `$menu_radius` (_common.scss:10),
|
|
33
|
-
* applied by `modelbutton` at _menus.scss:138.
|
|
34
|
-
*/
|
|
22
|
+
/** Corner radius of a menu item row, in px — `$menu_radius`, applied by `modelbutton`. */
|
|
35
23
|
export declare const POPOVER_ITEM_RADIUS = 9;
|
|
36
24
|
/** Payload of a {@link PopoverState} change. */
|
|
37
25
|
export interface PopoverStateChange {
|
|
@@ -47,18 +35,15 @@ export interface PopoverStateChange {
|
|
|
47
35
|
/** Subscriber for {@link PopoverState} changes. */
|
|
48
36
|
export type PopoverStateListener = (change: PopoverStateChange) => void;
|
|
49
37
|
/**
|
|
50
|
-
* The open/closed state of a popover, with the programmatic-vs-interactive
|
|
51
|
-
*
|
|
52
|
-
* {@link SplitButtonState}): a renderer re-emits `notify::*` only for the
|
|
53
|
-
*
|
|
54
|
-
* user click.
|
|
38
|
+
* The open/closed state of a popover, with the programmatic-vs-interactive distinction
|
|
39
|
+
* the other core states carry ({@link ComboState}, {@link SpinState},
|
|
40
|
+
* {@link SplitButtonState}): a renderer re-emits `notify::*` only for the interactive
|
|
41
|
+
* changes, so an application calling `popup()` does not look like a user click.
|
|
55
42
|
*
|
|
56
|
-
* NAMING:
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `<adw-popover>` element exposes. `SplitButtonState` resolved the same clash
|
|
61
|
-
* as `openMenu()`/`closeMenu()`.
|
|
43
|
+
* NAMING: an `open` GETTER means the mutators cannot also be `open()`/`close()`, so
|
|
44
|
+
* they take GTK's vocabulary ({@link popup} / {@link popdown}, after
|
|
45
|
+
* `adw_split_button_popup()` / `..._popdown()`) — which is what `<adw-popover>`
|
|
46
|
+
* exposes too.
|
|
62
47
|
*
|
|
63
48
|
* Idempotent: setting the current value again is a no-op and notifies nobody.
|
|
64
49
|
*/
|
|
@@ -78,9 +63,9 @@ export declare class PopoverState {
|
|
|
78
63
|
/** The anchor was activated by the user; flips open/closed. Returns whether it changed. */
|
|
79
64
|
toggle(): boolean;
|
|
80
65
|
/**
|
|
81
|
-
* The user dismissed the popover — an outside click, or Escape. Distinct
|
|
82
|
-
*
|
|
83
|
-
*
|
|
66
|
+
* The user dismissed the popover — an outside click, or Escape. Distinct from
|
|
67
|
+
* {@link popdown} only in the `interactive` flag: a dismissal is a gesture, a
|
|
68
|
+
* `popdown()` call is not.
|
|
84
69
|
*/
|
|
85
70
|
dismiss(): boolean;
|
|
86
71
|
}
|
|
@@ -113,43 +98,31 @@ export interface PopoverKeyContext {
|
|
|
113
98
|
}
|
|
114
99
|
/** {@link resolvePopoverKey}'s answer. */
|
|
115
100
|
export interface PopoverKeyResolution {
|
|
116
|
-
/** What to do. */
|
|
117
101
|
action: PopoverKeyAction;
|
|
118
102
|
/** Item index for `focus`/`activate`; `-1` for `close` and `none`. */
|
|
119
103
|
index: number;
|
|
120
104
|
}
|
|
121
105
|
/**
|
|
122
|
-
* Resolve a key press inside an open popover to a focus/activation move
|
|
123
|
-
*
|
|
124
|
-
* This is the `(current ± 1 + n) % n` arithmetic `adw-menu-button` and
|
|
125
|
-
* `adw-drop-down` each spelled out, reconciled. Where the two copies differed:
|
|
106
|
+
* Resolve a key press inside an open popover to a focus/activation move — the
|
|
107
|
+
* `(current ± 1 + n) % n` arithmetic, with three decisions a reader cannot see in it:
|
|
126
108
|
*
|
|
127
|
-
* - **`ArrowUp` from no focus
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* `preventDefault()` and then `.click()` activates exactly once, where relying
|
|
137
|
-
* on the native path makes the behaviour depend on the item's tag.
|
|
138
|
-
* - **`Home`/`End` with a search entry focused.** The drop-down stole them
|
|
139
|
-
* unconditionally, so Home could not move the caret to the start of the query
|
|
140
|
-
* the user was typing. `'none'` here while `hasSearch && currentIndex < 0`.
|
|
141
|
-
* - The `+ n` in `(current + 1 + n) % n` is defensive only — for `current` in
|
|
142
|
-
* `[-1, n)` it is arithmetically identical to `(current + 1) % n`. Not a
|
|
143
|
-
* divergence, just two spellings.
|
|
109
|
+
* - **`ArrowUp` from no focus** goes to `n - 1`, not to `(-1 - 1 + n) % n` = `n - 2`.
|
|
110
|
+
* Entering the list at the END is the ARIA menu/listbox convention and the mirror of
|
|
111
|
+
* ArrowDown → `0`; the second-to-last item is what the naive modulo gives.
|
|
112
|
+
* - **`Enter`/`Space`** report `'activate'` rather than leaning on the browser
|
|
113
|
+
* activating a focused `<button>` natively: a renderer that calls
|
|
114
|
+
* `preventDefault()` then `.click()` activates exactly once, where the native path
|
|
115
|
+
* makes the behaviour depend on the item's tag.
|
|
116
|
+
* - **`Home`/`End`** are `'none'` while `hasSearch && currentIndex < 0`, so Home moves
|
|
117
|
+
* the caret to the start of the query the user is typing.
|
|
144
118
|
*
|
|
145
119
|
* NOT VERIFIABLE IN THIS TREE: `refs/gtk` is empty and libadwaita vendors no
|
|
146
|
-
* `adw-popover.c`, so `GtkPopover`'s own `position
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* copies against the ARIA patterns, not a claim about GTK's C.
|
|
120
|
+
* `adw-popover.c`, so `GtkPopover`'s own `position`/`autohide`/`has-arrow` semantics
|
|
121
|
+
* and GTK's keynav from an unfocused list cannot be read from source. The wrap
|
|
122
|
+
* arithmetic is reconciled against the ARIA patterns, not a claim about GTK's C.
|
|
150
123
|
*
|
|
151
|
-
* `Tab` is deliberately unhandled (`'none'`): GTK popovers trap focus, and doing
|
|
152
|
-
*
|
|
153
|
-
*
|
|
124
|
+
* `Tab` is deliberately unhandled (`'none'`): GTK popovers trap focus, and doing that
|
|
125
|
+
* in the DOM is a renderer concern (`inert`, a focus sentinel) with no portable
|
|
126
|
+
* arithmetic to share.
|
|
154
127
|
*/
|
|
155
128
|
export declare function resolvePopoverKey(key: string, context: PopoverKeyContext): PopoverKeyResolution;
|