@gjsify/adwaita-web 0.32.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 +72 -50
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/elements/adw-combo-row.d.ts +10 -0
- package/lib/types/elements/adw-inline-view-switcher.d.ts +37 -1
- package/lib/types/elements/adw-navigation-split-view.d.ts +42 -0
- package/lib/types/elements/adw-overlay-split-view.d.ts +56 -0
- package/lib/types/elements/adw-spinner.d.ts +23 -0
- package/lib/types/elements/adw-view-stack.d.ts +12 -0
- package/lib/types/elements/adw-view-switcher-bar.d.ts +7 -5
- package/lib/types/elements/adw-view-switcher.d.ts +55 -3
- package/lib/types/elements/adw-wrap-box.d.ts +58 -3
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +6 -6
- package/scss/_combo_row.scss +19 -0
- package/scss/_navigation_split_view.scss +47 -8
- package/scss/_overlay_split_view.scss +117 -32
- package/scss/_spinner.scss +35 -21
- package/scss/_tab_view.scss +12 -13
- package/scss/_wrap_box.scss +9 -0
- package/src/adw-avatar.spec.ts +37 -0
- package/src/adw-button-content.spec.ts +24 -0
- package/src/adw-row-state.spec.ts +49 -0
- package/src/adw-wrap-box.spec.ts +148 -1
- package/src/chrome.spec.ts +111 -12
- package/src/elements/adw-action-row.ts +11 -1
- package/src/elements/adw-combo-row.ts +17 -0
- package/src/elements/adw-inline-view-switcher.ts +91 -8
- package/src/elements/adw-navigation-split-view.ts +179 -14
- package/src/elements/adw-overlay-split-view.ts +378 -20
- package/src/elements/adw-spinner.ts +165 -21
- package/src/elements/adw-tab-view.ts +20 -2
- package/src/elements/adw-view-stack.ts +21 -0
- package/src/elements/adw-view-switcher-bar.ts +13 -5
- package/src/elements/adw-view-switcher.ts +103 -11
- package/src/elements/adw-wrap-box.ts +290 -135
- package/src/split-views.spec.ts +586 -2
- package/src/styles.generated.ts +1 -1
- package/src/view-switcher.spec.ts +219 -0
|
@@ -11,5 +11,15 @@ export declare class AdwComboRow extends HTMLElement {
|
|
|
11
11
|
set selected(value: number);
|
|
12
12
|
connectedCallback(): void;
|
|
13
13
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
14
|
+
/**
|
|
15
|
+
* `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
|
|
16
|
+
* choice, so the arrow goes and the row stops being activatable.
|
|
17
|
+
*
|
|
18
|
+
* Both halves have to be expressed: `data-presents-chooser` gates the
|
|
19
|
+
* `.adw-row-value::after` mask in the stylesheet, and DISABLING the overlaid
|
|
20
|
+
* `<select>` is what makes the row inert — hiding the arrow alone would leave
|
|
21
|
+
* a row that still opens a one-entry popup on click.
|
|
22
|
+
*/
|
|
23
|
+
private _syncChooser;
|
|
14
24
|
private _renderText;
|
|
15
25
|
}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
+
import type { ViewSwitcherScheduler } from '@gjsify/adwaita-core';
|
|
1
2
|
import type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPage } from '@gjsify/adwaita-core';
|
|
2
3
|
/** A single page. Children of <adw-inline-view-switcher>; consumed at connect time. */
|
|
3
4
|
export declare class AdwViewStackPage extends HTMLElement {
|
|
4
5
|
static get observedAttributes(): string[];
|
|
5
6
|
}
|
|
6
7
|
export declare class AdwInlineViewSwitcher extends HTMLElement {
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The dwell timer, injectable.
|
|
10
|
+
*
|
|
11
|
+
* It used to be `new ViewSwitcherState({ scheduler: domViewSwitcherScheduler })`
|
|
12
|
+
* inline, which left NOWHERE to hand a clock in — so
|
|
13
|
+
* `VIEW_SWITCHER_DRAG_VECTORS` was driven by the core suite alone, and the
|
|
14
|
+
* conformance header claimed all three suites drove it. `scheduler` is a
|
|
15
|
+
* property so a test can replace it before the element connects; the DOM one
|
|
16
|
+
* is the default, exactly as before.
|
|
17
|
+
*/
|
|
18
|
+
scheduler: ViewSwitcherScheduler;
|
|
19
|
+
private _stateInstance;
|
|
20
|
+
/** Built on first access, so a `scheduler` set before connect is the one used. */
|
|
21
|
+
private get _state();
|
|
8
22
|
private _groupEl;
|
|
9
23
|
private _pagesEl;
|
|
10
24
|
private _panels;
|
|
11
25
|
private _toggles;
|
|
12
26
|
private _displayMode;
|
|
13
27
|
private _initialized;
|
|
28
|
+
/** The page ELEMENTS, kept because this element detaches them from the tree. */
|
|
29
|
+
private _declared;
|
|
30
|
+
private _pageObserver;
|
|
14
31
|
static get observedAttributes(): string[];
|
|
15
32
|
constructor();
|
|
16
33
|
/** Zero-based index of the visible PAGE, `-1` when nothing is selected. */
|
|
@@ -39,6 +56,25 @@ export declare class AdwInlineViewSwitcher extends HTMLElement {
|
|
|
39
56
|
setPageVisible(name: string, visible: boolean): boolean;
|
|
40
57
|
connectedCallback(): void;
|
|
41
58
|
disconnectedCallback(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Re-read every declared page and push it into the state.
|
|
61
|
+
*
|
|
62
|
+
* Driven by {@link _watchPages}, which is what makes a runtime
|
|
63
|
+
* `badge-number` or `icon-name` change reach the toggle — C rebinds on every
|
|
64
|
+
* page `notify` (adw-view-switcher.c:184-193) and this element did not.
|
|
65
|
+
*/
|
|
66
|
+
refreshPages(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Watch the declared pages for attribute changes — the DOM's `notify::` on
|
|
69
|
+
* `AdwViewStackPage`, which C binds per page (adw-view-switcher.c:184-193).
|
|
70
|
+
*
|
|
71
|
+
* A `MutationObserver` rather than an `attributeChangedCallback`: this
|
|
72
|
+
* element consumes the page elements at connect and `replaceChildren`s them
|
|
73
|
+
* out of the tree, so a detached page cannot find its owner. It delivers on
|
|
74
|
+
* a MICROTASK where GTK's notify is synchronous — invisible to a user, and
|
|
75
|
+
* nothing here reads the toggle back inside the setter.
|
|
76
|
+
*/
|
|
77
|
+
private _watchPages;
|
|
42
78
|
attributeChangedCallback(name: string): void;
|
|
43
79
|
private _readDisplayModeAttr;
|
|
44
80
|
/**
|
|
@@ -1,20 +1,62 @@
|
|
|
1
|
+
import { type AdwPackType, type NavigationActionResult } from '@gjsify/adwaita-core';
|
|
2
|
+
/** Detail of the `navigation-push` / `navigation-pop` delegation event. */
|
|
3
|
+
export interface NavigationDelegateDetail {
|
|
4
|
+
/** The tag a `push` names; absent for a `pop`. */
|
|
5
|
+
tag?: string;
|
|
6
|
+
/** Set by an ancestor that handled it — the `return TRUE` of the C's routing. */
|
|
7
|
+
handled: boolean;
|
|
8
|
+
}
|
|
1
9
|
export declare class AdwNavigationSplitView extends HTMLElement {
|
|
2
10
|
private _sidebarEl;
|
|
3
11
|
private _contentEl;
|
|
4
12
|
private _initialized;
|
|
5
13
|
private _disposeBreakpoint;
|
|
14
|
+
/** The ordering table, the tag guard and the action routing (ADR 0004). */
|
|
15
|
+
private _state;
|
|
16
|
+
/** Re-entrancy guard for the `show-content` reflection. */
|
|
17
|
+
private _reflecting;
|
|
6
18
|
static get observedAttributes(): string[];
|
|
7
19
|
get collapsed(): boolean;
|
|
8
20
|
set collapsed(v: boolean);
|
|
9
21
|
/** When collapsed, whether the content pane (true) or sidebar (false) shows. */
|
|
10
22
|
get showContent(): boolean;
|
|
11
23
|
set showContent(v: boolean);
|
|
24
|
+
/** Which side the sidebar is packed on — `start` (default) or `end`. */
|
|
25
|
+
get sidebarPosition(): AdwPackType;
|
|
26
|
+
set sidebarPosition(value: AdwPackType);
|
|
27
|
+
/** The sidebar page's tag of record, or `null`. */
|
|
28
|
+
get sidebarTag(): string | null;
|
|
29
|
+
/** The content page's tag of record, or `null`. */
|
|
30
|
+
get contentTag(): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* `navigation.push` with `tag` — `navigation_push_cb` (:644-685).
|
|
33
|
+
*
|
|
34
|
+
* An unmatched tag DELEGATES to the parent before it may become a critical,
|
|
35
|
+
* which is how nested split views forward a push outwards; on this port that
|
|
36
|
+
* is a bubbling `navigation-push` event whose `detail.handled` an ancestor
|
|
37
|
+
* sets. Returns what the routing decided.
|
|
38
|
+
*/
|
|
39
|
+
push(tag: string): NavigationActionResult;
|
|
40
|
+
/** `navigation.pop` — `navigation_pop_cb` (:687-702). */
|
|
41
|
+
pop(): NavigationActionResult;
|
|
12
42
|
connectedCallback(): void;
|
|
43
|
+
/** `Adw.NavigationPage:tag` off the slotted pane, or `null` when untagged. */
|
|
44
|
+
private _tagOf;
|
|
45
|
+
/**
|
|
46
|
+
* Mirror the state's `showContent` onto the attribute, so the DOM keeps
|
|
47
|
+
* telling the truth after a `navigation.push` moved it.
|
|
48
|
+
*
|
|
49
|
+
* Guarded the way the overlay view's reflection is: writing the attribute
|
|
50
|
+
* re-enters `attributeChangedCallback`, which without the flag is a loop.
|
|
51
|
+
*/
|
|
52
|
+
private _reflectShowContent;
|
|
13
53
|
disconnectedCallback(): void;
|
|
14
54
|
attributeChangedCallback(name: string): void;
|
|
15
55
|
private _syncWidth;
|
|
16
56
|
/** A pixel attribute, falling back to the widget's own default. */
|
|
17
57
|
private _widthAttr;
|
|
58
|
+
/** The reading direction `start` / `end` resolve against (`get_start_or_end`, :220-227). */
|
|
59
|
+
private get _direction();
|
|
18
60
|
private _syncClasses;
|
|
19
61
|
/** (Re)bind the `breakpoint` condition to `collapsed`. */
|
|
20
62
|
private _syncBreakpoint;
|
|
@@ -13,6 +13,13 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
13
13
|
private _state;
|
|
14
14
|
/** Re-entrancy guard for {@link _reflectShowSidebar}. */
|
|
15
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;
|
|
16
23
|
/**
|
|
17
24
|
* Every attribute {@link _readAttribute} handles must be listed here — an
|
|
18
25
|
* unobserved attribute never reaches `attributeChangedCallback`, so its branch
|
|
@@ -29,7 +36,23 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
29
36
|
get maxSidebarWidth(): number;
|
|
30
37
|
get sidebarWidthFraction(): number;
|
|
31
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;
|
|
32
53
|
disconnectedCallback(): void;
|
|
54
|
+
/** `escape_shortcut_cb` — only a COLLAPSED view with a revealed sidebar consumes it. */
|
|
55
|
+
private readonly _onKeyDown;
|
|
33
56
|
attributeChangedCallback(_name: string, _old: string | null, _val: string | null): void;
|
|
34
57
|
/**
|
|
35
58
|
* Push ONE attribute into the state, then reflect back what the state made
|
|
@@ -54,6 +77,39 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
54
77
|
openSidebar(): void;
|
|
55
78
|
hideSidebar(): void;
|
|
56
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();
|
|
57
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;
|
|
58
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;
|
|
59
115
|
}
|
|
@@ -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
|
}
|
|
@@ -39,6 +39,18 @@ export declare class AdwViewStack extends HTMLElement {
|
|
|
39
39
|
* (`update_child_visible`, adw-view-stack.c:1061-1082).
|
|
40
40
|
*/
|
|
41
41
|
setPageVisible(name: string, visible: boolean): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The pages model's `items-changed`, which the DOM stack had no counterpart
|
|
44
|
+
* for at all.
|
|
45
|
+
*
|
|
46
|
+
* `AdwViewSwitcherBar` re-runs `update_bar_revealed` on it
|
|
47
|
+
* (adw-view-switcher-bar.c:340) and `AdwViewSwitcher` rebinds its buttons
|
|
48
|
+
* (adw-view-switcher.c:258-263). Both ports listened only on
|
|
49
|
+
* `notify::visible-child`, so adding a page or hiding a non-selected one
|
|
50
|
+
* left `revealed` — and the button row — stale, with a manual `refresh()`
|
|
51
|
+
* as the documented workaround.
|
|
52
|
+
*/
|
|
53
|
+
private _emitItemsChanged;
|
|
42
54
|
private _onStateChange;
|
|
43
55
|
private _applyVisibility;
|
|
44
56
|
private _reflectName;
|
|
@@ -26,11 +26,13 @@ export declare class AdwViewSwitcherBar extends HTMLElement {
|
|
|
26
26
|
/** Bind to a stack element (or null). Unbinds the previous one and rebuilds. */
|
|
27
27
|
setStack(stack: AdwViewStack | null): void;
|
|
28
28
|
/**
|
|
29
|
-
* Rebuild the buttons
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* Rebuild the buttons by hand.
|
|
30
|
+
*
|
|
31
|
+
* Kept as public API — a consumer that mutates a page in place still has a
|
|
32
|
+
* way to say so — but no longer the ONLY way: the stack emits
|
|
33
|
+
* `items-changed` now and this bar binds it, which is the mechanism
|
|
34
|
+
* libadwaita uses (adw-view-switcher-bar.c:340,
|
|
35
|
+
* adw-view-switcher.c:258-263).
|
|
34
36
|
*/
|
|
35
37
|
refresh(): void;
|
|
36
38
|
private _readReveal;
|
|
@@ -1,13 +1,42 @@
|
|
|
1
|
+
import type { ViewSwitcherScheduler } from '@gjsify/adwaita-core';
|
|
1
2
|
import type { AdwViewSwitcherPage as AdwViewSwitcherPageInfo, AdwViewSwitcherPolicy } from '@gjsify/adwaita-core';
|
|
2
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A single page. Children of `<adw-view-switcher>`; consumed at connect time.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately carries NO `observedAttributes`. It used to declare six of them
|
|
7
|
+
* and no `attributeChangedCallback`, which is a dead declaration — the browser
|
|
8
|
+
* computes the list and has nowhere to deliver to — so changing `badge-number`,
|
|
9
|
+
* `title`, `icon-name` or `needs-attention` after connect did nothing at all,
|
|
10
|
+
* where C rebinds on every page `notify` (adw-view-switcher.c:184-193, :223).
|
|
11
|
+
*
|
|
12
|
+
* A callback could not fix it either: the switcher consumes these elements at
|
|
13
|
+
* connect and `replaceChildren`s them away, so a detached page has no `closest`
|
|
14
|
+
* to reach its owner through. The switcher watches them with a `MutationObserver`
|
|
15
|
+
* instead, which keeps working after the detach and needs nothing from this class.
|
|
16
|
+
*/
|
|
3
17
|
export declare class AdwViewSwitcherPage extends HTMLElement {
|
|
4
|
-
static get observedAttributes(): string[];
|
|
5
18
|
}
|
|
6
19
|
export declare class AdwViewSwitcher extends HTMLElement {
|
|
7
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The dwell timer, injectable.
|
|
22
|
+
*
|
|
23
|
+
* It used to be `new ViewSwitcherState({ scheduler: domViewSwitcherScheduler })`
|
|
24
|
+
* inline, which left NOWHERE to hand a clock in — so
|
|
25
|
+
* `VIEW_SWITCHER_DRAG_VECTORS` was driven by the core suite alone, and the
|
|
26
|
+
* conformance header claimed all three suites drove it. `scheduler` is a
|
|
27
|
+
* property so a test can replace it before the element connects; the DOM one
|
|
28
|
+
* is the default, exactly as before.
|
|
29
|
+
*/
|
|
30
|
+
scheduler: ViewSwitcherScheduler;
|
|
31
|
+
private _stateInstance;
|
|
32
|
+
/** Built on first access, so a `scheduler` set before connect is the one used. */
|
|
33
|
+
private get _state();
|
|
8
34
|
private _barEl;
|
|
9
35
|
private _contentEl;
|
|
10
36
|
private _nodes;
|
|
37
|
+
/** The page ELEMENTS, kept because the switcher detaches them from the tree. */
|
|
38
|
+
private _declared;
|
|
39
|
+
private _pageObserver;
|
|
11
40
|
private _policy;
|
|
12
41
|
private _initialized;
|
|
13
42
|
static get observedAttributes(): string[];
|
|
@@ -31,6 +60,29 @@ export declare class AdwViewSwitcher extends HTMLElement {
|
|
|
31
60
|
setPageVisible(name: string, visible: boolean): boolean;
|
|
32
61
|
connectedCallback(): void;
|
|
33
62
|
disconnectedCallback(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Re-read every declared page and push it into the state.
|
|
65
|
+
*
|
|
66
|
+
* Called by `AdwViewSwitcherPage.attributeChangedCallback`, which is what
|
|
67
|
+
* makes a runtime `badge-number` change reach the button. `setPages` keeps
|
|
68
|
+
* the selection where it can, so this is a repaint and not a reset.
|
|
69
|
+
*/
|
|
70
|
+
refreshPages(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Watch the declared pages for attribute changes.
|
|
73
|
+
*
|
|
74
|
+
* A `MutationObserver` rather than an `attributeChangedCallback` on the page:
|
|
75
|
+
* the switcher consumes those elements at connect and `replaceChildren`s them
|
|
76
|
+
* out of the tree, so a detached page cannot find its owner — but an observer
|
|
77
|
+
* bound to it keeps firing. This is the DOM's `notify::` on
|
|
78
|
+
* `AdwViewStackPage`, which the C's `update_button` handler binds per page
|
|
79
|
+
* (adw-view-switcher.c:184-193).
|
|
80
|
+
*
|
|
81
|
+
* It delivers on a MICROTASK where GTK's notify is synchronous. That is the
|
|
82
|
+
* DOM's contract for watching a node, it is invisible to a user, and nothing
|
|
83
|
+
* in this element reads the button back inside the setter.
|
|
84
|
+
*/
|
|
85
|
+
private _watchPages;
|
|
34
86
|
attributeChangedCallback(name: string): void;
|
|
35
87
|
private _buildPage;
|
|
36
88
|
private _readPolicyAttr;
|
|
@@ -1,13 +1,68 @@
|
|
|
1
|
+
import { type AdwLengthUnit } from '@gjsify/adwaita-core';
|
|
1
2
|
export declare class AdwWrapBox extends HTMLElement {
|
|
2
3
|
private _initialized;
|
|
3
|
-
static get observedAttributes():
|
|
4
|
-
/** Spacing between children on the same line, in
|
|
4
|
+
static get observedAttributes(): ("align" | "justify" | "justify-last-line" | "child-spacing" | "line-spacing" | "orientation" | "wrap-policy" | "child-spacing-unit" | "natural-line-length" | "pack-direction" | "wrap-reverse" | "line-spacing-unit" | "line-homogeneous" | "natural-line-length-unit")[];
|
|
5
|
+
/** Spacing between children on the same line, in `child-spacing-unit`. */
|
|
5
6
|
get childSpacing(): number;
|
|
6
7
|
set childSpacing(value: number);
|
|
7
|
-
/**
|
|
8
|
+
/** The unit `child-spacing` is written in. Defaults to `px`, as in C. */
|
|
9
|
+
get childSpacingUnit(): AdwLengthUnit;
|
|
10
|
+
set childSpacingUnit(value: AdwLengthUnit);
|
|
11
|
+
/** Spacing between lines, in `line-spacing-unit`. */
|
|
8
12
|
get lineSpacing(): number;
|
|
9
13
|
set lineSpacing(value: number);
|
|
14
|
+
/** The unit `line-spacing` is written in. Defaults to `px`, as in C. */
|
|
15
|
+
get lineSpacingUnit(): AdwLengthUnit;
|
|
16
|
+
set lineSpacingUnit(value: AdwLengthUnit);
|
|
17
|
+
/** Where the children sit ALONG the line (main axis): 0 start, 0.5 middle, 1 end. */
|
|
18
|
+
get align(): number;
|
|
19
|
+
set align(value: number);
|
|
20
|
+
/** Whether and how each line is stretched to fill the widget. */
|
|
21
|
+
get justify(): 'none' | 'fill' | 'spread';
|
|
22
|
+
set justify(value: 'none' | 'fill' | 'spread');
|
|
23
|
+
/** Whether the FINAL line is justified too. Default false, as in C. */
|
|
24
|
+
get justifyLastLine(): boolean;
|
|
25
|
+
set justifyLastLine(value: boolean);
|
|
26
|
+
/** Whether an overflowing line squeezes its children or lets them spill. */
|
|
27
|
+
get wrapPolicy(): 'minimum' | 'natural';
|
|
28
|
+
set wrapPolicy(value: 'minimum' | 'natural');
|
|
29
|
+
/** The direction children are packed in each line. */
|
|
30
|
+
get packDirection(): 'start-to-end' | 'end-to-start';
|
|
31
|
+
set packDirection(value: 'start-to-end' | 'end-to-start');
|
|
32
|
+
/** Whether lines wrap upwards (horizontal) / towards the start (vertical). */
|
|
33
|
+
get wrapReverse(): boolean;
|
|
34
|
+
set wrapReverse(value: boolean);
|
|
35
|
+
/** Whether every line takes the same amount of space. */
|
|
36
|
+
get lineHomogeneous(): boolean;
|
|
37
|
+
set lineHomogeneous(value: boolean);
|
|
38
|
+
/** The natural line length in `natural-line-length-unit`, or `-1` when unset. */
|
|
39
|
+
get naturalLineLength(): number;
|
|
40
|
+
set naturalLineLength(value: number);
|
|
41
|
+
/** The unit `natural-line-length` is written in. Defaults to `px`, as in C. */
|
|
42
|
+
get naturalLineLengthUnit(): AdwLengthUnit;
|
|
43
|
+
set naturalLineLengthUnit(value: AdwLengthUnit);
|
|
44
|
+
/** The axis children are packed along. */
|
|
45
|
+
get orientation(): 'horizontal' | 'vertical';
|
|
46
|
+
set orientation(value: 'horizontal' | 'vertical');
|
|
47
|
+
/** The element children, which are what the layout actually lays out. */
|
|
48
|
+
private get _children();
|
|
49
|
+
/**
|
|
50
|
+
* `adw_wrap_box_insert_child_after` (adw-wrap-box.c:1283-1300).
|
|
51
|
+
*
|
|
52
|
+
* A NULL/absent `sibling` inserts at the FIRST position, not the last —
|
|
53
|
+
* `gtk_widget_insert_after`'s documented rule, pinned by
|
|
54
|
+
* `WRAP_BOX_CHILD_ORDER_VECTORS`. Returns whether the insert happened; a
|
|
55
|
+
* refusal is where C would have hit a `g_return_if_fail`.
|
|
56
|
+
*/
|
|
57
|
+
insertChildAfter(child: Element, sibling?: Element | null): boolean;
|
|
58
|
+
/** `adw_wrap_box_reorder_child_after` (adw-wrap-box.c:1315-1332). Same NULL rule. */
|
|
59
|
+
reorderChildAfter(child: Element, sibling?: Element | null): boolean;
|
|
60
|
+
/** `adw_wrap_box_remove_all` (adw-wrap-box.c:1406-1414). */
|
|
61
|
+
removeAll(): void;
|
|
62
|
+
private _applyOrder;
|
|
10
63
|
connectedCallback(): void;
|
|
11
64
|
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
65
|
+
/** One attribute's value as the widget stores it — the notify comparison key. */
|
|
66
|
+
private _normalized;
|
|
12
67
|
private _sync;
|
|
13
68
|
}
|