@gjsify/adwaita-web 0.55.0 → 0.56.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/README.md +8 -0
- package/dist/adwaita-web.css +129 -27
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-status-page.spec.d.ts +1 -0
- package/lib/types/attributes.d.ts +19 -0
- package/lib/types/elements/adw-action-row.d.ts +4 -0
- package/lib/types/elements/adw-combo-row.d.ts +4 -0
- package/lib/types/elements/adw-entry-row.d.ts +6 -0
- package/lib/types/elements/adw-expander-row.d.ts +2 -0
- package/lib/types/elements/adw-header-bar.d.ts +6 -0
- package/lib/types/elements/adw-overlay-split-view.d.ts +13 -0
- package/lib/types/elements/adw-sidebar.d.ts +3 -2
- package/lib/types/elements/adw-spin-row.d.ts +6 -0
- package/lib/types/elements/adw-switch-row.d.ts +4 -0
- package/lib/types/elements/adw-toggle-group.d.ts +17 -0
- package/lib/types/elements/gtk-scrolled-window.d.ts +10 -2
- package/lib/types/elements/gtk-window.d.ts +8 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/row-line-clamp.d.ts +20 -0
- package/lib/types/row-tooltip.d.ts +8 -0
- package/lib/types/row-tooltip.spec.d.ts +1 -0
- package/lib/types/shared-tree-builder.d.ts +49 -19
- package/lib/types/shared-tree-mount.spec.d.ts +1 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/lib/types/widget-size.spec.d.ts +1 -0
- package/package.json +8 -8
- package/scss/_action_row.scss +39 -15
- package/scss/_button_row.scss +5 -0
- package/scss/_expander_row.scss +36 -3
- package/scss/_headerbar.scss +2 -1
- package/scss/_preferences_row.scss +9 -0
- package/scss/_row.scss +16 -0
- package/scss/_status_page.scss +1 -1
- package/scss/_toggle_group.scss +28 -0
- package/scss/_widget.scss +14 -3
- package/scss/_window.scss +13 -1
- package/src/adw-action-rows.spec.ts +255 -0
- package/src/adw-header-bar.spec.ts +18 -0
- package/src/adw-status-page.spec.ts +124 -0
- package/src/attributes.ts +52 -0
- package/src/capabilities.mjs +3 -0
- package/src/construct-vectors.spec.ts +1 -1
- package/src/elements/adw-action-row.ts +31 -2
- package/src/elements/adw-alert-dialog.ts +4 -1
- package/src/elements/adw-button-row.ts +7 -1
- package/src/elements/adw-combo-row.ts +26 -1
- package/src/elements/adw-entry-row.ts +22 -12
- package/src/elements/adw-expander-row.ts +34 -1
- package/src/elements/adw-header-bar.ts +18 -4
- package/src/elements/adw-overlay-split-view.ts +29 -6
- package/src/elements/adw-preferences-row.ts +5 -2
- package/src/elements/adw-sidebar.ts +33 -5
- package/src/elements/adw-spin-row.ts +37 -2
- package/src/elements/adw-status-page.ts +10 -2
- package/src/elements/adw-switch-row.ts +25 -1
- package/src/elements/adw-toggle-group.ts +119 -10
- package/src/elements/adw-window.ts +9 -4
- package/src/elements/gtk-scrolled-window.ts +18 -7
- package/src/elements/gtk-window.ts +9 -3
- package/src/gtk-window.spec.ts +12 -0
- package/src/index.ts +1 -1
- package/src/keyboard-operable.spec.ts +47 -11
- package/src/row-line-clamp.ts +74 -0
- package/src/row-tooltip.spec.ts +313 -0
- package/src/row-tooltip.ts +52 -0
- package/src/shared-tree-builder.ts +88 -35
- package/src/shared-tree-mount.spec.ts +130 -0
- package/src/shared-trees.spec.ts +15 -0
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +8 -0
- package/src/widget-size.spec.ts +117 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwStatusPageTest: () => Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VALUE_BASED_BOOLEAN_ATTRS } from '@gjsify/adwaita-core/tags';
|
|
2
|
+
/** Re-export for consumers that need the list (e.g. `shared-tree-builder.ts`). */
|
|
3
|
+
export { VALUE_BASED_BOOLEAN_ATTRS };
|
|
4
|
+
/**
|
|
5
|
+
* Whether an attribute spells a boolean property, defaulting to `whenAbsent`.
|
|
6
|
+
*
|
|
7
|
+
* Absent is the property's default; present, the literal `"false"` is FALSE and anything
|
|
8
|
+
* else is TRUE.
|
|
9
|
+
*/
|
|
10
|
+
export declare function booleanAttribute(value: string | null, whenAbsent: boolean): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Write a value-based boolean attribute (GTK property defaulting to TRUE).
|
|
13
|
+
*
|
|
14
|
+
* `true` → sets `attr="true"` (present, not "false", reads as true)
|
|
15
|
+
* `false` → sets `attr="false"` (present, reads as false)
|
|
16
|
+
* This avoids `toggleAttribute` which removes the attribute for `false`,
|
|
17
|
+
* causing value-based readers to fall back to the default (true).
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeBooleanAttribute(el: HTMLElement, attr: string, value: boolean): void;
|
|
@@ -3,6 +3,8 @@ export declare class AdwActionRow extends HTMLElement {
|
|
|
3
3
|
private _subtitleEl;
|
|
4
4
|
private _suffixEl;
|
|
5
5
|
private _prefixEl;
|
|
6
|
+
/** The label column — kept for `tooltip-text`, which the browser reads off a PART. */
|
|
7
|
+
private _textEl;
|
|
6
8
|
/** The headless labels + activatable-widget coupling (ADR 0004). */
|
|
7
9
|
private readonly _state;
|
|
8
10
|
/** Watches the activatable widget's `disabled`/`aria-disabled` — the live binding. */
|
|
@@ -46,4 +48,6 @@ export declare class AdwActionRow extends HTMLElement {
|
|
|
46
48
|
/** Reflect the state's `activatable` back onto the attribute + class. */
|
|
47
49
|
private _syncActivatable;
|
|
48
50
|
private _render;
|
|
51
|
+
/** Apply CSS line-clamping based on title-lines/subtitle-lines attributes. */
|
|
52
|
+
private _applyLineClamping;
|
|
49
53
|
}
|
|
@@ -2,6 +2,8 @@ import type { AdwComboOption, AdwListModelInput } from '@gjsify/adwaita-core';
|
|
|
2
2
|
export declare class AdwComboRow extends HTMLElement {
|
|
3
3
|
private _select;
|
|
4
4
|
private _valueEl;
|
|
5
|
+
/** The label column — kept for `tooltip-text`, which the browser reads off a PART. */
|
|
6
|
+
private _textEl;
|
|
5
7
|
private _titleEl;
|
|
6
8
|
private _subtitleEl;
|
|
7
9
|
/** The headless options list + selectedIndex↔selectedValue state machine (ADR 0004). */
|
|
@@ -78,4 +80,6 @@ export declare class AdwComboRow extends HTMLElement {
|
|
|
78
80
|
*/
|
|
79
81
|
private _syncChooser;
|
|
80
82
|
private _renderText;
|
|
83
|
+
/** Apply CSS line-clamping based on title-lines/subtitle-lines attributes. */
|
|
84
|
+
private _applyLineClamping;
|
|
81
85
|
}
|
|
@@ -49,6 +49,12 @@ export declare class AdwEntryRow extends HTMLElement {
|
|
|
49
49
|
get editing(): boolean;
|
|
50
50
|
connectedCallback(): void;
|
|
51
51
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
52
|
+
/**
|
|
53
|
+
* The parts `tooltip-text` lands on: the two slots and the editable area — NOT the
|
|
54
|
+
* apply button or the indicator, which carry tooltips of their own that the consumer
|
|
55
|
+
* reads for what they are.
|
|
56
|
+
*/
|
|
57
|
+
private _tooltipParts;
|
|
52
58
|
/**
|
|
53
59
|
* Add a widget after the editable area — `adw_entry_row_add_suffix`, which APPENDS
|
|
54
60
|
* into a box, so several suffixes coexist and the password row's own peek toggle
|
|
@@ -32,4 +32,6 @@ export declare class AdwExpanderRow extends HTMLElement {
|
|
|
32
32
|
connectedCallback(): void;
|
|
33
33
|
attributeChangedCallback(name: string): void;
|
|
34
34
|
private _render;
|
|
35
|
+
/** Apply CSS line-clamping based on title-lines/subtitle-lines attributes. */
|
|
36
|
+
private _applyLineClamping;
|
|
35
37
|
}
|
|
@@ -18,6 +18,12 @@ export declare class AdwHeaderBar extends HTMLElement {
|
|
|
18
18
|
* bare `Adw.HeaderBar {}` in a `.blp` page shows "Mailboxes" with no title of its own.
|
|
19
19
|
*/
|
|
20
20
|
private _page;
|
|
21
|
+
/**
|
|
22
|
+
* The window the bar sits in: `update_title`'s last stop before the application name
|
|
23
|
+
* (`gtk_window_get_title` of the root), so a bar with no title of its own, under no titled
|
|
24
|
+
* page, shows the window's.
|
|
25
|
+
*/
|
|
26
|
+
private _window;
|
|
21
27
|
private _pageObserver;
|
|
22
28
|
static get observedAttributes(): string[];
|
|
23
29
|
/** The start (left) section container — append buttons/widgets here. */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
1
2
|
export declare class AdwOverlaySplitView extends HTMLElement {
|
|
3
|
+
/** The GTK signals this element dispatches, which is what a `.blp` `bind` of `show-sidebar` follows. */
|
|
4
|
+
static readonly signals: DispatchedSignals;
|
|
2
5
|
private _initialized;
|
|
3
6
|
private _sidebarEl;
|
|
4
7
|
private _contentEl;
|
|
@@ -16,6 +19,8 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
16
19
|
* `show-sidebar` + `pin-sidebar` mean together, held to `OVERLAY_COLLAPSE_VECTORS`.
|
|
17
20
|
*/
|
|
18
21
|
private _state;
|
|
22
|
+
/** The `show-sidebar` the last `notify::show-sidebar` (or the first read) settled on. */
|
|
23
|
+
private _notifiedShowSidebar;
|
|
19
24
|
/** Re-entrancy guard for {@link _reflectShowSidebar}. */
|
|
20
25
|
private _reflecting;
|
|
21
26
|
/** The view's own width in CSS px — the size the sidebar fraction is OF. */
|
|
@@ -66,6 +71,14 @@ export declare class AdwOverlaySplitView extends HTMLElement {
|
|
|
66
71
|
* loop rather than a render.
|
|
67
72
|
*/
|
|
68
73
|
private _reflectShowSidebar;
|
|
74
|
+
/**
|
|
75
|
+
* `notify::show-sidebar`, raised on the EFFECTIVE value — the state's, after an auto-hide on
|
|
76
|
+
* collapse — and only when it changed, the way GObject notifies. Every path that moves it
|
|
77
|
+
* (the attribute, the property, a breakpoint, a gesture) ends in {@link _reflectShowSidebar},
|
|
78
|
+
* so this is the one place it is raised. The first read only records the baseline: a bind
|
|
79
|
+
* reads the current value itself.
|
|
80
|
+
*/
|
|
81
|
+
private _notifyShowSidebar;
|
|
69
82
|
private _syncBreakpoint;
|
|
70
83
|
openSidebar(): void;
|
|
71
84
|
hideSidebar(): void;
|
|
@@ -3,9 +3,10 @@ import { type AdwSidebarItemSpec, type AdwSidebarSectionSpec, type SidebarItemFi
|
|
|
3
3
|
export declare class AdwSidebarItem extends HTMLElement {
|
|
4
4
|
static get observedAttributes(): string[];
|
|
5
5
|
/**
|
|
6
|
-
* `AdwSidebarItem:enabled`, under the GIR name — the `disabled` attribute inverted.
|
|
7
|
-
* property is what lets an authored `enabled: false` reach this item through the
|
|
6
|
+
* `AdwSidebarItem:enabled`, under the GIR name — the `disabled` attribute inverted.
|
|
7
|
+
* The property is what lets an authored `enabled: false` reach this item through the
|
|
8
8
|
* shared-tree builder, which writes a `false` through the element's own property.
|
|
9
|
+
* Reads both the presence-based `disabled` and value-based `enabled` attributes.
|
|
9
10
|
*/
|
|
10
11
|
get enabled(): boolean;
|
|
11
12
|
set enabled(value: boolean);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { AdwAdjustment, AdwAdjustmentInput } from '@gjsify/adwaita-core';
|
|
2
2
|
export declare class AdwSpinRow extends HTMLElement {
|
|
3
3
|
private _input;
|
|
4
|
+
/** The label column — kept for `tooltip-text`, which the browser reads off a PART. */
|
|
5
|
+
private _textEl;
|
|
6
|
+
/** The −/input/+ box — the other half of the row's surface. */
|
|
7
|
+
private _controlEl;
|
|
4
8
|
private _titleEl;
|
|
5
9
|
private _subtitleEl;
|
|
6
10
|
/** The headless adjustment: the range, the clamp and the two signals (ADR 0004, ADR 0047). */
|
|
@@ -21,6 +25,8 @@ export declare class AdwSpinRow extends HTMLElement {
|
|
|
21
25
|
connectedCallback(): void;
|
|
22
26
|
attributeChangedCallback(name: string, _old: string | null, val: string | null): void;
|
|
23
27
|
private _renderText;
|
|
28
|
+
/** Apply CSS line-clamping based on title-lines/subtitle-lines attributes. */
|
|
29
|
+
private _applyLineClamping;
|
|
24
30
|
/** A stepper press — the interactive path, so it emits `notify::value`. */
|
|
25
31
|
private _adjust;
|
|
26
32
|
private _emitChange;
|
|
@@ -2,6 +2,8 @@ import './gtk-switch.js';
|
|
|
2
2
|
export declare class AdwSwitchRow extends HTMLElement {
|
|
3
3
|
private _switchEl;
|
|
4
4
|
private _prefixEl;
|
|
5
|
+
/** The label column — kept for `tooltip-text`, which the browser reads off a PART. */
|
|
6
|
+
private _textEl;
|
|
5
7
|
private _titleEl;
|
|
6
8
|
private _subtitleEl;
|
|
7
9
|
/** The headless active flag + its notify rule (ADR 0004). */
|
|
@@ -21,4 +23,6 @@ export declare class AdwSwitchRow extends HTMLElement {
|
|
|
21
23
|
*/
|
|
22
24
|
private _apply;
|
|
23
25
|
private _renderText;
|
|
26
|
+
/** Apply CSS line-clamping based on title-lines/subtitle-lines attributes. */
|
|
27
|
+
private _applyLineClamping;
|
|
24
28
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** A single toggle. Children of <adw-toggle-group>; consumed at connect time. */
|
|
2
2
|
export declare class AdwToggle extends HTMLElement {
|
|
3
3
|
static get observedAttributes(): string[];
|
|
4
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
4
5
|
}
|
|
5
6
|
export declare class AdwToggleGroup extends HTMLElement {
|
|
6
7
|
private _innerEl;
|
|
@@ -12,7 +13,21 @@ export declare class AdwToggleGroup extends HTMLElement {
|
|
|
12
13
|
private _stateAttr;
|
|
13
14
|
/** Each toggle's `name`, in order — what `active-name` resolves against. */
|
|
14
15
|
private _names;
|
|
16
|
+
/** `AdwToggle:enabled` per rendered button, in order — `add_toggle` spends this at add time. */
|
|
17
|
+
private _enabled;
|
|
18
|
+
/** The authored <adw-toggle> elements, kept to observe live `enabled` changes. */
|
|
19
|
+
private _toggles;
|
|
15
20
|
static get observedAttributes(): string[];
|
|
21
|
+
/**
|
|
22
|
+
* `GtkWidget:sensitive` — whether the whole group is insensitive.
|
|
23
|
+
*
|
|
24
|
+
* TRUE unless the attribute says `false`, because the property defaults to TRUE and a
|
|
25
|
+
* boolean attribute read by PRESENCE would leave every group on a page insensitive.
|
|
26
|
+
*/
|
|
27
|
+
get sensitive(): boolean;
|
|
28
|
+
set sensitive(value: boolean);
|
|
29
|
+
/** Whether the toggle at `index` is enabled (`AdwToggle:enabled`) — false once disabled. */
|
|
30
|
+
isToggleEnabled(index: number): boolean;
|
|
16
31
|
/** Zero-based index of the active toggle. */
|
|
17
32
|
get active(): number;
|
|
18
33
|
set active(value: number);
|
|
@@ -30,4 +45,6 @@ export declare class AdwToggleGroup extends HTMLElement {
|
|
|
30
45
|
private _readActiveAttr;
|
|
31
46
|
private _selectIndex;
|
|
32
47
|
private _render;
|
|
48
|
+
/** Select the first enabled toggle, if there is one — the C's "no active" repair. */
|
|
49
|
+
private _activateFirstEnabled;
|
|
33
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GtkViewport } from './gtk-viewport.js';
|
|
1
|
+
import type { GtkViewport } from './gtk-viewport.js';
|
|
2
2
|
/** `GtkPolicyType`'s four nicks; `automatic` is the pspec's default for both bars. */
|
|
3
3
|
export type GtkPolicyType = 'always' | 'never' | 'automatic' | 'external';
|
|
4
4
|
/** `GtkCornerType`'s four corners, `top-left` being the pspec's default. */
|
|
@@ -10,6 +10,8 @@ export type GtkDirectionType = 'forward' | 'backward';
|
|
|
10
10
|
export declare class GtkScrolledWindow extends HTMLElement {
|
|
11
11
|
private _viewport;
|
|
12
12
|
private _bars;
|
|
13
|
+
/** The size clamps `_writeSize` last wrote, which are the only ones it may clear. */
|
|
14
|
+
private readonly _wroteSizes;
|
|
13
15
|
private _shading;
|
|
14
16
|
private _observer;
|
|
15
17
|
private _hoverable;
|
|
@@ -73,7 +75,13 @@ export declare class GtkScrolledWindow extends HTMLElement {
|
|
|
73
75
|
private get _useIndicators();
|
|
74
76
|
/** Everything the pspec's own state decides: the classes, the bars, the sizes. */
|
|
75
77
|
private _sync;
|
|
76
|
-
|
|
78
|
+
/**
|
|
79
|
+
* One of the four clamps as inline style. An unwritten clamp clears only what THIS element
|
|
80
|
+
* wrote: `min-width` / `min-height` are also where a tree's `width-request` /
|
|
81
|
+
* `height-request` land (`GTK_WIDGET_SIZE_CSS`), and assigning '' unconditionally erased it.
|
|
82
|
+
* Where both are set the content clamp wins, which is the one the widget measures itself.
|
|
83
|
+
*/
|
|
84
|
+
private _writeSize;
|
|
77
85
|
/** The viewport's adjustment for one axis, which is where GTK reads the scrollbar's. */
|
|
78
86
|
private _adjustment;
|
|
79
87
|
/**
|
|
@@ -14,8 +14,14 @@ export declare class GtkWindow extends HTMLElement {
|
|
|
14
14
|
/** Watches the strip for an author's titlebar arriving after the build. */
|
|
15
15
|
private _titlebarObserver;
|
|
16
16
|
static get observedAttributes(): string[];
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* `Gtk.Window:title` — the window's title.
|
|
19
|
+
*
|
|
20
|
+
* The getter answers `''` for no title, not `null`: a `string | null` getter is not assignable to
|
|
21
|
+
* `HTMLElement.title`, and the emitted `.d.ts` then fails every consumer that does not set
|
|
22
|
+
* `skipLibCheck`. The setter still takes `null` to clear it, as GTK does.
|
|
23
|
+
*/
|
|
24
|
+
get title(): string;
|
|
19
25
|
set title(value: string | null);
|
|
20
26
|
/** `Gtk.Window:decorated` — whether the frame and its titlebar strip are drawn at all. */
|
|
21
27
|
get decorated(): boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { AdwAccentSource } from './appearance.js';
|
|
|
6
6
|
export { AdwScrollShading } from './scroll-shading.js';
|
|
7
7
|
export type { AdwUndershootEdges } from './scroll-shading.js';
|
|
8
8
|
export { buildSharedTree, mountSharedTree } from './shared-tree-builder.js';
|
|
9
|
-
export type { MountedSharedTree, SizeSource } from './shared-tree-builder.js';
|
|
9
|
+
export type { MountOptions, MountedSharedTree, SizeSource } from './shared-tree-builder.js';
|
|
10
10
|
export { registerTemplateClass } from './template-classes.js';
|
|
11
11
|
export { isIconAvailable, registerIcon } from './icon-registry.js';
|
|
12
12
|
export * as Adw from './namespace/adw.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface RowLineClampConfig {
|
|
2
|
+
titleEl: HTMLElement;
|
|
3
|
+
subtitleEl: HTMLElement;
|
|
4
|
+
textContainerEl: HTMLElement;
|
|
5
|
+
getTitleLines: () => number;
|
|
6
|
+
getSubtitleLines: () => number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Apply or remove line clamping based on title-lines/subtitle-lines values.
|
|
10
|
+
* Uses CSS custom properties and class toggle (not inline styles).
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyRowLineClamp(config: RowLineClampConfig): void;
|
|
13
|
+
/**
|
|
14
|
+
* Parse a lines attribute value following AdwActionRow semantics:
|
|
15
|
+
* - Missing/null/empty → 0 (unlimited)
|
|
16
|
+
* - Invalid/non-numeric → 0 (unlimited)
|
|
17
|
+
* - n > 0 → n (clamp to n lines)
|
|
18
|
+
* - n <= 0 → 0 (unlimited; pspec range is 0..G_MAXINT)
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseRowLinesAttribute(value: string | null): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply `row`'s `tooltip-text` to `parts`, or clear it when the attribute is absent.
|
|
3
|
+
*
|
|
4
|
+
* `parts` are the row's OWN sections, never a slotted consumer widget — see the header.
|
|
5
|
+
* Each one is marked `data-row-tooltip`, which is the hook `scss/_row.scss` stretches so
|
|
6
|
+
* the tooltip covers the row rather than the label text inside it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyRowTooltip(row: HTMLElement, parts: readonly Element[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwRowTooltipTest: () => Promise<void>;
|
|
@@ -44,21 +44,22 @@ interface PendingBind {
|
|
|
44
44
|
* A `SharedTreeNode`, realised as a DETACHED element tree: a tag, its authored properties as
|
|
45
45
|
* attributes, its style classes as classes, its extensions (ADR 0072) as the markup the element
|
|
46
46
|
* reads, its placement as `slot=`, its children, in that order — recursive and total,
|
|
47
|
-
* no tag list, no per-block case.
|
|
48
|
-
* (`toggleAttribute`), which is what every element in the corpus reads
|
|
49
|
-
* (`hasAttribute('revealed')`, `hasAttribute('expanded')`); spelling `"true"` would set a
|
|
50
|
-
* present attribute for `false` as well.
|
|
47
|
+
* no tag list, no per-block case.
|
|
51
48
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
49
|
+
* BOOLEAN ATTRIBUTES are written per (widget, property), not per attribute name. The same
|
|
50
|
+
* attribute name (e.g. `revealed`) can be VALUE-BASED for one widget (`gtk-action-bar`,
|
|
51
|
+
* default TRUE) and PRESENCE-BASED for another (`adw-banner`, default FALSE). The
|
|
52
|
+
* per-widget map in `@gjsify/adwaita-core/tags` ({@link isValueBasedBooleanAttr}) records this.
|
|
53
|
+
*
|
|
54
|
+
* - VALUE-BASED: `attr="false"` means false, absent means true (the GTK default).
|
|
55
|
+
* The builder writes `attr="true"|"false"` directly via {@link writeBooleanAttribute}.
|
|
56
|
+
* - PRESENCE-BASED (style classes like `flat`, `round`, `compact`): `toggleAttribute`
|
|
57
|
+
* writes the bare attribute for `true`, removes it for `false`.
|
|
58
|
+
*
|
|
59
|
+
* EXCEPT an authored `false` on a NON-value-based, WRITABLE property: the property is set
|
|
60
|
+
* directly (bypassing the attribute) because the element's setter will reflect it correctly.
|
|
61
|
+
* A getter-only property of the same name (e.g. `AdwSplitButton.active`) falls back to the
|
|
62
|
+
* presence rule since assignment would throw.
|
|
62
63
|
*
|
|
63
64
|
* THE SLOT IS WRITTEN AS THE ATTRIBUTE THIS RENDERER ALREADY ROUTES ON, not translated:
|
|
64
65
|
* `src/slotted-children.ts` reads `slot=` off every light-DOM child and keeps the routing
|
|
@@ -72,21 +73,50 @@ interface PendingBind {
|
|
|
72
73
|
* upgraded has declared no slots yet, so the refusal below belongs to the mount.
|
|
73
74
|
*/
|
|
74
75
|
export declare function buildSharedTree(node: SharedTreeNode, record?: BuildRecord): HTMLElement;
|
|
76
|
+
/**
|
|
77
|
+
* One authored property, written as the element reads it; a breakpoint setter takes the same door.
|
|
78
|
+
*
|
|
79
|
+
* BOOLEAN ATTRIBUTES are written per (widget, property), not per attribute name. The same
|
|
80
|
+
* attribute name (e.g. `revealed`) can be VALUE-BASED for one widget (`gtk-action-bar`,
|
|
81
|
+
* default TRUE) and PRESENCE-BASED for another (`adw-banner`, default FALSE). The
|
|
82
|
+
* per-widget map in `@gjsify/adwaita-core/tags` ({@link isValueBasedBooleanAttr}) records this.
|
|
83
|
+
*
|
|
84
|
+
* - VALUE-BASED: `attr="false"` means false, absent means true (the GTK default).
|
|
85
|
+
* The builder writes `attr="true"|"false"` directly via {@link writeBooleanAttribute}.
|
|
86
|
+
* - PRESENCE-BASED (style classes like `flat`, `round`, `compact`): `toggleAttribute`
|
|
87
|
+
* writes the bare attribute for `true`, removes it for `false`.
|
|
88
|
+
*
|
|
89
|
+
* EXCEPT an authored `false` on a NON-value-based, WRITABLE property: the property is set
|
|
90
|
+
* directly (bypassing the attribute) because the element's setter will reflect it correctly.
|
|
91
|
+
* A getter-only property of the same name (e.g. `AdwSplitButton.active`) falls back to the
|
|
92
|
+
* presence rule since assignment would throw. `hexpand` / `vexpand` keep an authored `false`
|
|
93
|
+
* as the attribute `"false"` and a later `true` rewrites it — `GTK_WIDGET_EXPAND` says why.
|
|
94
|
+
*/
|
|
95
|
+
export declare function writeProp(el: HTMLElement, prop: string, value: string | number | boolean): void;
|
|
75
96
|
/** A tree {@link mountSharedTree} built and connected. */
|
|
76
97
|
export interface MountedSharedTree {
|
|
77
98
|
/** The authored root — connected, so every custom element under it has upgraded and run. */
|
|
78
99
|
root: HTMLElement;
|
|
79
|
-
/** Disconnects and discards the mount point. */
|
|
100
|
+
/** Disconnects the tree, and discards the mount point when this call made one. */
|
|
80
101
|
unmount: () => void;
|
|
81
102
|
}
|
|
103
|
+
/** What {@link mountSharedTree} takes beside the tree. */
|
|
104
|
+
export interface MountOptions {
|
|
105
|
+
/** The object a handler NAME is looked up on (ADR 0093 § 3). */
|
|
106
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
107
|
+
/** The size source a `breakpoints` node is driven from. */
|
|
108
|
+
observeSize?: SizeSource;
|
|
109
|
+
/**
|
|
110
|
+
* Where the root is appended — a showcase's own container, which then lays the window out.
|
|
111
|
+
* Without it the tree gets a fresh host `<div>` in `document.body`, discarded on `unmount`.
|
|
112
|
+
*/
|
|
113
|
+
into?: HTMLElement;
|
|
114
|
+
}
|
|
82
115
|
/**
|
|
83
116
|
* {@link buildSharedTree}, attached under a fresh host `<div>` in `document.body` so the tree
|
|
84
117
|
* — and every custom element in it — is REAL rather than merely constructed. This is the
|
|
85
118
|
* instantiation half a caller reading the corpus's elements normally wants; a bare
|
|
86
119
|
* `buildSharedTree` is for a caller that already has somewhere of its own to attach it.
|
|
87
120
|
*/
|
|
88
|
-
export declare function mountSharedTree(node: SharedTreeNode, options?:
|
|
89
|
-
scope?: Readonly<Record<string, unknown>>;
|
|
90
|
-
observeSize?: SizeSource;
|
|
91
|
-
}): MountedSharedTree;
|
|
121
|
+
export declare function mountSharedTree(node: SharedTreeNode, options?: MountOptions): MountedSharedTree;
|
|
92
122
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwSharedTreeMountTest: () => Promise<void>;
|