@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,8 +1,9 @@
1
1
  import type { View } from '@nativescript/core';
2
2
  import { GridLayout, type EventData } from '@nativescript/core';
3
- import { type AdwViewStackPage, type ViewStackNotifyPayload } from './view-stack-state.js';
3
+ import { type AdwViewStackPageInfo, type ViewStackNotifyPayload } from './view-stack-state.js';
4
+ import { AdwViewStackPage } from './view-stack-page.js';
4
5
  import { type ConstructProps } from './construct-props.js';
5
- export type { AdwViewStackPage };
6
+ export type { AdwViewStackPageInfo };
6
7
  /** Event name emitted when the visible child changes. Mirrors GObject `notify::visible-child`. */
7
8
  export declare const NOTIFY_VISIBLE_CHILD = "notify::visible-child";
8
9
  /**
@@ -15,6 +16,18 @@ export interface NotifyVisibleChildEventData extends EventData, ViewStackNotifyP
15
16
  declare const AdwViewStack_base: (abstract new (...args: any[]) => {
16
17
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
17
18
  disconnect(handlerId: number): void;
19
+ get halign(): string;
20
+ set halign(value: string | number);
21
+ get valign(): string;
22
+ set valign(value: string | number);
23
+ get hexpand(): boolean;
24
+ set hexpand(value: boolean | string);
25
+ get vexpand(): boolean;
26
+ set vexpand(value: boolean | string);
27
+ get marginStart(): number;
28
+ set marginStart(value: number | string);
29
+ get marginEnd(): number;
30
+ set marginEnd(value: number | string);
18
31
  _emit(eventName: string): void;
19
32
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
20
33
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -24,6 +37,12 @@ declare const AdwViewStack_base: (abstract new (...args: any[]) => {
24
37
  get(name: string): unknown;
25
38
  }) & typeof GridLayout;
26
39
  export declare class AdwViewStack extends AdwViewStack_base {
40
+ /**
41
+ * No named placement: a stack's XML children are its pages, in order, as GtkBuildable's
42
+ * untyped `<child>` is (`adw_view_stack_buildable_add_child`). An empty list, not an absent
43
+ * one, so the builder refuses an authored slot by name instead of guessing one.
44
+ */
45
+ static readonly builderSlots: readonly string[];
27
46
  private readonly _state;
28
47
  constructor(props?: ConstructProps<AdwViewStack>);
29
48
  /**
@@ -32,16 +51,41 @@ export declare class AdwViewStack extends AdwViewStack_base {
32
51
  * initial page without a manual `refresh()` (`add_page`,
33
52
  * adw-view-stack.c:1149-1151 → the notify at :1038-1039). Returns the page handle.
34
53
  */
35
- add(content: View, name: string, title?: string, icon?: string): AdwViewStackPage;
54
+ add(content: View, name: string, title?: string, icon?: string): AdwViewStackPageInfo;
55
+ /** Put a page's view into the one cell and let the selection decide what shows. */
56
+ private _placePage;
57
+ /**
58
+ * An XML child — `adw_view_stack_buildable_add_child`: an {@link AdwViewStackPage} record
59
+ * adds its child under the record's name, title, icon and badge state; any other view is
60
+ * a page with no name, which is `adw_view_stack_add` (`name` NULL). Before this there was no
61
+ * child door at all, and `LayoutBase`'s inherited one put every child into the grid
62
+ * beside the pages, shown whatever the selection said.
63
+ */
64
+ _addChildFromBuilder(_name: string, view: View | AdwViewStackPage): void;
36
65
  /** Convenience alias matching `Adw.ViewStack.add_titled`. */
37
- add_titled(content: View, name: string, title: string): AdwViewStackPage;
66
+ add_titled(content: View, name: string, title: string): AdwViewStackPageInfo;
38
67
  /**
39
- * Remove the first page named `name` and detach its content view. Returns
68
+ * Register a titled page carrying an icon — `Adw.ViewStack.add_titled_with_icon`.
69
+ *
70
+ * The same call {@link add} already is, under the name the counterpart gives it. It
71
+ * exists because the ARGUMENT ORDER is the thing a reader has to get right and this
72
+ * port had no spelling that matched: `add(child, name, title, icon)` and
73
+ * `adw_view_stack_add_titled_with_icon (stack, child, name, title, icon_name)` take
74
+ * the same four values in the same order, so the alias is a rename and cannot drift
75
+ * from the method it forwards to.
76
+ */
77
+ add_titled_with_icon(content: View, name: string, title: string, iconName: string): AdwViewStackPageInfo;
78
+ /**
79
+ * Remove a page and detach its content view — `adw_view_stack_remove`. Returns
40
80
  * whether anything was removed. When the removed page was the visible one the
41
81
  * stack ends up showing NOTHING and emits no event — `stack_remove` clears
42
82
  * `visible_child` without re-picking (adw-view-stack.c:1202-1203).
83
+ *
84
+ * Takes the CHILD, as the GIR verb does, or the page name the port's headless list
85
+ * keys on (view-stack-state.ts) — a caller ported off GJS holds the view, and one
86
+ * that came through {@link visibleChildName} or an XML attribute holds the name.
43
87
  */
