@gjsify/adwaita-core 0.64.13-next.283 → 0.64.14

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.
@@ -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 firstElementChild: unknown;
12
- readonly lastElementChild: unknown;
13
- readonly nextElementSibling: unknown;
14
- readonly previousElementSibling: unknown;
15
- readonly parentElement: unknown;
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
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-core",
3
- "version": "0.64.13-next.283",
3
+ "version": "0.64.14",
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.13-next.283",
70
+ "@gjsify/cli": "^0.64.14",
71
71
  "@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
72
- "@gjsify/unit": "0.64.13-next.283",
72
+ "@gjsify/unit": "^0.64.14",
73
73
  "@types/node": "^25.9.2",
74
74
  "typescript": "^6.0.3"
75
75
  },
@@ -92,6 +92,5 @@
92
92
  "bugs": {
93
93
  "url": "https://github.com/gjsify/gjsify/issues"
94
94
  },
95
- "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/adwaita-core#readme",
96
- "gitHead": "05fae97125a374e84bf57c2d2d086fb53523f205"
95
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/adwaita-core#readme"
97
96
  }