@gjsify/adwaita-nativescript 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.
Files changed (107) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/index.js +1 -1
  3. package/lib/esm/namespace/gio.js +1 -1
  4. package/lib/esm/namespace/gtk.js +1 -1
  5. package/lib/esm/widgets/adw-about-dialog.js +3 -3
  6. package/lib/esm/widgets/adw-action-row.js +1 -1
  7. package/lib/esm/widgets/adw-avatar.js +1 -1
  8. package/lib/esm/widgets/adw-banner.js +1 -1
  9. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  10. package/lib/esm/widgets/adw-button-row.js +1 -1
  11. package/lib/esm/widgets/adw-carousel.js +1 -1
  12. package/lib/esm/widgets/adw-combo-row.js +1 -1
  13. package/lib/esm/widgets/adw-data-grid.js +1 -1
  14. package/lib/esm/widgets/adw-dialog.js +1 -1
  15. package/lib/esm/widgets/adw-entry-row.js +1 -1
  16. package/lib/esm/widgets/adw-image-button.js +1 -1
  17. package/lib/esm/widgets/adw-navigation-page.js +1 -1
  18. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  19. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  20. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  21. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  22. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  23. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  24. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  25. package/lib/esm/widgets/adw-sidebar.js +1 -1
  26. package/lib/esm/widgets/adw-slider-row.js +1 -1
  27. package/lib/esm/widgets/adw-spin-row.js +1 -1
  28. package/lib/esm/widgets/adw-split-button.js +1 -1
  29. package/lib/esm/widgets/adw-tab-view.js +1 -1
  30. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  31. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  32. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  33. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  34. package/lib/esm/widgets/box-layout.js +1 -1
  35. package/lib/esm/widgets/construct-props.js +1 -1
  36. package/lib/esm/widgets/gtk-action-bar.js +1 -1
  37. package/lib/esm/widgets/gtk-box.js +1 -1
  38. package/lib/esm/widgets/gtk-button.js +1 -1
  39. package/lib/esm/widgets/gtk-check-button.js +1 -1
  40. package/lib/esm/widgets/gtk-drawing-area.js +1 -1
  41. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  42. package/lib/esm/widgets/gtk-entry.js +1 -1
  43. package/lib/esm/widgets/gtk-grid.js +1 -1
  44. package/lib/esm/widgets/gtk-icon-size.js +1 -1
  45. package/lib/esm/widgets/gtk-image.js +1 -1
  46. package/lib/esm/widgets/gtk-label.js +2 -2
  47. package/lib/esm/widgets/gtk-list-box.js +1 -1
  48. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  49. package/lib/esm/widgets/gtk-popover-menu.js +1 -1
  50. package/lib/esm/widgets/gtk-revealer.js +1 -1
  51. package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
  52. package/lib/esm/widgets/gtk-stack.js +1 -1
  53. package/lib/esm/widgets/gtk-text-view.js +1 -1
  54. package/lib/esm/widgets/gtk-toggle-button.js +1 -1
  55. package/lib/esm/widgets/gtk-window.js +1 -1
  56. package/lib/esm/widgets/index.js +1 -1
  57. package/lib/esm/widgets/label-markup-native.android.js +1 -0
  58. package/lib/esm/widgets/label-markup-native.ios.js +1 -0
  59. package/lib/esm/widgets/label-markup-native.js +1 -0
  60. package/lib/esm/widgets/label-markup.js +1 -1
  61. package/lib/esm/widgets/menu-slot.js +1 -0
  62. package/lib/esm/widgets/popup-menu-view.js +1 -1
  63. package/lib/esm/widgets/popup-menu.js +1 -1
  64. package/lib/esm/widgets/scrolled-window-policy.js +1 -1
  65. package/lib/esm/widgets/signals.js +1 -1
  66. package/lib/esm/widgets/single-child-base.js +1 -1
  67. package/lib/esm/widgets/single-child-cell.js +1 -0
  68. package/lib/esm/widgets/stack-page.js +1 -1
  69. package/lib/esm/widgets/transition-type.js +1 -1
  70. package/lib/esm/widgets/view-stack-page.js +1 -1
  71. package/lib/esm/widgets/widget-layout.js +1 -1
  72. package/lib/esm/widgets/xml-values.js +1 -1
  73. package/lib/types/clamped-bin.spec.d.ts +2 -0
  74. package/lib/types/combo-row-properties.spec.d.ts +2 -0
  75. package/lib/types/drop-down-properties.spec.d.ts +2 -0
  76. package/lib/types/entry-properties.spec.d.ts +1 -0
  77. package/lib/types/index.d.ts +4 -2
  78. package/lib/types/menu-model-door.spec.d.ts +1 -0
  79. package/lib/types/namespace/gio.d.ts +1 -1
  80. package/lib/types/single-child-cell.spec.d.ts +2 -0
  81. package/lib/types/template-xalign.spec.d.ts +2 -0
  82. package/lib/types/testing/ns-core.d.mts +35 -2
  83. package/lib/types/widgets/actions.d.ts +3 -3
  84. package/lib/types/widgets/adw-combo-row.d.ts +42 -26
  85. package/lib/types/widgets/adw-split-button.d.ts +17 -7
  86. package/lib/types/widgets/box-layout.d.ts +37 -0
  87. package/lib/types/widgets/gtk-box.d.ts +11 -5
  88. package/lib/types/widgets/gtk-drop-down.d.ts +41 -33
  89. package/lib/types/widgets/gtk-entry.d.ts +62 -34
  90. package/lib/types/widgets/gtk-label.d.ts +24 -0
  91. package/lib/types/widgets/gtk-menu-button.d.ts +22 -13
  92. package/lib/types/widgets/gtk-popover-menu.d.ts +7 -7
  93. package/lib/types/widgets/index.d.ts +2 -4
  94. package/lib/types/widgets/label-markup-native.android.d.ts +5 -0
  95. package/lib/types/widgets/label-markup-native.d.ts +19 -0
  96. package/lib/types/widgets/label-markup-native.ios.d.ts +5 -0
  97. package/lib/types/widgets/label-markup.d.ts +62 -1
  98. package/lib/types/widgets/menu-slot.d.ts +40 -0
  99. package/lib/types/widgets/popup-menu-view.d.ts +3 -2
  100. package/lib/types/widgets/popup-menu.d.ts +8 -6
  101. package/lib/types/widgets/signals.d.ts +33 -8
  102. package/lib/types/widgets/single-child-base.d.ts +5 -0
  103. package/lib/types/widgets/single-child-cell.d.ts +13 -0
  104. package/lib/types/widgets/xml-values.d.ts +12 -0
  105. package/package.json +13 -14
  106. package/src/testing/ns-core.mts +74 -2
  107. package/src/theme/adwaita.css +24 -11
