@gjsify/adwaita-web 0.55.0 → 0.57.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 +137 -29
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-status-page.spec.d.ts +1 -0
- package/lib/types/application.d.ts +24 -0
- package/lib/types/application.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-application-window.d.ts +2 -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/adw-view-stack.d.ts +3 -0
- package/lib/types/elements/checks.d.ts +6 -0
- package/lib/types/elements/gtk-application-window.d.ts +2 -0
- package/lib/types/elements/gtk-drop-down.d.ts +3 -0
- package/lib/types/elements/gtk-entry.d.ts +10 -0
- package/lib/types/elements/gtk-menu-button.d.ts +2 -0
- package/lib/types/elements/gtk-scrolled-window.d.ts +26 -2
- package/lib/types/elements/gtk-stack.d.ts +3 -0
- package/lib/types/elements/gtk-switch.d.ts +3 -0
- package/lib/types/elements/gtk-window.d.ts +8 -2
- package/lib/types/glib.spec.d.ts +1 -0
- package/lib/types/gobject-door.d.ts +4 -0
- package/lib/types/gobject-door.spec.d.ts +1 -0
- package/lib/types/gobject-elements.d.ts +17 -0
- package/lib/types/gtksource/gtk-source-view.d.ts +77 -0
- package/lib/types/gtksource/gtk-source-view.spec.d.ts +2 -0
- package/lib/types/gtksource/web-editor-driver.d.ts +44 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/menu-actions.spec.d.ts +1 -0
- package/lib/types/namespace/adw.d.ts +1 -0
- package/lib/types/namespace/gio.d.ts +2 -0
- package/lib/types/namespace/glib.d.ts +10 -0
- package/lib/types/namespace/gobject.d.ts +27 -0
- package/lib/types/namespace/gtk-enums.d.ts +22 -0
- package/lib/types/namespace/gtk.d.ts +2 -0
- package/lib/types/namespace/gtksource.d.ts +2 -0
- 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 +69 -20
- 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 +11 -9
- 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/_reset.scss +1 -1
- 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/application.spec.ts +75 -0
- package/src/application.ts +92 -0
- package/src/attributes.ts +52 -0
- package/src/capabilities.mjs +3 -0
- package/src/construct-vectors.spec.ts +156 -1
- package/src/elements/adw-action-row.ts +31 -2
- package/src/elements/adw-alert-dialog.ts +4 -1
- package/src/elements/adw-application-window.ts +5 -0
- 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-split-button.ts +5 -1
- 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-view-stack.ts +14 -0
- package/src/elements/adw-window.ts +9 -4
- package/src/elements/checks.ts +25 -1
- package/src/elements/gtk-application-window.ts +5 -0
- package/src/elements/gtk-drop-down.ts +16 -0
- package/src/elements/gtk-entry.ts +45 -7
- package/src/elements/gtk-menu-button.ts +12 -1
- package/src/elements/gtk-popover-menu.ts +7 -2
- package/src/elements/gtk-scrolled-window.ts +76 -7
- package/src/elements/gtk-stack.ts +8 -0
- package/src/elements/gtk-switch.ts +8 -0
- package/src/elements/gtk-window.ts +9 -3
- package/src/glib.spec.ts +34 -0
- package/src/gobject-door.spec.ts +119 -0
- package/src/gobject-door.ts +137 -0
- package/src/gobject-elements.ts +172 -0
- package/src/gtk-window.spec.ts +12 -0
- package/src/gtksource/gtk-source-view.spec.ts +69 -0
- package/src/gtksource/gtk-source-view.ts +379 -0
- package/src/gtksource/web-editor-driver.ts +260 -0
- package/src/index.ts +11 -1
- package/src/keyboard-operable.spec.ts +47 -11
- package/src/menu-actions.spec.ts +47 -0
- package/src/namespace/adw.ts +1 -0
- package/src/namespace/gio.ts +2 -0
- package/src/namespace/glib.ts +22 -0
- package/src/namespace/gobject.ts +37 -0
- package/src/namespace/gtk-enums.ts +15 -0
- package/src/namespace/gtk.ts +2 -0
- package/src/namespace/gtksource.ts +9 -0
- 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 +230 -42
- package/src/shared-tree-mount.spec.ts +130 -0
- package/src/shared-trees.spec.ts +15 -0
- package/src/split-button.spec.ts +2 -0
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +18 -0
- package/src/widget-size.spec.ts +117 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwStatusPageTest: () => Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GioApplicationBase, type AdwMenuItem, type AdwMenuActions, type AdwMenuModel, type ApplicationHost } from '@gjsify/adwaita-core';
|
|
2
|
+
export declare const webHost: ApplicationHost;
|
|
3
|
+
/** An element's parent for action resolution; a popover is rooted at the widget that owns it. */
|
|
4
|
+
export declare function parentOfElement(node: object): object | null;
|
|
5
|
+
/** What a `Gtk.Actionable` does on activation: the action `prefix.name` found from `widget`. */
|
|
6
|
+
export declare function activateWidgetAction(widget: Element, fullName: string, parameter?: unknown): boolean;
|
|
7
|
+
/** What the items of `model` read from the actions registered above `el` (ADR 0097 § 3). */
|
|
8
|
+
export declare function menuActionsOfElement(el: Element, model: AdwMenuModel): AdwMenuActions;
|
|
9
|
+
/** What choosing `item` in a menu owned by `el` does: the action it names fires. */
|
|
10
|
+
export declare function activateElementMenuItem(el: Element, item: AdwMenuItem): boolean;
|
|
11
|
+
export declare class GioApplication extends GioApplicationBase {
|
|
12
|
+
static host: ApplicationHost;
|
|
13
|
+
}
|
|
14
|
+
declare const GtkApplication_base: typeof GioApplication & import("@gjsify/adwaita-core").GtkApplicationConstructor;
|
|
15
|
+
export declare class GtkApplication extends GtkApplication_base {
|
|
16
|
+
}
|
|
17
|
+
export declare class AdwApplication extends GtkApplication {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `Gtk.Window:application` and the window's `Gio.ActionMap` (`win.` actions) on an element class.
|
|
21
|
+
* Setting the property is `add_window`, as on GTK; setting it to `null` is `remove_window`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function defineWindowApplication(proto: object): void;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ApplicationTest: () => 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
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type AdwMenuInput, type AdwMenuModel } from '@gjsify/adwaita-core';
|
|
2
2
|
import { AdwWindow } from './adw-window.js';
|
|
3
3
|
export declare class AdwApplicationWindow extends AdwWindow {
|
|
4
|
+
/** `Gtk.Window:application`: setting it is `add_window` (ADR 0098), set by `defineWindowApplication`. */
|
|
5
|
+
application: object | null;
|
|
4
6
|
private _menubarEl;
|
|
5
7
|
private _model;
|
|
6
8
|
static get observedAttributes(): string[];
|
|
@@ -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,6 +1,9 @@
|
|
|
1
1
|
import type { AdwViewStackPageInfo as CorePageInfo } from '@gjsify/adwaita-core';
|
|
2
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
2
3
|
export type AdwViewStackPageInfo = CorePageInfo<HTMLElement>;
|
|
3
4
|
export declare class AdwViewStack extends HTMLElement {
|
|
5
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
6
|
+
static readonly signals: DispatchedSignals;
|
|
4
7
|
private readonly _state;
|
|
5
8
|
private _initialized;
|
|
6
9
|
static get observedAttributes(): string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
1
2
|
/**
|
|
2
3
|
* The markup + state shared by `<gtk-check-button>` and `<adw-radio>`.
|
|
3
4
|
*
|
|
@@ -17,6 +18,9 @@ declare abstract class AdwCheckBase extends HTMLElement {
|
|
|
17
18
|
protected abstract activate(): void;
|
|
18
19
|
get checked(): boolean;
|
|
19
20
|
set checked(value: boolean);
|
|
21
|
+
/** `Gtk.CheckButton:active`, the GObject name for {@link checked}. */
|
|
22
|
+
get active(): boolean;
|
|
23
|
+
set active(value: boolean);
|
|
20
24
|
/** Whether the control is in the third, inconsistent state. */
|
|
21
25
|
get indeterminate(): boolean;
|
|
22
26
|
set indeterminate(value: boolean);
|
|
@@ -33,6 +37,8 @@ declare abstract class AdwCheckBase extends HTMLElement {
|
|
|
33
37
|
}
|
|
34
38
|
/** The Adwaita checkbox — `checkbutton > check` as a custom element. */
|
|
35
39
|
export declare class GtkCheckButton extends AdwCheckBase {
|
|
40
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
41
|
+
static readonly signals: DispatchedSignals;
|
|
36
42
|
static get observedAttributes(): string[];
|
|
37
43
|
protected get inputType(): 'checkbox';
|
|
38
44
|
protected activate(): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AdwSlot } from '../slotted-children.js';
|
|
2
2
|
import { GtkWindow } from './gtk-window.js';
|
|
3
3
|
export declare class GtkApplicationWindow extends GtkWindow {
|
|
4
|
+
/** `Gtk.Window:application`: setting it is `add_window` (ADR 0098), set by `defineWindowApplication`. */
|
|
5
|
+
application: object | null;
|
|
4
6
|
private _menubar;
|
|
5
7
|
private _menubarObserver;
|
|
6
8
|
static get observedAttributes(): string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './gtk-popover.js';
|
|
2
2
|
import type { AdwComboOption, AdwListModelInput } from '@gjsify/adwaita-core';
|
|
3
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
3
4
|
/**
|
|
4
5
|
* A dropdown option — `value` is the stable id, `label` the shown text. An alias of
|
|
5
6
|
* core's {@link AdwComboOption}, since the drop-down and the combo row are the same
|
|
@@ -7,6 +8,8 @@ import type { AdwComboOption, AdwListModelInput } from '@gjsify/adwaita-core';
|
|
|
7
8
|
*/
|
|
8
9
|
export type GtkDropDownOption = AdwComboOption;
|
|
9
10
|
export declare class GtkDropDown extends HTMLElement {
|
|
11
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
12
|
+
static readonly signals: DispatchedSignals;
|
|
10
13
|
private _buttonEl;
|
|
11
14
|
private _labelEl;
|
|
12
15
|
private _popoverEl;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
1
2
|
export declare class GtkEntry extends HTMLElement {
|
|
2
3
|
/**
|
|
3
4
|
* `protected`, not `private`: `GtkPasswordEntry` and `GtkSearchEntry` subclass this
|
|
@@ -8,9 +9,18 @@ export declare class GtkEntry extends HTMLElement {
|
|
|
8
9
|
protected _input: HTMLInputElement;
|
|
9
10
|
private _initialized;
|
|
10
11
|
private _maxLength;
|
|
12
|
+
/** The text last announced, so `changed` fires on a real change only — as `gtk_editable_changed` does. */
|
|
13
|
+
private _announced;
|
|
14
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
15
|
+
static readonly signals: DispatchedSignals;
|
|
11
16
|
static get observedAttributes(): string[];
|
|
12
17
|
get value(): string;
|
|
13
18
|
set value(v: string);
|
|
19
|
+
/** `Gtk.Editable:text`, the GObject name for {@link value}. */
|
|
20
|
+
get text(): string;
|
|
21
|
+
set text(v: string);
|
|
22
|
+
/** `changed` then `notify::text`, once per real change of the text, typed or set from code. */
|
|
23
|
+
private _announceText;
|
|
14
24
|
/** `Gtk.Entry:max-length` — 0 means unlimited. Counted in CODE POINTS. */
|
|
15
25
|
get maxLength(): number;
|
|
16
26
|
set maxLength(value: number);
|
|
@@ -67,5 +67,7 @@ export declare class GtkMenuButton extends HTMLElement {
|
|
|
67
67
|
private _parseMenuAttr;
|
|
68
68
|
private _onPopoverToggled;
|
|
69
69
|
private _render;
|
|
70
|
+
/** The registry's answer, unless the application wrote `actions` itself (ADR 0097 § 2). */
|
|
71
|
+
private _refreshActions;
|
|
70
72
|
private _renderMenu;
|
|
71
73
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AdwAdjustment } from '@gjsify/adwaita-core';
|
|
2
|
+
import type { GtkViewport } from './gtk-viewport.js';
|
|
2
3
|
/** `GtkPolicyType`'s four nicks; `automatic` is the pspec's default for both bars. */
|
|
3
4
|
export type GtkPolicyType = 'always' | 'never' | 'automatic' | 'external';
|
|
4
5
|
/** `GtkCornerType`'s four corners, `top-left` being the pspec's default. */
|
|
@@ -10,11 +11,16 @@ export type GtkDirectionType = 'forward' | 'backward';
|
|
|
10
11
|
export declare class GtkScrolledWindow extends HTMLElement {
|
|
11
12
|
private _viewport;
|
|
12
13
|
private _bars;
|
|
14
|
+
/** The size clamps `_writeSize` last wrote, which are the only ones it may clear. */
|
|
15
|
+
private readonly _wroteSizes;
|
|
13
16
|
private _shading;
|
|
14
17
|
private _observer;
|
|
15
18
|
private _hoverable;
|
|
16
19
|
private _fadeTimer;
|
|
17
20
|
private _built;
|
|
21
|
+
/** What an unbuilt window answers before it has a viewport to read. */
|
|
22
|
+
private readonly _standIn;
|
|
23
|
+
private readonly _adopted;
|
|
18
24
|
static get observedAttributes(): string[];
|
|
19
25
|
/** `GtkScrolledWindow:hscrollbar-policy` — `automatic` in the pspec. */
|
|
20
26
|
get hscrollbarPolicy(): GtkPolicyType;
|
|
@@ -22,6 +28,18 @@ export declare class GtkScrolledWindow extends HTMLElement {
|
|
|
22
28
|
/** `GtkScrolledWindow:vscrollbar-policy` — `automatic` in the pspec. */
|
|
23
29
|
get vscrollbarPolicy(): GtkPolicyType;
|
|
24
30
|
set vscrollbarPolicy(value: GtkPolicyType);
|
|
31
|
+
/** `gtk_scrolled_window_get_policy`: `[hscrollbar, vscrollbar]` as `Gtk.PolicyType` constants. */
|
|
32
|
+
get_policy(): [number, number];
|
|
33
|
+
/** `gtk_scrolled_window_set_policy`; a value that is not a `Gtk.PolicyType` throws, as GJS's enum marshalling does. */
|
|
34
|
+
set_policy(hscrollbar_policy: number, vscrollbar_policy: number): void;
|
|
35
|
+
/** `GtkScrollable:hadjustment` as the window reports it: the one it was given, else the viewport's. */
|
|
36
|
+
get hadjustment(): AdwAdjustment;
|
|
37
|
+
get vadjustment(): AdwAdjustment;
|
|
38
|
+
get_hadjustment(): AdwAdjustment;
|
|
39
|
+
get_vadjustment(): AdwAdjustment;
|
|
40
|
+
/** Adopts `adjustment` as what `get_hadjustment` answers; the scroll position keeps following the viewport. */
|
|
41
|
+
set_hadjustment(adjustment: AdwAdjustment): void;
|
|
42
|
+
set_vadjustment(adjustment: AdwAdjustment): void;
|
|
25
43
|
/** `GtkScrolledWindow:window-placement` — where the contents sit against the bars. */
|
|
26
44
|
get windowPlacement(): GtkCornerType;
|
|
27
45
|
set windowPlacement(value: GtkCornerType);
|
|
@@ -73,7 +91,13 @@ export declare class GtkScrolledWindow extends HTMLElement {
|
|
|
73
91
|
private get _useIndicators();
|
|
74
92
|
/** Everything the pspec's own state decides: the classes, the bars, the sizes. */
|
|
75
93
|
private _sync;
|
|
76
|
-
|
|
94
|
+
/**
|
|
95
|
+
* One of the four clamps as inline style. An unwritten clamp clears only what THIS element
|
|
96
|
+
* wrote: `min-width` / `min-height` are also where a tree's `width-request` /
|
|
97
|
+
* `height-request` land (`GTK_WIDGET_SIZE_CSS`), and assigning '' unconditionally erased it.
|
|
98
|
+
* Where both are set the content clamp wins, which is the one the widget measures itself.
|
|
99
|
+
*/
|
|
100
|
+
private _writeSize;
|
|
77
101
|
/** The viewport's adjustment for one axis, which is where GTK reads the scrollbar's. */
|
|
78
102
|
private _adjustment;
|
|
79
103
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
1
2
|
/** `GtkStackTransitionType`, spelled as the GIR's enum nicks (gtkstack.c:95-121). */
|
|
2
3
|
export type StackTransitionType = 'none' | 'crossfade' | 'slide-right' | 'slide-left' | 'slide-up' | 'slide-down' | 'slide-left-right' | 'slide-up-down' | 'over-up' | 'over-down' | 'over-left' | 'over-right' | 'under-up' | 'under-down' | 'under-left' | 'under-right' | 'over-up-down' | 'over-down-up' | 'over-left-right' | 'over-right-left' | 'rotate-left' | 'rotate-right' | 'rotate-left-right';
|
|
3
4
|
/** The browser's page descriptor — the stand-in for the `GtkStackPage` GObject. */
|
|
@@ -18,6 +19,8 @@ export interface GtkStackPageInfo {
|
|
|
18
19
|
child: HTMLElement;
|
|
19
20
|
}
|
|
20
21
|
export declare class GtkStack extends HTMLElement {
|
|
22
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
23
|
+
static readonly signals: DispatchedSignals;
|
|
21
24
|
/** The child that is visible, or `null` — C's `priv->visible_child`. */
|
|
22
25
|
private _visible;
|
|
23
26
|
/** C's `priv->last_visible_child`: the page being animated away. */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
1
2
|
export declare class GtkSwitch extends HTMLElement {
|
|
3
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
4
|
+
static readonly signals: DispatchedSignals;
|
|
2
5
|
private _input;
|
|
3
6
|
private _slider;
|
|
4
7
|
private _initialized;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GLibTest: () => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GObjectDoorTest: () => Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Handler = (emitter: HTMLElement, ...args: unknown[]) => unknown;
|
|
2
|
+
/** Whether `el` got its four methods from {@link installElementApi} (a registered class has the core's). */
|
|
3
|
+
export declare function hasElementApi(el: object): boolean;
|
|
4
|
+
/** Makes every change of `property` on `el` reach a `notify::<property>` listener, connected or not. */
|
|
5
|
+
export declare function ensureNotifying(el: HTMLElement, property: string): void;
|
|
6
|
+
/** Calls `handler(el, ...args)` for `signal`; returns the disconnect. */
|
|
7
|
+
export declare function listenElement(el: HTMLElement, signal: string, handler: Handler): () => void;
|
|
8
|
+
export declare function dispatchElement(el: HTMLElement, signal: string, args: readonly unknown[]): void;
|
|
9
|
+
/** Gives `el` the instance API of a registered class, over the events it declares. */
|
|
10
|
+
export declare function installElementApi(el: HTMLElement): void;
|
|
11
|
+
/**
|
|
12
|
+
* The end of a bind the core's engine drives. An element speaks camelCase members where a `.blp`
|
|
13
|
+
* says `dash-name`, so a built element is wrapped to translate the name; a registered class
|
|
14
|
+
* already has the core's accessors and aliases and is returned as it is.
|
|
15
|
+
*/
|
|
16
|
+
export declare function endpointOf(el: HTMLElement): HTMLElement;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { GtkAdjustment } from '@gjsify/adwaita-core';
|
|
2
|
+
import type { Buffer } from '@gjsify/gtksource-core';
|
|
3
|
+
export declare class GtkSourceView extends HTMLElement {
|
|
4
|
+
static get observedAttributes(): string[];
|
|
5
|
+
private readonly session;
|
|
6
|
+
private readonly driver;
|
|
7
|
+
private unsubscribe;
|
|
8
|
+
private built;
|
|
9
|
+
private readonly gutter;
|
|
10
|
+
private readonly backdrop;
|
|
11
|
+
private readonly area;
|
|
12
|
+
private readonly vadj;
|
|
13
|
+
private readonly hadj;
|
|
14
|
+
private direction;
|
|
15
|
+
constructor();
|
|
16
|
+
private syncAdjustments;
|
|
17
|
+
private readonly onAreaScroll;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
21
|
+
/** `GtkSource.View:buffer`. */
|
|
22
|
+
get buffer(): Buffer;
|
|
23
|
+
set buffer(value: Buffer);
|
|
24
|
+
get autoIndent(): boolean;
|
|
25
|
+
set autoIndent(value: boolean | string);
|
|
26
|
+
/** Held and read back; a textarea has no indent step to apply it to (ADR 0094). */
|
|
27
|
+
get indentWidth(): number;
|
|
28
|
+
set indentWidth(value: number | string);
|
|
29
|
+
get showLineNumbers(): boolean;
|
|
30
|
+
set showLineNumbers(value: boolean | string);
|
|
31
|
+
get highlightCurrentLine(): boolean;
|
|
32
|
+
set highlightCurrentLine(value: boolean | string);
|
|
33
|
+
get monospace(): boolean;
|
|
34
|
+
set monospace(value: boolean | string);
|
|
35
|
+
get editable(): boolean;
|
|
36
|
+
set editable(value: boolean | string);
|
|
37
|
+
/** `GtkTextView:cursor-visible` — whether the insertion cursor is drawn; TRUE by default. */
|
|
38
|
+
get cursorVisible(): boolean;
|
|
39
|
+
set cursorVisible(value: boolean | string);
|
|
40
|
+
get cursor_visible(): boolean;
|
|
41
|
+
set cursor_visible(value: boolean);
|
|
42
|
+
get_cursor_visible(): boolean;
|
|
43
|
+
set_cursor_visible(value: boolean): void;
|
|
44
|
+
get_editable(): boolean;
|
|
45
|
+
set_editable(value: boolean): void;
|
|
46
|
+
get highlight_current_line(): boolean;
|
|
47
|
+
set highlight_current_line(value: boolean);
|
|
48
|
+
get show_line_numbers(): boolean;
|
|
49
|
+
set show_line_numbers(value: boolean);
|
|
50
|
+
/** `GtkScrollable:vadjustment` — one stable adjustment that follows the textarea's scroll. */
|
|
51
|
+
get vadjustment(): GtkAdjustment;
|
|
52
|
+
get hadjustment(): GtkAdjustment;
|
|
53
|
+
get_vadjustment(): GtkAdjustment;
|
|
54
|
+
get_hadjustment(): GtkAdjustment;
|
|
55
|
+
/** `gtk_widget_set_direction`: held, and mirrored onto `dir` for LTR and RTL. */
|
|
56
|
+
set_direction(direction: number): void;
|
|
57
|
+
get_direction(): number;
|
|
58
|
+
/** A view has no widget children of its own here: its parts are the browser's. */
|
|
59
|
+
get_first_child(): null;
|
|
60
|
+
get_next_sibling(): Element | null;
|
|
61
|
+
get_parent(): Element | null;
|
|
62
|
+
/** Gutters are slice 6 (ADR 0094). */
|
|
63
|
+
get_gutter(_window_type: number): never;
|
|
64
|
+
get leftMargin(): number;
|
|
65
|
+
set leftMargin(value: number | string);
|
|
66
|
+
get rightMargin(): number;
|
|
67
|
+
set rightMargin(value: number | string);
|
|
68
|
+
get topMargin(): number;
|
|
69
|
+
set topMargin(value: number | string);
|
|
70
|
+
get bottomMargin(): number;
|
|
71
|
+
set bottomMargin(value: number | string);
|
|
72
|
+
/** GJS `connect(name, cb) → id`; the handler's first argument is this view. */
|
|
73
|
+
connect(name: string, callback: (self: GtkSourceView, ...args: never[]) => void): number;
|
|
74
|
+
disconnect(id: number): void;
|
|
75
|
+
/** The inner textarea, for focus and tests. */
|
|
76
|
+
get textarea(): HTMLTextAreaElement;
|
|
77
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { EditorDriver, EditorHost, EditorLayout, EditorPalette, StyledRun } from '@gjsify/gtksource-core';
|
|
2
|
+
export interface EditorParts {
|
|
3
|
+
readonly root: HTMLElement;
|
|
4
|
+
readonly area: HTMLTextAreaElement;
|
|
5
|
+
readonly backdrop: HTMLElement;
|
|
6
|
+
readonly gutter: HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
export declare class WebEditorDriver implements EditorDriver {
|
|
9
|
+
private readonly parts;
|
|
10
|
+
private host;
|
|
11
|
+
private text;
|
|
12
|
+
private caret;
|
|
13
|
+
private reported;
|
|
14
|
+
private layout;
|
|
15
|
+
private readonly runs;
|
|
16
|
+
private scheduled;
|
|
17
|
+
private listening;
|
|
18
|
+
private palette;
|
|
19
|
+
private attached;
|
|
20
|
+
constructor(parts: EditorParts);
|
|
21
|
+
bind(host: EditorHost): void;
|
|
22
|
+
/** Starts listening to the textarea; the counterpart of the Android `attach()`. */
|
|
23
|
+
attach(): void;
|
|
24
|
+
detach(): void;
|
|
25
|
+
private onInput;
|
|
26
|
+
private onSelection;
|
|
27
|
+
/** `accepts-tab` is GTK's default; a textarea would move focus, so Tab inserts a tab. */
|
|
28
|
+
private onKey;
|
|
29
|
+
setText(text: string): void;
|
|
30
|
+
replaceRange(start: number, end: number, text: string): void;
|
|
31
|
+
setSelection(start: number, end: number): void;
|
|
32
|
+
setLineCount(): void;
|
|
33
|
+
setLayout(layout: EditorLayout): void;
|
|
34
|
+
/** Attributes and styles on the host wait for `attach()`: a custom element's constructor may not write them. */
|
|
35
|
+
private applyLayout;
|
|
36
|
+
setPalette(palette: EditorPalette): void;
|
|
37
|
+
private applyPalette;
|
|
38
|
+
spliceLines(first: number, removed: number, inserted: number): void;
|
|
39
|
+
paintLine(line: number, _lineStart: number, runs: readonly StyledRun[]): void;
|
|
40
|
+
clearAll(): void;
|
|
41
|
+
/** One repaint per task: a burst of `paintLine` calls from one edit costs one DOM rebuild. */
|
|
42
|
+
private scheduleRender;
|
|
43
|
+
private render;
|
|
44
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,12 +6,15 @@ 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';
|
|
13
13
|
export * as Gtk from './namespace/gtk.js';
|
|
14
14
|
export * as Gio from './namespace/gio.js';
|
|
15
|
+
export * as GLib from './namespace/glib.js';
|
|
16
|
+
export * as GObject from './namespace/gobject.js';
|
|
17
|
+
export * as GtkSource from './namespace/gtksource.js';
|
|
15
18
|
export { AdwCard } from './elements/adw-card.js';
|
|
16
19
|
export { AdwDataGrid } from './elements/adw-data-grid.js';
|
|
17
20
|
export type { AdwDataGridAlign, AdwDataGridColumn, AdwDataGridRow, AdwDataGridRowVariant, } from './elements/adw-data-grid.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MenuActionsTest: () => Promise<void>;
|
|
@@ -54,3 +54,4 @@ export { AdwViewSwitcherBar as ViewSwitcherBar } from '../elements/adw-view-swit
|
|
|
54
54
|
export { AdwWindow as Window } from '../elements/adw-window.js';
|
|
55
55
|
export { AdwWindowTitle as WindowTitle } from '../elements/adw-window-title.js';
|
|
56
56
|
export { AdwWrapBox as WrapBox } from '../elements/adw-wrap-box.js';
|
|
57
|
+
export { AdwApplication as Application } from '../application.js';
|