44
- removePage(name: string): boolean;
88
+ remove(child: View | string): boolean;
45
89
  /**
46
90
  * Show or hide a page (`AdwViewStackPage:visible`). Returns whether the
47
91
  * SELECTION moved: hiding the visible page falls back to the next visible one
@@ -49,8 +93,10 @@ export declare class AdwViewStack extends AdwViewStack_base {
49
93
  * (`update_child_visible`, adw-view-stack.c:1061-1082).
50
94
  */
51
95
  setPageVisible(name: string, visible: boolean): boolean;
96
+ /** The name of the page holding `child`, or `null` when it is not one of ours. */
97
+ private _nameOf;
52
98
  /** All registered pages, in add order (a bound switcher reads this). */
53
- get pages(): readonly AdwViewStackPage[];
99
+ get pages(): readonly AdwViewStackPageInfo[];
54
100
  /**
55
101
  * The visible page's position, `-1` when nothing is selected.
56
102
  *
@@ -1,9 +1,22 @@
1
1
  import { GridLayout } from '@nativescript/core';
2
- import type { AdwViewStack } from './adw-view-stack.js';
2
+ import { AdwViewStack } from './adw-view-stack.js';
3
+ import { type ViewId } from './id-reference.js';
3
4
  import { type ConstructProps } from './construct-props.js';
4
5
  declare const AdwViewSwitcherBar_base: (abstract new (...args: any[]) => {
5
6
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
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);
7
20
  _emit(eventName: string): void;
8
21
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
9
22
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -13,10 +26,14 @@ declare const AdwViewSwitcherBar_base: (abstract new (...args: any[]) => {
13
26
  get(name: string): unknown;
14
27
  }) & typeof GridLayout;
15
28
  export declare class AdwViewSwitcherBar extends AdwViewSwitcherBar_base {
29
+ /** `stack` names an `AdwViewStack` of the same tree — see `./builder-slots.ts`. */
30
+ static readonly builderReferences: readonly string[];
16
31
  /** The horizontal (homogeneous) row of buttons. */
17
32
  private readonly _bar;
18
33
  private _nodes;
19
34
  private _stack;
35
+ /** A `stack` written as an id before the bar was in a loaded tree. */
36
+ private _stackId;
20
37
  private _stackListener;
21
38
  private readonly _barState;
22
39
  constructor(props?: ConstructProps<AdwViewSwitcherBar>);