@@ -1,4 +1,4 @@
1
- import { Label, type EventData, type View } from '@nativescript/core';
1
+ import { Label, type View } from '@nativescript/core';
2
2
  import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
3
3
  import { AdwActionRow } from './adw-action-row.js';
4
4
  import { GtkImage } from './gtk-image.js';
@@ -7,14 +7,18 @@ export { ComboState } from '@gjsify/adwaita-core';
7
7
  export type { AdwComboOption, ComboStateChange, ComboStateListener } from '@gjsify/adwaita-core';
8
8
  /** Event name emitted when {@link AdwComboRow.selected} changes. Mirrors GObject `notify::selected`. */
9
9
  export declare const NOTIFY_SELECTED = "notify::selected";
10
- /** Payload of the `notify::selected` event. */
11
- export interface NotifySelectedEventData extends EventData {
12
- /** The newly-selected index. */
13
- selected: number;
14
- /** The newly-selected option's `value`. */
15
- value: string;
16
- }
17
- export declare class AdwComboRow extends AdwActionRow {
10
+ declare const AdwComboRow_base: ((abstract new (...args: any[]) => {
11
+ _emit(eventName: string): void;
12
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
13
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
14
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
15
+ notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
16
+ set(name: string, value: unknown): void;
17
+ get(name: string): unknown;
18
+ }) & {
19
+ readonly emittedSignals: readonly string[];
20
+ }) & typeof AdwActionRow;
21
+ export declare class AdwComboRow extends AdwComboRow_base {
18
22
  static readonly GTypeName: string;
19
23
  /**
20
24
  * The action row's edges, plus `model`: `model: Gtk.StringList { strings [ … ] }` in a
@@ -42,7 +46,35 @@ export declare class AdwComboRow extends AdwActionRow {
42
46
  * writes `model:` first — the order GtkBuilder needs too.
43
47
  */
44
48
  private _pendingSelected;
49
+ /** `Adw.ComboRow:model` — the list, by identity. Declared above; the seam installs it. */
50
+ model: ComboWatchableModel | null;
51
+ /**
52
+ * `Adw.ComboRow:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
53
+ * Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
54
+ * per declared property and this row is what writes the derived value.
55
+ */
56
+ selected: number;
57
+ /**
58
+ * `Adw.ComboRow:selected-item` — the model's OWN object at {@link selected}, so the identity
59
+ * comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
60
+ * model. Read-only by derivation (see the declaration).
61
+ */
62
+ selectedItem: unknown;
63
+ /**
64
+ * What a `model` write DOES, once the seam has stored the normalized value.
65
+ *
66
+ * A method on the class and not a body inside the declaration, because the descriptor sits
67
+ * outside the class and reaches the state through a cast — and a reader keyed on
68
+ * `this.<field>` cannot tell `ComboState.setModel` from `ListViewState.setModel` through
69
+ * one (`check-adwaita-collection-reactivity.mjs`). Guessing there would merge two different
70
+ * collections into one comparison, so the call is made where the field's type is declared.
71
+ */
72
+ private _applyModel;
73
+ /** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
74
+ private _applySelected;
45
75
  constructor(props?: ConstructProps<AdwComboRow>);
76
+ /** What the relay pushes for each of the three — the state's reading, never the store's. */
77
+ private _valueOf;
46
78
  /**
47
79
  * `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
48
80
  * choice, so the chevron goes and the row stops being activatable.
@@ -54,13 +86,6 @@ export declare class AdwComboRow extends AdwActionRow {
54
86
  private _syncChooser;
55
87
  /** Open the native action chooser and apply the picked option. */
56
88
  private _openChooser;
57
- /**
58
- * The list model (`Adw.ComboRow:model`) — the OBJECT that was assigned, by identity, as
59
- * `row.model === model` is measured to hold in libadwaita (ADR 0122 § 4). The normalised
60
- * descriptors are {@link options}.
61
- */
62
- get model(): ComboWatchableModel | null;
63
- set model(value: ComboWatchableModel | string | null);
64
89
  /** The held model's items as `{ value, label }` descriptors. */
65
90
  get options(): AdwComboOption[];
66
91
  /** `adw_combo_row_set_model`. */
@@ -73,21 +98,12 @@ export declare class AdwComboRow extends AdwActionRow {
73
98
  * row edge, as on any action row.
74
99
  */
75
100
  _addChildFromBuilder(name: string, child: View): void;
76
- /** The selected option index. Updates the inline value label. */
77
- get selected(): number;
78
- set selected(raw: number | string);
101
+ /** `adw_combo_row_get_selected`. */
79
102
  get_selected(): number;
80
103
  set_selected(position: number): void;
81
104
  /** The selected option's `value`, or `''` when out of range. */
82
105
  get selectedValue(): string;
83
106
  set selectedValue(value: string);
84
- /**
85
- * The selected ITEM (`Adw.ComboRow:selected-item`) — the model's own object at
86
- * {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
87
- * consumer writes holds. `null` for the sentinel and for no model. Read-only, as in
88
- * libadwaita.
89
- */
90
- get selectedItem(): unknown;
91
107
  /** `adw_combo_row_get_selected_item`. */
92
108
  get_selected_item(): unknown;
93
109
  }
@@ -1,5 +1,5 @@
1
1
  import { GridLayout, Label, StackLayout, type EventData } from '@nativescript/core';
2
- import type { AdwMenuActions, AdwMenuInput, AdwMenuModel, SplitButtonDirection } from '@gjsify/adwaita-core';
2
+ import type { AdwMenuActions, AdwMenuModel, SplitButtonDirection } from '@gjsify/adwaita-core';
3
3
  import { GtkImage } from './gtk-image.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  import { type GObjectNotify } from './signals.js';
@@ -121,6 +121,12 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
121
121
  /** The direction arrow. */
122
122
  protected readonly _chevron: GtkImage;
123
123
  private readonly _state;
124
+ /**
125
+ * The menu this button holds, with its `items-changed` watcher. The STATE holds it too
126
+ * — `setMenuModel` is what drives `dropdownEnabled` and the notify order — and this
127
+ * holds the snapshot the popup is built from, which the state has no business knowing.
128
+ */
129
+ private readonly _slot;
124
130
  private _actions;
125
131
  /** Which of the two action views is currently parented. */
126
132
  private _showingIcon;
@@ -168,13 +174,17 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
168
174
  * (`gallery-page.ts`), which no structured value can satisfy. An input form nothing
169
175
  * can run is a claim, not a feature.
170
176
  *
171
- * AND IT SAYS SO. Left to `normalizeMenuModel`, a string is "not an array" and
172
- * becomes an EMPTY menu — so an XML author writing `menuModel="[…]"` would get a
173
- * button whose dropdown is dead, with nothing anywhere saying why. A shut door that
174
- * is silent is worse than one that is open.
177
+ * AND IT SAYS SO. Left to the core's door a string would be PARSED, because that door
178
+ * is also the browser's `menu-model` attribute (ADR 0128 § 4) — so an XML author writing
179
+ * `menuModel="[…]"` would get a menu this port never promised to build from markup. A
180
+ * shut door that is silent is worse than one that is open, so the refusal names itself.
181
+ *
182
+ * `null` IS THE ONE SPELLING OF "NO MENU" since ADR 0128: an empty `Gio.Menu` is a menu
183
+ * that happens to have no rows, and it keeps the dropdown live exactly as it does on
184
+ * GTK (measured, `MENU_MODEL_DOOR_VECTORS`).
175
185
  */
176
- get menuModel(): AdwMenuModel;
177
- set menuModel(value: AdwMenuInput);
186
+ get menuModel(): AdwMenuModel | null;
187
+ set menuModel(value: AdwMenuModel | null);
178
188
  /**
179
189
  * What the action group publishes about the actions this menu names — the portable
180
190
  * stand-in for a `GActionGroup`, and the only source of a menu's enabled/checked
@@ -25,6 +25,43 @@ export interface BoxTrack {
25
25
  export declare function boxTrackPlan(expands: readonly boolean[], spacing: unknown, homogeneous: boolean): BoxTrack[];
26
26
  /** The track child `index` lives in — the even ones; the odd ones are the gaps. */
27
27
  export declare function boxChildTrack(index: number): number;
28
+ /** What a track list has to change to become the next one — a kept head and an added tail. */
29
+ export interface BoxTrackDiff {
30
+ /** How many leading tracks are already right and stay exactly as they are. */
31
+ keep: number;
32
+ /** The tracks to add after those, in order. Everything past `keep` is dropped first. */
33
+ add: readonly BoxTrack[];
34
+ }
35
+ /**
36
+ * How to turn `current` into `next`: keep the common leading run, drop the rest from the END
37
+ * backwards, then add {@link BoxTrackDiff.add}.
38
+ *
39
+ * WHY A DIFF AND NOT A REBUILD. {@link boxTrackPlan} is a pure SUFFIX EXTENSION — one more
40
+ * child appends a gap track and a track, and leaves every earlier track untouched, because
41
+ * {@link boxChildTrack} answers `2 * i` whatever follows. So the widget re-planned the whole
42
+ * list on every single `addChild` / `removeChild`, and that is quadratic in the child count.
43
+ * Measured on a Galaxy S9, a 167-child vertical box building the Learn6502 tutorial: 362
44
+ * `_applyChildren` calls, 175 ms of them spent removing and re-adding `ItemSpec`s that had
45
+ * not changed and writing cells to children that had not moved. With this diff an append and
46
+ * a remove-at-the-end are both one track pair.
47
+ *
48
+ * REMOVING FROM THE END IS NOT AN OPTIMISATION, it is the only order that works: the platform
49
+ * removes a track BY SPEC, so dropping a leading one renumbers the specs still to drop.
50
+ */
51
+ export declare function boxTrackDiff(current: readonly BoxTrack[], next: readonly BoxTrack[]): BoxTrackDiff;
52
+ /**
53
+ * The first index at which the children already placed differ from the children now — where
54
+ * writing cells has to start.
55
+ *
56
+ * A child's cell is `2 * index` and nothing else, so a child whose index did not move keeps
57
+ * the cell it has: an append has to place only the newcomer, and a remove-at-the-end nothing
58
+ * at all. A prepend or a remove from the middle shifts every index after it and is answered
59
+ * with a 0 — correct, and no cheaper than it is in the child list itself.
60
+ *
61
+ * Generic over the child type for the same reason the rest of this module is free of
62
+ * `@nativescript/core`: so the spec suite can drive it off-device.
63
+ */
64
+ export declare function boxPlacementStart<T>(placed: readonly T[], next: readonly T[]): number;
28
65
  /**
29
66
  * Where the child list ends up after an `insert_child_after` / `reorder_child_after`, or
30
67
  * `null` where C would have hit a `g_return_if_fail`.
@@ -8,7 +8,10 @@ export declare class GtkBox extends AdwStyledLayoutBase {
8
8
  private _spacing;
9
9
  private _orientation;
10
10
  private _homogeneous;
11
- private _trackKey;
11
+ private _tracks;
12
+ private _tracksVertical;
13
+ private readonly _specs;
14
+ private _placed;
12
15
  private readonly _followers;
13
16
  constructor(props?: ConstructProps<GtkBox>);
14
17
  /** Append a child — `gtk_box_append`. */
@@ -54,10 +57,13 @@ export declare class GtkBox extends AdwStyledLayoutBase {
54
57
  /**
55
58
  * Give every child its track and the box the track list that matches.
56
59
  *
57
- * The WHOLE set, not just the newcomer: adding a second child changes the FIRST one's
58
- * answer too when the box is re-ordered, and a removal shifts every index after it. The
59
- * track list is rebuilt only when it differs, because re-adding every `ItemSpec` makes
60
- * the platform re-measure.
60
+ * RE-PLANNED FROM THE WHOLE SET, APPLIED AS A DIFF. Adding a second child changes the
61
+ * FIRST one's answer too when the box is re-ordered, and a removal shifts every index
62
+ * after it, so the plan is always read off every child. But this runs on EVERY
63
+ * `addChild` / `insertChild` / `removeChild`, and re-adding every `ItemSpec` and
64
+ * re-writing every cell made that quadratic in the child count — `boxTrackDiff` and
65
+ * `boxPlacementStart` hold the measurement and the reasoning. An append and a
66
+ * remove-from-the-end are one track pair and one cell each.
61
67
  */
62
68
  private _applyChildren;
63
69
  }
@@ -1,24 +1,16 @@
1
- import { Label, StackLayout, type EventData, type View } from '@nativescript/core';
1
+ import { Label, StackLayout, type View } from '@nativescript/core';
2
2
  import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
3
3
  import { GtkImage } from './gtk-image.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
- /** Event name emitted when {@link GtkDropDown.selected} changes through a pick. Mirrors GObject `notify::selected`. */
5
+ import { type GObjectNotify } from './signals.js';
6
+ /** Event name emitted when {@link GtkDropDown.selected} changes. Mirrors GObject `notify::selected`. */
6
7
  export declare const NOTIFY_SELECTED = "notify::selected";
7
8
  /** Mirrors GObject `notify::selected-item`; fired right after the one above, on the same change. */
8
9
  export declare const NOTIFY_SELECTED_ITEM = "notify::selected-item";
9
- /** Payload of the `notify::selected` event. */
10
- export interface NotifyDropDownSelectedEventData extends EventData {
11
- /** The newly-selected index. */
12
- selected: number;
13
- /** The newly-selected option's `value`. */
14
- value: string;
15
- /** The newly-selected option's `label` — what the button now shows. */
16
- label: string;
17
- }
18
10
  declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
19
- addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
20
- removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
21
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
11
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
12
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
13
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
22
14
  disconnect(handlerId: number): void;
23
15
  emit(eventName: string, ...args: unknown[]): void;
24
16
  get_property(name: string): unknown;
@@ -73,7 +65,7 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
73
65
  set_focus_on_click(focusOnClick: boolean): void;
74
66
  grab_focus(): boolean;
75
67
  _emit(eventName: string): void;
76
- notify<T extends EventData>(data: T): void;
68
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
77
69
  notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
78
70
  set(name: string, value: unknown): void;
79
71
  get(name: string): unknown;
@@ -82,8 +74,6 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
82
74
  }) & typeof StackLayout;
