@gjsify/adwaita-nativescript 0.43.0 → 0.45.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 (96) hide show
  1. package/lib/esm/widgets/adw-about-dialog.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-carousel.js +1 -1
  8. package/lib/esm/widgets/adw-clamp.js +1 -1
  9. package/lib/esm/widgets/adw-combo-row.js +1 -1
  10. package/lib/esm/widgets/adw-data-grid.js +1 -1
  11. package/lib/esm/widgets/adw-drop-down.js +1 -1
  12. package/lib/esm/widgets/adw-entry-row.js +1 -1
  13. package/lib/esm/widgets/adw-entry.js +1 -1
  14. package/lib/esm/widgets/adw-expander-row.js +1 -1
  15. package/lib/esm/widgets/adw-header-bar.js +1 -1
  16. package/lib/esm/widgets/adw-icon.js +1 -1
  17. package/lib/esm/widgets/adw-image-button.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-slider-row.js +1 -1
  27. package/lib/esm/widgets/adw-spin-row.js +1 -1
  28. package/lib/esm/widgets/adw-spinner.js +1 -1
  29. package/lib/esm/widgets/adw-split-button.js +1 -1
  30. package/lib/esm/widgets/adw-status-page.js +1 -1
  31. package/lib/esm/widgets/adw-switch-row.js +1 -1
  32. package/lib/esm/widgets/adw-tab-view.js +1 -1
  33. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  34. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  35. package/lib/esm/widgets/adw-view-stack.js +1 -1
  36. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  37. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  38. package/lib/esm/widgets/builder-slots.js +1 -0
  39. package/lib/esm/widgets/host-insets.android.js +1 -0
  40. package/lib/esm/widgets/host-insets.ios.js +1 -0
  41. package/lib/esm/widgets/host-insets.js +1 -0
  42. package/lib/esm/widgets/icon-path.js +2 -2
  43. package/lib/esm/widgets/icons.android.js +1 -1
  44. package/lib/esm/widgets/icons.ios.js +1 -1
  45. package/lib/esm/widgets/split-view-base.js +1 -1
  46. package/lib/esm/widgets/view-switcher-base.js +1 -1
  47. package/lib/esm/widgets/window-insets.js +1 -1
  48. package/lib/esm/widgets/xml-values.js +1 -0
  49. package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
  50. package/lib/types/widgets/adw-action-row.d.ts +15 -1
  51. package/lib/types/widgets/adw-avatar.d.ts +1 -1
  52. package/lib/types/widgets/adw-banner.d.ts +2 -2
  53. package/lib/types/widgets/adw-bottom-sheet.d.ts +20 -2
  54. package/lib/types/widgets/adw-button-content.d.ts +2 -2
  55. package/lib/types/widgets/adw-carousel.d.ts +14 -3
  56. package/lib/types/widgets/adw-clamp.d.ts +13 -2
  57. package/lib/types/widgets/adw-combo-row.d.ts +1 -1
  58. package/lib/types/widgets/adw-data-grid.d.ts +1 -1
  59. package/lib/types/widgets/adw-drop-down.d.ts +1 -1
  60. package/lib/types/widgets/adw-entry-row.d.ts +4 -4
  61. package/lib/types/widgets/adw-entry.d.ts +2 -2
  62. package/lib/types/widgets/adw-expander-row.d.ts +20 -1
  63. package/lib/types/widgets/adw-header-bar.d.ts +13 -1
  64. package/lib/types/widgets/adw-icon.d.ts +1 -1
  65. package/lib/types/widgets/adw-image-button.d.ts +1 -1
  66. package/lib/types/widgets/adw-navigation-split-view.d.ts +1 -1
  67. package/lib/types/widgets/adw-navigation-view.d.ts +13 -2
  68. package/lib/types/widgets/adw-overlay-split-view.d.ts +1 -1
  69. package/lib/types/widgets/adw-password-entry-row.d.ts +2 -2
  70. package/lib/types/widgets/adw-preferences-dialog.d.ts +7 -1
  71. package/lib/types/widgets/adw-preferences-group.d.ts +11 -0
  72. package/lib/types/widgets/adw-preferences-page.d.ts +7 -1
  73. package/lib/types/widgets/adw-sidebar.d.ts +1 -1
  74. package/lib/types/widgets/adw-slider-row.d.ts +4 -4
  75. package/lib/types/widgets/adw-spin-row.d.ts +4 -4
  76. package/lib/types/widgets/adw-spinner.d.ts +2 -2
  77. package/lib/types/widgets/adw-split-button.d.ts +2 -2
  78. package/lib/types/widgets/adw-status-page.d.ts +7 -0
  79. package/lib/types/widgets/adw-switch-row.d.ts +1 -1
  80. package/lib/types/widgets/adw-tab-view.d.ts +2 -2
  81. package/lib/types/widgets/adw-toggle-group.d.ts +1 -1
  82. package/lib/types/widgets/adw-toolbar-view.d.ts +20 -3
  83. package/lib/types/widgets/adw-view-stack.d.ts +1 -1
  84. package/lib/types/widgets/adw-view-switcher-bar.d.ts +1 -1
  85. package/lib/types/widgets/adw-wrap-box.d.ts +7 -7
  86. package/lib/types/widgets/builder-slots.d.ts +16 -0
  87. package/lib/types/widgets/host-insets.android.d.ts +4 -0
  88. package/lib/types/widgets/host-insets.d.ts +13 -0
  89. package/lib/types/widgets/host-insets.ios.d.ts +4 -0
  90. package/lib/types/widgets/icon-path.d.ts +72 -7
  91. package/lib/types/widgets/index.d.ts +13 -6
  92. package/lib/types/widgets/split-view-base.d.ts +15 -6
  93. package/lib/types/widgets/view-switcher-base.d.ts +1 -1
  94. package/lib/types/widgets/window-insets.d.ts +24 -0
  95. package/lib/types/widgets/xml-values.d.ts +18 -0
  96. package/package.json +11 -8
