@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,184 @@
|
|
|
1
|
+
import type { MakeComparableOptions, PreferencesGroupHeaderInput, PreferencesGroupHeaderState, PreferencesSearchPage, PreferencesSearchRow, SearchRowSubtitleInput } from '../preferences.js';
|
|
2
|
+
/** One `derivePreferencesGroupHeader` expectation. */
|
|
3
|
+
export interface PreferencesGroupHeaderVector {
|
|
4
|
+
/** The group's title / description / suffix / row count. */
|
|
5
|
+
input: PreferencesGroupHeaderInput;
|
|
6
|
+
/** The five states C derives from it. */
|
|
7
|
+
state: PreferencesGroupHeaderState;
|
|
8
|
+
/**
|
|
9
|
+
* Set when the expectation only holds for a renderer that INTERPRETS Pango
|
|
10
|
+
* markup in its labels. Both current renderers paint the string verbatim
|
|
11
|
+
* and pass `useMarkup: false`, so their suites skip these rows rather than
|
|
12
|
+
* assert a rule they deliberately do not implement. Closing the
|
|
13
|
+
* markup-rendering gap is what retires the flag.
|
|
14
|
+
*/
|
|
15
|
+
dependsOnMarkup?: boolean;
|
|
16
|
+
/** Why this row exists — the rule or the regression it pins down. */
|
|
17
|
+
rule: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `update_title_visibility` / `update_description_visibility` /
|
|
21
|
+
* `update_listbox_visibility` / `is_single_line` / `update_header_visibility`
|
|
22
|
+
* (adw-preferences-group.c:91-156).
|
|
23
|
+
*/
|
|
24
|
+
export declare const PREFERENCES_GROUP_HEADER_VECTORS: ReadonlyArray<PreferencesGroupHeaderVector>;
|
|
25
|
+
/** One `defaultCaseFolder` expectation. */
|
|
26
|
+
export interface CaseFoldVector {
|
|
27
|
+
/** The string being folded. */
|
|
28
|
+
text: string;
|
|
29
|
+
/** `g_utf8_casefold(text)` — Unicode FULL case folding. */
|
|
30
|
+
folded: string;
|
|
31
|
+
/** What a bare `toLowerCase()` returns, kept in the table as the trap. */
|
|
32
|
+
naiveLowerCase: string;
|
|
33
|
+
/** Why this row exists. */
|
|
34
|
+
rule: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `g_utf8_casefold` (adw-preferences-dialog.c:101, :133).
|
|
38
|
+
*
|
|
39
|
+
* Every row where `folded !== naiveLowerCase` is a query a `toLowerCase()` port
|
|
40
|
+
* silently fails to match — in German, Greek and any text with a typographic
|
|
41
|
+
* ligature. None of it is visible in an ASCII test suite, which is exactly why
|
|
42
|
+
* the rows are here.
|
|
43
|
+
*
|
|
44
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
45
|
+
*/
|
|
46
|
+
export declare const CASE_FOLD_VECTORS: ReadonlyArray<CaseFoldVector>;
|
|
47
|
+
/** One `stripMarkup` expectation. */
|
|
48
|
+
export interface StripMarkupVector {
|
|
49
|
+
/** The (already folded, in the real pipeline) markup string. */
|
|
50
|
+
markup: string;
|
|
51
|
+
/** The plain text, or `null` when `pango_parse_markup` fails. */
|
|
52
|
+
plain: string | null;
|
|
53
|
+
/** Why this row exists. */
|
|
54
|
+
rule: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `pango_parse_markup (…, accel_marker 0, …)` as `make_comparable` calls it
|
|
58
|
+
* (adw-preferences-dialog.c:104-114).
|
|
59
|
+
*
|
|
60
|
+
* `null` is not an error case to be smoothed over: it is the branch where C
|
|
61
|
+
* logs a `g_critical` and KEEPS the unparsed string, so every `null` row below
|
|
62
|
+
* is a row that must stay searchable under its literal spelling.
|
|
63
|
+
*
|
|
64
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
65
|
+
*/
|
|
66
|
+
export declare const STRIP_MARKUP_VECTORS: ReadonlyArray<StripMarkupVector>;
|
|
67
|
+
/** One `stripMnemonic` expectation. */
|
|
68
|
+
export interface StripMnemonicVector {
|
|
69
|
+
/** The label text with accel markers. */
|
|
70
|
+
text: string;
|
|
71
|
+
/** What `adw_strip_mnemonic` returns. */
|
|
72
|
+
stripped: string;
|
|
73
|
+
/** Why this row exists. */
|
|
74
|
+
rule: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `adw_strip_mnemonic` (adw-widget-utils.c:685-703) — `g_markup_escape_text`
|
|
78
|
+
* followed by `pango_parse_markup` with `accel_marker = '_'`.
|
|
79
|
+
*
|
|
80
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
81
|
+
*/
|
|
82
|
+
export declare const STRIP_MNEMONIC_VECTORS: ReadonlyArray<StripMnemonicVector>;
|
|
83
|
+
/** One `makeComparable` expectation. */
|
|
84
|
+
export interface MakeComparableVector {
|
|
85
|
+
/** The raw title or subtitle. */
|
|
86
|
+
source: string;
|
|
87
|
+
/** The row flags plus the title/subtitle `allowUnderline` distinction. */
|
|
88
|
+
options: MakeComparableOptions;
|
|
89
|
+
/** What the search compares against. */
|
|
90
|
+
comparable: string;
|
|
91
|
+
/** Why this row exists. */
|
|
92
|
+
rule: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `make_comparable` (adw-preferences-dialog.c:96-123).
|
|
96
|
+
*
|
|
97
|
+
* The defaults matter as much as the rows: `use-markup` defaults to TRUE
|
|
98
|
+
* (adw-preferences-row.c:185-188) and `use-underline` to FALSE (:155-158), so
|
|
99
|
+
* an ordinary row's title IS markup-parsed and is NOT mnemonic-stripped.
|
|
100
|
+
*
|
|
101
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
102
|
+
*/
|
|
103
|
+
export declare const MAKE_COMPARABLE_VECTORS: ReadonlyArray<MakeComparableVector>;
|
|
104
|
+
/** One `rowMatchesQuery` expectation. */
|
|
105
|
+
export interface RowMatchVector {
|
|
106
|
+
/** The row being tested. */
|
|
107
|
+
row: PreferencesSearchRow;
|
|
108
|
+
/** What the user typed into the search entry. */
|
|
109
|
+
query: string;
|
|
110
|
+
/** Whether `filter_search_results` keeps the row. */
|
|
111
|
+
matches: boolean;
|
|
112
|
+
/** Why this row exists. */
|
|
113
|
+
rule: string;
|
|
114
|
+
}
|
|
115
|
+
/** `filter_search_results` (adw-preferences-dialog.c:125-153). *
|
|
116
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
117
|
+
*/
|
|
118
|
+
export declare const ROW_MATCH_VECTORS: ReadonlyArray<RowMatchVector>;
|
|
119
|
+
/** One `collectSearchRows` expectation. */
|
|
120
|
+
export interface SearchCorpusVector {
|
|
121
|
+
/** The page tree being indexed. */
|
|
122
|
+
pages: readonly PreferencesSearchPage[];
|
|
123
|
+
/** The row titles the corpus contains, in order. */
|
|
124
|
+
titles: readonly string[];
|
|
125
|
+
/** Why this row exists. */
|
|
126
|
+
rule: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The three-filter chain: `adw_preferences_dialog_init`'s visible-page filter
|
|
130
|
+
* (:632-641) over `adw_preferences_page_get_rows`' `is_visible_group`
|
|
131
|
+
* (adw-preferences-page.c:831-834) over `adw_preferences_group_get_rows`'
|
|
132
|
+
* `row_has_title` (adw-preferences-group.c:736-740).
|
|
133
|
+
*
|
|
134
|
+
* Dropping any clause is invisible — nothing errors, the search just quietly
|
|
135
|
+
* indexes the wrong set — which is why these rows are separate from the
|
|
136
|
+
* end-to-end ones.
|
|
137
|
+
*
|
|
138
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
139
|
+
*/
|
|
140
|
+
export declare const SEARCH_CORPUS_VECTORS: ReadonlyArray<SearchCorpusVector>;
|
|
141
|
+
/** One `createSearchRowSubtitle` expectation. */
|
|
142
|
+
export interface SearchRowSubtitleVector {
|
|
143
|
+
/** The matched row's ancestors, plus the visible-page count. */
|
|
144
|
+
input: SearchRowSubtitleInput;
|
|
145
|
+
/** The second line of the result row, `null` for none. */
|
|
146
|
+
subtitle: string | null;
|
|
147
|
+
/** Why this row exists. */
|
|
148
|
+
rule: string;
|
|
149
|
+
}
|
|
150
|
+
/** `create_search_row_subtitle` (adw-preferences-dialog.c:168-234). *
|
|
151
|
+
* CORE-ONLY: an internal step of a pipeline whose COMPOSED result is renderer-driven — driving it separately would assert the same thing twice (PREFERENCES_SEARCH_VECTORS)
|
|
152
|
+
*/
|
|
153
|
+
export declare const SEARCH_ROW_SUBTITLE_VECTORS: ReadonlyArray<SearchRowSubtitleVector>;
|
|
154
|
+
/**
|
|
155
|
+
* The page tree both renderer suites materialise into real widgets.
|
|
156
|
+
*
|
|
157
|
+
* Chosen so every clause of the pipeline is exercised by at least one query:
|
|
158
|
+
* two visible pages (so subtitles carry the arrow) plus a hidden third, a hidden
|
|
159
|
+
* group, an untitled row, an action row with a searchable subtitle, an entry row
|
|
160
|
+
* whose subtitle must NOT be searched, a German title for the fold, and a
|
|
161
|
+
* markup title.
|
|
162
|
+
*/
|
|
163
|
+
export declare const PREFERENCES_SEARCH_PAGES: ReadonlyArray<PreferencesSearchPage>;
|
|
164
|
+
/** One expected search result, as a renderer can read it off its own result row. */
|
|
165
|
+
export interface PreferencesSearchExpectation {
|
|
166
|
+
/** The result row's title — copied verbatim from the matched row. */
|
|
167
|
+
title: string;
|
|
168
|
+
/** The result row's subtitle. */
|
|
169
|
+
subtitle: string | null;
|
|
170
|
+
}
|
|
171
|
+
/** One end-to-end `searchPreferences` expectation over {@link PREFERENCES_SEARCH_PAGES}. */
|
|
172
|
+
export interface PreferencesSearchVector {
|
|
173
|
+
/** What the user typed. */
|
|
174
|
+
query: string;
|
|
175
|
+
/** The results, in corpus order. */
|
|
176
|
+
results: readonly PreferencesSearchExpectation[];
|
|
177
|
+
/** Why this row exists. */
|
|
178
|
+
rule: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The whole pipeline over {@link PREFERENCES_SEARCH_PAGES} — corpus, filter and
|
|
182
|
+
* subtitle at once. This is the table a renderer drives its own widgets with.
|
|
183
|
+
*/
|
|
184
|
+
export declare const PREFERENCES_SEARCH_VECTORS: ReadonlyArray<PreferencesSearchVector>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AdwComboOption, ComboStateChange } from '../rows.js';
|
|
2
|
+
/**
|
|
3
|
+
* One mutation in a combo scenario. DATA, not a closure: a renderer suite
|
|
4
|
+
* replays these against a real widget (set the options, pick from the chooser)
|
|
5
|
+
* and compares what the user would see.
|
|
6
|
+
*/
|
|
7
|
+
export type ComboSelectionStep = {
|
|
8
|
+
op: 'setOptions';
|
|
9
|
+
options: ReadonlyArray<AdwComboOption>;
|
|
10
|
+
} | {
|
|
11
|
+
op: 'setSelectedIndex';
|
|
12
|
+
index: number;
|
|
13
|
+
} | {
|
|
14
|
+
op: 'setSelectedValue';
|
|
15
|
+
value: string;
|
|
16
|
+
} | {
|
|
17
|
+
op: 'select';
|
|
18
|
+
index: number;
|
|
19
|
+
};
|
|
20
|
+
/** One combo-selection scenario. */
|
|
21
|
+
export interface ComboSelectionVector {
|
|
22
|
+
/** Short scenario name. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** The mutations, applied in order to a fresh state. */
|
|
25
|
+
steps: readonly ComboSelectionStep[];
|
|
26
|
+
/** `selectedIndex` afterwards. */
|
|
27
|
+
selected: number;
|
|
28
|
+
/** `selectedValue` afterwards — `''` when the index sits outside the options. */
|
|
29
|
+
value: string;
|
|
30
|
+
/** `selectedLabel` afterwards — the text the inline value / button shows. */
|
|
31
|
+
label: string;
|
|
32
|
+
/**
|
|
33
|
+
* Every change the state emits, in order. This IS the renderer's feed: the
|
|
34
|
+
* label repaint comes off `label`, and the `notify::selected` re-emit is
|
|
35
|
+
* gated on `interactive`.
|
|
36
|
+
*/
|
|
37
|
+
emitted: ReadonlyArray<ComboStateChange>;
|
|
38
|
+
/** Why this row exists — the rule or edge case it pins down. */
|
|
39
|
+
rule: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `adw_combo_row_set_selected` (adw-combo-row.c:772-789) and the notify chain it
|
|
43
|
+
* drives (:136-155, :157-185), plus the two port answers the C leaves open (see
|
|
44
|
+
* the module header).
|
|
45
|
+
*
|
|
46
|
+
* Note that EVERY scenario starts with a `setOptions`, which is itself an
|
|
47
|
+
* emission: the model is what the label is read out of, so a renderer that
|
|
48
|
+
* repaints only on a selection change draws a stale value after the list is
|
|
49
|
+
* replaced. That first change is in `emitted` for exactly that reason.
|
|
50
|
+
*/
|
|
51
|
+
export declare const COMBO_SELECTION_VECTORS: ReadonlyArray<ComboSelectionVector>;
|
|
52
|
+
/** One `presentsChooser` expectation. */
|
|
53
|
+
export interface ComboChooserVector {
|
|
54
|
+
/** How many options the model holds. */
|
|
55
|
+
count: number;
|
|
56
|
+
/** Whether the arrow is drawn and the row is activatable. */
|
|
57
|
+
presentsChooser: boolean;
|
|
58
|
+
/** The rule this row pins down. */
|
|
59
|
+
rule: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `model_changed` (adw-combo-row.c:187-195) — one predicate, `n_items > 1`,
|
|
63
|
+
* driving BOTH `gtk_widget_set_visible (arrow_box, …)` and
|
|
64
|
+
* `gtk_list_box_row_set_activatable (row, …)`.
|
|
65
|
+
*
|
|
66
|
+
* A row with one option or none has nothing to choose, so it stops presenting
|
|
67
|
+
* itself as a chooser. Neither port did this: a NativeScript `AdwComboRow` with
|
|
68
|
+
* a single option still showed its chevron and opened an `action()` sheet with
|
|
69
|
+
* one entry, and the browser element behaved the same way.
|
|
70
|
+
*
|
|
71
|
+
* `Gtk.DropDown` is deliberately NOT covered — it keeps its arrow at any count,
|
|
72
|
+
* which is why this lives on the combo ROW rather than in the shared chooser.
|
|
73
|
+
*/
|
|
74
|
+
export declare const COMBO_CHOOSER_VECTORS: ReadonlyArray<ComboChooserVector>;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { AdwSidebarItemSpec, AdwSidebarSectionSpec, SidebarHeaderSpec } from '../sidebar.js';
|
|
2
|
+
/** One `clampSidebarSelection` expectation. */
|
|
3
|
+
export interface SidebarClampVector {
|
|
4
|
+
/** The index handed to `AdwSidebar:selected`. */
|
|
5
|
+
index: number;
|
|
6
|
+
/** How many items the sidebar has (`n_items`). */
|
|
7
|
+
count: number;
|
|
8
|
+
/** What `selected` reads back as: the index itself, or `-1` for no selection. */
|
|
9
|
+
selected: number;
|
|
10
|
+
/** Why this row exists. */
|
|
11
|
+
rule: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `adw_sidebar_set_selected` (adw-sidebar.c:3028-3029):
|
|
15
|
+
* `if (selected >= self->n_items) selected = GTK_INVALID_LIST_POSITION;`
|
|
16
|
+
*
|
|
17
|
+
* The negative rows are not a TS invention — `selected` is a `guint`, so `-7`
|
|
18
|
+
* arrives as `4294967289`, which is `>= n_items`. The fractional/`NaN` rows are
|
|
19
|
+
* the generalisation to values C cannot express: not a valid position is no
|
|
20
|
+
* position. They are the inputs that used to be wrong — the web port truncated
|
|
21
|
+
* `"1.5"` to row 1 and the NativeScript port stored `1.5` verbatim, highlighting
|
|
22
|
+
* no row while reporting a selection.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SIDEBAR_CLAMP_VECTORS: ReadonlyArray<SidebarClampVector>;
|
|
25
|
+
/** One `adjustSidebarSelection` expectation — an `items-changed` splice. */
|
|
26
|
+
export interface SidebarItemsChangedVector {
|
|
27
|
+
/** `selected` before the splice. */
|
|
28
|
+
selected: number;
|
|
29
|
+
/** `n_items` before the splice. */
|
|
30
|
+
oldCount: number;
|
|
31
|
+
/** `n_items` after the splice. */
|
|
32
|
+
newCount: number;
|
|
33
|
+
/** Flat index the splice starts at. */
|
|
34
|
+
position: number;
|
|
35
|
+
/** How many items were removed. */
|
|
36
|
+
removed: number;
|
|
37
|
+
/** How many items were added. */
|
|
38
|
+
added: number;
|
|
39
|
+
/** `selected` after `items_changed_cb` has run. */
|
|
40
|
+
expected: number;
|
|
41
|
+
/** Why this row exists. */
|
|
42
|
+
rule: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `items_changed_cb` (adw-sidebar.c:2246-2284) — the derivation NEITHER port had.
|
|
46
|
+
*
|
|
47
|
+
* The last row documents libadwaita's unsigned wraparound: with no selection,
|
|
48
|
+
* `selected` is `G_MAXUINT`, so the "splice covers the selection" test can never
|
|
49
|
+
* fire and the shift branch computes `G_MAXUINT + added - removed`, which wraps
|
|
50
|
+
* into range. It is reproduced rather than repaired — a renderer that "fixed" it
|
|
51
|
+
* would stop matching the toolkit it mirrors.
|
|
52
|
+
*/
|
|
53
|
+
export declare const SIDEBAR_ITEMS_CHANGED_VECTORS: ReadonlyArray<SidebarItemsChangedVector>;
|
|
54
|
+
/** One flattened-model expectation for a whole section list. */
|
|
55
|
+
export interface SidebarModelVector {
|
|
56
|
+
/** Human-readable name, used as the test title. */
|
|
57
|
+
name: string;
|
|
58
|
+
/** The declared sections. */
|
|
59
|
+
sections: ReadonlyArray<AdwSidebarSectionSpec>;
|
|
60
|
+
/** `n_items` — the size of the selection index space. */
|
|
61
|
+
count: number;
|
|
62
|
+
/** `adw_sidebar_section_get_first_index` per section, in declaration order. */
|
|
63
|
+
sectionFirstIndex: ReadonlyArray<number>;
|
|
64
|
+
/** Every rendered row, in render order. */
|
|
65
|
+
flat: ReadonlyArray<{
|
|
66
|
+
index: number;
|
|
67
|
+
sectionIndex: number;
|
|
68
|
+
sectionItemIndex: number;
|
|
69
|
+
title: string;
|
|
70
|
+
}>;
|
|
71
|
+
/** The headers that get drawn, in render order. */
|
|
72
|
+
headers: ReadonlyArray<SidebarHeaderSpec>;
|
|
73
|
+
/** Why this row exists. */
|
|
74
|
+
rule: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The flat index space (`items_changed_cb`'s section walk, adw-sidebar.c:2261-2267
|
|
78
|
+
* + `adw_sidebar_item_get_index`, adw-sidebar-item.c:1040) and the header
|
|
79
|
+
* derivation (`set_header_cb`/`create_header`, adw-sidebar.c:1532-1563, :1483-1530).
|
|
80
|
+
*
|
|
81
|
+
* The empty-leading-section rows are the ones the web port got wrong: it keyed
|
|
82
|
+
* `.first` and the hidden-separator case off the DECLARATION index, so an empty
|
|
83
|
+
* or fully-filtered first section drew a stray separator and cost section 1 the
|
|
84
|
+
* flush-to-top padding `.header.first > .heading` prescribes.
|
|
85
|
+
*/
|
|
86
|
+
export declare const SIDEBAR_MODEL_VECTORS: ReadonlyArray<SidebarModelVector>;
|
|
87
|
+
/** One item-label-visibility expectation. */
|
|
88
|
+
export interface SidebarItemFlagsVector {
|
|
89
|
+
/** The declared item. */
|
|
90
|
+
item: AdwSidebarItemSpec;
|
|
91
|
+
/** `string_is_not_empty(title)` (adw-sidebar.c:1411-1412). */
|
|
92
|
+
titleVisible: boolean;
|
|
93
|
+
/** `string_is_not_empty(subtitle)` (adw-sidebar.c:1420-1421). */
|
|
94
|
+
subtitleVisible: boolean;
|
|
95
|
+
/** `notify_icon_cb`'s `icon_name && *icon_name` (adw-sidebar.c:1303). */
|
|
96
|
+
iconVisible: boolean;
|
|
97
|
+
/** Why this row exists. */
|
|
98
|
+
rule: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The three `string_is_not_empty` bindings, so renderers stop spelling
|
|
102
|
+
* `x.length === 0` themselves — and so the `'-symbolic'` row pins that icon
|
|
103
|
+
* visibility is decided on the RAW name, before any suffix stripping.
|
|
104
|
+
*/
|
|
105
|
+
export declare const SIDEBAR_ITEM_FLAG_VECTORS: ReadonlyArray<SidebarItemFlagsVector>;
|
|
106
|
+
/** One activation (row click) expectation. */
|
|
107
|
+
export interface SidebarActivationVector {
|
|
108
|
+
/** Human-readable name, used as the test title. */
|
|
109
|
+
name: string;
|
|
110
|
+
/** The declared sections. */
|
|
111
|
+
sections: ReadonlyArray<AdwSidebarSectionSpec>;
|
|
112
|
+
/** The selection to establish before clicking, applied through `setSelected`. */
|
|
113
|
+
initialSelected: number;
|
|
114
|
+
/** The flat index that is clicked. */
|
|
115
|
+
activate: number;
|
|
116
|
+
/** Whether a row was actually activated — the `activated` signal. */
|
|
117
|
+
activated: boolean;
|
|
118
|
+
/** Whether `notify::selected` fired. */
|
|
119
|
+
selectionChanged: boolean;
|
|
120
|
+
/** `selected` afterwards. */
|
|
121
|
+
selected: number;
|
|
122
|
+
/** Why this row exists. */
|
|
123
|
+
rule: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The selection/activation split: `row-selected` fires only on a real change,
|
|
127
|
+
* `row-activated` fires on EVERY click (adw-sidebar.c:1585-1612), and page mode
|
|
128
|
+
* does the same thing in one callback (`boxed_row_activated_cb`, :1662-1674).
|
|
129
|
+
*
|
|
130
|
+
* The re-click row is the one that matters: it is the documented way to reveal
|
|
131
|
+
* the content pane of a split view (adw-sidebar.c:73-75), and the NativeScript
|
|
132
|
+
* port could not express it at all — its setter early-returned on an unchanged
|
|
133
|
+
* index and it emitted no activation signal.
|
|
134
|
+
*/
|
|
135
|
+
export declare const SIDEBAR_ACTIVATION_VECTORS: ReadonlyArray<SidebarActivationVector>;
|
|
136
|
+
/** One filter / empty-state expectation. */
|
|
137
|
+
export interface SidebarFilterVector {
|
|
138
|
+
/** Human-readable name, used as the test title. */
|
|
139
|
+
name: string;
|
|
140
|
+
/** The declared sections. */
|
|
141
|
+
sections: ReadonlyArray<AdwSidebarSectionSpec>;
|
|
142
|
+
/** Item titles the filter keeps; the suites build `(item) => keepTitles.includes(item.title)`. */
|
|
143
|
+
keepTitles: ReadonlyArray<string>;
|
|
144
|
+
/** `n_items` — UNCHANGED by the filter, because the selection counts the unfiltered model. */
|
|
145
|
+
count: number;
|
|
146
|
+
/** Flat indices of the rows that survive the filter, in render order. */
|
|
147
|
+
visibleIndices: ReadonlyArray<number>;
|
|
148
|
+
/** The headers that get drawn once the filter is applied. */
|
|
149
|
+
headers: ReadonlyArray<SidebarHeaderSpec>;
|
|
150
|
+
/** The `.empty` / placeholder state — computed from the FILTERED count. */
|
|
151
|
+
isEmpty: boolean;
|
|
152
|
+
/** Why this row exists. */
|
|
153
|
+
rule: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* `adw_sidebar_set_filter` (adw-sidebar.c:3127-3139) feeds a `GtkFilterListModel`
|
|
157
|
+
* that only the row list and the placeholder see; the selection index space stays
|
|
158
|
+
* on the unfiltered `items_model` (adw-sidebar.c:2866 vs :2177-2180), and
|
|
159
|
+
* `update_placeholder` counts the filtered one (adw-sidebar.c:1828, :1839-1842).
|
|
160
|
+
*
|
|
161
|
+
* Neither port had a filter or a placeholder at all.
|
|
162
|
+
*/
|
|
163
|
+
export declare const SIDEBAR_FILTER_VECTORS: ReadonlyArray<SidebarFilterVector>;
|
|
164
|
+
/** One mode expectation. */
|
|
165
|
+
export interface SidebarModeVector {
|
|
166
|
+
/** The mode being set. */
|
|
167
|
+
mode: 'sidebar' | 'page';
|
|
168
|
+
/** Whether the selection is PAINTED in that mode. */
|
|
169
|
+
selectionVisible: boolean;
|
|
170
|
+
/** Why this row exists. */
|
|
171
|
+
rule: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* `adw_sidebar_set_mode` (adw-sidebar.c:2960-2981) never touches `selected`:
|
|
175
|
+
* "In this mode, the selection is invisible and only tracked to determine the
|
|
176
|
+
* initially selected item once switched back to sidebar mode" (adw-sidebar.c:2948-2951).
|
|
177
|
+
*
|
|
178
|
+
* The web port painted its `.selected` highlight in BOTH modes; page mode builds
|
|
179
|
+
* plain `AdwActionRow`s in a boxed list (`create_boxed_row`, adw-sidebar.c:1676)
|
|
180
|
+
* and shows no selected row at all.
|
|
181
|
+
*/
|
|
182
|
+
export declare const SIDEBAR_MODE_VECTORS: ReadonlyArray<SidebarModeVector>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** How close two radian values have to be to count as equal. */
|
|
2
|
+
export declare const SPINNER_ARC_TOLERANCE = 1e-9;
|
|
3
|
+
/**
|
|
4
|
+
* The arc lengths actually DRAWN, in radians — measured over one cycle at 200k
|
|
5
|
+
* samples, not read off the constants.
|
|
6
|
+
*
|
|
7
|
+
* The distinction matters and is easy to get wrong: `MAX_ARC_LENGTH` is
|
|
8
|
+
* `pi * 0.9` (162 degrees), and both `get_arc_start` and `get_arc_end` lerp
|
|
9
|
+
* TOWARDS it — but each then subtracts the drift term
|
|
10
|
+
* `angle * MAX_ARC_LENGTH / cycle_length`, which is what makes the figure
|
|
11
|
+
* advance around the circle. The two ends drift together, so the visible arc
|
|
12
|
+
* peaks at **102.8 degrees**, not 162. Reading the constant as the drawn length
|
|
13
|
+
* is the obvious mistake; issue #1066 made it in its own summary table.
|
|
14
|
+
*
|
|
15
|
+
* The MINIMUM is exactly `MIN_ARC_LENGTH`, because the drift is zero at the
|
|
16
|
+
* cycle boundary where the arc is shortest.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SPINNER_ARC_ENVELOPE: {
|
|
19
|
+
/** Exactly `MIN_ARC_LENGTH` — 2.7 degrees, at the cycle boundary. */
|
|
20
|
+
readonly min: number;
|
|
21
|
+
/** 102.815... degrees. Asserted to a tolerance, not to the last digit. */
|
|
22
|
+
readonly max: 1.794463;
|
|
23
|
+
/** How far a measured extreme may sit from the value above. */
|
|
24
|
+
readonly tolerance: 0.0001;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* `get_arc_start` / `get_arc_end` (adw-spinner-paintable.c:109-145) at the four
|
|
28
|
+
* corners of one cycle, plus the resting pose.
|
|
29
|
+
*
|
|
30
|
+
* The lengths are DERIVED from the C's own constants rather than typed in: the
|
|
31
|
+
* point of the rows is which MOMENT each is, and a hand-copied radian would be a
|
|
32
|
+
* second reading of the same arithmetic the implementation does. What they pin
|
|
33
|
+
* is the shape — that the arc is shortest at the cycle boundary, longest around
|
|
34
|
+
* the extend/contract handover, and never leaves `[MIN_ARC_LENGTH,
|
|
35
|
+
* MAX_ARC_LENGTH]`.
|
|
36
|
+
*/
|
|
37
|
+
export interface SpinnerArcShapeVector {
|
|
38
|
+
/** Fraction of one arc cycle, 0..1. */
|
|
39
|
+
phase: number;
|
|
40
|
+
/** What happens here. */
|
|
41
|
+
rule: string;
|
|
42
|
+
}
|
|
43
|
+
/** The moments worth naming in one arc cycle. *
|
|
44
|
+
* CORE-ONLY: the arc is drawn per frame from `spinnerArc`, and a renderer can only show the RESULT — the browser suite asserts the drawn envelope and the round caps, which is the observable half
|
|
45
|
+
*/
|
|
46
|
+
export declare const SPINNER_ARC_PHASE_VECTORS: ReadonlyArray<SpinnerArcShapeVector>;
|
|
47
|
+
/** One "is this constant what the C says" expectation. */
|
|
48
|
+
export interface SpinnerConstantVector {
|
|
49
|
+
/** The constant's name in the C. */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Its value, as a multiple of pi where the C writes one. */
|
|
52
|
+
value: number;
|
|
53
|
+
/** Where it is defined and what the ports had instead. */
|
|
54
|
+
rule: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The `#define`s at adw-spinner-paintable.c:18-33 and adw-spinner.c:14-15.
|
|
58
|
+
*
|
|
59
|
+
* A constant table looks redundant next to the implementation until you read the
|
|
60
|
+
* `rule` column: five of these seven were WRONG or absent in a shipping port,
|
|
61
|
+
* and a table is what makes "the port picked its own number" fail a test rather
|
|
62
|
+
* than look like a design choice.
|
|
63
|
+
*
|
|
64
|
+
* CORE-ONLY: a table OF constants: what a renderer can show is the geometry they produce, which the browser suite asserts through SPINNER_GEOMETRY/SIZE_VECTORS
|
|
65
|
+
*/
|
|
66
|
+
export declare const SPINNER_CONSTANT_VECTORS: ReadonlyArray<SpinnerConstantVector>;
|