@gjsify/adwaita-core 0.31.0 → 0.32.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/about-dialog.js +3 -0
- package/lib/esm/action-row.js +1 -0
- package/lib/esm/avatar.js +1 -0
- package/lib/esm/banner.js +1 -0
- package/lib/esm/button-content.js +1 -0
- package/lib/esm/carousel.js +1 -0
- package/lib/esm/checks.js +1 -0
- package/lib/esm/chrome.js +1 -0
- package/lib/esm/conformance/about-dialog.js +6 -0
- package/lib/esm/conformance/action-row.js +1 -0
- package/lib/esm/conformance/avatar.js +1 -0
- package/lib/esm/conformance/banner.js +1 -0
- package/lib/esm/conformance/button-content.js +1 -0
- package/lib/esm/conformance/carousel.js +1 -0
- package/lib/esm/conformance/checks.js +1 -0
- package/lib/esm/conformance/chrome.js +1 -0
- package/lib/esm/conformance/data-grid.js +1 -0
- package/lib/esm/conformance/dialog.js +1 -0
- package/lib/esm/conformance/entry-row.js +1 -0
- package/lib/esm/conformance/index.js +1 -0
- package/lib/esm/conformance/navigation-view.js +1 -0
- package/lib/esm/conformance/popover.js +1 -0
- package/lib/esm/conformance/preferences.js +1 -0
- package/lib/esm/conformance/rows.js +1 -0
- package/lib/esm/conformance/sidebar.js +1 -0
- package/lib/esm/conformance/split-button.js +1 -0
- package/lib/esm/conformance/split-view.js +1 -0
- package/lib/esm/conformance/tab-view.js +1 -0
- package/lib/esm/conformance/view-stack.js +1 -0
- package/lib/esm/conformance/view-switcher.js +1 -0
- package/lib/esm/conformance/wrap-box.js +1 -0
- package/lib/esm/data-grid.js +1 -0
- package/lib/esm/dialog.js +1 -1
- package/lib/esm/entry-row.js +1 -0
- package/lib/esm/glib.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/navigation-view.js +1 -0
- package/lib/esm/popover.js +1 -0
- package/lib/esm/preferences.js +1 -0
- package/lib/esm/rows.js +1 -1
- package/lib/esm/sidebar.js +1 -0
- package/lib/esm/split-button.js +1 -0
- package/lib/esm/split-view.js +1 -0
- package/lib/esm/tab-view.js +1 -0
- package/lib/esm/view-stack.js +1 -0
- package/lib/esm/view-switcher.js +1 -0
- package/lib/types/about-dialog.d.ts +391 -0
- package/lib/types/about-dialog.spec.d.ts +2 -0
- package/lib/types/action-row.d.ts +270 -0
- package/lib/types/action-row.spec.d.ts +2 -0
- package/lib/types/avatar.d.ts +112 -0
- package/lib/types/avatar.spec.d.ts +2 -0
- package/lib/types/banner.d.ts +104 -0
- package/lib/types/banner.spec.d.ts +2 -0
- package/lib/types/button-content.d.ts +141 -0
- package/lib/types/button-content.spec.d.ts +2 -0
- package/lib/types/carousel.d.ts +535 -0
- package/lib/types/carousel.spec.d.ts +2 -0
- package/lib/types/checks.d.ts +63 -0
- package/lib/types/checks.spec.d.ts +2 -0
- package/lib/types/chrome.d.ts +355 -0
- package/lib/types/chrome.spec.d.ts +2 -0
- package/lib/types/conformance/about-dialog.d.ts +300 -0
- package/lib/types/conformance/action-row.d.ts +186 -0
- package/lib/types/conformance/avatar.d.ts +61 -0
- package/lib/types/conformance/banner.d.ts +91 -0
- package/lib/types/conformance/button-content.d.ts +110 -0
- package/lib/types/conformance/carousel.d.ts +284 -0
- package/lib/types/conformance/checks.d.ts +29 -0
- package/lib/types/conformance/chrome.d.ts +195 -0
- package/lib/types/conformance/data-grid.d.ts +134 -0
- package/lib/types/conformance/dialog.d.ts +97 -0
- package/lib/types/conformance/entry-row.d.ts +185 -0
- package/lib/types/conformance/index.d.ts +44 -0
- package/lib/types/conformance/navigation-view.d.ts +235 -0
- package/lib/types/conformance/popover.d.ts +56 -0
- package/lib/types/conformance/preferences.d.ts +170 -0
- package/lib/types/conformance/rows.d.ts +51 -0
- package/lib/types/conformance/sidebar.d.ts +182 -0
- package/lib/types/conformance/split-button.d.ts +189 -0
- package/lib/types/conformance/split-view.d.ts +290 -0
- package/lib/types/conformance/tab-view.d.ts +441 -0
- package/lib/types/conformance/view-stack.d.ts +121 -0
- package/lib/types/conformance/view-switcher.d.ts +443 -0
- package/lib/types/conformance/wrap-box.d.ts +134 -0
- package/lib/types/data-grid.d.ts +140 -0
- package/lib/types/data-grid.spec.d.ts +2 -0
- package/lib/types/dialog.d.ts +144 -0
- package/lib/types/entry-row.d.ts +308 -0
- package/lib/types/entry-row.spec.d.ts +2 -0
- package/lib/types/glib.d.ts +49 -0
- package/lib/types/index.d.ts +43 -4
- package/lib/types/navigation-view.d.ts +343 -0
- package/lib/types/navigation-view.spec.d.ts +2 -0
- package/lib/types/popover.d.ts +155 -0
- package/lib/types/popover.spec.d.ts +2 -0
- package/lib/types/preferences.d.ts +349 -0
- package/lib/types/preferences.spec.d.ts +2 -0
- package/lib/types/rows.d.ts +49 -2
- package/lib/types/sidebar.d.ts +308 -0
- package/lib/types/sidebar.spec.d.ts +2 -0
- package/lib/types/split-button.d.ts +316 -0
- package/lib/types/split-button.spec.d.ts +2 -0
- package/lib/types/split-view.d.ts +714 -0
- package/lib/types/split-view.spec.d.ts +2 -0
- package/lib/types/tab-view.d.ts +616 -0
- package/lib/types/tab-view.spec.d.ts +2 -0
- package/lib/types/view-stack.d.ts +266 -0
- package/lib/types/view-stack.spec.d.ts +2 -0
- package/lib/types/view-switcher.d.ts +521 -0
- package/lib/types/view-switcher.spec.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPolicy, ViewSwitcherScheduler } from '../view-switcher.js';
|
|
2
|
+
/**
|
|
3
|
+
* A page as a vector declares it — the input half of `AdwViewSwitcherPageInit`.
|
|
4
|
+
*
|
|
5
|
+
* `title`/`iconName` omitted OR `null` both mean "the page has none", which is
|
|
6
|
+
* also what `getAttribute` returns for a missing attribute, so a DOM driver maps
|
|
7
|
+
* both to "do not set the attribute".
|
|
8
|
+
*/
|
|
9
|
+
export interface ViewSwitcherVectorPage {
|
|
10
|
+
/** The page name. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** `AdwViewStackPage:title`; absent means NULL. */
|
|
13
|
+
title?: string | null;
|
|
14
|
+
/** `AdwViewStackPage:icon-name`; absent means NULL. */
|
|
15
|
+
iconName?: string | null;
|
|
16
|
+
/** `AdwViewStackPage:visible`; absent means `true`. */
|
|
17
|
+
visible?: boolean;
|
|
18
|
+
/** `AdwViewStackPage:use-underline`; absent means `false`. */
|
|
19
|
+
useUnderline?: boolean;
|
|
20
|
+
/** `AdwViewStackPage:badge-number`; absent means `0`. */
|
|
21
|
+
badgeNumber?: number;
|
|
22
|
+
/** `AdwViewStackPage:needs-attention`; absent means `false`. */
|
|
23
|
+
needsAttention?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** One `stripMnemonic` expectation. */
|
|
26
|
+
export interface MnemonicVector {
|
|
27
|
+
/** The raw title. */
|
|
28
|
+
label: string;
|
|
29
|
+
/** What `adw_strip_mnemonic` produces. */
|
|
30
|
+
stripped: string;
|
|
31
|
+
/** What this row pins down. */
|
|
32
|
+
rule: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `adw_strip_mnemonic` (adw-widget-utils.c:685-703) — `g_markup_escape_text`
|
|
36
|
+
* then `pango_parse_markup` with `'_'` as the accel marker.
|
|
37
|
+
*
|
|
38
|
+
* The escape/parse round trip is entity-NEUTRAL, which is what the `R&D` row
|
|
39
|
+
* pins: a port that only escaped, or only unescaped, would drift on every
|
|
40
|
+
* ampersand.
|
|
41
|
+
*/
|
|
42
|
+
export declare const VIEW_SWITCHER_MNEMONIC_VECTORS: ReadonlyArray<MnemonicVector>;
|
|
43
|
+
/** One `viewSwitcherIconName` expectation. */
|
|
44
|
+
export interface ViewSwitcherIconVector {
|
|
45
|
+
/** `AdwViewStackPage:icon-name` as the page carries it. */
|
|
46
|
+
iconName: string | null | undefined;
|
|
47
|
+
/** The icon the switcher actually renders. */
|
|
48
|
+
resolved: string;
|
|
49
|
+
/** What this row pins down. */
|
|
50
|
+
rule: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The `image-missing` substitution (adw-view-switcher-button.c:399-405,
|
|
54
|
+
* adw-inline-view-switcher.c:137-142). Both ports rendered NO icon instead,
|
|
55
|
+
* which is why an icons-mode toggle for a page without an icon was a blank box.
|
|
56
|
+
*
|
|
57
|
+
* Note there is no `-symbolic` stripping here: C passes the name to `GtkImage`
|
|
58
|
+
* unchanged. Turning a name into a CSS class or an SVG document is the
|
|
59
|
+
* renderer's job.
|
|
60
|
+
*/
|
|
61
|
+
export declare const VIEW_SWITCHER_ICON_VECTORS: ReadonlyArray<ViewSwitcherIconVector>;
|
|
62
|
+
/** One `isViewSwitcherButtonVisible` expectation. */
|
|
63
|
+
export interface ViewSwitcherButtonVisibilityVector {
|
|
64
|
+
/** `AdwViewStackPage:visible`. */
|
|
65
|
+
visible: boolean;
|
|
66
|
+
/** `AdwViewStackPage:title`. */
|
|
67
|
+
title: string | null;
|
|
68
|
+
/** `AdwViewStackPage:icon-name`. */
|
|
69
|
+
iconName: string | null;
|
|
70
|
+
/** Whether `AdwViewSwitcher` shows the button. */
|
|
71
|
+
buttonVisible: boolean;
|
|
72
|
+
/** What this row pins down. */
|
|
73
|
+
rule: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `update_button`'s `gtk_widget_set_visible (button, visible && (title != NULL ||
|
|
77
|
+
* icon_name != NULL))` (adw-view-switcher.c:178).
|
|
78
|
+
*
|
|
79
|
+
* Implemented in NEITHER port: the browser one hid the label and icon spans but
|
|
80
|
+
* always appended a visible `<button>`, the NativeScript one always added the
|
|
81
|
+
* button `StackLayout` with an empty `Label`. Both therefore rendered an empty,
|
|
82
|
+
* clickable, space-consuming tab for a page with no title and no icon.
|
|
83
|
+
*/
|
|
84
|
+
export declare const VIEW_SWITCHER_BUTTON_VISIBILITY_VECTORS: ReadonlyArray<ViewSwitcherButtonVisibilityVector>;
|
|
85
|
+
/** One badge-label + indicator-description expectation. */
|
|
86
|
+
export interface ViewSwitcherBadgeVector {
|
|
87
|
+
/** `AdwViewStackPage:badge-number`. */
|
|
88
|
+
badgeNumber: number;
|
|
89
|
+
/** `AdwViewStackPage:needs-attention`. */
|
|
90
|
+
needsAttention: boolean;
|
|
91
|
+
/** `get_badge_label`'s text. */
|
|
92
|
+
badgeLabel: string;
|
|
93
|
+
/** `update_description`'s text. */
|
|
94
|
+
description: string;
|
|
95
|
+
/** What this row pins down. */
|
|
96
|
+
rule: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* `get_badge_label` (adw-indicator-bin.c:58-68) and `update_description`
|
|
100
|
+
* (:70-113), which both ports omit entirely — neither renders a badge, a
|
|
101
|
+
* needs-attention dot, or an accessible description.
|
|
102
|
+
*
|
|
103
|
+
* The composition ORDER is the subtle part: when both clauses apply the format
|
|
104
|
+
* is `"%s %s", badge_description, needs_attention_description` (:96), so the
|
|
105
|
+
* BADGE comes first.
|
|
106
|
+
*/
|
|
107
|
+
export declare const VIEW_SWITCHER_BADGE_VECTORS: ReadonlyArray<ViewSwitcherBadgeVector>;
|
|
108
|
+
/** One `shouldRevealViewSwitcherBar` expectation. */
|
|
109
|
+
export interface ViewSwitcherBarRevealVector {
|
|
110
|
+
/** `AdwViewSwitcherBar:reveal` — what the layout asked for. */
|
|
111
|
+
reveal: boolean;
|
|
112
|
+
/** The bound stack's pages, reduced to their `visible` flag. */
|
|
113
|
+
pages: readonly {
|
|
114
|
+
readonly visible: boolean;
|
|
115
|
+
}[];
|
|
116
|
+
/** Whether the action bar is actually revealed. */
|
|
117
|
+
revealed: boolean;
|
|
118
|
+
/** What this row pins down. */
|
|
119
|
+
rule: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* `update_bar_revealed` (adw-view-switcher-bar.c:104-126) — absent from BOTH
|
|
123
|
+
* ports, which each reduced `revealed` to their own boolean flag and never
|
|
124
|
+
* consulted the page count. A bar bound to a one-page stack therefore showed an
|
|
125
|
+
* empty strip libadwaita keeps collapsed.
|
|
126
|
+
*/
|
|
127
|
+
export declare const VIEW_SWITCHER_BAR_REVEAL_VECTORS: ReadonlyArray<ViewSwitcherBarRevealVector>;
|
|
128
|
+
/** One step of a {@link ViewSwitcherBarVector} script. */
|
|
129
|
+
export type ViewSwitcherBarStep = {
|
|
130
|
+
readonly kind: 'reveal';
|
|
131
|
+
readonly value: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'pages';
|
|
134
|
+
readonly pages: readonly {
|
|
135
|
+
readonly visible: boolean;
|
|
136
|
+
}[];
|
|
137
|
+
};
|
|
138
|
+
/** The `{ reveal, revealed }` pair a bar exposes. */
|
|
139
|
+
export interface ViewSwitcherBarSnapshot {
|
|
140
|
+
/** The request. */
|
|
141
|
+
reveal: boolean;
|
|
142
|
+
/** The derived truth. */
|
|
143
|
+
revealed: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** One end-to-end switcher-bar expectation. */
|
|
146
|
+
export interface ViewSwitcherBarVector {
|
|
147
|
+
/** What this row pins down. */
|
|
148
|
+
rule: string;
|
|
149
|
+
/** The C function + lines it is derived from. */
|
|
150
|
+
derivedFrom: string;
|
|
151
|
+
/** The script, applied in order to a fresh bar. */
|
|
152
|
+
steps: readonly ViewSwitcherBarStep[];
|
|
153
|
+
/**
|
|
154
|
+
* Return value of each step. A `reveal` step returns whether `reveal` ITSELF
|
|
155
|
+
* changed (C returns early before its notify otherwise); a `pages` step
|
|
156
|
+
* returns whether `revealed` flipped.
|
|
157
|
+
*/
|
|
158
|
+
stepResults: readonly boolean[];
|
|
159
|
+
/** The state after each step, in order. */
|
|
160
|
+
states: readonly ViewSwitcherBarSnapshot[];
|
|
161
|
+
/** The changes emitted, in order — only a flip of `revealed` notifies. */
|
|
162
|
+
changes: readonly ViewSwitcherBarSnapshot[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* `AdwViewSwitcherBar`'s reveal machine end to end. `update_bar_revealed` is
|
|
166
|
+
* re-run from `set_reveal`, from `set_stack` and from the pages' `items-changed`
|
|
167
|
+
* (adw-view-switcher-bar.c:340-343, :383, :277), which is why the page set alone
|
|
168
|
+
* can flip the bar while `reveal` never moves.
|
|
169
|
+
*/
|
|
170
|
+
export declare const VIEW_SWITCHER_BAR_VECTORS: ReadonlyArray<ViewSwitcherBarVector>;
|
|
171
|
+
/** One `inlineToggleTooltip` expectation. */
|
|
172
|
+
export interface InlineTooltipVector {
|
|
173
|
+
/** `AdwViewStackPage:title`. */
|
|
174
|
+
title: string | null;
|
|
175
|
+
/** `AdwViewStackPage:use-underline`. */
|
|
176
|
+
useUnderline: boolean;
|
|
177
|
+
/** The current display mode. */
|
|
178
|
+
displayMode: AdwInlineViewSwitcherDisplayMode;
|
|
179
|
+
/** The tooltip text, as PLAIN text. */
|
|
180
|
+
tooltip: string;
|
|
181
|
+
/** What this row pins down. */
|
|
182
|
+
rule: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* `update_tooltip` (adw-inline-view-switcher.c:163-192). The browser port gated
|
|
186
|
+
* on the mode correctly but used the RAW attribute, so `title="_Files"` produced
|
|
187
|
+
* the tooltip `_Files`; the NativeScript port has no tooltip at all.
|
|
188
|
+
*/
|
|
189
|
+
export declare const INLINE_TOOLTIP_VECTORS: ReadonlyArray<InlineTooltipVector>;
|
|
190
|
+
/** The derived per-button model a vector expects. */
|
|
191
|
+
export interface ExpectedViewSwitcherButton {
|
|
192
|
+
/** Position in the page list. */
|
|
193
|
+
pageIndex: number;
|
|
194
|
+
/** The page name. */
|
|
195
|
+
name: string;
|
|
196
|
+
/** The text painted on the button. */
|
|
197
|
+
label: string;
|
|
198
|
+
/** The icon name painted on the button, never empty. */
|
|
199
|
+
iconName: string;
|
|
200
|
+
/** Whether the button is shown at all. */
|
|
201
|
+
visible: boolean;
|
|
202
|
+
/** Whether it is the selected one. */
|
|
203
|
+
selected: boolean;
|
|
204
|
+
/** Icon/label arrangement, from the policy. */
|
|
205
|
+
orientation: 'horizontal' | 'vertical';
|
|
206
|
+
/** Badge text, `''` for none. */
|
|
207
|
+
badgeLabel: string;
|
|
208
|
+
/** Whether the needs-attention dot is painted. */
|
|
209
|
+
needsAttention: boolean;
|
|
210
|
+
/** Screen-reader description, `''` for none. */
|
|
211
|
+
description: string;
|
|
212
|
+
}
|
|
213
|
+
/** One `buildViewSwitcherButtons` expectation. */
|
|
214
|
+
export interface ViewSwitcherButtonVector {
|
|
215
|
+
/** What this row pins down. */
|
|
216
|
+
rule: string;
|
|
217
|
+
/** The C function + lines it is derived from. */
|
|
218
|
+
derivedFrom: string;
|
|
219
|
+
/** The pages, in order. */
|
|
220
|
+
pages: readonly ViewSwitcherVectorPage[];
|
|
221
|
+
/** The selected PAGE index, `-1` for none. */
|
|
222
|
+
selected: number;
|
|
223
|
+
/** `AdwViewSwitcher:policy`. */
|
|
224
|
+
policy: AdwViewSwitcherPolicy;
|
|
225
|
+
/** One model per page — the index space is preserved, hidden buttons included. */
|
|
226
|
+
buttons: readonly ExpectedViewSwitcherButton[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* `AdwViewSwitcher`'s per-button derivation: `populate_switcher` adds a button
|
|
230
|
+
* for EVERY page (adw-view-switcher.c:230-238) and `update_button` decides what
|
|
231
|
+
* it shows and whether it is visible (:149-182).
|
|
232
|
+
*/
|
|
233
|
+
export declare const VIEW_SWITCHER_BUTTON_VECTORS: ReadonlyArray<ViewSwitcherButtonVector>;
|
|
234
|
+
/** The derived per-toggle model a vector expects. */
|
|
235
|
+
export interface ExpectedInlineToggle {
|
|
236
|
+
/** Position among the toggles — compacted. */
|
|
237
|
+
toggleIndex: number;
|
|
238
|
+
/** Position in the page list — libadwaita's `child-index`. */
|
|
239
|
+
pageIndex: number;
|
|
240
|
+
/** The page name. */
|
|
241
|
+
name: string;
|
|
242
|
+
/** The text painted on the toggle. */
|
|
243
|
+
label: string;
|
|
244
|
+
/** The icon name painted on the toggle, never empty. */
|
|
245
|
+
iconName: string;
|
|
246
|
+
/** Whether this display mode builds an icon. */
|
|
247
|
+
showIcon: boolean;
|
|
248
|
+
/** Whether this display mode builds a label. */
|
|
249
|
+
showLabel: boolean;
|
|
250
|
+
/** Tooltip text, `''` outside icons mode. */
|
|
251
|
+
tooltip: string;
|
|
252
|
+
/** Badge text, `''` for none. */
|
|
253
|
+
badgeLabel: string;
|
|
254
|
+
/** Whether the needs-attention dot is painted. */
|
|
255
|
+
needsAttention: boolean;
|
|
256
|
+
/** Screen-reader description, `''` for none. */
|
|
257
|
+
description: string;
|
|
258
|
+
}
|
|
259
|
+
/** One `buildInlineToggles` + index-mapping expectation. */
|
|
260
|
+
export interface InlineToggleVector {
|
|
261
|
+
/** What this row pins down. */
|
|
262
|
+
rule: string;
|
|
263
|
+
/** The C function + lines it is derived from. */
|
|
264
|
+
derivedFrom: string;
|
|
265
|
+
/** The pages, in order. */
|
|
266
|
+
pages: readonly ViewSwitcherVectorPage[];
|
|
267
|
+
/** `AdwInlineViewSwitcher:display-mode`. */
|
|
268
|
+
displayMode: AdwInlineViewSwitcherDisplayMode;
|
|
269
|
+
/** One model per VISIBLE page. */
|
|
270
|
+
toggles: readonly ExpectedInlineToggle[];
|
|
271
|
+
/** `toggleIndexForPage` for every page index, in order — `-1` for a hidden page. */
|
|
272
|
+
toggleIndexByPage: readonly number[];
|
|
273
|
+
/** `pageIndexForToggle` for every toggle index, in order. */
|
|
274
|
+
pageIndexByToggle: readonly number[];
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* The inline switcher's TWO index spaces, plus what each display mode builds.
|
|
278
|
+
*
|
|
279
|
+
* `populate_group` calls `add_toggle` only for visible pages and passes the PAGE
|
|
280
|
+
* index `i`, which `add_toggle` stashes as `child-index`
|
|
281
|
+
* (adw-inline-view-switcher.c:370-378, :346); `notify_active_cb` reads it back
|
|
282
|
+
* (:114-129) and `selection_changed_cb` walks the other way (:434-453). Neither
|
|
283
|
+
* port filtered hidden pages, so the mapping looked like the identity and the
|
|
284
|
+
* `-1` sentinel had no spelling.
|
|
285
|
+
*/
|
|
286
|
+
export declare const INLINE_TOGGLE_VECTORS: ReadonlyArray<InlineToggleVector>;
|
|
287
|
+
/** One change notification, in the order it is emitted. */
|
|
288
|
+
export interface ViewSwitcherVectorChange {
|
|
289
|
+
/** Index of the newly-selected page, `-1` for none. */
|
|
290
|
+
selected: number;
|
|
291
|
+
/** Its name, `''` for none. */
|
|
292
|
+
name: string;
|
|
293
|
+
/** Its painted label, `''` for none. */
|
|
294
|
+
title: string;
|
|
295
|
+
/** `true` for a user activation or an explicit select; `false` for an auto-pick. */
|
|
296
|
+
interactive: boolean;
|
|
297
|
+
}
|
|
298
|
+
/** One operation a selection vector applies after its pages exist. */
|
|
299
|
+
export type ViewSwitcherVectorOp = {
|
|
300
|
+
readonly kind: 'selectIndex';
|
|
301
|
+
readonly index: number;
|
|
302
|
+
} | {
|
|
303
|
+
readonly kind: 'selectName';
|
|
304
|
+
readonly name: string | null | undefined;
|
|
305
|
+
} | {
|
|
306
|
+
readonly kind: 'setPageVisible';
|
|
307
|
+
readonly name: string;
|
|
308
|
+
readonly visible: boolean;
|
|
309
|
+
};
|
|
310
|
+
/** One end-to-end switcher-selection expectation. */
|
|
311
|
+
export interface ViewSwitcherSelectionVector {
|
|
312
|
+
/** What this row pins down. */
|
|
313
|
+
rule: string;
|
|
314
|
+
/** The C function + lines it is derived from. */
|
|
315
|
+
derivedFrom: string;
|
|
316
|
+
/** The pages, set in this order. */
|
|
317
|
+
pages: readonly ViewSwitcherVectorPage[];
|
|
318
|
+
/** Changes emitted WHILE the pages are set (the auto-pick), in order. */
|
|
319
|
+
setupChanges: readonly ViewSwitcherVectorChange[];
|
|
320
|
+
/** Operations applied after the pages exist. */
|
|
321
|
+
ops: readonly ViewSwitcherVectorOp[];
|
|
322
|
+
/**
|
|
323
|
+
* Return value of each op, in order. Asserted by the core and NativeScript
|
|
324
|
+
* suites; the browser suite drives property setters, which return nothing,
|
|
325
|
+
* and asserts `changes` plus the final state instead.
|
|
326
|
+
*/
|
|
327
|
+
opResults: readonly boolean[];
|
|
328
|
+
/** Changes emitted BY the ops, in order. */
|
|
329
|
+
changes: readonly ViewSwitcherVectorChange[];
|
|
330
|
+
/** Final selected page index, `-1` for none. */
|
|
331
|
+
selected: number;
|
|
332
|
+
/** Final selected page name, `''` for none. */
|
|
333
|
+
selectedName: string;
|
|
334
|
+
/** Final selected page label, `''` for none. */
|
|
335
|
+
selectedTitle: string;
|
|
336
|
+
/** Expected diagnostics (C's `g_warning` texts), when the row exercises them. */
|
|
337
|
+
diagnostics?: readonly string[];
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The selection machine a switcher drives, which is the bound stack's — the
|
|
341
|
+
* switcher owns no selection property of its own (adw-view-switcher.c:126-147
|
|
342
|
+
* goes straight to `gtk_selection_model_select_item`).
|
|
343
|
+
*
|
|
344
|
+
* The refusal rows are the ones both ports failed differently: the browser
|
|
345
|
+
* switcher CLAMPED an out-of-range or negative index into range (so `active="-1"`
|
|
346
|
+
* jumped to the first page and `active="99"` to the last), and both stacks
|
|
347
|
+
* accepted a fractional index and then matched no page at all.
|
|
348
|
+
*/
|
|
349
|
+
export declare const VIEW_SWITCHER_SELECTION_VECTORS: ReadonlyArray<ViewSwitcherSelectionVector>;
|
|
350
|
+
/** One page-list rebuild expectation. */
|
|
351
|
+
export interface ViewSwitcherRebuildVector {
|
|
352
|
+
/** What this row pins down. */
|
|
353
|
+
rule: string;
|
|
354
|
+
/** The C function + lines it is derived from. */
|
|
355
|
+
derivedFrom: string;
|
|
356
|
+
/** The initial pages. */
|
|
357
|
+
pages: readonly ViewSwitcherVectorPage[];
|
|
358
|
+
/** A page name to select before the rebuild; omitted keeps the auto-pick. */
|
|
359
|
+
select?: string;
|
|
360
|
+
/** The replacement pages. */
|
|
361
|
+
nextPages: readonly ViewSwitcherVectorPage[];
|
|
362
|
+
/** Changes emitted BY the rebuild, in order. */
|
|
363
|
+
changes: readonly ViewSwitcherVectorChange[];
|
|
364
|
+
/** Selected page index after the rebuild. */
|
|
365
|
+
selected: number;
|
|
366
|
+
/** Selected page name after the rebuild. */
|
|
367
|
+
selectedName: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* What happens to the selection when the page list is replaced wholesale — the
|
|
371
|
+
* shape both renderers actually use (`setViews` on NativeScript, a re-parse on
|
|
372
|
+
* the browser side).
|
|
373
|
+
*
|
|
374
|
+
* libadwaita's selection is a page POINTER compared by identity
|
|
375
|
+
* (`adw_view_stack_pages_is_selected`, adw-view-stack.c:660-672), so it follows
|
|
376
|
+
* the page across inserts instead of pinning an index; a rebuild that drops the
|
|
377
|
+
* selected page falls through to the first-visible auto-pick
|
|
378
|
+
* (adw-view-switcher.c:258-263).
|
|
379
|
+
*/
|
|
380
|
+
export declare const VIEW_SWITCHER_REBUILD_VECTORS: ReadonlyArray<ViewSwitcherRebuildVector>;
|
|
381
|
+
/** One step of a {@link ViewSwitcherDragVector} script. */
|
|
382
|
+
export type ViewSwitcherDragStep = {
|
|
383
|
+
readonly kind: 'enter';
|
|
384
|
+
readonly index: number;
|
|
385
|
+
} | {
|
|
386
|
+
readonly kind: 'leave';
|
|
387
|
+
readonly index: number;
|
|
388
|
+
} | {
|
|
389
|
+
readonly kind: 'advance';
|
|
390
|
+
readonly ms: number;
|
|
391
|
+
};
|
|
392
|
+
/** One drag-hover auto-switch expectation. */
|
|
393
|
+
export interface ViewSwitcherDragVector {
|
|
394
|
+
/** What this row pins down. */
|
|
395
|
+
rule: string;
|
|
396
|
+
/** The C function + lines it is derived from. */
|
|
397
|
+
derivedFrom: string;
|
|
398
|
+
/** The pages. */
|
|
399
|
+
pages: readonly ViewSwitcherVectorPage[];
|
|
400
|
+
/** The page index selected before the drag starts. */
|
|
401
|
+
initial: number;
|
|
402
|
+
/** The drag script. */
|
|
403
|
+
steps: readonly ViewSwitcherDragStep[];
|
|
404
|
+
/** Changes emitted by the script, in order. */
|
|
405
|
+
changes: readonly ViewSwitcherVectorChange[];
|
|
406
|
+
/** Selected page index once the script has run. */
|
|
407
|
+
selected: number;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* `TIMEOUT_EXPAND` — the 500 ms dwell that switches pages mid-drag. Defined
|
|
411
|
+
* identically in both C files (adw-view-switcher-button.c:14, :58-96;
|
|
412
|
+
* adw-inline-view-switcher.c:80, :194-236) and present in NEITHER port, which
|
|
413
|
+
* only ever listened for `click`/`tap`.
|
|
414
|
+
*
|
|
415
|
+
* `interactive: true` on the resulting change: the C timeout activates the
|
|
416
|
+
* toggle, which runs the very same `on_button_toggled` a click does.
|
|
417
|
+
*/
|
|
418
|
+
export declare const VIEW_SWITCHER_DRAG_VECTORS: ReadonlyArray<ViewSwitcherDragVector>;
|
|
419
|
+
/** A deterministic stand-in for a platform timer, driven by {@link advance}. */
|
|
420
|
+
export interface ViewSwitcherClock extends ViewSwitcherScheduler {
|
|
421
|
+
/** Move the clock forward, firing every dwell whose deadline has passed. */
|
|
422
|
+
advance(ms: number): void;
|
|
423
|
+
/** How many dwells are still pending. */
|
|
424
|
+
readonly pending: number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* A fake clock for the drag vectors.
|
|
428
|
+
*
|
|
429
|
+
* Note WHAT it is: a clock, not a stand-in for any behaviour under test. It
|
|
430
|
+
* schedules and cancels callbacks and nothing else, so it cannot transcribe the
|
|
431
|
+
* logic it is used to exercise.
|
|
432
|
+
*
|
|
433
|
+
* WHO DRIVES THOSE VECTORS: the core suite, and only it. This said "the core,
|
|
434
|
+
* browser and NativeScript suites all" — a claim of coverage that was never
|
|
435
|
+
* true, which is worse than silence, because it reads as a reason to stop
|
|
436
|
+
* looking. The browser elements construct
|
|
437
|
+
* `new ViewSwitcherState({ scheduler: domViewSwitcherScheduler })` inline
|
|
438
|
+
* (`elements/adw-view-switcher.ts`, `elements/adw-inline-view-switcher.ts`), so
|
|
439
|
+
* there is no seam to hand this clock through, and the NativeScript port has no
|
|
440
|
+
* drag surface at all. Wiring the browser side means giving the elements a
|
|
441
|
+
* scheduler seam first.
|
|
442
|
+
*/
|
|
443
|
+
export declare function createViewSwitcherClock(): ViewSwitcherClock;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Adw.WrapBox:child-spacing` and `:line-spacing` defaults, in px.
|
|
3
|
+
*
|
|
4
|
+
* Both are `g_param_spec_int (…, 0, G_MAXINT, 0, …)` — adw-wrap-box.c:285-287
|
|
5
|
+
* and :393-395. The NativeScript port defaulted BOTH to 6 DIPs, so identical
|
|
6
|
+
* markup was looser on a phone than in the browser.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ADW_WRAP_BOX_DEFAULT_SPACING = 0;
|
|
9
|
+
/**
|
|
10
|
+
* `Adw.WrapBox:align` default (adw-wrap-box.c:335-337).
|
|
11
|
+
*
|
|
12
|
+
* Declared `g_param_spec_float (…, 0, 1, 0, …)`, so GObject validates an
|
|
13
|
+
* out-of-range value back into `[0, 1]` on set.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ADW_WRAP_BOX_DEFAULT_ALIGN = 0;
|
|
16
|
+
/** `Adw.WrapBox:justify` default — `ADW_JUSTIFY_NONE` (adw-wrap-box.c:364-366). */
|
|
17
|
+
export declare const ADW_WRAP_BOX_DEFAULT_JUSTIFY = "none";
|
|
18
|
+
/** `Adw.WrapBox:justify-last-line` default — `FALSE` (adw-wrap-box.c:379-381). */
|
|
19
|
+
export declare const ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE = false;
|
|
20
|
+
/** `AdwJustifyMode` — the three values of `Adw.WrapBox:justify`. */
|
|
21
|
+
export type WrapBoxJustify = 'none' | 'fill' | 'spread';
|
|
22
|
+
/** What a renderer has to do with a line's leftover space. */
|
|
23
|
+
export interface WrapBoxLineLayout {
|
|
24
|
+
/**
|
|
25
|
+
* The justify mode that governs THIS line, after the last-line gate. It is
|
|
26
|
+
* the widget's `justify` for every line except the final one, and for the
|
|
27
|
+
* final one only when `justify-last-line` is set
|
|
28
|
+
* (adw-wrap-layout.c:397-400, :705-706).
|
|
29
|
+
*/
|
|
30
|
+
justify: WrapBoxJustify;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the CHILDREN absorb the leftover (`allocated_size` grows to
|
|
33
|
+
* `available_size`, adw-wrap-layout.c:336-341). CSS: `flex-grow` on the
|
|
34
|
+
* items.
|
|
35
|
+
*/
|
|
36
|
+
growChildren: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the GAPS absorb the leftover — children keep `minimum_size` and
|
|
39
|
+
* are spread apart by `size_delta` (adw-wrap-layout.c:338-339, :752-757).
|
|
40
|
+
* CSS: `justify-content: space-between`.
|
|
41
|
+
*/
|
|
42
|
+
growGaps: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The MAIN-axis offset factor applied to the whole line block when nothing
|
|
45
|
+
* grows: `widget_offset += roundf (length_delta * align)`
|
|
46
|
+
* (adw-wrap-layout.c:717-725). 0 packs the line at the start of the main
|
|
47
|
+
* axis, 1 at its end. Meaningless — and reported as 0 — as soon as the line
|
|
48
|
+
* is justified, because C only computes `length_delta` inside
|
|
49
|
+
* `if (!justify_line)`.
|
|
50
|
+
*/
|
|
51
|
+
align: number;
|
|
52
|
+
}
|
|
53
|
+
/** One row of the decision table. */
|
|
54
|
+
export interface WrapBoxLineVector {
|
|
55
|
+
/** The widget's `justify` property. */
|
|
56
|
+
justify: WrapBoxJustify;
|
|
57
|
+
/** The widget's `justify-last-line` property. */
|
|
58
|
+
justifyLastLine: boolean;
|
|
59
|
+
/** The widget's `align` property, already validated into `[0, 1]`. */
|
|
60
|
+
align: number;
|
|
61
|
+
/**
|
|
62
|
+
* Whether this is the FINAL line — `i == *n_lines - 1`
|
|
63
|
+
* (adw-wrap-layout.c:463-464). Note it is the final line, NOT merely an
|
|
64
|
+
* incomplete one: a wrap box whose children all fit on one line has that
|
|
65
|
+
* line as its last, so by default `justify` does nothing to it at all.
|
|
66
|
+
*/
|
|
67
|
+
lastLine: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* How many children the line holds. Only `spread` reads it, and only to
|
|
70
|
+
* distinguish 1 from more (adw-wrap-layout.c:338).
|
|
71
|
+
*/
|
|
72
|
+
childrenInLine: number;
|
|
73
|
+
/** What the renderer must do. */
|
|
74
|
+
layout: WrapBoxLineLayout;
|
|
75
|
+
/** The rule or edge case this row pins down. */
|
|
76
|
+
rule: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The line-layout decision, row by row (adw-wrap-layout.c:317-341, :397-400,
|
|
80
|
+
* :705-706, :717-725).
|
|
81
|
+
*
|
|
82
|
+
* Two rows are counter-intuitive and are the reason the table exists rather than
|
|
83
|
+
* a sentence in a comment. First, `lastLine` is the FINAL line whether or not it
|
|
84
|
+
* is full, so the single-line case — the common one — is governed by
|
|
85
|
+
* `justify-last-line`, not by `justify`. Second, `spread` with exactly ONE child
|
|
86
|
+
* in the line does not spread anything: `n_children > 1` guards the branch that
|
|
87
|
+
* keeps children at `minimum_size`, so a lone child is STRETCHED instead, which
|
|
88
|
+
* the property documentation states outright (adw-wrap-box.c:349-352).
|
|
89
|
+
*/
|
|
90
|
+
export declare const WRAP_BOX_LINE_VECTORS: ReadonlyArray<WrapBoxLineVector>;
|
|
91
|
+
/** One `child-spacing` / `line-spacing` normalisation expectation. */
|
|
92
|
+
export interface WrapBoxSpacingVector {
|
|
93
|
+
/**
|
|
94
|
+
* The value handed to the setter. A string is what an HTML attribute or an
|
|
95
|
+
* XML layout carries; a number is what a JS property setter gets. C only
|
|
96
|
+
* ever sees an `int`, so the string rows are the PORTS' own edge — they
|
|
97
|
+
* exist because the browser port propagated `NaN` into the style where the
|
|
98
|
+
* NativeScript port coerced it to 0.
|
|
99
|
+
*/
|
|
100
|
+
value: number | string | null;
|
|
101
|
+
/** The value the widget stores and lays out with. */
|
|
102
|
+
spacing: number;
|
|
103
|
+
/** The rule this row pins down. */
|
|
104
|
+
rule: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* `adw_wrap_box_set_child_spacing` / `set_line_spacing`
|
|
108
|
+
* (adw-wrap-box.c:587-588, :927-928) — a negative spacing is clamped to 0
|
|
109
|
+
* BEFORE anything else happens, so it never reaches the layout.
|
|
110
|
+
*
|
|
111
|
+
* The property is declared with a minimum of 0 (adw-wrap-box.c:285-287,
|
|
112
|
+
* :393-395), which is why the clamp exists at all: without it GObject would
|
|
113
|
+
* reject the value and warn.
|
|
114
|
+
*/
|
|
115
|
+
export declare const WRAP_BOX_SPACING_VECTORS: ReadonlyArray<WrapBoxSpacingVector>;
|
|
116
|
+
/** One "does the setter report a change" expectation. */
|
|
117
|
+
export interface WrapBoxSpacingNotifyVector {
|
|
118
|
+
/** The spacing the widget already holds. */
|
|
119
|
+
from: number;
|
|
120
|
+
/** The value handed to the setter. */
|
|
121
|
+
value: number | string;
|
|
122
|
+
/** Whether the setter reaches `g_object_notify_by_pspec` at all. */
|
|
123
|
+
notifies: boolean;
|
|
124
|
+
/** The rule this row pins down. */
|
|
125
|
+
rule: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The early return in `adw_wrap_box_set_child_spacing`
|
|
129
|
+
* (adw-wrap-box.c:592-593, :930-931): the comparison happens AFTER the clamp,
|
|
130
|
+
* so setting `-5` on a box that already holds 0 changes nothing and notifies
|
|
131
|
+
* nobody. The browser port compared raw attribute strings and fired
|
|
132
|
+
* `notify::child-spacing` for a value libadwaita had normalised away.
|
|
133
|
+
*/
|
|
134
|
+
export declare const WRAP_BOX_SPACING_NOTIFY_VECTORS: ReadonlyArray<WrapBoxSpacingNotifyVector>;
|