@gjsify/adwaita-nativescript 0.64.13 → 0.64.15-next.287

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 (119) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/index.js +1 -1
  3. package/lib/esm/name-selector.js +1 -0
  4. package/lib/esm/namespace/gio.js +1 -1
  5. package/lib/esm/namespace/gtk.js +1 -1
  6. package/lib/esm/platform-host.js +1 -1
  7. package/lib/esm/widgets/adw-about-dialog.js +3 -3
  8. package/lib/esm/widgets/adw-action-row.js +1 -1
  9. package/lib/esm/widgets/adw-button-row.js +1 -1
  10. package/lib/esm/widgets/adw-entry-row.js +1 -1
  11. package/lib/esm/widgets/adw-image-button.js +1 -1
  12. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  13. package/lib/esm/widgets/adw-split-button.js +1 -1
  14. package/lib/esm/widgets/bin-layout.js +1 -0
  15. package/lib/esm/widgets/box-layout.js +1 -1
  16. package/lib/esm/widgets/css-names.js +1 -0
  17. package/lib/esm/widgets/gtk-box.js +1 -1
  18. package/lib/esm/widgets/gtk-button.js +1 -1
  19. package/lib/esm/widgets/gtk-check-button.js +1 -1
  20. package/lib/esm/widgets/gtk-entry.js +1 -1
  21. package/lib/esm/widgets/gtk-label.js +2 -2
  22. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  23. package/lib/esm/widgets/gtk-popover-menu.js +1 -1
  24. package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
  25. package/lib/esm/widgets/gtk-stack.js +1 -1
  26. package/lib/esm/widgets/index.js +1 -1
  27. package/lib/esm/widgets/label-markup-native.android.js +1 -0
  28. package/lib/esm/widgets/label-markup-native.ios.js +1 -0
  29. package/lib/esm/widgets/label-markup-native.js +1 -0
  30. package/lib/esm/widgets/label-markup.js +1 -1
  31. package/lib/esm/widgets/menu-slot.js +1 -0
  32. package/lib/esm/widgets/popup-menu-view.js +1 -1
  33. package/lib/esm/widgets/popup-menu.js +1 -1
  34. package/lib/esm/widgets/scrolled-window-policy.js +1 -1
  35. package/lib/esm/widgets/signals.js +1 -1
  36. package/lib/esm/widgets/single-child-base.js +1 -1
  37. package/lib/esm/widgets/single-child-cell.js +1 -1
  38. package/lib/esm/widgets/widget-layout.js +1 -1
  39. package/lib/types/button-bin.spec.d.ts +2 -0
  40. package/lib/types/css-names.spec.d.ts +1 -0
  41. package/lib/types/entry-properties.spec.d.ts +1 -0
  42. package/lib/types/index.d.ts +4 -2
  43. package/lib/types/menu-button-properties.spec.d.ts +2 -0
  44. package/lib/types/menu-model-door.spec.d.ts +1 -0
  45. package/lib/types/menu-model-route-d.node-gi.spec.d.ts +2 -0
  46. package/lib/types/name-selector.d.ts +20 -0
  47. package/lib/types/name-selector.spec.d.ts +2 -0
  48. package/lib/types/namespace/gio.d.ts +1 -1
  49. package/lib/types/template-xalign.spec.d.ts +2 -0
  50. package/lib/types/testing/ns-core.d.mts +30 -0
  51. package/lib/types/widgets/actions.d.ts +3 -3
  52. package/lib/types/widgets/adw-about-dialog.d.ts +2 -0
  53. package/lib/types/widgets/adw-action-row.d.ts +2 -0
  54. package/lib/types/widgets/adw-alert-dialog.d.ts +2 -0
  55. package/lib/types/widgets/adw-avatar.d.ts +2 -0
  56. package/lib/types/widgets/adw-banner.d.ts +2 -0
  57. package/lib/types/widgets/adw-bottom-sheet.d.ts +2 -0
  58. package/lib/types/widgets/adw-button-content.d.ts +2 -0
  59. package/lib/types/widgets/adw-carousel.d.ts +2 -0
  60. package/lib/types/widgets/adw-clamp.d.ts +2 -0
  61. package/lib/types/widgets/adw-data-grid.d.ts +2 -0
  62. package/lib/types/widgets/adw-header-bar.d.ts +2 -0
  63. package/lib/types/widgets/adw-image-button.d.ts +4 -2
  64. package/lib/types/widgets/adw-navigation-page.d.ts +2 -0
  65. package/lib/types/widgets/adw-navigation-view.d.ts +2 -0
  66. package/lib/types/widgets/adw-preferences-group.d.ts +2 -0
  67. package/lib/types/widgets/adw-preferences-page.d.ts +2 -0
  68. package/lib/types/widgets/adw-shortcut-label.d.ts +2 -0
  69. package/lib/types/widgets/adw-sidebar.d.ts +2 -0
  70. package/lib/types/widgets/adw-slider-row.d.ts +2 -0
  71. package/lib/types/widgets/adw-spinner.d.ts +2 -0
  72. package/lib/types/widgets/adw-split-button.d.ts +49 -24
  73. package/lib/types/widgets/adw-status-page.d.ts +2 -0
  74. package/lib/types/widgets/adw-tab-view.d.ts +2 -0
  75. package/lib/types/widgets/adw-toast-overlay.d.ts +2 -0
  76. package/lib/types/widgets/adw-toggle-group.d.ts +2 -0
  77. package/lib/types/widgets/adw-toggle.d.ts +2 -0
  78. package/lib/types/widgets/adw-toolbar-view.d.ts +2 -0
  79. package/lib/types/widgets/adw-view-stack.d.ts +2 -0
  80. package/lib/types/widgets/adw-view-switcher-bar.d.ts +2 -0
  81. package/lib/types/widgets/adw-window-title.d.ts +2 -0
  82. package/lib/types/widgets/adw-wrap-box.d.ts +2 -0
  83. package/lib/types/widgets/bin-layout.d.ts +12 -0
  84. package/lib/types/widgets/box-layout.d.ts +37 -0
  85. package/lib/types/widgets/carousel-indicator-base.d.ts +2 -0
  86. package/lib/types/widgets/css-names.d.ts +9 -0
  87. package/lib/types/widgets/gtk-action-bar.d.ts +2 -0
  88. package/lib/types/widgets/gtk-box.d.ts +11 -5
  89. package/lib/types/widgets/gtk-button.d.ts +8 -5
  90. package/lib/types/widgets/gtk-drop-down.d.ts +2 -0
  91. package/lib/types/widgets/gtk-entry.d.ts +64 -34
  92. package/lib/types/widgets/gtk-image.d.ts +2 -0
  93. package/lib/types/widgets/gtk-label.d.ts +26 -0
  94. package/lib/types/widgets/gtk-menu-button.d.ts +33 -18
  95. package/lib/types/widgets/gtk-popover-menu.d.ts +9 -7
  96. package/lib/types/widgets/gtk-scrolled-window.d.ts +9 -0
  97. package/lib/types/widgets/gtk-stack.d.ts +2 -0
  98. package/lib/types/widgets/gtk-text-view.d.ts +2 -0
  99. package/lib/types/widgets/index.d.ts +1 -2
  100. package/lib/types/widgets/label-markup-native.android.d.ts +5 -0
  101. package/lib/types/widgets/label-markup-native.d.ts +19 -0
  102. package/lib/types/widgets/label-markup-native.ios.d.ts +5 -0
  103. package/lib/types/widgets/label-markup.d.ts +62 -1
  104. package/lib/types/widgets/menu-slot.d.ts +51 -0
  105. package/lib/types/widgets/popup-menu-view.d.ts +3 -2
  106. package/lib/types/widgets/popup-menu.d.ts +8 -6
  107. package/lib/types/widgets/scrolled-window-policy.d.ts +4 -2
  108. package/lib/types/widgets/signals.d.ts +2 -0
  109. package/lib/types/widgets/single-child-base.d.ts +3 -0
  110. package/lib/types/widgets/single-child-cell.d.ts +10 -5
  111. package/lib/types/widgets/split-view-base.d.ts +2 -0
  112. package/lib/types/widgets/stack-page.d.ts +2 -0
  113. package/lib/types/widgets/styled-layout-base.d.ts +2 -0
  114. package/lib/types/widgets/view-stack-page.d.ts +2 -0
  115. package/lib/types/widgets/view-switcher-base.d.ts +2 -0
  116. package/lib/types/widgets/widget-layout.d.ts +2 -0
  117. package/package.json +20 -15
  118. package/src/testing/ns-core.mts +58 -0
  119. package/src/theme/adwaita.css +24 -11
