@gjsify/adwaita-core 0.51.1 → 0.53.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/accent.js +1 -1
- package/lib/esm/appearance.js +2 -0
- package/lib/esm/apple-accent.js +1 -0
- package/lib/esm/box.js +1 -0
- package/lib/esm/conformance/accent.js +1 -1
- package/lib/esm/conformance/appearance.js +4 -0
- package/lib/esm/conformance/box.js +1 -0
- package/lib/esm/conformance/dialog.js +1 -1
- package/lib/esm/conformance/index.js +1 -1
- package/lib/esm/conformance/label.js +1 -0
- package/lib/esm/conformance/rows.js +1 -1
- package/lib/esm/conformance/shared-trees.js +1 -1
- package/lib/esm/conformance/tags.js +1 -0
- package/lib/esm/conformance/value-lists.js +1 -0
- package/lib/esm/dialog.js +1 -1
- package/lib/esm/gio-menu.js +1 -0
- package/lib/esm/gtk-adjustment.js +1 -0
- package/lib/esm/gtk-string-list.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/label.js +1 -0
- package/lib/esm/markup.js +4 -0
- package/lib/esm/rows.js +1 -1
- package/lib/esm/shortcut-format.js +1 -0
- package/lib/esm/source.js +1 -0
- package/lib/esm/tags.js +1 -0
- package/lib/esm/tokens.generated.js +1 -1
- package/lib/types/accent.d.ts +36 -0
- package/lib/types/appearance.d.ts +60 -0
- package/lib/types/appearance.spec.d.ts +2 -0
- package/lib/types/apple-accent.d.ts +18 -0
- package/lib/types/apple-accent.spec.d.ts +2 -0
- package/lib/types/box.d.ts +18 -0
- package/lib/types/box.spec.d.ts +2 -0
- package/lib/types/conformance/accent.d.ts +21 -0
- package/lib/types/conformance/appearance.d.ts +13 -0
- package/lib/types/conformance/box.d.ts +21 -0
- package/lib/types/conformance/dialog.d.ts +123 -1
- package/lib/types/conformance/index.d.ts +18 -8
- package/lib/types/conformance/label.d.ts +115 -0
- package/lib/types/conformance/list.d.ts +1 -1
- package/lib/types/conformance/rows.d.ts +29 -0
- package/lib/types/conformance/shared-trees.d.ts +155 -5
- package/lib/types/conformance/tags.d.ts +46 -0
- package/lib/types/conformance/value-lists.d.ts +19 -0
- package/lib/types/dialog.d.ts +163 -0
- package/lib/types/gio-menu.d.ts +46 -0
- package/lib/types/gtk-adjustment.d.ts +73 -0
- package/lib/types/gtk-adjustment.spec.d.ts +2 -0
- package/lib/types/gtk-string-list.d.ts +70 -0
- package/lib/types/gtk-string-list.spec.d.ts +2 -0
- package/lib/types/index.d.ts +21 -5
- package/lib/types/label.d.ts +135 -0
- package/lib/types/label.spec.d.ts +2 -0
- package/lib/types/markup.d.ts +14 -0
- package/lib/types/markup.spec.d.ts +2 -0
- package/lib/types/rows.d.ts +20 -0
- package/lib/types/shortcut-format.d.ts +25 -0
- package/lib/types/shortcut-format.spec.d.ts +2 -0
- package/lib/types/source.d.ts +94 -0
- package/lib/types/source.spec.d.ts +2 -0
- package/lib/types/tags.d.ts +48 -0
- package/lib/types/tags.spec.d.ts +2 -0
- package/lib/types/tokens.generated.d.ts +1 -1
- package/package.json +12 -4
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type AdwAccentColorName } from './accent.js';
|
|
2
|
+
/**
|
|
3
|
+
* The system's colour-scheme preference, in the XDG Settings portal's own terms
|
|
4
|
+
* (`org.freedesktop.appearance color-scheme`: 0 no preference, 1 dark, 2 light).
|
|
5
|
+
* `no-preference` is an ANSWER — the user chose nothing — and differs from the
|
|
6
|
+
* field being absent, which means nothing could be read.
|
|
7
|
+
*/
|
|
8
|
+
export type AdwSystemColorScheme = 'light' | 'dark' | 'no-preference';
|
|
9
|
+
/** Every {@link AdwSystemColorScheme}. */
|
|
10
|
+
export declare const ADW_SYSTEM_COLOR_SCHEMES: readonly AdwSystemColorScheme[];
|
|
11
|
+
/**
|
|
12
|
+
* What the desktop says about its appearance. Every field is optional and an
|
|
13
|
+
* absent field means UNKNOWN: a reader that cannot answer leaves it out rather
|
|
14
|
+
* than guessing the default, so a consumer can tell "the user picked blue"
|
|
15
|
+
* from "nothing was read".
|
|
16
|
+
*/
|
|
17
|
+
export interface DesktopAppearance {
|
|
18
|
+
/** The system accent, snapped to libadwaita's nine with `nearestAccent`. */
|
|
19
|
+
readonly accent?: AdwAccentColorName;
|
|
20
|
+
/** The raw system accent as `#rrggbb`, when the source reports a colour rather than a name. */
|
|
21
|
+
readonly accentRgb?: string;
|
|
22
|
+
/** The colour-scheme preference. */
|
|
23
|
+
readonly colorScheme?: AdwSystemColorScheme;
|
|
24
|
+
}
|
|
25
|
+
/** `<meta name="adw-accent" content="purple">` — one of the nine names, or `system` (see ADR 0078). */
|
|
26
|
+
export declare const ADW_ACCENT_META = "adw-accent";
|
|
27
|
+
/** `<meta name="adw-color-scheme" content="dark">` — an {@link AdwSystemColorScheme}. */
|
|
28
|
+
export declare const ADW_COLOR_SCHEME_META = "adw-color-scheme";
|
|
29
|
+
/**
|
|
30
|
+
* The `adw-accent` value that asks the page to follow the browser's CSS
|
|
31
|
+
* `AccentColor` instead of a named accent — for a server that knows it cannot
|
|
32
|
+
* read the desktop but wants the page to try.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ADW_ACCENT_META_SYSTEM = "system";
|
|
35
|
+
export declare function isAdwSystemColorScheme(value: unknown): value is AdwSystemColorScheme;
|
|
36
|
+
/**
|
|
37
|
+
* Validate an untrusted value — a JSON payload, a message from another
|
|
38
|
+
* process — into a {@link DesktopAppearance}. Unknown or malformed fields are
|
|
39
|
+
* DROPPED, never guessed, so the result can be applied without further checks.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseDesktopAppearance(raw: unknown): DesktopAppearance;
|
|
42
|
+
/**
|
|
43
|
+
* The `<meta>` tags that hand `appearance` to a page using
|
|
44
|
+
* `@gjsify/adwaita-web`, for the server to put in `<head>`. An unknown field
|
|
45
|
+
* renders no tag, so the page falls through to its next source. The values come
|
|
46
|
+
* from closed sets, so nothing here needs HTML escaping — anything outside them
|
|
47
|
+
* is dropped by {@link parseDesktopAppearance} first.
|
|
48
|
+
*/
|
|
49
|
+
export declare function renderAppearanceMeta(appearance: DesktopAppearance): string;
|
|
50
|
+
/** What the handoff tags say, read back. `accent: 'system'` asks for the CSS system colour. */
|
|
51
|
+
export interface AppearanceMeta {
|
|
52
|
+
readonly accent?: AdwAccentColorName | typeof ADW_ACCENT_META_SYSTEM;
|
|
53
|
+
readonly colorScheme?: AdwSystemColorScheme;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Read the handoff tags through `content(name)`, which returns a `<meta>`
|
|
57
|
+
* tag's `content` or `null` — `document.querySelector` in a browser, a
|
|
58
|
+
* template's own lookup anywhere else. Unknown values are ignored.
|
|
59
|
+
*/
|
|
60
|
+
export declare function appearanceFromMeta(content: (name: string) => string | null | undefined): AppearanceMeta;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AdwAccentColorName } from './accent.js';
|
|
2
|
+
/**
|
|
3
|
+
* `AppleAccentColor`'s values → the Adwaita accent of the same name.
|
|
4
|
+
* `-1` graphite, `0` red, `1` orange, `2` yellow, `3` green, `4` blue, `5` purple, `6` pink.
|
|
5
|
+
*/
|
|
6
|
+
export declare const APPLE_ACCENT_COLORS: Readonly<Record<number, AdwAccentColorName>>;
|
|
7
|
+
/** The accent for "Multicolor" (key absent): the app's own, and an Adwaita app's own is blue. */
|
|
8
|
+
export declare const APPLE_MULTICOLOR_ACCENT: AdwAccentColorName;
|
|
9
|
+
/**
|
|
10
|
+
* The Adwaita accent for an `AppleAccentColor` value.
|
|
11
|
+
*
|
|
12
|
+
* Takes what `defaults read` prints (surrounding whitespace allowed) or the
|
|
13
|
+
* number itself. `null`/`undefined` means the key is absent — Multicolor —
|
|
14
|
+
* and gives {@link APPLE_MULTICOLOR_ACCENT}. Anything else macOS does not
|
|
15
|
+
* define (a new value, a non-integer) gives `null`, never a guess: the caller
|
|
16
|
+
* then keeps whatever it would do without a system accent.
|
|
17
|
+
*/
|
|
18
|
+
export declare function adwAccentFromAppleAccentColor(value: string | number | null | undefined): AdwAccentColorName | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** `Gtk.Box:spacing`'s default — `0` in the pspec. */
|
|
2
|
+
export declare const DEFAULT_BOX_SPACING = 0;
|
|
3
|
+
/** `Gtk.Orientation`'s two nicks — the value `orientation` takes on every surface. */
|
|
4
|
+
export type BoxOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
/**
|
|
6
|
+
* A spacing value as the box will hold it: a finite, non-negative number.
|
|
7
|
+
*
|
|
8
|
+
* The pspec's minimum is 0, and a negative write lands there — measured on `Gtk.Box`
|
|
9
|
+
* under gjs 1.88.1 / gtk 4.22.4 (`conformance/box.ts` records the rows).
|
|
10
|
+
* A box that pulled its children together would look like a theme bug, not a refusal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeBoxSpacing(value: unknown): number;
|
|
13
|
+
/**
|
|
14
|
+
* `GtkOrientable:orientation` from its nick. Anything but `vertical` is the pspec
|
|
15
|
+
* default, `horizontal` — the same answer an unknown enum nick gets from GtkBuilder,
|
|
16
|
+
* which rejects it and leaves the property untouched.
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeBoxOrientation(value: unknown): BoxOrientation;
|
|
@@ -18,3 +18,24 @@ export interface AccentColorVector {
|
|
|
18
18
|
* produce, which is why this table is the only place they are written down.
|
|
19
19
|
*/
|
|
20
20
|
export declare const ACCENT_COLOR_VECTORS: ReadonlyArray<AccentColorVector>;
|
|
21
|
+
/** One colour a desktop may report → the accent libadwaita snaps it to. */
|
|
22
|
+
export interface NearestAccentVector {
|
|
23
|
+
/** The system colour, `#rrggbb`. */
|
|
24
|
+
color: string;
|
|
25
|
+
/** `adw_accent_color_nearest_from_rgba (color)`, lowercased. */
|
|
26
|
+
expected: AdwAccentColorName;
|
|
27
|
+
/** Which palette the colour comes from, as libadwaita's test groups it. */
|
|
28
|
+
source: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `adw_accent_color_nearest_from_rgba` reference cases, transcribed verbatim
|
|
32
|
+
* from libadwaita's own test (`tests/test-accent-color.c` at the pinned
|
|
33
|
+
* `refs/libadwaita` commit): the GNOME icon palette and the accent sets of
|
|
34
|
+
* elementary, KDE, Ubuntu, Cinnamon, COSMIC and macOS. Unlike the table above
|
|
35
|
+
* these are upstream's EXPECTATIONS, not a runtime read-out: the function is
|
|
36
|
+
* private in libadwaita, so introspection cannot reach it.
|
|
37
|
+
*
|
|
38
|
+
* The test's first loop, each of the nine palette colours mapping to itself,
|
|
39
|
+
* is asserted from `ACCENT_COLOR_VECTORS` rather than repeated here.
|
|
40
|
+
*/
|
|
41
|
+
export declare const NEAREST_ACCENT_VECTORS: ReadonlyArray<NearestAccentVector>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AdwAccentColorName } from '../accent.js';
|
|
2
|
+
import type { DesktopAppearance } from '../appearance.js';
|
|
3
|
+
export interface AppearanceHandoffVector {
|
|
4
|
+
/** What the server read. May carry values outside the closed sets, as untrusted input does. */
|
|
5
|
+
appearance: DesktopAppearance;
|
|
6
|
+
/** The exact tags `renderAppearanceMeta` must write. */
|
|
7
|
+
meta: string;
|
|
8
|
+
/** The accent the page paints from those tags; `null` = the stylesheet's own blue. */
|
|
9
|
+
paints: AdwAccentColorName | null;
|
|
10
|
+
/** The theme class the page puts on `<html>`, or `null`. */
|
|
11
|
+
themeClass: 'theme-dark' | 'theme-light' | null;
|
|
12
|
+
}
|
|
13
|
+
export declare const APPEARANCE_HANDOFF_VECTORS: ReadonlyArray<AppearanceHandoffVector>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** One authored `spacing` and the gap the box lays out with. */
|
|
2
|
+
export interface BoxSpacingVector {
|
|
3
|
+
/** As authored: a number from code, a string from an attribute, `null` when absent. */
|
|
4
|
+
value: number | string | null;
|
|
5
|
+
spacing: number;
|
|
6
|
+
rule: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `Gtk.Box:spacing`. The negative rows are the ones a port gets wrong quietly — measured
|
|
10
|
+
* under gjs 1.88.1 / gtk 4.22.4, a negative write reads back as 0, so a box never pulls
|
|
11
|
+
* its children together.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BOX_SPACING_VECTORS: ReadonlyArray<BoxSpacingVector>;
|
|
14
|
+
/** One authored `orientation` and the axis the box stacks along. */
|
|
15
|
+
export interface BoxOrientationVector {
|
|
16
|
+
value: string | null;
|
|
17
|
+
orientation: 'horizontal' | 'vertical';
|
|
18
|
+
rule: string;
|
|
19
|
+
}
|
|
20
|
+
/** `GtkOrientable:orientation`, read by nick as GtkBuilder reads an enum. */
|
|
21
|
+
export declare const BOX_ORIENTATION_VECTORS: ReadonlyArray<BoxOrientationVector>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetTeardownCallback } from '../dialog.js';
|
|
1
|
+
import type { BottomSheetChrome, BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetOpenOutcome, BottomSheetOpenSource, BottomSheetSwipeTrackerConfig, BottomSheetSwipeTrackerState, BottomSheetTeardownCallback } from '../dialog.js';
|
|
2
2
|
/** One `resolveBottomSheetClose` expectation. */
|
|
3
3
|
export interface BottomSheetCloseVector {
|
|
4
4
|
/** Which affordance asked to close. */
|
|
@@ -90,3 +90,125 @@ export declare function runBottomSheetSteps(adapter: BottomSheetPresentationAdap
|
|
|
90
90
|
* carrying an unchanged payload.
|
|
91
91
|
*/
|
|
92
92
|
export declare const BOTTOM_SHEET_PRESENTATION_VECTORS: ReadonlyArray<BottomSheetPresentationVector>;
|
|
93
|
+
/** One `resolveBottomSheetOpen` expectation. */
|
|
94
|
+
export interface BottomSheetOpenVector {
|
|
95
|
+
/** Which affordance asked to open. */
|
|
96
|
+
source: BottomSheetOpenSource;
|
|
97
|
+
/** `AdwBottomSheet:open` at the time of the request. */
|
|
98
|
+
open: boolean;
|
|
99
|
+
/** `AdwBottomSheet:can-open` at the time of the request. */
|
|
100
|
+
canOpen: boolean;
|
|
101
|
+
/** Whether `AdwBottomSheet:bottom-bar` is set. */
|
|
102
|
+
hasBottomBar: boolean;
|
|
103
|
+
/** `AdwBottomSheet:reveal-bottom-bar`. */
|
|
104
|
+
revealBottomBar: boolean;
|
|
105
|
+
/** What the C source does with it. */
|
|
106
|
+
outcome: BottomSheetOpenOutcome;
|
|
107
|
+
rule: string;
|
|
108
|
+
derivedFrom: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Every distinguishable `(source, open, canOpen, hasBottomBar, revealBottomBar)` the open
|
|
112
|
+
* gate answers differently for — so a renderer cannot pass by wiring the bar to `open = true`
|
|
113
|
+
* and calling it done.
|
|
114
|
+
*/
|
|
115
|
+
export declare const BOTTOM_SHEET_OPEN_VECTORS: ReadonlyArray<BottomSheetOpenVector>;
|
|
116
|
+
/** One `resolveBottomSheetSwipeTracker` expectation. */
|
|
117
|
+
export interface BottomSheetSwipeTrackerVector {
|
|
118
|
+
/** The four properties `update_swipe_tracker` reads. */
|
|
119
|
+
state: BottomSheetSwipeTrackerState;
|
|
120
|
+
/** The three settings it writes. */
|
|
121
|
+
config: BottomSheetSwipeTrackerConfig;
|
|
122
|
+
rule: string;
|
|
123
|
+
derivedFrom: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* `update_swipe_tracker`'s three assignments, row by row.
|
|
127
|
+
*
|
|
128
|
+
* CORE-ONLY: an `AdwSwipeTracker` has no counterpart in either port — neither renderer runs a
|
|
129
|
+
* gesture tracker, so there is no object to read these settings off. Its `enabled` line is
|
|
130
|
+
* the same fact as the `'swipe'` rows of BOTTOM_SHEET_OPEN_VECTORS and BOTTOM_SHEET_CLOSE_VECTORS,
|
|
131
|
+
* which both renderers drive against their real widgets; this table is the third assignment
|
|
132
|
+
* and the conjunction written out, not a second source of truth.
|
|
133
|
+
*/
|
|
134
|
+
export declare const BOTTOM_SHEET_SWIPE_TRACKER_VECTORS: ReadonlyArray<BottomSheetSwipeTrackerVector>;
|
|
135
|
+
/** One step of a {@link BottomSheetBottomBarVector}, in the order it is applied. */
|
|
136
|
+
export type BottomSheetBottomBarStep =
|
|
137
|
+
/** `adw_bottom_sheet_set_bottom_bar` — a widget, or NULL. */
|
|
138
|
+
{
|
|
139
|
+
readonly kind: 'setBottomBar';
|
|
140
|
+
readonly present: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** `adw_bottom_sheet_set_can_open`. */
|
|
143
|
+
| {
|
|
144
|
+
readonly kind: 'setCanOpen';
|
|
145
|
+
readonly canOpen: boolean;
|
|
146
|
+
}
|
|
147
|
+
/** `adw_bottom_sheet_set_reveal_bottom_bar`. */
|
|
148
|
+
| {
|
|
149
|
+
readonly kind: 'setRevealBottomBar';
|
|
150
|
+
readonly reveal: boolean;
|
|
151
|
+
}
|
|
152
|
+
/** `adw_bottom_sheet_set_modal`. */
|
|
153
|
+
| {
|
|
154
|
+
readonly kind: 'setModal';
|
|
155
|
+
readonly modal: boolean;
|
|
156
|
+
}
|
|
157
|
+
/** The programmatic path — `adw_bottom_sheet_set_open`, ignores `can-open`. */
|
|
158
|
+
| {
|
|
159
|
+
readonly kind: 'setOpen';
|
|
160
|
+
readonly open: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** The interactive path — runs the {@link BOTTOM_SHEET_OPEN_VECTORS} gate. */
|
|
163
|
+
| {
|
|
164
|
+
readonly kind: 'requestOpen';
|
|
165
|
+
readonly source: BottomSheetOpenSource;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* One end-to-end bottom-bar expectation.
|
|
169
|
+
*
|
|
170
|
+
* Every field is observable from a RENDERER: `chrome` is what it has to paint (which layer
|
|
171
|
+
* shows, whether the surface is on screen, whether the bar looks inert) and `notifications`
|
|
172
|
+
* is the `notify::open` stream. So the same row drives the core suite and both renderer
|
|
173
|
+
* suites against their real widgets.
|
|
174
|
+
*/
|
|
175
|
+
export interface BottomSheetBottomBarVector {
|
|
176
|
+
/** Applied in order, through the surface every implementation exposes. */
|
|
177
|
+
steps: readonly BottomSheetBottomBarStep[];
|
|
178
|
+
/** The outcome of each `requestOpen` step, in order. */
|
|
179
|
+
outcomes: readonly BottomSheetOpenOutcome[];
|
|
180
|
+
/** Every `notify::open` payload, in order. */
|
|
181
|
+
notifications: readonly boolean[];
|
|
182
|
+
/** `open` after the last step. */
|
|
183
|
+
open: boolean;
|
|
184
|
+
/** What the renderer must be showing after the last step. */
|
|
185
|
+
chrome: BottomSheetChrome;
|
|
186
|
+
rule: string;
|
|
187
|
+
derivedFrom: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The three-plus-two-method surface a {@link BottomSheetBottomBarVector} is replayed
|
|
191
|
+
* against. Core implements it directly; each renderer implements it by driving its REAL
|
|
192
|
+
* widget (adopting a bar child, writing an attribute, clicking the bar).
|
|
193
|
+
*/
|
|
194
|
+
export interface BottomSheetBottomBarAdapter {
|
|
195
|
+
/** Give the sheet a bottom bar, or take it away (`AdwBottomSheet:bottom-bar`). */
|
|
196
|
+
setBottomBar(present: boolean): void;
|
|
197
|
+
/** `AdwBottomSheet:can-open`. */
|
|
198
|
+
setCanOpen(canOpen: boolean): void;
|
|
199
|
+
/** `AdwBottomSheet:reveal-bottom-bar`. */
|
|
200
|
+
setRevealBottomBar(reveal: boolean): void;
|
|
201
|
+
/** `AdwBottomSheet:modal`. */
|
|
202
|
+
setModal(modal: boolean): void;
|
|
203
|
+
/** The programmatic path (`AdwBottomSheet:open`). */
|
|
204
|
+
setOpen(open: boolean): void;
|
|
205
|
+
/** The interactive path — returns what the gate decided. */
|
|
206
|
+
requestOpen(source: BottomSheetOpenSource): BottomSheetOpenOutcome;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Replay a vector's steps against `adapter`, collecting the outcome of each `requestOpen`
|
|
210
|
+
* step in order. Shared by all three suites so no side can drift in HOW it replays a row.
|
|
211
|
+
*/
|
|
212
|
+
export declare function runBottomSheetBottomBarSteps(adapter: BottomSheetBottomBarAdapter, steps: readonly BottomSheetBottomBarStep[]): BottomSheetOpenOutcome[];
|
|
213
|
+
/** The bottom bar's life as scripts: adopting one, gating it, revealing it, clicking it. */
|
|
214
|
+
export declare const BOTTOM_SHEET_BOTTOM_BAR_VECTORS: ReadonlyArray<BottomSheetBottomBarVector>;
|
|
@@ -12,8 +12,8 @@ export { BUTTON_STYLE_CLASS_VECTORS } from './button.js';
|
|
|
12
12
|
export type { ButtonStyleClassVector } from './button.js';
|
|
13
13
|
export { RADIO_GROUP_VECTORS } from './checks.js';
|
|
14
14
|
export type { RadioGroupStep, RadioGroupVector } from './checks.js';
|
|
15
|
-
export { COMBO_CHOOSER_VECTORS, COMBO_SELECTION_VECTORS } from './rows.js';
|
|
16
|
-
export type { ComboChooserVector, ComboSelectionStep, ComboSelectionVector } from './rows.js';
|
|
15
|
+
export { COMBO_CHOOSER_VECTORS, COMBO_SELECTION_VECTORS, TOGGLE_ACTIVE_NAME_VECTORS } from './rows.js';
|
|
16
|
+
export type { ComboChooserVector, ComboSelectionStep, ComboSelectionVector, ToggleActiveNameVector } from './rows.js';
|
|
17
17
|
export { VIEW_STACK_ICON_NAME_VECTORS, VIEW_STACK_PAGE_VECTORS, VIEW_STACK_VECTORS } from './view-stack.js';
|
|
18
18
|
export type { ViewStackIconNameVector, ViewStackPageDescriptorVector, ViewStackVector, ViewStackVectorChange, ViewStackVectorOp, ViewStackVectorPage, } from './view-stack.js';
|
|
19
19
|
export { NAVIGATION_VIEW_VECTORS, collectNavigationState, navigationEventLog, runNavigationSteps, } from './navigation-view.js';
|
|
@@ -44,21 +44,31 @@ export { CASE_FOLD_VECTORS, MAKE_COMPARABLE_VECTORS, PREFERENCES_GROUP_HEADER_VE
|
|
|
44
44
|
export type { CaseFoldVector, MakeComparableVector, PreferencesGroupHeaderVector, PreferencesSearchExpectation, PreferencesSearchVector, RowMatchVector, SearchCorpusVector, SearchRowSubtitleVector, StripMarkupVector, StripMnemonicVector, } from './preferences.js';
|
|
45
45
|
export { CLAMP_ALLOCATE_VECTORS, CLAMP_CHILD_SIZE_VECTORS, CLAMP_PROPERTY_VECTORS, CLAMP_SIZE_FROM_CHILD_VECTORS, CLAMP_THRESHOLD_VECTORS, SPINNER_GEOMETRY_VECTORS, SPINNER_SIZE_VECTORS, TOOLBAR_VIEW_ALLOCATE_VECTORS, TOOLBAR_VIEW_CLASS_VECTORS, TOOLBAR_VIEW_CONTENT_FOR_SIZE_VECTORS, TOOLBAR_VIEW_MEASURE_VECTORS, } from './chrome.js';
|
|
46
46
|
export type { ClampAllocateVector, ClampChildSizeVector, ClampPropertyVector, ClampSizeFromChildVector, ClampThresholdsVector, SpinnerGeometryVector, SpinnerSizeVector, ToolbarViewAllocateVector, ToolbarViewClassVector, ToolbarViewContentForSizeVector, ToolbarViewMeasureVector, } from './chrome.js';
|
|
47
|
-
export { BOTTOM_SHEET_CLOSE_VECTORS, BOTTOM_SHEET_PRESENTATION_VECTORS, runBottomSheetSteps } from './dialog.js';
|
|
48
|
-
export type { BottomSheetCloseVector, BottomSheetPresentationAdapter, BottomSheetPresentationStep, BottomSheetPresentationVector, } from './dialog.js';
|
|
47
|
+
export { BOTTOM_SHEET_BOTTOM_BAR_VECTORS, BOTTOM_SHEET_CLOSE_VECTORS, BOTTOM_SHEET_OPEN_VECTORS, BOTTOM_SHEET_PRESENTATION_VECTORS, BOTTOM_SHEET_SWIPE_TRACKER_VECTORS, runBottomSheetBottomBarSteps, runBottomSheetSteps, } from './dialog.js';
|
|
48
|
+
export type { BottomSheetBottomBarAdapter, BottomSheetBottomBarStep, BottomSheetBottomBarVector, BottomSheetCloseVector, BottomSheetOpenVector, BottomSheetPresentationAdapter, BottomSheetPresentationStep, BottomSheetPresentationVector, BottomSheetSwipeTrackerVector, } from './dialog.js';
|
|
49
49
|
export { POPOVER_KEY_VECTORS, POPOVER_SURFACE_VECTORS } from './popover.js';
|
|
50
50
|
export type { PopoverKeyVector, PopoverSurfaceVariant, PopoverSurfaceVector } from './popover.js';
|
|
51
|
-
export { ACCENT_COLOR_VECTORS } from './accent.js';
|
|
52
|
-
export type { AccentColorVector } from './accent.js';
|
|
51
|
+
export { ACCENT_COLOR_VECTORS, NEAREST_ACCENT_VECTORS } from './accent.js';
|
|
52
|
+
export type { AccentColorVector, NearestAccentVector } from './accent.js';
|
|
53
|
+
export { APPEARANCE_HANDOFF_VECTORS } from './appearance.js';
|
|
54
|
+
export type { AppearanceHandoffVector } from './appearance.js';
|
|
53
55
|
export { formatShortcutLabelNodes, SHORTCUT_LABEL_VECTORS } from './shortcut-label.js';
|
|
54
56
|
export type { ShortcutLabelVector } from './shortcut-label.js';
|
|
55
57
|
export { SPINNER_ARC_ENVELOPE, SPINNER_ARC_PHASE_VECTORS, SPINNER_ARC_TOLERANCE, SPINNER_CONSTANT_VECTORS, } from './spinner.js';
|
|
56
58
|
export type { SpinnerArcShapeVector, SpinnerConstantVector } from './spinner.js';
|
|
59
|
+
export { BOX_ORIENTATION_VECTORS, BOX_SPACING_VECTORS } from './box.js';
|
|
60
|
+
export type { BoxOrientationVector, BoxSpacingVector } from './box.js';
|
|
61
|
+
export { LABEL_CHAR_COUNT_VECTORS, LABEL_DISPLAY_TEXT_VECTORS, LABEL_EFFECTIVE_LINES_VECTORS, LABEL_ELLIPSIZE_OVERFLOW_VECTORS, LABEL_ELLIPSIZE_VECTORS, LABEL_JUSTIFY_VECTORS, LABEL_WIDTH_CHARS_EXTENT_VECTORS, LABEL_WRAP_MODE_VECTORS, LABEL_XALIGN_VECTORS, LABEL_YALIGN_ALIGN_ITEMS_VECTORS, LABEL_YALIGN_VECTORS, } from './label.js';
|
|
62
|
+
export type { LabelCharCountVector, LabelDisplayTextVector, LabelEffectiveLinesVector, LabelEllipsizeOverflowVector, LabelEllipsizeVector, LabelJustifyVector, LabelWidthCharsExtentVector, LabelWrapModeVector, LabelXalignVector, LabelYalignAlignItemsVector, LabelYalignVector, } from './label.js';
|
|
57
63
|
export { WRAP_BOX_CHILD_ORDER_VECTORS, WRAP_BOX_LENGTH_VECTORS, WRAP_BOX_LINE_VECTORS, WRAP_BOX_NATURAL_LENGTH_VECTORS, WRAP_BOX_NOTIFY_PROPERTIES, WRAP_BOX_POLICY_VECTORS, WRAP_BOX_SPACING_NOTIFY_VECTORS, WRAP_BOX_SPACING_VECTORS, } from './wrap-box.js';
|
|
58
64
|
export type { WrapBoxChildOrderVector, WrapBoxLengthVector, WrapBoxLineVector, WrapBoxNaturalLengthVector, WrapBoxPolicyVector, WrapBoxSpacingNotifyVector, WrapBoxSpacingVector, } from './wrap-box.js';
|
|
59
65
|
export { BREAKPOINT_PICK_VECTORS, BREAKPOINT_TRANSITION_VECTORS } from './breakpoint-bin.js';
|
|
60
66
|
export type { BreakpointPickVector, BreakpointTransitionVector } from './breakpoint-bin.js';
|
|
61
67
|
export { HEADER_BAR_PACK_VECTORS, HEADER_BAR_TITLE_SOURCE_VECTORS, HEADER_BAR_TITLE_WIDGET_VECTORS, } from './header-bar.js';
|
|
62
68
|
export type { HeaderBarPackVector, HeaderBarTitleSourceVector, HeaderBarTitleWidgetVector } from './header-bar.js';
|
|
63
|
-
export {
|
|
64
|
-
export type {
|
|
69
|
+
export { ATTRIBUTE_OF_VECTORS, HOST_TAG_VECTORS, PROPERTY_OF_VECTORS } from './tags.js';
|
|
70
|
+
export type { AttributeOfVector, HostTagVector, PropertyOfVector } from './tags.js';
|
|
71
|
+
export { VALUE_LIST_VECTORS } from './value-lists.js';
|
|
72
|
+
export type { ValueListResponse, ValueListVector } from './value-lists.js';
|
|
73
|
+
export { SHARED_TREE_BLOCKS_WITHOUT_EXPECTATIONS, SHARED_TREE_TABLES, authoredNodes, authoredTags, reachedTables, sharedTreeExpectations, sharedTreePlacements, subjectIndexOf, withoutPlacements, } from './shared-trees.js';
|
|
74
|
+
export type { SharedTreeExpectation, SharedTreeNode, SharedTreeObservable, SharedTreePlacement, } from './shared-trees.js';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** One `label` + flags and the text shown. */
|
|
2
|
+
export interface LabelDisplayTextVector {
|
|
3
|
+
label: string;
|
|
4
|
+
useMarkup: boolean;
|
|
5
|
+
useUnderline: boolean;
|
|
6
|
+
text: string;
|
|
7
|
+
rule: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const LABEL_DISPLAY_TEXT_VECTORS: ReadonlyArray<LabelDisplayTextVector>;
|
|
10
|
+
/** One authored `xalign` and the value the label holds. */
|
|
11
|
+
export interface LabelXalignVector {
|
|
12
|
+
value: number | string | null;
|
|
13
|
+
xalign: number;
|
|
14
|
+
rule: string;
|
|
15
|
+
}
|
|
16
|
+
/** `gtk_label_set_xalign` CLAMPs to 0…1 itself; the pspec default is 0.5. */
|
|
17
|
+
export declare const LABEL_XALIGN_VECTORS: ReadonlyArray<LabelXalignVector>;
|
|
18
|
+
/** One authored `justify` and the `Gtk.Justification` nick the label holds. */
|
|
19
|
+
export interface LabelJustifyVector {
|
|
20
|
+
value: string | null;
|
|
21
|
+
justify: 'left' | 'right' | 'center' | 'fill';
|
|
22
|
+
rule: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const LABEL_JUSTIFY_VECTORS: ReadonlyArray<LabelJustifyVector>;
|
|
25
|
+
/** One authored `yalign` and the value the label holds. Same shape as `xalign`. */
|
|
26
|
+
export interface LabelYalignVector {
|
|
27
|
+
value: number | string | null;
|
|
28
|
+
yalign: number;
|
|
29
|
+
rule: string;
|
|
30
|
+
}
|
|
31
|
+
/** `gtk_label_set_yalign` CLAMPs to 0…1 itself; the pspec default is 0.5. */
|
|
32
|
+
export declare const LABEL_YALIGN_VECTORS: ReadonlyArray<LabelYalignVector>;
|
|
33
|
+
/** One `yalign` and the `align-items` zone it is nearest to. */
|
|
34
|
+
export interface LabelYalignAlignItemsVector {
|
|
35
|
+
yalign: number;
|
|
36
|
+
alignItems: 'flex-start' | 'center' | 'flex-end';
|
|
37
|
+
rule: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* TRUE nearest-of-three, not a strict half-split: the boundary between "nearest 0" and
|
|
41
|
+
* "nearest 0.5" is their midpoint, `0.25`, and symmetrically `0.75` on the other side —
|
|
42
|
+
* a `yalign` short of a full CSS continuum still lands on the CLOSER zone rather than
|
|
43
|
+
* whichever half of `[0, 1]` it falls in. Exact at the three values GTK's own default and
|
|
44
|
+
* both edges take (0, 0.5, 1); the four intermediate rows (`0.2`/`0.3`/`0.7`/`0.8`) are the
|
|
45
|
+
* ones a strict `< 0.5`/`> 0.5` split gets wrong — `0.3` is closer to `0.5` than to `0`,
|
|
46
|
+
* so it belongs in `center`, not `flex-start`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const LABEL_YALIGN_ALIGN_ITEMS_VECTORS: ReadonlyArray<LabelYalignAlignItemsVector>;
|
|
49
|
+
/** One authored `ellipsize` and the `Pango.EllipsizeMode` nick the label holds. */
|
|
50
|
+
export interface LabelEllipsizeVector {
|
|
51
|
+
value: string | null;
|
|
52
|
+
ellipsize: 'none' | 'start' | 'middle' | 'end';
|
|
53
|
+
rule: string;
|
|
54
|
+
}
|
|
55
|
+
/** `Pango-1.0.gir`'s four `EllipsizeMode` nicks, read via `gi://Pango` under gjs 1.88.1. */
|
|
56
|
+
export declare const LABEL_ELLIPSIZE_VECTORS: ReadonlyArray<LabelEllipsizeVector>;
|
|
57
|
+
/** One `Pango.EllipsizeMode` nick and the ONE truncating value both renderers can draw. */
|
|
58
|
+
export interface LabelEllipsizeOverflowVector {
|
|
59
|
+
ellipsize: 'none' | 'start' | 'middle' | 'end';
|
|
60
|
+
overflow: 'clip' | 'ellipsis';
|
|
61
|
+
rule: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Neither CSS `text-overflow` nor NativeScript's `textOverflow` has a start- or
|
|
65
|
+
* middle-truncating mode — see `labelEllipsizeOverflowValue`'s own comment for why every
|
|
66
|
+
* non-`none` mode draws an end-ellipsis rather than a silent `clip`. `start` and `middle`
|
|
67
|
+
* are the DECLARED divergence these two rows pin.
|
|
68
|
+
*/
|
|
69
|
+
export declare const LABEL_ELLIPSIZE_OVERFLOW_VECTORS: ReadonlyArray<LabelEllipsizeOverflowVector>;
|
|
70
|
+
/** One authored `wrap-mode` and the `Pango.WrapMode` nick the label holds. */
|
|
71
|
+
export interface LabelWrapModeVector {
|
|
72
|
+
value: string | null;
|
|
73
|
+
wrapMode: 'word' | 'char' | 'word-char';
|
|
74
|
+
rule: string;
|
|
75
|
+
}
|
|
76
|
+
/** `Pango-1.0.gir`'s three `WrapMode` nicks, read via `gi://Pango` under gjs 1.88.1. */
|
|
77
|
+
export declare const LABEL_WRAP_MODE_VECTORS: ReadonlyArray<LabelWrapModeVector>;
|
|
78
|
+
/** One authored value and the int `width-chars` / `max-width-chars` / `lines` all hold. */
|
|
79
|
+
export interface LabelCharCountVector {
|
|
80
|
+
value: number | string | null;
|
|
81
|
+
count: number;
|
|
82
|
+
rule: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* `width-chars`, `max-width-chars` and `lines` share one pspec shape — floor `-1`, default
|
|
86
|
+
* `-1` — so one table drives all three normalizers in `label.spec.ts`. Measured through
|
|
87
|
+
* `label.set_property()`, the door an attribute-driven tree uses (`label.ts`'s header).
|
|
88
|
+
*/
|
|
89
|
+
export declare const LABEL_CHAR_COUNT_VECTORS: ReadonlyArray<LabelCharCountVector>;
|
|
90
|
+
/** One `lines` / `ellipsize` combination and the line count a renderer applies. */
|
|
91
|
+
export interface LabelEffectiveLinesVector {
|
|
92
|
+
lines: number;
|
|
93
|
+
ellipsize: 'none' | 'start' | 'middle' | 'end';
|
|
94
|
+
effective: number | null;
|
|
95
|
+
rule: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* MEASURED (a real `Gtk.Label`, allocated, gjs 1.88.1 / gtk 4.22.5) — `wrap` is
|
|
99
|
+
* deliberately not a column here, because it changes NONE of these outcomes.
|
|
100
|
+
* `wrap=TRUE, ellipsize=NONE, lines=2` laid out 15 lines (the cap ignored);
|
|
101
|
+
* `wrap=FALSE, ellipsize=END, lines=2` laid out exactly 2, ellipsized. `label.ts`'s header
|
|
102
|
+
* carries the fuller measurement, including the two prior, WRONG readings of the pspec's
|
|
103
|
+
* "has no effect if the label is not wrapping or ellipsized" this table replaced.
|
|
104
|
+
*/
|
|
105
|
+
export declare const LABEL_EFFECTIVE_LINES_VECTORS: ReadonlyArray<LabelEffectiveLinesVector>;
|
|
106
|
+
/** One `width-chars` + `max-width-chars` pair and the `ch`-unit extent it derives. */
|
|
107
|
+
export interface LabelWidthCharsExtentVector {
|
|
108
|
+
widthChars: number;
|
|
109
|
+
maxWidthChars: number;
|
|
110
|
+
minCh: number | null;
|
|
111
|
+
maxCh: number | null;
|
|
112
|
+
rule: string;
|
|
113
|
+
}
|
|
114
|
+
/** `get_default_widths` (gtklabel.c): minimum is `width-chars`, natural is their MAX. */
|
|
115
|
+
export declare const LABEL_WIDTH_CHARS_EXTENT_VECTORS: ReadonlyArray<LabelWidthCharsExtentVector>;
|
|
@@ -15,7 +15,7 @@ export interface ListNormalizeVector {
|
|
|
15
15
|
*
|
|
16
16
|
* The NativeScript widgets take the same input and NOTHING there asserts it. That
|
|
17
17
|
* package's specs reach `ComboState` and never the widget class, for the reason
|
|
18
|
-
* `drop-down.spec.ts`' own header gives, and the gap is filed in `status/open-todos.md`
|
|
18
|
+
* `drop-down.spec.ts`' own header gives, and the gap is filed in `status/open-todos/README.md`
|
|
19
19
|
* under "The NativeScript list-model setter is held by core's vectors, not by a widget
|
|
20
20
|
* test". This docblock used to say "every surface that takes a `model` … must answer
|
|
21
21
|
* these rows: … the NativeScript widgets through theirs", which reads as coverage for a
|
|
@@ -65,3 +65,32 @@ export interface ComboChooserVector {
|
|
|
65
65
|
* which is why this lives on the combo ROW rather than in the shared chooser.
|
|
66
66
|
*/
|
|
67
67
|
export declare const COMBO_CHOOSER_VECTORS: ReadonlyArray<ComboChooserVector>;
|
|
68
|
+
/** One authored `active-name`, over toggles carrying these names. */
|
|
69
|
+
export interface ToggleActiveNameVector {
|
|
70
|
+
/** Each authored toggle's `name`, in document order; `null` is unnamed. */
|
|
71
|
+
names: readonly (string | null)[];
|
|
72
|
+
/** The authored `Adw.ToggleGroup:active-name`. */
|
|
73
|
+
activeName: string;
|
|
74
|
+
/** How many toggles the group keeps — `keptToggles`, the buttons a built group draws. */
|
|
75
|
+
kept: number;
|
|
76
|
+
/** What `toggleIndexOfName` answers over the kept names — `-1` for none. */
|
|
77
|
+
index: number;
|
|
78
|
+
/** The button a BUILT group shows active afterwards. */
|
|
79
|
+
active: number;
|
|
80
|
+
rule: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* `adw_toggle_group_set_active_name` (adw-toggle-group.c:1989) resolves the name through
|
|
84
|
+
* the table `add_toggle` fills (:898), and a `.blp` writes it BEFORE the toggles exist —
|
|
85
|
+
* GtkBuilder sets properties first and children after, which is why the C holds the name
|
|
86
|
+
* back in `delayed_active_name` until `parser_finished` (:1247). `active` is therefore a
|
|
87
|
+
* row about the built tree, not about the lookup: a renderer that resolves the name the
|
|
88
|
+
* moment it is written finds no toggles and drops it.
|
|
89
|
+
*
|
|
90
|
+
* The first toggle is active before the name is applied, because `add_toggle` activates
|
|
91
|
+
* the first toggle it is given (:903). Every row was measured against libadwaita 1.9.3
|
|
92
|
+
* through `Gtk.Builder`, and the shared-name row is the one the source reading got wrong
|
|
93
|
+
* first: the table insert at :898 looks like "last one wins", but :849 refuses the second
|
|
94
|
+
* toggle before it is ever reached.
|
|
95
|
+
*/
|
|
96
|
+
export declare const TOGGLE_ACTIVE_NAME_VECTORS: ReadonlyArray<ToggleActiveNameVector>;
|