@gjsify/adwaita-nativescript 0.30.0 → 0.32.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 (146) hide show
  1. package/lib/esm/index.js +1 -1
  2. package/lib/esm/widgets/adw-action-row.js +1 -1
  3. package/lib/esm/widgets/adw-avatar.js +1 -1
  4. package/lib/esm/widgets/adw-banner.js +1 -1
  5. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  6. package/lib/esm/widgets/adw-button-content.js +1 -1
  7. package/lib/esm/widgets/adw-button-row.js +1 -1
  8. package/lib/esm/widgets/adw-carousel.js +1 -1
  9. package/lib/esm/widgets/adw-clamp.js +1 -1
  10. package/lib/esm/widgets/adw-combo-row.js +1 -1
  11. package/lib/esm/widgets/adw-data-grid.js +1 -0
  12. package/lib/esm/widgets/adw-drop-down.js +1 -0
  13. package/lib/esm/widgets/adw-entry-row.js +1 -1
  14. package/lib/esm/widgets/adw-entry.js +1 -0
  15. package/lib/esm/widgets/adw-expander-row.js +1 -1
  16. package/lib/esm/widgets/adw-header-bar.js +1 -1
  17. package/lib/esm/widgets/adw-inline-view-switcher.js +1 -1
  18. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  19. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  20. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  21. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  22. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  23. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  24. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  25. package/lib/esm/widgets/adw-sidebar.js +1 -1
  26. package/lib/esm/widgets/adw-spin-row.js +1 -1
  27. package/lib/esm/widgets/adw-spinner.js +1 -1
  28. package/lib/esm/widgets/adw-split-button.js +1 -1
  29. package/lib/esm/widgets/adw-status-page.js +1 -1
  30. package/lib/esm/widgets/adw-switch-row.js +1 -1
  31. package/lib/esm/widgets/adw-tab-view.js +1 -1
  32. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  33. package/lib/esm/widgets/adw-view-stack.js +1 -1
  34. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  35. package/lib/esm/widgets/adw-window-title.js +1 -1
  36. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  37. package/lib/esm/widgets/avatar-color.js +1 -0
  38. package/lib/esm/widgets/bottom-sheet-state.js +1 -0
  39. package/lib/esm/widgets/button-content.js +1 -0
  40. package/lib/esm/widgets/carousel-state.js +1 -0
  41. package/lib/esm/widgets/chrome.js +1 -0
  42. package/lib/esm/widgets/data-grid-model.js +1 -0
  43. package/lib/esm/widgets/entry-row-view.js +1 -0
  44. package/lib/esm/widgets/icon-path.js +2 -2
  45. package/lib/esm/widgets/icons.ios.js +1 -0
  46. package/lib/esm/widgets/index.js +1 -1
  47. package/lib/esm/widgets/navigation-stack.js +1 -0
  48. package/lib/esm/widgets/preferences-group-state.js +1 -0
  49. package/lib/esm/widgets/preferences-search.js +1 -0
  50. package/lib/esm/widgets/row-state.js +1 -0
  51. package/lib/esm/widgets/sidebar-model.js +1 -0
  52. package/lib/esm/widgets/split-button.js +1 -0
  53. package/lib/esm/widgets/split-view-base.js +1 -1
  54. package/lib/esm/widgets/split-view-state.js +1 -0
  55. package/lib/esm/widgets/split-view-width.js +1 -0
  56. package/lib/esm/widgets/status-page-content.js +1 -0
  57. package/lib/esm/widgets/svg-path.js +2 -0
  58. package/lib/esm/widgets/tab-view-state.js +1 -0
  59. package/lib/esm/widgets/view-stack-state.js +1 -0
  60. package/lib/esm/widgets/view-switcher-base.js +1 -1
  61. package/lib/esm/widgets/view-switcher-model.js +1 -0
  62. package/lib/esm/widgets/wrap-box-layout.js +1 -0
  63. package/lib/types/banner.spec.d.ts +2 -0
  64. package/lib/types/bottom-sheet.spec.d.ts +2 -0
  65. package/lib/types/button-content.spec.d.ts +2 -0
  66. package/lib/types/carousel.spec.d.ts +1 -0
  67. package/lib/types/chrome.spec.d.ts +2 -0
  68. package/lib/types/data-grid.spec.d.ts +2 -0
  69. package/lib/types/drop-down.spec.d.ts +2 -0
  70. package/lib/types/entry-rows.spec.d.ts +2 -0
  71. package/lib/types/entry.spec.d.ts +2 -0
  72. package/lib/types/index.d.ts +2 -2
  73. package/lib/types/navigation-view.spec.d.ts +2 -0
  74. package/lib/types/preferences.spec.d.ts +2 -0
  75. package/lib/types/row-state.spec.d.ts +2 -0
  76. package/lib/types/sidebar.spec.d.ts +1 -0
  77. package/lib/types/split-button.spec.d.ts +1 -0
  78. package/lib/types/split-view-state.spec.d.ts +2 -0
  79. package/lib/types/split-view-width.spec.d.ts +2 -0
  80. package/lib/types/status-page.spec.d.ts +2 -0
  81. package/lib/types/svg-path.spec.d.ts +2 -0
  82. package/lib/types/tab-view.spec.d.ts +2 -0
  83. package/lib/types/view-stack.spec.d.ts +2 -0
  84. package/lib/types/view-switcher.spec.d.ts +1 -0
  85. package/lib/types/widgets/adw-action-row.d.ts +63 -7
  86. package/lib/types/widgets/adw-avatar.d.ts +2 -7
  87. package/lib/types/widgets/adw-banner.d.ts +26 -7
  88. package/lib/types/widgets/adw-bottom-sheet.d.ts +29 -11
  89. package/lib/types/widgets/adw-button-content.d.ts +41 -6
  90. package/lib/types/widgets/adw-button-row.d.ts +31 -9
  91. package/lib/types/widgets/adw-carousel.d.ts +70 -15
  92. package/lib/types/widgets/adw-clamp.d.ts +21 -4
  93. package/lib/types/widgets/adw-data-grid.d.ts +73 -0
  94. package/lib/types/widgets/adw-drop-down.d.ts +45 -0
  95. package/lib/types/widgets/adw-entry-row.d.ts +98 -2
  96. package/lib/types/widgets/adw-entry.d.ts +43 -0
  97. package/lib/types/widgets/adw-expander-row.d.ts +3 -0
  98. package/lib/types/widgets/adw-header-bar.d.ts +11 -2
  99. package/lib/types/widgets/adw-inline-view-switcher.d.ts +26 -0
  100. package/lib/types/widgets/adw-navigation-split-view.d.ts +2 -1
  101. package/lib/types/widgets/adw-navigation-view.d.ts +71 -16
  102. package/lib/types/widgets/adw-overlay-split-view.d.ts +29 -2
  103. package/lib/types/widgets/adw-password-entry-row.d.ts +33 -3
  104. package/lib/types/widgets/adw-preferences-dialog.d.ts +18 -0
  105. package/lib/types/widgets/adw-preferences-group.d.ts +56 -8
  106. package/lib/types/widgets/adw-preferences-page.d.ts +32 -1
  107. package/lib/types/widgets/adw-sidebar.d.ts +49 -7
  108. package/lib/types/widgets/adw-spinner.d.ts +8 -3
  109. package/lib/types/widgets/adw-split-button.d.ts +48 -13
  110. package/lib/types/widgets/adw-status-page.d.ts +5 -10
  111. package/lib/types/widgets/adw-switch-row.d.ts +21 -1
  112. package/lib/types/widgets/adw-tab-view.d.ts +129 -15
  113. package/lib/types/widgets/adw-toolbar-view.d.ts +39 -0
  114. package/lib/types/widgets/adw-view-stack.d.ts +30 -27
  115. package/lib/types/widgets/adw-view-switcher-bar.d.ts +22 -10
  116. package/lib/types/widgets/adw-window-title.d.ts +12 -8
  117. package/lib/types/widgets/adw-wrap-box.d.ts +21 -4
  118. package/lib/types/widgets/avatar-color.d.ts +14 -0
  119. package/lib/types/widgets/bottom-sheet-state.d.ts +73 -0
  120. package/lib/types/widgets/button-content.d.ts +43 -0
  121. package/lib/types/widgets/carousel-state.d.ts +85 -0
  122. package/lib/types/widgets/chrome.d.ts +159 -0
  123. package/lib/types/widgets/data-grid-model.d.ts +104 -0
  124. package/lib/types/widgets/entry-row-view.d.ts +88 -0
  125. package/lib/types/widgets/icon-path.d.ts +20 -0
  126. package/lib/types/widgets/icons.ios.d.ts +13 -0
  127. package/lib/types/widgets/index.d.ts +20 -5
  128. package/lib/types/widgets/navigation-stack.d.ts +153 -0
  129. package/lib/types/widgets/preferences-group-state.d.ts +52 -0
  130. package/lib/types/widgets/preferences-search.d.ts +68 -0
  131. package/lib/types/widgets/row-state.d.ts +71 -0
  132. package/lib/types/widgets/sidebar-model.d.ts +18 -0
  133. package/lib/types/widgets/split-button.d.ts +55 -0
  134. package/lib/types/widgets/split-view-base.d.ts +55 -12
  135. package/lib/types/widgets/split-view-state.d.ts +196 -0
  136. package/lib/types/widgets/split-view-width.d.ts +76 -0
  137. package/lib/types/widgets/status-page-content.d.ts +23 -0
  138. package/lib/types/widgets/svg-path.d.ts +28 -0
  139. package/lib/types/widgets/tab-view-state.d.ts +74 -0
  140. package/lib/types/widgets/view-stack-state.d.ts +35 -0
  141. package/lib/types/widgets/view-switcher-base.d.ts +61 -32
  142. package/lib/types/widgets/view-switcher-model.d.ts +114 -0
  143. package/lib/types/widgets/wrap-box-layout.d.ts +43 -0
  144. package/lib/types/wrap-box.spec.d.ts +2 -0
  145. package/package.json +7 -7
  146. package/src/theme/adwaita.css +393 -8