@@ -17,6 +17,8 @@ declare const AdwDataGrid_base: ((abstract new (...args: any[]) => {
17
17
  emit(eventName: string, ...args: unknown[]): void;
18
18
  get_property(name: string): unknown;
19
19
  set_property(name: string, value: unknown): void;
20
+ get cssType(): string | undefined;
21
+ set cssType(value: string | undefined);
20
22
  get halign(): string;
21
23
  set halign(value: string | number);
22
24
  get valign(): string;
@@ -9,6 +9,8 @@ declare const AdwHeaderBar_base: ((abstract new (...args: any[]) => {
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get_property(name: string): unknown;
11
11
  set_property(name: string, value: unknown): void;
12
+ get cssType(): string | undefined;
13
+ set cssType(value: string | undefined);
12
14
  get halign(): string;
13
15
  set halign(value: string | number);
14
16
  get valign(): string;
@@ -1,4 +1,4 @@
1
- import { GridLayout, Image } from '@nativescript/core';
1
+ import { DockLayout, Image } from '@nativescript/core';
2
2
  import { type GtkIconSizeNick } from './gtk-icon-size.js';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  /**
@@ -19,6 +19,8 @@ declare const AdwImageButton_base: ((abstract new (...args: any[]) => {
19
19
  emit(eventName: string, ...args: unknown[]): void;
20
20
  get_property(name: string): unknown;
21
21
  set_property(name: string, value: unknown): void;
22
+ get cssType(): string | undefined;
23
+ set cssType(value: string | undefined);
22
24
  get halign(): string;
23
25
  set halign(value: string | number);
24
26
  get valign(): string;
@@ -75,7 +77,7 @@ declare const AdwImageButton_base: ((abstract new (...args: any[]) => {
75
77
  get(name: string): unknown;
76
78
  }) & {
77
79
  readonly emittedSignals: readonly string[];
78
- }) & typeof GridLayout;
80
+ }) & typeof DockLayout;
79
81
  export declare class AdwImageButton extends AdwImageButton_base {
80
82
  static readonly GTypeName: string;
81
83
  /** The centered icon image. */
@@ -15,6 +15,8 @@ declare const AdwNavigationPage_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -22,6 +22,8 @@ declare const AdwNavigationView_base: ((abstract new (...args: any[]) => {
22
22
  emit(eventName: string, ...args: unknown[]): void;
23
23
  get_property(name: string): unknown;
24
24
  set_property(name: string, value: unknown): void;
25
+ get cssType(): string | undefined;
26
+ set cssType(value: string | undefined);
25
27
  get halign(): string;
26
28
  set halign(value: string | number);
27
29
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwPreferencesGroup_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwPreferencesPage_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -8,6 +8,8 @@ declare const AdwShortcutLabel_base: ((abstract new (...args: any[]) => {
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get_property(name: string): unknown;
10
10
  set_property(name: string, value: unknown): void;
11
+ get cssType(): string | undefined;
12
+ set cssType(value: string | undefined);
11
13
  get halign(): string;
12
14
  set halign(value: string | number);
13
15
  get valign(): string;
@@ -34,6 +34,8 @@ declare const AdwSidebar_base: ((abstract new (...args: any[]) => {
34
34
  emit(eventName: string, ...args: unknown[]): void;
35
35
  get_property(name: string): unknown;
36
36
  set_property(name: string, value: unknown): void;
37
+ get cssType(): string | undefined;
38
+ set cssType(value: string | undefined);
37
39
  get halign(): string;
38
40
  set halign(value: string | number);
39
41
  get valign(): string;
@@ -16,6 +16,8 @@ declare const AdwSliderRow_base: ((abstract new (...args: any[]) => {
16
16
  emit(eventName: string, ...args: unknown[]): void;
17
17
  get_property(name: string): unknown;
18
18
  set_property(name: string, value: unknown): void;
19
+ get cssType(): string | undefined;
20
+ set cssType(value: string | undefined);
19
21
  get halign(): string;
20
22
  set halign(value: string | number);
21
23
  get valign(): string;
@@ -15,6 +15,8 @@ declare const AdwSpinner_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -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';
@@ -30,6 +30,8 @@ declare const AdwSplitButton_base: ((abstract new (...args: any[]) => {
30
30
  emit(eventName: string, ...args: unknown[]): void;
31
31
  get_property(name: string): unknown;
32
32
  set_property(name: string, value: unknown): void;
33
+ get cssType(): string | undefined;
34
+ set cssType(value: string | undefined);
33
35
  get halign(): string;
34
36
  set halign(value: string | number);
35
37
  get valign(): string;
@@ -110,6 +112,37 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
110
112
  * for what should be shown; a PopupMenu has no tooltip surface, so this is carried for parity.
111
113
  */
112
114
  dropdownTooltip: string;
115
+ /**
116
+ * The dropdown menu — a real `Gio.MenuModel` (ADR 0128), opened as a `PopupMenu` on an
117
+ * arrow tap.
118
+ *
119
+ * Accepts everything the portable model does, INCLUDING the bare `string[]` this
120
+ * widget used to be alone in taking: that shorthand is now one of the model's own
121
+ * input forms rather than a NativeScript-only shape, so the same value works on
122
+ * every surface.
123
+ *
124
+ * IT DOES NOT TAKE A JSON STRING, which the browser element's `menu-model`
125
+ * ATTRIBUTE does. Not an oversight: NativeScript's Builder writes an XML attribute
126
+ * straight onto the property, so accepting one here would open the XML door — and
127
+ * the gallery probe that would have to prove it compares a read-back by IDENTITY
128
+ * (`gallery-page.ts`), which no structured value can satisfy. An input form nothing
129
+ * can run is a claim, not a feature.
130
+ *
131
+ * AND IT SAYS SO. Left to the core's door a string would be PARSED, because that door
132
+ * is also the browser's `menu-model` attribute (ADR 0128 § 4) — so an XML author writing
133
+ * `menuModel="[…]"` would get a menu this port never promised to build from markup. A
134
+ * shut door that is silent is worse than one that is open, so the refusal names itself,
135
+ * from `normalize` and so on both legs alike.
136
+ *
137
+ * `null` IS THE ONE SPELLING OF "NO MENU" since ADR 0128: an empty `Gio.Menu` is a menu
138
+ * that happens to have no rows, and it keeps the dropdown live exactly as it does on
139
+ * GTK (measured, `MENU_MODEL_DOOR_VECTORS`).
140
+ *
141
+ * A CHANGE IS `notify::menu-model` through {@link connect}, not the NativeScript
142
+ * `menuModelChange` this property emitted while it was hand-rolled: the declaration
143
+ * moved it onto the seam, where every declared property has one GObject channel.
144
+ */
145
+ menuModel: AdwMenuModel | null;
113
146
  /** The main action part (column 0). */
114
147
  protected readonly _actionPart: StackLayout;
115
148
  /** The action label (shown in label mode). */
@@ -121,6 +154,12 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
121
154
  /** The direction arrow. */
122
155
  protected readonly _chevron: GtkImage;
123
156
  private readonly _state;
157
+ /**
158
+ * The menu this button holds, with its `items-changed` watcher. The STATE holds it too
159
+ * — `setMenuModel` is what drives `dropdownEnabled` and the notify order — and this
160
+ * holds the snapshot the popup is built from, which the state has no business knowing.
161
+ */
162
+ private readonly _slot;
124
163
  private _actions;
125
164
  /** Which of the two action views is currently parented. */
126
165
  private _showingIcon;
@@ -139,6 +178,15 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
139
178
  constructor(props?: ConstructProps<AdwSplitButton, {
140
179
  direction: number | SplitButtonDirection;
141
180
  }>);
181
+ /**
182
+ * Move the slot and the state onto the model the seam has just stored — the one hop every
183
+ * `menu-model` write takes, called from the declaration's `afterNotify` before it notifies.
184
+ *
185
+ * The slot snapshots and re-watches; the STATE is what drives `dropdownEnabled` and so the
186
+ * dropdown's dimming. `setMenuModel`'s own return value is ignored: the seam has already
187
+ * decided this write is a change, and the two guards are the same identity guard.
188
+ */
189
+ private _applyMenuModel;
142
190
  /**
143
191
  * Show the dropdown menu at the arrow half and dispatch the choice BY POSITION.
144
192
  *
@@ -152,29 +200,6 @@ export declare class AdwSplitButton extends AdwSplitButton_base {
152
200
  private _renderContent;
153
201
  /** Repaint the dropdown half and the dimming from the state machine. */
154
202
  private _render;
155
- /**
156
- * The dropdown menu, normalised (ADR 0042) — opened as a `PopupMenu` on an
157
- * arrow tap.
158
- *
159
- * Accepts everything the portable model does, INCLUDING the bare `string[]` this
160
- * widget used to be alone in taking: that shorthand is now one of the model's own
161
- * input forms rather than a NativeScript-only shape, so the same value works on
162
- * every surface.
163
- *
164
- * IT DOES NOT TAKE A JSON STRING, which the browser element's `menu-model`
165
- * ATTRIBUTE does. Not an oversight: NativeScript's Builder writes an XML attribute
166
- * straight onto the property, so accepting one here would open the XML door — and
167
- * the gallery probe that would have to prove it compares a read-back by IDENTITY
168
- * (`gallery-page.ts`), which no structured value can satisfy. An input form nothing
169
- * can run is a claim, not a feature.
170
- *
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.
175
- */
176
- get menuModel(): AdwMenuModel;
177
- set menuModel(value: AdwMenuInput);
178
203
  /**
179
204
  * What the action group publishes about the actions this menu names — the portable
180
205
  * stand-in for a `GActionGroup`, and the only source of a menu's enabled/checked
@@ -10,6 +10,8 @@ declare const AdwStatusPage_base: ((abstract new (...args: any[]) => {
10
10
  emit(eventName: string, ...args: unknown[]): void;
11
11
  get_property(name: string): unknown;
12
12
  set_property(name: string, value: unknown): void;
13
+ get cssType(): string | undefined;
14
+ set cssType(value: string | undefined);
13
15
  get halign(): string;
14
16
  set halign(value: string | number);
15
17
  get valign(): string;
@@ -31,6 +31,8 @@ declare const AdwTabView_base: ((abstract new (...args: any[]) => {
31
31
  emit(eventName: string, ...args: unknown[]): void;
32
32
  get_property(name: string): unknown;
33
33
  set_property(name: string, value: unknown): void;
34
+ get cssType(): string | undefined;
35
+ set cssType(value: string | undefined);
34
36
  get halign(): string;
35
37
  set halign(value: string | number);
36
38
  get valign(): string;
@@ -12,6 +12,8 @@ declare const AdwToastOverlay_base: ((abstract new (...args: any[]) => {
12
12
  emit(eventName: string, ...args: unknown[]): void;
13
13
  get_property(name: string): unknown;
14
14
  set_property(name: string, value: unknown): void;
15
+ get cssType(): string | undefined;
16
+ set cssType(value: string | undefined);
15
17
  get halign(): string;
16
18
  set halign(value: string | number);
17
19
  get valign(): string;
@@ -29,6 +29,8 @@ declare const AdwToggleGroup_base: ((abstract new (...args: any[]) => {
29
29
  emit(eventName: string, ...args: unknown[]): void;
30
30
  get_property(name: string): unknown;
31
31
  set_property(name: string, value: unknown): void;
32
+ get cssType(): string | undefined;
33
+ set cssType(value: string | undefined);
32
34
  get halign(): string;
33
35
  set halign(value: string | number);
34
36
  get valign(): string;
@@ -8,6 +8,8 @@ declare const AdwToggle_base: ((abstract new (...args: any[]) => {
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get_property(name: string): unknown;
10
10
  set_property(name: string, value: unknown): void;
11
+ get cssType(): string | undefined;
12
+ set cssType(value: string | undefined);
11
13
  get halign(): string;
12
14
  set halign(value: string | number);
13
15
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwToolbarView_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -23,6 +23,8 @@ declare const AdwViewStack_base: ((abstract new (...args: any[]) => {
23
23
  emit(eventName: string, ...args: unknown[]): void;
24
24
  get_property(name: string): unknown;
25
25
  set_property(name: string, value: unknown): void;
26
+ get cssType(): string | undefined;
27
+ set cssType(value: string | undefined);
26
28
  get halign(): string;
27
29
  set halign(value: string | number);
28
30
  get valign(): string;
@@ -10,6 +10,8 @@ declare const AdwViewSwitcherBar_base: ((abstract new (...args: any[]) => {
10
10
  emit(eventName: string, ...args: unknown[]): void;
11
11
  get_property(name: string): unknown;
12
12
  set_property(name: string, value: unknown): void;
13
+ get cssType(): string | undefined;
14
+ set cssType(value: string | undefined);
13
15
  get halign(): string;
14
16
  set halign(value: string | number);
15
17
  get valign(): string;
@@ -13,6 +13,8 @@ declare const AdwWindowTitle_base: ((abstract new (...args: any[]) => {
13
13
  emit(eventName: string, ...args: unknown[]): void;
14
14
  get_property(name: string): unknown;
15
15
  set_property(name: string, value: unknown): void;
16
+ get cssType(): string | undefined;
17
+ set cssType(value: string | undefined);
16
18
  get halign(): string;
17
19
  set halign(value: string | number);
18
20
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwWrapBox_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -0,0 +1,12 @@
1
+ import type { DockLayout, View } from '@nativescript/core';
2
+ /**
3
+ * Parent `view` as the single child of a bin-shaped `layout`, centred in whatever allocation
4
+ * that layout is given.
5
+ *
6
+ * `stretchLastChild` is WRITTEN rather than left to the platform default (`true`,
7
+ * `ui/layouts/dock-layout/dock-layout-common`), because it is the whole of what makes this a
8
+ * bin: with it the last — here only — child is laid out across the padding box of the real
9
+ * allocation. The two alignments are the child's half of the same statement, `Gtk.Align.CENTER`
10
+ * on both axes, which is what `gtk_widget_set_halign` / `set_valign` would say.
11
+ */
12
+ export declare function adoptIntoBin<T extends View>(layout: DockLayout, view: T): T;
@@ -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`.
@@ -9,6 +9,8 @@ declare const AdwCarouselIndicatorBase_base: ((abstract new (...args: any[]) =>
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get_property(name: string): unknown;
11
11
  set_property(name: string, value: unknown): void;
12
+ get cssType(): string | undefined;
13
+ set cssType(value: string | undefined);
12
14
  get halign(): string;
13
15
  set halign(value: string | number);
14
16
  get valign(): string;
@@ -0,0 +1,9 @@
1
+ export declare const GTK_CSS_NAMES: Readonly<Record<string, string>>;
2
+ /** The `cssType` a CSS node name is matched under, spelled as NativeScript's parser spells a selector. */
3
+ export declare function nsTypeSelector(cssName: string): string;
4
+ /**
5
+ * The `cssType` of a widget class: the nearest class in its chain that declares a `GTypeName`
6
+ * in {@link GTK_CSS_NAMES}. An application's `class Mine extends GtkBox` is a `box`, as a GTK
7
+ * subclass inherits its parent's CSS name; `undefined` when no ancestor is listed.
8
+ */
9
+ export declare function cssTypeOf(ctor: Function): string | undefined;
@@ -9,6 +9,8 @@ declare const GtkActionBar_base: ((abstract new (...args: any[]) => {
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get_property(name: string): unknown;
11
11
  set_property(name: string, value: unknown): void;
12
+ get cssType(): string | undefined;
13
+ set cssType(value: string | undefined);
12
14
  get halign(): string;
13
15
  set halign(value: string | number);
14
16
  get valign(): string;
@@ -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,4 +1,4 @@
1
- import { GridLayout, type View } from '@nativescript/core';
1
+ import { DockLayout, type View } from '@nativescript/core';
2
2
  import { type ConstructProps } from './construct-props.js';
3
3
  /** Event name emitted when the button is tapped. Mirrors `Gtk.Button::clicked`. */
4
4
  export declare const GTK_BUTTON_CLICKED = "clicked";
@@ -14,6 +14,8 @@ declare const GtkButton_base: ((abstract new (...args: any[]) => {
14
14
  emit(eventName: string, ...args: unknown[]): void;
15
15
  get_property(name: string): unknown;
16
16
  set_property(name: string, value: unknown): void;
17
+ get cssType(): string | undefined;
18
+ set cssType(value: string | undefined);
17
19
  get halign(): string;
18
20
  set halign(value: string | number);
19
21
  get valign(): string;
@@ -70,7 +72,7 @@ declare const GtkButton_base: ((abstract new (...args: any[]) => {
70
72
  get(name: string): unknown;
71
73
  }) & {
72
74
  readonly emittedSignals: readonly string[];
73
- }) & typeof GridLayout;
75
+ }) & typeof DockLayout;
74
76
  export declare class GtkButton extends GtkButton_base {
75
77
  static readonly GTypeName: string;
76
78
  /**
@@ -196,8 +198,9 @@ export declare class GtkButton extends GtkButton_base {
196
198
  * Put `value` in the single cell under `wrote`'s slot, detaching whatever the previous
197
199
  * slot had parented.
198
200
  *
199
- * The detach is the whole reason `button-slot.ts` exists: two views left in one
200
- * `GridLayout` cell paint on top of each other and nothing complains.
201
+ * The detach is the whole reason `button-slot.ts` exists: two views left in one bin
202
+ * paint on top of each other and nothing complains. It is also what keeps the content
203
+ * the LAST child, which is the one `DockLayout` stretches.
201
204
  */
202
205
  private _fill;
203
206
  /**
@@ -212,7 +215,7 @@ export declare class GtkButton extends GtkButton_base {
212
215
  */
213
216
  private _inOsdContainer;
214
217
  private _detach;
215
- /** Parent `view` in the single cell, centred, and remember it as the content. */
218
+ /** Parent `view` as the bin's one child, centred, and remember it as the content. */
216
219
  private _adopt;
217
220
  }
218
221
  export {};
@@ -15,6 +15,8 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;