@@ -24,7 +41,7 @@ export declare class AdwViewSwitcherBar extends AdwViewSwitcherBar_base {
24
41
  set_stack(stack: AdwViewStack | null): void;
25
42
  /** The bound stack (`Adw.ViewSwitcherBar.stack`). */
26
43
  get stack(): AdwViewStack | null;
27
- set stack(value: AdwViewStack | null);
44
+ set stack(value: AdwViewStack | ViewId | null);
28
45
  /**
29
46
  * Whether the layout asked for the bar — `Adw.ViewSwitcherBar:reveal`. An
30
47
  * adaptive layout sets it `true` on narrow screens and `false` on wide ones,
@@ -7,6 +7,18 @@ export declare const NOTIFY_SUBTITLE = "notify::subtitle";
7
7
  declare const AdwWindowTitle_base: (abstract new (...args: any[]) => {
8
8
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
9
9
  disconnect(handlerId: number): void;
10
+ get halign(): string;
11
+ set halign(value: string | number);
12
+ get valign(): string;
13
+ set valign(value: string | number);
14
+ get hexpand(): boolean;
15
+ set hexpand(value: boolean | string);
16
+ get vexpand(): boolean;
17
+ set vexpand(value: boolean | string);
18
+ get marginStart(): number;
19
+ set marginStart(value: number | string);
20
+ get marginEnd(): number;
21
+ set marginEnd(value: number | string);
10
22
  _emit(eventName: string): void;
11
23
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
12
24
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -6,6 +6,18 @@ export type AdwWrapBoxProperty = 'child-spacing' | 'child-spacing-unit' | 'pack-
6
6
  declare const AdwWrapBox_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;
@@ -48,7 +48,7 @@ export interface AvatarViewState extends AvatarVisibilities {
48
48
  * unreachable is three assignments; no test here closes that.
49
49
  *
50
50
  * `hasCustomImage` is hard `false` because the port has no `custom-image` counterpart
51
- * (status/open-todos.md); when it lands, only this argument changes.
51
+ * (status/open-todos/README.md); when it lands, only this argument changes.
52
52
  */
53
53
  export declare function avatarViewState(input: {
54
54
  showInitials: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { EventData, View } from '@nativescript/core';
2
2
  import { BottomSheetPresentation } from '@gjsify/adwaita-core';
3
- import type { BottomSheetCloseOutcome, BottomSheetCloseSource } from '@gjsify/adwaita-core';
3
+ import type { BottomSheetChrome, BottomSheetCloseOutcome, BottomSheetCloseSource } from '@gjsify/adwaita-core';
4
4
  /** Event name emitted when the sheet's open state changes. Mirrors GObject `notify::open`. */
5
5
  export declare const NOTIFY_OPEN = "notify::open";
6
6
  /**
@@ -25,13 +25,46 @@ export type NsSheetVisibility = 'visible' | 'collapse';
25
25
  /** The open/can-close model an `AdwBottomSheet` delegates to. */
26
26
  export declare function createBottomSheetPresentation(): BottomSheetPresentation;
27
27
  /**
28
- * The `visibility` the sheet panel must carry for the current open state. NS has
29
- * no transform transition in its CSS subset, so the reveal is instant — the
30
- * spring animation and its intermediate `progress` are not modelled here.
28
+ * The `visibility` a sheet pane must carry to be shown or not. NS has no transform
29
+ * transition in its CSS subset, so every reveal is instant — the spring animation and its
30
+ * intermediate `progress` are not modelled here.
31
31
  */
32
- export declare function sheetVisibility(open: boolean): NsSheetVisibility;
33
- /** Push {@link sheetVisibility} onto the real panel view. */
34
- export declare function applySheetVisibility(panel: View, open: boolean): void;
32
+ export declare function sheetVisibility(shown: boolean): NsSheetVisibility;
33
+ /** Marker class on the bottom-bar bin — the collapsed form the sheet morphs out of. */
34
+ export declare const BOTTOM_BAR_CLASS = "adw-bottom-sheet-bottom-bar";
35
+ /**
36
+ * Marker class for a bar that refuses to open (`AdwBottomSheet:can-open` off).
37
+ *
38
+ * libadwaita spells it `inert` on the bin (adw-bottom-sheet.c:2033-2036) and takes only the
39
+ * hover/active feedback away with it; the bar stays a live, focusable button. Prefixed here
40
+ * because every class this port emits is held against `theme/adwaita.css` by name.
41
+ */
42
+ export declare const INERT_CLASS = "adw-bottom-sheet-inert";
43
+ /** Marker class on the scrim a modal sheet lays over its content while it is open. */
44
+ export declare const DIMMING_CLASS = "adw-bottom-sheet-dimming";
45
+ /** The four views a bottom sheet's chrome is painted onto. */
46
+ export interface BottomSheetPanes {
47
+ /**
48
+ * The scrim between the content and the sheet — libadwaita's `dimming` gizmo. Painted
49
+ * over the content and under the panel, so a tap on the dimmed area lands HERE and never
50
+ * on the content a modal sheet blocks.
51
+ */
52
+ dimming: View;
53
+ /** The bottom-anchored bin — libadwaita's `sheet_bin`. */
54
+ panel: View;
55
+ /** The sheet page inside it: drag handle plus the sheet child. */
56
+ page: View;
57
+ /** The bottom-bar bin, the page's sibling in the same slot. */
58
+ bottomBar: View;
59
+ }
60
+ /**
61
+ * Paint a {@link BottomSheetChrome} onto the real views.
62
+ *
63
+ * The two `visibility` writes are ONE stack in libadwaita (`sheet_stack`), so they are
64
+ * mutually exclusive by construction here: NS has no stack, and two independently toggled
65
+ * panes is how a port ends up showing a bar on top of an open sheet.
66
+ */
67
+ export declare function applyBottomSheetChrome(panes: BottomSheetPanes, chrome: BottomSheetChrome): void;
35
68
  /**
36
69
  * Which event a gate verdict makes the widget emit, or `null` when it emits
37
70
  * nothing.
@@ -1,20 +1,6 @@
1
- import { resolveWrapBoxChildOrder } from '@gjsify/adwaita-core';
2
- /**
3
- * `Gtk.Box:spacing`'s default, in DIPs. `0` in C (`gtkbox.c`, the property's default
4
- * value), which is also what makes the margin write invisible until a caller asks.
5
- */
6
- export declare const DEFAULT_BOX_SPACING = 0;
7
- /** Which axis a box stacks along — NativeScript's two words, and `Gtk.Orientation`'s nicks. */
8
- export type BoxOrientation = 'horizontal' | 'vertical';
9
- /**
10
- * A spacing value as the box will hold it: a finite, non-negative number of DIPs.
11
- *
12
- * `gtk_box_set_spacing` takes an `int` and the property's minimum is 0, so a negative
13
- * value is clamped rather than refused — the same clamp `normalizeWrapBoxSpacing` applies
14
- * one widget over, restated here because that one carries the wrap box's UNIT machinery
15
- * (`Adw.LengthUnit`) and a `Gtk.Box` has no unit to convert from.
16
- */
17
- export declare function normalizeBoxSpacing(value: unknown): number;
1
+ import { DEFAULT_BOX_SPACING, normalizeBoxSpacing, resolveWrapBoxChildOrder, type BoxOrientation } from '@gjsify/adwaita-core';
2
+ export { DEFAULT_BOX_SPACING, normalizeBoxSpacing };
3
+ export type { BoxOrientation };
18
4
  /** Whether writing `next` over `current` is a change the box must push to its children. */
19
5
  export declare function boxSpacingChanges(current: number, next: unknown): boolean;
20
6
  /**
@@ -1,3 +1,31 @@
1
+ /**
2
+ * Every name a widget's `_addChildFromBuilder` answers to — its own slots and the
3
+ * fallback, in one list.
4
+ *
5
+ * WHY A WIDGET DECLARES THEM AT ALL, when {@link resolveBuilderSlot} already routes:
6
+ * routing is total by design, so an XML child naming a slot this widget does not have
7
+ * takes the fallback and lands somewhere plausible, silently — which is exactly right
8
+ * for a bare `<AdwHeaderBar>` child arriving under its ELEMENT name, and exactly wrong
9
+ * for a tree that AUTHORED a placement. A builder realising an authored tree has to be
10
+ * able to ask, before the write, whether the name means anything here; the answer is
11
+ * the widget's own, so it lives on the widget rather than in a table beside it.
12
+ *
13
+ * The fallback is IN the list: it is a name this widget honours — `content` on a
14
+ * toolbar view, `row` on an expander — and a caller that spells it deliberately gets
15
+ * the placement it asked for rather than a refusal.
16
+ */
17
+ export declare function builderSlotsOf<Slot extends string, Fallback extends string>(slots: readonly Slot[], fallback: Fallback): readonly (Slot | Fallback)[];
18
+ /** A widget class that declares {@link builderSlotsOf} — read by the shared-tree builder. */
19
+ export interface BuilderSlotDeclaring {
20
+ readonly builderSlots: readonly string[];
21
+ }
22
+ /**
23
+ * The slots a widget CLASS declares, or `null` when it declares none.
24
+ *
25
+ * `null` and an empty list are different answers: a class with no declaration cannot be
26
+ * asked, so the builder refuses every authored slot for it rather than inventing one.
27
+ */
28
+ export declare function declaredBuilderSlots(ctor: unknown): readonly string[] | null;
1
29
  /**
2
30
  * The slot an XML child asks for, or `fallback` when it asks for nothing this
3
31
  * widget knows.
@@ -14,3 +42,23 @@
14
42
  * a widget's own tree.
15
43
  */
16
44
  export declare function resolveBuilderSlot<Slot extends string, Fallback extends string>(name: unknown, slots: readonly Slot[], fallback: Fallback): Slot | Fallback;
45
+ /**
46
+ * A widget class that declares which of its properties hold ANOTHER OBJECT of the tree,
47
+ * named by id — read by the shared-tree builder.
48
+ *
49
+ * WHY A DECLARATION, when the builder could look for a string that matches an id: a projected
50
+ * `.blp` carries `stack: stack` as the prop `stack` holding the STRING `"stack"`, exactly as it
51
+ * carries `name: "inbox"` — the projection keeps the value and drops the type. GtkBuilder tells
52
+ * the two apart by the property's `GParamSpec` (an object pspec resolves the id, deferred to
53
+ * the end of the parse so a reference may point forward), and a runtime without GI has no
54
+ * pspec to ask. So the widget says which of its properties are object-valued, and the builder
55
+ * resolves exactly those — never a `name` that happens to equal an id.
56
+ */
57
+ export interface BuilderReferenceDeclaring {
58
+ readonly builderReferences: readonly string[];
59
+ }
60
+ /**
61
+ * The object-valued properties a widget CLASS declares, as the camelCase names its accessors
62
+ * carry; an empty list when it declares none.
63
+ */
64
+ export declare function declaredBuilderReferences(ctor: unknown): readonly string[];
@@ -1,5 +1,6 @@
1
1
  import { BUTTON_CONTENT_STYLE_CLASS, buttonContentEllipsize, buttonContentLabelText, buttonContentLabelVisible } from '@gjsify/adwaita-core';
2
2
  import type { ButtonContentEllipsize } from '@gjsify/adwaita-core';
3
+ import { type NsClassName } from './chrome.js';
3
4
  export { BUTTON_CONTENT_STYLE_CLASS, buttonContentEllipsize, buttonContentLabelText, buttonContentLabelVisible };
4
5
  export type { ButtonContentEllipsize };
5
6
  /** The class the content carries while `can-shrink` is set, for the theme to key off. */
@@ -21,14 +22,14 @@ export declare function buttonContentIconIsFallback(icon: string): boolean;
21
22
  * of `adw_button_content_root`. Adds rather than rewrites, so a caller's composed
22
23
  * classes survive, and is idempotent, so a re-parent cannot double the token.
23
24
  */
24
- export declare function buttonContentRootedParentClassName(current: string): string;
25
+ export declare function buttonContentRootedParentClassName(current: NsClassName): string;
25
26
  /**
26
27
  * The parent button's `className` with `image-text-button` removed — the unroot half.
27
28
  * A button that loses its content must go back to plain-button padding, or the 9px
28
29
  * stays on a now text-only button.
29
30
  */
30
- export declare function buttonContentUnrootedParentClassName(current: string): string;
31
+ export declare function buttonContentUnrootedParentClassName(current: NsClassName): string;
31
32
  /** The label view's `visibility` — NS's spelling of `gtk_widget_set_visible`. */
32
33
  export declare function buttonContentLabelVisibility(label: string): 'visible' | 'collapse';
33
34
  /** The content's own `className` for a `can-shrink` value, other tokens untouched. */
34
- export declare function buttonContentClassName(current: string, canShrink: boolean): string;
35
+ export declare function buttonContentClassName(current: NsClassName, canShrink: boolean): string;
@@ -0,0 +1,54 @@
1
+ import { GridLayout, StackLayout } from '@nativescript/core';
2
+ import { AdwCarousel } from './adw-carousel.js';
3
+ import { type ViewId } from './id-reference.js';
4
+ declare const AdwCarouselIndicatorBase_base: (abstract new (...args: any[]) => {
5
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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);
19
+ _emit(eventName: string): void;
20
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
21
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
22
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
23
+ notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
24
+ set(name: string, value: unknown): void;
25
+ get(name: string): unknown;
26
+ }) & typeof GridLayout;
27
+ export declare abstract class AdwCarouselIndicatorBase extends AdwCarouselIndicatorBase_base {
28
+ /** `carousel` names an `AdwCarousel` of the same tree — see `./builder-slots.ts`. */
29
+ static readonly builderReferences: readonly string[];
30
+ /** The marker row, centred in the indicator's cell as the C snapshot centres it. */
31
+ protected readonly _row: StackLayout;
32
+ private _carousel;
33
+ /** A `carousel` written as an id before the indicator was in a loaded tree. */
34
+ private _carouselId;
35
+ private readonly _onChange;
36
+ /** The class every marker carries — `adw-carousel-dot` or `adw-carousel-line`. */
37
+ protected abstract readonly _markerClass: string;
38
+ /** What a marker shows; the look is the theme's. */
39
+ protected abstract readonly _markerText: string;
40
+ constructor(indicatorClass: string);
41
+ /** `AdwCarouselIndicator*:carousel` — the carousel whose pages this marks, or `null`. */
42
+ get carousel(): AdwCarousel | null;
43
+ set carousel(value: AdwCarousel | ViewId | null);
44
+ private _resolveCarouselId;
45
+ /**
46
+ * `GtkOrientable:orientation` — the axis the markers run along, `horizontal` by default.
47
+ * The nick, as `Gtk.Box`'s `orientation` takes it; anything else is refused.
48
+ */
49
+ get orientation(): string;
50
+ set orientation(value: string);
51
+ /** Rebuild the markers when the page count moved, then mark the current page. */
52
+ private _render;
53
+ }
54
+ export {};
@@ -1,4 +1,3 @@
1
- import type { Label } from '@nativescript/core';
2
1
  import { CarouselState } from '@gjsify/adwaita-core';
3
2
  import type { CarouselScrollRequest, CarouselStateChange } from '@gjsify/adwaita-core';
4
3
  /**
@@ -52,17 +51,21 @@ export declare class CarouselScrollSync {
52
51
  */
53
52
  apply(state: CarouselState, position: number, epsilon?: number): boolean;
54
53
  }
55
- /** The class string each dot `Label` must carry, in page order. */
56
- export declare function carouselDotClasses(state: CarouselState): string[];
57
54
  /**
58
- * Push {@link carouselDotClasses} onto the real dot labels.
55
+ * The class string each marker of a page indicator carries, in page order: `markerClass`,
56
+ * and `active` on the page the carousel settles on (`current`, `-1` for none).
59
57
  *
60
- * The selected dot comes from `get_page_at_position` (adw-carousel.c:222-239),
61
- * not from `Math.round`, so a carousel resting half-way between two pages marks
62
- * the LOWER one — and, unlike the integer compare this replaces, it marks
63
- * something at all while a swipe is in progress.
58
+ * The CURRENT page comes from `get_page_at_position` (adw-carousel.c:222-239) — the
59
+ * carousel's `currentPage` — never from `Math.round(position)`, so a carousel resting
60
+ * half-way between two pages marks the LOWER one, and a swipe in progress still marks one.
64
61
  */
65
- export declare function applyCarouselDots(state: CarouselState, dots: readonly Label[]): void;
62
+ export declare function indicatorMarkerClasses(markerClass: string, count: number, current: number): string[];
63
+ /** {@link indicatorMarkerClasses} for a dot indicator bound to a carousel in `state`. */
64
+ export declare function carouselDotClasses(state: CarouselState): string[];
65
+ /** Push marker classes onto the real marker views, in page order. */
66
+ export declare function applyMarkerClasses(markers: readonly {
67
+ className: string;
68
+ }[], classes: readonly string[]): void;
66
69
  /** The data half of the `notify::position` event (minus NS's `eventName`/`object`). */
67
70
  export interface CarouselNotifyPayload {
68
71
  /** The clamped fractional scroll position. */
@@ -72,6 +72,22 @@ export interface ToolbarViewClassNames {
72
72
  topBar: string;
73
73
  bottomBar: string;
74
74
  }
75
+ /**
76
+ * A `className` as READ BACK off a NativeScript view.
77
+ *
78
+ * NOT `string`, and the difference is a crash. `classNameProperty` is registered with NO
79
+ * `defaultValue` (`ui/core/view-base/index.ts:1592`) and `Property`'s getter answers
80
+ * `key in this ? this[key] : defaultValue` (`ui/core/properties/index.ts:303`), so a view
81
+ * nobody has written a class onto reads `undefined` — measured against
82
+ * `@nativescript/core` 9.1.2, not inferred. NativeScript's own `valueChanged` guards
83
+ * `typeof newValue === 'string'` for exactly this reason.
84
+ *
85
+ * A view with no class of its own is ordinary, not exotic: `Gtk.Box` and `Gtk.Label` are
86
+ * transparent and write no `className` at all, and so does any plain `@nativescript/core`
87
+ * view a consumer hands a widget. Every function here that takes a class string its
88
+ * caller did NOT write itself takes this type.
89
+ */
90
+ export type NsClassName = string | null | undefined;
75
91
  /**
76
92
  * Swap the classes a widget MANAGES on a NativeScript `className`, leaving every
77
93
  * other token in place.
@@ -81,10 +97,20 @@ export interface ToolbarViewClassNames {
81
97
  * a fixed base instead would silently drop what a CONSUMER added — the storybook
82
98
  * appends `sb-sidebar-pane` to an `AdwToolbarView`, and a re-style would have
83
99
  * taken it away again.
100
+ *
101
+ * THE ONE FUNNEL, which is why the missing class is answered here and not at a call site.
102
+ * This took `current: string` and split it unconditionally, and that is how `Adw.Clamp`
103
+ * killed Learn6502's Android port at startup on a real emulator: `TypeError: … reading
104
+ * 'split'` on a clamp child carrying no class. THE TYPE IS WHAT HID IT — the ambient
105
+ * `ns-core.d.ts` promised `string`, so `gjsify tsc` held every call correct, and the
106
+ * off-device double answered `''` where a device answers `undefined`, leaving nothing in
107
+ * the package able to see it. Four sibling readers of a class string their caller did not
108
+ * write — `addMarkerClass`, `removeMarkerClass`, `navigationPageClassName`,
109
+ * `_paneClassName` — were already tolerant; this family was the one that was not.
84
110
  */
85
- export declare function replaceClasses(current: string, managed: readonly string[], next: readonly string[]): string;
111
+ export declare function replaceClasses(current: NsClassName, managed: readonly string[], next: readonly string[]): string;
86
112
  /** The child `className` for a clamp allocation — the size class, and nothing else touched. */
87
- export declare function clampChildClassName(current: string, sizeClass: AdwClampSizeClass | null): string;
113
+ export declare function clampChildClassName(current: NsClassName, sizeClass: AdwClampSizeClass | null): string;
88
114
  /** The five banner properties, as the widget holds them. */
89
115
  export type BannerProps = AdwBannerProps;
90
116
  /**
@@ -117,7 +143,7 @@ export declare function bannerVisibility(revealed: boolean): 'visible' | 'collap
117
143
  * `adw_banner_set_button_style` only ever adds or removes `suggested-action`; it
118
144
  * never rewrites the button's class list, and neither does this.
119
145
  */
120
- export declare function bannerButtonClassName(current: string, style: AdwBannerButtonStyle): string;
146
+ export declare function bannerButtonClassName(current: NsClassName, style: AdwBannerButtonStyle): string;
121
147
  /**
122
148
  * The `className` strings for a toolbar view, given its CURRENT ones, its
123
149
  * properties and the measured bar heights.
@@ -127,9 +153,9 @@ export declare function bannerButtonClassName(current: string, style: AdwBannerB
127
153
  * that was never given a height fades nothing, so it gets no undershoot.
128
154
  */
129
155
  export declare function toolbarViewClassNames(current: {
130
- view: string;
131
- topBar: string;
132
- bottomBar: string;
156
+ view: NsClassName;
157
+ topBar: NsClassName;
158
+ bottomBar: NsClassName;
133
159
  }, props: ToolbarViewProps, heights: {
134
160
  topBarHeight: number;
135
161
  bottomBarHeight: number;
@@ -1,9 +1,12 @@
1
+ import type { AdwAdjustmentInput, AdwListModelInput } from '@gjsify/adwaita-core';
1
2
  /**
2
3
  * The keys a widget's construct-props bag accepts, derived from the widget itself.
3
4
  *
4
5
  * Methods are dropped; everything else a caller could assign stays, its type read off the
5
6
  * GETTER (so `size?: number` even though `set size(value: number | string)` also takes the
6
- * string XML hands over — the bag is the TypeScript door, the attribute is the string one).
7
+ * string XML hands over — the bag is the TypeScript door, the attribute is the string one),
8
+ * except for the two keys {@link ValueProps} widens, where the setter takes a portable VALUE
9
+ * the getter does not hand back.
7
10
  *
8
11
  * A read-only accessor survives this type and is refused at RUNTIME instead. The
9
12
  * `readonly`-detecting mapped type that would have caught `parent` at compile time was
@@ -12,14 +15,50 @@
12
15
  * one that admits two impossible ones and says so when they arrive.
13
16
  */
14
17
  export type ConstructProps<T> = Partial<{
15
- [K in keyof T as T[K] extends (...args: never[]) => unknown ? never : K]: K extends EnumProp ? T[K] | number : T[K];
18
+ [K in keyof T as T[K] extends (...args: never[]) => unknown ? never : K]: K extends EnumProp ? T[K] | number : K extends ValueProp ? T[K] | ValueProps[K & ValueProp] : T[K];
16
19
  }>;
20
+ /**
21
+ * The two properties whose SETTER takes a portable VALUE the getter does not hand back, and
22
+ * what each one accepts.
23
+ *
24
+ * THE GETTER TYPE IS NOT THE WHOLE DOOR HERE, and the difference is not an XML artifact like
25
+ * `size`'s `| string`. `set model` takes `AdwListModelInput` — bare strings included, which
26
+ * is `Gtk.StringList`'s own model and what `Gtk.StringList` itself is — and hands back
27
+ * normalised `AdwComboOption`s; `set adjustment` takes a PARTIAL and hands back a whole one,
28
+ * which is what makes `adjustment: { upper: 20 }` move one bound. Read off the getter alone,
29
+ * the bag refused both — `new Adw.ComboRow({ model: ['Blue', 'Teal'] })` and
30
+ * `new Adw.SpinRow({ adjustment: { lower: 0, upper: 100 } })` are the spellings the website
31
+ * gallery has published on every such block, and every one of them was `TS2322` while the
32
+ * runtime took it: `applyConstructProps` assigns through the setter, so nothing could fail.
33
+ *
34
+ * TWO KEY NAMES AND FOUR ACCESSORS: `model` on `AdwComboRow` and `GtkDropDown`, `adjustment`
35
+ * on `AdwSpinRow` and `AdwSliderRow`, each pair declaring the same input type as the other.
36
+ * Keyed by NAME like {@link ALIGNMENT_AXES}, because a widget that grows one of these
37
+ * properties grows it with that meaning or the vocabulary gate refuses the name.
38
+ *
39
+ * It is held by `gtk-value-doors.spec.ts`, which writes all four spellings — array, a
40
+ * `Gtk.StringList`, an object literal and a `Gtk.Adjustment` — through this door and is
41
+ * type-checked with the rest of the package, so narrowing this table stops that file
42
+ * compiling.
43
+ */
44
+ export interface ValueProps {
45
+ model: AdwListModelInput;
46
+ adjustment: AdwAdjustmentInput;
47
+ }
48
+ /** The keys {@link ValueProps} declares — {@link ConstructProps} widens exactly these. */
49
+ export type ValueProp = keyof ValueProps;
17
50
  /**
18
51
  * Every key this bag reads as a GIR ENUM, so `| number` is admitted for exactly those and
19
52
  * nowhere else. ADR 0034 § 4's second spelling: a nick is what an XML attribute can carry,
20
53
  * and the constant is what a snippet ported off GJS carries.
21
54
  */
22
- export type EnumProp = AlignmentProp | IconSizeProp;
55
+ export type EnumProp = AlignmentProp | GtkAlignProp | IconSizeProp;
56
+ /**
57
+ * `GtkWidget:halign` / `valign` under GTK's own names (`widget-layout.ts`). Their setters read a
58
+ * nick or a constant themselves, so unlike {@link AlignmentProp} the bag translates nothing
59
+ * for them — the widening is the type half alone.
60
+ */
61
+ export type GtkAlignProp = 'halign' | 'valign';
23
62
  /**
24
63
  * The NativeScript properties whose value this package reads as a `Gtk.Align`.
25
64
  *
@@ -39,8 +78,10 @@ export type EnumProp = AlignmentProp | IconSizeProp;
39
78
  * to `stretch`, which is also what the `default:` arm does with it. Nothing here closes the
40
79
  * vertical three — the attribute door has no coercer to hang this on and a per-widget
41
80
  * `set verticalAlignment` would shadow `View`'s, which is the hazard arm 2 of
42
- * `check-nativescript-xml-doors.mjs` exists for — so it is a declared divergence and the same
43
- * § 1 convergence question ADR 0034 § Amendment 12 leaves open for `halign` / `valign`.
81
+ * `check-nativescript-xml-doors.mjs` exists for — so it stays a declared divergence on
82
+ * NativeScript's OWN name. The door that agrees everywhere is GTK's: `valign="center"` and
83
+ * `halign` are accessors on every widget (`widget-layout.ts`), so the attribute, the bag and a
84
+ * projected `.blp` all translate the same way through them.
44
85
  */
45
86
  declare const ALIGNMENT_AXES: {
46
87
  readonly horizontalAlignment: "horizontal";