@@ -14,6 +14,12 @@ export declare class AdwPreferencesDialog extends GridLayout {
14
14
  set title(value: string);
15
15
  /** Add an `AdwPreferencesPage` (or any view) to the dialog body. */
16
16
  add(view: View): void;
17
+ /**
18
+ * An XML child is a page in the dialog BODY, not a child of the grid the dialog
19
+ * builds its header and scroller in — which is where `LayoutBase`'s inherited
20
+ * `_addChildFromBuilder` would have put it, on top of the title bar.
21
+ */
22
+ _addChildFromBuilder(_name: string, view: View): void;
17
23
  /** Remove a previously-added page from the body. */
18
24
  remove(view: View): void;
19
25
  /**
@@ -38,7 +44,7 @@ export declare class AdwPreferencesDialog extends GridLayout {
38
44
  close(): void;
39
45
  /** Whether the dialog is currently shown. */
40
46
  get open(): boolean;
41
- set open(value: boolean);
47
+ set open(value: boolean | string);
42
48
  /** The scrollable body that hosts the preferences pages. */
43
49
  get body(): StackLayout;
44
50
  }
@@ -45,6 +45,17 @@ export declare class AdwPreferencesGroup extends StackLayout implements NsSearch
45
45
  */
46
46
  get headerSuffix(): View | null;
47
47
  set headerSuffix(view: View | null);
48
+ /**
49
+ * XML inflation — a template's children are ROWS, not stray layout children.
50
+ *
51
+ * `<AdwPreferencesGroup.headerSuffix>` reaches the suffix host; everything
52
+ * else goes into the boxed list, which is where a row has to be to get the
53
+ * card, the rounded ends and the separators. Without this the `StackLayout`
54
+ * default appended each row NEXT TO the listbox: measured on Android, the
55
+ * rows rendered — unboxed, on the page background, with no `.boxed-list`
56
+ * around them — which is the failure that looks like a styling bug.
57
+ */
58
+ _addChildFromBuilder(name: string, view: View): void;
48
59
  /** Append a row (or any view) to the boxed list. */
49
60
  addRow(view: View): void;
