@gjsify/adwaita-core 0.36.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
package/lib/types/data-grid.d.ts
CHANGED
|
@@ -33,12 +33,10 @@ export interface AdwDataGridRow {
|
|
|
33
33
|
[key: string]: AdwDataGridCellValue;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* One column track, in renderer-neutral terms.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* whose meaning is the stylesheet's. A renderer without a CSS engine parses what
|
|
41
|
-
* it understands and falls back — see the NativeScript sibling for that call.
|
|
36
|
+
* One column track, in renderer-neutral terms. `fixed` carries the author's CSS length
|
|
37
|
+
* UNPARSED, because only a browser can resolve every unit CSS has: it is the one track
|
|
38
|
+
* kind whose meaning is the stylesheet's. A renderer without a CSS engine parses what it
|
|
39
|
+
* understands and falls back.
|
|
42
40
|
*/
|
|
43
41
|
export type DataGridTrack =
|
|
44
42
|
/** A pinned track: the `width` string exactly as the column declared it. */
|
|
@@ -66,56 +64,51 @@ export declare const DATA_GRID_ROW_CLASS = "adw-data-grid-row";
|
|
|
66
64
|
/**
|
|
67
65
|
* The column tracks derived from the column descriptors.
|
|
68
66
|
*
|
|
69
|
-
* `width` pins a track and `flex` weights one, each on its own column. The
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* One declared size anywhere turns the rule off for every column, so a caller
|
|
77
|
-
* pinning a single column does not silently keep an implicit flexible one.
|
|
67
|
+
* `width` pins a track and `flex` weights one, each on its own column. The third rule is
|
|
68
|
+
* GLOBAL, not per column: when NOTHING declares a size anywhere, the FIRST column absorbs
|
|
69
|
+
* the slack and every other column sizes to its content — the statement shape, one label
|
|
70
|
+
* column taking what is left and trailing figures hugging the right edge. One declared
|
|
71
|
+
* size anywhere turns the rule off for every column, so pinning a single column does not
|
|
72
|
+
* silently keep an implicit flexible one.
|
|
78
73
|
*/
|
|
79
74
|
export declare function dataGridTracks(columns: ReadonlyArray<AdwDataGridColumn>): DataGridTrack[];
|
|
80
75
|
/**
|
|
81
76
|
* The CSS `grid-template-columns` value for a track list — the browser mapping.
|
|
82
77
|
*
|
|
83
|
-
* The slack track is `minmax(0px, 1fr)` rather than `1fr` so a long cell cannot
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* form, and a bare `0` does not round-trip through `style.gridTemplateColumns`.
|
|
78
|
+
* The slack track is `minmax(0px, 1fr)` rather than `1fr` so a long cell cannot push the
|
|
79
|
+
* column past its share (`1fr` floors at the content's min-content size); `0px` carries
|
|
80
|
+
* its unit because a bare `0` does not round-trip through `style.gridTemplateColumns`.
|
|
87
81
|
*/
|
|
88
82
|
export declare function dataGridTrackTemplate(tracks: ReadonlyArray<DataGridTrack>): string;
|
|
89
83
|
/**
|
|
90
|
-
* A column's effective alignment: its own `align`, or `end` when it is numeric.
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* does not end on a common right edge is a boxed list with extra steps.
|
|
84
|
+
* A column's effective alignment: its own `align`, or `end` when it is numeric. The
|
|
85
|
+
* numeric default is the widget's reason to exist — a column of figures that does not end
|
|
86
|
+
* on a common right edge is a boxed list with extra steps.
|
|
94
87
|
*/
|
|
95
88
|
export declare function dataGridColumnAlign(column: AdwDataGridColumn): AdwDataGridAlign;
|
|
96
89
|
/**
|
|
97
|
-
* The classes a column's cells carry: the base cell class, the alignment, and
|
|
98
|
-
*
|
|
90
|
+
* The classes a column's cells carry: the base cell class, the alignment, and the two
|
|
91
|
+
* typographic opt-ins.
|
|
99
92
|
*
|
|
100
|
-
* `numeric`
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
93
|
+
* `numeric` IS libadwaita's own label class (`font-variant-numeric: tabular-nums`);
|
|
94
|
+
* `mono` is this widget's cell class, which `@extend`s upstream's `.monospace` on top of
|
|
95
|
+
* the tabular figures. A renderer whose stylesheet cannot express the font feature still
|
|
96
|
+
* gets the alignment, which is the half that survives.
|
|
104
97
|
*
|
|
105
|
-
* `align` is NOT clamped to {@link AdwDataGridAlign}
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
98
|
+
* `align` is NOT clamped to {@link AdwDataGridAlign}, so a value outside the union
|
|
99
|
+
* produces a class no stylesheet claims and the cell falls back to the base rule —
|
|
100
|
+
* deliberate asymmetry with {@link normalizeDataGridVariant}: a bogus variant would pick
|
|
101
|
+
* an EMPHASIS (a bold total rule where none belongs), a bogus alignment only fails to
|
|
102
|
+
* move text.
|
|
110
103
|
*/
|
|
111
104
|
export declare function dataGridColumnClasses(column: AdwDataGridColumn): string[];
|
|
112
105
|
/**
|
|
113
106
|
* Coerce a cell value to display text — pre-formatted strings pass through.
|
|
114
107
|
*
|
|
115
|
-
* The grid FORMATS NOTHING: locale currency, thousands separators and decimals
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
108
|
+
* The grid FORMATS NOTHING: locale currency, thousands separators and decimals are the
|
|
109
|
+
* app's, because only the app knows the locale and the rounding. A number reaching here is
|
|
110
|
+
* a convenience, not a formatting request, so it is stringified as-is. A missing key is
|
|
111
|
+
* empty rather than `undefined`.
|
|
119
112
|
*/
|
|
120
113
|
export declare function dataGridCellText(value: AdwDataGridCellValue | null): string;
|
|
121
114
|
/** Clamp an arbitrary variant to the known set (unknown → 'normal'). */
|
|
@@ -125,16 +118,13 @@ export declare function normalizeDataGridColumns(raw: unknown): AdwDataGridColum
|
|
|
125
118
|
/**
|
|
126
119
|
* Whether a row activates on click/tap.
|
|
127
120
|
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* otherwise inert one.
|
|
121
|
+
* Only a `normal` row can activate at all — a section header, a subtotal and a total are
|
|
122
|
+
* STRUCTURE, and making them tappable would offer a detail view for a computed line that
|
|
123
|
+
* has none. The per-row flag then wins over the grid-level one in BOTH directions:
|
|
124
|
+
* `false` opts a single row out of a fully interactive grid, `true` opts one into an
|
|
125
|
+
* otherwise inert grid.
|
|
134
126
|
*
|
|
135
|
-
* `rowFlag` is `unknown` on purpose: it arrives from a JSON attribute
|
|
136
|
-
*
|
|
137
|
-
* value defers to the grid, which is what a value the widget cannot read should
|
|
138
|
-
* do.
|
|
127
|
+
* `rowFlag` is `unknown` on purpose: it arrives from a JSON attribute where anything can
|
|
128
|
+
* be under the key, and only the two booleans decide — any other value defers to the grid.
|
|
139
129
|
*/
|
|
140
130
|
export declare function dataGridRowInteractive(variant: AdwDataGridRowVariant, rowFlag: unknown, gridInteractive: boolean): boolean;
|
package/lib/types/dialog.d.ts
CHANGED
|
@@ -101,9 +101,8 @@ export declare class AdwAlertResponses {
|
|
|
101
101
|
/**
|
|
102
102
|
* Which affordance asked a bottom sheet to close.
|
|
103
103
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* `_attemptClose()` loses.
|
|
104
|
+
* Not interchangeable: the C runs each through a DIFFERENT gate, and the differences are
|
|
105
|
+
* exactly what a renderer flattening them into one `_attemptClose()` loses.
|
|
107
106
|
*
|
|
108
107
|
* - `'dimming'` — a click on the modal scrim (`released_cb`).
|
|
109
108
|
* - `'escape'` — the <kbd>Escape</kbd> shortcut on the sheet (`maybe_close_cb`).
|
|
@@ -135,28 +134,22 @@ export interface BottomSheetCloseState {
|
|
|
135
134
|
* The dismissal decision table — `Adw.BottomSheet`'s five dismissal affordances
|
|
136
135
|
* as one pure function, callable without owning any state.
|
|
137
136
|
*
|
|
138
|
-
* Three rows are worth reading twice
|
|
137
|
+
* Three rows are worth reading twice:
|
|
139
138
|
*
|
|
140
139
|
* - `('drag-handle', …)` is ALWAYS `'ignored'`. The handle is created with
|
|
141
|
-
* `can_focus = FALSE` + `can_target = FALSE
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* Both ports had turned it into a close BUTTON, which is the one behaviour it
|
|
145
|
-
* provably does not have.
|
|
140
|
+
* `can_focus = FALSE` + `can_target = FALSE`, so it cannot be clicked at all; its only
|
|
141
|
+
* behavioural role is elsewhere (`allow_mouse_drag = show_drag_handle || bottom_bar`). It
|
|
142
|
+
* is NOT a close button.
|
|
146
143
|
* - `('escape', { open: false })` is `'close-attempt'`, not nothing. The emit in
|
|
147
|
-
* `maybe_close_cb`
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* `sheet_close_cb` (adw-bottom-sheet.c:377-385) activates the parent's
|
|
152
|
-
* `sheet.close` action instead of doing nothing.
|
|
144
|
+
* `maybe_close_cb` is the fallthrough for EVERY case that is not `can_close && open`, and a
|
|
145
|
+
* closed sheet is still focusable while it shows a bottom bar.
|
|
146
|
+
* - `('close-button', { open: false, canClose: true })` is `'delegate'`: `sheet_close_cb`
|
|
147
|
+
* activates the parent's `sheet.close` action instead of doing nothing.
|
|
153
148
|
*
|
|
154
|
-
* The `'dimming'`/`'swipe'` closed rows encode a REACHABILITY gate rather than a
|
|
155
|
-
*
|
|
156
|
-
* `
|
|
157
|
-
*
|
|
158
|
-
* (adw-bottom-sheet.c:1050-1053). Neither can fire on a closed sheet, so neither
|
|
159
|
-
* signals anything.
|
|
149
|
+
* The `'dimming'`/`'swipe'` closed rows encode a REACHABILITY gate rather than a branch
|
|
150
|
+
* inside the callback: `released_cb` never tests `open`, but the scrim is `can_target = open`,
|
|
151
|
+
* and `prepare_cb` refuses to even detect a swipe unless the direction matches the state.
|
|
152
|
+
* Neither can fire on a closed sheet, so neither signals anything.
|
|
160
153
|
*/
|
|
161
154
|
export declare function resolveBottomSheetClose(source: BottomSheetCloseSource, state: BottomSheetCloseState): BottomSheetCloseOutcome;
|
|
162
155
|
/** One entry in a {@link BottomSheetPresentation}'s teardown callback pair. */
|
|
@@ -165,13 +158,12 @@ export type BottomSheetTeardownCallback = 'closing' | 'closed';
|
|
|
165
158
|
export type BottomSheetPresentationListener = (open: boolean) => void;
|
|
166
159
|
/**
|
|
167
160
|
* The two callbacks `AdwDialog` installs on its bottom sheet
|
|
168
|
-
* (`adw_bottom_sheet_set_callbacks
|
|
169
|
-
* NOT the same event twice:
|
|
161
|
+
* (`adw_bottom_sheet_set_callbacks`). NOT the same event twice:
|
|
170
162
|
*
|
|
171
|
-
* - `onClosing` fires when the close STARTS —
|
|
172
|
-
*
|
|
173
|
-
* - `onClosed` fires when the sheet has finished hiding —
|
|
174
|
-
*
|
|
163
|
+
* - `onClosing` fires when the close STARTS — `AdwDialog` turns it into the public
|
|
164
|
+
* `AdwDialog::closed` signal.
|
|
165
|
+
* - `onClosed` fires when the sheet has finished hiding — `AdwDialog` turns it into the
|
|
166
|
+
* dialog's removal from the widget tree.
|
|
175
167
|
*/
|
|
176
168
|
export interface BottomSheetPresentationOptions {
|
|
177
169
|
/** The close started (`closing_callback`). */
|
|
@@ -184,12 +176,10 @@ export interface BottomSheetPresentationOptions {
|
|
|
184
176
|
* the idempotent `open` flag, the `can-close` gate applied through
|
|
185
177
|
* {@link resolveBottomSheetClose}, and the `has_been_open` teardown replay.
|
|
186
178
|
*
|
|
187
|
-
* `setOpen` is the PROGRAMMATIC path and deliberately ignores `can-close`
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* by its owner — the distinction NativeScript lacked entirely (every dismissal
|
|
192
|
-
* went through one unconditional `close()`).
|
|
179
|
+
* `setOpen` is the PROGRAMMATIC path and deliberately ignores `can-close` ("Bottom sheet can
|
|
180
|
+
* still be closed using [property@BottomSheet:open]"); {@link requestClose} is the INTERACTIVE
|
|
181
|
+
* path that runs the gate. Keeping them apart is what lets a locked sheet still be closed by
|
|
182
|
+
* its owner.
|
|
193
183
|
*/
|
|
194
184
|
export declare class BottomSheetPresentation {
|
|
195
185
|
private _open;
|
|
@@ -208,37 +198,35 @@ export declare class BottomSheetPresentation {
|
|
|
208
198
|
get canClose(): boolean;
|
|
209
199
|
/**
|
|
210
200
|
* Whether the sheet has ever been open. Drives the teardown replay in
|
|
211
|
-
* {@link setOpen}; `has_been_open` in the C source
|
|
201
|
+
* {@link setOpen}; `has_been_open` in the C source.
|
|
212
202
|
*/
|
|
213
203
|
get hasBeenOpen(): boolean;
|
|
214
|
-
/** Set `can-close`. Returns whether it changed
|
|
204
|
+
/** Set `can-close`. Returns whether it changed. */
|
|
215
205
|
setCanClose(canClose: boolean): boolean;
|
|
216
206
|
/**
|
|
217
|
-
* The programmatic open/close — `adw_bottom_sheet_set_open`
|
|
218
|
-
*
|
|
219
|
-
* whether a `notify::open` was emitted.
|
|
207
|
+
* The programmatic open/close — `adw_bottom_sheet_set_open`. Returns whether `open`
|
|
208
|
+
* changed, i.e. whether a `notify::open` was emitted.
|
|
220
209
|
*
|
|
221
210
|
* `can-close` is NOT consulted: this is the owner's path, and it is how
|
|
222
|
-
* `adw_dialog_force_close` closes a locked dialog
|
|
211
|
+
* `adw_dialog_force_close` closes a locked dialog.
|
|
223
212
|
*/
|
|
224
213
|
setOpen(open: boolean): boolean;
|
|
225
214
|
/**
|
|
226
|
-
* Route a dismissal affordance through {@link resolveBottomSheetClose} and
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* nothing at all.
|
|
215
|
+
* Route a dismissal affordance through {@link resolveBottomSheetClose} and APPLY the
|
|
216
|
+
* outcome — `'close'` closes the sheet, everything else leaves it untouched. The returned
|
|
217
|
+
* outcome tells the renderer what to emit: a `close-attempt` signal, a `sheet.close`
|
|
218
|
+
* forwarded to the parent, or nothing at all.
|
|
231
219
|
*/
|
|
232
220
|
requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
|
|
233
221
|
/**
|
|
234
|
-
* The sheet has finished hiding — `open_animation_done_cb`'s teardown
|
|
235
|
-
*
|
|
236
|
-
*
|
|
222
|
+
* The sheet has finished hiding — `open_animation_done_cb`'s teardown reduced to what a
|
|
223
|
+
* renderer without a spring animation can observe. Fires `onClosed` and returns whether it
|
|
224
|
+
* did.
|
|
237
225
|
*
|
|
238
|
-
* The C guard is `progress < 0.5` ("settled on the closed side"); with no
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
226
|
+
* The C guard is `progress < 0.5` ("settled on the closed side"); with no animation the
|
|
227
|
+
* settled progress IS `open`, so an open sheet fires nothing. Call it only after a
|
|
228
|
+
* {@link setOpen} that RETURNED TRUE — the replay branch has already fired both callbacks
|
|
229
|
+
* for a never-opened sheet.
|
|
242
230
|
*/
|
|
243
231
|
finishClose(): boolean;
|
|
244
232
|
}
|
package/lib/types/easing.d.ts
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
/** `adw_lerp`
|
|
1
|
+
/** `adw_lerp` — `a * (1 - t) + b * t`. */
|
|
2
2
|
export declare function adwLerp(a: number, b: number, t: number): number;
|
|
3
3
|
/**
|
|
4
|
-
* The inverse: where `r` sits between `a` and `b`, as a 0..1 fraction.
|
|
5
|
-
*
|
|
6
|
-
* Not a libadwaita function — C writes the division inline — but it is the same
|
|
7
|
-
* expression at every call site, and naming it is what keeps the two directions
|
|
8
|
-
* from drifting apart.
|
|
4
|
+
* The inverse: where `r` sits between `a` and `b`, as a 0..1 fraction. Not a
|
|
5
|
+
* libadwaita function — C writes the division inline at each call site.
|
|
9
6
|
*/
|
|
10
7
|
export declare function inverseLerp(a: number, b: number, r: number): number;
|
|
11
8
|
/** `ease_out_cubic` (adw-easing.c) — `(t - 1)^3 + 1`. */
|
|
12
9
|
export declare function easeOutCubic(t: number): number;
|
|
13
10
|
/**
|
|
14
|
-
* `ease_in_out_sine`
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* This is the curve the spinner's arc breathes on, at BOTH ends: `get_arc_start`
|
|
18
|
-
* eases the extend phase and `get_arc_end` the contract phase
|
|
19
|
-
* (adw-spinner-paintable.c:121, :141).
|
|
11
|
+
* `ease_in_out_sine` — `-0.5 * (cos(pi * t) - 1)`, with the duration argument at its
|
|
12
|
+
* only used value, 1. The curve the spinner's arc breathes on at BOTH ends:
|
|
13
|
+
* `get_arc_start` eases the extend phase, `get_arc_end` the contract phase.
|
|
20
14
|
*/
|
|
21
15
|
export declare function easeInOutSine(t: number): number;
|