83
75
  export declare class GtkDropDown extends GtkDropDown_base {
84
76
  static readonly GTypeName: string;
85
- /** The GTK signals this widget emits through `connect` — read by the shared-tree builder (ADR 0093). */
86
- static readonly emittedSignals: readonly string[];
87
77
  /**
88
78
  * `model` only: `model: Gtk.StringList { strings [ … ] }` in a `.blp` places the list at
89
79
  * the property it sets (ADR 0072). `GtkDropDown` takes no child widget in GTK.
@@ -104,16 +94,43 @@ export declare class GtkDropDown extends GtkDropDown_base {
104
94
  private readonly _authored;
105
95
  /** Title shown atop the substituted `action()` sheet. */
106
96
  private _chooserTitle;
97
+ /**
98
+ * A `selected` written while the widget has no model yet — the twin of
99
+ * {@link AdwComboRow}'s. NativeScript's XML builder assigns every attribute before it adds
100
+ * the children, so `<gtk:DropDown selected="1">` reached this widget before its
101
+ * `<gtk:DropDown.model>` list did and the index was DROPPED; the row has held it since it
102
+ * was written and the drop-down does now too.
103
+ */
104
+ private _pendingSelected;
105
+ /** `Gtk.DropDown:model` — the list, by identity. Declared above; the seam installs it. */
106
+ model: ComboWatchableModel | null;
107
+ /**
108
+ * `Gtk.DropDown:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
109
+ * Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
110
+ * per declared property and this widget is what writes the derived value.
111
+ */
112
+ selected: number;
113
+ /**
114
+ * `Gtk.DropDown:selected-item` — the model's OWN object at {@link selected}, so the identity
115
+ * comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
116
+ * model. Read-only by derivation (see the declaration).
117
+ */
118
+ selectedItem: unknown;
119
+ /** GJS's `notify('<prop>')` beside NativeScript's `notify({ eventName })`; see the seam. */
120
+ notify: GObjectNotify;
121
+ /**
122
+ * What a `model` write does, once the seam has stored the normalized value — the twin of
123
+ * `AdwComboRow._applyModel`, which says why the body sits on the class and not in the
124
+ * declaration.
125
+ */
126
+ private _applyModel;
127
+ /** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
128
+ private _applySelected;
107
129
  constructor(props?: ConstructProps<GtkDropDown>);
130
+ /** What the relay pushes for each of the three — the state's reading, never the store's. */
131
+ private _valueOf;
108
132
  /** Open the native chooser and apply the picked option. */
109
133
  private _openChooser;
110
- /**
111
- * The list model (`Gtk.DropDown:model`) — the OBJECT that was assigned, by identity, as
112
- * `dropdown.model === model` is measured to hold in GTK (ADR 0122 § 4). The normalised
113
- * descriptors are {@link options}.
114
- */
115
- get model(): ComboWatchableModel | null;
116
- set model(value: ComboWatchableModel | string | null);
117
134
  /** The held model's items as `{ value, label }` descriptors. */
118
135
  get options(): AdwComboOption[];
119
136
  /** `gtk_drop_down_set_model`. */
@@ -125,9 +142,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
125
142
  * Anything else is refused, as GTK refuses a child widget on a `GtkDropDown`.
126
143
  */
127
144
  _addChildFromBuilder(name: string, child: View): void;
128
- /** The selected option index (`Gtk.DropDown:selected`). */
129
- get selected(): number;
130
- set selected(raw: number | string);
131
145
  /** `gtk_drop_down_get_selected`. */
132
146
  get_selected(): number;
133
147
  /** `gtk_drop_down_set_selected`. */
@@ -135,12 +149,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
135
149
  /** The selected option's `value`, or `''` when out of range. */
136
150
  get selectedValue(): string;
137
151
  set selectedValue(value: string);
138
- /**
139
- * The selected ITEM (`Gtk.DropDown:selected-item`) — the model's own object at
140
- * {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
141
- * consumer writes holds. `null` for the sentinel and for no model. Read-only, as in GTK.
142
- */
143
- get selectedItem(): unknown;
144
152
  /** `gtk_drop_down_get_selected_item`. */
145
153
  get_selected_item(): unknown;
146
154
  /**
@@ -1,22 +1,24 @@
1
- import { GridLayout, TextField, type EventData } from '@nativescript/core';
1
+ import { GridLayout, TextField } from '@nativescript/core';
2
2
  import { type ConstructProps } from './construct-props.js';
3
+ import { type GObjectNotify } from './signals.js';
3
4
  /** Event name emitted when {@link GtkEntry.text} changes. Mirrors GObject `notify::text`. */
4
5
  export declare const NOTIFY_TEXT = "notify::text";
6
+ /** Event name emitted when {@link GtkEntry.textLength} changes. Mirrors `notify::text-length`. */
7
+ export declare const NOTIFY_TEXT_LENGTH = "notify::text-length";
8
+ /** Event name emitted when {@link GtkEntry.maxLength} changes. Mirrors `notify::max-length`. */
9
+ export declare const NOTIFY_MAX_LENGTH = "notify::max-length";
10
+ /** Event name emitted when {@link GtkEntry.placeholderText} changes. */
11
+ export declare const NOTIFY_PLACEHOLDER_TEXT = "notify::placeholder-text";
12
+ /** Event name emitted when {@link GtkEntry.editable} changes. */
13
+ export declare const NOTIFY_EDITABLE = "notify::editable";
5
14
  /** Event name emitted when the return key is pressed — `Gtk.Entry::activate`. */
6
15
  export declare const ACTIVATE = "activate";
7
16
  /** `Gtk.Editable::changed` — every change of the text, typed or set. */
8
17
  export declare const CHANGED = "changed";
9
- /** Payload of the `notify::text` event. */
10
- export interface NotifyEntryTextEventData extends EventData {
11
- /** The new text value (already truncated to `maxLength`). */
12
- text: string;
13
- /** The new number of CHARACTERS (not UTF-16 units). */
14
- textLength: number;
15
- }
16
18
  declare const GtkEntry_base: ((abstract new (...args: any[]) => {
17
- addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
18
- removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
19
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
19
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
20
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
21
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
20
22
  disconnect(handlerId: number): void;
21
23
  emit(eventName: string, ...args: unknown[]): void;
22
24
  get_property(name: string): unknown;
@@ -71,7 +73,7 @@ declare const GtkEntry_base: ((abstract new (...args: any[]) => {
71
73
  set_focus_on_click(focusOnClick: boolean): void;
72
74
  grab_focus(): boolean;
73
75
  _emit(eventName: string): void;
74
- notify<T extends EventData>(data: T): void;
76
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
75
77
  notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
76
78
  set(name: string, value: unknown): void;
77
79
  get(name: string): unknown;
@@ -80,35 +82,61 @@ declare const GtkEntry_base: ((abstract new (...args: any[]) => {
80
82
  }) & typeof GridLayout;
81
83
  export declare class GtkEntry extends GtkEntry_base {
82
84
  static readonly GTypeName: string;
83
- /** The GTK signals this widget emits through `connect` — read by the shared-tree builder (ADR 0093). */
84
- static readonly emittedSignals: readonly string[];
85
85
  /** The real input. Chrome-less: the box around it paints the Adwaita surface. */
86
86
  protected readonly _field: TextField;
87
- private _text;
88
- private _maxLength;
89
- constructor(props?: ConstructProps<GtkEntry>);
90
87
  /**
91
- * Truncate, write the field, and notify on a real change.
88
+ * Whether the write being applied came from the keyboard. It decides the ORDER
89
+ * {@link _applyText} emits in, and nothing else — see the module header's measurement.
90
+ */
91
+ private _typing;
92
+ /** The entry's contents, truncated to {@link maxLength}. Declared above; the seam installs it. */
93
+ text: string;
94
+ /**
95
+ * `Gtk.Entry:text-length` — the number of CHARACTERS, not UTF-16 units, so `'🔒é'` is 2.
92
96
  *
93
- * Writing the field re-enters through `textChange`; the nested call finds the
94
- * text already applied and settles it, and the outer one then sees its own
95
- * value in `_text` and stops — so a truncated keystroke notifies exactly once.
97
+ * READ-ONLY, as upstream declares it: a write is normalized back to the count derived from
98
+ * this entry's own {@link text} and so changes nothing (see the declaration). Not `readonly`
99
+ * in TypeScript, because the seam installs one accessor pair per declared property and this
100
+ * widget is what writes the derived value.
96
101
  */
97
- private _applyText;
98
- /** The editable text. */
99
- get text(): string;
100
- set text(value: string);
101
- /** The number of CHARACTERS in {@link text}, not UTF-16 units. */
102
- get textLength(): number;
103
- /** Maximum number of characters, `0` = unlimited. */
104
- get maxLength(): number;
105
- set maxLength(raw: number | string);
102
+ textLength: number;
103
+ /** `Gtk.Entry:max-length` — maximum number of characters, `0` = unlimited. */
104
+ maxLength: number;
106
105
  /** Placeholder shown while the entry is empty (`Gtk.Entry:placeholder-text`). */
107
- get placeholderText(): string;
108
- set placeholderText(value: string);
106
+ placeholderText: string;
109
107
  /** Whether the entry accepts edits (`GtkEditable:editable`). */
110
- get editable(): boolean;
111
- set editable(raw: boolean | string);
108
+ editable: boolean;
109
+ /** GJS's `notify('<prop>')` beside NativeScript's `notify({ eventName })`; see the seam. */
110
+ notify: GObjectNotify;
111
+ constructor(props?: ConstructProps<GtkEntry>);
112
+ /**
113
+ * What a `text` write does once the seam holds the normalized value: push the field, move
114
+ * the derived length, and emit in the MEASURED order.
115
+ *
116
+ * Writing the field re-enters through `textChange`, which writes this very value back; the
117
+ * seam's equal-write rule drops it, and that is what retired the old re-entrancy funnel.
118
+ * The origin is read BEFORE that write, because the handler it re-enters assigns `_typing`
119
+ * and the flag is no longer this call's once the field has been touched.
120
+ */
121
+ private _applyText;
122
+ /**
123
+ * What a `max-length` write does: re-run the held text against the new ceiling, so a
124
+ * SHRINKING limit truncates what is already there, and only then announce the limit —
125
+ * `changed`, `notify::text`, `notify::max-length`, as measured.
126
+ */
127
+ private _applyMaxLength;
128
+ /** `placeholder-text` reaches the field's hint and nothing else. */
129
+ private _applyPlaceholderText;
130
+ /** `editable` gates the keyboard only — see the declaration. */
131
+ private _applyEditable;
132
+ /** `gtk_editable_get_text`. */
133
+ get_text(): string;
134
+ /** `gtk_editable_set_text`. */
135
+ set_text(text: string): void;
136
+ /** `gtk_entry_get_max_length`. */
137
+ get_max_length(): number;
138
+ /** `gtk_entry_set_max_length`. */
139
+ set_max_length(max: number): void;
112
140
  /** The inner `TextField` — for focus, selection and host-specific keyboard options. */
113
141
  get field(): TextField;
114
142
  }
@@ -3,6 +3,23 @@ import { type LabelEllipsizeMode, type LabelJustification } from '@gjsify/adwait
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  /** Event name emitted when a link in the markup is tapped, before it is opened. */
5
5
  export declare const ACTIVATE_LINK = "activate-link";
6
+ /**
7
+ * `Gtk.Label:xalign` on a TEMPLATE CHILD — a plain `@nativescript/core` `Label` an Adw widget
8
+ * builds inside itself, standing in for a `<object class="GtkLabel">` in the upstream `.ui`.
9
+ *
10
+ * WHY IT EXISTS AND WHY IT IS NOT A NO-OP AT 0. The platform's own default is start-aligned, so
11
+ * `0` writes the word the view already had; the point is that the widget now STATES the alignment
12
+ * its upstream template states, instead of agreeing with it by accident. Upstream rows read
13
+ * left-aligned because `adw-action-row.ui` and its siblings each say `<property name="xalign">0`,
14
+ * not because GTK's default is 0 — it is 0.5 — and a port that leaves them implicit cannot be read
15
+ * against the `.ui` file that is its specification.
16
+ *
17
+ * START IS `'initial'`, NOT `'left'`: GTK's 0 is the START edge and mirrors in RTL, and `'initial'`
18
+ * is the platform's own direction-aware start. Only `0` and `0.5` are here, which is every value
19
+ * libadwaita's templates put on a label; `1` belongs to `adw-spin-row.ui`'s `GtkSpinButton`, an
20
+ * entry's `xalign` and not this one.
21
+ */
22
+ export declare function applyTemplateXalign(label: Label, xalign: 0 | 0.5): void;
6
23
  declare const GtkLabel_base: ((abstract new (...args: any[]) => {
7
24
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
8
25
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -204,6 +221,13 @@ export declare class GtkLabel extends GtkLabel_base {
204
221
  set_css_classes(names: readonly string[]): void;
205
222
  private _setClasses;
206
223
  private _render;
224
+ /**
225
+ * `TextBase._setNativeText` — the one place every text write ends in, and therefore the
226
+ * seam the native markup path draws at. Refused by every host but Android, which then
227
+ * leaves the framework's own `formattedText`/`text` implementation in charge:
228
+ * `label-markup-native.ts`.
229
+ */
230
+ _setNativeText(reset?: boolean): void;
207
231
  /**
208
232
  * `emit_activate_link` for the link at `index`: the user's handlers under GTK's handled
209
233
  * accumulator, then — only if none handled it — the default launch.
@@ -1,4 +1,4 @@
1
- import type { AdwMenuActions, AdwMenuInput, AdwMenuModel } from '@gjsify/adwaita-core';
1
+ import type { AdwMenuActions, AdwMenuModel } from '@gjsify/adwaita-core';
2
2
  import type { EventData } from '@nativescript/core';
3
3
  import { AdwImageButton } from './adw-image-button.js';
4
4
  import { type ConstructProps } from './construct-props.js';
@@ -20,7 +20,13 @@ export interface MenuItemActivatedEventData extends EventData {
20
20
  }
21
21
  export declare class GtkMenuButton extends AdwImageButton {
22
22
  static readonly GTypeName: string;
23
- private _model;
23
+ /**
24
+ * `Gtk.MenuButton` has NO identity guard on `menu-model` — measured: every write
25
+ * notifies, including the same model twice and `null` over `null`
26
+ * (`MENU_MODEL_NOTIFY_VECTORS`), which is the opposite of what `Adw.SplitButton` next
27
+ * door does. So the notify below is unconditional, and the slot does not gate it.
28
+ */
29
+ private readonly _slot;
24
30
  private _actions;
25
31
  private _menuTitle;
26
32
  private _primary;
@@ -29,20 +35,23 @@ export declare class GtkMenuButton extends AdwImageButton {
29
35
  private _styleClasses;
30
36
  constructor(props?: ConstructProps<GtkMenuButton>);
31
37
  /**
32
- * The menu, normalised (ADR 0042) — opened as an Android `PopupMenu` on tap.
38
+ * The menu — a real `Gio.MenuModel` since ADR 0128 — opened as an Android `PopupMenu`
39
+ * on tap. `null` is the one spelling of "no menu".
33
40
  *
34
- * Accepts every input form the portable model does, a bare `string[]` included —
35
- * but NOT a JSON string; see `AdwSplitButton.menuModel` for why the XML door stays
36
- * shut until a probe can prove it, and why being shut is not the same as being
37
- * silent.
41
+ * IT TAKES A MODEL AND NOTHING ELSE: `Gio.Menu` from this package's `Gio` namespace, or
42
+ * `buildMenu([…])` for the authored shorthands (a bare `string[]` included). An array
43
+ * written straight here is refused by the GObject value check, word for word as GJS
44
+ * refuses it. A JSON STRING is refused too, with its own message — see
45
+ * `AdwSplitButton.menuModel` for why the XML door stays shut until a probe can prove
46
+ * it, and why being shut is not the same as being silent.
38
47
  */
39
- get menuModel(): AdwMenuModel;
40
- set menuModel(value: AdwMenuInput);
48
+ get menuModel(): AdwMenuModel | null;
49
+ set menuModel(value: AdwMenuModel | null);
41
50
  /** `Gtk.MenuButton:menu-model` — the GIR spelling of {@link menuModel}. */
42
- get menu_model(): AdwMenuModel;
43
- set menu_model(value: AdwMenuInput);
44
- get_menu_model(): AdwMenuModel;
45
- set_menu_model(value: AdwMenuInput): void;
51
+ get menu_model(): AdwMenuModel | null;
52
+ set menu_model(value: AdwMenuModel | null);
53
+ get_menu_model(): AdwMenuModel | null;
54
+ set_menu_model(value: AdwMenuModel | null): void;
46
55
  /**
47
56
  * What the action group publishes about the actions this menu names — the portable
48
57
  * stand-in for a `GActionGroup`. Left `null`, the registry above the button answers
@@ -1,5 +1,5 @@
1
1
  import { Observable, type EventData } from '@nativescript/core';
2
- import type { AdwMenuActions, AdwMenuInput, AdwMenuModel } from '@gjsify/adwaita-core';
2
+ import type { AdwMenuActions, AdwMenuModel } from '@gjsify/adwaita-core';
3
3
  import type { ActionHost } from './actions.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  /** `GtkPopover::closed`, emitted when the menu goes away. */
@@ -71,16 +71,16 @@ declare const GtkPopoverMenu_base: ((abstract new (...args: any[]) => {
71
71
  }) & typeof Observable;
72
72
  export declare class GtkPopoverMenu extends GtkPopoverMenu_base {
73
73
  static readonly GTypeName: string;
74
- private _model;
74
+ private readonly _slot;
75
75
  private _actions;
76
76
  private _parent;
77
77
  private _open;
78
78
  constructor(props?: ConstructProps<GtkPopoverMenu>);
79
- /** `Gtk.PopoverMenu:menu-model`. */
80
- get menuModel(): AdwMenuModel;
81
- set menuModel(value: AdwMenuInput);
82
- set_menu_model(model: AdwMenuInput | null): void;
83
- get_menu_model(): AdwMenuModel;
79
+ /** `Gtk.PopoverMenu:menu-model` — a real `Gio.MenuModel`, or `null` (ADR 0128). */
80
+ get menuModel(): AdwMenuModel | null;
81
+ set menuModel(value: AdwMenuModel | null);
82
+ set_menu_model(model: AdwMenuModel | null): void;
83
+ get_menu_model(): AdwMenuModel | null;
84
84
  /** What the action group publishes about the actions this menu names; see `GtkMenuButton.actions`. */
85
85
  get actions(): AdwMenuActions | null;
86
86
  set actions(value: AdwMenuActions | null);
@@ -4,12 +4,10 @@ export { AdwActionRow } from './adw-action-row.js';
4
4
  export { AdwSwitchRow, NOTIFY_ACTIVE } from './adw-switch-row.js';
5
5
  export { AdwEntryRow, NOTIFY_TEXT, NOTIFY_TEXT_LENGTH, NOTIFY_MAX_LENGTH, NOTIFY_EDITABLE, NOTIFY_SHOW_APPLY_BUTTON, NOTIFY_ACTIVATES_DEFAULT, SIGNAL_APPLY, SIGNAL_ENTRY_ACTIVATED, } from './adw-entry-row.js';
6
6
  export { AdwPasswordEntryRow } from './adw-password-entry-row.js';
7
- export { GtkEntry, ACTIVATE as ENTRY_ACTIVATE, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT } from './gtk-entry.js';
8
- export type { NotifyEntryTextEventData } from './gtk-entry.js';
7
+ export { GtkEntry, ACTIVATE as ENTRY_ACTIVATE, CHANGED as ENTRY_CHANGED, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT, NOTIFY_TEXT_LENGTH as NOTIFY_ENTRY_TEXT_LENGTH, NOTIFY_MAX_LENGTH as NOTIFY_ENTRY_MAX_LENGTH, NOTIFY_PLACEHOLDER_TEXT, NOTIFY_EDITABLE as NOTIFY_ENTRY_EDITABLE, } from './gtk-entry.js';
9
8
  export { AdwComboRow, ComboState, NOTIFY_SELECTED } from './adw-combo-row.js';
10
- export type { AdwComboOption, ComboStateChange, ComboStateListener, NotifySelectedEventData } from './adw-combo-row.js';
9
+ export type { AdwComboOption, ComboStateChange, ComboStateListener } from './adw-combo-row.js';
11
10
  export { GtkDropDown, NOTIFY_SELECTED as NOTIFY_DROP_DOWN_SELECTED } from './gtk-drop-down.js';
12
- export type { NotifyDropDownSelectedEventData } from './gtk-drop-down.js';
13
11
  export { AdwSpinRow, NOTIFY_VALUE, SpinState } from './adw-spin-row.js';
14
12
  export type { NotifyValueEventData, SpinStateChange, SpinStateListener } from './adw-spin-row.js';
15
13
  export { AdwSliderRow, NOTIFY_SLIDER_VALUE } from './adw-slider-row.js';
@@ -0,0 +1,5 @@
1
+ import { type LabelMarkupNativeText } from './label-markup.js';
2
+ /** Rationale and contract: `label-markup-native.ts`. */
3
+ export declare function labelMarkupHoldNative(label: object, text: LabelMarkupNativeText | null): boolean;
4
+ /** Rationale and contract: `label-markup-native.ts`. */
5
+ export declare function labelMarkupDrawNative(label: object, reset: boolean): boolean;