50
61
  /** Remove a previously-added row from the boxed list. */
@@ -26,11 +26,17 @@ export declare class AdwPreferencesPage extends ScrollView implements NsSearchab
26
26
  * a search-result subtitle strips before showing it (:196-199).
27
27
  */
28
28
  get useUnderline(): boolean;
29
- set useUnderline(value: boolean);
29
+ set useUnderline(value: boolean | string);
30
30
  /** Append a preferences group (or any view) to the page. */
31
31
  addGroup(view: View): void;
32
32
  /** Remove a previously-added group from the page. */
33
33
  removeGroup(view: View): void;
34
+ /**
35
+ * An XML child is a GROUP. `ScrollView`'s inherited `_addChildFromBuilder` sets
36
+ * `content`, which would REPLACE the page's own scroll body — one group in place
37
+ * of all of them, and no error.
38
+ */
39
+ _addChildFromBuilder(_name: string, view: View): void;
34
40
  /**
35
41
  * The groups this page contributes to a preferences search, in order.
36
42
  *
@@ -51,7 +51,7 @@ export declare class AdwSidebar extends ScrollView {
51
51
  * selection rather than being ignored (adw-sidebar.c:3028-3029).
52
52
  */
53
53
  get selected(): number;
54
- set selected(value: number);
54
+ set selected(raw: number | string);
55
55
  /** The selected item, or undefined — `adw_sidebar_get_selected_item`. */
56
56
  get selectedItem(): AdwSidebarItemSpec | undefined;
57
57
  /**
@@ -29,16 +29,16 @@ export declare class AdwSliderRow extends StackLayout {
29
29
  set title(value: string);
30
30
  /** The current numeric value (always within `[min, max]`, snapped to `step`). */
31
31
  get value(): number;
32
- set value(v: number);
32
+ set value(raw: number | string);
33
33
  /** Lower bound. Re-clamps the current value if it now falls below. */
34
34
  get min(): number;
35
- set min(v: number);
35
+ set min(raw: number | string);
36
36
  /** Upper bound. Re-clamps the current value if it now falls above. */
37
37
  get max(): number;
38
- set max(v: number);
38
+ set max(raw: number | string);
39
39
  /** Snap granularity applied as the slider is dragged. */
40
40
  get step(): number;
41
- set step(v: number);
41
+ set step(raw: number | string);
42
42
  /** The underlying {@link Slider} (e.g. to tweak styling). */
43
43
  get slider(): Slider;
44
44
  }
@@ -23,14 +23,14 @@ export declare class AdwSpinRow extends AdwActionRow {
23
23
  constructor();
24
24
  /** The current numeric value (always within `[min, max]`). */
25
25
  get value(): number;
26
- set value(v: number);
26
+ set value(v: number | string);
27
27
  /** Lower bound. Re-clamps the current value if it now falls below. */
28
28
  get min(): number;
29
- set min(v: number);
29
+ set min(v: number | string);
30
30
  /** Upper bound. Re-clamps the current value if it now falls above. */
31
31
  get max(): number;
32
- set max(v: number);
32
+ set max(v: number | string);
33
33
  /** Increment/decrement step applied per button press. */
34
34
  get step(): number;
35
- set step(v: number);
35
+ set step(v: number | string);
36
36
  }
@@ -13,7 +13,7 @@ export declare class AdwSpinner extends GridLayout {
13
13
  private _applySpinning;
14
14
  /** Whether the spinner is animating. Gated on being mapped, as in GTK. */
15
15
  get spinning(): boolean;
16
- set spinning(value: boolean);
16
+ set spinning(value: boolean | string);
17
17
  /**
18
18
  * The BOX size in DIPs — what was requested, floored at the measured
19
19
  * minimum 16 and NOT capped.
@@ -24,7 +24,7 @@ export declare class AdwSpinner extends GridLayout {
24
24
  * silently took 64 DIPs of layout instead of the 200 it was given.
25
25
  */
26
26
  get size(): number;
27
- set size(value: number);
27
+ set size(value: number | string);
28
28
  /** The drawn ring diameter — `spinnerGeometry`, capped at 64. */
29
29
  get ringDiameter(): number;
30
30
  }
