@gjsify/adwaita-nativescript 0.44.0 → 0.46.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 (115) hide show
  1. package/lib/esm/index.js +1 -1
  2. package/lib/esm/namespace.js +1 -0
  3. package/lib/esm/widgets/adw-about-dialog.js +1 -1
  4. package/lib/esm/widgets/adw-action-row.js +1 -1
  5. package/lib/esm/widgets/adw-avatar.js +1 -1
  6. package/lib/esm/widgets/adw-banner.js +1 -1
  7. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  8. package/lib/esm/widgets/adw-button-content.js +1 -1
  9. package/lib/esm/widgets/adw-button-row.js +1 -1
  10. package/lib/esm/widgets/adw-carousel.js +1 -1
  11. package/lib/esm/widgets/adw-clamp.js +1 -1
  12. package/lib/esm/widgets/adw-combo-row.js +1 -1
  13. package/lib/esm/widgets/adw-data-grid.js +1 -1
  14. package/lib/esm/widgets/adw-entry-row.js +1 -1
  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-icon.js +1 -1
  18. package/lib/esm/widgets/adw-image-button.js +1 -1
  19. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  20. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  21. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  22. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  23. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  24. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  25. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  26. package/lib/esm/widgets/adw-sidebar.js +1 -1
  27. package/lib/esm/widgets/adw-slider-row.js +1 -1
  28. package/lib/esm/widgets/adw-spin-row.js +1 -1
  29. package/lib/esm/widgets/adw-spinner.js +1 -1
  30. package/lib/esm/widgets/adw-split-button.js +1 -1
  31. package/lib/esm/widgets/adw-status-page.js +1 -1
  32. package/lib/esm/widgets/adw-switch-row.js +1 -1
  33. package/lib/esm/widgets/adw-tab-view.js +1 -1
  34. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  35. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  36. package/lib/esm/widgets/adw-view-stack.js +1 -1
  37. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  38. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  39. package/lib/esm/widgets/builder-slots.js +1 -0
  40. package/lib/esm/widgets/entry-row-view.js +1 -1
  41. package/lib/esm/widgets/{adw-button.js → gtk-button.js} +1 -1
  42. package/lib/esm/widgets/gtk-drop-down.js +1 -0
  43. package/lib/esm/widgets/gtk-entry.js +1 -0
  44. package/lib/esm/widgets/{adw-menu-button.js → gtk-menu-button.js} +1 -1
  45. package/lib/esm/widgets/host-insets.android.js +1 -0
  46. package/lib/esm/widgets/host-insets.ios.js +1 -0
  47. package/lib/esm/widgets/host-insets.js +1 -0
  48. package/lib/esm/widgets/icon-path.js +2 -2
  49. package/lib/esm/widgets/icons.android.js +1 -1
  50. package/lib/esm/widgets/icons.ios.js +1 -1
  51. package/lib/esm/widgets/index.js +1 -1
  52. package/lib/esm/widgets/split-view-base.js +1 -1
  53. package/lib/esm/widgets/view-switcher-base.js +1 -1
  54. package/lib/esm/widgets/window-insets.js +1 -1
  55. package/lib/esm/widgets/wrap-box-layout.js +1 -1
  56. package/lib/esm/widgets/xml-values.js +1 -0
  57. package/lib/types/index.d.ts +2 -1
  58. package/lib/types/namespace.d.ts +92 -0
  59. package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
  60. package/lib/types/widgets/adw-action-row.d.ts +17 -2
  61. package/lib/types/widgets/adw-avatar.d.ts +1 -1
  62. package/lib/types/widgets/adw-banner.d.ts +2 -2
  63. package/lib/types/widgets/adw-bottom-sheet.d.ts +22 -3
  64. package/lib/types/widgets/adw-button-content.d.ts +4 -4
  65. package/lib/types/widgets/adw-button-row.d.ts +4 -4
  66. package/lib/types/widgets/adw-carousel.d.ts +16 -4
  67. package/lib/types/widgets/adw-clamp.d.ts +15 -3
  68. package/lib/types/widgets/adw-combo-row.d.ts +3 -3
  69. package/lib/types/widgets/adw-data-grid.d.ts +1 -1
  70. package/lib/types/widgets/adw-entry-row.d.ts +4 -4
  71. package/lib/types/widgets/adw-expander-row.d.ts +22 -2
  72. package/lib/types/widgets/adw-header-bar.d.ts +15 -2
  73. package/lib/types/widgets/adw-icon.d.ts +3 -3
  74. package/lib/types/widgets/adw-image-button.d.ts +3 -3
  75. package/lib/types/widgets/adw-navigation-split-view.d.ts +1 -1
  76. package/lib/types/widgets/adw-navigation-view.d.ts +13 -2
  77. package/lib/types/widgets/adw-overlay-split-view.d.ts +1 -1
  78. package/lib/types/widgets/adw-password-entry-row.d.ts +2 -2
  79. package/lib/types/widgets/adw-preferences-dialog.d.ts +9 -2
  80. package/lib/types/widgets/adw-preferences-group.d.ts +13 -1
  81. package/lib/types/widgets/adw-preferences-page.d.ts +9 -2
  82. package/lib/types/widgets/adw-sidebar.d.ts +1 -1
  83. package/lib/types/widgets/adw-slider-row.d.ts +4 -4
  84. package/lib/types/widgets/adw-spin-row.d.ts +4 -4
  85. package/lib/types/widgets/adw-spinner.d.ts +2 -2
  86. package/lib/types/widgets/adw-split-button.d.ts +23 -7
  87. package/lib/types/widgets/adw-status-page.d.ts +11 -3
  88. package/lib/types/widgets/adw-switch-row.d.ts +1 -1
  89. package/lib/types/widgets/adw-tab-view.d.ts +2 -2
  90. package/lib/types/widgets/adw-toast-overlay.d.ts +2 -1
  91. package/lib/types/widgets/adw-toggle-group.d.ts +2 -2
  92. package/lib/types/widgets/adw-toolbar-view.d.ts +22 -4
  93. package/lib/types/widgets/adw-view-stack.d.ts +3 -2
  94. package/lib/types/widgets/adw-view-switcher-bar.d.ts +2 -2
  95. package/lib/types/widgets/adw-wrap-box.d.ts +7 -7
  96. package/lib/types/widgets/builder-slots.d.ts +16 -0
  97. package/lib/types/widgets/entry-row-view.d.ts +1 -1
  98. package/lib/types/widgets/{adw-button.d.ts → gtk-button.d.ts} +7 -2
  99. package/lib/types/widgets/{adw-drop-down.d.ts → gtk-drop-down.d.ts} +4 -4
  100. package/lib/types/widgets/{adw-entry.d.ts → gtk-entry.d.ts} +6 -6
  101. package/lib/types/widgets/{adw-menu-button.d.ts → gtk-menu-button.d.ts} +3 -3
  102. package/lib/types/widgets/host-insets.android.d.ts +4 -0
  103. package/lib/types/widgets/host-insets.d.ts +13 -0
  104. package/lib/types/widgets/host-insets.ios.d.ts +4 -0
  105. package/lib/types/widgets/icon-path.d.ts +72 -7
  106. package/lib/types/widgets/index.d.ts +21 -14
  107. package/lib/types/widgets/split-button.d.ts +2 -2
  108. package/lib/types/widgets/split-view-base.d.ts +15 -6
  109. package/lib/types/widgets/view-switcher-base.d.ts +1 -1
  110. package/lib/types/widgets/window-insets.d.ts +24 -0
  111. package/lib/types/widgets/wrap-box-layout.d.ts +3 -60
  112. package/lib/types/widgets/xml-values.d.ts +18 -0
  113. package/package.json +11 -8
  114. package/lib/esm/widgets/adw-drop-down.js +0 -1
  115. package/lib/esm/widgets/adw-entry.js +0 -1
