@gjsify/adwaita-nativescript 0.51.1 → 0.53.0

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 (138) hide show
  1. package/lib/esm/builder/index.js +1 -0
  2. package/lib/esm/index.js +1 -1
  3. package/lib/esm/namespace/adw.js +1 -1
  4. package/lib/esm/namespace/gio.js +1 -0
  5. package/lib/esm/namespace/gtk.js +1 -1
  6. package/lib/esm/values/sidebar.js +1 -0
  7. package/lib/esm/values/tab-page.js +1 -0
  8. package/lib/esm/widgets/adw-action-row.js +1 -1
  9. package/lib/esm/widgets/adw-alert-dialog.js +1 -1
  10. package/lib/esm/widgets/adw-avatar.js +1 -1
  11. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  12. package/lib/esm/widgets/adw-button-row.js +1 -1
  13. package/lib/esm/widgets/adw-carousel-indicator-dots.js +1 -0
  14. package/lib/esm/widgets/adw-carousel-indicator-lines.js +1 -0
  15. package/lib/esm/widgets/adw-carousel.js +1 -1
  16. package/lib/esm/widgets/adw-clamp.js +1 -1
  17. package/lib/esm/widgets/adw-combo-row.js +1 -1
  18. package/lib/esm/widgets/adw-expander-row.js +1 -1
  19. package/lib/esm/widgets/adw-header-bar.js +1 -1
  20. package/lib/esm/widgets/adw-navigation-page.js +1 -0
  21. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  22. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  23. package/lib/esm/widgets/adw-shortcut-label.js +1 -1
  24. package/lib/esm/widgets/adw-sidebar.js +1 -1
  25. package/lib/esm/widgets/adw-spin-row.js +1 -1
  26. package/lib/esm/widgets/adw-status-page.js +1 -1
  27. package/lib/esm/widgets/adw-tab-view.js +1 -1
  28. package/lib/esm/widgets/adw-toast-overlay.js +1 -1
  29. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  30. package/lib/esm/widgets/adw-toggle.js +1 -0
  31. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  32. package/lib/esm/widgets/adw-view-stack.js +1 -1
  33. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  34. package/lib/esm/widgets/bottom-sheet-state.js +1 -1
  35. package/lib/esm/widgets/box-layout.js +1 -1
  36. package/lib/esm/widgets/builder-slots.js +1 -1
  37. package/lib/esm/widgets/carousel-indicator-base.js +1 -0
  38. package/lib/esm/widgets/carousel-state.js +1 -1
  39. package/lib/esm/widgets/chrome.js +1 -1
  40. package/lib/esm/widgets/gtk-action-bar.js +1 -0
  41. package/lib/esm/widgets/gtk-box.js +1 -1
  42. package/lib/esm/widgets/gtk-button.js +1 -1
  43. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  44. package/lib/esm/widgets/gtk-label.js +1 -1
  45. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  46. package/lib/esm/widgets/icon-theme.js +1 -1
  47. package/lib/esm/widgets/id-reference.js +1 -0
  48. package/lib/esm/widgets/index.js +1 -1
  49. package/lib/esm/widgets/signals.js +1 -1
  50. package/lib/esm/widgets/split-view-base.js +1 -1
  51. package/lib/esm/widgets/view-stack-page.js +1 -0
  52. package/lib/esm/widgets/view-switcher-base.js +1 -1
  53. package/lib/esm/widgets/widget-layout.js +1 -0
  54. package/lib/types/blueprint-markup.spec.d.ts +4 -0
  55. package/lib/types/blueprint-trees.spec.d.ts +1 -0
  56. package/lib/types/builder/index.d.ts +70 -0
  57. package/lib/types/clamp-child.spec.d.ts +2 -0
  58. package/lib/types/gallery-blueprints.spec.d.ts +1 -0
  59. package/lib/types/gtk-value-doors.spec.d.ts +1 -0
  60. package/lib/types/index.d.ts +2 -1
  61. package/lib/types/namespace/adw.d.ts +8 -0
  62. package/lib/types/namespace/gio.d.ts +1 -0
  63. package/lib/types/namespace/gtk.d.ts +3 -0
  64. package/lib/types/shared-trees.spec.d.ts +2 -0
  65. package/lib/types/testing/ns-core.d.mts +340 -0
  66. package/lib/types/value-lists.spec.d.ts +1 -0
  67. package/lib/types/values/sidebar.d.ts +46 -0
  68. package/lib/types/values/tab-page.d.ts +16 -0
  69. package/lib/types/view-switcher-stack.spec.d.ts +1 -0
  70. package/lib/types/widgets/adw-about-dialog.d.ts +12 -0
  71. package/lib/types/widgets/adw-action-row.d.ts +22 -0
  72. package/lib/types/widgets/adw-alert-dialog.d.ts +18 -1
  73. package/lib/types/widgets/adw-avatar.d.ts +12 -0
  74. package/lib/types/widgets/adw-banner.d.ts +12 -0
  75. package/lib/types/widgets/adw-bottom-sheet.d.ts +77 -6
  76. package/lib/types/widgets/adw-button-content.d.ts +12 -0
  77. package/lib/types/widgets/adw-button-row.d.ts +21 -0
  78. package/lib/types/widgets/adw-carousel-indicator-dots.d.ts +7 -0
  79. package/lib/types/widgets/adw-carousel-indicator-lines.d.ts +7 -0
  80. package/lib/types/widgets/adw-carousel.d.ts +31 -15
  81. package/lib/types/widgets/adw-clamp.d.ts +19 -0
  82. package/lib/types/widgets/adw-combo-row.d.ts +20 -1
  83. package/lib/types/widgets/adw-data-grid.d.ts +12 -0
  84. package/lib/types/widgets/adw-expander-row.d.ts +2 -0
  85. package/lib/types/widgets/adw-header-bar.d.ts +14 -0
  86. package/lib/types/widgets/adw-image-button.d.ts +12 -0
  87. package/lib/types/widgets/adw-navigation-page.d.ts +63 -0
  88. package/lib/types/widgets/adw-navigation-view.d.ts +18 -5
  89. package/lib/types/widgets/adw-preferences-dialog.d.ts +12 -0
  90. package/lib/types/widgets/adw-preferences-group.d.ts +14 -0
  91. package/lib/types/widgets/adw-preferences-page.d.ts +12 -0
  92. package/lib/types/widgets/adw-shortcut-label.d.ts +12 -0
  93. package/lib/types/widgets/adw-sidebar.d.ts +26 -0
  94. package/lib/types/widgets/adw-slider-row.d.ts +12 -0
  95. package/lib/types/widgets/adw-spin-row.d.ts +12 -1
  96. package/lib/types/widgets/adw-spinner.d.ts +12 -0
  97. package/lib/types/widgets/adw-split-button.d.ts +12 -0
  98. package/lib/types/widgets/adw-status-page.d.ts +46 -0
  99. package/lib/types/widgets/adw-tab-view.d.ts +60 -27
  100. package/lib/types/widgets/adw-toast-overlay.d.ts +20 -0
  101. package/lib/types/widgets/adw-toggle-group.d.ts +51 -3
  102. package/lib/types/widgets/adw-toggle.d.ts +41 -0
  103. package/lib/types/widgets/adw-toolbar-view.d.ts +22 -1
  104. package/lib/types/widgets/adw-view-stack.d.ts +53 -7
  105. package/lib/types/widgets/adw-view-switcher-bar.d.ts +19 -2
  106. package/lib/types/widgets/adw-window-title.d.ts +12 -0
  107. package/lib/types/widgets/adw-wrap-box.d.ts +12 -0
  108. package/lib/types/widgets/avatar-view.d.ts +1 -1
  109. package/lib/types/widgets/bottom-sheet-state.d.ts +40 -7
  110. package/lib/types/widgets/box-layout.d.ts +3 -17
  111. package/lib/types/widgets/builder-slots.d.ts +48 -0
  112. package/lib/types/widgets/button-content.d.ts +4 -3
  113. package/lib/types/widgets/carousel-indicator-base.d.ts +54 -0
  114. package/lib/types/widgets/carousel-state.d.ts +12 -9
  115. package/lib/types/widgets/chrome.d.ts +32 -6
  116. package/lib/types/widgets/construct-props.d.ts +46 -5
  117. package/lib/types/widgets/gtk-action-bar.d.ts +53 -0
  118. package/lib/types/widgets/gtk-box.d.ts +12 -0
  119. package/lib/types/widgets/gtk-button.d.ts +27 -0
  120. package/lib/types/widgets/gtk-drop-down.d.ts +23 -1
  121. package/lib/types/widgets/gtk-entry.d.ts +12 -0
  122. package/lib/types/widgets/gtk-image.d.ts +12 -0
  123. package/lib/types/widgets/gtk-label.d.ts +47 -1
  124. package/lib/types/widgets/gtk-menu-button.d.ts +22 -0
  125. package/lib/types/widgets/id-reference.d.ts +13 -0
  126. package/lib/types/widgets/index.d.ts +16 -5
  127. package/lib/types/widgets/signals.d.ts +14 -1
  128. package/lib/types/widgets/split-view-base.d.ts +26 -2
  129. package/lib/types/widgets/tab-view-state.d.ts +3 -3
  130. package/lib/types/widgets/view-stack-page.d.ts +98 -0
  131. package/lib/types/widgets/view-stack-state.d.ts +7 -3
  132. package/lib/types/widgets/view-switcher-base.d.ts +62 -0
  133. package/lib/types/widgets/widget-layout.d.ts +50 -0
  134. package/package.json +21 -11
  135. package/src/theme/adwaita.css +123 -2
  136. package/lib/esm/widgets/label-text.js +0 -1
  137. package/lib/types/widgets/label-text.d.ts +0 -13
  138. /package/lib/types/{label-text.spec.d.ts → gio-menu.spec.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { View } from '@nativescript/core';
2
2
  import { GridLayout, StackLayout } from '@nativescript/core';
3
- import type { BottomSheetCloseOutcome, BottomSheetCloseSource } from '@gjsify/adwaita-core';
3
+ import type { BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetOpenOutcome, BottomSheetOpenSource } from '@gjsify/adwaita-core';
4
4
  import { CLOSE_ATTEMPT, NOTIFY_OPEN, SHEET_CLOSE, type NotifyOpenEventData } from './bottom-sheet-state.js';
5
5
  import { type ConstructProps } from './construct-props.js';
6
6
  export { CLOSE_ATTEMPT, NOTIFY_OPEN, SHEET_CLOSE };
@@ -8,6 +8,18 @@ export type { NotifyOpenEventData };
8
8
  declare const AdwBottomSheet_base: (abstract new (...args: any[]) => {
9
9
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
10
10
  disconnect(handlerId: number): void;
11
+ get halign(): string;
12
+ set halign(value: string | number);
13
+ get valign(): string;
14
+ set valign(value: string | number);
15
+ get hexpand(): boolean;
16
+ set hexpand(value: boolean | string);
17
+ get vexpand(): boolean;
18
+ set vexpand(value: boolean | string);
19
+ get marginStart(): number;
20
+ set marginStart(value: number | string);
21
+ get marginEnd(): number;
22
+ set marginEnd(value: number | string);
11
23
  _emit(eventName: string): void;
12
24
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
13
25
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -17,23 +29,43 @@ declare const AdwBottomSheet_base: (abstract new (...args: any[]) => {
17
29
  get(name: string): unknown;
18
30
  }) & typeof GridLayout;
19
31
  export declare class AdwBottomSheet extends AdwBottomSheet_base {
32
+ /** The names this widget's `_addChildFromBuilder` honours — see `./builder-slots.ts`. */
33
+ static readonly builderSlots: readonly string[];
20
34
  /** The always-visible content layer. */
21
35
  private _content;
22
- /** The bottom sheet panel wrapper (drag handle + sheet child). */
36
+ /** The scrim over the content while a modal sheet is open — libadwaita's `dimming`. */
37
+ private readonly _dimming;
38
+ /** The bottom-anchored bin holding both layers — libadwaita's `sheet_bin`. */
23
39
  protected readonly _sheetPanel: StackLayout;
40
+ /** The sheet page inside the bin: drag handle + sheet child. */
41
+ private readonly _sheetPage;
42
+ /** The bottom-bar bin — the bin's other layer, tapped to open the sheet. */
43
+ private readonly _bottomBarBin;
24
44
  private _sheetChild;
45
+ private _bottomBar;
25
46
  /** The shared open/can-close model — the single source of truth for both. */
26
47
  private readonly _state;
27
48
  constructor(props?: ConstructProps<AdwBottomSheet>);
49
+ /** Push the current chrome onto the three views — the widget's whole rendering step. */
50
+ private _paintChrome;
28
51
  /** Set (or replace) the always-visible content layer (painted under the sheet) — `adw_bottom_sheet_set_content`. */
29
52
  set_content(view: View | null): void;
30
53
  /** Set (or replace) the sheet panel's child (shown when open) — `adw_bottom_sheet_set_sheet`. */
31
54
  set_sheet(view: View | null): void;
32
55
  /**
33
- * An XML child asks for the sheet or for the content, and a bare one is CONTENT —
34
- * the always-visible layer, which is what a sheet with nothing behind it would be
35
- * missing. `LayoutBase`'s inherited default would put either into the grid
36
- * alongside the sheet panel, where it neither paints under the sheet nor moves
56
+ * Set (or replace) the bottom bar — `adw_bottom_sheet_set_bottom_bar`, shown in the
57
+ * sheet's place while it is closed.
58
+ *
59
+ * Presence is an INPUT to the open gate, not decoration: taking the bar away takes every
60
+ * on-device way of opening this sheet with it, which is why the state hears about it
61
+ * (upstream re-runs `update_swipe_tracker` from the same setter, adw-bottom-sheet.c:1629).
62
+ */
63
+ set_bottom_bar(view: View | null): void;
64
+ /**
65
+ * An XML child asks for the sheet, the bottom bar or the content, and a bare one is
66
+ * CONTENT — the always-visible layer, which is what a sheet with nothing behind it
67
+ * would be missing. `LayoutBase`'s inherited default would put any of them into the
68
+ * grid alongside the sheet panel, where it neither paints under the sheet nor moves
37
69
  * with it.
38
70
  */
39
71
  _addChildFromBuilder(name: string, view: View): void;
@@ -45,8 +77,20 @@ export declare class AdwBottomSheet extends AdwBottomSheet_base {
45
77
  * child it declared actually went.
46
78
  */
47
79
  get content(): View | null;
80
+ /**
81
+ * `Adw.BottomSheet:content` — {@link set_content} under the property spelling the
82
+ * counterpart declares, so a construct-props bag can carry the pane and a snippet
83
+ * ported off GJS keeps the assignment it was written as.
84
+ */
85
+ set content(view: View | null);
48
86
  /** The sheet panel's child, or `null` — the read-back for `set_sheet`. */
49
87
  get sheet(): View | null;
88
+ /** `Adw.BottomSheet:sheet` — {@link set_sheet} under the counterpart's spelling. */
89
+ set sheet(view: View | null);
90
+ /** The bottom bar's child, or `null` — the read-back for `set_bottom_bar`. */
91
+ get bottomBar(): View | null;
92
+ /** `Adw.BottomSheet:bottom-bar` — {@link set_bottom_bar} under the counterpart's spelling. */
93
+ set bottomBar(view: View | null);
50
94
  /**
51
95
  * Whether the sheet is open (`AdwBottomSheet:open`). Toggling shows/hides the panel
52
96
  * and emits `notify::open`.
@@ -61,12 +105,31 @@ export declare class AdwBottomSheet extends AdwBottomSheet_base {
61
105
  */
62
106
  get open(): boolean;
63
107
  set open(value: boolean | string);
108
+ /**
109
+ * Whether the sheet dims the content and blocks it while open (`AdwBottomSheet:modal`,
110
+ * default `true`). Changing it on an open sheet adds or removes the scrim at once, as
111
+ * `adw_bottom_sheet_set_modal` does; `open` does not move.
112
+ */
113
+ get modal(): boolean;
114
+ set modal(raw: boolean | string);
64
115
  /**
65
116
  * Whether the user may dismiss the sheet (`AdwBottomSheet:can-close`). When
66
117
  * off, a refused dismissal emits `close-attempt` instead of closing.
67
118
  */
68
119
  get canClose(): boolean;
69
120
  set canClose(raw: boolean | string);
121
+ /**
122
+ * Whether the user may open the sheet from its bottom bar (`AdwBottomSheet:can-open`).
123
+ *
124
+ * Off, the bar STAYS on screen and only gains the inert marker: libadwaita refuses the
125
+ * click in the handler rather than disabling the button (adw-bottom-sheet.c:2031-2038).
126
+ * There is no `open-attempt` signal to answer with, so a refused tap is silent.
127
+ */
128
+ get canOpen(): boolean;
129
+ set canOpen(raw: boolean | string);
130
+ /** Whether the bottom bar is shown while the sheet is closed (`AdwBottomSheet:reveal-bottom-bar`). */
131
+ get revealBottomBar(): boolean;
132
+ set revealBottomBar(raw: boolean | string);
70
133
  /**
71
134
  * Route a dismissal affordance through the shared gate and act on the
72
135
  * verdict: close, emit `close-attempt`, emit `sheet.close` for the host to
@@ -78,4 +141,12 @@ export declare class AdwBottomSheet extends AdwBottomSheet_base {
78
141
  * `requestClose('close-button')`.
79
142
  */
80
143
  requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
144
+ /**
145
+ * Route an open affordance through the shared gate — the bar's own tap goes through
146
+ * here, and a host with a gesture of its own passes `'swipe'`.
147
+ *
148
+ * Unlike {@link requestClose} there is nothing to emit on a refusal: libadwaita has no
149
+ * `open-attempt` counterpart to `close-attempt`, so `'ignored'` is silent.
150
+ */
151
+ requestOpen(source: BottomSheetOpenSource): BottomSheetOpenOutcome;
81
152
  }
@@ -5,6 +5,18 @@ import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwButtonContent_base: (abstract new (...args: any[]) => {
6
6
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
7
  disconnect(handlerId: number): void;
8
+ get halign(): string;
9
+ set halign(value: string | number);
10
+ get valign(): string;
11
+ set valign(value: string | number);
12
+ get hexpand(): boolean;
13
+ set hexpand(value: boolean | string);
14
+ get vexpand(): boolean;
15
+ set vexpand(value: boolean | string);
16
+ get marginStart(): number;
17
+ set marginStart(value: number | string);
18
+ get marginEnd(): number;
19
+ set marginEnd(value: number | string);
8
20
  _emit(eventName: string): void;
9
21
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
10
22
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -27,7 +27,28 @@ export declare class AdwButtonRow extends AdwActionRow {
27
27
  * second state object would give one label two sources of truth.
28
28
  */
29
29
  private readonly _buttonState;
30
+ private _styleClasses;
30
31
  constructor(props?: ConstructProps<AdwButtonRow>);
32
+ /**
33
+ * `GtkWidget:css-classes`, spelled `styleClasses` for the reason `style-classes.ts`
34
+ * gives. The Adwaita page documents a button row by its style classes
35
+ * (`.suggested-action`, `.destructive-action`), and a `.blp` writes them as
36
+ * `styles [...]`; the shared-tree builder refuses a style class the widget has no door
37
+ * for, so without this the gallery's button-row `.blp` did not build here.
38
+ */
39
+ get styleClasses(): string[];
40
+ set styleClasses(value: string | null | undefined);
41
+ /** `gtk_widget_add_css_class`. A class the row already carries is a no-op. */
42
+ add_css_class(name: string): void;
43
+ /** `gtk_widget_remove_css_class`. A class it does not carry is a no-op. */
44
+ remove_css_class(name: string): void;
45
+ /** `gtk_widget_has_css_class`. */
46
+ has_css_class(name: string): boolean;
47
+ /** `gtk_widget_get_css_classes` — the list, without the row's own classes. */
48
+ get_css_classes(): string[];
49
+ /** `gtk_widget_set_css_classes` — REPLACES the list, as in C. */
50
+ set_css_classes(names: readonly string[]): void;
51
+ private _setClasses;
31
52
  /** A centered symbolic icon, collapsed until it has content. Its fill is set by
32
53
  * {@link _applyIconColor}, which is also what follows an accent change. */
33
54
  private static _makeIcon;
@@ -0,0 +1,7 @@
1
+ import { AdwCarouselIndicatorBase } from './carousel-indicator-base.js';
2
+ import { type ConstructProps } from './construct-props.js';
3
+ export declare class AdwCarouselIndicatorDots extends AdwCarouselIndicatorBase {
4
+ protected readonly _markerClass = "adw-carousel-dot";
5
+ protected readonly _markerText = "\u25CF";
6
+ constructor(props?: ConstructProps<AdwCarouselIndicatorDots>);
7
+ }
@@ -0,0 +1,7 @@
1
+ import { AdwCarouselIndicatorBase } from './carousel-indicator-base.js';
2
+ import { type ConstructProps } from './construct-props.js';
3
+ export declare class AdwCarouselIndicatorLines extends AdwCarouselIndicatorBase {
4
+ protected readonly _markerClass = "adw-carousel-line";
5
+ protected readonly _markerText = "";
6
+ constructor(props?: ConstructProps<AdwCarouselIndicatorLines>);
7
+ }
@@ -20,6 +20,18 @@ export interface PageChangedEventData extends EventData {
20
20
  declare const AdwCarousel_base: (abstract new (...args: any[]) => {
21
21
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
22
22
  disconnect(handlerId: number): void;
23
+ get halign(): string;
24
+ set halign(value: string | number);
25
+ get valign(): string;
26
+ set valign(value: string | number);
27
+ get hexpand(): boolean;
28
+ set hexpand(value: boolean | string);
29
+ get vexpand(): boolean;
30
+ set vexpand(value: boolean | string);
31
+ get marginStart(): number;
32
+ set marginStart(value: number | string);
33
+ get marginEnd(): number;
34
+ set marginEnd(value: number | string);
23
35
  _emit(eventName: string): void;
24
36
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
25
37
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -33,14 +45,10 @@ export declare class AdwCarousel extends AdwCarousel_base {
33
45
  protected readonly _scroller: ScrollView;
34
46
  /** The horizontal track inside the scroller (holds fixed-width pages). */
35
47
  protected readonly _track: StackLayout;
36
- /** The dot-indicator row. */
37
- protected readonly _dots: StackLayout;
38
48
  private readonly _state;
39
49
  private readonly _sync;
40
50
  /** Page id → its content view, so a DOM-free model can still be projected. */
41
51
  private readonly _views;
42
- /** Page id → its dot. Keyed by ID, not by index: an insert or a reorder renumbers every page after it. */
43
- private readonly _dotsById;
44
52
  private _nextPageId;
45
53
  private _pageWidth;
46
54
  constructor(props?: ConstructProps<AdwCarousel>);
@@ -51,8 +59,8 @@ export declare class AdwCarousel extends AdwCarousel_base {
51
59
  *
52
60
  * The name is ignored: a carousel has one kind of child. Without this,
53
61
  * `LayoutBase`'s default puts the view straight into the grid the carousel builds
54
- * its scroller and dots in — on top of the track rather than on it, and the page
55
- * never gets a width, a `adw-carousel-page` class or a dot.
62
+ * its scroller in — on top of the track rather than on it, and the page never gets
63
+ * a width or a `adw-carousel-page` class.
56
64
  */
57
65
  _addChildFromBuilder(_name: string, view: View): void;
58
66
  /**
@@ -65,12 +73,15 @@ export declare class AdwCarousel extends AdwCarousel_base {
65
73
  /** Move a page — `adw_carousel_reorder` (adw-carousel.c:1419-1499). */
66
74
  reorder(view: View, position: number): boolean;
67
75
  /**
68
- * Scroll to a page by index. Out-of-range, fractional and NaN indices are
69
- * refused rather than clamped, matching `adw_carousel_get_nth_page`'s
70
- * precondition (adw-carousel.c:1616) — `scrollToPage(NaN)` used to set the
71
- * position to NaN and leave no dot selected.
76
+ * Scroll to a page — `adw_carousel_scroll_to` (adw-carousel.c:1600-1640).
77
+ *
78
+ * Takes the PAGE, as its siblings `insert`, `remove` and `reorder` already do, and
79
+ * resolves it through the same `_idOf` they use; a view this carousel does not hold
80
+ * is refused, which is C's precondition — and it is what a bound indicator calls
81
+ * with `pages[i]` when a marker is tapped, as `adw-carousel-indicator-dots.c` does.
82
+ * The INDEX door is {@link position}.
72
83
  */
73
- scrollToPage(index: number): void;
84
+ scroll_to(page: View): void;
74
85
  /** One keynav step — `navigate_to_direction` (adw-carousel.c:475-508). */
75
86
  navigate(direction: 'back' | 'forward'): boolean;
76
87
  /** The pages on the track, in order — the read-back for `append`/`insert`. */
@@ -95,21 +106,26 @@ export declare class AdwCarousel extends AdwCarousel_base {
95
106
  set interactive(raw: boolean | string);
96
107
  /**
97
108
  * The per-page width in DIPs used for scroll-offset math. Set this to the
98
- * carousel's on-screen width so `scrollToPage` lands cleanly. Re-applies to
109
+ * carousel's on-screen width so `scroll_to` lands cleanly. Re-applies to
99
110
  * all existing pages.
100
111
  */
101
112
  get pageWidth(): number;
102
113
  set pageWidth(raw: number | string);
103
114
  /** The px pitch between two page origins — `self->distance` (adw-carousel.c:767). */
104
115
  private _distance;
116
+ /**
117
+ * Scroll to a page by index. Out-of-range, fractional and NaN indices are
118
+ * refused rather than clamped, matching `adw_carousel_get_nth_page`'s
119
+ * precondition (adw-carousel.c:1616) — an index of NaN used to set the
120
+ * position to NaN and leave no dot selected.
121
+ */
122
+ private _scrollToIndex;
105
123
  /** The state's id for a page view, or `null` when it is not one of ours. */
106
124
  private _idOf;
107
125
  /** Run the scroll the state asked for. */
108
126
  private _performScroll;
109
- /** The dots in page order — the order `applyCarouselDots` indexes by. */
110
- private _orderedDots;
111
127
  /**
112
- * Make both native child lists match the model order.
128
+ * Make the track's child list match the model order.
113
129
  *
114
130
  * Detach-then-reattach rather than a positional patch: NS has no "move
115
131
  * child", `insertChild` on an already-parented view double-parents it, and
@@ -6,6 +6,18 @@ export { DEFAULT_CLAMP_MAX_SIZE, DEFAULT_CLAMP_TIGHTENING_THRESHOLD };
6
6
  declare const AdwClamp_base: (abstract new (...args: any[]) => {
7
7
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
8
8
  disconnect(handlerId: number): void;
9
+ get halign(): string;
10
+ set halign(value: string | number);
11
+ get valign(): string;
12
+ set valign(value: string | number);
13
+ get hexpand(): boolean;
14
+ set hexpand(value: boolean | string);
15
+ get vexpand(): boolean;
16
+ set vexpand(value: boolean | string);
17
+ get marginStart(): number;
18
+ set marginStart(value: number | string);
19
+ get marginEnd(): number;
20
+ set marginEnd(value: number | string);
9
21
  _emit(eventName: string): void;
10
22
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
11
23
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -15,6 +27,13 @@ declare const AdwClamp_base: (abstract new (...args: any[]) => {
15
27
  get(name: string): unknown;
16
28
  }) & typeof GridLayout;
17
29
  export declare class AdwClamp extends AdwClamp_base {
30
+ /**
31
+ * The names this widget's `_addChildFromBuilder` honours — see `./builder-slots.ts`.
32
+ * `Adw.Clamp:child` is this widget's own property name, and its fallback: an authored
33
+ * `child: …` and a bare child mean the same thing, the shape `_addChildFromBuilder`
34
+ * below already has.
35
+ */
36
+ static readonly builderSlots: readonly string[];
18
37
  private _props;
19
38
  private _child;
20
39
  /** The container width the child was last clamped against, in DIPs. */
@@ -1,4 +1,4 @@
1
- import { Label, type EventData } from '@nativescript/core';
1
+ import { Label, type EventData, type View } from '@nativescript/core';
2
2
  import type { AdwComboOption, AdwListModelInput } from '@gjsify/adwaita-core';
3
3
  import { AdwActionRow } from './adw-action-row.js';
4
4
  import { GtkImage } from './gtk-image.js';
@@ -15,12 +15,25 @@ export interface NotifySelectedEventData extends EventData {
15
15
  value: string;
16
16
  }
17
17
  export declare class AdwComboRow extends AdwActionRow {
18
+ /**
19
+ * The action row's edges, plus `model`: `model: Gtk.StringList { strings [ … ] }` in a
20
+ * `.blp` places the list at the property it sets (ADR 0072).
21
+ */
22
+ static readonly builderSlots: readonly string[];
18
23
  /** The dim inline value label (selected option). */
19
24
  protected readonly _valueLabel: Label;
20
25
  /** The down-chevron — a real Adwaita `pan-down-symbolic` icon. */
21
26
  protected readonly _chevron: GtkImage;
22
27
  /** The headless options list + selectedIndex↔selectedValue state machine (ADR 0004). */
23
28
  private readonly _state;
29
+ /**
30
+ * A `selected` written while the row has no model yet. NativeScript's XML builder assigns
31
+ * every attribute before it adds the children, so `<adw:ComboRow selected="1">` reaches
32
+ * this setter before its `<adw:ComboRow.model>` list does, and the index had nothing to
33
+ * select. Held until the first model arrives, which is the order a `.blp` states when it
34
+ * writes `model:` first — the order GtkBuilder needs too.
35
+ */
36
+ private _pendingSelected;
24
37
  constructor(props?: ConstructProps<AdwComboRow>);
25
38
  /**
26
39
  * `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
@@ -36,6 +49,12 @@ export declare class AdwComboRow extends AdwActionRow {
36
49
  /** The list model (`Adw.ComboRow:model`). Updates the inline value label. */
37
50
  get model(): AdwComboOption[];
38
51
  set model(value: AdwListModelInput);
52
+ /**
53
+ * XML inflation: a child at `model` is the row's list — a `Gtk.StringList` is already an
54
+ * `AdwListModelInput`, so it goes through the same setter as the property. Everything
55
+ * else is a row edge, as on any action row.
56
+ */
57
+ _addChildFromBuilder(name: string, child: View): void;
39
58
  /** The selected option index. Updates the inline value label. */
40
59
  get selected(): number;
41
60
  set selected(raw: number | string);
@@ -12,6 +12,18 @@ export interface RowActivatedEventData extends EventData {
12
12
  declare const AdwDataGrid_base: (abstract new (...args: any[]) => {
13
13
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
14
14
  disconnect(handlerId: number): void;
15
+ get halign(): string;
16
+ set halign(value: string | number);
17
+ get valign(): string;
18
+ set valign(value: string | number);
19
+ get hexpand(): boolean;
20
+ set hexpand(value: boolean | string);
21
+ get vexpand(): boolean;
22
+ set vexpand(value: boolean | string);
23
+ get marginStart(): number;
24
+ set marginStart(value: number | string);
25
+ get marginEnd(): number;
26
+ set marginEnd(value: number | string);
15
27
  _emit(eventName: string): void;
16
28
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
17
29
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -13,6 +13,8 @@ export interface NotifyExpandedEventData extends EventData {
13
13
  expanded: boolean;
14
14
  }
15
15
  export declare class AdwExpanderRow extends AdwActionRow {
16
+ /** The names this widget's `_addChildFromBuilder` honours — see `./builder-slots.ts`. */
17
+ static readonly builderSlots: readonly string[];
16
18
  /** `AdwExpanderRow` derives from `AdwPreferencesRow` in C
17
19
  * (adw-expander-row.c:72), so the search does not consult a subtitle here. */
18
20
  readonly isActionRow: boolean;
@@ -4,6 +4,18 @@ import { type ConstructProps } from './construct-props.js';
4
4
  declare const AdwHeaderBar_base: (abstract new (...args: any[]) => {
5
5
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
6
  disconnect(handlerId: number): void;
7
+ get halign(): string;
8
+ set halign(value: string | number);
9
+ get valign(): string;
10
+ set valign(value: string | number);
11
+ get hexpand(): boolean;
12
+ set hexpand(value: boolean | string);
13
+ get vexpand(): boolean;
14
+ set vexpand(value: boolean | string);
15
+ get marginStart(): number;
16
+ set marginStart(value: number | string);
17
+ get marginEnd(): number;
18
+ set marginEnd(value: number | string);
7
19
  _emit(eventName: string): void;
8
20
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
9
21
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -13,6 +25,8 @@ declare const AdwHeaderBar_base: (abstract new (...args: any[]) => {
13
25
  get(name: string): unknown;
14
26
  }) & typeof GridLayout;
15
27
  export declare class AdwHeaderBar extends AdwHeaderBar_base {
28
+ /** The names this widget's `_addChildFromBuilder` honours — see `./builder-slots.ts`. */
29
+ static readonly builderSlots: readonly string[];
16
30
  /** The start (left) slot — a horizontal stack. */
17
31
  protected readonly _startBox: StackLayout;
18
32
  /** The end (right) slot — a horizontal stack. */
@@ -14,6 +14,18 @@ export declare const DEFAULT_ICON_BUTTON_ICON_SIZE: number;
14
14
  declare const AdwImageButton_base: (abstract new (...args: any[]) => {
15
15
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
16
16
  disconnect(handlerId: number): void;
17
+ get halign(): string;
18
+ set halign(value: string | number);
19
+ get valign(): string;
20
+ set valign(value: string | number);
21
+ get hexpand(): boolean;
22
+ set hexpand(value: boolean | string);
23
+ get vexpand(): boolean;
24
+ set vexpand(value: boolean | string);
25
+ get marginStart(): number;
26
+ set marginStart(value: number | string);
27
+ get marginEnd(): number;
28
+ set marginEnd(value: number | string);
17
29
  _emit(eventName: string): void;
18
30
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
19
31
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -0,0 +1,63 @@
1
+ import type { View } from '@nativescript/core';
2
+ import { GridLayout } from '@nativescript/core';
3
+ import { type ConstructProps } from './construct-props.js';
4
+ /** The navigation view a page is registered in — the three setters it forwards to. */
5
+ export interface NavigationPageOwner {
6
+ setPageTag(view: View, tag: string | null): boolean;
7
+ setPageTitle(view: View, title: string): boolean;
8
+ setPageCanPop(view: View, canPop: boolean): boolean;
9
+ }
10
+ declare const AdwNavigationPage_base: (abstract new (...args: any[]) => {
11
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
12
+ disconnect(handlerId: number): void;
13
+ get halign(): string;
14
+ set halign(value: string | number);
15
+ get valign(): string;
16
+ set valign(value: string | number);
17
+ get hexpand(): boolean;
18
+ set hexpand(value: boolean | string);
19
+ get vexpand(): boolean;
20
+ set vexpand(value: boolean | string);
21
+ get marginStart(): number;
22
+ set marginStart(value: number | string);
23
+ get marginEnd(): number;
24
+ set marginEnd(value: number | string);
25
+ _emit(eventName: string): void;
26
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
27
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
28
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
29
+ notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
30
+ set(name: string, value: unknown): void;
31
+ get(name: string): unknown;
32
+ }) & typeof GridLayout;
33
+ export declare class AdwNavigationPage extends AdwNavigationPage_base {
34
+ /**
35
+ * `Adw.NavigationPage:child` is the one destination, so it is also the fallback: an
36
+ * authored `child: …` and a bare child mean the same thing (adw-navigation-view.c:808).
37
+ */
38
+ static readonly builderSlots: readonly string[];
39
+ private _child;
40
+ private _tag;
41
+ private _title;
42
+ private _canPop;
43
+ private _owner;
44
+ constructor(props?: ConstructProps<AdwNavigationPage>);
45
+ /** Set (or clear) the page's content — `adw_navigation_page_set_child`. */
46
+ set_child(view: View | null): void;
47
+ /** The page's content, or `null`. */
48
+ get child(): View | null;
49
+ /** XML inflation — every child is THE child, as the C's `add_child` makes it. */
50
+ _addChildFromBuilder(_name: string, view: View): void;
51
+ /** `Adw.NavigationPage:tag` — how `push_by_tag` finds this page; `null` for none. */
52
+ get tag(): string | null;
53
+ set tag(value: string | null);
54
+ /** `Adw.NavigationPage:title` — also the next page's back-button tooltip. */
55
+ get title(): string;
56
+ set title(value: string);
57
+ /** `Adw.NavigationPage:can-pop` — gates the back button and the shortcuts, not `pop()`. */
58
+ get canPop(): boolean;
59
+ set canPop(raw: boolean | string);
60
+ /** Called by the view that registered this page, so later writes reach its stack. */
61
+ _setOwner(owner: NavigationPageOwner | null): void;
62
+ }
63
+ export {};
@@ -17,6 +17,18 @@ export type NotifyVisiblePageEventData = AdwNavigationEventData;
17
17
  declare const AdwNavigationView_base: (abstract new (...args: any[]) => {
18
18
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
19
19
  disconnect(handlerId: number): void;
20
+ get halign(): string;
21
+ set halign(value: string | number);
22
+ get valign(): string;
23
+ set valign(value: string | number);
24
+ get hexpand(): boolean;
25
+ set hexpand(value: boolean | string);
26
+ get vexpand(): boolean;
27
+ set vexpand(value: boolean | string);
28
+ get marginStart(): number;
29
+ set marginStart(value: number | string);
30
+ get marginEnd(): number;
31
+ set marginEnd(value: number | string);
20
32
  _emit(eventName: string): void;
21
33
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
22
34
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -38,11 +50,12 @@ export declare class AdwNavigationView extends AdwNavigationView_base {
38
50
  * An XML child is a PAGE, registered in document order — so the first one is
39
51
  * pushed and the rest wait behind it, exactly as `add` already promises.
40
52
  *
41
- * Registered with NO TAG: `add(view)` defaults it to `null`, and nothing in the
42
- * markup can supply one, because a `tag` is this widget's own idea rather than a
43
- * property of the child. `push_by_tag` is therefore not reachable for a page that
44
- * came from a template; a loader that wants it registers the page itself, or
45
- * calls `setPageTag` on one it looked up. What XML contributes is the tree.
53
+ * An {@link AdwNavigationPage} brings its own `tag`, `title` and `can-pop`, which is
54
+ * what `adw_navigation_view_add` reads off an `AdwNavigationPage` in C
55
+ * (adw-navigation-view.c:2192), and it keeps a handle on this view so a later write
56
+ * to one of them reaches the stack. Any other view is still accepted and registered
57
+ * untagged: this port let a bare view be a page before the page class existed, and
58
+ * dropping it — the C's `g_warning` — would empty every template written that way.
46
59
  */
47
60
  _addChildFromBuilder(_name: string, view: View): void;
48
61
  /**
@@ -8,6 +8,18 @@ export declare const CLOSED = "closed";
8
8
  declare const AdwPreferencesDialog_base: (abstract new (...args: any[]) => {
9
9
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
10
10
  disconnect(handlerId: number): void;
11
+ get halign(): string;
12
+ set halign(value: string | number);
13
+ get valign(): string;
14
+ set valign(value: string | number);
15
+ get hexpand(): boolean;
16
+ set hexpand(value: boolean | string);
17
+ get vexpand(): boolean;
18
+ set vexpand(value: boolean | string);
19
+ get marginStart(): number;
20
+ set marginStart(value: number | string);
21
+ get marginEnd(): number;
22
+ set marginEnd(value: number | string);
11
23
  _emit(eventName: string): void;
12
24
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
13
25
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -5,6 +5,18 @@ import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwPreferencesGroup_base: (abstract new (...args: any[]) => {
6
6
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
7
  disconnect(handlerId: number): void;
8
+ get halign(): string;
9
+ set halign(value: string | number);
10
+ get valign(): string;
11
+ set valign(value: string | number);
12
+ get hexpand(): boolean;
13
+ set hexpand(value: boolean | string);
14
+ get vexpand(): boolean;
15
+ set vexpand(value: boolean | string);
16
+ get marginStart(): number;
17
+ set marginStart(value: number | string);
18
+ get marginEnd(): number;
19
+ set marginEnd(value: number | string);
8
20
  _emit(eventName: string): void;
9
21
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
10
22
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -14,6 +26,8 @@ declare const AdwPreferencesGroup_base: (abstract new (...args: any[]) => {
14
26
  get(name: string): unknown;
15
27
  }) & typeof StackLayout;
16
28
  export declare class AdwPreferencesGroup extends AdwPreferencesGroup_base implements NsSearchableGroup {
29
+ /** The names this widget's `_addChildFromBuilder` honours — see `./builder-slots.ts`. */
30
+ static readonly builderSlots: readonly string[];
17
31
  /** The header box: labels on the leading edge, suffix on the trailing one. */
18
32
  protected readonly _header: GridLayout;
19
33
  /** The group header label. */
@@ -5,6 +5,18 @@ import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwPreferencesPage_base: (abstract new (...args: any[]) => {
6
6
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
7
  disconnect(handlerId: number): void;
8
+ get halign(): string;
9
+ set halign(value: string | number);
10
+ get valign(): string;
11
+ set valign(value: string | number);
12
+ get hexpand(): boolean;
13
+ set hexpand(value: boolean | string);
14
+ get vexpand(): boolean;
15
+ set vexpand(value: boolean | string);
16
+ get marginStart(): number;
17
+ set marginStart(value: number | string);
18
+ get marginEnd(): number;
19
+ set marginEnd(value: number | string);
8
20
  _emit(eventName: string): void;
9
21
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
10
22
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;