@gjsify/adwaita-nativescript 0.64.13-next.283 → 0.64.13
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.
- package/lib/esm/widgets/adw-about-dialog.js +3 -3
- package/lib/esm/widgets/adw-avatar.js +1 -1
- package/lib/esm/widgets/adw-banner.js +1 -1
- package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
- package/lib/esm/widgets/adw-carousel.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-data-grid.js +1 -1
- package/lib/esm/widgets/adw-dialog.js +1 -1
- package/lib/esm/widgets/adw-image-button.js +1 -1
- package/lib/esm/widgets/adw-navigation-page.js +1 -1
- package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
- package/lib/esm/widgets/adw-navigation-view.js +1 -1
- package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
- package/lib/esm/widgets/adw-password-entry-row.js +1 -1
- package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
- package/lib/esm/widgets/adw-preferences-page.js +1 -1
- package/lib/esm/widgets/adw-sidebar.js +1 -1
- package/lib/esm/widgets/adw-slider-row.js +1 -1
- package/lib/esm/widgets/adw-spin-row.js +1 -1
- package/lib/esm/widgets/adw-split-button.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toggle-group.js +1 -1
- package/lib/esm/widgets/adw-toolbar-view.js +1 -1
- package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
- package/lib/esm/widgets/adw-wrap-box.js +1 -1
- package/lib/esm/widgets/construct-props.js +1 -1
- package/lib/esm/widgets/gtk-action-bar.js +1 -1
- package/lib/esm/widgets/gtk-box.js +1 -1
- package/lib/esm/widgets/gtk-button.js +1 -1
- package/lib/esm/widgets/gtk-check-button.js +1 -1
- package/lib/esm/widgets/gtk-drawing-area.js +1 -1
- package/lib/esm/widgets/gtk-drop-down.js +1 -1
- package/lib/esm/widgets/gtk-entry.js +1 -1
- package/lib/esm/widgets/gtk-grid.js +1 -1
- package/lib/esm/widgets/gtk-icon-size.js +1 -1
- package/lib/esm/widgets/gtk-image.js +1 -1
- package/lib/esm/widgets/gtk-label.js +1 -1
- package/lib/esm/widgets/gtk-list-box.js +1 -1
- package/lib/esm/widgets/gtk-menu-button.js +1 -1
- package/lib/esm/widgets/gtk-revealer.js +1 -1
- package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
- package/lib/esm/widgets/gtk-stack.js +1 -1
- package/lib/esm/widgets/gtk-text-view.js +1 -1
- package/lib/esm/widgets/gtk-toggle-button.js +1 -1
- package/lib/esm/widgets/gtk-window.js +1 -1
- package/lib/esm/widgets/label-markup.js +1 -1
- package/lib/esm/widgets/scrolled-window-policy.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/single-child-base.js +1 -1
- package/lib/esm/widgets/single-child-cell.js +1 -0
- package/lib/esm/widgets/stack-page.js +1 -1
- package/lib/esm/widgets/transition-type.js +1 -1
- package/lib/esm/widgets/view-stack-page.js +1 -1
- package/lib/esm/widgets/widget-layout.js +1 -1
- package/lib/esm/widgets/xml-values.js +1 -1
- package/lib/types/clamped-bin.spec.d.ts +2 -0
- package/lib/types/combo-row-properties.spec.d.ts +2 -0
- package/lib/types/drop-down-properties.spec.d.ts +2 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/single-child-cell.spec.d.ts +2 -0
- package/lib/types/testing/ns-core.d.mts +24 -2
- package/lib/types/widgets/adw-combo-row.d.ts +42 -26
- package/lib/types/widgets/gtk-drop-down.d.ts +41 -33
- package/lib/types/widgets/index.d.ts +1 -2
- package/lib/types/widgets/signals.d.ts +33 -8
- package/lib/types/widgets/single-child-base.d.ts +2 -0
- package/lib/types/widgets/single-child-cell.d.ts +8 -0
- package/lib/types/widgets/xml-values.d.ts +12 -0
- package/package.json +13 -14
- package/src/testing/ns-core.mts +55 -2
|
@@ -59,6 +59,15 @@ export declare class Style extends Observable {
|
|
|
59
59
|
constructor(view: View);
|
|
60
60
|
get visibility(): string;
|
|
61
61
|
set visibility(value: string);
|
|
62
|
+
/**
|
|
63
|
+
* The inline width, in DIPs or as a percentage string, `'auto'` until written — and the
|
|
64
|
+
* `widthChange` a one-child container listens for. A CSS property notifies on the style
|
|
65
|
+
* and not on the view, which is the whole reason this pair lives here.
|
|
66
|
+
*/
|
|
67
|
+
get width(): number | string;
|
|
68
|
+
set width(value: number | string);
|
|
69
|
+
get height(): number | string;
|
|
70
|
+
set height(value: number | string);
|
|
62
71
|
}
|
|
63
72
|
export declare class View extends Observable {
|
|
64
73
|
/**
|
|
@@ -95,8 +104,21 @@ export declare class View extends Observable {
|
|
|
95
104
|
* missing so the first `className` write died inside a constructor.
|
|
96
105
|
*/
|
|
97
106
|
readonly cssClasses: Set<string>;
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
/**
|
|
108
|
+
* `'auto'` until written, and HELD ON THE {@link Style} as `widthProperty` /
|
|
109
|
+
* `heightProperty` are (`ui/styling/style-properties.ts` registers both on `Style`;
|
|
110
|
+
* `view-common.ts`'s `get width()` is a one-line forward to `this.style.width`).
|
|
111
|
+
*
|
|
112
|
+
* This double held them as plain fields on the view, which made it STRUCTURALLY BLIND to
|
|
113
|
+
* the one thing a reader needs from them: the notification. `AdwSingleChildBase` learns
|
|
114
|
+
* that a parent settled its width from `widthChange` on the style — on a device the only
|
|
115
|
+
* place it is emitted — and against a field there is no event at all, so a spec would
|
|
116
|
+
* have passed while the widget sat waiting for a message that never came.
|
|
117
|
+
*/
|
|
118
|
+
get width(): number | string;
|
|
119
|
+
set width(value: number | string);
|
|
120
|
+
get height(): number | string;
|
|
121
|
+
set height(value: number | string);
|
|
100
122
|
horizontalAlignment: string;
|
|
101
123
|
verticalAlignment: string;
|
|
102
124
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, type
|
|
1
|
+
import { Label, type View } from '@nativescript/core';
|
|
2
2
|
import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
|
|
3
3
|
import { AdwActionRow } from './adw-action-row.js';
|
|
4
4
|
import { GtkImage } from './gtk-image.js';
|
|
@@ -7,14 +7,18 @@ export { ComboState } from '@gjsify/adwaita-core';
|
|
|
7
7
|
export type { AdwComboOption, ComboStateChange, ComboStateListener } from '@gjsify/adwaita-core';
|
|
8
8
|
/** Event name emitted when {@link AdwComboRow.selected} changes. Mirrors GObject `notify::selected`. */
|
|
9
9
|
export declare const NOTIFY_SELECTED = "notify::selected";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
value:
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
declare const AdwComboRow_base: ((abstract new (...args: any[]) => {
|
|
11
|
+
_emit(eventName: string): void;
|
|
12
|
+
addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
|
|
13
|
+
removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
|
|
14
|
+
notify<T extends import("@nativescript/core").EventData>(data: T): void;
|
|
15
|
+
notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
|
|
16
|
+
set(name: string, value: unknown): void;
|
|
17
|
+
get(name: string): unknown;
|
|
18
|
+
}) & {
|
|
19
|
+
readonly emittedSignals: readonly string[];
|
|
20
|
+
}) & typeof AdwActionRow;
|
|
21
|
+
export declare class AdwComboRow extends AdwComboRow_base {
|
|
18
22
|
static readonly GTypeName: string;
|
|
19
23
|
/**
|
|
20
24
|
* The action row's edges, plus `model`: `model: Gtk.StringList { strings [ … ] }` in a
|
|
@@ -42,7 +46,35 @@ export declare class AdwComboRow extends AdwActionRow {
|
|
|
42
46
|
* writes `model:` first — the order GtkBuilder needs too.
|
|
43
47
|
*/
|
|
44
48
|
private _pendingSelected;
|
|
49
|
+
/** `Adw.ComboRow:model` — the list, by identity. Declared above; the seam installs it. */
|
|
50
|
+
model: ComboWatchableModel | null;
|
|
51
|
+
/**
|
|
52
|
+
* `Adw.ComboRow:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
|
|
53
|
+
* Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
|
|
54
|
+
* per declared property and this row is what writes the derived value.
|
|
55
|
+
*/
|
|
56
|
+
selected: number;
|
|
57
|
+
/**
|
|
58
|
+
* `Adw.ComboRow:selected-item` — the model's OWN object at {@link selected}, so the identity
|
|
59
|
+
* comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
|
|
60
|
+
* model. Read-only by derivation (see the declaration).
|
|
61
|
+
*/
|
|
62
|
+
selectedItem: unknown;
|
|
63
|
+
/**
|
|
64
|
+
* What a `model` write DOES, once the seam has stored the normalized value.
|
|
65
|
+
*
|
|
66
|
+
* A method on the class and not a body inside the declaration, because the descriptor sits
|
|
67
|
+
* outside the class and reaches the state through a cast — and a reader keyed on
|
|
68
|
+
* `this.<field>` cannot tell `ComboState.setModel` from `ListViewState.setModel` through
|
|
69
|
+
* one (`check-adwaita-collection-reactivity.mjs`). Guessing there would merge two different
|
|
70
|
+
* collections into one comparison, so the call is made where the field's type is declared.
|
|
71
|
+
*/
|
|
72
|
+
private _applyModel;
|
|
73
|
+
/** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
|
|
74
|
+
private _applySelected;
|
|
45
75
|
constructor(props?: ConstructProps<AdwComboRow>);
|
|
76
|
+
/** What the relay pushes for each of the three — the state's reading, never the store's. */
|
|
77
|
+
private _valueOf;
|
|
46
78
|
/**
|
|
47
79
|
* `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
|
|
48
80
|
* choice, so the chevron goes and the row stops being activatable.
|
|
@@ -54,13 +86,6 @@ export declare class AdwComboRow extends AdwActionRow {
|
|
|
54
86
|
private _syncChooser;
|
|
55
87
|
/** Open the native action chooser and apply the picked option. */
|
|
56
88
|
private _openChooser;
|
|
57
|
-
/**
|
|
58
|
-
* The list model (`Adw.ComboRow:model`) — the OBJECT that was assigned, by identity, as
|
|
59
|
-
* `row.model === model` is measured to hold in libadwaita (ADR 0122 § 4). The normalised
|
|
60
|
-
* descriptors are {@link options}.
|
|
61
|
-
*/
|
|
62
|
-
get model(): ComboWatchableModel | null;
|
|
63
|
-
set model(value: ComboWatchableModel | string | null);
|
|
64
89
|
/** The held model's items as `{ value, label }` descriptors. */
|
|
65
90
|
get options(): AdwComboOption[];
|
|
66
91
|
/** `adw_combo_row_set_model`. */
|
|
@@ -73,21 +98,12 @@ export declare class AdwComboRow extends AdwActionRow {
|
|
|
73
98
|
* row edge, as on any action row.
|
|
74
99
|
*/
|
|
75
100
|
_addChildFromBuilder(name: string, child: View): void;
|
|
76
|
-
/**
|
|
77
|
-
get selected(): number;
|
|
78
|
-
set selected(raw: number | string);
|
|
101
|
+
/** `adw_combo_row_get_selected`. */
|
|
79
102
|
get_selected(): number;
|
|
80
103
|
set_selected(position: number): void;
|
|
81
104
|
/** The selected option's `value`, or `''` when out of range. */
|
|
82
105
|
get selectedValue(): string;
|
|
83
106
|
set selectedValue(value: string);
|
|
84
|
-
/**
|
|
85
|
-
* The selected ITEM (`Adw.ComboRow:selected-item`) — the model's own object at
|
|
86
|
-
* {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
|
|
87
|
-
* consumer writes holds. `null` for the sentinel and for no model. Read-only, as in
|
|
88
|
-
* libadwaita.
|
|
89
|
-
*/
|
|
90
|
-
get selectedItem(): unknown;
|
|
91
107
|
/** `adw_combo_row_get_selected_item`. */
|
|
92
108
|
get_selected_item(): unknown;
|
|
93
109
|
}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import { Label, StackLayout, type
|
|
1
|
+
import { Label, StackLayout, type View } from '@nativescript/core';
|
|
2
2
|
import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
|
|
3
3
|
import { GtkImage } from './gtk-image.js';
|
|
4
4
|
import { type ConstructProps } from './construct-props.js';
|
|
5
|
-
|
|
5
|
+
import { type GObjectNotify } from './signals.js';
|
|
6
|
+
/** Event name emitted when {@link GtkDropDown.selected} changes. Mirrors GObject `notify::selected`. */
|
|
6
7
|
export declare const NOTIFY_SELECTED = "notify::selected";
|
|
7
8
|
/** Mirrors GObject `notify::selected-item`; fired right after the one above, on the same change. */
|
|
8
9
|
export declare const NOTIFY_SELECTED_ITEM = "notify::selected-item";
|
|
9
|
-
/** Payload of the `notify::selected` event. */
|
|
10
|
-
export interface NotifyDropDownSelectedEventData extends EventData {
|
|
11
|
-
/** The newly-selected index. */
|
|
12
|
-
selected: number;
|
|
13
|
-
/** The newly-selected option's `value`. */
|
|
14
|
-
value: string;
|
|
15
|
-
/** The newly-selected option's `label` — what the button now shows. */
|
|
16
|
-
label: string;
|
|
17
|
-
}
|
|
18
10
|
declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
|
|
19
|
-
addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
|
|
20
|
-
removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
|
|
21
|
-
connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
|
|
11
|
+
addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
|
|
12
|
+
removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
|
|
13
|
+
connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
|
|
22
14
|
disconnect(handlerId: number): void;
|
|
23
15
|
emit(eventName: string, ...args: unknown[]): void;
|
|
24
16
|
get_property(name: string): unknown;
|
|
@@ -73,7 +65,7 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
|
|
|
73
65
|
set_focus_on_click(focusOnClick: boolean): void;
|
|
74
66
|
grab_focus(): boolean;
|
|
75
67
|
_emit(eventName: string): void;
|
|
76
|
-
notify<T extends EventData>(data: T): void;
|
|
68
|
+
notify<T extends import("@nativescript/core").EventData>(data: T): void;
|
|
77
69
|
notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
|
|
78
70
|
set(name: string, value: unknown): void;
|
|
79
71
|
get(name: string): unknown;
|
|
@@ -82,8 +74,6 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
|
|
|
82
74
|
}) & typeof StackLayout;
|
|
83
75
|
export declare class GtkDropDown extends GtkDropDown_base {
|
|
84
76
|
static readonly GTypeName: string;
|
|
85
|
-
/** The GTK signals this widget emits through `connect` — read by the shared-tree builder (ADR 0093). */
|
|
86
|
-
static readonly emittedSignals: readonly string[];
|
|
87
77
|
/**
|
|
88
78
|
* `model` only: `model: Gtk.StringList { strings [ … ] }` in a `.blp` places the list at
|
|
89
79
|
* the property it sets (ADR 0072). `GtkDropDown` takes no child widget in GTK.
|
|
@@ -104,16 +94,43 @@ export declare class GtkDropDown extends GtkDropDown_base {
|
|
|
104
94
|
private readonly _authored;
|
|
105
95
|
/** Title shown atop the substituted `action()` sheet. */
|
|
106
96
|
private _chooserTitle;
|
|
97
|
+
/**
|
|
98
|
+
* A `selected` written while the widget has no model yet — the twin of
|
|
99
|
+
* {@link AdwComboRow}'s. NativeScript's XML builder assigns every attribute before it adds
|
|
100
|
+
* the children, so `<gtk:DropDown selected="1">` reached this widget before its
|
|
101
|
+
* `<gtk:DropDown.model>` list did and the index was DROPPED; the row has held it since it
|
|
102
|
+
* was written and the drop-down does now too.
|
|
103
|
+
*/
|
|
104
|
+
private _pendingSelected;
|
|
105
|
+
/** `Gtk.DropDown:model` — the list, by identity. Declared above; the seam installs it. */
|
|
106
|
+
model: ComboWatchableModel | null;
|
|
107
|
+
/**
|
|
108
|
+
* `Gtk.DropDown:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
|
|
109
|
+
* Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
|
|
110
|
+
* per declared property and this widget is what writes the derived value.
|
|
111
|
+
*/
|
|
112
|
+
selected: number;
|
|
113
|
+
/**
|
|
114
|
+
* `Gtk.DropDown:selected-item` — the model's OWN object at {@link selected}, so the identity
|
|
115
|
+
* comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
|
|
116
|
+
* model. Read-only by derivation (see the declaration).
|
|
117
|
+
*/
|
|
118
|
+
selectedItem: unknown;
|
|
119
|
+
/** GJS's `notify('<prop>')` beside NativeScript's `notify({ eventName })`; see the seam. */
|
|
120
|
+
notify: GObjectNotify;
|
|
121
|
+
/**
|
|
122
|
+
* What a `model` write does, once the seam has stored the normalized value — the twin of
|
|
123
|
+
* `AdwComboRow._applyModel`, which says why the body sits on the class and not in the
|
|
124
|
+
* declaration.
|
|
125
|
+
*/
|
|
126
|
+
private _applyModel;
|
|
127
|
+
/** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
|
|
128
|
+
private _applySelected;
|
|
107
129
|
constructor(props?: ConstructProps<GtkDropDown>);
|
|
130
|
+
/** What the relay pushes for each of the three — the state's reading, never the store's. */
|
|
131
|
+
private _valueOf;
|
|
108
132
|
/** Open the native chooser and apply the picked option. */
|
|
109
133
|
private _openChooser;
|
|
110
|
-
/**
|
|
111
|
-
* The list model (`Gtk.DropDown:model`) — the OBJECT that was assigned, by identity, as
|
|
112
|
-
* `dropdown.model === model` is measured to hold in GTK (ADR 0122 § 4). The normalised
|
|
113
|
-
* descriptors are {@link options}.
|
|
114
|
-
*/
|
|
115
|
-
get model(): ComboWatchableModel | null;
|
|
116
|
-
set model(value: ComboWatchableModel | string | null);
|
|
117
134
|
/** The held model's items as `{ value, label }` descriptors. */
|
|
118
135
|
get options(): AdwComboOption[];
|
|
119
136
|
/** `gtk_drop_down_set_model`. */
|
|
@@ -125,9 +142,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
|
|
|
125
142
|
* Anything else is refused, as GTK refuses a child widget on a `GtkDropDown`.
|
|
126
143
|
*/
|
|
127
144
|
_addChildFromBuilder(name: string, child: View): void;
|
|
128
|
-
/** The selected option index (`Gtk.DropDown:selected`). */
|
|
129
|
-
get selected(): number;
|
|
130
|
-
set selected(raw: number | string);
|
|
131
145
|
/** `gtk_drop_down_get_selected`. */
|
|
132
146
|
get_selected(): number;
|
|
133
147
|
/** `gtk_drop_down_set_selected`. */
|
|
@@ -135,12 +149,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
|
|
|
135
149
|
/** The selected option's `value`, or `''` when out of range. */
|
|
136
150
|
get selectedValue(): string;
|
|
137
151
|
set selectedValue(value: string);
|
|
138
|
-
/**
|
|
139
|
-
* The selected ITEM (`Gtk.DropDown:selected-item`) — the model's own object at
|
|
140
|
-
* {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
|
|
141
|
-
* consumer writes holds. `null` for the sentinel and for no model. Read-only, as in GTK.
|
|
142
|
-
*/
|
|
143
|
-
get selectedItem(): unknown;
|
|
144
152
|
/** `gtk_drop_down_get_selected_item`. */
|
|
145
153
|
get_selected_item(): unknown;
|
|
146
154
|
/**
|
|
@@ -7,9 +7,8 @@ export { AdwPasswordEntryRow } from './adw-password-entry-row.js';
|
|
|
7
7
|
export { GtkEntry, ACTIVATE as ENTRY_ACTIVATE, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT } from './gtk-entry.js';
|
|
8
8
|
export type { NotifyEntryTextEventData } from './gtk-entry.js';
|
|
9
9
|
export { AdwComboRow, ComboState, NOTIFY_SELECTED } from './adw-combo-row.js';
|
|
10
|
-
export type { AdwComboOption, ComboStateChange, ComboStateListener
|
|
10
|
+
export type { AdwComboOption, ComboStateChange, ComboStateListener } from './adw-combo-row.js';
|
|
11
11
|
export { GtkDropDown, NOTIFY_SELECTED as NOTIFY_DROP_DOWN_SELECTED } from './gtk-drop-down.js';
|
|
12
|
-
export type { NotifyDropDownSelectedEventData } from './gtk-drop-down.js';
|
|
13
12
|
export { AdwSpinRow, NOTIFY_VALUE, SpinState } from './adw-spin-row.js';
|
|
14
13
|
export type { NotifyValueEventData, SpinStateChange, SpinStateListener } from './adw-spin-row.js';
|
|
15
14
|
export { AdwSliderRow, NOTIFY_SLIDER_VALUE } from './adw-slider-row.js';
|
|
@@ -22,9 +22,9 @@ type Declared<P> = P & {
|
|
|
22
22
|
*/
|
|
23
23
|
readonly normalize?: (value: unknown, self: object) => unknown;
|
|
24
24
|
/**
|
|
25
|
-
* Replaces the equal-write check for this property
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Replaces the equal-write check for this property: `written` is the value as the caller
|
|
26
|
+
* spelled it, `next` what {@link Declared.normalize} made of it, `held` what the store holds
|
|
27
|
+
* — and the answer decides whether the write notifies at all.
|
|
28
28
|
*
|
|
29
29
|
* WHY. A C setter guards on `g_strcmp0 (value, adw_…_get_…(self))`, against the GETTER
|
|
30
30
|
* READBACK rather than the stored field. Where storage normalises, the two differ and the
|
|
@@ -33,12 +33,19 @@ type Declared<P> = P & {
|
|
|
33
33
|
* libadwaita 1.9.4). Comparing the held value says the opposite, and only the property whose
|
|
34
34
|
* `normalize` collapses distinct writes onto one held value can tell the difference.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* RUNS ON BOTH LEGS. It used to run on the pure one alone, on the reasoning that "there the
|
|
37
|
+
* guard IS the C one" — which holds for a widget wrapping a real C object and not for a
|
|
38
|
+
* foreign-parent class, which has no C setter at all. On route D node-gi's generated setter
|
|
39
|
+
* is an identity guard and nothing more (`installForeignPropertyAccessors` in `gi.js`), so a
|
|
40
|
+
* property that left this to the real leg got the identity answer there and the measured one
|
|
41
|
+
* off-device — the per-leg difference this seam exists to close.
|
|
37
42
|
*/
|
|
38
43
|
readonly changed?: (next: unknown, held: unknown, written: unknown, self: object) => boolean;
|
|
39
44
|
/**
|
|
40
|
-
* The rest of the C setter
|
|
41
|
-
*
|
|
45
|
+
* The rest of the C setter: runs once this property's own `notify::<name>` is out, so a
|
|
46
|
+
* setter that also drives OTHER properties emits in the order C does. For a property with
|
|
47
|
+
* {@link ForeignScalarProperty.explicitNotify} it runs INSTEAD of that notify, and owes every
|
|
48
|
+
* emission the write makes, its own included.
|
|
42
49
|
*
|
|
43
50
|
* WHY IT IS NOT `normalize`. A normalizer runs AHEAD of the store, so a cross-write made
|
|
44
51
|
* there notifies before the property that caused it. `Adw.SplitButton` measures the other way
|
|
@@ -46,8 +53,9 @@ type Declared<P> = P & {
|
|
|
46
53
|
* after — and the two cannot both be one hook. The SHAPE of a value still belongs to
|
|
47
54
|
* `normalize`; what the write does to its siblings belongs here.
|
|
48
55
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
56
|
+
* RUNS ON BOTH LEGS, for the reason {@link Declared.changed} states: the foreign-parent class
|
|
57
|
+
* route D registers has no C setter to do this instead. `adw-split-button`'s label/icon-name
|
|
58
|
+
* mutual clear is the one that was silently missing on Android because of it.
|
|
51
59
|
*/
|
|
52
60
|
readonly afterNotify?: (self: object) => void;
|
|
53
61
|
};
|
|
@@ -223,4 +231,21 @@ export declare function withProperties<TBase extends ObservableConstructor>(Base
|
|
|
223
231
|
/** Only what this class ADDS; `emittedSignalsOf` merges it with the base's. */
|
|
224
232
|
readonly emittedSignals: readonly string[];
|
|
225
233
|
}) & TBase;
|
|
234
|
+
/**
|
|
235
|
+
* Write a declared property's held value WITHOUT notifying, and without running `normalize`,
|
|
236
|
+
* `changed` or `afterNotify` — the PUSH half of a property whose widget owns the emission.
|
|
237
|
+
*
|
|
238
|
+
* WHY A WIDGET NEEDS IT. A property whose value also moves from UNDERNEATH — the selection of an
|
|
239
|
+
* `Adw.ComboRow` when its model is replaced, or when the held model splices — cannot be kept in
|
|
240
|
+
* sync by writing it, because the write is the thing that emits and the emission order is
|
|
241
|
+
* measured and is not the order a write would produce. `model = null` is the sharpest case:
|
|
242
|
+
* `selected` goes to the sentinel and `selected-item` to null with NO notify at all, and `model`
|
|
243
|
+
* alone notifies. So the widget pushes the new value in here and emits what it owes with
|
|
244
|
+
* `notify('<name>')`, in the order it measured.
|
|
245
|
+
*
|
|
246
|
+
* Only a {@link isSeamOwned} property may be pushed, and a name that is not one THROWS rather
|
|
247
|
+
* than writing a store route D would never read back: there the value lives in the GObject, and
|
|
248
|
+
* a silent push would be correct off-device and invisible on the device.
|
|
249
|
+
*/
|
|
250
|
+
export declare function pushDeclared(self: object, name: string, value: unknown): void;
|
|
226
251
|
export {};
|
|
@@ -5,6 +5,8 @@ export declare abstract class AdwSingleChildBase extends AdwStyledLayoutBase {
|
|
|
5
5
|
constructor();
|
|
6
6
|
private _columnIsStar;
|
|
7
7
|
onLoaded(): void;
|
|
8
|
+
onUnloaded(): void;
|
|
9
|
+
private _onWidthChangeSyncColumn;
|
|
8
10
|
private _syncColumnToAlignment;
|
|
9
11
|
/** The child, or `null`. */
|
|
10
12
|
get child(): View | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the single cell of a one-child container is `star` rather than `auto`.
|
|
3
|
+
*
|
|
4
|
+
* `star` when the container's width is settled — either because it stretches to its parent,
|
|
5
|
+
* or because a definite `width` was written on it. `auto` otherwise, so the container can
|
|
6
|
+
* still report its child's natural width and be placed by its alignment.
|
|
7
|
+
*/
|
|
8
|
+
export declare function singleChildCellIsStar(horizontalAlignment: unknown, width: unknown): boolean;
|
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
* caller can keep validating a RANGE without also having to re-check the type.
|
|
7
7
|
*/
|
|
8
8
|
export declare function xmlNumber(value: unknown, fallback: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* The integer GtkBuilder reads out of an enum property's value, or `undefined` when the
|
|
11
|
+
* value is a nick or name.
|
|
12
|
+
*
|
|
13
|
+
* `_gtk_builder_enum_from_string` (gtk/gtkbuilder.c) tries the number FIRST
|
|
14
|
+
* (`g_ascii_strtoull (string, &endptr, 0)`, so base 0: decimal, `0x` hex, leading-`0` octal)
|
|
15
|
+
* and only then the nick and the name — which is why `halign="1"` and `halign="start"` are
|
|
16
|
+
* the same attribute in a `.ui` file. A JS number is the same reading, already parsed.
|
|
17
|
+
* GTK also accepts a numeric PREFIX (`"2abc"` is 2); the whole string must be a number here,
|
|
18
|
+
* so a nick that merely starts with a digit stays a nick.
|
|
19
|
+
*/
|
|
20
|
+
export declare function gtkBuilderInteger(value: unknown): number | undefined;
|
|
9
21
|
/**
|
|
10
22
|
* An attribute as a boolean.
|
|
11
23
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-nativescript",
|
|
3
|
-
"version": "0.64.13
|
|
3
|
+
"version": "0.64.13",
|
|
4
4
|
"description": "Native Adwaita widgets for the NativeScript runtime — real NativeScript components (StackLayout/GridLayout/Switch/Label) styled like Libadwaita, not a webview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"design-system"
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@gjsify/adwaita-core": "0.64.13
|
|
77
|
-
"@gjsify/adwaita-fonts": "0.64.13
|
|
78
|
-
"@gjsify/adwaita-icons": "0.64.13
|
|
79
|
-
"@gjsify/canvas2d-core": "0.64.13
|
|
80
|
-
"@gjsify/native-platform": "0.64.13
|
|
76
|
+
"@gjsify/adwaita-core": "^0.64.13",
|
|
77
|
+
"@gjsify/adwaita-fonts": "^0.64.13",
|
|
78
|
+
"@gjsify/adwaita-icons": "^0.64.13",
|
|
79
|
+
"@gjsify/canvas2d-core": "^0.64.13",
|
|
80
|
+
"@gjsify/native-platform": "^0.64.13"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@nativescript/core": "*",
|
|
84
|
-
"@gjsify/app-settings": "0.64.13
|
|
84
|
+
"@gjsify/app-settings": "^0.64.13"
|
|
85
85
|
},
|
|
86
86
|
"peerDependenciesMeta": {
|
|
87
87
|
"@nativescript/core": {
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@gjsify/app-settings": "0.64.13
|
|
96
|
-
"@gjsify/blueprint": "0.64.13
|
|
97
|
-
"@gjsify/cli": "0.64.13
|
|
98
|
-
"@gjsify/unit": "0.64.13
|
|
99
|
-
"@gjsify/vite-plugin-blueprint": "0.64.13
|
|
95
|
+
"@gjsify/app-settings": "^0.64.13",
|
|
96
|
+
"@gjsify/blueprint": "^0.64.13",
|
|
97
|
+
"@gjsify/cli": "^0.64.13",
|
|
98
|
+
"@gjsify/unit": "^0.64.13",
|
|
99
|
+
"@gjsify/vite-plugin-blueprint": "^0.64.13",
|
|
100
100
|
"@types/node": "^25.9.2",
|
|
101
101
|
"typescript": "^6.0.3"
|
|
102
102
|
},
|
|
@@ -125,6 +125,5 @@
|
|
|
125
125
|
"bugs": {
|
|
126
126
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
127
127
|
},
|
|
128
|
-
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/adwaita#readme"
|
|
129
|
-
"gitHead": "05fae97125a374e84bf57c2d2d086fb53523f205"
|
|
128
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/adwaita#readme"
|
|
130
129
|
}
|
package/src/testing/ns-core.mts
CHANGED
|
@@ -177,6 +177,8 @@ export class Style extends Observable {
|
|
|
177
177
|
fontSize?: number;
|
|
178
178
|
readonly viewRef: WeakRef<View>;
|
|
179
179
|
#visibility = 'visible';
|
|
180
|
+
#width: number | string = 'auto';
|
|
181
|
+
#height: number | string = 'auto';
|
|
180
182
|
|
|
181
183
|
constructor(view: View) {
|
|
182
184
|
super();
|
|
@@ -193,6 +195,33 @@ export class Style extends Observable {
|
|
|
193
195
|
this.#visibility = value;
|
|
194
196
|
this.notify({ eventName: 'visibilityChange', object: this, propertyName: 'visibility', value, oldValue });
|
|
195
197
|
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The inline width, in DIPs or as a percentage string, `'auto'` until written — and the
|
|
201
|
+
* `widthChange` a one-child container listens for. A CSS property notifies on the style
|
|
202
|
+
* and not on the view, which is the whole reason this pair lives here.
|
|
203
|
+
*/
|
|
204
|
+
get width(): number | string {
|
|
205
|
+
return this.#width;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
set width(value: number | string) {
|
|
209
|
+
const oldValue = this.#width;
|
|
210
|
+
if (value === oldValue) return;
|
|
211
|
+
this.#width = value;
|
|
212
|
+
this.notify({ eventName: 'widthChange', object: this, propertyName: 'width', value, oldValue });
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
get height(): number | string {
|
|
216
|
+
return this.#height;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
set height(value: number | string) {
|
|
220
|
+
const oldValue = this.#height;
|
|
221
|
+
if (value === oldValue) return;
|
|
222
|
+
this.#height = value;
|
|
223
|
+
this.notify({ eventName: 'heightChange', object: this, propertyName: 'height', value, oldValue });
|
|
224
|
+
}
|
|
196
225
|
}
|
|
197
226
|
|
|
198
227
|
export class View extends Observable {
|
|
@@ -234,8 +263,32 @@ export class View extends Observable {
|
|
|
234
263
|
* missing so the first `className` write died inside a constructor.
|
|
235
264
|
*/
|
|
236
265
|
readonly cssClasses: Set<string> = new Set();
|
|
237
|
-
|
|
238
|
-
|
|
266
|
+
/**
|
|
267
|
+
* `'auto'` until written, and HELD ON THE {@link Style} as `widthProperty` /
|
|
268
|
+
* `heightProperty` are (`ui/styling/style-properties.ts` registers both on `Style`;
|
|
269
|
+
* `view-common.ts`'s `get width()` is a one-line forward to `this.style.width`).
|
|
270
|
+
*
|
|
271
|
+
* This double held them as plain fields on the view, which made it STRUCTURALLY BLIND to
|
|
272
|
+
* the one thing a reader needs from them: the notification. `AdwSingleChildBase` learns
|
|
273
|
+
* that a parent settled its width from `widthChange` on the style — on a device the only
|
|
274
|
+
* place it is emitted — and against a field there is no event at all, so a spec would
|
|
275
|
+
* have passed while the widget sat waiting for a message that never came.
|
|
276
|
+
*/
|
|
277
|
+
get width(): number | string {
|
|
278
|
+
return this._style.width;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
set width(value: number | string) {
|
|
282
|
+
this._style.width = value;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
get height(): number | string {
|
|
286
|
+
return this._style.height;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
set height(value: number | string) {
|
|
290
|
+
this._style.height = value;
|
|
291
|
+
}
|
|
239
292
|
horizontalAlignment = 'stretch';
|
|
240
293
|
verticalAlignment = 'stretch';
|
|
241
294
|
/**
|