@@ -1,4 +1,5 @@
1
- import { GridLayout, Label, StackLayout, View } from '@nativescript/core';
1
+ import type { View } from '@nativescript/core';
2
+ import { GridLayout, Label, StackLayout } from '@nativescript/core';
2
3
  import { AdwIcon } from './adw-icon.js';
3
4
  export declare class AdwStatusPage extends GridLayout {
4
5
  /** The centered vertical stack. */
@@ -21,8 +22,8 @@ export declare class AdwStatusPage extends GridLayout {
21
22
  * hides it. Matches `Adw.StatusPage`'s themed icon. Mutually exclusive with
22
23
  * {@link iconText} — whichever was set last wins.
23
24
  */
24
- get icon(): string;
25
- set icon(value: string);
25
+ get iconName(): string;
26
+ set iconName(value: string);
26
27
  /**
27
28
  * A large glyph shown above the title (emoji / font glyph — the legacy
28
29
  * fallback for callers that have no symbolic SVG). Mutually exclusive with
@@ -46,4 +47,11 @@ export declare class AdwStatusPage extends GridLayout {
46
47
  setChild(view: View | null): void;
47
48
  /** The currently-installed child, or `null`. */
48
49
  get child(): View | null;
50
+ /**
51
+ * The one destination an XML child can have: the slot under the description,
52
+ * where `AdwStatusPage:child` goes. The name is ignored because
53
+ * `<AdwStatusPage.child>` and a bare child mean the same thing — the shape
54
+ * `AdwClamp` already has.
55
+ */
56
+ _addChildFromBuilder(_name: string, view: View): void;
49
57
  }
@@ -15,7 +15,7 @@ export declare class AdwSwitchRow extends AdwActionRow {
15
15
  constructor();
16
16
  /** Whether the switch is on. */
17
17
  get active(): boolean;
18
- set active(value: boolean);
18
+ set active(value: boolean | string);
19
19
  /**
20
20
  * The row was tapped — invert the state, then emit `activated` like any
21
21
  * other action row (adw-switch-row.c:23-27 via the activatable widget).
@@ -55,7 +55,7 @@ export declare class AdwTabView extends GridLayout {
55
55
  get selectedIndex(): number;
56
56
  /** The selected page index. Setting it IGNORES a non-integer or out-of-range value. */
57
57
  get selected(): number;
58
- set selected(value: number);
58
+ set selected(raw: number | string);
59
59
  isClosing(id: string): boolean;
60
60
  setSelectedPage(id: string | null): boolean;
61
61
  selectNthPage(n: number): boolean;
@@ -103,7 +103,7 @@ export declare class AdwTabView extends GridLayout {
103
103
  * visible before this lift stays visible unless asked otherwise.
104
104
  */
105
105
  get autohide(): boolean;
106
- set autohide(value: boolean);
106
+ set autohide(raw: boolean | string);
107
107
  /** `Adw.TabView:default-icon` — what a PINNED page with no icon of its own shows. */
108
108
  get defaultIcon(): string | null;
109
109
  set defaultIcon(value: string | null);
@@ -1,4 +1,5 @@
1
- import { Button, GridLayout, Label, View } from '@nativescript/core';
1
+ import type { View } from '@nativescript/core';
2
+ import { Button, GridLayout, Label } from '@nativescript/core';
2
3
  import { AdwToast } from '@gjsify/adwaita-core';
3
4
  import type { AdwToastOptions } from '@gjsify/adwaita-core';
4
5
  export { AdwToast, AdwToastQueue, DEFAULT_TOAST_TIMEOUT } from '@gjsify/adwaita-core';
@@ -29,8 +29,8 @@ export declare class AdwToggleGroup extends StackLayout {
29
29
  /** Mark only the selected segment `.active` (the raised white pill). */
30
30
  private _applySelection;
31
31
  /** The selected segment index. Swaps the active pill + emits `notify::selected`. */
32
- get selected(): number;
33
- set selected(value: number);
32
+ get active(): number;
33
+ set active(raw: number | string);
34
34
  /** The selected segment's label, or `''` when out of range. */
35
35
  get selectedValue(): string;
36
36
  }
@@ -1,4 +1,5 @@
1
- import { GridLayout, StackLayout, View } from '@nativescript/core';
1
+ import type { View } from '@nativescript/core';
2
+ import { GridLayout, StackLayout } from '@nativescript/core';
2
3
  import { type AdwToolbarStyle } from './chrome.js';
3
4
  export declare class AdwToolbarView extends GridLayout {
4
5
  /** The top-bar slot (row 0) — stack of header bars / toolbars. */
@@ -20,6 +21,16 @@ export declare class AdwToolbarView extends GridLayout {
20
21
  addBottomBar(view: View): void;
21
22
  /** Set (or replace) the main content view. Pass `null` to clear it. */
22
23
  setContent(view: View | null): void;
24
+ /**
25
+ * XML inflation — route a template's child through the slot API.
26
+ *
27
+ * `<AdwToolbarView.topBar>` / `.bottomBar` / `.content` arrive here as those
28
+ * names; anything else (a bare child) is the content, which is the one slot a
29
+ * toolbar view cannot do without. Without this the `GridLayout` default put
30
+ * every child in row 0: measured on Android, a top bar and the content were
31
+ * painted ON TOP OF EACH OTHER in the bar row while row 1 stayed empty.
32
+ */
33
+ _addChildFromBuilder(name: string, view: View): void;
23
34
  /** The currently-installed content view, or `null`. */
24
35
  get content(): View | null;
25
36
  /** The top-bar slot container. */
@@ -34,10 +45,10 @@ export declare class AdwToolbarView extends GridLayout {
34
45
  set bottomBarStyle(value: AdwToolbarStyle);
35
46
  /** `Adw.ToolbarView:extend-content-to-top-edge` — draw the top bar OVER the content. */
36
47
  get extendContentToTopEdge(): boolean;
37
- set extendContentToTopEdge(value: boolean);
48
+ set extendContentToTopEdge(raw: boolean | string);
38
49
  /** `Adw.ToolbarView:extend-content-to-bottom-edge` — draw the bottom bar OVER the content. */
39
50
  get extendContentToBottomEdge(): boolean;
40
- set extendContentToBottomEdge(value: boolean);
51
+ set extendContentToBottomEdge(raw: boolean | string);
41
52
  /**
42
53
  * Put each bar box in its own row, or — when the content extends under it —
43
54
  * in the CONTENT row pinned to that edge, which is how an NS `GridLayout`
@@ -54,7 +65,14 @@ export declare class AdwToolbarView extends GridLayout {
54
65
  */
55
66
  private _restackBars;
56
67
  /**
57
- * Pay each edge's inset out of the slot that sits on it.
68
+ * Pay each edge's inset out of the slot that sits on it — the part of it this
69
+ * widget still owes.
70
+ *
71
+ * `insetsOwedBy` drops what the HOST already paid, which on Android is the bottom
72
+ * edge (the page's `LayoutBase`, because only its branch also folds in the keyboard)
73
+ * and never the top (`host-insets.android.ts` hands that edge back, because only the
74
+ * top-bar box paints it in the header colour). Without it the inset was applied
75
+ * twice: 142 px + 142 px above the header bar on emulator-5554.
58
76
  *
59
77
  * The assignment is decided by the pure sibling (`toolbarViewInsetPadding`); this
60
78
  * only spells it in NativeScript. Where that module says "the content pays", the
@@ -1,4 +1,5 @@
1
- import { GridLayout, View, type EventData } from '@nativescript/core';
1
+ import type { View } from '@nativescript/core';
2
+ import { GridLayout, type EventData } from '@nativescript/core';
2
3
  import { type AdwViewStackPage, type ViewStackNotifyPayload } from './view-stack-state.js';
3
4
  export type { AdwViewStackPage };
4
5
  /** Event name emitted when the visible child changes. Mirrors GObject `notify::visible-child`. */
@@ -40,7 +41,7 @@ export declare class AdwViewStack extends GridLayout {
40
41
  get pages(): readonly AdwViewStackPage[];
41
42
  /** The visible page index, `-1` when nothing is selected. Swaps the visible page + emits. */
42
43
  get visibleChildIndex(): number;
43
- set visibleChildIndex(value: number);
44
+ set visibleChildIndex(raw: number | string);
44
45
  /** The visible page name (`Adw.ViewStack.visible-child-name`), `''` for none. */
45
46
  get visibleChildName(): string;
46
47
  set visibleChildName(name: string | null | undefined);
@@ -1,5 +1,5 @@
1
1
  import { GridLayout } from '@nativescript/core';
2
- import { AdwViewStack } from './adw-view-stack.js';
2
+ import type { AdwViewStack } from './adw-view-stack.js';
3
3
  export declare class AdwViewSwitcherBar extends GridLayout {
4
4
  /** The horizontal (homogeneous) row of buttons. */
5
5
  private readonly _bar;
@@ -19,7 +19,7 @@ export declare class AdwViewSwitcherBar extends GridLayout {
19
19
  * where a header-bar `AdwViewSwitcher` takes over.
20
20
  */
21
21
  get reveal(): boolean;
22
- set reveal(value: boolean);
22
+ set reveal(raw: boolean | string);
23
23
  /**
24
24
  * Whether the bar is actually shown. READ-ONLY: a one-page stack keeps it
25
25
  * collapsed however loudly the layout asks (adw-view-switcher-bar.c:125).
@@ -47,31 +47,31 @@ export declare class AdwWrapBox extends FlexboxLayout {
47
47
  private _applyOrder;
48
48
  /** Gap between items in a line, in {@link childSpacingUnit}. Defaults to 0, as in C. */
49
49
  get childSpacing(): number;
50
- set childSpacing(value: number);
50
+ set childSpacing(value: number | string);
51
51
  /** The unit {@link childSpacing} is written in. Defaults to `px`, as in C. */
52
52
  get childSpacingUnit(): AdwLengthUnit;
53
53
  set childSpacingUnit(value: AdwLengthUnit);
54
54
  /** Gap between wrapped lines, in {@link lineSpacingUnit}. Defaults to 0, as in C. */
55
55
  get lineSpacing(): number;
56
- set lineSpacing(value: number);
56
+ set lineSpacing(value: number | string);
57
57
  /** The unit {@link lineSpacing} is written in. Defaults to `px`, as in C. */
58
58
  get lineSpacingUnit(): AdwLengthUnit;
59
59
  set lineSpacingUnit(value: AdwLengthUnit);
60
60
  /** Where the children sit ALONG the line (main axis): 0 start, 0.5 middle, 1 end. */
61
61
  get align(): number;
62
- set align(value: number);
62
+ set align(raw: number | string);
63
63
  /** Whether and how each line is stretched to fill the widget. */
64
64
  get justify(): AdwWrapBoxJustify;
65
65
  set justify(value: AdwWrapBoxJustify);
66
66
  /** Whether the FINAL line is justified too. Default false, as in C. */
67
67
  get justifyLastLine(): boolean;
68
- set justifyLastLine(value: boolean);
68
+ set justifyLastLine(raw: boolean | string);
69
69
  /** Whether every line takes the same amount of space. */
70
70
  get lineHomogeneous(): boolean;
71
- set lineHomogeneous(value: boolean);
71
+ set lineHomogeneous(raw: boolean | string);
72
72
  /** Whether lines wrap upwards (horizontal) / towards the start (vertical). */
73
73
  get wrapReverse(): boolean;
74
- set wrapReverse(value: boolean);
74
+ set wrapReverse(raw: boolean | string);
75
75
  /** Whether an overflowing line squeezes its children or lets them spill. */
76
76
  get wrapPolicy(): AdwWrapPolicy;
77
77
  set wrapPolicy(value: AdwWrapPolicy);
@@ -88,7 +88,7 @@ export declare class AdwWrapBox extends FlexboxLayout {
88
88
  * maximum-size property to cap a line with.
89
89
  */
90
90
  get naturalLineLength(): number;
91
- set naturalLineLength(value: number);
91
+ set naturalLineLength(raw: number | string);
92
92
  /** The unit {@link naturalLineLength} is written in. Defaults to `px`, as in C. */
93
93
  get naturalLineLengthUnit(): AdwLengthUnit;
94
94
  set naturalLineLengthUnit(value: AdwLengthUnit);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The slot an XML child asks for, or `fallback` when it asks for nothing this
3
+ * widget knows.
4
+ *
5
+ * `slots` are the widget's own property names, because that is what NativeScript's
6
+ * complex-property syntax spells: `<AdwToolbarView.topBar>` reaches
7
+ * `_addChildFromBuilder('topBar', …)`. A bare `<AdwHeaderBar>` child arrives under
8
+ * its ELEMENT name instead, which is never a slot name and so takes the fallback —
9
+ * the same shape as GtkBuildable's untyped `<child>`.
10
+ *
11
+ * A dotted `name` is reduced to its last segment first. NativeScript already does
12
+ * that before it calls us, but a caller that does not is the difference between
13
+ * "no slot" and "the wrong slot", and this returns the answer to a question about
14
+ * a widget's own tree.
15
+ */
16
+ export declare function resolveBuilderSlot<Slot extends string, Fallback extends string>(name: unknown, slots: readonly Slot[], fallback: Fallback): Slot | Fallback;
@@ -39,7 +39,7 @@ export interface PasswordEntryRowViews {
39
39
  };
40
40
  /** The peek toggle, whose `icon` takes an Adwaita symbolic SVG string. */
41
41
  peekButton: {
42
- icon: string;
42
+ iconName: string;
43
43
  };
44
44
  }
45
45
  /** Base class list of an entry row, before the state classes. */
@@ -6,14 +6,19 @@ import { Button } from '@nativescript/core';
6
6
  * The class list is `@gjsify/adwaita-core`'s, not a local table: this widget's own
7
7
  * one was MISSING `circular`, which the browser element had, and neither file could
8
8
  * see the other. `circular` is now here because the shared table says it exists.
9
+ *
10
+ * STILL `Adw…`, on a class that is not: the variants ARE libadwaita style classes
11
+ * (`.suggested-action`, `.pill`, `_buttons.scss`), so the prefix names what they are.
12
+ * ADR 0034 clause 1 renames WIDGETS after the library owning their GType; a style-class
13
+ * vocabulary is not a widget, and renaming it would have moved a true name to a false one.
9
14
  */
10
15
  export type AdwButtonVariant = 'default' | AdwButtonStyleClass;
11
- export declare class AdwButton extends Button {
16
+ export declare class GtkButton extends Button {
12
17
  private _variant;
13
18
  constructor();
14
19
  /**
15
20
  * The Adwaita style variant. Setting it swaps the corresponding CSS class
16
- * (one of `AdwButton.variantClasses`) onto the button,
21
+ * (one of `GtkButton.variantClasses`) onto the button,
17
22
  * preserving the base `adw-button` class. Note that `pill` is the rounded
18
23
  * SHAPE and combines with no other variant here (set the shape OR the accent
19
24
  * intent — matching how this CSS subset expresses them as flat classes).
@@ -1,7 +1,7 @@
1
1
  import { Label, StackLayout, type EventData } from '@nativescript/core';
2
2
  import type { AdwComboOption } from '@gjsify/adwaita-core';
3
3
  import { AdwIcon } from './adw-icon.js';
4
- /** Event name emitted when {@link AdwDropDown.selected} changes through a pick. Mirrors GObject `notify::selected`. */
4
+ /** Event name emitted when {@link GtkDropDown.selected} changes through a pick. Mirrors GObject `notify::selected`. */
5
5
  export declare const NOTIFY_SELECTED = "notify::selected";
6
6
  /** Payload of the `notify::selected` event. */
7
7
  export interface NotifyDropDownSelectedEventData extends EventData {
@@ -12,7 +12,7 @@ export interface NotifyDropDownSelectedEventData extends EventData {
12
12
  /** The newly-selected option's `label` — what the button now shows. */
13
13
  label: string;
14
14
  }
15
- export declare class AdwDropDown extends StackLayout {
15
+ export declare class GtkDropDown extends StackLayout {
16
16
  /** The button label — the selected option. */
17
17
  protected readonly _label: Label;
18
18
  /** The down-chevron — a real Adwaita `pan-down-symbolic` icon. */
@@ -29,7 +29,7 @@ export declare class AdwDropDown extends StackLayout {
29
29
  set options(value: AdwComboOption[]);
30
30
  /** The selected option index (`Gtk.DropDown:selected`). */
31
31
  get selected(): number;
32
- set selected(value: number);
32
+ set selected(raw: number | string);
33
33
  /** The selected option's `value`, or `''` when out of range. */
34
34
  get selectedValue(): string;
35
35
  set selectedValue(value: string);
@@ -38,7 +38,7 @@ export declare class AdwDropDown extends StackLayout {
38
38
  /**
39
39
  * Optional title shown atop the chooser sheet. A SUBSTITUTION affordance:
40
40
  * GTK's popover has no title, but a bare native sheet gives no clue what is
41
- * being chosen — the same reason `AdwMenuButton` carries `menuTitle`.
41
+ * being chosen — the same reason `GtkMenuButton` carries `menuTitle`.
42
42
  */
43
43
  get chooserTitle(): string;
44
44
  set chooserTitle(value: string);
@@ -1,5 +1,5 @@
1
1
  import { GridLayout, TextField, type EventData } from '@nativescript/core';
2
- /** Event name emitted when {@link AdwEntry.text} changes. Mirrors GObject `notify::text`. */
2
+ /** Event name emitted when {@link GtkEntry.text} changes. Mirrors GObject `notify::text`. */
3
3
  export declare const NOTIFY_TEXT = "notify::text";
4
4
  /** Event name emitted when the return key is pressed — `Gtk.Entry::activate`. */
5
5
  export declare const ACTIVATE = "activate";
@@ -10,7 +10,7 @@ export interface NotifyEntryTextEventData extends EventData {
10
10
  /** The new number of CHARACTERS (not UTF-16 units). */
11
11
  textLength: number;
12
12
  }
13
- export declare class AdwEntry extends GridLayout {
13
+ export declare class GtkEntry extends GridLayout {
14
14
  /** The real input. Chrome-less: the box around it paints the Adwaita surface. */
15
15
  protected readonly _field: TextField;
16
16
  private _text;
@@ -31,13 +31,13 @@ export declare class AdwEntry extends GridLayout {
31
31
  get textLength(): number;
32
32
  /** Maximum number of characters, `0` = unlimited. */
33
33
  get maxLength(): number;
34
- set maxLength(value: number);
34
+ set maxLength(raw: number | string);
35
35
  /** Placeholder shown while the entry is empty (`Gtk.Entry:placeholder-text`). */
36
- get placeholder(): string;
37
- set placeholder(value: string);
36
+ get placeholderText(): string;
37
+ set placeholderText(value: string);
38
38
  /** Whether the entry accepts edits (`GtkEditable:editable`). */
39
39
  get editable(): boolean;
40
- set editable(value: boolean);
40
+ set editable(raw: boolean | string);
41
41
  /** The inner `TextField` — for focus, selection and host-specific keyboard options. */
42
42
  get field(): TextField;
43
43
  }
@@ -4,7 +4,7 @@ import { AdwImageButton } from './adw-image-button.js';
4
4
  /** Event name emitted when a menu item is chosen. */
5
5
  export declare const MENU_ITEM_ACTIVATED = "menuItemActivated";
6
6
  /**
7
- * One entry in an {@link AdwMenuButton}'s menu — `@gjsify/adwaita-core`'s
7
+ * One entry in an {@link GtkMenuButton}'s menu — `@gjsify/adwaita-core`'s
8
8
  * {@link AdwMenuEntry}, under the name this widget has always used.
9
9
  *
10
10
  * It used to be a THIRD declaration of the same shape (the browser element had a
@@ -19,10 +19,10 @@ export interface MenuItemActivatedEventData extends EventData {
19
19
  id: string;
20
20
  /** The chosen item's label. */
21
21
  label: string;
22
- /** The chosen item's index in {@link AdwMenuButton.menuItems}. */
22
+ /** The chosen item's index in {@link GtkMenuButton.menuItems}. */
23
23
  index: number;
24
24
  }
25
- export declare class AdwMenuButton extends AdwImageButton {
25
+ export declare class GtkMenuButton extends AdwImageButton {
26
26
  private _items;
27
27
  private _menuTitle;
28
28
  constructor();
@@ -0,0 +1,4 @@
1
+ import type { View } from '@nativescript/core';
2
+ import { type HostPaidEdges, type WindowInsets } from './window-insets.js';
3
+ /** Settle which window-inset edges `view` still owes. See {@link resolveHostInsets}. */
4
+ export declare function resolveHostInsets(view: View, insets: WindowInsets): HostPaidEdges;
@@ -0,0 +1,13 @@
1
+ import type { View } from '@nativescript/core';
2
+ import { type HostPaidEdges, type WindowInsets } from './window-insets.js';
3
+ /**
4
+ * Settle which window-inset edges `view` still owes, adjusting the host where the
5
+ * widget paints an edge better than the host can.
6
+ *
7
+ * Takes the READING as well as the view, and is called on every inset application
8
+ * rather than once at `loaded`, because an Android variant that hands an edge back to
9
+ * the host must not do so before it holds a reading to pay that edge with. Idempotent:
10
+ * a page with two toolbar views resolves twice, and a view re-attached to another page
11
+ * resolves again.
12
+ */
13
+ export declare function resolveHostInsets(_view: View, _insets: WindowInsets): HostPaidEdges;
@@ -0,0 +1,4 @@
1
+ import type { View } from '@nativescript/core';
2
+ import { type HostPaidEdges, type WindowInsets } from './window-insets.js';
3
+ /** Settle which window-inset edges `view` still owes. See {@link resolveHostInsets}. */
4
+ export declare function resolveHostInsets(_view: View, _insets: WindowInsets): HostPaidEdges;
@@ -8,20 +8,74 @@ export interface SymbolicIconOptions {
8
8
  /** Fill colour as a hex string (`#RRGGBB` / `#AARRGGBB`). Default = light fg. */
9
9
  color?: string;
10
10
  }
11
- /** One fillable path of a symbolic icon: its path data + its own fill opacity. */
11
+ /**
12
+ * A 2D affine transform in SVG's own `matrix(a b c d e f)` order.
13
+ *
14
+ * `[a c e; b d f; 0 0 1]` — the same six numbers `android.graphics.Matrix.setValues`
15
+ * and `CGAffineTransformMake` take, so neither renderer has to convert anything.
16
+ */
17
+ export type IconTransform = readonly [number, number, number, number, number, number];
18
+ /** The identity — nothing to apply. */
19
+ export declare const IDENTITY_TRANSFORM: IconTransform;
20
+ /** One fillable path of a symbolic icon. */
12
21
  export interface IconPath {
13
22
  /** SVG `d` path data (the `androidx` `PathParser` `pathData` grammar). */
14
23
  d: string;
15
24
  /** Per-path fill opacity in [0, 1] — Adwaita dims accent sub-shapes (e.g. the
16
25
  * filled panel of `sidebar-show`); defaults to 1 when the path has none. */
17
26
  opacity: number;
27
+ /**
28
+ * This path's own `transform`, composed under every enclosing `<g transform=…>`.
29
+ *
30
+ * {@link IDENTITY_TRANSFORM} for the icons that need none. NOT optional: an
31
+ * optional field is one a renderer forgets to read, and forgetting it is exactly
32
+ * the defect this exists to fix.
33
+ */
34
+ transform: IconTransform;
35
+ /**
36
+ * `fill-rule` — `evenodd`, or `nonzero` (SVG's initial value) when unset.
37
+ *
38
+ * Neither renderer set one, so both drew the platform default and every icon
39
+ * declaring `evenodd` filled a hole it should have carved.
40
+ */
41
+ fillRule: 'nonzero' | 'evenodd';
42
+ /**
43
+ * The path's own `fill`, when it names a colour instead of inheriting one.
44
+ *
45
+ * `null` means "use the caller's colour" — the symbolic case, and the common one.
46
+ * A shipped icon that hardcodes `#ed333b` for a critical battery is NOT symbolic,
47
+ * and drawing it in one colour is what turned a red battery grey. The icon
48
+ * generator rewrites the four neutral greys to `currentColor`, so anything still
49
+ * literal here was meant to be literal.
50
+ */
51
+ fill: string | null;
18
52
  }
19
53
  /**
20
- * Extract every fillable `<path>` of a symbolic SVG as `{ d, opacity }`. Each path
21
- * must be drawn SEPARATELY (not concatenated): Adwaita icons frequently pair a
22
- * solid outline with a dimmed (`fill-opacity`) inner shape, and a single path's
23
- * subpaths carve holes via the non-zero winding rule — flattening all paths into
24
- * one fill destroys both. Returns `[]` when the SVG carries no path data.
54
+ * Parse an SVG `transform` attribute into one affine matrix.
55
+ *
56
+ * The whole grammar, not the two functions the shipped icons happen to use
57
+ * (`translate` 33×, `matrix` 9×): SVG's transform list is exactly matrix / translate /
58
+ * scale / rotate / skewX / skewY, all affine, and supporting five of six would sit
59
+ * silently wrong the first time an icon set grows the sixth. Returns `null` for a
60
+ * string it cannot read, which a caller must treat as a refusal rather than as
61
+ * identity — quietly dropping a transform is the failure being repaired here.
62
+ */
63
+ export declare function parseIconTransform(value: string): IconTransform | null;
64
+ /**
65
+ * Extract every fillable `<path>` of a symbolic SVG.
66
+ *
67
+ * Each path must be drawn SEPARATELY (not concatenated): Adwaita icons frequently pair
68
+ * a solid outline with a dimmed (`fill-opacity`) inner shape, and a single path's
69
+ * subpaths carve holes via the winding rule — flattening all paths into one fill
70
+ * destroys both. Returns `[]` when the SVG carries no path data.
71
+ *
72
+ * WHY THIS WALKS `<g>` AND NOT JUST `<path>`. It used to be one regex over `<path>`
73
+ * tags, and the geometry of a grouped icon is authored in the group's coordinate space:
74
+ * icons whose paths live at x≈684, y≈180 under a `translate(-680,-180)` were extracted
75
+ * with the translate dropped, scaled by `size/16`, and drawn onto a 16×16 bitmap that
76
+ * their geometry misses entirely. Measured before this change: 12 shipped icons —
77
+ * eleven `battery-level-*-charging` and one parental-controls glyph — rendered
78
+ * COMPLETELY EMPTY on NativeScript, with no diagnostic anywhere.
25
79
  */
26
80
  export declare function extractIconPaths(svg: string): IconPath[];
27
81
  /**
@@ -48,9 +102,20 @@ export interface IconColorComponents {
48
102
  * two backends must read the same string the same way.
49
103
  *
50
104
  * Returns opaque black for anything unparsable, so a typo in a caller's colour
51
- * yields a visible icon rather than an invisible one.
105
+ * yields a visible icon rather than an invisible one. Where the caller has a better
106
+ * fallback than black — a path's own `fill`, which should fall back to the icon
107
+ * colour rather than to black — use {@link parseHexColorOrNull}.
52
108
  */
53
109
  export declare function parseHexColor(hex: string): IconColorComponents;
110
+ /**
111
+ * {@link parseHexColor} without the black fallback: `null` says "not a colour I read".
112
+ *
113
+ * Two callers want different answers to the same failure. A caller's own
114
+ * `options.color` has no better candidate than black — an invisible icon is worse
115
+ * than a wrong-coloured one. A path's `fill` does: the icon colour the caller passed
116
+ * in. Folding both into one black default made the second silently draw black.
117
+ */
118
+ export declare function parseHexColorOrNull(hex: string): IconColorComponents | null;
54
119
  /**
55
120
  * Space-separate the two single-digit ARC FLAGS (large-arc, sweep) in every
56
121
  * elliptical-arc command (`A`/`a`) of an SVG path-data string.
@@ -6,23 +6,23 @@ export type { NotifyActiveEventData } from './adw-switch-row.js';
6
6
  export { AdwEntryRow, NOTIFY_TEXT } from './adw-entry-row.js';
7
7
  export type { NotifyTextEventData } from './adw-entry-row.js';
8
8
  export { AdwPasswordEntryRow } from './adw-password-entry-row.js';
9
- export { AdwEntry, ACTIVATE as ENTRY_ACTIVATE, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT } from './adw-entry.js';
10
- export type { NotifyEntryTextEventData } from './adw-entry.js';
9
+ export { GtkEntry, ACTIVATE as ENTRY_ACTIVATE, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT } from './gtk-entry.js';
10
+ export type { NotifyEntryTextEventData } from './gtk-entry.js';
11
11
  export { AdwComboRow, ComboState, NOTIFY_SELECTED } from './adw-combo-row.js';
12
12
  export type { AdwComboOption, ComboStateChange, ComboStateListener, NotifySelectedEventData } from './adw-combo-row.js';
13
- export { AdwDropDown, NOTIFY_SELECTED as NOTIFY_DROP_DOWN_SELECTED } from './adw-drop-down.js';
14
- export type { NotifyDropDownSelectedEventData } from './adw-drop-down.js';
13
+ export { GtkDropDown, NOTIFY_SELECTED as NOTIFY_DROP_DOWN_SELECTED } from './gtk-drop-down.js';
14
+ export type { NotifyDropDownSelectedEventData } from './gtk-drop-down.js';
15
15
  export { AdwSpinRow, NOTIFY_VALUE, SpinState } from './adw-spin-row.js';
16
16
  export type { NotifyValueEventData, SpinStateChange, SpinStateListener } from './adw-spin-row.js';
17
17
  export { AdwSliderRow, NOTIFY_SLIDER_VALUE } from './adw-slider-row.js';
18
18
  export type { NotifySliderValueEventData } from './adw-slider-row.js';
19
19
  export { AdwExpanderRow, ExpanderState, NOTIFY_EXPANDED } from './adw-expander-row.js';
20
20
  export type { ExpanderStateListener, NotifyExpandedEventData } from './adw-expander-row.js';
21
- export { AdwButton } from './adw-button.js';
22
- export type { AdwButtonVariant } from './adw-button.js';
21
+ export { GtkButton } from './gtk-button.js';
22
+ export type { AdwButtonVariant } from './gtk-button.js';
23
23
  export { AdwImageButton, DEFAULT_ICON_BUTTON_ICON_SIZE } from './adw-image-button.js';
24
- export { AdwMenuButton, MENU_ITEM_ACTIVATED } from './adw-menu-button.js';
25
- export type { AdwMenuItem, MenuItemActivatedEventData } from './adw-menu-button.js';
24
+ export { GtkMenuButton, MENU_ITEM_ACTIVATED } from './gtk-menu-button.js';
25
+ export type { AdwMenuItem, MenuItemActivatedEventData } from './gtk-menu-button.js';
26
26
  export { AdwIcon, DEFAULT_ADW_ICON_SIZE } from './adw-icon.js';
27
27
  export { AdwBanner, BUTTON_CLICKED } from './adw-banner.js';
28
28
  export { AdwAvatar, DEFAULT_AVATAR_SIZE, avatarInitials } from './adw-avatar.js';
@@ -90,12 +90,19 @@ export type { AdwColorScheme } from './color-scheme.js';
90
90
  export { AdwBreakpoint, addBreakpoints, evaluateBreakpointCondition, parseBreakpointCondition } from './breakpoint.js';
91
91
  export type { AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './breakpoint.js';
92
92
  /**
93
- * Register all Adwaita widgets as NativeScript XML elements (idempotent).
93
+ * Register all Adwaita widgets as UNPREFIXED NativeScript XML elements, where a
94
+ * framework integration provides the `registerElement` global (idempotent).
94
95
  *
95
- * After calling this once at app bootstrap, markup like
96
- * `<AdwSwitchRow title="Dark mode" />` resolves to the corresponding class.
97
- * No-op (returns silently) when the `registerElement` runtime global is absent
98
- * — i.e. off NativeScript, or when the bundler context has not injected it yet —
99
- * so the call is safe to make unconditionally.
96
+ * That global is NOT part of NativeScript itself: `@nativescript/core` 9.1 does
97
+ * not contain the identifier at all, and it is `undefined` in a plain app built
98
+ * with `@nativescript/vite` — measured on an Android emulator, 2026-08-28, where
99
+ * this function therefore returned silently and `<AdwSwitchRow>` resolved to
100
+ * nothing. It comes from `@nativescript/angular` / `nativescript-vue`, which is
101
+ * where this call earns its keep; a plain XML app uses the `xmlns` barrel above
102
+ * instead and needs no registration at all.
103
+ *
104
+ * The no-op is the safe branch of that split, not a fallback: it is why the call
105
+ * can be made unconditionally, and why it must never be the only thing an app
106
+ * does before writing `<AdwSwitchRow>` in markup.
100
107
  */
101
108
  export declare function registerAdwaitaElements(): void;
@@ -28,11 +28,11 @@ export declare function resolveMenuChoice(sheetActions: readonly string[], chose
28
28
  /** The arrow SVG for a direction; the split button's `none` is the down caret, not a hamburger. */
29
29
  export declare function splitButtonArrowSvg(direction: SplitButtonDirection): string;
30
30
  /**
31
- * Apply `AdwSplitButton.actionIcon = svg` to the content machine. The SVG string IS
31
+ * Apply `AdwSplitButton.iconName = svg` to the content machine. The SVG string IS
32
32
  * the icon identity on NativeScript, so it goes where GTK puts the icon NAME.
33
33
  *
34
34
  * C offers no "unset the icon", only the side effect of filling another slot, so an
35
35
  * empty SVG clears the content and lets the label half take over again — what a
36
- * caller assigning `actionIcon` from a nullable lookup expects.
36
+ * caller assigning `iconName` from a nullable lookup expects.
37
37
  */
38
38
  export declare function setActionIcon(state: SplitButtonState, svg: string | null | undefined): void;
@@ -78,6 +78,15 @@ export declare abstract class AdwSplitViewBase<TState extends NsSplitViewState =
78
78
  setSidebar(view: View | null): void;
79
79
  /** Set (or replace) the content pane. */
80
80
  setContent(view: View | null): void;
81
+ /**
82
+ * An XML child asks for `sidebar` or `content`, and a bare one is CONTENT.
83
+ *
84
+ * The fallback follows the widget's own collapsed behaviour: a lone child stays
85
+ * visible whatever `show-content` says, so the pane a template gives without
86
+ * naming one is the one a reader will see. Without this override, `LayoutBase`'s
87
+ * default drops both panes into column 0 of the grid, stacked.
88
+ */
89
+ _addChildFromBuilder(name: string, view: View): void;
81
90
  /** Show the sidebar (relevant in collapsed mode). */
82
91
  showSidebarPane(): void;
83
92
  /** Hide the sidebar (relevant in collapsed mode). */
@@ -90,26 +99,26 @@ export declare abstract class AdwSplitViewBase<TState extends NsSplitViewState =
90
99
  * `notify::show-sidebar` first — the state machine owns that, not this setter.
91
100
  */
92
101
  get collapsed(): boolean;
93
- set collapsed(value: boolean);
102
+ set collapsed(raw: boolean | string);
94
103
  /** Whether the sidebar is shown. Toggling emits `notify::show-sidebar`. */
95
104
  get showSidebar(): boolean;
96
- set showSidebar(value: boolean);
105
+ set showSidebar(raw: boolean | string);
97
106
  /**
98
107
  * The sidebar pane width in DIPs, DERIVED from the container size unless a caller
99
108
  * assigned one — `Adw.OverlaySplitView` stores no width; see
100
109
  * `split-view-width.ts` for the rule.
101
110
  */
102
111
  get sidebarWidth(): number;
103
- set sidebarWidth(value: number);
112
+ set sidebarWidth(raw: number | string);
104
113
  /** Lower bound in DIPs (`Adw.OverlaySplitView:min-sidebar-width`, default 180). */
105
114
  get minSidebarWidth(): number;
106
- set minSidebarWidth(value: number);
115
+ set minSidebarWidth(raw: number | string);
107
116
  /** Upper bound in DIPs (`Adw.OverlaySplitView:max-sidebar-width`, default 280). */
108
117
  get maxSidebarWidth(): number;
109
- set maxSidebarWidth(value: number);
118
+ set maxSidebarWidth(raw: number | string);
110
119
  /** Share of the container the sidebar asks for (default 0.25). */
111
120
  get sidebarWidthFraction(): number;
112
- set sidebarWidthFraction(value: number);
121
+ set sidebarWidthFraction(raw: number | string);
113
122
  /**
114
123
  * Re-measure the container and re-size the sidebar.
115
124
  *
@@ -74,7 +74,7 @@ export declare abstract class AdwViewSwitcherBase extends GridLayout {
74
74
  * NO-OPS — refused, never clamped, as `adw_view_stack_pages_select_item` does.
75
75
  */
76
76
  get selected(): number;
77
- set selected(value: number);
77
+ set selected(raw: number | string);
78
78
  /** Name of the selected page, `''` when nothing is selected. */
79
79
  get selectedName(): string;
80
80
  /**