@@ -70,10 +70,10 @@ export declare class AdwSplitButton extends GridLayout {
70
70
  set dropdownTooltip(value: string);
71
71
  /** Whether an underline in the label marks a mnemonic. */
72
72
  get useUnderline(): boolean;
73
- set useUnderline(value: boolean);
73
+ set useUnderline(raw: boolean | string);
74
74
  /** Whether the control is insensitive: dimmed, and emitting neither signal. */
75
75
  get disabled(): boolean;
76
- set disabled(value: boolean);
76
+ set disabled(raw: boolean | string);
77
77
  /** The main action part (for composing a custom content widget). */
78
78
  get actionButton(): StackLayout;
79
79
  }
@@ -46,4 +46,11 @@ export declare class AdwStatusPage extends GridLayout {
46
46
  setChild(view: View | null): void;
47
47
  /** The currently-installed child, or `null`. */
48
48
  get child(): View | null;
49
+ /**
50
+ * The one destination an XML child can have: the slot under the description,
51
+ * where `AdwStatusPage:child` goes. The name is ignored because
52
+ * `<AdwStatusPage.child>` and a bare child mean the same thing — the shape
53
+ * `AdwClamp` already has.
54
+ */
55
+ _addChildFromBuilder(_name: string, view: View): void;
49
56
  }
@@ -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);
@@ -30,7 +30,7 @@ export declare class AdwToggleGroup extends StackLayout {
30
30
  private _applySelection;
31
31
  /** The selected segment index. Swaps the active pill + emits `notify::selected`. */
32
32
  get selected(): number;
33
- set selected(value: number);
33
+ set selected(raw: number | string);
34
34
  /** The selected segment's label, or `''` when out of range. */
35
35
  get selectedValue(): string;
36
36
  }
