@gjsify/adwaita-core 0.64.12 → 0.64.13
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/lib/esm/action-row.js +1 -1
- package/lib/esm/conformance/action-row.js +1 -1
- package/lib/esm/conformance/expander-row.js +1 -0
- package/lib/esm/conformance/index.js +1 -1
- package/lib/esm/conformance/label-markup.js +1 -0
- package/lib/esm/conformance/label.js +1 -1
- package/lib/esm/conformance/split-button.js +1 -1
- package/lib/esm/default-translate.js +1 -0
- package/lib/esm/glib.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/label-markup.js +1 -0
- package/lib/esm/label.js +1 -1
- package/lib/esm/pango-markup.js +1 -1
- package/lib/esm/rows.js +1 -1
- package/lib/esm/split-button.js +1 -1
- package/lib/esm/widget-members.js +1 -1
- package/lib/types/action-row.d.ts +5 -1
- package/lib/types/conformance/action-row.d.ts +28 -0
- package/lib/types/conformance/expander-row.d.ts +40 -0
- package/lib/types/conformance/index.d.ts +6 -2
- package/lib/types/conformance/label-markup.d.ts +73 -0
- package/lib/types/conformance/split-button.d.ts +7 -3
- package/lib/types/default-translate.d.ts +6 -0
- package/lib/types/default-translate.spec.d.ts +2 -0
- package/lib/types/engine.d.ts +16 -0
- package/lib/types/glib.d.ts +40 -0
- package/lib/types/glib.spec.d.ts +2 -0
- package/lib/types/index.d.ts +9 -5
- package/lib/types/label-markup.d.ts +129 -0
- package/lib/types/label-markup.spec.d.ts +2 -0
- package/lib/types/label.d.ts +6 -0
- package/lib/types/pango-markup.d.ts +47 -2
- package/lib/types/rows.d.ts +27 -5
- package/lib/types/split-button.d.ts +28 -6
- package/lib/types/widget-members.d.ts +40 -5
- package/lib/types/widget-members.spec.d.ts +2 -0
- package/package.json +3 -3
|
@@ -28,7 +28,11 @@ export interface SplitButtonChange {
|
|
|
28
28
|
mode: SplitButtonContentMode;
|
|
29
29
|
/** The label, or `null` unless {@link mode} is `'label'`. */
|
|
30
30
|
label: string | null;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* The icon name as `get_icon_name` reads it back: `null` unless {@link mode} is
|
|
33
|
+
* `'icon'`, and `null` as well for an icon name set to `''`
|
|
34
|
+
* ({@link gtkButtonIconNameReadback}).
|
|
35
|
+
*/
|
|
32
36
|
iconName: string | null;
|
|
33
37
|
/** The child widget — the app's in `'child'` mode, an opaque internal node in `'label'`/`'icon'` mode. */
|
|
34
38
|
child: object | null;
|
|
@@ -135,6 +139,11 @@ export declare class SplitButtonState {
|
|
|
135
139
|
/** Subscribe to state changes. Returns an unsubscribe function. */
|
|
136
140
|
subscribe(listener: SplitButtonListener): () => void;
|
|
137
141
|
private _emit;
|
|
142
|
+
/**
|
|
143
|
+
* The `notify::*` sequence a content mutation owes, per {@link CONTENT_NOTIFY_ORDER}.
|
|
144
|
+
* Reads the PRE-state, so every caller must build its list before mutating.
|
|
145
|
+
*/
|
|
146
|
+
private _contentNotify;
|
|
138
147
|
/** Which content slot is filled. */
|
|
139
148
|
get mode(): SplitButtonContentMode;
|
|
140
149
|
/** The label, or `null` unless {@link mode} is `'label'`. */
|
|
@@ -145,11 +154,19 @@ export declare class SplitButtonState {
|
|
|
145
154
|
* C, clearing it is a side effect of setting another slot.
|
|
146
155
|
*/
|
|
147
156
|
setLabel(label: string): boolean;
|
|
148
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* The icon name as `adw_split_button_get_icon_name` reads it back — `null` unless
|
|
159
|
+
* {@link mode} is `'icon'`, and `null` as well for an icon name set to `''`, which
|
|
160
|
+
* leaves GtkButton's internal image EMPTY ({@link gtkButtonIconNameReadback}).
|
|
161
|
+
*/
|
|
149
162
|
get iconName(): string | null;
|
|
150
163
|
/**
|
|
151
164
|
* Set the icon name, clearing `label` and `child`. A non-string is rejected —
|
|
152
165
|
* `g_return_if_fail (icon_name != NULL)`.
|
|
166
|
+
*
|
|
167
|
+
* The guard is C's `g_strcmp0 (icon_name, get_icon_name (self))`: against the
|
|
168
|
+
* READBACK, so `''` is never equal to the `null` it reads back as and every
|
|
169
|
+
* `setIconName('')` is a change that notifies afresh.
|
|
153
170
|
*/
|
|
154
171
|
setIconName(iconName: string): boolean;
|
|
155
172
|
/**
|
|
@@ -190,15 +207,20 @@ export declare class SplitButtonState {
|
|
|
190
207
|
* from a renderer's point of view. A model that is non-empty but draws nothing — one
|
|
191
208
|
* empty section — is NOT collapsed: it has a node, so it is a menu, which is the
|
|
192
209
|
* answer GTK gives for the same `GMenu`.
|
|
210
|
+
*
|
|
211
|
+
* Notifies both properties per {@link DROPDOWN_NOTIFY_ORDER}; the guard is on the
|
|
212
|
+
* menu model ALONE, so clearing it on a popover-only button emits nothing.
|
|
193
213
|
*/
|
|
194
214
|
setMenuModel(input: AdwMenuInput | null | undefined): boolean;
|
|
195
215
|
/** The popover: the one the app set, or the model-derived stand-in, or `null`. */
|
|
196
216
|
get popover(): object | null;
|
|
197
217
|
/**
|
|
198
|
-
* Set the popover, dissociating any menu model.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
218
|
+
* Set (or clear, with `null`) the popover, dissociating any menu model. Both properties
|
|
219
|
+
* are notified per {@link DROPDOWN_NOTIFY_ORDER}, UNCONDITIONALLY — setting a popover on
|
|
220
|
+
* a split button that never had a menu model still emits `notify::menu-model`.
|
|
221
|
+
*
|
|
222
|
+
* The guard is pointer equality on the popover ALONE, so handing back the
|
|
223
|
+
* model-derived popover is a no-op that leaves the menu model in place.
|
|
202
224
|
*/
|
|
203
225
|
setPopover(popover: object | null | undefined): boolean;
|
|
204
226
|
/**
|
|
@@ -8,17 +8,52 @@ interface WidgetNode extends PointNode {
|
|
|
8
8
|
removeAttribute(name: string): void;
|
|
9
9
|
hasAttribute(name: string): boolean;
|
|
10
10
|
toggleAttribute(name: string, force?: boolean): boolean;
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
11
|
+
readonly localName: string;
|
|
12
|
+
readonly firstElementChild: LinkedNode | null;
|
|
13
|
+
readonly lastElementChild: LinkedNode | null;
|
|
14
|
+
readonly nextElementSibling: LinkedNode | null;
|
|
15
|
+
readonly previousElementSibling: LinkedNode | null;
|
|
16
|
+
readonly parentElement: LinkedNode | null;
|
|
16
17
|
readonly classList: {
|
|
17
18
|
add(name: string): void;
|
|
18
19
|
remove(name: string): void;
|
|
19
20
|
contains(name: string): boolean;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* What the tree walkers need of a node they STEP OVER: its name, and the link to the next
|
|
25
|
+
* candidate. A `<span>` a label built answers both and is no `WidgetNode` — the whole point.
|
|
26
|
+
*/
|
|
27
|
+
interface LinkedNode {
|
|
28
|
+
readonly localName: string;
|
|
29
|
+
readonly firstElementChild: LinkedNode | null;
|
|
30
|
+
readonly lastElementChild: LinkedNode | null;
|
|
31
|
+
readonly nextElementSibling: LinkedNode | null;
|
|
32
|
+
readonly previousElementSibling: LinkedNode | null;
|
|
33
|
+
readonly parentElement: LinkedNode | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Is this element a WIDGET, or a piece of a widget's own insides?
|
|
37
|
+
*
|
|
38
|
+
* `gtk_widget_get_first_child` walks the WIDGET tree — every node it hands back is a
|
|
39
|
+
* `GtkWidget`, including the template children of a composite one. A DOM port has a second
|
|
40
|
+
* kind of child in the same `children` list: the `<span>` a label's markup renderer builds,
|
|
41
|
+
* the `<div>` a row lays its slots out in. Those are not widgets in any renderer, and a
|
|
42
|
+
* caller that got one back found `instanceof Gtk.Label` false and, one step further, no
|
|
43
|
+
* `get_first_child` on it at all — a `TypeError` thrown in the consumer's walk, far from
|
|
44
|
+
* the port that produced the node. (Measured in Learn6502: a depth-first walk over the
|
|
45
|
+
* rendered tutorial hit the spans inside a label and died.)
|
|
46
|
+
*
|
|
47
|
+
* The test is the one the DOM itself guarantees: a custom element name MUST contain a
|
|
48
|
+
* hyphen and a built-in one may not, so `localName.includes('-')` separates the two kinds
|
|
49
|
+
* exactly. `compute-expand.ts` reads the same signal for the same reason.
|
|
50
|
+
*
|
|
51
|
+
* Reference: GTK gtk/gtkwidget.c (gtk_widget_get_first_child — `priv->first_child`, a
|
|
52
|
+
* GtkWidget), WHATWG HTML § custom element name (the hyphen requirement).
|
|
53
|
+
*/
|
|
54
|
+
export declare function isWidgetNode(node: {
|
|
55
|
+
readonly localName: string;
|
|
56
|
+
} | null | undefined): boolean;
|
|
22
57
|
/**
|
|
23
58
|
* Mirrors the held direction onto the `dir` attribute. A custom element may not take an attribute
|
|
24
59
|
* while `createElement` constructs it, and a widget's constructor is where GTK code pins its
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-core",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.13",
|
|
4
4
|
"description": "Headless Adwaita widget behavior (breakpoint condition grammar + apply/unapply state machine, color-scheme observable, avatar derivation) shared by the web and NativeScript Adwaita renderers — pure TS, no platform imports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"headless"
|
|
68
68
|
],
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@gjsify/cli": "^0.64.
|
|
70
|
+
"@gjsify/cli": "^0.64.13",
|
|
71
71
|
"@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
|
|
72
|
-
"@gjsify/unit": "^0.64.
|
|
72
|
+
"@gjsify/unit": "^0.64.13",
|
|
73
73
|
"@types/node": "^25.9.2",
|
|
74
74
|
"typescript": "^6.0.3"
|
|
75
75
|
},
|