@gjsify/adwaita-web 0.64.1 → 0.64.2-next.252
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 +12 -8
- package/dist/adwaita-web.css +39 -9
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/application.d.ts +1 -1
- package/lib/types/child-slot.spec.d.ts +1 -0
- package/lib/types/container-fill.spec.d.ts +1 -0
- package/lib/types/elements/adw-alert-dialog.d.ts +77 -17
- package/lib/types/elements/adw-toast-overlay.d.ts +8 -29
- package/lib/types/elements/adw-window-features.d.ts +8 -0
- package/lib/types/elements/gtk-application-window.d.ts +1 -4
- package/lib/types/elements/gtk-emoji-chooser.d.ts +2 -0
- package/lib/types/elements/gtk-popover-menu.d.ts +2 -0
- package/lib/types/elements/gtk-popover.d.ts +5 -0
- package/lib/types/elements/gtk-stack-page.d.ts +28 -0
- package/lib/types/elements/gtk-stack.d.ts +11 -0
- package/lib/types/elements/gtk-window.d.ts +16 -1
- package/lib/types/gobject-elements.d.ts +9 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/types/learn6502-window.spec.d.ts +1 -0
- package/lib/types/namespace/adw.d.ts +1 -1
- package/lib/types/namespace/gtk.d.ts +2 -0
- package/lib/types/shared-tree-builder.d.ts +31 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/lib/types/widget-visible.spec.d.ts +1 -0
- package/lib/types/window-maximize.spec.d.ts +1 -0
- package/package.json +13 -12
- package/scss/_bin.scss +6 -3
- package/scss/_overlay.scss +11 -1
- package/scss/_reset.scss +1 -1
- package/scss/_stack.scss +8 -2
- package/scss/_toast.scss +13 -3
- package/scss/_window.scss +16 -0
- package/src/adw-alert-dialog.spec.ts +71 -5
- package/src/adw-bin.spec.ts +4 -3
- package/src/adw-header-bar.spec.ts +18 -0
- package/src/adw-toast-overlay.spec.ts +68 -24
- package/src/application.spec.ts +44 -0
- package/src/application.ts +13 -18
- package/src/capabilities.mjs +1 -3
- package/src/child-slot.spec.ts +71 -0
- package/src/construct-vectors.spec.ts +51 -6
- package/src/container-fill.spec.ts +70 -0
- package/src/elements/adw-alert-dialog.ts +174 -44
- package/src/elements/adw-application-window.ts +0 -3
- package/src/elements/adw-breakpoint-bin.ts +3 -0
- package/src/elements/adw-dialog.ts +3 -1
- package/src/elements/adw-header-bar.ts +4 -0
- package/src/elements/adw-toast-overlay.ts +35 -69
- package/src/elements/adw-window-features.ts +14 -2
- package/src/elements/gtk-application-window.ts +3 -8
- package/src/elements/gtk-drag-icon.ts +4 -0
- package/src/elements/gtk-emoji-chooser.ts +5 -0
- package/src/elements/gtk-flow-box-child.ts +3 -1
- package/src/elements/gtk-graphics-offload.ts +3 -1
- package/src/elements/gtk-list-box-row.ts +3 -1
- package/src/elements/gtk-overlay.ts +5 -4
- package/src/elements/gtk-paned.ts +7 -1
- package/src/elements/gtk-popover-bin.ts +3 -0
- package/src/elements/gtk-popover-menu.ts +5 -0
- package/src/elements/gtk-popover.ts +12 -0
- package/src/elements/gtk-search-bar.ts +5 -5
- package/src/elements/gtk-stack-page.ts +111 -0
- package/src/elements/gtk-stack.ts +50 -5
- package/src/elements/gtk-tree-expander.ts +3 -0
- package/src/elements/gtk-viewport.ts +4 -0
- package/src/elements/gtk-window-handle.ts +4 -0
- package/src/elements/gtk-window.ts +55 -6
- package/src/gobject-elements.ts +28 -0
- package/src/gtk-stack.spec.ts +170 -0
- package/src/index.ts +2 -2
- package/src/keyboard-operable.spec.ts +3 -3
- package/src/learn6502-window.spec.ts +113 -0
- package/src/namespace/adw.ts +1 -1
- package/src/namespace/gtk.ts +2 -0
- package/src/shared-tree-builder.ts +105 -10
- package/src/shared-trees.spec.ts +15 -1
- package/src/slotted-children.spec.ts +24 -0
- package/src/slotted-children.ts +18 -2
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +10 -0
- package/src/value-lists.spec.ts +3 -3
- package/src/widget-visible.spec.ts +104 -0
- package/src/window-maximize.spec.ts +93 -0
|
@@ -17,7 +17,7 @@ export declare class GtkApplication extends GtkApplication_base {
|
|
|
17
17
|
export declare class AdwApplication extends GtkApplication {
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* `Gtk.Window:application` and
|
|
20
|
+
* `Gtk.Window:application`, `get_application()` and `set_application()` on a window element class.
|
|
21
21
|
* Setting the property is `add_window`, as on GTK; setting it to `null` is `remove_window`.
|
|
22
22
|
*/
|
|
23
23
|
export declare function defineWindowApplication(proto: object): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwChildSlotTest: () => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContainerFillTest: () => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AdwResponseAppearance } from '@gjsify/adwaita-core';
|
|
2
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
2
3
|
/** Response button appearance — mirrors Adw.ResponseAppearance. */
|
|
3
4
|
export type { AdwResponseAppearance } from '@gjsify/adwaita-core';
|
|
4
5
|
/**
|
|
@@ -10,8 +11,39 @@ export type { AdwResponseAppearance } from '@gjsify/adwaita-core';
|
|
|
10
11
|
export declare class AdwAlertResponse extends HTMLElement {
|
|
11
12
|
static get observedAttributes(): string[];
|
|
12
13
|
}
|
|
14
|
+
/** The `Adw.AlertDialog` construct properties, in GJS's snake_case or the camelCase GJS also takes. */
|
|
15
|
+
export interface AdwAlertDialogProps {
|
|
16
|
+
heading?: string;
|
|
17
|
+
body?: string;
|
|
18
|
+
heading_use_markup?: boolean;
|
|
19
|
+
headingUseMarkup?: boolean;
|
|
20
|
+
body_use_markup?: boolean;
|
|
21
|
+
bodyUseMarkup?: boolean;
|
|
22
|
+
close_response?: string;
|
|
23
|
+
closeResponse?: string;
|
|
24
|
+
default_response?: string | null;
|
|
25
|
+
defaultResponse?: string | null;
|
|
26
|
+
prefer_wide_layout?: boolean;
|
|
27
|
+
preferWideLayout?: boolean;
|
|
28
|
+
}
|
|
13
29
|
export declare class AdwAlertDialog extends HTMLElement {
|
|
30
|
+
/** The GTK signals this element dispatches, each with the DOM event it arrives as (ADR 0093). */
|
|
31
|
+
static readonly signals: DispatchedSignals;
|
|
32
|
+
/** `GObject.Object.connect`: installed per instance by `installElementApi`; refuses an undeclared signal. */
|
|
33
|
+
connect: (signal: string, handler: (emitter: this, ...args: any[]) => unknown) => number;
|
|
34
|
+
/** `GObject.Object.disconnect`: throws for an id that is not connected. */
|
|
35
|
+
disconnect: (id: number) => void;
|
|
36
|
+
/** `GObject.Object.emit`. */
|
|
37
|
+
emit: (signal: string, ...args: unknown[]) => void;
|
|
38
|
+
/** `GObject.Object.notify`. */
|
|
39
|
+
notify: (name: string) => void;
|
|
40
|
+
/** `GObject.Object.get_property`, by GTK's dashed name. */
|
|
41
|
+
get_property: (name: string) => unknown;
|
|
42
|
+
/** `GObject.Object.set_property`. */
|
|
43
|
+
set_property: (name: string, value: unknown) => void;
|
|
14
44
|
private _initialized;
|
|
45
|
+
/** Set when `present()` attached the dialog, so closing detaches it again. */
|
|
46
|
+
private _attachedByPresent;
|
|
15
47
|
private _scrimEl;
|
|
16
48
|
private _dialogEl;
|
|
17
49
|
private _headingEl;
|
|
@@ -24,6 +56,12 @@ export declare class AdwAlertDialog extends HTMLElement {
|
|
|
24
56
|
/** The rendered button per registered response id (the DOM half of the model). */
|
|
25
57
|
private readonly _buttons;
|
|
26
58
|
private _blockCloseResponse;
|
|
59
|
+
/**
|
|
60
|
+
* `new Adw.AlertDialog({ heading, body, close_response, default_response })`, the GJS
|
|
61
|
+
* construct bag. Only the `new` form passes one: `document.createElement` and the
|
|
62
|
+
* parser call this with nothing, which is why writing attributes here is allowed.
|
|
63
|
+
*/
|
|
64
|
+
constructor(props?: AdwAlertDialogProps);
|
|
27
65
|
static get observedAttributes(): string[];
|
|
28
66
|
get heading(): string;
|
|
29
67
|
set heading(value: string);
|
|
@@ -54,24 +92,46 @@ export declare class AdwAlertDialog extends HTMLElement {
|
|
|
54
92
|
*/
|
|
55
93
|
private _adoptResponse;
|
|
56
94
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
57
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Present the dialog (`adw_dialog_present`). A detached dialog is attached to the document
|
|
97
|
+
* first and detached again when it closes; `parent` names the window it belongs to, and the
|
|
98
|
+
* page is that window's root here, so it does not change where the dialog goes.
|
|
99
|
+
*/
|
|
58
100
|
present(_parent?: unknown): void;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
|
|
101
|
+
/** `adw_alert_dialog_add_response`: a duplicate id is refused, as libadwaita's g_critical does. */
|
|
102
|
+
add_response(id: string, label: string): void;
|
|
103
|
+
/** `adw_alert_dialog_remove_response`. */
|
|
104
|
+
remove_response(id: string): void;
|
|
105
|
+
/** `adw_alert_dialog_has_response`. */
|
|
106
|
+
has_response(id: string): boolean;
|
|
107
|
+
/** `adw_alert_dialog_get_response_label`; `null` for an unknown id, as the C returns NULL. */
|
|
108
|
+
get_response_label(id: string): string | null;
|
|
109
|
+
/** `adw_alert_dialog_set_response_label`. */
|
|
110
|
+
set_response_label(id: string, label: string): void;
|
|
111
|
+
/** `adw_alert_dialog_get_response_appearance`; `null` for an unknown id. */
|
|
112
|
+
get_response_appearance(id: string): AdwResponseAppearance | null;
|
|
113
|
+
/** `adw_alert_dialog_set_response_appearance`. */
|
|
114
|
+
set_response_appearance(id: string, appearance: AdwResponseAppearance): void;
|
|
115
|
+
/** `adw_alert_dialog_get_response_enabled`; `false` for an unknown id, as the C returns FALSE. */
|
|
116
|
+
get_response_enabled(id: string): boolean;
|
|
117
|
+
/** `adw_alert_dialog_set_response_enabled`: a disabled button cannot be activated. */
|
|
118
|
+
set_response_enabled(id: string, enabled: boolean): void;
|
|
119
|
+
/** `adw_alert_dialog_get_default_response`. */
|
|
120
|
+
get_default_response(): string | null;
|
|
121
|
+
/** `adw_alert_dialog_set_default_response`: its button is highlighted and takes the focus. */
|
|
122
|
+
set_default_response(id: string | null): void;
|
|
123
|
+
/** `adw_alert_dialog_get_close_response`. */
|
|
124
|
+
get_close_response(): string;
|
|
125
|
+
/** `adw_alert_dialog_set_close_response`: emitted on dismissal (Escape / scrim click). */
|
|
126
|
+
set_close_response(id: string): void;
|
|
127
|
+
/** `adw_alert_dialog_get_heading`. */
|
|
128
|
+
get_heading(): string;
|
|
129
|
+
/** `adw_alert_dialog_set_heading`. */
|
|
130
|
+
set_heading(heading: string): void;
|
|
131
|
+
/** `adw_alert_dialog_get_body`. */
|
|
132
|
+
get_body(): string;
|
|
133
|
+
/** `adw_alert_dialog_set_body`. */
|
|
134
|
+
set_body(body: string): void;
|
|
75
135
|
private _activateResponse;
|
|
76
136
|
/** Dismissal (Escape / scrim) — close, then emit the close-response. */
|
|
77
137
|
private _dismiss;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ToastScheduler } from '@gjsify/adwaita-core';
|
|
1
|
+
import type { Toast, ToastScheduler } from '@gjsify/adwaita-core';
|
|
3
2
|
export type { ToastScheduler, ToastTimerHandle } from '@gjsify/adwaita-core';
|
|
4
|
-
/** Options for {@link AdwToastOverlay.addToast}, mirroring Adw.Toast's properties. */
|
|
5
|
-
export interface AdwToastOptions {
|
|
6
|
-
/** Seconds before the toast auto-dismisses; `0` keeps it until dismissed. Mirrors Adw.Toast:timeout (default 5). */
|
|
7
|
-
timeout?: number;
|
|
8
|
-
/** Label for the action button; omitted/empty means no button. Mirrors Adw.Toast:button-label. */
|
|
9
|
-
buttonLabel?: string;
|
|
10
|
-
/** Invoked when the action button is pressed. Mirrors the activation of Adw.Toast:action-name. */
|
|
11
|
-
onAction?: () => void;
|
|
12
|
-
}
|
|
13
3
|
export declare class AdwToastOverlay extends HTMLElement {
|
|
14
4
|
private _toasts;
|
|
15
5
|
private _initialized;
|
|
16
|
-
/** The headless
|
|
6
|
+
/** The headless queue of `adw-toast-overlay.c` (ADR 0004). */
|
|
17
7
|
private readonly _queue;
|
|
18
8
|
/** The timing source the queue's auto-dismiss runs on — swappable, see {@link scheduler}. */
|
|
19
9
|
private _scheduler;
|
|
20
|
-
/** The strip currently mounted for {@link
|
|
10
|
+
/** The strip currently mounted for {@link ToastOverlayQueue.current}, if any. */
|
|
21
11
|
private _currentEl;
|
|
22
|
-
/** Per-toast action callbacks (the core toast descriptor carries only the label). */
|
|
23
|
-
private readonly _actions;
|
|
24
12
|
constructor();
|
|
25
13
|
connectedCallback(): void;
|
|
26
14
|
/**
|
|
@@ -32,22 +20,13 @@ export declare class AdwToastOverlay extends HTMLElement {
|
|
|
32
20
|
get scheduler(): ToastScheduler;
|
|
33
21
|
set scheduler(scheduler: ToastScheduler);
|
|
34
22
|
/** The toast currently on screen, or `null` when nothing is shown. */
|
|
35
|
-
get currentToast():
|
|
23
|
+
get currentToast(): Toast | null;
|
|
36
24
|
/** Number of toasts queued behind the visible one. */
|
|
37
25
|
get pendingToasts(): number;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
* `options` is either an {@link AdwToastOptions} bag or, as a legacy shorthand, a
|
|
44
|
-
* timeout in MILLISECONDS.
|
|
45
|
-
*/
|
|
46
|
-
addToast(title: string, options?: number | AdwToastOptions): void;
|
|
47
|
-
/** Dismiss the visible toast early; the next queued toast takes its place. */
|
|
48
|
-
dismiss(): void;
|
|
49
|
-
/** Dismiss the visible toast and discard everything still queued behind it. */
|
|
50
|
-
clearToasts(): void;
|
|
26
|
+
/** `adw_toast_overlay_add_toast`: show `toast` now, or queue it by its priority. */
|
|
27
|
+
add_toast(toast: Toast): void;
|
|
28
|
+
/** `adw_toast_overlay_dismiss_all`: dismiss every queued toast, then the visible one. */
|
|
29
|
+
dismiss_all(): void;
|
|
51
30
|
/** Build + attach the strip for `toast` — the DOM half of the queue's `onShow`. */
|
|
52
31
|
private _mountToast;
|
|
53
32
|
/**
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { AdwBreakpoint } from '@gjsify/adwaita-core';
|
|
2
|
+
/**
|
|
3
|
+
* A maximized or fullscreen `Gtk.Window` ignores its default size and fills the monitor's work
|
|
4
|
+
* area (gtkwindow.c: the default size is only the RESTORED size). The page's work area is the
|
|
5
|
+
* frame's containing block, which the skin sizes from these two attributes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fillsContainingBlock(host: HTMLElement): boolean;
|
|
2
8
|
export declare class AdwWindowFeatures {
|
|
3
9
|
private readonly _host;
|
|
4
10
|
private _contentEl;
|
|
@@ -39,6 +45,8 @@ export declare class AdwWindowFeatures {
|
|
|
39
45
|
* size; `width-request`/`height-request` override it). `default-width/height` is only
|
|
40
46
|
* a default: an authored size is the box, and an absent one leaves the box to the
|
|
41
47
|
* stylesheet, which fills the viewport — a page has no window manager to pick a size.
|
|
48
|
+
* While maximized or fullscreened the default size is not applied at all: the stylesheet
|
|
49
|
+
* fills the containing block, and the minimum still holds.
|
|
42
50
|
*/
|
|
43
51
|
applySizeRequest(): void;
|
|
44
52
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { GtkApplication } from '../application.js';
|
|
1
|
+
import { type ActionLike } from '@gjsify/adwaita-core';
|
|
3
2
|
import type { DispatchedSignals } from '../signals.js';
|
|
4
3
|
import type { AdwSlot } from '../slotted-children.js';
|
|
5
4
|
import { GtkWindow } from './gtk-window.js';
|
|
6
5
|
export declare class GtkApplicationWindow extends GtkWindow {
|
|
7
|
-
/** `Gtk.Window:application`: setting it is `add_window` (ADR 0098), set by `defineWindowApplication`. */
|
|
8
|
-
application: GtkApplication | null;
|
|
9
6
|
/** `Gio.ActionMap.add_action`: installed by `installActionMap`; the action is reachable as `win.<name>`. */
|
|
10
7
|
add_action: (action: ActionLike) => void;
|
|
11
8
|
/** `Gio.ActionMap.lookup_action`: the window's own action, or `null`. */
|
|
@@ -17,6 +17,8 @@ export declare class GtkEmojiChooser extends GtkPopover {
|
|
|
17
17
|
* events themselves — which is what `gdk_device_get_modifier_state` answers.
|
|
18
18
|
*/
|
|
19
19
|
private _ctrl;
|
|
20
|
+
/** The chooser's template is the child (gtkemojichooser.ui). */
|
|
21
|
+
protected takesChild(): boolean;
|
|
20
22
|
connectedCallback(): void;
|
|
21
23
|
/** The emoji picked most recently, newest first — what `recently-used-emoji` holds. */
|
|
22
24
|
get recentEmoji(): EmojiEntry[];
|
|
@@ -38,6 +38,8 @@ export declare class GtkPopoverMenu extends GtkPopover {
|
|
|
38
38
|
*/
|
|
39
39
|
get visibleSubmenu(): string;
|
|
40
40
|
set visibleSubmenu(value: string);
|
|
41
|
+
/** The menu's own stack is the child (gtkpopovermenu.c `gtk_popover_menu_init`). */
|
|
42
|
+
protected takesChild(): boolean;
|
|
41
43
|
connectedCallback(): void;
|
|
42
44
|
attributeChangedCallback(name?: string, previous?: string | null, value?: string | null): void;
|
|
43
45
|
/** `gtk_popover_menu_open_submenu` — switch to the named page. */
|
|
@@ -67,6 +67,11 @@ export declare class GtkPopover extends HTMLElement {
|
|
|
67
67
|
/** Subscribe to open-state changes. Returns an unsubscribe function. */
|
|
68
68
|
subscribe(listener: (open: boolean) => void): () => void;
|
|
69
69
|
connectedCallback(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Whether `Gtk.Popover:child` is the author's to set. A subclass that builds its own
|
|
72
|
+
* content (GtkPopoverMenu, GtkEmojiChooser) sets the child itself, as their C does.
|
|
73
|
+
*/
|
|
74
|
+
protected takesChild(): boolean;
|
|
70
75
|
private _buildOnce;
|
|
71
76
|
disconnectedCallback(): void;
|
|
72
77
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The attributes a record hands to its child on adoption — `GtkStackPage`'s string/boolean properties. */
|
|
2
|
+
export declare const STACK_PAGE_ATTRIBUTES: readonly ["name", "title", "icon-name", "needs-attention", "use-underline"];
|
|
3
|
+
export declare class GtkStackPage extends HTMLElement {
|
|
4
|
+
static get observedAttributes(): ("title" | "name" | "icon-name" | "use-underline" | "needs-attention")[];
|
|
5
|
+
/** `GtkStackPage:name` — what `visible-child-name` selects by. */
|
|
6
|
+
get name(): string;
|
|
7
|
+
set name(value: string | null);
|
|
8
|
+
/** `GtkStackPage:icon-name`. */
|
|
9
|
+
get iconName(): string | null;
|
|
10
|
+
set iconName(value: string | null);
|
|
11
|
+
/** `GtkStackPage:needs-attention`. */
|
|
12
|
+
get needsAttention(): boolean;
|
|
13
|
+
set needsAttention(value: boolean);
|
|
14
|
+
/** `GtkStackPage:use-underline`. */
|
|
15
|
+
get useUnderline(): boolean;
|
|
16
|
+
set useUnderline(value: boolean);
|
|
17
|
+
/** `GtkStackPage:visible` — `hidden`, as on the child the stack reads it from. */
|
|
18
|
+
get visible(): boolean;
|
|
19
|
+
set visible(value: boolean);
|
|
20
|
+
/** `GtkStackPage:child` — the element the stack shows for this page, while not yet adopted. */
|
|
21
|
+
get child(): HTMLElement | null;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The one element a record holds: its `slot="child"` child or its only element child. A record
|
|
26
|
+
* with none, or with more than one, is refused by name — GtkStackPage has exactly one `child`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function pageChildOf(page: HTMLElement): HTMLElement | null;
|
|
@@ -118,7 +118,18 @@ export declare class GtkStack extends HTMLElement {
|
|
|
118
118
|
private _page;
|
|
119
119
|
/** `set_visible_child`'s "pick first visible" scan (gtkstack.c:1437-1450). */
|
|
120
120
|
private _firstVisible;
|
|
121
|
+
/**
|
|
122
|
+
* A `<gtk-stack-page>` record, adopted: its child takes the record's place and its properties
|
|
123
|
+
* as the attributes this element reads, the way `<adw-view-stack>` adopts a declared page.
|
|
124
|
+
* Any other child is already the page and is handed back as it is.
|
|
125
|
+
*/
|
|
126
|
+
private _adopt;
|
|
121
127
|
private _initChild;
|
|
128
|
+
/**
|
|
129
|
+
* The observer watches the subtree, so an attribute record can come from anything below a
|
|
130
|
+
* page; only a direct child is a page of THIS stack (a nested stack's pages are its own).
|
|
131
|
+
*/
|
|
132
|
+
private _isPage;
|
|
122
133
|
private _onChildMutations;
|
|
123
134
|
/** C's NULL page name is an ABSENT attribute, not the empty string (gtkstack.c:2216). */
|
|
124
135
|
private _nameOrNull;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GtkApplication } from '../application.js';
|
|
1
2
|
import type { DispatchedSignals } from '../signals.js';
|
|
2
3
|
import { type AdwSlot } from '../slotted-children.js';
|
|
3
4
|
import './gtk-window-controls.js';
|
|
@@ -26,6 +27,10 @@ export declare class GtkWindow extends HTMLElement {
|
|
|
26
27
|
* A `close-request` handler that returns true is `preventDefault()`.
|
|
27
28
|
*/
|
|
28
29
|
static readonly signals: DispatchedSignals;
|
|
30
|
+
/** `Gtk.Window:application`: setting it is `add_window` (ADR 0098), set by `defineWindowApplication`. */
|
|
31
|
+
application: GtkApplication | null;
|
|
32
|
+
get_application: () => GtkApplication | null;
|
|
33
|
+
set_application: (application: GtkApplication | null) => void;
|
|
29
34
|
/** `GObject.Object.connect`: installed per instance by `installElementApi`; refuses an undeclared signal. */
|
|
30
35
|
connect: (signal: string, handler: (emitter: this, ...args: any[]) => unknown) => number;
|
|
31
36
|
/** `GObject.Object.disconnect`: throws for an id that is not connected. */
|
|
@@ -55,6 +60,9 @@ export declare class GtkWindow extends HTMLElement {
|
|
|
55
60
|
/** `Gtk.Window:maximized` — square corners and the restore glyph. */
|
|
56
61
|
get maximized(): boolean;
|
|
57
62
|
set maximized(value: boolean);
|
|
63
|
+
/** `Gtk.Window:fullscreened` — square corners, and the frame fills its containing block. */
|
|
64
|
+
get fullscreened(): boolean;
|
|
65
|
+
set fullscreened(value: boolean);
|
|
58
66
|
/** `Gtk.Window:resizable` — whether the maximize button may appear. */
|
|
59
67
|
get resizable(): boolean;
|
|
60
68
|
set resizable(value: boolean);
|
|
@@ -112,7 +120,8 @@ export declare class GtkWindow extends HTMLElement {
|
|
|
112
120
|
private _render;
|
|
113
121
|
/**
|
|
114
122
|
* The frame's box from `default-width` / `default-height`; an absent one clears it. A subclass
|
|
115
|
-
* with a size request of its own (`Adw.Window`'s 360×200) replaces this.
|
|
123
|
+
* with a size request of its own (`Adw.Window`'s 360×200) replaces this. A maximized or
|
|
124
|
+
* fullscreened frame carries no inline size: the skin fills its containing block.
|
|
116
125
|
*/
|
|
117
126
|
protected renderFrameSize(): void;
|
|
118
127
|
/**
|
|
@@ -170,4 +179,10 @@ export declare class GtkWindow extends HTMLElement {
|
|
|
170
179
|
maximize(): void;
|
|
171
180
|
/** `gtk_window_unmaximize`, with the same caveat as {@link maximize}. */
|
|
172
181
|
unmaximize(): void;
|
|
182
|
+
/** `gtk_window_is_fullscreen`: the FRAME's state, like {@link is_maximized}. */
|
|
183
|
+
is_fullscreen(): boolean;
|
|
184
|
+
/** `gtk_window_fullscreen`; asynchronous in GTK, so the property is written directly. */
|
|
185
|
+
fullscreen(): void;
|
|
186
|
+
/** `gtk_window_unfullscreen`, with the same caveat as {@link fullscreen}. */
|
|
187
|
+
unfullscreen(): void;
|
|
173
188
|
}
|
|
@@ -13,6 +13,15 @@ export declare function dispatchElement(el: HTMLElement, signal: string, args: r
|
|
|
13
13
|
* declares `sensitive` (`<adw-toggle-group>`) keeps its own.
|
|
14
14
|
*/
|
|
15
15
|
export declare function installSensitive(el: HTMLElement): void;
|
|
16
|
+
/** Whether `installVisible` gave `el` its `visible` (an element with its own keeps its own). */
|
|
17
|
+
export declare function hasInstalledVisible(el: Element): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* `Gtk.Widget:visible` for an element that has no member of that name: `gtk_widget_get_visible`
|
|
20
|
+
* and `gtk_widget_set_visible` over the DOM's `hidden` attribute, TRUE until hidden as GtkWidget's
|
|
21
|
+
* default is. It notifies only where the element declares `notify::visible`. An element that already declares `visible` (`<gtk-stack-page>`, `<adw-sidebar>`)
|
|
22
|
+
* keeps its own, and so does a registered class whose prototype has the port's members.
|
|
23
|
+
*/
|
|
24
|
+
export declare function installVisible(el: HTMLElement): void;
|
|
16
25
|
/** Gives `el` the instance API of a registered class, over the events it declares. */
|
|
17
26
|
export declare function installElementApi(el: HTMLElement): void;
|
|
18
27
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { adwaitaAccentSource, applyDesktopAppearance, applySystemAccent, followD
|
|
|
5
5
|
export type { AdwAccentSource } from './appearance.js';
|
|
6
6
|
export { AdwScrollShading } from './scroll-shading.js';
|
|
7
7
|
export type { AdwUndershootEdges } from './scroll-shading.js';
|
|
8
|
-
export { buildSharedTree, mountSharedTree } from './shared-tree-builder.js';
|
|
9
|
-
export type { MountOptions, MountedSharedTree, SizeSource } from './shared-tree-builder.js';
|
|
8
|
+
export { buildSharedTree, buildWithSiblings, mountSharedTree } from './shared-tree-builder.js';
|
|
9
|
+
export type { BuildOptions, BuiltTree, 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 { registerColorIcon } from './icon-theme.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwLearn6502WindowTest: () => Promise<void>;
|
|
@@ -56,4 +56,4 @@ export { AdwWindowTitle as WindowTitle } from '../elements/adw-window-title.js';
|
|
|
56
56
|
export { AdwWrapBox as WrapBox } from '../elements/adw-wrap-box.js';
|
|
57
57
|
export { AdwApplication as Application } from '../application.js';
|
|
58
58
|
export { AdwStyleManager as StyleManager } from '../style-manager.js';
|
|
59
|
-
export { ColorScheme } from '@gjsify/adwaita-core';
|
|
59
|
+
export { ColorScheme, Toast, ToastPriority } from '@gjsify/adwaita-core';
|
|
@@ -62,6 +62,7 @@ export { GtkSeparator as Separator } from '../elements/gtk-separator.js';
|
|
|
62
62
|
export { GtkSpinButton as SpinButton } from '../elements/gtk-spin-button.js';
|
|
63
63
|
export { GtkSpinner as Spinner } from '../elements/gtk-spinner.js';
|
|
64
64
|
export { GtkStack as Stack } from '../elements/gtk-stack.js';
|
|
65
|
+
export { GtkStackPage as StackPage } from '../elements/gtk-stack-page.js';
|
|
65
66
|
export { GtkStackSidebar as StackSidebar } from '../elements/gtk-stack-sidebar.js';
|
|
66
67
|
export { GtkStackSwitcher as StackSwitcher } from '../elements/gtk-stack-switcher.js';
|
|
67
68
|
export { GtkStringList as StringList } from '@gjsify/adwaita-core';
|
|
@@ -76,6 +77,7 @@ export type { WindowCommon } from '@gjsify/adwaita-core';
|
|
|
76
77
|
export { GtkWindowControls as WindowControls } from '../elements/gtk-window-controls.js';
|
|
77
78
|
export { GtkViewport as Viewport } from '../elements/gtk-viewport.js';
|
|
78
79
|
export { GtkWindowHandle as WindowHandle } from '../elements/gtk-window-handle.js';
|
|
80
|
+
export { ApplicationInhibitFlags } from '@gjsify/adwaita-core';
|
|
79
81
|
export { GtkApplication as Application } from '../application.js';
|
|
80
82
|
export { STYLE_PROVIDER_PRIORITY_APPLICATION, STYLE_PROVIDER_PRIORITY_FALLBACK, STYLE_PROVIDER_PRIORITY_SETTINGS, STYLE_PROVIDER_PRIORITY_THEME, STYLE_PROVIDER_PRIORITY_USER, } from '@gjsify/adwaita-core';
|
|
81
83
|
export { CssProvider, EventControllerKey, IconTheme, show_uri, StyleContext, Settings } from './gtk-platform.js';
|
|
@@ -77,6 +77,37 @@ interface PendingBind {
|
|
|
77
77
|
* upgraded has declared no slots yet, so the refusal below belongs to the mount.
|
|
78
78
|
*/
|
|
79
79
|
export declare function buildSharedTree(node: SharedTreeNode, record?: BuildRecord): HTMLElement;
|
|
80
|
+
/** What {@link buildWithSiblings} hands back: the root element and the objects built beside it. */
|
|
81
|
+
export interface BuiltTree {
|
|
82
|
+
/** The element the tree roots at, as {@link buildSharedTree} returns it. */
|
|
83
|
+
root: HTMLElement;
|
|
84
|
+
/**
|
|
85
|
+
* The sibling objects by id — `Adw.AlertDialog unsavedChangesDialog { }` or `$Learn learn { }`
|
|
86
|
+
* written after the template. A sibling is built in the root's id scope (a setter or a bind
|
|
87
|
+
* may name it) but is no child of the root: the code beside the file decides where, or
|
|
88
|
+
* whether, it is placed.
|
|
89
|
+
*/
|
|
90
|
+
siblings: ReadonlyMap<string, HTMLElement>;
|
|
91
|
+
/** Every element the tree names by id, siblings included: what `GtkBuilder.get_object` answers for. */
|
|
92
|
+
objects: ReadonlyMap<string, HTMLElement>;
|
|
93
|
+
}
|
|
94
|
+
/** What {@link buildWithSiblings} takes beside the tree. */
|
|
95
|
+
export interface BuildOptions {
|
|
96
|
+
/** The object a handler NAME is looked up on (ADR 0093 § 3). */
|
|
97
|
+
scope?: Readonly<Record<string, unknown>>;
|
|
98
|
+
/** The size source a `breakpoints` node is driven from. */
|
|
99
|
+
observeSize?: SizeSource;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A tree with sibling roots (ADR 0093): the root element, and each sibling by id, all DETACHED
|
|
103
|
+
* like {@link buildSharedTree}'s result.
|
|
104
|
+
*
|
|
105
|
+
* {@link buildSharedTree}, {@link mountSharedTree} and {@link buildTemplateTree} refuse such a
|
|
106
|
+
* tree by name, because they return one element and the siblings would be built and then thrown
|
|
107
|
+
* away. A sibling with no id is refused too: nothing could ever ask for it, which is how a
|
|
108
|
+
* dropped object looks finished.
|
|
109
|
+
*/
|
|
110
|
+
export declare function buildWithSiblings(node: SharedTreeNode, options?: BuildOptions): BuiltTree;
|
|
80
111
|
/**
|
|
81
112
|
* One authored property, written as the element reads it; a breakpoint setter takes the same door.
|
|
82
113
|
*
|