@@ -20,6 +20,16 @@ export declare class AdwToolbarView extends GridLayout {
20
20
  addBottomBar(view: View): void;
21
21
  /** Set (or replace) the main content view. Pass `null` to clear it. */
22
22
  setContent(view: View | null): void;
23
+ /**
24
+ * XML inflation — route a template's child through the slot API.
25
+ *
26
+ * `<AdwToolbarView.topBar>` / `.bottomBar` / `.content` arrive here as those
27
+ * names; anything else (a bare child) is the content, which is the one slot a
28
+ * toolbar view cannot do without. Without this the `GridLayout` default put
29
+ * every child in row 0: measured on Android, a top bar and the content were
30
+ * painted ON TOP OF EACH OTHER in the bar row while row 1 stayed empty.
31
+ */
32
+ _addChildFromBuilder(name: string, view: View): void;
23
33
  /** The currently-installed content view, or `null`. */
24
34
  get content(): View | null;
25
35
  /** The top-bar slot container. */
@@ -34,10 +44,10 @@ export declare class AdwToolbarView extends GridLayout {
34
44
  set bottomBarStyle(value: AdwToolbarStyle);
35
45
  /** `Adw.ToolbarView:extend-content-to-top-edge` — draw the top bar OVER the content. */
36
46
  get extendContentToTopEdge(): boolean;
37
- set extendContentToTopEdge(value: boolean);
47
+ set extendContentToTopEdge(raw: boolean | string);
38
48
  /** `Adw.ToolbarView:extend-content-to-bottom-edge` — draw the bottom bar OVER the content. */
39
49
  get extendContentToBottomEdge(): boolean;
40
- set extendContentToBottomEdge(value: boolean);
50
+ set extendContentToBottomEdge(raw: boolean | string);
41
51
  /**
42
52
  * Put each bar box in its own row, or — when the content extends under it —
43
53
  * in the CONTENT row pinned to that edge, which is how an NS `GridLayout`
@@ -54,7 +64,14 @@ export declare class AdwToolbarView extends GridLayout {
54
64
  */
55
65
  private _restackBars;
56
66
  /**
57
- * Pay each edge's inset out of the slot that sits on it.
67
+ * Pay each edge's inset out of the slot that sits on it — the part of it this
68
+ * widget still owes.
69
+ *
70
+ * `insetsOwedBy` drops what the HOST already paid, which on Android is the bottom
71
+ * edge (the page's `LayoutBase`, because only its branch also folds in the keyboard)
72
+ * and never the top (`host-insets.android.ts` hands that edge back, because only the
73
+ * top-bar box paints it in the header colour). Without it the inset was applied
74
+ * twice: 142 px + 142 px above the header bar on emulator-5554.
58
75
  *
59
76
  * The assignment is decided by the pure sibling (`toolbarViewInsetPadding`); this
60
77
  * only spells it in NativeScript. Where that module says "the content pays", the
@@ -40,7 +40,7 @@ export declare class AdwViewStack extends GridLayout {
40
40
  get pages(): readonly AdwViewStackPage[];
41
41
  /** The visible page index, `-1` when nothing is selected. Swaps the visible page + emits. */
42
42
  get visibleChildIndex(): number;
43
- set visibleChildIndex(value: number);
43
+ set visibleChildIndex(raw: number | string);
44
44
  /** The visible page name (`Adw.ViewStack.visible-child-name`), `''` for none. */
45
45
  get visibleChildName(): string;
46
46
  set visibleChildName(name: string | null | undefined);
@@ -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;
@@ -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.
@@ -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;
@@ -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
  /**
@@ -18,6 +18,30 @@ export interface InsetPadding {
18
18
  readonly contentBottom: number;
19
19
  }
20
20
  export declare const NO_INSETS: WindowInsets;
21
+ /**
22
+ * The edges a HOST layout already pays, so the widget must not pay them again.
23
+ *
24
+ * Declared here rather than beside the platform files that answer it, so this module
25
+ * stays the one place the inset arithmetic lives and keeps importing nothing.
26
+ */
27
+ export interface HostPaidEdges {
28
+ readonly top: boolean;
29
+ readonly bottom: boolean;
30
+ }
31
+ /** Nothing above the widget pays anything — it owes every edge. */
32
+ export declare const NO_HOST_PAYMENT: HostPaidEdges;
33
+ /**
34
+ * Drop the edges a host layout already paid, leaving what the widget still owes.
35
+ *
36
+ * Separate from {@link toolbarViewInsetPadding} because it answers a different question:
37
+ * that one splits an owed inset between the slots of ONE widget, this one decides
38
+ * whether the inset is owed at all. Which edges a host pays is a per-platform fact
39
+ * (`host-insets.{android,ios}.ts`); how much of it lands on which slot is not.
40
+ *
41
+ * Left and right pass through: no host in this tree pays them, and dropping an edge
42
+ * nobody paid is how an inset silently goes missing.
43
+ */
44
+ export declare function insetsOwedBy(insets: WindowInsets, paidByHost: HostPaidEdges): WindowInsets;
21
45
  /**
22
46
  * Assign `insets` to the slots of a toolbar view of `shape`.
23
47
  *
@@ -0,0 +1,18 @@
1
+ /**
2
+ * An attribute as a finite number, or `fallback` when it is not one.
3
+ *
4
+ * A string is trimmed and parsed; empty is NOT zero (`Number('')` is 0, which is how
5
+ * a missing value becomes a real setting). `NaN` and `Infinity` are refused, so a
6
+ * caller can keep validating a RANGE without also having to re-check the type.
7
+ */
8
+ export declare function xmlNumber(value: unknown, fallback: number): number;
9
+ /**
10
+ * An attribute as a boolean.
11
+ *
12
+ * Only the two spellings XML can mean are accepted — anything else takes the
13
+ * `fallback` rather than the truthiness of the string, because truthiness is exactly
14
+ * what made `revealed="false"` reveal. `'True'`/`'FALSE'` are accepted too: XML
15
+ * attribute VALUES are not case-normalised by any parser, and a template that means
16
+ * one of the two booleans should not depend on which case its author typed.
17
+ */
18
+ export declare function xmlBoolean(value: unknown, fallback: boolean): boolean;