@gjsify/adwaita-nativescript 0.35.0 → 0.37.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.
@@ -4,64 +4,49 @@ import { ActionRowState } from './row-state.js';
4
4
  export declare const ACTIVATED = "activated";
5
5
  export declare class AdwActionRow extends GridLayout {
6
6
  /**
7
- * Whether libadwaita would answer `ADW_IS_ACTION_ROW` for this row — which
8
- * is what decides whether the preferences SEARCH consults its subtitle
9
- * (`filter_search_results`, adw-preferences-dialog.c:140-146).
7
+ * Whether libadwaita would answer `ADW_IS_ACTION_ROW` for this row, which decides
8
+ * whether the preferences SEARCH consults its subtitle.
10
9
  *
11
- * A declared property, not an `instanceof` test, because this port's class
12
- * tree deliberately does NOT match the GObject one: `AdwEntryRow`,
13
- * `AdwExpanderRow` and `AdwButtonRow` extend this class here to reuse the
14
- * row chrome, while in C all three derive from `AdwPreferencesRow`
15
- * (adw-entry-row.c:90, adw-expander-row.c:72, adw-button-row.c:74). They
16
- * override this to `false`, so the search behaves as GTK does.
10
+ * A declared property, not an `instanceof` test, because this port's class tree
11
+ * deliberately does NOT match the GObject one: `AdwEntryRow`, `AdwExpanderRow`
12
+ * and `AdwButtonRow` extend this class to reuse the row chrome, while in C all
13
+ * three derive from `AdwPreferencesRow`. They override this to `false`, so the
14
+ * search behaves as GTK does.
17
15
  */
18
16
  readonly isActionRow: boolean;
19
17
  /** The text/value column (column 1). */
20
18
  protected readonly _textStack: StackLayout;
21
- /** The title label. */
22
19
  protected readonly _titleLabel: Label;
23
- /** The subtitle label. */
24
20
  protected readonly _subtitleLabel: Label;
25
21
  /** The headless labels + activatable-widget coupling (ADR 0004). */
26
22
  protected readonly _rowState: ActionRowState<View>;
27
- /** The currently-installed prefix view (column 0), if any. */
28
23
  private _prefix;
29
- /** The currently-installed suffix view (column 2), if any. */
30
24
  private _suffix;
31
25
  constructor();
32
- /**
33
- * Install a prefix widget in column 0 (e.g. an `AdwIcon` symbolic icon).
34
- * Replaces any previously-installed prefix. Pass `null` to clear it.
35
- */
26
+ /** Install a prefix widget in column 0. Replaces any previous one; `null` clears. */
36
27
  setPrefix(view: View | null): void;
37
- /** The currently-installed prefix view, or `null`. */
38
28
  get prefix(): View | null;
39
29
  /** The row title (column 1, top line). */
40
30
  get title(): string;
41
31
  set title(value: string);
42
32
  /**
43
- * The row subtitle (column 1, dim second line). An empty subtitle collapses
44
- * its label so it leaves no blank gap — `string_is_not_empty`, the same rule
45
- * the title now follows.
33
+ * The row subtitle (column 1, dim second line). Empty collapses its label so it
34
+ * leaves no blank gap — `string_is_not_empty`, the rule the title follows too.
46
35
  */
47
36
  get subtitle(): string;
48
37
  set subtitle(value: string);
49
- /**
50
- * Install a suffix widget in column 2 (e.g. a `Switch`, `Button`, or icon).
51
- * Replaces any previously-installed suffix. Pass `null` to clear it.
52
- */
38
+ /** Install a suffix widget in column 2. Replaces any previous one; `null` clears. */
53
39
  setSuffix(view: View | null): void;
54
- /** The currently-installed suffix view, or `null`. */
55
40
  get suffix(): View | null;
56
41
  /** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
57
42
  get activatableWidget(): View | null;
58
43
  /**
59
- * Set the activatable widget. Its sensitivity is copied into `activatable`
60
- * (adw-action-row.c:729-732); clearing it LEAVES the row activatable
61
- * (C:709). Call {@link syncActivatableWidgetSensitivity} when the widget's
44
+ * Set the activatable widget. Its sensitivity is copied into `activatable`;
45
+ * clearing it LEAVES the row activatable. Call
46
+ * {@link syncActivatableWidgetSensitivity} when the widget's
62
47
  * `isUserInteractionEnabled` changes — NativeScript has no property-change
63
- * notification a plain `View` write goes through, so the live half of the
64
- * binding has to be driven, not observed.
48
+ * notification a plain `View` write goes through, so the live half of the binding
49
+ * has to be driven, not observed.
65
50
  */
66
51
  set activatableWidget(widget: View | null);
67
52
  /** Re-read the activatable widget's sensitivity — the live half of the binding. */
@@ -70,24 +55,23 @@ export declare class AdwActionRow extends GridLayout {
70
55
  get activatable(): boolean;
71
56
  set activatable(value: boolean);
72
57
  /**
73
- * `adw_action_row_activate` (adw-action-row.h:90): forward to the activatable
74
- * widget, then emit `activated` (C:297-307). A no-op while unactivatable,
75
- * because a tap on a non-activatable `GtkListBoxRow` never reaches here.
58
+ * `adw_action_row_activate`: forward to the activatable widget, then emit
59
+ * `activated`. A no-op while unactivatable, because a tap on a non-activatable
60
+ * `GtkListBoxRow` never reaches here.
76
61
  *
77
- * FORWARDING IS SUBCLASS BUSINESS in this port. GTK sends
78
- * `mnemonic-activate` and every widget knows what that means for itself;
79
- * NativeScript has no such primitive on `View`, so {@link AdwSwitchRow}
80
- * overrides this to toggle its slider and a plain action row only emits.
62
+ * FORWARDING IS SUBCLASS BUSINESS here: GTK sends `mnemonic-activate` and every
63
+ * widget knows what that means for itself, while NativeScript has no such
64
+ * primitive on `View` — so `AdwSwitchRow` overrides this to toggle its slider and
65
+ * a plain action row only emits.
81
66
  */
82
67
  activate(): void;
83
68
  /**
84
69
  * Whether this row's own title visibility follows `string_is_not_empty`.
85
70
  *
86
- * `AdwEntryRow` sets it `false`: its two titles are the endpoints of
87
- * libadwaita's empty↔filled CROSS-FADE (adw-entry-row.c:433-439), so which
88
- * of them shows is decided by `emptyTarget`, not by whether the string is
89
- * empty. Without the opt-out, setting a title on an entry row would reveal
90
- * the small floating label on top of the large placeholder.
71
+ * `AdwEntryRow` sets it `false`: its two titles are the endpoints of libadwaita's
72
+ * empty↔filled CROSS-FADE, so which shows is decided by `emptyTarget`, not by
73
+ * whether the string is empty. Without the opt-out, setting a title on an entry
74
+ * row reveals the small floating label on top of the large placeholder.
91
75
  */
92
76
  protected _managesTitleVisibility: boolean;
93
77
  /** Push the derived label text + visibility onto the two `Label`s. */
@@ -6,7 +6,6 @@ export declare const ROW_ACTIVATED = "row-activated";
6
6
  export interface RowActivatedEventData extends EventData {
7
7
  /** The row's index in the `rows` array. */
8
8
  index: number;
9
- /** The row object that was activated. */
10
9
  row: AdwDataGridRow;
11
10
  }
12
11
  export declare class AdwDataGrid extends GridLayout {
@@ -42,18 +41,13 @@ export declare class AdwDataGrid extends GridLayout {
42
41
  * (Re)declare the column tracks from the descriptors.
43
42
  *
44
43
  * Guarded on the derived tracks rather than run on every render: re-declaring
45
- * invalidates the layout, and a data change must not move the columns. The
46
- * precedent is `AdwViewSwitcherBar`, which rebuilds only when the page count
47
- * moves; the key generalises that, because a column list can change without
48
- * changing length (`data-grid-model.ts` says why).
44
+ * invalidates the layout, and a data change must not move the columns.
49
45
  */
50
46
  private _syncColumns;
51
47
  /**
52
- * Rebuild the cell views when the grid's SHAPE moves, and only then.
53
- *
54
- * A repaint keeps the views: replacing the row under the user's finger on
55
- * every data update is what the view-switcher bar's count guard exists to
56
- * avoid, and here it would also drop the press state mid-touch.
48
+ * Rebuild the cell views when the grid's SHAPE moves, and only then — replacing
49
+ * the row under the user's finger on every data update would drop the press
50
+ * state mid-touch.
57
51
  */
58
52
  private _syncNodes;
59
53
  /** Build one row: the spanning background first, then a cell per column. */
@@ -7,15 +7,14 @@ export { EntryRowState } from '@gjsify/adwaita-core';
7
7
  export type { EntryRowRenderState, EntryRowActivation } from '@gjsify/adwaita-core';
8
8
  /** Event name emitted when {@link AdwEntryRow.text} changes. Mirrors GObject `notify::text`. */
9
9
  export declare const NOTIFY_TEXT = "notify::text";
10
- /** Event name emitted when the character count changes — `on_length_changed` (adw-entry-row.c:268-273). */
10
+ /** Event name emitted when the character count changes. */
11
11
  export declare const NOTIFY_TEXT_LENGTH = "notify::text-length";
12
- /** Event name emitted by the apply button, or by the return key while it shows — `AdwEntryRow::apply` (C:240). */
12
+ /** `AdwEntryRow::apply` — the apply button, or the return key while it shows. */
13
13
  export declare const SIGNAL_APPLY = "apply";
14
- /** Event name emitted by the return key when there is nothing to apply — `AdwEntryRow::entry-activated` (C:256). */
14
+ /** `AdwEntryRow::entry-activated` — the return key when there is nothing to apply. */
15
15
  export declare const SIGNAL_ENTRY_ACTIVATED = "entry-activated";
16
16
  /** Payload of the `notify::text` event. */
17
17
  export interface NotifyTextEventData extends EventData {
18
- /** The new text value. */
19
18
  text: string;
20
19
  }
21
20
  /** Payload of the `notify::text-length` event. */
@@ -26,15 +25,15 @@ export interface NotifyTextLengthEventData extends EventData {
26
25
  /** Payload of the `entry-activated` event. */
27
26
  export interface EntryActivatedEventData extends EventData {
28
27
  /**
29
- * Whether the host must activate its default action FIRST — the C calls
30
- * `gtk_widget_activate_default` on line 254 and emits the signal on line 256,
31
- * and NS has no default-widget concept, so the ordering becomes the host's.
28
+ * Whether the host must activate its default action FIRST — C calls
29
+ * `gtk_widget_activate_default` before emitting, and NS has no default-widget
30
+ * concept, so the ordering becomes the host's.
32
31
  */
33
32
  activateDefault: boolean;
34
33
  }
35
34
  export declare class AdwEntryRow extends AdwActionRow {
36
- /** `AdwEntryRow` derives from `AdwPreferencesRow` in C (adw-entry-row.c:90), so
37
- * the preferences search must NOT read the text typed into it. */
35
+ /** `AdwEntryRow` derives from `AdwPreferencesRow` in C, so the preferences search
36
+ * must NOT read the text typed into it. */
38
37
  readonly isActionRow: boolean;
39
38
  /** The headless `update_empty` derivation + apply latch (ADR 0004). */
40
39
  protected readonly _state: EntryRowState;
@@ -48,7 +47,6 @@ export declare class AdwEntryRow extends AdwActionRow {
48
47
  protected readonly _editIcon: AdwIcon;
49
48
  /** The caps-lock warning slot (`indicator`). */
50
49
  protected readonly _indicator: AdwIcon;
51
- /** The apply button. */
52
50
  protected readonly _applyButton: AdwImageButton;
53
51
  /** The suffix installed through the inherited single-slot {@link setSuffix}. */
54
52
  private _slotSuffix;
@@ -74,36 +72,29 @@ export declare class AdwEntryRow extends AdwActionRow {
74
72
  set activatesDefault(value: boolean);
75
73
  /** Whether the field currently has focus. */
76
74
  get editing(): boolean;
77
- /**
78
- * Append a suffix — `adw_entry_row_add_suffix` (adw-entry-row.c:885-899),
79
- * which appends into a BOX so suffixes COEXIST.
80
- */
75
+ /** Append a suffix — `adw_entry_row_add_suffix` appends into a BOX, so suffixes COEXIST. */
81
76
  addSuffix(view: View): void;
82
77
  /**
83
- * The inherited single-slot API, kept working for existing consumers: it
84
- * replaces only the suffix a previous `setSuffix` installed.
85
- *
86
- * `AdwActionRow.setSuffix` removes whatever sat in the slot, which detached
87
- * the password row's own peek toggle the moment a consumer set a suffix —
88
- * while `_peekButton` kept pointing at the detached view, so the row could
89
- * never be revealed again. Upstream has no such conflict because there is no
90
- * single slot: `add_suffix` appends.
78
+ * The inherited single-slot API, narrowed to replace only the suffix a previous
79
+ * `setSuffix` installed. `AdwActionRow.setSuffix` removes whatever sits in the
80
+ * slot, which would detach the password row's own peek toggle — leaving
81
+ * `_peekButton` pointing at a detached view, so the row could never be revealed
82
+ * again. Upstream has no such conflict: `add_suffix` appends.
91
83
  */
92
84
  setSuffix(view: View | null): void;
93
85
  /** The suffix installed through {@link setSuffix}, or `null`. */
94
86
  get suffix(): View | null;
95
87
  /**
96
- * Drive the trailing indicator — `adw_entry_row_set_show_indicator`
97
- * (adw-entry-row-private.h, C:1281-1296). Private-to-the-library upstream,
98
- * public here because `AdwPasswordEntryRow` composes rather than reaching
99
- * into a private header.
88
+ * Drive the trailing indicator — `adw_entry_row_set_show_indicator`. Private to
89
+ * the library upstream, public here because `AdwPasswordEntryRow` composes rather
90
+ * than reaching into a private header.
100
91
  */
101
92
  setShowIndicator(show: boolean): void;
102
- /** `adw_entry_row_set_indicator_icon_name` (C:1263-1273), as an Adwaita symbolic SVG. */
93
+ /** `adw_entry_row_set_indicator_icon_name`, as an Adwaita symbolic SVG. */
103
94
  setIndicatorIcon(svg: string): void;
104
- /** Apply the pending edit — the apply button tap (C:229-241). */
95
+ /** Apply the pending edit — the apply button tap. */
105
96
  apply(): void;
106
- /** `text_activated_cb` (C:243-266) — exactly one of the two signals. */
97
+ /** `text_activated_cb` — exactly one of the two signals. */
107
98
  private _activate;
108
99
  /** Paint one render snapshot through the shared (spec-driven) painter. */
109
100
  protected _render(state: EntryRowRenderState): void;
@@ -6,38 +6,29 @@ export type { ButtonContentEllipsize };
6
6
  export declare const BUTTON_CONTENT_CAN_SHRINK_CLASS = "can-shrink";
7
7
  /**
8
8
  * The SVG the icon view is given: the app's, or the `image-missing` asset for an
9
- * empty slot.
9
+ * empty slot — the fallback `init` applies too, while `icon_name` is still `""`.
10
10
  *
11
- * That fallback is `gtk_image_set_from_icon_name (icon, "image-missing")`
12
- * (adw-button-content.c:355-356), applied by `init` too while `icon_name` is
13
- * still `""` (:284, :294). The widget NEVER hides the image — only the label
14
- * (:300, :398) — so this port keeps the icon view parented at all times and
15
- * swaps its source, which is the same shape as the C. The doc comments at :228
16
- * and :343 claim the icon is hidden instead; the code disagrees with them and
17
- * this follows the code (see the conformance vector's `rule`).
11
+ * The C NEVER hides the image, only the label, so this port keeps the icon view
12
+ * parented at all times and swaps its source. Upstream's own doc comments claim the
13
+ * icon is hidden instead; the code disagrees with them and this follows the code
14
+ * (see the conformance vector's `rule`).
18
15
  */
19
16
  export declare function buttonContentIconSvg(svg: string): string;
20
17
  /** Whether the icon shown is the empty-slot fallback rather than an app asset. */
21
18
  export declare function buttonContentIconIsFallback(svg: string): boolean;
22
19
  /**
23
- * The parent button's `className` with `image-text-button` added — the root-time
24
- * half of `adw_button_content_root` (:115).
25
- *
26
- * Adds rather than rewrites, so the `adw-button suggested-action pill` a caller
27
- * composed survives; and it is idempotent, so a re-parent cannot double the
28
- * token.
20
+ * The parent button's `className` with `image-text-button` added — the root-time half
21
+ * of `adw_button_content_root`. Adds rather than rewrites, so a caller's composed
22
+ * classes survive, and is idempotent, so a re-parent cannot double the token.
29
23
  */
30
24
  export declare function buttonContentRootedParentClassName(current: string): string;
31
25
  /**
32
- * The parent button's `className` with `image-text-button` removed — the unroot
33
- * half (:126).
34
- *
35
- * The C removes it on unroot rather than leaving it behind, so a button that
36
- * loses its content goes back to plain-button padding. A port that only ever
37
- * added the class would leave the 9px on a button that is now text-only.
26
+ * The parent button's `className` with `image-text-button` removed — the unroot half.
27
+ * A button that loses its content must go back to plain-button padding, or the 9px
28
+ * stays on a now text-only button.
38
29
  */
39
30
  export declare function buttonContentUnrootedParentClassName(current: string): string;
40
- /** The label view's `visibility` — NS's spelling of `gtk_widget_set_visible` (:398). */
31
+ /** The label view's `visibility` — NS's spelling of `gtk_widget_set_visible`. */
41
32
  export declare function buttonContentLabelVisibility(label: string): 'visible' | 'collapse';
42
33
  /** The content's own `className` for a `can-shrink` value, other tokens untouched. */
43
34
  export declare function buttonContentClassName(current: string, canShrink: boolean): string;
@@ -2,10 +2,9 @@ import type { Label } from '@nativescript/core';
2
2
  import { CarouselState } from '@gjsify/adwaita-core';
3
3
  import type { CarouselScrollRequest, CarouselStateChange } from '@gjsify/adwaita-core';
4
4
  /**
5
- * Default page width (DIPs) used for offset math until the consumer sets
6
- * `pageWidth`. libadwaita MEASURES its pages (adw-carousel.c:739-765); NS gives
7
- * a widget no size before its first layout pass, so a plausible phone-width
8
- * default keeps the offsets sane until the consumer supplies the real one.
5
+ * Default page width (DIPs) for the offset math until the consumer sets `pageWidth`.
6
+ * libadwaita MEASURES its pages; NS gives a widget no size before its first layout
7
+ * pass, so a plausible phone width keeps the offsets sane until then.
9
8
  */
10
9
  export declare const DEFAULT_CAROUSEL_PAGE_WIDTH = 320;
11
10
  /** Construction seams an `AdwCarousel` hands to its state machine. */
@@ -18,31 +17,29 @@ export interface NsCarouselStateOptions {
18
17
  /**
19
18
  * The state machine an `AdwCarousel` delegates to.
20
19
  *
21
- * `animateScroll` is FALSE: the `ScrollView` animates the pixels, but it reports
22
- * nothing until it has, and on an untested platform it may report nothing at
23
- * all. Keeping the model authoritative means a `scrollToPage` is correct the
24
- * instant it is called, which is also what the port did before the lift —
25
- * {@link CarouselScrollSync} is what keeps the two from fighting.
20
+ * `animateScroll` is FALSE: the `ScrollView` animates the pixels but reports nothing
21
+ * until it has, and on an untested platform it may report nothing at all. Keeping the
22
+ * model authoritative makes a `scrollToPage` correct the instant it is called;
23
+ * {@link CarouselScrollSync} keeps the two from fighting.
26
24
  */
27
25
  export declare function createCarouselState(options?: NsCarouselStateOptions): CarouselState;
28
26
  /** A page width that can be divided by — anything else falls back to the default. */
29
27
  export declare function normalizeCarouselPageWidth(value: number): number;
30
- /** The horizontal scroll offset in DIPs for a position — `distance * position` (adw-carousel.c:797-801). */
28
+ /** The horizontal scroll offset in DIPs for a position — `distance * position`. */
31
29
  export declare function carouselScrollOffset(position: number, distance: number): number;
32
30
  /** The inverse: the position a `ScrollView` at `offset` is showing. */
33
31
  export declare function carouselPositionAtOffset(offset: number, distance: number): number;
34
32
  /**
35
33
  * Keeps the model in step with a `ScrollView` that animates its own scrolls.
36
34
  *
37
- * Without this the two fight: the widget moves the model the moment
38
- * `scrollToPage` is called, then the animation replays every intermediate offset
39
- * back at it, so the dots would run backwards to where the scroll STARTED and
40
- * crawl forward again, emitting a second `page-changed` on arrival.
35
+ * Without this the two fight: the widget moves the model the moment `scrollToPage`
36
+ * is called, then the animation replays every intermediate offset back at it, so the
37
+ * dots run backwards to where the scroll STARTED and crawl forward again, emitting a
38
+ * second `page-changed` on arrival.
41
39
  *
42
- * So a programmatic scroll declares its destination with {@link expect}, and
43
- * every offset before that destination is ignored. A scroll nobody declared is a
44
- * user swipe and drives the model directly — which is how a free flick gets a
45
- * fractional position at all, something the port had no way to observe.
40
+ * So a programmatic scroll declares its destination with {@link expect} and every
41
+ * offset before it is ignored. A scroll nobody declared is a user swipe and drives the
42
+ * model directly — which is how a free flick gets a fractional position.
46
43
  */
47
44
  export declare class CarouselScrollSync {
48
45
  /** Position a programmatic scroll is animating towards, `null` while idle. */
@@ -17,10 +17,8 @@ export declare function defaultClampProps(): ClampProps;
17
17
  /**
18
18
  * Normalise one clamp property, keeping a nonsense value out of the layout.
19
19
  *
20
- * Delegates to core so the NativeScript widget and the browser element agree on
21
- * the three inputs they used to answer differently — `0` (valid, and NOT the
22
- * default), a non-numeric value (never reaches the layout, so the DEFAULT
23
- * applies), and a negative (clamped to the range floor).
20
+ * The three inputs worth knowing: `0` is valid and NOT the default, a non-numeric
21
+ * value falls back to the DEFAULT, a negative is clamped to the range floor.
24
22
  */
25
23
  export declare function normalizeClampProp(value: number | string | null | undefined, fallback: number): number;
26
24
  /** What one clamp layout pass tells the widget to do with its child. */
@@ -37,55 +35,41 @@ export interface ClampAllocationForWidth {
37
35
  /**
38
36
  * The child width and size class for a clamp `availableWidth` DIPs wide.
39
37
  *
40
- * `availableWidth <= 0` means NativeScript has not laid the view out yet — it
41
- * reports a zero size before the first pass — and the honest answer there is
42
- * "do not constrain", the same shape `sidebarWidthFor` uses for the same reason.
43
- * Anything else runs libadwaita's curve, so a narrow container yields a narrow
44
- * child rather than the maximum.
38
+ * `availableWidth <= 0` means NativeScript has not laid the view out yet (it
39
+ * reports a zero size before the first pass), and the honest answer there is "do
40
+ * not constrain" — the same shape `sidebarWidthFor` uses for the same reason.
45
41
  *
46
42
  * `childMin`/`childNat` are 0: NativeScript does not expose a child's measured
47
43
  * minimum before layout, and `lower = MAX (…, child_min)` only ever RAISES the
48
- * child's width — an NS child whose own content is wider than the clamp already
49
- * overflows rather than being cut, so nothing is lost by leaving it out.
44
+ * child's width — an NS child wider than the clamp already overflows rather than
45
+ * being cut, so nothing is lost by leaving it out.
50
46
  */
51
47
  export declare function clampAllocationFor(availableWidth: number, props: ClampProps): ClampAllocationForWidth;
52
- /**
53
- * Default spinner diameter in DIPs — `Adw.Spinner`'s measured natural size,
54
- * which equals its minimum (adw-spinner.c:78-81).
55
- *
56
- * Replaces an invented 32: nothing in libadwaita produces that number.
57
- */
48
+ /** Default spinner diameter in DIPs — `Adw.Spinner`'s natural size, which equals its minimum. */
58
49
  export declare const DEFAULT_SPINNER_SIZE = 16;
59
50
  /**
60
51
  * The RING diameter for a requested BOX size — floored at the measured minimum
61
52
  * 16 and capped at Adwaita's 64, with the odd-size flooring (`31` draws a 30 DIP
62
53
  * ring) coming from the paintable rather than from here.
63
54
  *
64
- * The two are different numbers, which is the whole point: `AdwSpinner` sizes
65
- * its BOX to the request and its `ActivityIndicator` to this. They used to be
66
- * one, so `size = 200` occupied 64 DIPs of layout where GTK occupies 200.
55
+ * Box and ring are deliberately different numbers: `AdwSpinner` sizes its BOX to
56
+ * the request and its `ActivityIndicator` to this, so `size = 200` occupies 200
57
+ * DIPs of layout around a 64 DIP ring.
67
58
  */
68
59
  export declare function spinnerDiameter(value: number | string | null | undefined): number;
69
60
  /** The four toolbar-view properties the style classes are derived from. */
70
61
  export interface ToolbarViewProps {
71
- /** `top-bar-style`. */
72
62
  topBarStyle: AdwToolbarStyle;
73
- /** `bottom-bar-style`. */
74
63
  bottomBarStyle: AdwToolbarStyle;
75
- /** `extend-content-to-top-edge`. */
76
64
  extendContentToTopEdge: boolean;
77
- /** `extend-content-to-bottom-edge`. */
78
65
  extendContentToBottomEdge: boolean;
79
66
  }
80
67
  /** The property defaults a fresh toolbar view starts with. */
81
68
  export declare function defaultToolbarViewProps(): ToolbarViewProps;
82
69
  /** The three `className` strings a toolbar view distributes over its own node and its two bar boxes. */
83
70
  export interface ToolbarViewClassNames {
84
- /** `className` for the view. */
85
71
  view: string;
86
- /** `className` for the top-bar box. */
87
72
  topBar: string;
88
- /** `className` for the bottom-bar box. */
89
73
  bottomBar: string;
90
74
  }
91
75
  /**
@@ -105,42 +89,33 @@ export declare function clampChildClassName(current: string, sizeClass: AdwClamp
105
89
  export type BannerProps = AdwBannerProps;
106
90
  /**
107
91
  * The property defaults a fresh banner starts with — libadwaita's, not this
108
- * port's.
109
- *
110
- * This is the whole reason the banner is here. `AdwBanner` used to initialise
111
- * `_revealed = true` AND never write `visibility` in its constructor, so a
112
- * banner put itself on screen on a device while the same markup stayed hidden in
113
- * the browser. `Adw.Banner:revealed` defaults to FALSE (adw-banner.c:456-459) —
114
- * "Banners are hidden by default" (:47) — and `use-markup` to TRUE (:422-425),
115
- * which the port had backwards as well.
92
+ * port's. The two easy ones to get backwards: `Adw.Banner:revealed` defaults to
93
+ * FALSE (banners are hidden until revealed) and `use-markup` to TRUE.
116
94
  */
117
95
  export declare function defaultBannerProps(): BannerProps;
118
96
  /**
119
97
  * The text the NS title `Label` is given.
120
98
  *
121
- * `Adw.Banner`'s title is Pango markup by default (:422-425) and the NS CSS
122
- * subset has no inline-markup layer at all, so the honest reduction is the
123
- * markup's PLAIN TEXT: `<b>Metered</b>` reads `Metered`, which is what GTK
124
- * paints minus the weight, where writing the raw string would paint the tags.
125
- * Unparseable markup keeps the raw string, reproducing the C fallback that
126
- * {@link stripMarkup} already models.
99
+ * `Adw.Banner`'s title is Pango markup by default and the NS CSS subset has no
100
+ * inline-markup layer, so the honest reduction is the markup's PLAIN TEXT:
101
+ * `<b>Metered</b>` reads `Metered`, where the raw string would paint the tags.
102
+ * Unparseable markup keeps the raw string, reproducing the C fallback.
127
103
  */
128
104
  export declare function bannerTitleText(title: string, useMarkup: boolean): string;
129
105
  /**
130
106
  * The NS `visibility` for a `revealed` value.
131
107
  *
132
- * `Adw.Banner` reveals through a `GtkRevealer` (:817); the NS subset has no
133
- * revealer, so `collapse` — which takes the view out of layout entirely — is the
134
- * closest thing to a fully retracted one.
108
+ * `Adw.Banner` reveals through a `GtkRevealer`; the NS subset has none, so
109
+ * `collapse` — which takes the view out of layout entirely — is the closest thing
110
+ * to a fully retracted one.
135
111
  */
136
112
  export declare function bannerVisibility(revealed: boolean): 'visible' | 'collapse';
137
113
  /**
138
114
  * The `className` for the banner button — the managed `button-style` class
139
115
  * swapped in, every other token left alone.
140
116
  *
141
- * `adw_banner_set_button_style` only ever adds or removes `suggested-action`
142
- * (:766, :769); it never rewrites the button's class list, and neither does
143
- * this.
117
+ * `adw_banner_set_button_style` only ever adds or removes `suggested-action`; it
118
+ * never rewrites the button's class list, and neither does this.
144
119
  */
145
120
  export declare function bannerButtonClassName(current: string, style: AdwBannerButtonStyle): string;
146
121
  /**
@@ -2,9 +2,8 @@ import type { AdwDataGridRowVariant, DataGridTrack } from '@gjsify/adwaita-core'
2
2
  import type { GridUnitType } from '@nativescript/core';
3
3
  /** The two numbers a NativeScript `ItemSpec` is constructed from. */
4
4
  export interface DataGridItemSpec {
5
- /** The `ItemSpec` value: a star weight, a pixel length, or 1 for `auto`. */
5
+ /** A star weight, a pixel length, or 1 for `auto`. */
6
6
  value: number;
7
- /** The `GridUnitType` — `'star'`, `'pixel'` or `'auto'`. */
8
7
  type: GridUnitType;
9
8
  }
10
9
  /** The class the header row's background carries. */
@@ -20,18 +19,15 @@ export declare const DATA_GRID_HEADER_CELL_CLASS = "header-cell";
20
19
  * `DataGridTrack`'s `fixed` kind carries the author's `width` string verbatim,
21
20
  * because only a CSS engine can resolve every unit CSS has. NativeScript has
22
21
  * exactly one length unit — the DIP — and its own stylesheet subset writes it as
23
- * a bare number (`min-height: 34`, `padding: 5 10 5 10`), so BOTH `'80px'` and
24
- * `'80'` are read as 80 here and everything else (`6rem`, `50%`, `calc(...)`)
25
- * is unresolvable and falls back to a content-sized track.
22
+ * a bare number (`min-height: 34`), so BOTH `'80px'` and `'80'` are read as 80
23
+ * here and everything else (`6rem`, `50%`, `calc(...)`) falls back to a
24
+ * content-sized track.
26
25
  *
27
- * That bare-number acceptance is a deliberate divergence from the browser, where
28
- * `width: '80'` is not a valid CSS length and takes the WHOLE
29
- * `grid-template-columns` declaration down with it. Falling back to `auto` for
30
- * one column is the smaller failure, and refusing a spelling that is valid in
31
- * this renderer's own stylesheet would be the surprising half.
32
- *
33
- * A negative or non-finite length is rejected rather than clamped: `ItemSpec`
34
- * refuses one, and a column silently pinned to 0 reads as a missing column.
26
+ * Accepting a bare number diverges from the browser deliberately, where `width:
27
+ * '80'` is not a valid CSS length and takes the whole `grid-template-columns`
28
+ * declaration down with it; falling back to `auto` for one column is the smaller
29
+ * failure. A negative or non-finite length is rejected rather than clamped:
30
+ * `ItemSpec` refuses one, and a column silently pinned to 0 reads as missing.
35
31
  */
36
32
  export declare function parseDataGridWidth(css: string): number | null;
37
33
  /**
@@ -54,14 +50,11 @@ export declare function dataGridItemSpec(track: DataGridTrack): DataGridItemSpec
54
50
  /**
55
51
  * A stable key for a track list — what the widget re-declares its columns on.
56
52
  *
57
- * The precedent is `AdwViewSwitcherBar`, which rebuilds its buttons only when the
58
- * page COUNT moves so that a selection change cannot replace the button under
59
- * the user's finger. The same discipline applies here, with one difference the
60
- * grid forces: a column list can change WITHOUT changing length — pinning a
61
- * column's `width` on a narrow screen is exactly that — and a count guard would
62
- * keep painting against the old tracks. So the guard is the tracks themselves,
63
- * which is a strict superset: whenever the count moves the key moves too, and a
64
- * repaint (new rows, a toggled `interactive`) never touches the columns.
53
+ * The guard is the tracks themselves, not their COUNT: a column list can change
54
+ * without changing length (pinning a column's `width` on a narrow screen does
55
+ * exactly that) and a count guard would keep painting against the old tracks.
56
+ * Whenever the count moves the key moves too, and a repaint (new rows, a toggled
57
+ * `interactive`) never touches the columns.
65
58
  */
66
59
  export declare function dataGridTracksKey(tracks: ReadonlyArray<DataGridTrack>): string;
67
60
  /**
@@ -76,12 +69,12 @@ export declare function dataGridShapeKey(columnCount: number, rowCount: number):
76
69
  /**
77
70
  * The classes a data row's background carries.
78
71
  *
79
- * The row background is a NativeScript-only node and this is why it exists: the
80
- * browser paints the fill, the hairline rules and the hover affordance on the
81
- * row ELEMENT, which is a real element there because it is a subgrid. Here the
82
- * cells are direct children of the one grid, so a full-width `StackLayout`
83
- * placed first at the same row — below the cells, spanning every column — is
84
- * what carries them, plus the tap target and the press feedback.
72
+ * The row background is a NativeScript-only node: the browser paints the fill, the
73
+ * hairline rules and the hover affordance on the row ELEMENT, which is a real
74
+ * element there because it is a subgrid. Here the cells are direct children of the
75
+ * one grid, so a full-width `StackLayout` placed first at the same row — below the
76
+ * cells, spanning every column — carries them plus the tap target and press
77
+ * feedback.
85
78
  *
86
79
  * `interactive` is a class rather than a widget flag so the press-darken keys off
87
80
  * it: `attachRowPressFeedback` is wired on EVERY data row, and a non-interactive
@@ -91,14 +84,10 @@ export declare function dataGridRowClass(variant: AdwDataGridRowVariant, interac
91
84
  /**
92
85
  * The classes a body cell carries: its column's own, plus the row's variant.
93
86
  *
94
- * The variant is repeated onto the CELL because of the same structural
95
- * difference: the browser bolds a subtotal's figures with
96
- * `.variant-subtotal .adw-data-grid-cell`, a DESCENDANT selector, and here the
97
- * cell is not inside the row background — the two are siblings in one grid. So
98
- * the row class cannot reach the cells and the cell has to say it itself.
99
- *
100
- * `normal` adds nothing: it is every row in a statement but the handful that
101
- * carry emphasis, and a class the stylesheet has no rule for is only noise in
102
- * the one place a reader looks when the emphasis is wrong.
87
+ * The variant is repeated onto the CELL because the browser bolds a subtotal's
88
+ * figures with a DESCENDANT selector (`.variant-subtotal .adw-data-grid-cell`)
89
+ * while here cell and row background are SIBLINGS in one grid — the row class
90
+ * cannot reach the cells. `normal` adds nothing, since the stylesheet has no rule
91
+ * for it.
103
92
  */
104
93
  export declare function dataGridCellClass(columnClasses: ReadonlyArray<string>, variant: AdwDataGridRowVariant): string;