@gjsify/adwaita-core 0.31.0 → 0.33.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/spinner.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/easing.js +1 -0
- 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/length-unit.js +1 -0
- 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/spinner.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/esm/wrap-box.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 +314 -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 +298 -0
- package/lib/types/conformance/checks.d.ts +29 -0
- package/lib/types/conformance/chrome.d.ts +207 -0
- package/lib/types/conformance/data-grid.d.ts +136 -0
- package/lib/types/conformance/dialog.d.ts +97 -0
- package/lib/types/conformance/entry-row.d.ts +187 -0
- package/lib/types/conformance/index.d.ts +46 -0
- package/lib/types/conformance/navigation-view.d.ts +235 -0
- package/lib/types/conformance/popover.d.ts +58 -0
- package/lib/types/conformance/preferences.d.ts +184 -0
- package/lib/types/conformance/rows.d.ts +74 -0
- package/lib/types/conformance/sidebar.d.ts +182 -0
- package/lib/types/conformance/spinner.d.ts +66 -0
- package/lib/types/conformance/split-button.d.ts +193 -0
- package/lib/types/conformance/split-view.d.ts +301 -0
- package/lib/types/conformance/tab-view.d.ts +449 -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 +185 -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/easing.d.ts +21 -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 +50 -4
- package/lib/types/length-unit.d.ts +24 -0
- 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 +96 -8
- package/lib/types/sidebar.d.ts +308 -0
- package/lib/types/sidebar.spec.d.ts +2 -0
- package/lib/types/spinner.d.ts +117 -0
- package/lib/types/spinner.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 +703 -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 +278 -0
- package/lib/types/view-stack.spec.d.ts +2 -0
- package/lib/types/view-switcher.d.ts +524 -0
- package/lib/types/view-switcher.spec.d.ts +2 -0
- package/lib/types/wrap-box.d.ts +200 -0
- package/lib/types/wrap-box.spec.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
/** A page as a vector declares it. */
|
|
2
|
+
export interface TabViewVectorPage {
|
|
3
|
+
/** The page id — the platform-neutral stand-in for the `AdwTabPage` pointer. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Tab label; omitted means `''`. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Whether the page is seeded into the pinned prefix. */
|
|
8
|
+
pinned?: boolean;
|
|
9
|
+
/** Id of the page this one was opened from (`AdwTabPage:parent`). */
|
|
10
|
+
parentId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** One operation a vector applies after its pages are seeded. */
|
|
13
|
+
export type TabViewVectorOp = {
|
|
14
|
+
readonly kind: 'select';
|
|
15
|
+
readonly id: string | null;
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'selectNth';
|
|
18
|
+
readonly n: number;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'selectPrevious';
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'selectNext';
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'selectFirst';
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'selectLast';
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'cycleNext';
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'cyclePrevious';
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'addPage';
|
|
33
|
+
readonly page: TabViewVectorPage;
|
|
34
|
+
readonly parentId: string | null;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'insertPage';
|
|
37
|
+
readonly page: TabViewVectorPage;
|
|
38
|
+
readonly position: number;
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: 'prependPage';
|
|
41
|
+
readonly page: TabViewVectorPage;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: 'appendPage';
|
|
44
|
+
readonly page: TabViewVectorPage;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'insertPinnedPage';
|
|
47
|
+
readonly page: TabViewVectorPage;
|
|
48
|
+
readonly position: number;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'prependPinnedPage';
|
|
51
|
+
readonly page: TabViewVectorPage;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'appendPinnedPage';
|
|
54
|
+
readonly page: TabViewVectorPage;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: 'setPinned';
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly pinned: boolean;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'closePage';
|
|
61
|
+
readonly id: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: 'closePageFinish';
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly confirm: boolean;
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: 'closeOtherPages';
|
|
68
|
+
readonly id: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: 'closePagesBefore';
|
|
71
|
+
readonly id: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'closePagesAfter';
|
|
74
|
+
readonly id: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'detach';
|
|
77
|
+
readonly id: string;
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: 'reorder';
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly position: number;
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: 'reorderBackward';
|
|
84
|
+
readonly id: string;
|
|
85
|
+
} | {
|
|
86
|
+
readonly kind: 'reorderForward';
|
|
87
|
+
readonly id: string;
|
|
88
|
+
} | {
|
|
89
|
+
readonly kind: 'reorderFirst';
|
|
90
|
+
readonly id: string;
|
|
91
|
+
} | {
|
|
92
|
+
readonly kind: 'reorderLast';
|
|
93
|
+
readonly id: string;
|
|
94
|
+
} | {
|
|
95
|
+
readonly kind: 'setTitle';
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly title: string | null;
|
|
98
|
+
};
|
|
99
|
+
/** One expected selection notification, in the order it is emitted. */
|
|
100
|
+
export interface TabViewVectorSelection {
|
|
101
|
+
/** Id of the newly-selected page, `null` when the view emptied. */
|
|
102
|
+
selectedId: string | null;
|
|
103
|
+
/** Its index, `-1` when the view emptied. */
|
|
104
|
+
selectedIndex: number;
|
|
105
|
+
/** The previously-selected id, `null` when there was none. */
|
|
106
|
+
previousId: string | null;
|
|
107
|
+
/** `true` only for an explicit selection; every model-driven pick is `false`. */
|
|
108
|
+
interactive: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** One expected page-list notification. */
|
|
111
|
+
export interface TabViewVectorPagesChange {
|
|
112
|
+
/** Which kind of change. */
|
|
113
|
+
kind: 'attached' | 'detached' | 'reordered' | 'pinned' | 'updated';
|
|
114
|
+
/** The page it happened to. */
|
|
115
|
+
id: string;
|
|
116
|
+
/** Its index after the change. */
|
|
117
|
+
position: number;
|
|
118
|
+
/** Its index before the change, `-1` for `'attached'`. */
|
|
119
|
+
previousPosition: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* How the `close-page` handler behaves for the whole row.
|
|
123
|
+
*
|
|
124
|
+
* `'default'` reproduces libadwaita's own default handler, `close_page_cb`'s
|
|
125
|
+
* `close_page_finish (self, page, !adw_tab_page_get_pinned (page))`
|
|
126
|
+
* (adw-tab-view.c:1986-1993) — the suites install a RECORDING wrapper around it
|
|
127
|
+
* so the close-attempt order is observable, and the core suite additionally
|
|
128
|
+
* replays the row with NO handler at all to prove the built-in default agrees.
|
|
129
|
+
* `'defer'` holds every page in the closing state so `closePageFinish` decides.
|
|
130
|
+
*/
|
|
131
|
+
export type TabViewVectorHandler = 'default' | 'defer';
|
|
132
|
+
/** One end-to-end tab-view expectation. */
|
|
133
|
+
export interface TabViewVector {
|
|
134
|
+
/** What this row pins down. */
|
|
135
|
+
rule: string;
|
|
136
|
+
/** The C function + lines it is derived from. */
|
|
137
|
+
derivedFrom: string;
|
|
138
|
+
/** The pages, seeded in this order (pinned ones via appendPinnedPage, parented ones via addPage). */
|
|
139
|
+
pages: readonly TabViewVectorPage[];
|
|
140
|
+
/** How close requests are answered. Defaults to `'default'`. */
|
|
141
|
+
handler?: TabViewVectorHandler;
|
|
142
|
+
/** Selection changes emitted WHILE the pages are seeded (the auto-select), in order. */
|
|
143
|
+
setupChanges: readonly TabViewVectorSelection[];
|
|
144
|
+
/** Operations applied after the pages exist. */
|
|
145
|
+
ops: readonly TabViewVectorOp[];
|
|
146
|
+
/**
|
|
147
|
+
* Return value of each op, in order — `null` for the ops that return nothing.
|
|
148
|
+
* Asserted by the core and NativeScript suites; the browser suite drives the
|
|
149
|
+
* same operations through element methods and asserts the DOM instead.
|
|
150
|
+
*/
|
|
151
|
+
opResults: readonly (boolean | number | null)[];
|
|
152
|
+
/** Selection changes emitted BY the ops, in order. */
|
|
153
|
+
changes: readonly TabViewVectorSelection[];
|
|
154
|
+
/** Page-list changes emitted by the ops, in order. Asserted only when present. */
|
|
155
|
+
pagesChanges?: readonly TabViewVectorPagesChange[];
|
|
156
|
+
/** Ids the close handler was asked about, in order. Asserted only when present. */
|
|
157
|
+
closeAttempts?: readonly string[];
|
|
158
|
+
/** Final page order. */
|
|
159
|
+
order: readonly string[];
|
|
160
|
+
/** Final pinned-prefix length. */
|
|
161
|
+
nPinnedPages: number;
|
|
162
|
+
/** Final selected id, `null` for none. */
|
|
163
|
+
selectedId: string | null;
|
|
164
|
+
/** Final selected index, `-1` for none. */
|
|
165
|
+
selectedIndex: number;
|
|
166
|
+
/** Ids still awaiting a `closePageFinish`. Asserted only when present. */
|
|
167
|
+
closing?: readonly string[];
|
|
168
|
+
/** Expected `diagnostics` (C's `g_return_if_fail` texts), when the row exercises them. */
|
|
169
|
+
diagnostics?: readonly string[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* `Adw.TabView`'s selection, close protocol, partition and ordering, end to end.
|
|
173
|
+
*
|
|
174
|
+
* Read the `rule` of a row before changing it: most of them encode behaviour
|
|
175
|
+
* NEITHER port had, and several encode behaviour a port had backwards.
|
|
176
|
+
*/
|
|
177
|
+
export declare const TAB_VIEW_VECTORS: ReadonlyArray<TabViewVector>;
|
|
178
|
+
/**
|
|
179
|
+
* The surface a vector driver needs.
|
|
180
|
+
*
|
|
181
|
+
* Deliberately STRUCTURAL and named exactly as `TabViewState` names things, so
|
|
182
|
+
* all three suites hand their subject straight to {@link applyTabViewOp} with no
|
|
183
|
+
* translation layer: the core suite passes a `TabViewState`, the NativeScript
|
|
184
|
+
* suite passes the state its widget delegates to, and the browser suite passes
|
|
185
|
+
* the `<adw-tab-view>` element itself. A renderer that cannot be passed here has
|
|
186
|
+
* stopped being a thin adapter, which is the thing these vectors exist to catch.
|
|
187
|
+
*/
|
|
188
|
+
export interface TabViewVectorTarget {
|
|
189
|
+
/** The ordered pages — only the three fields a vector reads. */
|
|
190
|
+
readonly pages: readonly {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly title: string;
|
|
193
|
+
readonly pinned: boolean;
|
|
194
|
+
}[];
|
|
195
|
+
/** Length of the pinned prefix. */
|
|
196
|
+
readonly nPinnedPages: number;
|
|
197
|
+
/** Selected page id, `null` when the view is empty. */
|
|
198
|
+
readonly selectedId: string | null;
|
|
199
|
+
/** Selected index, `-1` when the view is empty. */
|
|
200
|
+
readonly selectedIndex: number;
|
|
201
|
+
/** Whether a close request for `id` is awaiting confirmation. */
|
|
202
|
+
isClosing(id: string): boolean;
|
|
203
|
+
setSelectedPage(id: string | null): boolean;
|
|
204
|
+
selectNthPage(n: number): boolean;
|
|
205
|
+
selectPreviousPage(): boolean;
|
|
206
|
+
selectNextPage(): boolean;
|
|
207
|
+
selectFirstPage(): boolean;
|
|
208
|
+
selectLastPage(): boolean;
|
|
209
|
+
cycleNextPage(): boolean;
|
|
210
|
+
cyclePreviousPage(): boolean;
|
|
211
|
+
addPage(spec: {
|
|
212
|
+
id: string;
|
|
213
|
+
title?: string | null;
|
|
214
|
+
}, parentId: string | null): number;
|
|
215
|
+
insertPage(spec: {
|
|
216
|
+
id: string;
|
|
217
|
+
title?: string | null;
|
|
218
|
+
}, position: number): number;
|
|
219
|
+
prependPage(spec: {
|
|
220
|
+
id: string;
|
|
221
|
+
title?: string | null;
|
|
222
|
+
}): number;
|
|
223
|
+
appendPage(spec: {
|
|
224
|
+
id: string;
|
|
225
|
+
title?: string | null;
|
|
226
|
+
}): number;
|
|
227
|
+
insertPinnedPage(spec: {
|
|
228
|
+
id: string;
|
|
229
|
+
title?: string | null;
|
|
230
|
+
}, position: number): number;
|
|
231
|
+
prependPinnedPage(spec: {
|
|
232
|
+
id: string;
|
|
233
|
+
title?: string | null;
|
|
234
|
+
}): number;
|
|
235
|
+
appendPinnedPage(spec: {
|
|
236
|
+
id: string;
|
|
237
|
+
title?: string | null;
|
|
238
|
+
}): number;
|
|
239
|
+
setPagePinned(id: string, pinned: boolean): number;
|
|
240
|
+
closePage(id: string): boolean;
|
|
241
|
+
closePageFinish(id: string, confirm: boolean): boolean;
|
|
242
|
+
closeOtherPages(id: string): void;
|
|
243
|
+
closePagesBefore(id: string): void;
|
|
244
|
+
closePagesAfter(id: string): void;
|
|
245
|
+
detachPage(id: string): unknown;
|
|
246
|
+
reorderPage(id: string, position: number): boolean;
|
|
247
|
+
reorderBackward(id: string): boolean;
|
|
248
|
+
reorderForward(id: string): boolean;
|
|
249
|
+
reorderFirst(id: string): boolean;
|
|
250
|
+
reorderLast(id: string): boolean;
|
|
251
|
+
setPageTitle(id: string, title: string | null): boolean;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Seed a vector's pages, choosing the insertion call each page's declaration
|
|
255
|
+
* implies: a pinned page through `appendPinnedPage` (so the pinned prefix builds up
|
|
256
|
+
* in declaration order), a parented one through `addPage` (so the position is
|
|
257
|
+
* DERIVED, which is itself under test), everything else through `append`.
|
|
258
|
+
*
|
|
259
|
+
* Every vector's declared order is also the order this produces — the core suite
|
|
260
|
+
* asserts that right after seeding, which is what turns the fixtures themselves
|
|
261
|
+
* into a test of `adw_tab_view_add_page`'s position derivation.
|
|
262
|
+
*/
|
|
263
|
+
export declare function seedTabViewPages(target: TabViewVectorTarget, pages: readonly TabViewVectorPage[]): void;
|
|
264
|
+
/**
|
|
265
|
+
* Apply one vector operation, returning what it returned — `null` for the ops
|
|
266
|
+
* that return nothing, so a vector's `opResults` stays a flat, comparable list.
|
|
267
|
+
*/
|
|
268
|
+
export declare function applyTabViewOp(target: TabViewVectorTarget, op: TabViewVectorOp): boolean | number | null;
|
|
269
|
+
/** The page ids in order — what every vector's `order` is compared against. */
|
|
270
|
+
export declare function tabViewOrder(target: TabViewVectorTarget): string[];
|
|
271
|
+
/** Which of a vector's pages are still awaiting a `closePageFinish`, in page order. */
|
|
272
|
+
export declare function tabViewClosing(target: TabViewVectorTarget): string[];
|
|
273
|
+
/** One `successorAfterClose` expectation — the close-successor kernel on its own. */
|
|
274
|
+
export interface TabSuccessorVector {
|
|
275
|
+
/** What this row pins down. */
|
|
276
|
+
rule: string;
|
|
277
|
+
/** The C lines it is derived from. */
|
|
278
|
+
derivedFrom: string;
|
|
279
|
+
/** The page list. */
|
|
280
|
+
pages: readonly TabViewVectorPage[];
|
|
281
|
+
/** The page being closed. */
|
|
282
|
+
closingId: string;
|
|
283
|
+
/** The currently-selected id. */
|
|
284
|
+
selectedId: string | null;
|
|
285
|
+
/** Who ends up selected — `null` when the view empties. */
|
|
286
|
+
successorId: string | null;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* `select_previous_page` (adw-tab-view.c:1857-1897) with no view around it.
|
|
290
|
+
*
|
|
291
|
+
* These are the same rules the end-to-end rows exercise, stated as pure inputs
|
|
292
|
+
* so a failure names the RULE rather than the script that reached it.
|
|
293
|
+
*
|
|
294
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (TAB_VIEW_VECTORS)
|
|
295
|
+
*/
|
|
296
|
+
export declare const TAB_SUCCESSOR_VECTORS: ReadonlyArray<TabSuccessorVector>;
|
|
297
|
+
/** One `isDescendantOfPage` expectation. */
|
|
298
|
+
export interface TabDescendantVector {
|
|
299
|
+
/** What this row pins down. */
|
|
300
|
+
rule: string;
|
|
301
|
+
/** The page list. */
|
|
302
|
+
pages: readonly TabViewVectorPage[];
|
|
303
|
+
/** The candidate descendant. */
|
|
304
|
+
pageId: string | null;
|
|
305
|
+
/** The candidate ancestor. */
|
|
306
|
+
parentId: string;
|
|
307
|
+
/** Whether the walk reaches the ancestor. */
|
|
308
|
+
descendant: boolean;
|
|
309
|
+
}
|
|
310
|
+
/** `is_descendant_of` (adw-tab-view.c:1735-1742). *
|
|
311
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (TAB_VIEW_VECTORS)
|
|
312
|
+
*/
|
|
313
|
+
export declare const TAB_DESCENDANT_VECTORS: ReadonlyArray<TabDescendantVector>;
|
|
314
|
+
/** One `tabsRevealed` expectation. */
|
|
315
|
+
export interface TabsRevealedVector {
|
|
316
|
+
/** `AdwTabBar:autohide`. */
|
|
317
|
+
autohide: boolean;
|
|
318
|
+
/** `adw_tab_view_get_n_pages`. */
|
|
319
|
+
nPages: number;
|
|
320
|
+
/** `adw_tab_view_get_n_pinned_pages`. */
|
|
321
|
+
nPinnedPages: number;
|
|
322
|
+
/** `adw_tab_view_get_is_transferring_page`. */
|
|
323
|
+
isTransferringPage: boolean;
|
|
324
|
+
/** Whether the bar shows its tabs. */
|
|
325
|
+
revealed: boolean;
|
|
326
|
+
/** What this row pins down. */
|
|
327
|
+
rule: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* `update_autohide_cb` (adw-tab-bar.c:142-164), verbatim:
|
|
331
|
+
* `!autohide || n_tabs > 1 || n_pinned_tabs >= 1 || is_transferring_page`.
|
|
332
|
+
*/
|
|
333
|
+
export declare const TABS_REVEALED_VECTORS: ReadonlyArray<TabsRevealedVector>;
|
|
334
|
+
/** One `tabCloseVisible` expectation. */
|
|
335
|
+
export interface TabCloseVisibleVector {
|
|
336
|
+
/** Pointer is over the tab. */
|
|
337
|
+
hovering: boolean;
|
|
338
|
+
/** The tab is not clipped by the bar's scroll region. */
|
|
339
|
+
fullyVisible: boolean;
|
|
340
|
+
/** The tab is selected. */
|
|
341
|
+
selected: boolean;
|
|
342
|
+
/** The tab is being dragged. */
|
|
343
|
+
dragging: boolean;
|
|
344
|
+
/** The tab is pinned. */
|
|
345
|
+
pinned: boolean;
|
|
346
|
+
/** Whether the close button shows. */
|
|
347
|
+
visible: boolean;
|
|
348
|
+
/** What this row pins down. */
|
|
349
|
+
rule: string;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* `update_state`'s `show_close` (adw-tab.c:124) plus the pinned gate applied at
|
|
353
|
+
* construction (adw-tab.c:645-650). Each port shipped a different single term of
|
|
354
|
+
* this — web showed it always, NS only on the selected tab.
|
|
355
|
+
*/
|
|
356
|
+
export declare const TAB_CLOSE_VISIBLE_VECTORS: ReadonlyArray<TabCloseVisibleVector>;
|
|
357
|
+
/** One `tabTooltip` expectation. */
|
|
358
|
+
export interface TabTooltipVector {
|
|
359
|
+
/** `AdwTabPage:tooltip`. */
|
|
360
|
+
tooltip: string;
|
|
361
|
+
/** `AdwTabPage:title`. */
|
|
362
|
+
title: string;
|
|
363
|
+
/** What the tab shows. */
|
|
364
|
+
text: string;
|
|
365
|
+
/** Whether that text is Pango markup rather than plain text. */
|
|
366
|
+
markup: boolean;
|
|
367
|
+
/** What this row pins down. */
|
|
368
|
+
rule: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* `update_tooltip` (adw-tab.c:137-146): a non-empty tooltip wins and is set as
|
|
372
|
+
* MARKUP; an empty one falls back to the title, set as TEXT.
|
|
373
|
+
*
|
|
374
|
+
* WHO DRIVES THIS TABLE: only the core suite — and that is a GAP, not a reason.
|
|
375
|
+
* "Neither port has tooltips at all" was true when this was written and is not
|
|
376
|
+
* any more: the browser sets `tab.title = tabTooltip(page)`
|
|
377
|
+
* (`elements/adw-tab-view.ts`) and NativeScript re-exports it as
|
|
378
|
+
* `tabTooltipText` (`widgets/tab-view-state.ts`), so BOTH renderers consume
|
|
379
|
+
* these rows today and neither is held to them. Both surfaces are readable from
|
|
380
|
+
* their own suites, so wiring them is a loop, not new capability.
|
|
381
|
+
*
|
|
382
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (TAB_VIEW_VECTORS — both ports consume the derivation, which this header once denied)
|
|
383
|
+
*/
|
|
384
|
+
export declare const TAB_TOOLTIP_VECTORS: ReadonlyArray<TabTooltipVector>;
|
|
385
|
+
/** One `tabIconState` expectation. */
|
|
386
|
+
export interface TabIconStateVector {
|
|
387
|
+
/** `AdwTabPage:icon`. */
|
|
388
|
+
icon: string | null;
|
|
389
|
+
/** `AdwTabPage:indicator-icon`. */
|
|
390
|
+
indicatorIcon: string | null;
|
|
391
|
+
/** `AdwTabPage:loading`. */
|
|
392
|
+
loading: boolean;
|
|
393
|
+
/** `AdwTabPage:pinned`. */
|
|
394
|
+
pinned: boolean;
|
|
395
|
+
/** `AdwTabView:default-icon`. */
|
|
396
|
+
defaultIcon: string | null;
|
|
397
|
+
/** The icon actually painted, `null` for none. */
|
|
398
|
+
resolvedIcon: string | null;
|
|
399
|
+
/** Whether a spinner replaces the icon image. */
|
|
400
|
+
spinner: boolean;
|
|
401
|
+
/** Whether the icon slot shows. */
|
|
402
|
+
iconVisible: boolean;
|
|
403
|
+
/** Whether the indicator slot shows. */
|
|
404
|
+
indicatorVisible: boolean;
|
|
405
|
+
/** What this row pins down. */
|
|
406
|
+
rule: string;
|
|
407
|
+
}
|
|
408
|
+
/** `update_icons` (adw-tab.c:171-198). */
|
|
409
|
+
export declare const TAB_ICON_STATE_VECTORS: ReadonlyArray<TabIconStateVector>;
|
|
410
|
+
/** One page-descriptor normalization expectation. */
|
|
411
|
+
export interface TabPageDescriptorVector {
|
|
412
|
+
/** What this row pins down. */
|
|
413
|
+
rule: string;
|
|
414
|
+
/** The C property it is derived from. */
|
|
415
|
+
derivedFrom: string;
|
|
416
|
+
/** The declared page. */
|
|
417
|
+
spec: {
|
|
418
|
+
id: string;
|
|
419
|
+
title?: string | null;
|
|
420
|
+
tooltip?: string | null;
|
|
421
|
+
icon?: string | null;
|
|
422
|
+
indicatorIcon?: string | null;
|
|
423
|
+
loading?: boolean;
|
|
424
|
+
needsAttention?: boolean;
|
|
425
|
+
};
|
|
426
|
+
/** Resolved `title`. */
|
|
427
|
+
title: string;
|
|
428
|
+
/** Resolved `tooltip`. */
|
|
429
|
+
tooltip: string;
|
|
430
|
+
/** Resolved `icon`. */
|
|
431
|
+
icon: string | null;
|
|
432
|
+
/** Resolved `indicatorIcon`. */
|
|
433
|
+
indicatorIcon: string | null;
|
|
434
|
+
/** Resolved `loading`. */
|
|
435
|
+
loading: boolean;
|
|
436
|
+
/** Resolved `needsAttention`. */
|
|
437
|
+
needsAttention: boolean;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* What a declared page resolves to.
|
|
441
|
+
*
|
|
442
|
+
* The `null → ''` coercions are `g_set_str (&self->title, title ? title : "")`
|
|
443
|
+
* (adw-tab-view.c:3021) and its tooltip twin (:3064). The icon fields do NOT
|
|
444
|
+
* coerce: "no icon" is a state `tabIconState` branches on, so `null` has to
|
|
445
|
+
* survive.
|
|
446
|
+
*
|
|
447
|
+
* CORE-ONLY: GAP — a descriptor normaliser neither element routes its page input through. Tracked in #1072
|
|
448
|
+
*/
|
|
449
|
+
export declare const TAB_PAGE_DESCRIPTOR_VECTORS: ReadonlyArray<TabPageDescriptorVector>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** A page as a vector declares it — the input half of `AdwViewStackPageSpec`. */
|
|
2
|
+
export interface ViewStackVectorPage {
|
|
3
|
+
/** The page name. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Explicit title; omitted means "fall back to the name". */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** GTK icon name, pre-normalization. */
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** `AdwViewStackPage:visible`; omitted means `true`. */
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** One operation a vector applies after its pages are added. */
|
|
13
|
+
export type ViewStackVectorOp = {
|
|
14
|
+
readonly kind: 'selectIndex';
|
|
15
|
+
readonly index: number;
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'selectName';
|
|
18
|
+
readonly name: string | null | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'setPageVisible';
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly visible: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'removePage';
|
|
25
|
+
readonly name: string;
|
|
26
|
+
};
|
|
27
|
+
/** One expected change notification, in the order it is emitted. */
|
|
28
|
+
export interface ViewStackVectorChange {
|
|
29
|
+
/** Index of the newly-visible page, `-1` for none. */
|
|
30
|
+
index: number;
|
|
31
|
+
/** Its name, `''` for none. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Its title, `''` for none. */
|
|
34
|
+
title: string;
|
|
35
|
+
/** `true` only for an explicit select; every auto-pick is `false`. */
|
|
36
|
+
interactive: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** One end-to-end view-stack expectation. */
|
|
39
|
+
export interface ViewStackVector {
|
|
40
|
+
/** What this row pins down. */
|
|
41
|
+
rule: string;
|
|
42
|
+
/** The C function + lines it is derived from. */
|
|
43
|
+
derivedFrom: string;
|
|
44
|
+
/** The pages, added in this order. */
|
|
45
|
+
pages: readonly ViewStackVectorPage[];
|
|
46
|
+
/** Changes emitted WHILE the pages are added (the auto-pick), in order. */
|
|
47
|
+
setupChanges: readonly ViewStackVectorChange[];
|
|
48
|
+
/** Operations applied after the pages exist. */
|
|
49
|
+
ops: readonly ViewStackVectorOp[];
|
|
50
|
+
/**
|
|
51
|
+
* Return value of each op, in order. Asserted by the core suite only — the
|
|
52
|
+
* renderers drive the same operations through property setters, which have
|
|
53
|
+
* no return value; what they assert is `changes` plus the final state.
|
|
54
|
+
*/
|
|
55
|
+
opResults: readonly boolean[];
|
|
56
|
+
/** Changes emitted BY the ops, in order. */
|
|
57
|
+
changes: readonly ViewStackVectorChange[];
|
|
58
|
+
/** Final selected index, `-1` for none. */
|
|
59
|
+
visibleIndex: number;
|
|
60
|
+
/** Final selected name, `''` for none. */
|
|
61
|
+
visibleName: string;
|
|
62
|
+
/** Final selected title, `''` for none. */
|
|
63
|
+
visibleTitle: string;
|
|
64
|
+
/** Final page count. */
|
|
65
|
+
count: number;
|
|
66
|
+
/** Expected `duplicateNames`, when the row exercises them. */
|
|
67
|
+
duplicateNames?: readonly string[];
|
|
68
|
+
/** Expected `diagnostics` (C's `g_warning` texts), when the row exercises them. */
|
|
69
|
+
diagnostics?: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The selection state machine of `Adw.ViewStack`, end to end.
|
|
73
|
+
*
|
|
74
|
+
* Read the `rule` of each row before changing it: several encode behaviour that
|
|
75
|
+
* BOTH ports had wrong, and "fixing" the vector to match a renderer would undo
|
|
76
|
+
* the reason this table exists.
|
|
77
|
+
*/
|
|
78
|
+
export declare const VIEW_STACK_VECTORS: ReadonlyArray<ViewStackVector>;
|
|
79
|
+
/** One page-descriptor normalization expectation. */
|
|
80
|
+
export interface ViewStackPageDescriptorVector {
|
|
81
|
+
/** What this row pins down. */
|
|
82
|
+
rule: string;
|
|
83
|
+
/** The C property it is derived from. */
|
|
84
|
+
derivedFrom: string;
|
|
85
|
+
/** The declared page. */
|
|
86
|
+
page: ViewStackVectorPage;
|
|
87
|
+
/** Resolved `title`. */
|
|
88
|
+
title: string;
|
|
89
|
+
/** Resolved `icon`. */
|
|
90
|
+
icon: string;
|
|
91
|
+
/** Resolved `visible`. */
|
|
92
|
+
visible: boolean;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* What a declared page resolves to in `pages[i]` — the shape a bound switcher
|
|
96
|
+
* reads. `icon` is a NAME and is never `undefined`; the NS port used to store
|
|
97
|
+
* `undefined`, which the web switcher bar's `page.icon.length` would throw on.
|
|
98
|
+
*/
|
|
99
|
+
export declare const VIEW_STACK_PAGE_VECTORS: ReadonlyArray<ViewStackPageDescriptorVector>;
|
|
100
|
+
/** One `normalizeIconName` expectation. */
|
|
101
|
+
export interface ViewStackIconNameVector {
|
|
102
|
+
/** The declared `icon-name`. */
|
|
103
|
+
icon: string | null | undefined;
|
|
104
|
+
/** The normalized result. */
|
|
105
|
+
normalized: string;
|
|
106
|
+
/** What this row pins down. */
|
|
107
|
+
rule: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `normalizeIconName` — the one home for a `-symbolic` strip that appeared
|
|
111
|
+
* eleven times across the web package and zero times in NS, plus the token guard
|
|
112
|
+
* that appeared exactly ONCE (`<adw-split-button>`) and was missing from every
|
|
113
|
+
* other copy.
|
|
114
|
+
*
|
|
115
|
+
* The guard rows are not hypothetical: `<adw-menu-button>` interpolated the raw
|
|
116
|
+
* name into `class="adw-icon adw-menu-button-icon adw-icon--<name>"`, so
|
|
117
|
+
* `icon-name="a b"` shipped a stray `b` class — for its own icon and for every
|
|
118
|
+
* JSON menu entry's. NOTHING in the build was in a position to notice, because
|
|
119
|
+
* the one element that DID guard passed its own spec.
|
|
120
|
+
*/
|
|
121
|
+
export declare const VIEW_STACK_ICON_NAME_VECTORS: ReadonlyArray<ViewStackIconNameVector>;
|