@gjsify/adwaita-web 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/dist/adwaita-web.css +835 -299
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-about-dialog.spec.d.ts +1 -0
- package/lib/types/adw-action-rows.spec.d.ts +1 -0
- package/lib/types/adw-avatar.spec.d.ts +1 -0
- package/lib/types/adw-banner.spec.d.ts +1 -0
- package/lib/types/adw-button-content.spec.d.ts +1 -0
- package/lib/types/adw-carousel.spec.d.ts +1 -0
- package/lib/types/adw-checks.spec.d.ts +1 -0
- package/lib/types/adw-header-bar.spec.d.ts +1 -0
- package/lib/types/adw-icon.spec.d.ts +1 -0
- package/lib/types/adw-progress-bar.spec.d.ts +1 -0
- package/lib/types/adw-sidebar.spec.d.ts +1 -0
- package/lib/types/adw-switch.spec.d.ts +1 -0
- package/lib/types/adw-wrap-box.spec.d.ts +1 -0
- package/lib/types/bottom-sheet.spec.d.ts +1 -0
- package/lib/types/breakpoints.d.ts +22 -0
- package/lib/types/breakpoints.spec.d.ts +1 -0
- package/lib/types/chrome.spec.d.ts +1 -0
- package/lib/types/elements/adw-about-dialog.d.ts +47 -8
- package/lib/types/elements/adw-action-row.d.ts +35 -0
- package/lib/types/elements/adw-avatar.d.ts +11 -0
- package/lib/types/elements/adw-bottom-sheet.d.ts +33 -4
- package/lib/types/elements/adw-button-content.d.ts +12 -0
- package/lib/types/elements/adw-button-row.d.ts +10 -1
- package/lib/types/elements/adw-carousel.d.ts +111 -8
- package/lib/types/elements/adw-checks.d.ts +57 -0
- package/lib/types/elements/adw-clamp.d.ts +4 -1
- package/lib/types/elements/adw-combo-row.d.ts +10 -0
- package/lib/types/elements/adw-data-grid.d.ts +11 -31
- package/lib/types/elements/adw-drop-down.d.ts +17 -20
- package/lib/types/elements/adw-entry-row.d.ts +93 -3
- package/lib/types/elements/adw-expander-row.d.ts +7 -1
- package/lib/types/elements/adw-header-bar.d.ts +15 -0
- package/lib/types/elements/adw-icon.d.ts +25 -0
- package/lib/types/elements/adw-inline-view-switcher.d.ts +73 -11
- package/lib/types/elements/adw-menu-button.d.ts +6 -6
- package/lib/types/elements/adw-navigation-split-view.d.ts +48 -0
- package/lib/types/elements/adw-navigation-view.d.ts +63 -20
- package/lib/types/elements/adw-overlay-split-view.d.ts +94 -0
- package/lib/types/elements/adw-password-entry-row.d.ts +19 -10
- package/lib/types/elements/adw-popover.d.ts +58 -0
- package/lib/types/elements/adw-preferences-dialog.d.ts +57 -2
- package/lib/types/elements/adw-preferences-group.d.ts +31 -0
- package/lib/types/elements/adw-progress-bar.d.ts +38 -0
- package/lib/types/elements/adw-sidebar.d.ts +37 -5
- package/lib/types/elements/adw-spinner.d.ts +23 -0
- package/lib/types/elements/adw-split-button.d.ts +53 -7
- package/lib/types/elements/adw-switch-row.d.ts +11 -2
- package/lib/types/elements/adw-switch.d.ts +15 -0
- package/lib/types/elements/adw-tab-view.d.ts +129 -12
- package/lib/types/elements/adw-toolbar-view.d.ts +5 -0
- package/lib/types/elements/adw-view-stack.d.ts +39 -19
- package/lib/types/elements/adw-view-switcher-bar.d.ts +25 -7
- package/lib/types/elements/adw-view-switcher.d.ts +76 -13
- package/lib/types/elements/adw-window-title.d.ts +3 -1
- package/lib/types/elements/adw-wrap-box.d.ts +58 -3
- package/lib/types/elements/view-switcher-dom.d.ts +44 -0
- package/lib/types/entry-rows.spec.d.ts +1 -0
- package/lib/types/index.d.ts +7 -0
- package/lib/types/navigation-view.spec.d.ts +1 -0
- package/lib/types/preferences-search.d.ts +20 -0
- package/lib/types/preferences.spec.d.ts +1 -0
- package/lib/types/split-button.spec.d.ts +1 -0
- package/lib/types/split-views.spec.d.ts +1 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/lib/types/tab-view.spec.d.ts +1 -0
- package/lib/types/view-stack.spec.d.ts +1 -0
- package/lib/types/view-switcher.spec.d.ts +1 -0
- package/package.json +6 -6
- package/scss/_banner.scss +13 -0
- package/scss/_bottom_sheet.scss +5 -6
- package/scss/_button.scss +3 -26
- package/scss/_button_content.scss +28 -0
- package/scss/_checks.scss +228 -0
- package/scss/_clamp.scss +9 -3
- package/scss/_combo_row.scss +19 -0
- package/scss/_data_grid.scss +15 -7
- package/scss/_drop_down.scss +12 -55
- package/scss/_expander_row.scss +5 -50
- package/scss/_icon.scss +51 -0
- package/scss/_icons.generated.scss +6 -0
- package/scss/_inline_view_switcher.scss +34 -0
- package/scss/_labels.scss +135 -0
- package/scss/_menu_button.scss +10 -70
- package/scss/_navigation_split_view.scss +47 -8
- package/scss/_overlay_split_view.scss +117 -32
- package/scss/_popover.scss +186 -0
- package/scss/_preferences.scss +29 -0
- package/scss/_preferences_dialog.scss +17 -0
- package/scss/_progress_bar.scss +161 -0
- package/scss/_reset.scss +18 -7
- package/scss/_spinner.scss +37 -19
- package/scss/_split_button.scss +6 -50
- package/scss/_switch.scss +90 -0
- package/scss/_switch_row.scss +6 -52
- package/scss/_tab_view.scss +63 -0
- package/scss/_theme.scss +10 -0
- package/scss/_toolbar_view.scss +74 -0
- package/scss/_variables.scss +34 -0
- package/scss/_view_switcher.scss +40 -0
- package/scss/_view_switcher_bar.scss +37 -0
- package/scss/_wrap_box.scss +65 -6
- package/scss/adwaita-skin.scss +23 -0
- package/src/adw-about-dialog.spec.ts +350 -0
- package/src/adw-action-rows.spec.ts +342 -0
- package/src/adw-avatar.spec.ts +176 -0
- package/src/adw-banner.spec.ts +152 -0
- package/src/adw-button-content.spec.ts +207 -0
- package/src/adw-button-row.spec.ts +12 -6
- package/src/adw-carousel.spec.ts +389 -0
- package/src/adw-checks.spec.ts +368 -0
- package/src/adw-drop-down.spec.ts +123 -0
- package/src/adw-header-bar.spec.ts +83 -0
- package/src/adw-icon.spec.ts +167 -0
- package/src/adw-progress-bar.spec.ts +173 -0
- package/src/adw-row-state.spec.ts +49 -0
- package/src/adw-sidebar.spec.ts +332 -0
- package/src/adw-switch.spec.ts +242 -0
- package/src/adw-tab-view.spec.ts +12 -3
- package/src/adw-view-switcher-bar.spec.ts +61 -13
- package/src/adw-wrap-box.spec.ts +341 -0
- package/src/bottom-sheet.spec.ts +325 -0
- package/src/breakpoints.spec.ts +147 -0
- package/src/breakpoints.ts +67 -0
- package/src/chrome.spec.ts +400 -0
- package/src/elements/adw-about-dialog.ts +223 -163
- package/src/elements/adw-action-row.ts +131 -11
- package/src/elements/adw-avatar.ts +48 -54
- package/src/elements/adw-banner.ts +46 -10
- package/src/elements/adw-bottom-sheet.ts +145 -60
- package/src/elements/adw-button-content.ts +107 -33
- package/src/elements/adw-button-row.ts +61 -37
- package/src/elements/adw-button.ts +5 -7
- package/src/elements/adw-carousel.ts +467 -105
- package/src/elements/adw-checks.ts +299 -0
- package/src/elements/adw-clamp.ts +80 -10
- package/src/elements/adw-combo-row.ts +32 -7
- package/src/elements/adw-data-grid.ts +43 -91
- package/src/elements/adw-drop-down.ts +117 -128
- package/src/elements/adw-entry-row.ts +404 -36
- package/src/elements/adw-expander-row.ts +61 -29
- package/src/elements/adw-header-bar.ts +31 -6
- package/src/elements/adw-icon.ts +148 -0
- package/src/elements/adw-inline-view-switcher.ts +325 -131
- package/src/elements/adw-menu-button.ts +93 -70
- package/src/elements/adw-navigation-split-view.ts +220 -14
- package/src/elements/adw-navigation-view.ts +286 -148
- package/src/elements/adw-overlay-split-view.ts +536 -28
- package/src/elements/adw-password-entry-row.ts +111 -89
- package/src/elements/adw-popover.ts +283 -0
- package/src/elements/adw-preferences-dialog.ts +120 -21
- package/src/elements/adw-preferences-group.ts +128 -22
- package/src/elements/adw-progress-bar.ts +189 -0
- package/src/elements/adw-sidebar.ts +301 -142
- package/src/elements/adw-spin-row.ts +11 -5
- package/src/elements/adw-spinner.ts +168 -9
- package/src/elements/adw-split-button.ts +371 -92
- package/src/elements/adw-status-page.ts +9 -9
- package/src/elements/adw-switch-row.ts +100 -30
- package/src/elements/adw-switch.ts +129 -0
- package/src/elements/adw-tab-view.ts +700 -129
- package/src/elements/adw-toggle-group.ts +5 -7
- package/src/elements/adw-toolbar-view.ts +84 -21
- package/src/elements/adw-view-stack.ts +183 -85
- package/src/elements/adw-view-switcher-bar.ts +171 -81
- package/src/elements/adw-view-switcher.ts +328 -117
- package/src/elements/adw-window-title.ts +44 -11
- package/src/elements/adw-wrap-box.ts +329 -78
- package/src/elements/view-switcher-dom.ts +108 -0
- package/src/entry-rows.spec.ts +391 -0
- package/src/index.ts +23 -0
- package/src/navigation-view.spec.ts +435 -0
- package/src/preferences-search.ts +135 -0
- package/src/preferences.spec.ts +250 -0
- package/src/source-view/adw-source-view.ts +2 -5
- package/src/split-button.spec.ts +470 -0
- package/src/split-views.spec.ts +893 -0
- package/src/styles.generated.ts +1 -1
- package/src/tab-view.spec.ts +451 -0
- package/src/test.browser.mts +49 -0
- package/src/view-stack.spec.ts +272 -0
- package/src/view-switcher.spec.ts +665 -0
|
@@ -3,6 +3,30 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
3
3
|
private _sidebarEl;
|
|
4
4
|
private _contentEl;
|
|
5
5
|
private _backdropEl;
|
|
6
|
+
private _disposeBreakpoint;
|
|
7
|
+
/**
|
|
8
|
+
* The single source of truth for the property interplay, shared with the
|
|
9
|
+
* NativeScript renderer (ADR 0004). The element owns the attributes and the
|
|
10
|
+
* painting; every rule about what `collapsed` + `show-sidebar` + `pin-sidebar`
|
|
11
|
+
* MEAN together lives in core, held to `OVERLAY_COLLAPSE_VECTORS`.
|
|
12
|
+
*/
|
|
13
|
+
private _state;
|
|
14
|
+
/** Re-entrancy guard for {@link _reflectShowSidebar}. */
|
|
15
|
+
private _reflecting;
|
|
16
|
+
/** The view's own width in CSS px — the size the sidebar fraction is OF. */
|
|
17
|
+
private _measuredWidth;
|
|
18
|
+
private _resizeObserver;
|
|
19
|
+
/** The pointer currently panning the sidebar, if any. */
|
|
20
|
+
private _swipePointer;
|
|
21
|
+
/** Where the pan started, and the progress it started from. */
|
|
22
|
+
private _swipeOrigin;
|
|
23
|
+
/**
|
|
24
|
+
* Every attribute {@link _readAttribute} handles must be listed here — an
|
|
25
|
+
* unobserved attribute never reaches `attributeChangedCallback`, so its branch
|
|
26
|
+
* is DEAD after construction. `pin-sidebar` was missing, which made the
|
|
27
|
+
* property that suppresses the collapse coupling settable only in the markup
|
|
28
|
+
* a parser saw: `view.setAttribute('pin-sidebar', '')` did nothing at all.
|
|
29
|
+
*/
|
|
6
30
|
static get observedAttributes(): string[];
|
|
7
31
|
get showSidebar(): boolean;
|
|
8
32
|
set showSidebar(v: boolean);
|
|
@@ -12,10 +36,80 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
12
36
|
get maxSidebarWidth(): number;
|
|
13
37
|
get sidebarWidthFraction(): number;
|
|
14
38
|
connectedCallback(): void;
|
|
39
|
+
/** The DOM surgery and the state, which happen once per element lifetime. */
|
|
40
|
+
private _buildOnce;
|
|
41
|
+
/**
|
|
42
|
+
* Everything that must be re-established every time the element enters a
|
|
43
|
+
* document — NOT once per lifetime.
|
|
44
|
+
*
|
|
45
|
+
* `connectedCallback` returns early on the second connect (the DOM is
|
|
46
|
+
* already built), so anything torn down in `disconnectedCallback` used to be
|
|
47
|
+
* gone for good: moving the view between parents — which is what a slideshow
|
|
48
|
+
* or a client-side route change does — killed the ResizeObserver and left
|
|
49
|
+
* `_measuredWidth` frozen at whatever it last saw, or at 0 if the view had
|
|
50
|
+
* never been visible. That is the other half of the docs-site regression.
|
|
51
|
+
*/
|
|
52
|
+
private _bindToDocument;
|
|
53
|
+
disconnectedCallback(): void;
|
|
54
|
+
/** `escape_shortcut_cb` — only a COLLAPSED view with a revealed sidebar consumes it. */
|
|
55
|
+
private readonly _onKeyDown;
|
|
15
56
|
attributeChangedCallback(_name: string, _old: string | null, _val: string | null): void;
|
|
57
|
+
/**
|
|
58
|
+
* Push ONE attribute into the state, then reflect back what the state made
|
|
59
|
+
* of it.
|
|
60
|
+
*
|
|
61
|
+
* Per-attribute rather than a re-read of all of them, because `show-sidebar`
|
|
62
|
+
* is a value the state ALSO owns: collapsing auto-hides an unpinned sidebar,
|
|
63
|
+
* and a blanket re-read would immediately clobber that decision with the
|
|
64
|
+
* stale attribute.
|
|
65
|
+
*/
|
|
66
|
+
private _readAttribute;
|
|
67
|
+
/**
|
|
68
|
+
* Mirror the state's `showSidebar` back onto the attribute, so the DOM keeps
|
|
69
|
+
* telling the truth after an auto-hide.
|
|
70
|
+
*
|
|
71
|
+
* Guarded: writing the attribute re-enters `attributeChangedCallback`, and
|
|
72
|
+
* without the flag that is an infinite reflection loop rather than a render.
|
|
73
|
+
*/
|
|
74
|
+
private _reflectShowSidebar;
|
|
75
|
+
/** (Re)bind the `breakpoint` condition to `collapsed`. */
|
|
76
|
+
private _syncBreakpoint;
|
|
16
77
|
openSidebar(): void;
|
|
17
78
|
hideSidebar(): void;
|
|
18
79
|
toggleSidebar(): void;
|
|
80
|
+
/**
|
|
81
|
+
* The reading direction `start` / `end` are resolved against.
|
|
82
|
+
*
|
|
83
|
+
* `get_start_or_end` (adw-overlay-split-view.c:227-234) returns
|
|
84
|
+
* `GTK_PACK_END` under RTL, so a `start` sidebar is drawn on the RIGHT.
|
|
85
|
+
* Neither renderer mirrored any of it; the browser has the direction for
|
|
86
|
+
* free and only had to read it.
|
|
87
|
+
*/
|
|
88
|
+
private get _direction();
|
|
89
|
+
/** The sizing properties as the core takes them. */
|
|
90
|
+
private get _widthSpec();
|
|
91
|
+
/** The sidebar's allocated width in px — `get_sidebar_width` (:441-466). */
|
|
92
|
+
private get _sidebarWidth();
|
|
19
93
|
private _syncClasses;
|
|
94
|
+
/**
|
|
95
|
+
* Place the sidebar for the current progress — `allocate_uncollapsed`
|
|
96
|
+
* (:572-610) and `allocate_collapsed` (:653-703), through the core.
|
|
97
|
+
*
|
|
98
|
+
* The slide used to be `marginRight: -offsetWidth` REGARDLESS of which edge
|
|
99
|
+
* the sidebar is on, so an `end` sidebar slid the wrong way; and it was only
|
|
100
|
+
* two states, so a swipe had nothing to drive. `layoutOverlaySplitView`
|
|
101
|
+
* returns the pane rect for any progress including the overshoot, which is
|
|
102
|
+
* what makes a continuous gesture expressible at all.
|
|
103
|
+
*/
|
|
104
|
+
private _syncGeometry;
|
|
20
105
|
private _syncSidebarWidth;
|
|
106
|
+
/**
|
|
107
|
+
* The pan gesture the five `OVERLAY_SWIPE_*` tables describe.
|
|
108
|
+
*
|
|
109
|
+
* There was no gesture code in either renderer — grep for `pan` in both
|
|
110
|
+
* split views returned zero — so `showProgress` was only ever 0 or 1 and the
|
|
111
|
+
* tables shipped unexercised. Pointer events give the browser the whole
|
|
112
|
+
* gesture in three handlers; every DECISION in them is core's.
|
|
113
|
+
*/
|
|
114
|
+
private _bindSwipe;
|
|
21
115
|
}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { AdwEntryRow } from './adw-entry-row.js';
|
|
2
|
+
export declare class AdwPasswordEntryRow extends AdwEntryRow {
|
|
3
|
+
/** The headless peek + caps-lock derivation, composing the parent row's state. */
|
|
4
|
+
private readonly _password;
|
|
4
5
|
private _toggle;
|
|
5
6
|
private _toggleIcon;
|
|
6
|
-
private _initialized;
|
|
7
7
|
static get observedAttributes(): string[];
|
|
8
|
-
get
|
|
9
|
-
|
|
10
|
-
/** Whether the contents are shown in clear text (peek toggle is engaged). */
|
|
8
|
+
protected get _classPrefix(): string;
|
|
9
|
+
/** Whether the contents are shown in clear text (`GtkText:visibility`). */
|
|
11
10
|
get revealed(): boolean;
|
|
12
11
|
set revealed(value: boolean);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/** Whether Caps Lock is engaged, as last observed from a keyboard event. */
|
|
13
|
+
get capsLockOn(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Feed the platform's Caps Lock state in — GDK gets it from the keyboard
|
|
16
|
+
* device (adw-password-entry-row.c:111-115). Public because a host that
|
|
17
|
+
* knows better than `KeyboardEvent.getModifierState` (a virtual keyboard, a
|
|
18
|
+
* test) can drive it directly.
|
|
19
|
+
*/
|
|
20
|
+
setCapsLockOn(on: boolean): void;
|
|
21
|
+
protected _onConnected(): void;
|
|
22
|
+
attributeChangedCallback(name: string, oldValue: string | null, value: string | null): void;
|
|
23
|
+
/** `notify_visibility_cb` (C:62-81), applied to the DOM. */
|
|
24
|
+
private _renderPassword;
|
|
16
25
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Which side of the anchor the surface sits on. */
|
|
2
|
+
export type AdwPopoverPosition = 'bottom' | 'top' | 'start' | 'end';
|
|
3
|
+
/** Which edge of the anchor the surface lines up with. */
|
|
4
|
+
export type AdwPopoverAlign = 'start' | 'end';
|
|
5
|
+
/** The ARIA role of the surface — it decides the row role consumers give their items. */
|
|
6
|
+
export type AdwPopoverRole = 'menu' | 'listbox';
|
|
7
|
+
export declare class AdwPopover extends HTMLElement {
|
|
8
|
+
private readonly _state;
|
|
9
|
+
private _anchor;
|
|
10
|
+
private _initialized;
|
|
11
|
+
/** Guards the `open` attribute↔property loop, which would otherwise recurse. */
|
|
12
|
+
private _reflecting;
|
|
13
|
+
private _onDocumentPointerDown;
|
|
14
|
+
private _onDocumentKeyDown;
|
|
15
|
+
static get observedAttributes(): string[];
|
|
16
|
+
/** Whether the popover is showing. */
|
|
17
|
+
get open(): boolean;
|
|
18
|
+
set open(value: boolean);
|
|
19
|
+
/**
|
|
20
|
+
* The element the surface is positioned against and hands focus back to.
|
|
21
|
+
* Defaults to `parentElement`, which is the common case: the popover is the
|
|
22
|
+
* last child of the widget that owns it.
|
|
23
|
+
*/
|
|
24
|
+
get anchor(): HTMLElement | null;
|
|
25
|
+
set anchor(value: HTMLElement | null);
|
|
26
|
+
/** Which side of the anchor the surface sits on. */
|
|
27
|
+
get position(): AdwPopoverPosition;
|
|
28
|
+
set position(value: AdwPopoverPosition);
|
|
29
|
+
/** Which edge of the anchor the surface lines up with. */
|
|
30
|
+
get align(): AdwPopoverAlign;
|
|
31
|
+
set align(value: AdwPopoverAlign);
|
|
32
|
+
/** The surface's ARIA role. */
|
|
33
|
+
get popoverRole(): AdwPopoverRole;
|
|
34
|
+
/** The navigable rows, in DOM order. Hidden rows are skipped — a filtered list navigates what it shows. */
|
|
35
|
+
get items(): HTMLElement[];
|
|
36
|
+
/** Show the popover — `gtk_popover_popup()`. */
|
|
37
|
+
popup(): void;
|
|
38
|
+
/** Hide the popover — `gtk_popover_popdown()`. */
|
|
39
|
+
popdown(): void;
|
|
40
|
+
/** Subscribe to open-state changes. Returns an unsubscribe function. */
|
|
41
|
+
subscribe(listener: (open: boolean) => void): () => void;
|
|
42
|
+
connectedCallback(): void;
|
|
43
|
+
disconnectedCallback(): void;
|
|
44
|
+
attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
|
|
45
|
+
private _onStateChange;
|
|
46
|
+
private _bindDocument;
|
|
47
|
+
private _unbindDocument;
|
|
48
|
+
private _render;
|
|
49
|
+
/**
|
|
50
|
+
* Arrow/Home/End/Enter/Space inside the surface. The arithmetic is core's
|
|
51
|
+
* ({@link resolvePopoverKey}); this only maps its answer onto the DOM.
|
|
52
|
+
*
|
|
53
|
+
* Escape is NOT handled here — it is bound at the document in capture phase
|
|
54
|
+
* so it works no matter where focus sits, including a search entry inside
|
|
55
|
+
* the popover.
|
|
56
|
+
*/
|
|
57
|
+
private _onKeyDown;
|
|
58
|
+
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
import type { PreferencesSearchResult, SearchPreferencesOptions } from '@gjsify/adwaita-core';
|
|
1
2
|
/**
|
|
2
|
-
* A single preferences page. Child of <adw-preferences-dialog
|
|
3
|
-
*
|
|
3
|
+
* A single preferences page. Child of <adw-preferences-dialog>. Carries optional
|
|
4
|
+
* `title` / `icon-name` / `name` / `use-underline` attributes and any
|
|
4
5
|
* <adw-preferences-group> content — mirrors Adw.PreferencesPage.
|
|
6
|
+
*
|
|
7
|
+
* The dialog keeps the page ELEMENT rather than hoisting its children out,
|
|
8
|
+
* because the page's identity is load-bearing: `adw_preferences_dialog_add`
|
|
9
|
+
* binds title / icon-name / name / use-underline / visible onto the view-stack
|
|
10
|
+
* page (adw-preferences-dialog.c:707-711), and `create_search_row_subtitle`
|
|
11
|
+
* needs the title back the moment a second page is visible.
|
|
5
12
|
*/
|
|
6
13
|
export declare class AdwPreferencesPage extends HTMLElement {
|
|
7
14
|
static get observedAttributes(): string[];
|
|
15
|
+
/** `adw_preferences_page_get_name` — the view-stack child name. */
|
|
16
|
+
get name(): string;
|
|
17
|
+
set name(value: string);
|
|
18
|
+
/** `AdwPreferencesPage:icon-name`, shown by a view switcher. */
|
|
19
|
+
get iconName(): string;
|
|
20
|
+
set iconName(value: string);
|
|
21
|
+
/** `AdwPreferencesPage:use-underline` — the title carries a mnemonic. */
|
|
22
|
+
get useUnderline(): boolean;
|
|
23
|
+
set useUnderline(value: boolean);
|
|
24
|
+
/** The page's groups, in document order. */
|
|
25
|
+
get groups(): HTMLElement[];
|
|
8
26
|
}
|
|
9
27
|
export declare class AdwPreferencesDialog extends HTMLElement {
|
|
10
28
|
private _initialized;
|
|
@@ -12,6 +30,7 @@ export declare class AdwPreferencesDialog extends HTMLElement {
|
|
|
12
30
|
private _dialogEl;
|
|
13
31
|
private _titleEl;
|
|
14
32
|
private _bodyEl;
|
|
33
|
+
private _pagesEl;
|
|
15
34
|
private _closeBtn;
|
|
16
35
|
static get observedAttributes(): string[];
|
|
17
36
|
/** Whether the dialog is revealed. */
|
|
@@ -29,6 +48,42 @@ export declare class AdwPreferencesDialog extends HTMLElement {
|
|
|
29
48
|
close(): void;
|
|
30
49
|
/** Dismiss the dialog regardless of `can-close` (mirrors Adw.Dialog.force_close). */
|
|
31
50
|
forceClose(): void;
|
|
51
|
+
/**
|
|
52
|
+
* `adw_preferences_dialog_add` (adw-preferences-dialog.c:693-716) — add a
|
|
53
|
+
* page at ANY time.
|
|
54
|
+
*
|
|
55
|
+
* Before this the pages were snapshotted once, in `connectedCallback`; a
|
|
56
|
+
* page appended later stayed a sibling of the scrim and rendered OUTSIDE
|
|
57
|
+
* the dialog card. GTK and the NativeScript port both accept a page
|
|
58
|
+
* whenever it arrives.
|
|
59
|
+
*/
|
|
60
|
+
add(page: AdwPreferencesPage): void;
|
|
61
|
+
/**
|
|
62
|
+
* `adw_preferences_dialog_remove` (:723-745). C logs
|
|
63
|
+
* `ADW_CRITICAL_CANNOT_REMOVE_CHILD` and no-ops for a page it does not own;
|
|
64
|
+
* returning `false` is the same contract without a console write.
|
|
65
|
+
*
|
|
66
|
+
* NOT named `remove`: `ChildNode.remove()` already exists on every element
|
|
67
|
+
* and takes no arguments, so overriding it with a different signature makes
|
|
68
|
+
* the class un-assignable to `HTMLElement` — which `customElements.define`
|
|
69
|
+
* requires.
|
|
70
|
+
*/
|
|
71
|
+
removePage(page: AdwPreferencesPage): boolean;
|
|
72
|
+
/** The dialog's pages, in add order. */
|
|
73
|
+
get pages(): AdwPreferencesPage[];
|
|
74
|
+
/**
|
|
75
|
+
* The preferences search (`filter_search_results` +
|
|
76
|
+
* `create_search_row_subtitle`), over this dialog's live page subtree.
|
|
77
|
+
*
|
|
78
|
+
* The whole pipeline is `@gjsify/adwaita-core`'s, so this dialog and the
|
|
79
|
+
* NativeScript one answer identically for the same tree — including the
|
|
80
|
+
* three corpus filters (visible page → visible group → titled visible row)
|
|
81
|
+
* and the case fold that makes `strasse` find `Straße`.
|
|
82
|
+
*
|
|
83
|
+
* An empty query returns the WHOLE corpus, which is what C does and what
|
|
84
|
+
* makes the results list non-empty before the user types.
|
|
85
|
+
*/
|
|
86
|
+
search(query: string, options?: SearchPreferencesOptions): PreferencesSearchResult<Element>[];
|
|
32
87
|
connectedCallback(): void;
|
|
33
88
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
34
89
|
private _attemptClose;
|
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
export declare class AdwPreferencesGroup extends HTMLElement {
|
|
2
|
+
private _headerEl;
|
|
2
3
|
private _titleEl;
|
|
3
4
|
private _descriptionEl;
|
|
4
5
|
private _suffixEl;
|
|
6
|
+
private _listboxEl;
|
|
5
7
|
private _initialized;
|
|
8
|
+
private _observer;
|
|
6
9
|
static get observedAttributes(): string[];
|
|
7
10
|
get description(): string;
|
|
8
11
|
set description(value: string);
|
|
12
|
+
/**
|
|
13
|
+
* `adw_preferences_group_add` (adw-preferences-group.c:396-411): a row goes
|
|
14
|
+
* into the boxed list, a `header-suffix` child into the header.
|
|
15
|
+
*
|
|
16
|
+
* Exposed as a method AND wired to a `MutationObserver` on the host, because
|
|
17
|
+
* both spellings occur: `group.addRow(row)` in code, `group.append(row)` in
|
|
18
|
+
* a framework's rendering. Before this, a child appended after connect
|
|
19
|
+
* stayed a bare child of the host — outside the card, and invisible to the
|
|
20
|
+
* row count that decides whether the card is painted at all.
|
|
21
|
+
*/
|
|
22
|
+
addRow(child: Node): void;
|
|
23
|
+
/**
|
|
24
|
+
* `adw_preferences_group_remove` (:421-440). C logs
|
|
25
|
+
* `ADW_CRITICAL_CANNOT_REMOVE_CHILD` and no-ops for a child it does not
|
|
26
|
+
* own; returning `false` is the same contract without a console write.
|
|
27
|
+
*/
|
|
28
|
+
removeRow(child: Node): boolean;
|
|
9
29
|
connectedCallback(): void;
|
|
30
|
+
disconnectedCallback(): void;
|
|
10
31
|
attributeChangedCallback(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Adopt children appended to the HOST after the subtree was built, so
|
|
34
|
+
* `group.append(row)` behaves like `adw_preferences_group_add`.
|
|
35
|
+
*
|
|
36
|
+
* C gets this for free — `gtk_widget_observe_children` on the listbox drives
|
|
37
|
+
* `update_listbox_visibility` through `items-changed`
|
|
38
|
+
* (adw-preferences-group.c:335-339) — and a DOM element needs the observer
|
|
39
|
+
* to have the same rule hold over time rather than only at connect.
|
|
40
|
+
*/
|
|
41
|
+
private _observeHost;
|
|
11
42
|
private _renderHeader;
|
|
12
43
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare class AdwProgressBar extends HTMLElement {
|
|
2
|
+
private _trough;
|
|
3
|
+
private _progress;
|
|
4
|
+
private _text;
|
|
5
|
+
private _initialized;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
/** How much of the bar is filled, 0…1. Always the CLAMPED value. */
|
|
8
|
+
get fraction(): number;
|
|
9
|
+
set fraction(value: number);
|
|
10
|
+
/** Whether the bar is indeterminate. */
|
|
11
|
+
get pulsing(): boolean;
|
|
12
|
+
set pulsing(value: boolean);
|
|
13
|
+
/** Whether the text node is shown. */
|
|
14
|
+
get showText(): boolean;
|
|
15
|
+
set showText(value: boolean);
|
|
16
|
+
/** The shown text. Falls back to the fraction as a percentage. */
|
|
17
|
+
get text(): string;
|
|
18
|
+
set text(value: string);
|
|
19
|
+
/** Whether the bar fills from the far end. */
|
|
20
|
+
get inverted(): boolean;
|
|
21
|
+
set inverted(value: boolean);
|
|
22
|
+
/** Whether the `.osd` hairline variant is used. */
|
|
23
|
+
get osd(): boolean;
|
|
24
|
+
set osd(value: boolean);
|
|
25
|
+
/** Whether the widget is dimmed. */
|
|
26
|
+
get disabled(): boolean;
|
|
27
|
+
set disabled(value: boolean);
|
|
28
|
+
/**
|
|
29
|
+
* Switch the bar to indeterminate — GtkProgressBar's method name for the
|
|
30
|
+
* same intent. See the module header: the bouncing block is a CSS animation
|
|
31
|
+
* here, so this ENTERS the state and repeat calls are no-ops; GTK's
|
|
32
|
+
* `pulse-step` arithmetic is not verifiable in this tree and is not faked.
|
|
33
|
+
*/
|
|
34
|
+
pulse(): void;
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
attributeChangedCallback(): void;
|
|
37
|
+
private _render;
|
|
38
|
+
}
|
|
@@ -1,29 +1,61 @@
|
|
|
1
|
+
import { type AdwSidebarItemSpec, type AdwSidebarSectionSpec, type SidebarItemFilter } from '@gjsify/adwaita-core';
|
|
1
2
|
/** A single sidebar item. Child of <adw-sidebar-section>; consumed at connect time. */
|
|
2
3
|
export declare class AdwSidebarItem extends HTMLElement {
|
|
3
4
|
static get observedAttributes(): string[];
|
|
5
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
4
6
|
}
|
|
5
7
|
/** A titled group of items. Child of <adw-sidebar>; consumed at connect time. */
|
|
6
8
|
export declare class AdwSidebarSection extends HTMLElement {
|
|
7
9
|
static get observedAttributes(): string[];
|
|
10
|
+
attributeChangedCallback(_name: string, _oldValue: string | null, newValue: string | null): void;
|
|
8
11
|
}
|
|
9
12
|
export declare class AdwSidebar extends HTMLElement {
|
|
13
|
+
private readonly _state;
|
|
10
14
|
private _listEl;
|
|
11
15
|
private _rows;
|
|
12
|
-
private _selected;
|
|
13
|
-
private _mode;
|
|
14
16
|
private _initialized;
|
|
17
|
+
/** Guards the `selected` attribute write we make ourselves from re-entering. */
|
|
18
|
+
private _reflecting;
|
|
15
19
|
static get observedAttributes(): string[];
|
|
16
20
|
/** Zero-based flat index of the selected item, or -1 for no selection. */
|
|
17
21
|
get selected(): number;
|
|
18
22
|
set selected(value: number);
|
|
23
|
+
/** The selected item's spec, or undefined — Adw.Sidebar:selected-item. */
|
|
24
|
+
get selectedItem(): AdwSidebarItemSpec | undefined;
|
|
19
25
|
/** 'sidebar' (flat navigation list) or 'page' (boxed lists). */
|
|
20
26
|
get mode(): 'sidebar' | 'page';
|
|
21
27
|
set mode(value: 'sidebar' | 'page');
|
|
28
|
+
/** The section/item model. Assigning replaces it, the way adw_sidebar_remove_all + append would. */
|
|
29
|
+
get sections(): readonly AdwSidebarSectionSpec[];
|
|
30
|
+
set sections(value: readonly AdwSidebarSectionSpec[]);
|
|
31
|
+
/** Adw.Sidebar:filter — decides which rows render, never the selection index space. */
|
|
32
|
+
get filter(): SidebarItemFilter | null;
|
|
33
|
+
set filter(value: SidebarItemFilter | null);
|
|
22
34
|
connectedCallback(): void;
|
|
23
35
|
attributeChangedCallback(name: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Re-derive after a declared `<adw-sidebar-item>` / `<adw-sidebar-section>`
|
|
38
|
+
* attribute changed. The item model keeps its shape, so the selection cannot
|
|
39
|
+
* move — exactly like the GObject property bindings this stands in for.
|
|
40
|
+
*/
|
|
41
|
+
refresh(): void;
|
|
42
|
+
/** Snapshot the declared children into specs, and bind them for live updates. */
|
|
43
|
+
private _readDeclaredSections;
|
|
24
44
|
private _readModeAttr;
|
|
45
|
+
/**
|
|
46
|
+
* `parseFloat`, not `parseInt`: the core rejects a fractional position, and
|
|
47
|
+
* truncating `"1.5"` to row 1 here would hide that from it. An unparseable
|
|
48
|
+
* value is NaN, which the core turns into "no selection".
|
|
49
|
+
*/
|
|
25
50
|
private _readSelectedAttr;
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
51
|
+
private _reflectSelected;
|
|
52
|
+
private _onSelectionChanged;
|
|
53
|
+
/** Click handler — the core applies the selection, then `activated` fires. */
|
|
54
|
+
private _activate;
|
|
55
|
+
/** Rebuild the rendered rows + headers from the core's derived model. */
|
|
56
|
+
private _rebuild;
|
|
57
|
+
private _createHeader;
|
|
58
|
+
private _createRow;
|
|
59
|
+
private _applyMode;
|
|
60
|
+
private _applySelection;
|
|
29
61
|
}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
export declare class AdwSpinner extends HTMLElement {
|
|
2
2
|
static get observedAttributes(): string[];
|
|
3
|
+
private _svg;
|
|
4
|
+
private _track;
|
|
5
|
+
private _arc;
|
|
6
|
+
/** Path length of the ring, so the dash arithmetic is done once per resize. */
|
|
7
|
+
private _circumference;
|
|
8
|
+
/** Ring radius in px — the dash lengths are arc-length, i.e. radians × r. */
|
|
9
|
+
private _radius;
|
|
10
|
+
/** The timestamp this spinner was mapped at, so its progress starts at 0. */
|
|
11
|
+
private _origin;
|
|
3
12
|
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
4
14
|
attributeChangedCallback(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Draw the frame for `now`, in `requestAnimationFrame` timebase.
|
|
17
|
+
*
|
|
18
|
+
* Public because the shared ticker is a module-level function rather than a
|
|
19
|
+
* method — and because a test needs to place the spinner at a known moment
|
|
20
|
+
* without waiting for real frames.
|
|
21
|
+
*/
|
|
22
|
+
drawAt(now: number): void;
|
|
23
|
+
private _build;
|
|
24
|
+
/** Re-derive the box, the ring and the stroke from the `size` attribute. */
|
|
5
25
|
private _sync;
|
|
26
|
+
/** The progress the last painted frame used, so a resize can repaint it. */
|
|
27
|
+
private _lastProgress;
|
|
28
|
+
private _paint;
|
|
6
29
|
}
|
|
@@ -1,18 +1,64 @@
|
|
|
1
|
+
import type { AdwMenuEntry, SplitButtonDirection } from '@gjsify/adwaita-core';
|
|
2
|
+
import './adw-popover.js';
|
|
1
3
|
export declare class AdwSplitButton extends HTMLElement {
|
|
4
|
+
private readonly _state;
|
|
2
5
|
private _actionEl;
|
|
3
6
|
private _dropdownEl;
|
|
7
|
+
private _arrowEl;
|
|
4
8
|
private _menuEl;
|
|
5
|
-
|
|
6
|
-
private
|
|
9
|
+
/** Inline text content, captured before we take over the subtree. */
|
|
10
|
+
private _inlineLabel;
|
|
11
|
+
/** Last `open` value reflected as `notify::active`, so the event fires once per flip. */
|
|
12
|
+
private _openReflected;
|
|
7
13
|
private _initialized;
|
|
8
|
-
private _onDocumentPointerDown;
|
|
9
14
|
static get observedAttributes(): string[];
|
|
10
15
|
/** Whether the dropdown menu is currently open. */
|
|
11
16
|
get active(): boolean;
|
|
17
|
+
/** Whether the dropdown half is live (there is a menu to show). */
|
|
18
|
+
get dropdownEnabled(): boolean;
|
|
19
|
+
/** The action label, or `null` when the action half shows an icon or nothing. */
|
|
20
|
+
get label(): string | null;
|
|
21
|
+
set label(value: string);
|
|
22
|
+
/** The symbolic icon name, or `null` when the action half shows a label or nothing. */
|
|
23
|
+
get iconName(): string | null;
|
|
24
|
+
set iconName(value: string);
|
|
25
|
+
/** The dropdown menu entries. */
|
|
26
|
+
get menuItems(): readonly AdwMenuEntry[];
|
|
27
|
+
set menuItems(value: readonly AdwMenuEntry[]);
|
|
28
|
+
/** The dropdown tooltip as set — `''` while unset. */
|
|
29
|
+
get dropdownTooltip(): string;
|
|
30
|
+
set dropdownTooltip(value: string);
|
|
31
|
+
/** The direction the popup opens in, and the arrow points. */
|
|
32
|
+
get direction(): SplitButtonDirection;
|
|
33
|
+
set direction(value: SplitButtonDirection);
|
|
34
|
+
/** Whether an underline in the label marks a mnemonic. */
|
|
35
|
+
get useUnderline(): boolean;
|
|
36
|
+
set useUnderline(value: boolean);
|
|
37
|
+
/** Pop the menu up — `adw_split_button_popup()`. */
|
|
38
|
+
popup(): void;
|
|
39
|
+
/** Dismiss the menu — `adw_split_button_popdown()`. */
|
|
40
|
+
popdown(): void;
|
|
12
41
|
connectedCallback(): void;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
42
|
+
attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
|
|
43
|
+
/** Seed label/icon/menu/direction/tooltip from the attributes present at connect time. */
|
|
44
|
+
private _syncStateFromAttributes;
|
|
45
|
+
/**
|
|
46
|
+
* Route a `label` / `icon-name` attribute mutation into the content machine.
|
|
47
|
+
*
|
|
48
|
+
* C has no independent "unset" for either slot — clearing one is a side
|
|
49
|
+
* effect of setting another — so a REMOVED attribute falls back to whichever
|
|
50
|
+
* sibling is still present, and to the empty child otherwise. That fallback
|
|
51
|
+
* is what makes `removeAttribute('label')` actually drop the label; it used
|
|
52
|
+
* to be a silent no-op, so the storybook's icon-only mode rendered the icon
|
|
53
|
+
* next to a stale "Save".
|
|
54
|
+
*/
|
|
55
|
+
private _applyContentAttribute;
|
|
56
|
+
private _onStateChange;
|
|
17
57
|
private _render;
|
|
58
|
+
/** The action half + the root style classes libadwaita derives from it. */
|
|
59
|
+
private _renderContent;
|
|
60
|
+
/** The dropdown half: arrow glyph, tooltip/accessible name, expanded state. */
|
|
61
|
+
private _renderDropdown;
|
|
62
|
+
/** The popover contents, one button per menu entry, dispatched BY POSITION. */
|
|
63
|
+
private _renderMenu;
|
|
18
64
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import './adw-switch.js';
|
|
1
2
|
export declare class AdwSwitchRow extends HTMLElement {
|
|
2
|
-
private
|
|
3
|
+
private _switchEl;
|
|
3
4
|
private _titleEl;
|
|
4
5
|
private _subtitleEl;
|
|
6
|
+
/** The headless active flag + its notify rule (ADR 0004). */
|
|
7
|
+
private readonly _state;
|
|
5
8
|
private _initialized;
|
|
6
9
|
static get observedAttributes(): string[];
|
|
7
10
|
get active(): boolean;
|
|
8
11
|
set active(value: boolean);
|
|
9
12
|
connectedCallback(): void;
|
|
10
|
-
attributeChangedCallback(name: string
|
|
13
|
+
attributeChangedCallback(name: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Push a state transition out to the DOM and emit `notify::active` — but
|
|
16
|
+
* only when something actually changed, which is the `g_object_notify`
|
|
17
|
+
* gate libadwaita puts on the same transition (C:224-225 → :76).
|
|
18
|
+
*/
|
|
19
|
+
private _apply;
|
|
11
20
|
private _renderText;
|
|
12
21
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class AdwSwitch extends HTMLElement {
|
|
2
|
+
private _input;
|
|
3
|
+
private _slider;
|
|
4
|
+
private _initialized;
|
|
5
|
+
static get observedAttributes(): string[];
|
|
6
|
+
/** Whether the switch is on. */
|
|
7
|
+
get active(): boolean;
|
|
8
|
+
set active(value: boolean);
|
|
9
|
+
/** Whether the switch is inert. */
|
|
10
|
+
get disabled(): boolean;
|
|
11
|
+
set disabled(value: boolean);
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
attributeChangedCallback(name: string): void;
|
|
14
|
+
private _render;
|
|
15
|
+
}
|