@gjsify/adwaita-web 0.64.1-next.241 → 0.64.1-next.244
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 +42 -4
- package/dist/adwaita-web.css +9 -1
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/canvas2d/canvas2d-bridge.d.ts +18 -0
- package/lib/types/canvas2d-bridge.spec.d.ts +1 -0
- package/lib/types/elements/adw-action-row.d.ts +1 -0
- package/lib/types/elements/adw-bottom-sheet.d.ts +1 -0
- package/lib/types/elements/adw-navigation-view.d.ts +1 -0
- package/lib/types/elements/adw-switch-row.d.ts +1 -0
- package/lib/types/elements/gtk-image.d.ts +12 -3
- package/lib/types/elements/gtk-scrolled-window.d.ts +10 -0
- package/lib/types/gobject-elements.d.ts +7 -0
- package/lib/types/icon-registry.d.ts +3 -1
- package/lib/types/icon-theme.d.ts +53 -0
- package/lib/types/icon-theme.spec.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/namespace/gtk.d.ts +1 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +12 -12
- package/scss/_about_dialog.scss +2 -2
- package/scss/_icon.scss +18 -0
- package/src/adw-window.spec.ts +7 -0
- package/src/application.spec.ts +3 -3
- package/src/canvas2d/canvas2d-bridge.ts +51 -1
- package/src/canvas2d-bridge.spec.ts +47 -0
- package/src/elements/adw-about-dialog.ts +4 -2
- package/src/elements/adw-action-row.ts +6 -0
- package/src/elements/adw-bottom-sheet.ts +6 -0
- package/src/elements/adw-navigation-view.ts +6 -0
- package/src/elements/adw-switch-row.ts +6 -0
- package/src/elements/gtk-image.ts +55 -24
- package/src/elements/gtk-scrolled-window.ts +37 -1
- package/src/elements/gtk-window-controls.ts +1 -1
- package/src/elements/gtk-window.ts +1 -1
- package/src/file-chooser-host.ts +2 -0
- package/src/file-chooser.spec.ts +3 -5
- package/src/gobject-door.spec.ts +44 -0
- package/src/gobject-elements.ts +22 -0
- package/src/gtk-font-dialog-button.spec.ts +3 -1
- package/src/gtk-scrolled-window.spec.ts +77 -0
- package/src/icon-registry.ts +13 -7
- package/src/icon-theme.spec.ts +182 -0
- package/src/icon-theme.ts +178 -0
- package/src/index.ts +3 -0
- package/src/namespace/gtk.ts +2 -0
- package/src/navigation-view.spec.ts +4 -4
- package/src/shared-tree-builder.ts +2 -1
- package/src/styles.generated.ts +1 -1
- package/src/test.browser.mts +5 -0
|
@@ -37,6 +37,24 @@ export declare class Canvas2DBridgeElement extends HostElement {
|
|
|
37
37
|
private _height;
|
|
38
38
|
private _drawFrame;
|
|
39
39
|
static get observedAttributes(): string[];
|
|
40
|
+
/**
|
|
41
|
+
* `Gtk.Widget:focusable`, whether the widget can hold the keyboard focus. `Gtk.DrawingArea`
|
|
42
|
+
* leaves it FALSE, so it is read by PRESENCE; a blueprint's `focusable: true` writes it.
|
|
43
|
+
*/
|
|
44
|
+
get focusable(): boolean;
|
|
45
|
+
set focusable(v: boolean);
|
|
46
|
+
/** `Gtk.Widget:can-focus`, TRUE by default, so it is read by VALUE. */
|
|
47
|
+
get canFocus(): boolean;
|
|
48
|
+
set canFocus(v: boolean);
|
|
49
|
+
get can_focus(): boolean;
|
|
50
|
+
set can_focus(v: boolean);
|
|
51
|
+
/**
|
|
52
|
+
* `gtk_widget_grab_focus`: moves the keyboard focus here and says whether it landed.
|
|
53
|
+
* FALSE when the widget is not focusable or cannot focus, as in GTK.
|
|
54
|
+
*/
|
|
55
|
+
grab_focus(): boolean;
|
|
56
|
+
grabFocus(): boolean;
|
|
57
|
+
private _syncFocus;
|
|
40
58
|
/** `Gtk.DrawingArea:content-width`, the minimum and natural width. Defaults to 0. */
|
|
41
59
|
get contentWidth(): number;
|
|
42
60
|
set contentWidth(v: number);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Canvas2DBridgeTest: () => Promise<void>;
|
|
@@ -30,6 +30,7 @@ export declare class AdwActionRow extends HTMLElement {
|
|
|
30
30
|
set activatableWidget(widget: HTMLElement | null);
|
|
31
31
|
/** Whether a click activates this row — `GtkListBoxRow:activatable`. */
|
|
32
32
|
get activatable(): boolean;
|
|
33
|
+
constructor();
|
|
33
34
|
connectedCallback(): void;
|
|
34
35
|
/** Copy the declarative attributes into the headless state. */
|
|
35
36
|
private _adoptAttributes;
|
|
@@ -71,6 +71,7 @@ export declare class AdwBottomSheet extends HTMLElement {
|
|
|
71
71
|
* a swipe, and the drag handle never closes anything (`resolveBottomSheetClose`).
|
|
72
72
|
*/
|
|
73
73
|
requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
|
|
74
|
+
constructor();
|
|
74
75
|
connectedCallback(): void;
|
|
75
76
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
76
77
|
/** The programmatic open/close — `AdwBottomSheet:open`, ungated by `can-close`. */
|
|
@@ -41,6 +41,7 @@ export declare class AdwNavigationView extends HTMLElement {
|
|
|
41
41
|
get canGoBack(): boolean;
|
|
42
42
|
/** The back button's tooltip — the previous page's title, or null when there is no button. */
|
|
43
43
|
get backButtonTooltip(): string | null;
|
|
44
|
+
constructor();
|
|
44
45
|
connectedCallback(): void;
|
|
45
46
|
attributeChangedCallback(name: string): void;
|
|
46
47
|
/**
|
|
@@ -10,15 +10,22 @@ export declare const MASK_CLASS_PREFIX = "adw-icon--";
|
|
|
10
10
|
* returns for a name it cannot find.
|
|
11
11
|
*/
|
|
12
12
|
export declare const MISSING_ICON_NAME = "image-missing";
|
|
13
|
+
/**
|
|
14
|
+
* The modifier a colour icon carries. Deliberately NOT under {@link MASK_CLASS_PREFIX}: the
|
|
15
|
+
* stale-class sweep below and `.adw-icon:not([class*='adw-icon--'])` both read that prefix
|
|
16
|
+
* as "a mask is applied", and a colour icon has none.
|
|
17
|
+
*/
|
|
18
|
+
export declare const COLOR_ICON_CLASS = "adw-icon-color";
|
|
13
19
|
export declare class GtkImage extends HTMLElement {
|
|
14
20
|
static get observedAttributes(): string[];
|
|
15
21
|
/** The declared symbolic name, `-symbolic` suffix optional. */
|
|
16
22
|
get iconName(): string;
|
|
17
23
|
set iconName(value: string | null);
|
|
18
24
|
/**
|
|
19
|
-
* The name
|
|
20
|
-
*
|
|
21
|
-
*
|
|
25
|
+
* The name the SYMBOLIC lookup works with — `''` when the icon-name is absent, empty,
|
|
26
|
+
* or not usable as one CSS token. A registered colour icon can still draw for a name
|
|
27
|
+
* that answers `''` here (`org.gnome.Builder`); whether a name draws anything but
|
|
28
|
+
* `image-missing` is `isIconAvailable`'s question.
|
|
22
29
|
*
|
|
23
30
|
* `''` does NOT mean the box draws nothing: an unusable name that was given still
|
|
24
31
|
* draws {@link MISSING_ICON_NAME}. Whether an icon was ASKED FOR is the raw
|
|
@@ -28,7 +35,9 @@ export declare class GtkImage extends HTMLElement {
|
|
|
28
35
|
/** The rendered edge length in px, or `null` when the stylesheet decides. */
|
|
29
36
|
get size(): number | null;
|
|
30
37
|
set size(value: number | null);
|
|
38
|
+
private _unsubscribe;
|
|
31
39
|
connectedCallback(): void;
|
|
40
|
+
disconnectedCallback(): void;
|
|
32
41
|
attributeChangedCallback(): void;
|
|
33
42
|
private _render;
|
|
34
43
|
}
|
|
@@ -76,6 +76,16 @@ export declare class GtkScrolledWindow extends HTMLElement {
|
|
|
76
76
|
*/
|
|
77
77
|
hscrollbar(): HTMLElement | null;
|
|
78
78
|
vscrollbar(): HTMLElement | null;
|
|
79
|
+
/** `Gtk.ScrolledWindow:child` — the widget inside the viewport, or the one waiting to be adopted. */
|
|
80
|
+
get child(): Element | null;
|
|
81
|
+
set child(value: Element | null);
|
|
82
|
+
get_child(): Element | null;
|
|
83
|
+
/**
|
|
84
|
+
* `gtk_scrolled_window_set_child`: replace the child, which sits in the viewport. Before the
|
|
85
|
+
* first connect there is no viewport yet, so the child waits in the light DOM where
|
|
86
|
+
* `connectedCallback` adopts it the way it adopts a declared one.
|
|
87
|
+
*/
|
|
88
|
+
set_child(child: Element | null): void;
|
|
79
89
|
/** The `<gtk-viewport>` the child sits in — the one GTK's `set_child` builds for itself. */
|
|
80
90
|
get viewport(): GtkViewport;
|
|
81
91
|
connectedCallback(): void;
|
|
@@ -6,6 +6,13 @@ export declare function ensureNotifying(el: HTMLElement, property: string): void
|
|
|
6
6
|
/** Calls `handler(el, ...args)` for `signal`; returns the disconnect. */
|
|
7
7
|
export declare function listenElement(el: HTMLElement, signal: string, handler: Handler): () => void;
|
|
8
8
|
export declare function dispatchElement(el: HTMLElement, signal: string, args: readonly unknown[]): void;
|
|
9
|
+
/**
|
|
10
|
+
* `Gtk.Widget:sensitive` for an element that has no member of that name. The DOM spells it
|
|
11
|
+
* `disabled` on a form control and `aria-disabled` on anything else (`adw-action-row.ts` reads
|
|
12
|
+
* both), so the accessor writes the spelling the element understands. An element that already
|
|
13
|
+
* declares `sensitive` (`<adw-toggle-group>`) keeps its own.
|
|
14
|
+
*/
|
|
15
|
+
export declare function installSensitive(el: HTMLElement): void;
|
|
9
16
|
/** Gives `el` the instance API of a registered class, over the events it declares. */
|
|
10
17
|
export declare function installElementApi(el: HTMLElement): void;
|
|
11
18
|
/**
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function registerIcon(name: string, svg: string): void;
|
|
20
20
|
/**
|
|
21
|
-
* Whether `name`
|
|
21
|
+
* Whether `name` draws something other than `image-missing` — a symbolic glyph compiled into
|
|
22
|
+
* the stylesheet or registered at runtime, or a colour icon from `registerColorIcon`. The
|
|
23
|
+
* name is looked up exactly as `<gtk-image icon-name>` looks it up (`icon-theme.ts`).
|
|
22
24
|
*
|
|
23
25
|
* Reads the live cascade rather than a generated list, so it answers for a glyph that
|
|
24
26
|
* arrived by any route, including a consumer's own `--icon-<name>` declaration. It is
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** What one icon name resolves to, in the order GTK's theme would try it. */
|
|
2
|
+
export type IconLookup =
|
|
3
|
+
/** A registered full-colour image, drawn as-is. `url` is ready for `url("…")`. */
|
|
4
|
+
{
|
|
5
|
+
kind: 'color';
|
|
6
|
+
name: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
/** A symbolic glyph, drawn through the `.adw-icon--<name>` mask. `name` is normalized. */
|
|
10
|
+
| {
|
|
11
|
+
kind: 'symbolic';
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
/** Nothing in the theme answers this name — draw `image-missing`. */
|
|
15
|
+
| {
|
|
16
|
+
kind: 'missing';
|
|
17
|
+
};
|
|
18
|
+
/** Subscribe to theme changes. Returns the unsubscribe function. */
|
|
19
|
+
export declare function onIconThemeChanged(listener: () => void): () => void;
|
|
20
|
+
/** Run every subscriber — after any registration that can change a lookup's answer. */
|
|
21
|
+
export declare function notifyIconThemeChanged(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve `iconName` as `gtk_icon_theme_lookup_by_gicon` would for a `GtkImage`. `null` when
|
|
24
|
+
* no name was given — the state where GTK draws nothing, not `image-missing`.
|
|
25
|
+
*
|
|
26
|
+
* When no colour icon is registered for the name, a symbolic request is returned WITHOUT
|
|
27
|
+
* checking the cascade: the mask class falls back to `image-missing` through CSS by itself
|
|
28
|
+
* and corrects itself when a later `registerIcon` lands, which is how `<gtk-image>` behaved
|
|
29
|
+
* before this module. The cascade is read only to choose between a colour entry and a
|
|
30
|
+
* symbolic glyph.
|
|
31
|
+
*/
|
|
32
|
+
export declare function lookupIcon(iconName: string | null | undefined): IconLookup | null;
|
|
33
|
+
/**
|
|
34
|
+
* Whether `iconName` resolves to something other than `image-missing` — a registered colour
|
|
35
|
+
* icon, or a symbolic glyph compiled into the stylesheet or registered at runtime.
|
|
36
|
+
*/
|
|
37
|
+
export declare function iconResolves(iconName: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Register a FULL-COLOUR icon under `name` — what an application ships in
|
|
40
|
+
* `hicolor/scalable/apps/<app-id>.svg` and GTK finds through its icon theme. Every
|
|
41
|
+
* `<gtk-image>` asking for the name draws the image unrecoloured, the way `AdwAboutDialog`'s
|
|
42
|
+
* `application-icon` does on GNOME.
|
|
43
|
+
*
|
|
44
|
+
* `name` is the EXACT icon name, reverse-DNS application IDs included. A name with a
|
|
45
|
+
* `-symbolic` suffix THROWS: that is the other half of the theme, and {@link registerIcon}
|
|
46
|
+
* is its door. `source` is SVG source, or a URL (resolved against the document) to any
|
|
47
|
+
* image the browser can draw.
|
|
48
|
+
*
|
|
49
|
+
* Re-registering a name replaces the image, and every mounted `<gtk-image>` redraws.
|
|
50
|
+
*
|
|
51
|
+
* CLIENT-SIDE ONLY, like `registerIcon`: it reads `document`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function registerColorIcon(name: string, source: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdwIconThemeTest: () => Promise<void>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { buildSharedTree, mountSharedTree } from './shared-tree-builder.js';
|
|
|
9
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
|
+
export { registerColorIcon } from './icon-theme.js';
|
|
12
13
|
export * as Adw from './namespace/adw.js';
|
|
13
14
|
export * as Gtk from './namespace/gtk.js';
|
|
14
15
|
export * as Gio from './namespace/gio.js';
|
|
@@ -72,6 +72,7 @@ export { GtkToggleButton as ToggleButton } from '../elements/gtk-toggle-button.j
|
|
|
72
72
|
export { GtkTreeExpander as TreeExpander } from '../elements/gtk-tree-expander.js';
|
|
73
73
|
export { GtkVideo as Video } from '../elements/gtk-video.js';
|
|
74
74
|
export { GtkWindow as Window } from '../elements/gtk-window.js';
|
|
75
|
+
export type { WindowCommon } from '@gjsify/adwaita-core';
|
|
75
76
|
export { GtkWindowControls as WindowControls } from '../elements/gtk-window-controls.js';
|
|
76
77
|
export { GtkViewport as Viewport } from '../elements/gtk-viewport.js';
|
|
77
78
|
export { GtkWindowHandle as WindowHandle } from '../elements/gtk-window-handle.js';
|