@@ -1,33 +1,88 @@
1
- import { GridLayout, View, type EventData } from '@nativescript/core';
2
- /** Event name emitted when the visible page changes. Mirrors GObject `notify::visible-page`. */
3
- export declare const NOTIFY_VISIBLE_PAGE = "notify::visible-page";
4
- /** Payload of the `notify::visible-page` event. */
5
- export interface NotifyVisiblePageEventData extends EventData {
6
- /** The newly-visible page's tag, or `null`. */
1
+ import { GridLayout, type EventData, type View } from '@nativescript/core';
2
+ import type { AdwNavigationPageProps, NavigationShortcutResult } from '@gjsify/adwaita-core';
3
+ import { NOTIFY_VISIBLE_PAGE, POPPED, PUSHED, REPLACED } from './navigation-stack.js';
4
+ export { NOTIFY_VISIBLE_PAGE, POPPED, PUSHED, REPLACED };
5
+ /** Payload of every navigation signal — `pushed`, `popped`, `replaced`, `notify::visible-page`. */
6
+ export interface AdwNavigationEventData extends EventData {
7
+ /** The page the signal is about, or `null` (`replaced`, or an emptied view). */
8
+ page: View | null;
9
+ /** That page's tag, or `null`. */
7
10
  tag: string | null;
8
11
  /** The current navigation stack depth. */
9
12
  depth: number;
10
13
  }
14
+ /** Payload of the `notify::visible-page` event. */
15
+ export type NotifyVisiblePageEventData = AdwNavigationEventData;
11
16
  export declare class AdwNavigationView extends GridLayout {
12
- /** All registered pages (by tag), addressable by `push(tag)`. */
13
- private readonly _pages;
14
- /** The live navigation stack (last entry = visible). */
15
- private readonly _stack;
17
+ private readonly _nav;
16
18
  constructor();
17
19
  /**
18
- * Register a page (optionally with a tag for `push(tag)`). The FIRST page added
19
- * is auto-pushed so the view is never empty, matching `Adw.NavigationView`.
20
+ * Register a page (optionally with a tag for `push(tag)`). A page added while
21
+ * the stack is EMPTY is pushed automatically, so the view is never blank —
22
+ * which also re-arms after `replace([])`.
23
+ */
24
+ add(view: View, tag?: string | null, options?: Omit<AdwNavigationPageProps, 'tag'>): boolean;
25
+ /**
26
+ * Remove a page (`AdwNavigationView.remove`). One that is on the stack is
27
+ * removed once it is POPPED. Named `removePage` rather than `remove` so the
28
+ * widget never shadows a member of NativeScript's own `ViewBase`, the same
29
+ * reason `@gjsify/adwaita-web` avoids `HTMLElement.remove()`.
20
30
  */
21
- add(view: View, tag?: string | null): void;
31
+ removePage(view: View): boolean;
22
32
  /** Push a page (a previously-registered tag, or a fresh view) onto the stack. */
23
- push(pageOrTag: View | string): void;
24
- /** Pop the top page. Returns `true` if a page was popped (stack keeps ≥1). */
33
+ push(viewOrTag: View | string, options?: AdwNavigationPageProps): boolean;
34
+ /** Push the page carrying `tag`. */
35
+ pushByTag(tag: string): boolean;
36
+ /**
37
+ * Pop the top page. Returns `true` if a page was popped (the stack keeps ≥1).
38
+ * `can-pop` does NOT gate this — it gates {@link popFromShortcut} and the back
39
+ * button, exactly as libadwaita documents.
40
+ */
25
41
  pop(): boolean;
26
- private _applyVisible;
42
+ /** Pop until `view` is visible, in ONE transition. */
43
+ popToPage(view: View): boolean;
44
+ /** Pop until the page carrying `tag` is visible. */
45
+ popToTag(tag: string): boolean;
46
+ /** Replace the whole stack; the last entry becomes visible. Never animates. */
47
+ replace(entries: ReadonlyArray<View | string | null>): void;
48
+ /** Replace the stack with the pages carrying `tags`. */
49
+ replaceWithTags(tags: readonly string[]): void;
50
+ /** The page with this tag, or `null`. */
51
+ findPage(tag: string): View | null;
52
+ /** The page popping `view` would reveal, or `null`. */
53
+ getPreviousPage(view: View): View | null;
54
+ /** Set a page's tag. Rejected when another page already owns it. */
55
+ setPageTag(view: View, tag: string | null): boolean;
56
+ /** Set a page's title — used as the NEXT page's back-button tooltip. */
57
+ setPageTitle(view: View, title: string): boolean;
58
+ /** Set a page's `can-pop`, gating the shortcuts and a back button. */
59
+ setPageCanPop(view: View, canPop: boolean): boolean;
60
+ /** Whether a back button belongs on the visible page. */
61
+ canGoBack(): boolean;
62
+ /** The back button's label/tooltip — the previous page's title, or `null` when there is none. */
63
+ backButtonTooltip(fallback?: string): string | null;
64
+ /** The `can-pop`-aware pop, for a hardware/software back button. */
65
+ popFromShortcut(): NavigationShortcutResult;
66
+ /** Escape-to-pop, gated on {@link popOnEscape}. */
67
+ popFromEscape(): NavigationShortcutResult;
27
68
  /** The currently-visible page view, or `null`. */
28
69
  get visiblePage(): View | null;
29
70
  /** The currently-visible page tag, or `null`. */
30
71
  get visiblePageTag(): string | null;
31
72
  /** The current navigation stack depth. */
32
73
  get depth(): number;
74
+ /** The navigation stack, bottom-first. */
75
+ get navigationStack(): readonly View[];
76
+ /** Every registered page — static and dynamically pushed. */
77
+ get pages(): readonly View[];
78
+ /**
79
+ * `Adw.NavigationView:animate-transitions`. Kept for API parity: the NS CSS
80
+ * subset has no transition, so the swap is instant either way.
81
+ */
82
+ get animateTransitions(): boolean;
83
+ set animateTransitions(value: boolean);
84
+ /** `Adw.NavigationView:pop-on-escape` — consulted by {@link popFromEscape}. */
85
+ get popOnEscape(): boolean;
86
+ set popOnEscape(value: boolean);
87
+ private _emit;
33
88
  }
@@ -1,12 +1,34 @@
1
1
  import { AdwSplitViewBase } from './split-view-base.js';
2
- export declare class AdwOverlaySplitView extends AdwSplitViewBase {
2
+ import { NsOverlaySplitViewState } from './split-view-state.js';
3
+ export declare class AdwOverlaySplitView extends AdwSplitViewBase<NsOverlaySplitViewState> {
3
4
  /** Dimmed backdrop drawn between content and the overlaid sidebar; tapping it
4
5
  * closes the sidebar (Adwaita's click-outside-to-dismiss). Created lazily. */
5
6
  private _scrim;
6
7
  constructor();
8
+ /**
9
+ * `Adw.OverlaySplitView:pin-sidebar` (adw-overlay-split-view.c:990-992,
10
+ * default FALSE) — whether collapsing leaves the sidebar's visibility alone.
11
+ */
12
+ get pinSidebar(): boolean;
13
+ set pinSidebar(value: boolean);
7
14
  protected _applyLayout(): void;
8
15
  /** Animate a collapsed show/hide toggle; fall back to instant off-screen/off-device. */
9
16
  protected _transitionSidebar(): void;
17
+ /**
18
+ * `gtk_widget_set_can_focus (sidebar_bin, !collapsed || show_sidebar)` and its
19
+ * mirror (:330-331, :1460-1461), as NativeScript spells it.
20
+ *
21
+ * Without this the pane hidden UNDER the overlay keeps answering taps and stays
22
+ * in the screen-reader order — the scrim only shields the area it covers, and a
23
+ * `translateX`-ed sidebar is not covered at all.
24
+ *
25
+ * DEVIATION the C cannot settle: GTK sets `can-focus` on its own `AdwBin`
26
+ * WRAPPER, leaving the application's child untouched. NativeScript has no such
27
+ * wrapper — the pane IS the view the consumer handed us — so this writes on
28
+ * their view, and a pane the app deliberately made non-interactive is made
29
+ * interactive again the next time it comes on screen.
30
+ */
31
+ private _applyPaneFocus;
10
32
  /** Lazily create the tap-to-dismiss scrim. */
11
33
  private _ensureScrim;
12
34
  /** Re-establish paint order: content < scrim < sidebar (NS paints in add order).
@@ -24,5 +46,10 @@ export declare class AdwOverlaySplitView extends AdwSplitViewBase {
24
46
  private _animateClose;
25
47
  /** Off-screen sidebar offset: slides past the edge it's anchored to. */
26
48
  private _hiddenOffset;
27
- private _stripOverlay;
49
+ /**
50
+ * The sidebar pane's class list for the current mode — the NativeScript
51
+ * spelling of `update_collapsed`'s css-class swap (:727-738): `overlay-pane`
52
+ * while collapsed, `sidebar-pane` while docked, never both.
53
+ */
54
+ private _paneClassName;
28
55
  }
@@ -1,12 +1,42 @@
1
+ import type { EventData } from '@nativescript/core';
1
2
  import { AdwEntryRow } from './adw-entry-row.js';
2
3
  import { AdwImageButton } from './adw-image-button.js';
4
+ export { PasswordEntryRowState } from '@gjsify/adwaita-core';
5
+ export type { PasswordEntryRowRenderState } from '@gjsify/adwaita-core';
6
+ /** Event name emitted when the peek state flips. Mirrors a GObject `notify::`. */
7
+ export declare const NOTIFY_REVEALED = "notify::revealed";
8
+ /** Payload of the `notify::revealed` event. */
9
+ export interface NotifyRevealedEventData extends EventData {
10
+ /** Whether the contents are now shown in clear text. */
11
+ revealed: boolean;
12
+ }
3
13
  export declare class AdwPasswordEntryRow extends AdwEntryRow {
14
+ /** The headless peek + caps-lock derivation, composing the parent row's state. */
15
+ private readonly _password;
4
16
  /** The trailing peek (reveal/conceal) toggle button. */
5
17
  protected readonly _peekButton: AdwImageButton;
6
18
  constructor();
7
- /** Toggle the masked/revealed state + swap the eye icon. */
8
- private _togglePeek;
9
- /** Whether the password is currently revealed (the value is shown). */
19
+ /** Whether the contents are shown in clear text (`GtkText:visibility`). */
20
+ get revealed(): boolean;
21
+ set revealed(value: boolean);
22
+ /**
23
+ * Legacy spelling of {@link revealed}. The web port called it `revealed`, this
24
+ * one called it `peeking`, and neither name is in the C — kept so existing
25
+ * NativeScript callers keep working while `revealed` is the shared name.
26
+ */
10
27
  get peeking(): boolean;
11
28
  set peeking(value: boolean);
29
+ /** Flip masked↔revealed — `show_text_clicked_cb` (C:90-97). */
30
+ togglePeek(): boolean;
31
+ /** Whether Caps Lock is engaged, as last reported by the host. */
32
+ get capsLockOn(): boolean;
33
+ /**
34
+ * Feed the platform's Caps Lock state in — GDK reads it off the keyboard
35
+ * device (C:111-115). NativeScript surfaces no equivalent, so this is the
36
+ * host's seam.
37
+ */
38
+ setCapsLockOn(on: boolean): void;
39
+ protected get _baseClassName(): string;
40
+ /** `notify_visibility_cb` (C:62-81), applied to the NS views. */
41
+ private _renderPassword;
12
42
  }
@@ -1,4 +1,6 @@
1
1
  import { GridLayout, Label, StackLayout, View } from '@nativescript/core';
2
+ import type { SearchPreferencesOptions } from '@gjsify/adwaita-core';
3
+ import { type NsPreferencesSearchResult, type NsSearchablePage } from './preferences-search.js';
2
4
  /** Event name emitted when the dialog is closed. */
3
5
  export declare const CLOSED = "closed";
4
6
  export declare class AdwPreferencesDialog extends GridLayout {
@@ -14,6 +16,22 @@ export declare class AdwPreferencesDialog extends GridLayout {
14
16
  add(view: View): void;
15
17
  /** Remove a previously-added page from the body. */
16
18
  remove(view: View): void;
19
+ /**
20
+ * The pages this dialog searches, in add order.
21
+ *
22
+ * Reads the live body children, so a page added or removed after the dialog
23
+ * was built is indexed without an invalidation step. A plain view dropped
24
+ * into the body is not a page and contributes nothing.
25
+ */
26
+ get searchPages(): readonly NsSearchablePage[];
27
+ /**
28
+ * The preferences search (`filter_search_results` +
29
+ * `create_search_row_subtitle`) over this dialog's live pages.
30
+ *
31
+ * An empty query returns the WHOLE corpus, which is what C does and what
32
+ * keeps a results list populated before the user types.
33
+ */
34
+ search(query: string, options?: SearchPreferencesOptions): NsPreferencesSearchResult[];
17
35
  /** Reveal the preferences overlay. */
18
36
  present(): void;
19
37
  /** Hide the preferences overlay and emit `closed`. */
@@ -1,23 +1,71 @@
1
- import { StackLayout, Label, View } from '@nativescript/core';
2
- export declare class AdwPreferencesGroup extends StackLayout {
3
- /** The group header label (created lazily — only in the tree when a title is set). */
1
+ import { GridLayout, Label, StackLayout, View } from '@nativescript/core';
2
+ import type { NsSearchableGroup, NsSearchableRow } from './preferences-search.js';
3
+ export declare class AdwPreferencesGroup extends StackLayout implements NsSearchableGroup {
4
+ /** The header box: labels on the leading edge, suffix on the trailing one. */
5
+ protected readonly _header: GridLayout;
6
+ /** The group header label. */
4
7
  protected readonly _titleLabel: Label;
5
- private _hasTitle;
8
+ /** The dimmed description line below the title. */
9
+ protected readonly _descriptionLabel: Label;
10
+ /** Host for the optional `header-suffix` view. */
11
+ protected readonly _suffixHost: StackLayout;
6
12
  /** The boxed-list container that actually holds the rows. */
7
13
  protected readonly _listbox: StackLayout;
14
+ private _title;
15
+ private _description;
16
+ private _headerSuffix;
8
17
  constructor();
9
18
  /**
10
- * The group title (dim, uppercase header above the boxed list). Setting a
11
- * non-empty value inserts the header label above the list; setting empty
12
- * removes it — so a titleless group has no blank header, matching
13
- * `Adw.PreferencesGroup`.
19
+ * The group title (dim, uppercase header above the boxed list).
20
+ *
21
+ * `null`/`undefined` is the empty string, as
22
+ * `adw_preferences_group_set_title` normalises it
23
+ * (adw-preferences-group.c:508).
14
24
  */
15
25
  get title(): string;
16
26
  set title(value: string);
27
+ /**
28
+ * The dimmed description line below the title.
29
+ *
30
+ * Normalised here even though `adw_preferences_group_set_description` passes
31
+ * NULL straight through (:555) where its own `set_title` and
32
+ * `adw_preferences_page_set_title` both normalise — the visibility test
33
+ * treats NULL and `""` alike, so the inconsistency has no consequence.
34
+ */
35
+ get description(): string;
36
+ set description(value: string);
37
+ /**
38
+ * The `header-suffix` view — displayed above the list, next to the title and
39
+ * description; commonly a button or a spinner for the whole group
40
+ * (`adw_preferences_group_set_header_suffix`, :597-625).
41
+ *
42
+ * A suffix keeps the header alive even with no title AND makes it
43
+ * single-line, which is why it feeds the derivation rather than only the
44
+ * tree.
45
+ */
46
+ get headerSuffix(): View | null;
47
+ set headerSuffix(view: View | null);
17
48
  /** Append a row (or any view) to the boxed list. */
18
49
  addRow(view: View): void;
19
50
  /** Remove a previously-added row from the boxed list. */
20
51
  removeRow(view: View): void;
52
+ /**
53
+ * The rows this group contributes to a preferences search, in listbox order.
54
+ *
55
+ * Reads the live children rather than a parallel list, so a consumer that
56
+ * empties the listbox directly (the storybook's controls panel does) cannot
57
+ * leave a stale index behind.
58
+ */
59
+ searchRows(): readonly NsSearchableRow[];
60
+ /**
61
+ * Push the derived header/listbox state onto the views.
62
+ *
63
+ * Re-reads the live child count on every call — `update_listbox_visibility`
64
+ * is wired to the row model's `items-changed`
65
+ * (adw-preferences-group.c:335-339), so the rule has to hold after every
66
+ * mutation and not only at construction.
67
+ */
68
+ private _applyVisuals;
21
69
  /**
22
70
  * Mark the FIRST row so it draws no top separator. Adwaita draws hairline
23
71
  * separators BETWEEN rows only; the `.boxed-list .adw-row` top-border rule
@@ -1,12 +1,43 @@
1
1
  import { ScrollView, StackLayout, View } from '@nativescript/core';
2
- export declare class AdwPreferencesPage extends ScrollView {
2
+ import type { NsSearchableGroup, NsSearchablePage } from './preferences-search.js';
3
+ export declare class AdwPreferencesPage extends ScrollView implements NsSearchablePage {
3
4
  /** The vertical stack that actually holds the groups. */
4
5
  protected readonly _content: StackLayout;
6
+ private _title;
7
+ private _name;
8
+ private _iconName;
9
+ private _useUnderline;
5
10
  constructor();
11
+ /**
12
+ * `AdwPreferencesPage:title` — shown by a view switcher and by the search
13
+ * results, never by the page itself. `null` is the empty string
14
+ * (`adw_preferences_page_set_title`, adw-preferences-page.c:538).
15
+ */
16
+ get title(): string;
17
+ set title(value: string);
18
+ /** `AdwPreferencesPage:name` — the view-stack child name. */
19
+ get name(): string;
20
+ set name(value: string);
21
+ /** `AdwPreferencesPage:icon-name` — the symbolic a view switcher shows. */
22
+ get iconName(): string;
23
+ set iconName(value: string);
24
+ /**
25
+ * `AdwPreferencesPage:use-underline` — the title carries a mnemonic, which
26
+ * a search-result subtitle strips before showing it (:196-199).
27
+ */
28
+ get useUnderline(): boolean;
29
+ set useUnderline(value: boolean);
6
30
  /** Append a preferences group (or any view) to the page. */
7
31
  addGroup(view: View): void;
8
32
  /** Remove a previously-added group from the page. */
9
33
  removeGroup(view: View): void;
34
+ /**
35
+ * The groups this page contributes to a preferences search, in order.
36
+ *
37
+ * Reads the live children so a group added or removed later is indexed
38
+ * without an invalidation step.
39
+ */
40
+ searchGroups(): readonly NsSearchableGroup[];
10
41
  /** The vertical content stack holding the groups. */
11
42
  get groups(): StackLayout;
12
43
  }
@@ -1,27 +1,69 @@
1
1
  import { ScrollView, StackLayout, type EventData } from '@nativescript/core';
2
+ import type { AdwSidebarItemSpec, AdwSidebarSectionSpec, SidebarItemFilter } from './sidebar-model.js';
2
3
  /** Event name emitted when {@link AdwSidebar.selected} changes. Mirrors GObject `notify::selected`. */
3
4
  export declare const NOTIFY_SELECTED = "notify::selected";
5
+ /**
6
+ * Event name emitted on EVERY row tap, including a re-tap of the selected row.
7
+ * Mirrors the `AdwSidebar::activated` signal (adw-sidebar.c:1601-1612).
8
+ */
9
+ export declare const ACTIVATED = "activated";
4
10
  /** Payload of the `notify::selected` event. */
5
11
  export interface NotifySidebarSelectedEventData extends EventData {
6
- /** The newly-selected item index. */
12
+ /** The newly-selected item index, or -1 for no selection. */
7
13
  selected: number;
8
- /** The newly-selected item's label. */
14
+ /** The newly-selected item's label (`''` when nothing is selected). */
15
+ title: string;
16
+ /** The index the selection moved away from. */
17
+ previous: number;
18
+ /** True for a row tap; false for a programmatic set or a model change. */
19
+ interactive: boolean;
20
+ }
21
+ /** Payload of the `activated` event. */
22
+ export interface SidebarActivatedEventData extends EventData {
23
+ /** Flat index of the activated item. */
24
+ index: number;
25
+ /** The activated item's label. */
9
26
  title: string;
10
27
  }
11
28
  export declare class AdwSidebar extends ScrollView {
12
29
  /** The vertical list container. */
13
30
  protected readonly _list: StackLayout;
31
+ private readonly _state;
14
32
  private readonly _rows;
15
- private _items;
16
- private _selected;
17
33
  constructor();
18
- /** Set the navigation item labels. Rebuilds the tappable rows. */
34
+ /** Set the navigation item labels — one untitled section. Rebuilds the tappable rows. */
19
35
  setItems(items: string[]): void;
36
+ /** Set the full section model (titles, subtitles, icons, per-item `visible`/`enabled`). */
37
+ setSections(sections: readonly AdwSidebarSectionSpec[]): void;
38
+ private _rebuild;
39
+ /** Tap handler — the core applies the selection, then `activated` fires. */
40
+ private _activate;
20
41
  private _applySelection;
21
- /** The navigation item labels. */
42
+ /** The navigation item labels, in flat index order. */
22
43
  get items(): string[];
23
44
  set items(value: string[]);
24
- /** The selected item index. Highlights the row + emits `notify::selected`. */
45
+ /** The section model. */
46
+ get sections(): readonly AdwSidebarSectionSpec[];
47
+ set sections(value: readonly AdwSidebarSectionSpec[]);
48
+ /**
49
+ * The selected item index, or -1 for no selection. Writing an index that is
50
+ * not a valid position — out of range, negative, fractional — clears the
51
+ * selection rather than being ignored (adw-sidebar.c:3028-3029).
52
+ */
25
53
  get selected(): number;
26
54
  set selected(value: number);
55
+ /** The selected item, or undefined — `adw_sidebar_get_selected_item`. */
56
+ get selectedItem(): AdwSidebarItemSpec | undefined;
57
+ /**
58
+ * `Adw.Sidebar:mode`. Only the BEHAVIOURAL half is implemented here: page
59
+ * mode stops painting the selection (adw-sidebar.c:2948-2951). The boxed-list
60
+ * look it also switches to needs theme classes this surface does not have.
61
+ */
62
+ get mode(): 'sidebar' | 'page';
63
+ set mode(value: 'sidebar' | 'page');
64
+ /** `Adw.Sidebar:filter` — decides which rows render, never the selection index space. */
65
+ get filter(): SidebarItemFilter | null;
66
+ set filter(value: SidebarItemFilter | null);
67
+ /** Whether the FILTERED row list is empty — the `.empty` / placeholder state. */
68
+ get isEmpty(): boolean;
27
69
  }
@@ -1,6 +1,6 @@
1
1
  import { ActivityIndicator } from '@nativescript/core';
2
- /** Default spinner diameter in DIPs. */
3
- export declare const DEFAULT_SPINNER_SIZE = 32;
2
+ import { DEFAULT_SPINNER_SIZE } from './chrome.js';
3
+ export { DEFAULT_SPINNER_SIZE };
4
4
  export declare class AdwSpinner extends ActivityIndicator {
5
5
  private _size;
6
6
  constructor();
@@ -8,7 +8,12 @@ export declare class AdwSpinner extends ActivityIndicator {
8
8
  /** Whether the spinner is animating. Two-way bound to the indicator's `busy`. */
9
9
  get spinning(): boolean;
10
10
  set spinning(value: boolean);
11
- /** The spinner diameter in DIPs. */
11
+ /**
12
+ * The spinner diameter in DIPs — the DRAWN one, so reading it back after
13
+ * `size = 200` reports 64 and after `size = 8` reports 16. Adwaita's ring is
14
+ * bounded on both ends, and a getter that echoed the request would be
15
+ * describing something that is not on screen.
16
+ */
12
17
  get size(): number;
13
18
  set size(value: number);
14
19
  }
@@ -1,4 +1,5 @@
1
1
  import { GridLayout, Label, StackLayout, type EventData } from '@nativescript/core';
2
+ import type { AdwMenuEntry, SplitButtonDirection } from '@gjsify/adwaita-core';
2
3
  import { AdwIcon } from './adw-icon.js';
3
4
  /** Event name emitted when the main action part is tapped. Mirrors `Adw.SplitButton::clicked`. */
4
5
  export declare const CLICKED = "clicked";
@@ -8,37 +9,71 @@ export declare const MENU_TAPPED = "menuTapped";
8
9
  export interface MenuTappedEventData extends EventData {
9
10
  /** The chosen menu item label. */
10
11
  item: string;
11
- /** The chosen item's index in {@link AdwSplitButton.menu}. */
12
+ /** The chosen item's index in {@link AdwSplitButton.menu} — its GMenuModel POSITION. */
12
13
  index: number;
14
+ /** The chosen item's detailed action name, when the entry carried one. */
15
+ action?: string;
13
16
  }
14
17
  export declare class AdwSplitButton extends GridLayout {
15
18
  /** The main action part (column 0). */
16
19
  protected readonly _actionPart: StackLayout;
17
- /** The action label (shown when no `actionIcon` is set). */
20
+ /** The action label (shown in label mode). */
18
21
  protected readonly _actionLabel: Label;
19
- /** The action symbolic icon (shown when an `actionIcon` is set). */
22
+ /** The action symbolic icon (shown in icon mode). */
20
23
  protected readonly _actionIcon: AdwIcon;
21
24
  /** The dropdown-arrow part (column 1). */
22
25
  protected readonly _dropdownPart: GridLayout;
23
- /** The pan-down chevron. */
26
+ /** The direction arrow. */
24
27
  protected readonly _chevron: AdwIcon;
25
- private _menu;
26
- private _hasActionIcon;
27
- private _actionIconSvg;
28
+ private readonly _state;
29
+ /** Which of the two action views is currently parented. */
30
+ private _showingIcon;
31
+ private _disabled;
28
32
  constructor();
33
+ /**
34
+ * Present the dropdown menu and dispatch the choice BY POSITION.
35
+ *
36
+ * Nothing happens without a menu: "if the menu model is `NULL`, the dropdown
37
+ * is disabled" (adw-split-button.c:376-378).
38
+ */
29
39
  private _openMenu;
30
- /** The main action button's text label (used when no `actionIcon` is set). */
40
+ /** Repaint both halves from the state machine. */
41
+ private _render;
42
+ /**
43
+ * The main action button's text label, or `''` when the action half shows an
44
+ * icon or nothing — never the stale value behind a swapped-out view.
45
+ */
31
46
  get label(): string;
32
47
  set label(value: string);
33
48
  /**
34
- * A symbolic SVG for the action part (e.g. `documentSaveSymbolic`). When set,
35
- * the icon replaces the text label — matching `Adw.SplitButton`'s icon mode.
49
+ * A symbolic SVG for the action part (e.g. `documentSaveSymbolic`). Setting
50
+ * one replaces the label, clearing it returns the action half to its label —
51
+ * the mutual exclusion `Adw.SplitButton` enforces (adw-split-button.c:749-771).
52
+ *
53
+ * The SVG string IS the icon identity here, so it is what the state machine
54
+ * stores as the icon name; NS resolves no icon theme.
36
55
  */
37
56
  get actionIcon(): string;
38
57
  set actionIcon(svg: string);
39
- /** The dropdown menu items (opened as a native `action()` sheet on arrow tap). */
40
- get menu(): string[];
41
- set menu(value: string[]);
58
+ /** The dropdown menu entries (opened as a native `action()` sheet on arrow tap). */
59
+ get menu(): readonly AdwMenuEntry[];
60
+ set menu(value: readonly (string | AdwMenuEntry)[]);
61
+ /** The direction the arrow points (and, on GTK, the popup opens). */
62
+ get direction(): SplitButtonDirection;
63
+ set direction(value: SplitButtonDirection);
64
+ /**
65
+ * The dropdown tooltip as set — `''` while unset. Resolve it through
66
+ * `resolveDropdownTooltip()` for what should be shown; the NS sheet has no
67
+ * tooltip surface, so this is carried for parity and for host bindings.
68
+ */
69
+ get dropdownTooltip(): string;
70
+ set dropdownTooltip(value: string);
71
+ /** Whether an underline in the label marks a mnemonic. */
72
+ get useUnderline(): boolean;
73
+ set useUnderline(value: boolean);
74
+ /** Whether the control is insensitive: dimmed, and emitting neither signal. */
75
+ get disabled(): boolean;
76
+ set disabled(value: boolean);
42
77
  /** The main action part (for composing a custom content widget). */
43
78
  get actionButton(): StackLayout;
44
79
  }
@@ -9,19 +9,16 @@ export declare class AdwStatusPage extends GridLayout {
9
9
  /** The large glyph label (shown when `iconText` is set — the legacy fallback). */
10
10
  protected readonly _iconLabel: Label;
11
11
  private _iconGlyph;
12
- /** The icon node currently in the stack (the AdwIcon or the glyph Label), or null. */
13
- private _iconNode;
14
12
  /** The bold title label. */
15
13
  protected readonly _titleLabel: Label;
16
- /** The dim description label (lazily in the tree — only when set). */
14
+ /** The dim description label. */
17
15
  protected readonly _descriptionLabel: Label;
18
- private _hasDescription;
19
16
  private _child;
20
17
  constructor();
21
18
  /**
22
19
  * A large Adwaita symbolic SVG string shown above the title (e.g.
23
20
  * `folderSymbolic`). Setting a non-empty value shows the symbolic icon; empty
24
- * removes it. Matches `Adw.StatusPage`'s themed icon. Mutually exclusive with
21
+ * hides it. Matches `Adw.StatusPage`'s themed icon. Mutually exclusive with
25
22
  * {@link iconText} — whichever was set last wins.
26
23
  */
27
24
  get icon(): string;
@@ -33,17 +30,15 @@ export declare class AdwStatusPage extends GridLayout {
33
30
  */
34
31
  get iconText(): string;
35
32
  set iconText(value: string);
36
- /** Swap the icon node at the TOP of the stack (above the title), or clear it. */
37
- private _setIconNode;
38
33
  /** The icon fill colour (hex). Defaults to a dim grey; light/dark callers may override. */
39
34
  get iconColor(): string;
40
35
  set iconColor(value: string);
41
- /** The page title (bold, centered). */
36
+ /** The page title (bold, centered). An empty title takes no space. */
42
37
  get title(): string;
43
38
  set title(value: string);
44
39
  /**
45
- * The dim description below the title. Setting a non-empty value adds it;
46
- * empty removes it — so a descriptionless page has no blank gap.
40
+ * The dim description below the title. An empty description takes no space,
41
+ * so a descriptionless page has no blank gap.
47
42
  */
48
43
  get description(): string;
49
44
  set description(value: string);
@@ -10,8 +10,28 @@ export interface NotifyActiveEventData extends EventData {
10
10
  export declare class AdwSwitchRow extends AdwActionRow {
11
11
  /** The suffix Switch control. */
12
12
  protected readonly _switch: Switch;
13
+ /** The headless active flag + its notify rule (ADR 0004). */
14
+ private readonly _switchState;
13
15
  constructor();
14
- /** Whether the switch is on. Two-way bound to the suffix `Switch.checked`. */
16
+ /** Whether the switch is on. */
15
17
  get active(): boolean;
16
18
  set active(value: boolean);
19
+ /**
20
+ * The row was tapped — invert the state, then emit `activated` like any
21
+ * other action row (adw-switch-row.c:23-27 via the activatable widget).
22
+ *
23
+ * UNVERIFIED OFF-DEVICE: this assumes a tap that lands on the `Switch`
24
+ * itself is consumed by it and does NOT also reach the row's tap gesture. If
25
+ * a platform were to bubble it, the handle would toggle twice. Both Android
26
+ * (a clickable native widget consumes the touch) and iOS (a `UISwitch` claims
27
+ * the gesture) are expected to consume it, but only a device run can confirm
28
+ * that — `row-press.ts` reasons about the same propagation for its highlight.
29
+ */
30
+ activate(): void;
31
+ /**
32
+ * Push a state transition out to the Switch and emit `notify::active` — only
33
+ * when something actually changed, which is the `g_object_notify` gate
34
+ * libadwaita puts on the same transition (C:224-225 → :76).
35
+ */
36
+ private _apply;
17
37
  }