@gjsify/adwaita-react-native 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +415 -10
- package/lib/esm/index.gtk.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.native.js +1 -1
- package/lib/esm/row-shell.native.js +1 -0
- package/lib/esm/testing/react-native.js +1 -1
- package/lib/esm/widgets/action-row.gtk.js +1 -0
- package/lib/esm/widgets/action-row.js +1 -0
- package/lib/esm/widgets/action-row.native.js +1 -0
- package/lib/esm/widgets/avatar.gtk.js +1 -0
- package/lib/esm/widgets/avatar.js +1 -0
- package/lib/esm/widgets/avatar.native.js +1 -0
- package/lib/esm/widgets/banner.gtk.js +1 -0
- package/lib/esm/widgets/banner.js +1 -0
- package/lib/esm/widgets/banner.native.js +1 -0
- package/lib/esm/widgets/button-content.gtk.js +1 -0
- package/lib/esm/widgets/button-content.js +1 -0
- package/lib/esm/widgets/button-content.native.js +1 -0
- package/lib/esm/widgets/button-row.gtk.js +1 -0
- package/lib/esm/widgets/button-row.js +1 -0
- package/lib/esm/widgets/button-row.native.js +1 -0
- package/lib/esm/widgets/clamp.native.js +1 -1
- package/lib/esm/widgets/combo-row.gtk.js +1 -0
- package/lib/esm/widgets/combo-row.js +1 -0
- package/lib/esm/widgets/combo-row.native.js +1 -0
- package/lib/esm/widgets/entry-row.gtk.js +1 -0
- package/lib/esm/widgets/entry-row.js +1 -0
- package/lib/esm/widgets/entry-row.native.js +1 -0
- package/lib/esm/widgets/expander-row.gtk.js +1 -0
- package/lib/esm/widgets/expander-row.js +1 -0
- package/lib/esm/widgets/expander-row.native.js +1 -0
- package/lib/esm/widgets/header-bar.gtk.js +1 -0
- package/lib/esm/widgets/header-bar.js +1 -0
- package/lib/esm/widgets/header-bar.native.js +1 -0
- package/lib/esm/widgets/navigation-page.gtk.js +1 -0
- package/lib/esm/widgets/navigation-page.js +1 -0
- package/lib/esm/widgets/navigation-page.native.js +1 -0
- package/lib/esm/widgets/navigation-split-view.gtk.js +1 -0
- package/lib/esm/widgets/navigation-split-view.js +1 -0
- package/lib/esm/widgets/navigation-split-view.native.js +1 -0
- package/lib/esm/widgets/navigation-view.gtk.js +1 -0
- package/lib/esm/widgets/navigation-view.js +1 -0
- package/lib/esm/widgets/navigation-view.native.js +1 -0
- package/lib/esm/widgets/overlay-split-view.gtk.js +1 -0
- package/lib/esm/widgets/overlay-split-view.js +1 -0
- package/lib/esm/widgets/overlay-split-view.native.js +1 -0
- package/lib/esm/widgets/password-entry-row.gtk.js +1 -0
- package/lib/esm/widgets/password-entry-row.js +1 -0
- package/lib/esm/widgets/password-entry-row.native.js +1 -0
- package/lib/esm/widgets/preferences-group.gtk.js +1 -0
- package/lib/esm/widgets/preferences-group.js +1 -0
- package/lib/esm/widgets/preferences-group.native.js +1 -0
- package/lib/esm/widgets/preferences-page.gtk.js +1 -0
- package/lib/esm/widgets/preferences-page.js +1 -0
- package/lib/esm/widgets/preferences-page.native.js +1 -0
- package/lib/esm/widgets/spin-row.gtk.js +1 -0
- package/lib/esm/widgets/spin-row.js +1 -0
- package/lib/esm/widgets/spin-row.native.js +1 -0
- package/lib/esm/widgets/spinner.gtk.js +1 -0
- package/lib/esm/widgets/spinner.js +1 -0
- package/lib/esm/widgets/spinner.native.js +1 -0
- package/lib/esm/widgets/status-page.gtk.js +1 -0
- package/lib/esm/widgets/status-page.js +1 -0
- package/lib/esm/widgets/status-page.native.js +1 -0
- package/lib/esm/widgets/switch-row.gtk.js +1 -0
- package/lib/esm/widgets/switch-row.js +1 -0
- package/lib/esm/widgets/switch-row.native.js +1 -0
- package/lib/esm/widgets/toast-overlay.gtk.js +1 -0
- package/lib/esm/widgets/toast-overlay.js +1 -0
- package/lib/esm/widgets/toast-overlay.native.js +1 -0
- package/lib/esm/widgets/toolbar-view.gtk.js +1 -0
- package/lib/esm/widgets/toolbar-view.js +1 -0
- package/lib/esm/widgets/toolbar-view.native.js +1 -0
- package/lib/esm/widgets/view-stack.gtk.js +1 -0
- package/lib/esm/widgets/view-stack.js +1 -0
- package/lib/esm/widgets/view-stack.native.js +1 -0
- package/lib/esm/widgets/view-switcher.gtk.js +1 -0
- package/lib/esm/widgets/view-switcher.js +1 -0
- package/lib/esm/widgets/view-switcher.native.js +1 -0
- package/lib/esm/widgets/window-title.gtk.js +1 -0
- package/lib/esm/widgets/window-title.js +1 -0
- package/lib/esm/widgets/window-title.native.js +1 -0
- package/lib/esm/widgets/wrap-box.gtk.js +1 -0
- package/lib/esm/widgets/wrap-box.js +1 -0
- package/lib/esm/widgets/wrap-box.native.js +1 -0
- package/lib/types/index.d.ts +85 -1
- package/lib/types/index.gtk.d.ts +85 -1
- package/lib/types/index.native.d.ts +85 -1
- package/lib/types/parity.spec.d.ts +131 -1
- package/lib/types/props.d.ts +858 -2
- package/lib/types/row-shell.native.d.ts +25 -0
- package/lib/types/testing/gtk.spec.d.ts +73 -0
- package/lib/types/testing/react-native.d.ts +56 -1
- package/lib/types/testing/react-native.spec.d.ts +24 -2
- package/lib/types/testing/render.spec.d.ts +49 -0
- package/lib/types/widgets/action-row.d.ts +14 -0
- package/lib/types/widgets/action-row.gtk.d.ts +5 -0
- package/lib/types/widgets/action-row.native.d.ts +5 -0
- package/lib/types/widgets/avatar.d.ts +13 -0
- package/lib/types/widgets/avatar.gtk.d.ts +5 -0
- package/lib/types/widgets/avatar.native.d.ts +5 -0
- package/lib/types/widgets/avatar.native.spec.d.ts +3 -0
- package/lib/types/widgets/banner.d.ts +13 -0
- package/lib/types/widgets/banner.gtk.d.ts +5 -0
- package/lib/types/widgets/banner.native.d.ts +5 -0
- package/lib/types/widgets/banner.native.spec.d.ts +3 -0
- package/lib/types/widgets/button-content.d.ts +14 -0
- package/lib/types/widgets/button-content.gtk.d.ts +5 -0
- package/lib/types/widgets/button-content.native.d.ts +5 -0
- package/lib/types/widgets/button-content.native.spec.d.ts +3 -0
- package/lib/types/widgets/button-row.d.ts +13 -0
- package/lib/types/widgets/button-row.gtk.d.ts +5 -0
- package/lib/types/widgets/button-row.native.d.ts +5 -0
- package/lib/types/widgets/combo-row.d.ts +13 -0
- package/lib/types/widgets/combo-row.gtk.d.ts +15 -0
- package/lib/types/widgets/combo-row.native.d.ts +5 -0
- package/lib/types/widgets/content.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/entry-row.d.ts +14 -0
- package/lib/types/widgets/entry-row.gtk.d.ts +5 -0
- package/lib/types/widgets/entry-row.native.d.ts +5 -0
- package/lib/types/widgets/expander-row.d.ts +19 -0
- package/lib/types/widgets/expander-row.gtk.d.ts +5 -0
- package/lib/types/widgets/expander-row.native.d.ts +5 -0
- package/lib/types/widgets/header-bar.d.ts +30 -0
- package/lib/types/widgets/header-bar.gtk.d.ts +5 -0
- package/lib/types/widgets/header-bar.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/header-bar.native.d.ts +5 -0
- package/lib/types/widgets/header-bar.native.spec.d.ts +3 -0
- package/lib/types/widgets/navigation-page.d.ts +12 -0
- package/lib/types/widgets/navigation-page.gtk.d.ts +5 -0
- package/lib/types/widgets/navigation-page.native.d.ts +5 -0
- package/lib/types/widgets/navigation-page.native.spec.d.ts +3 -0
- package/lib/types/widgets/navigation-split-view.d.ts +15 -0
- package/lib/types/widgets/navigation-split-view.gtk.d.ts +5 -0
- package/lib/types/widgets/navigation-split-view.native.d.ts +10 -0
- package/lib/types/widgets/navigation-split-view.native.spec.d.ts +3 -0
- package/lib/types/widgets/navigation-view.d.ts +16 -0
- package/lib/types/widgets/navigation-view.gtk.d.ts +5 -0
- package/lib/types/widgets/navigation-view.native.d.ts +5 -0
- package/lib/types/widgets/navigation-view.native.spec.d.ts +3 -0
- package/lib/types/widgets/navigation.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/overlay-split-view.d.ts +13 -0
- package/lib/types/widgets/overlay-split-view.gtk.d.ts +5 -0
- package/lib/types/widgets/overlay-split-view.native.d.ts +5 -0
- package/lib/types/widgets/overlay-split-view.native.spec.d.ts +3 -0
- package/lib/types/widgets/password-entry-row.d.ts +13 -0
- package/lib/types/widgets/password-entry-row.gtk.d.ts +5 -0
- package/lib/types/widgets/password-entry-row.native.d.ts +5 -0
- package/lib/types/widgets/preferences-group.d.ts +13 -0
- package/lib/types/widgets/preferences-group.gtk.d.ts +5 -0
- package/lib/types/widgets/preferences-group.native.d.ts +5 -0
- package/lib/types/widgets/preferences-page.d.ts +14 -0
- package/lib/types/widgets/preferences-page.gtk.d.ts +5 -0
- package/lib/types/widgets/preferences-page.native.d.ts +5 -0
- package/lib/types/widgets/preferences.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/preferences.native.spec.d.ts +3 -0
- package/lib/types/widgets/rows.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/rows.native.spec.d.ts +3 -0
- package/lib/types/widgets/spin-row.d.ts +13 -0
- package/lib/types/widgets/spin-row.gtk.d.ts +20 -0
- package/lib/types/widgets/spin-row.native.d.ts +5 -0
- package/lib/types/widgets/spinner.d.ts +17 -0
- package/lib/types/widgets/spinner.gtk.d.ts +5 -0
- package/lib/types/widgets/spinner.native.d.ts +5 -0
- package/lib/types/widgets/spinner.native.spec.d.ts +3 -0
- package/lib/types/widgets/status-page.d.ts +15 -0
- package/lib/types/widgets/status-page.gtk.d.ts +5 -0
- package/lib/types/widgets/status-page.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/status-page.native.d.ts +5 -0
- package/lib/types/widgets/status-page.native.spec.d.ts +3 -0
- package/lib/types/widgets/switch-row.d.ts +14 -0
- package/lib/types/widgets/switch-row.gtk.d.ts +5 -0
- package/lib/types/widgets/switch-row.native.d.ts +5 -0
- package/lib/types/widgets/toast-overlay.d.ts +18 -0
- package/lib/types/widgets/toast-overlay.gtk.d.ts +23 -0
- package/lib/types/widgets/toast-overlay.native.d.ts +5 -0
- package/lib/types/widgets/toast-overlay.native.spec.d.ts +3 -0
- package/lib/types/widgets/toolbar-view.d.ts +23 -0
- package/lib/types/widgets/toolbar-view.gtk.d.ts +5 -0
- package/lib/types/widgets/toolbar-view.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/toolbar-view.native.d.ts +5 -0
- package/lib/types/widgets/toolbar-view.native.spec.d.ts +3 -0
- package/lib/types/widgets/view-stack.d.ts +13 -0
- package/lib/types/widgets/view-stack.gtk.d.ts +52 -0
- package/lib/types/widgets/view-stack.native.d.ts +20 -0
- package/lib/types/widgets/view-stack.native.spec.d.ts +3 -0
- package/lib/types/widgets/view-switcher.d.ts +13 -0
- package/lib/types/widgets/view-switcher.gtk.d.ts +5 -0
- package/lib/types/widgets/view-switcher.native.d.ts +5 -0
- package/lib/types/widgets/view-switcher.native.spec.d.ts +3 -0
- package/lib/types/widgets/window-title.d.ts +14 -0
- package/lib/types/widgets/window-title.gtk.d.ts +5 -0
- package/lib/types/widgets/window-title.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/window-title.native.d.ts +5 -0
- package/lib/types/widgets/window-title.native.spec.d.ts +3 -0
- package/lib/types/widgets/wrap-box.d.ts +22 -0
- package/lib/types/widgets/wrap-box.gtk.d.ts +5 -0
- package/lib/types/widgets/wrap-box.gtk.spec.d.ts +3 -0
- package/lib/types/widgets/wrap-box.native.d.ts +5 -0
- package/lib/types/widgets/wrap-box.native.spec.d.ts +3 -0
- package/package.json +139 -9
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import { type ViewStyle } from 'react-native';
|
|
4
|
+
import { type AdwRowLabelInput } from '@gjsify/adwaita-core';
|
|
5
|
+
/** A boxed-list row: the label column, then whatever trails it. */
|
|
6
|
+
export declare const ADW_ROW_STYLE: ViewStyle;
|
|
7
|
+
/** The title/subtitle column — it takes the width the trailing control does not. */
|
|
8
|
+
export declare const ADW_ROW_TEXT_COLUMN_STYLE: ViewStyle;
|
|
9
|
+
/**
|
|
10
|
+
* A part that is present and not drawn.
|
|
11
|
+
*
|
|
12
|
+
* `string_is_not_empty` said `false` for a label, or the apply latch is down for a
|
|
13
|
+
* button: the node stays in the tree and stops drawing, which is what the sibling
|
|
14
|
+
* renderers do and what lets a suite say WHICH part is hidden.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ADW_ROW_HIDDEN_STYLE: ViewStyle;
|
|
17
|
+
/**
|
|
18
|
+
* The two labels of a boxed-list row, with libadwaita's own visibility rule.
|
|
19
|
+
*
|
|
20
|
+
* The rule is `@gjsify/adwaita-core`'s `deriveRowLabels`, not a local `title !== ''`:
|
|
21
|
+
* it is the closure `adw-action-row.ui` binds to BOTH labels — the title's too, which is
|
|
22
|
+
* the half a hand-written port drops — and it is the same call `@gjsify/adwaita-web`'s
|
|
23
|
+
* `<adw-switch-row>` and `@gjsify/adwaita-nativescript`'s `rowLabelVisuals` make.
|
|
24
|
+
*/
|
|
25
|
+
export declare function AdwRowLabels({ title, subtitle }: AdwRowLabelInput): ReactElement;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import Gdk from 'gi://Gdk?version=4.0';
|
|
3
|
+
import Gtk from 'gi://Gtk?version=4.0';
|
|
4
|
+
import { type Runtime } from '@gjsify/unit';
|
|
5
|
+
import { type CaptureWidget } from '@gjsify/gtk-host';
|
|
6
|
+
/** Named identities, not a capability probe: a suite that ran zero tests reports success. */
|
|
7
|
+
export declare const GTK_HOSTS: Runtime[];
|
|
8
|
+
/** The frame every suite that does not care about width is laid out in. */
|
|
9
|
+
export declare const FRAME_WIDTH = 1000;
|
|
10
|
+
/** …and its height. */
|
|
11
|
+
export declare const FRAME_HEIGHT = 200;
|
|
12
|
+
/**
|
|
13
|
+
* The three calls `@gjsify/devtools`' `captureWidgetPng` makes, inlined.
|
|
14
|
+
*
|
|
15
|
+
* `null` means "no renderer or no size yet" and is what `blankReason` reads as "measured
|
|
16
|
+
* before it was ever on screen" — never "the image is empty".
|
|
17
|
+
*/
|
|
18
|
+
export declare const capture: CaptureWidget;
|
|
19
|
+
/** The GType name a widget actually has, for an assertion that names the class. */
|
|
20
|
+
export declare const typeOf: (widget: Gtk.Widget) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Mount into a REALISED, sized window and let GTK lay out, then run the body.
|
|
23
|
+
*
|
|
24
|
+
* A `Gtk.Box` that is not in a window is never allocated, so every size read off it is 0.
|
|
25
|
+
* The window is `present()`ed and the main context pumped until the container has a
|
|
26
|
+
* width; without the pump the first `get_width()` is 0 and the assertion would be
|
|
27
|
+
* measuring the scheduler.
|
|
28
|
+
*
|
|
29
|
+
* `title` is on the window because `Adw.HeaderBar` RESOLVES its derived title from the
|
|
30
|
+
* root window (`update_title`, adw-header-bar.c:475) — the one thing a header-bar suite
|
|
31
|
+
* cannot set up any other way.
|
|
32
|
+
*
|
|
33
|
+
* `rerender` is the THIRD argument because an update is a different claim from a mount,
|
|
34
|
+
* and the same root has to serve both: a second `createRoot` over the same container
|
|
35
|
+
* builds a second tree beside the first, so the suite would read a widget nothing
|
|
36
|
+
* updated. It pumps too — an assertion straight after a render measures the scheduler.
|
|
37
|
+
*/
|
|
38
|
+
export declare function laidOut(element: React.ReactNode, body: (container: Gtk.Widget, window: Gtk.Window, rerender: (next: React.ReactNode) => void) => void, options?: {
|
|
39
|
+
frameWidth?: number;
|
|
40
|
+
frameHeight?: number;
|
|
41
|
+
title?: string;
|
|
42
|
+
}): void;
|
|
43
|
+
/** First strict descendant of a GType, breadth-first over the REAL tree. */
|
|
44
|
+
export declare function find(root: Gtk.Widget, gtype: string): Gtk.Widget;
|
|
45
|
+
/**
|
|
46
|
+
* Is `child` inside a node carrying `cssClass`, up to `root`?
|
|
47
|
+
*
|
|
48
|
+
* THE ONLY WAY TO ASSERT A SLOT, for the slots whose adder is write-only. `add_top_bar`
|
|
49
|
+
* has no getter and `Adw.HeaderBar`'s two ends have none either, so a presence-based
|
|
50
|
+
* assertion passes with the child authored into the WRONG slot — measured in gtk-host's
|
|
51
|
+
* own conformance vectors, where every such assertion passed with a top bar authored
|
|
52
|
+
* into `bottom`. What separates them is the style class libadwaita puts on the internal
|
|
53
|
+
* box it packs into: `top-bar`/`bottom-bar` on the toolbar view (`_toolbars.scss`),
|
|
54
|
+
* `start`/`end` on the header bar's two `GtkBox`es (measured on libadwaita 1.9.3).
|
|
55
|
+
*/
|
|
56
|
+
export declare function insideClass(child: Gtk.Widget, root: Gtk.Widget, cssClass: string): boolean;
|
|
57
|
+
/** What {@link withGtk} hands a suite. */
|
|
58
|
+
export interface GtkHarness {
|
|
59
|
+
/** `describe`, with the diagnostics gate reset before and asserted after every test. */
|
|
60
|
+
gated: (name: string, run: () => Promise<void>) => Promise<void>;
|
|
61
|
+
/** The default display, or `null` where there is none — a photograph needs one. */
|
|
62
|
+
display: Gdk.Display | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Initialise GTK once, register the widget table, install the diagnostics gate, and run
|
|
66
|
+
* the suite inside it.
|
|
67
|
+
*
|
|
68
|
+
* `installDiagnosticsGate` is not optional decoration. Writing `css-classes` clobbers an
|
|
69
|
+
* orientation class, a generic `insert_before` on a `Gtk.ListBox` emitted 1 230 783
|
|
70
|
+
* `Gtk-WARNING` lines, and both are exit 0 — so every test in this package asserts zero
|
|
71
|
+
* GTK diagnostics as well as its own numbers.
|
|
72
|
+
*/
|
|
73
|
+
export declare function withGtk(suite: (harness: GtkHarness) => Promise<void>): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { View as RealView } from 'react-native';
|
|
1
|
+
import type { Pressable as RealPressable, Switch as RealSwitch, Text as RealText, TextInput as RealTextInput, View as RealView } from 'react-native';
|
|
2
2
|
/**
|
|
3
3
|
* The host element name `View` renders as.
|
|
4
4
|
*
|
|
@@ -7,6 +7,32 @@ import type { View as RealView } from 'react-native';
|
|
|
7
7
|
* reads the same as one written against the real thing.
|
|
8
8
|
*/
|
|
9
9
|
export declare const RCT_VIEW = "RCTView";
|
|
10
|
+
/**
|
|
11
|
+
* The host element name `Text` renders as.
|
|
12
|
+
*
|
|
13
|
+
* `RCTText` is React Native's own — `TextNativeComponent.js:57` registers the top-level
|
|
14
|
+
* text view under `uiViewClassName: 'RCTText'`, with `RCTVirtualText` for a NESTED one.
|
|
15
|
+
* This double never nests, so the outer name is the whole of what a tree assertion here
|
|
16
|
+
* can see; a widget that starts nesting text needs the second name and a reason.
|
|
17
|
+
*/
|
|
18
|
+
export declare const RCT_TEXT = "RCTText";
|
|
19
|
+
/**
|
|
20
|
+
* `Switch`'s host element.
|
|
21
|
+
*
|
|
22
|
+
* PLATFORM-SPLIT UPSTREAM: `SwitchNativeComponent` declares `paperComponentName:
|
|
23
|
+
* 'RCTSwitch'` and `AndroidSwitchNativeComponent` declares `'AndroidSwitch'`, so there is
|
|
24
|
+
* no single true answer and this is the iOS one. Nothing in this package depends on which
|
|
25
|
+
* — the suites read this constant.
|
|
26
|
+
*/
|
|
27
|
+
export declare const RCT_SWITCH = "RCTSwitch";
|
|
28
|
+
/**
|
|
29
|
+
* `TextInput`'s host element, single-line.
|
|
30
|
+
*
|
|
31
|
+
* PLATFORM-SPLIT the same way: `RCTSingelineTextInputNativeComponent` declares
|
|
32
|
+
* `uiViewClassName: 'RCTSinglelineTextInputView'` and `AndroidTextInputNativeComponent`
|
|
33
|
+
* declares `'AndroidTextInput'`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const RCT_TEXT_INPUT = "RCTSinglelineTextInputView";
|
|
10
36
|
/**
|
|
11
37
|
* `react-native`'s `View`, as a host component.
|
|
12
38
|
*
|
|
@@ -16,3 +42,32 @@ export declare const RCT_VIEW = "RCTView";
|
|
|
16
42
|
* against React's intrinsic elements and knows nothing about React Native's.
|
|
17
43
|
*/
|
|
18
44
|
export declare const View: typeof RealView;
|
|
45
|
+
/**
|
|
46
|
+
* `react-native`'s `Text`, as a host component.
|
|
47
|
+
*
|
|
48
|
+
* Same contract as {@link View} and for the same reason: the `typeof RealText`
|
|
49
|
+
* annotation is what stops the double from growing a surface of its own, and
|
|
50
|
+
* `react-native.spec.ts` falsifies it rather than restating it.
|
|
51
|
+
*
|
|
52
|
+
* The real `Text` additionally wires `onPress` through the press responder and reads an
|
|
53
|
+
* inherited text context, neither of which is reproduced — so a spec here asserts that a
|
|
54
|
+
* widget ASKS for a press, never that a tap arrives. Same class of gap as Yoga, and the
|
|
55
|
+
* README carries it too.
|
|
56
|
+
*/
|
|
57
|
+
export declare const Text: typeof RealText;
|
|
58
|
+
/**
|
|
59
|
+
* `react-native`'s `Pressable`, as a host component rendering a view.
|
|
60
|
+
*
|
|
61
|
+
* REAL `Pressable` DOES RENDER A `View` — it is a wrapper that turns press props into
|
|
62
|
+
* responder handlers — but it does NOT forward `onPress` to the host node, and this
|
|
63
|
+
* double does. That is why every assertion about press behaviour in this package reads
|
|
64
|
+
* the props off the COMPOSITE (`renderer.root.findByType(Pressable)`) and only the
|
|
65
|
+
* nesting off `toJSON()`: what a widget hands to `Pressable` is a fact about the widget,
|
|
66
|
+
* and what `Pressable` then does with it is React Native's business and is not measured
|
|
67
|
+
* here.
|
|
68
|
+
*/
|
|
69
|
+
export declare const Pressable: typeof RealPressable;
|
|
70
|
+
/** `react-native`'s `Switch`, as a host component. Same contract as {@link View}. */
|
|
71
|
+
export declare const Switch: typeof RealSwitch;
|
|
72
|
+
/** `react-native`'s `TextInput`, as a host component. Same contract as {@link View}. */
|
|
73
|
+
export declare const TextInput: typeof RealTextInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { View as RealView } from 'react-native';
|
|
1
|
+
import type { Pressable as RealPressable, Switch as RealSwitch, Text as RealText, TextInput as RealTextInput, View as RealView } from 'react-native';
|
|
2
2
|
import type { Assert, SameKeys } from '../parity.spec.js';
|
|
3
|
-
import { View } from './react-native.js';
|
|
3
|
+
import { Pressable, Switch, Text, TextInput, View } from './react-native.js';
|
|
4
4
|
/**
|
|
5
5
|
* The double accepts EXACTLY React Native's `View` props — same names, no more, no
|
|
6
6
|
* fewer.
|
|
@@ -29,5 +29,27 @@ import { View } from './react-native.js';
|
|
|
29
29
|
* reason one level up: the package's own props are all-optional too.
|
|
30
30
|
*/
|
|
31
31
|
export type DoublePropsMatchReactNative = Assert<SameKeys<Parameters<typeof View>[0], Parameters<typeof RealView>[0]>>;
|
|
32
|
+
/**
|
|
33
|
+
* The same contract for `Text`, which most of this package's widgets render.
|
|
34
|
+
*
|
|
35
|
+
* A SECOND PRIMITIVE IS A SECOND CHANCE TO INVENT ONE. `View` was pinned from the day it
|
|
36
|
+
* existed and `Text` arrived later, with widgets already leaning on it — which is exactly
|
|
37
|
+
* the order in which a double acquires a prop React Native does not have. And it is not
|
|
38
|
+
* redundant with the assertion above: `ViewProps` and `TextProps` are different key sets
|
|
39
|
+
* — `numberOfLines`, `ellipsizeMode` and `onPress` are on one and not the other — so a
|
|
40
|
+
* `Text` double annotated `typeof RealView` by a copy-paste would satisfy every assertion
|
|
41
|
+
* about `View` and none about the component the widgets actually use.
|
|
42
|
+
*/
|
|
43
|
+
export type TextPropsMatchReactNative = Assert<SameKeys<Parameters<typeof Text>[0], Parameters<typeof RealText>[0]>>;
|
|
44
|
+
/**
|
|
45
|
+
* The same instrument for the three primitives the boxed-list rows added.
|
|
46
|
+
*
|
|
47
|
+
* One alias per primitive rather than a mapped type over them: `SameKeys` is a
|
|
48
|
+
* CONSTRAINT violation when it fails, and the diagnostic then names the alias — which
|
|
49
|
+
* names the primitive. A mapped type would report one error naming the map.
|
|
50
|
+
*/
|
|
51
|
+
export type PressablePropsMatchReactNative = Assert<SameKeys<Parameters<typeof Pressable>[0], Parameters<typeof RealPressable>[0]>>;
|
|
52
|
+
export type SwitchPropsMatchReactNative = Assert<SameKeys<Parameters<typeof Switch>[0], Parameters<typeof RealSwitch>[0]>>;
|
|
53
|
+
export type TextInputPropsMatchReactNative = Assert<SameKeys<Parameters<typeof TextInput>[0], Parameters<typeof RealTextInput>[0]>>;
|
|
32
54
|
declare const _default: () => Promise<void>;
|
|
33
55
|
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactTestRenderer, type ReactTestRendererJSON } from 'react-test-renderer';
|
|
2
|
+
/** A host node's style, as the widget asked for it. */
|
|
3
|
+
export type Style = Record<string, unknown> | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Mount and keep the RENDERER, for a suite that has to drive a state transition.
|
|
6
|
+
*
|
|
7
|
+
* ONE renderer, read twice. Creating a second one for the post-transition read hands back
|
|
8
|
+
* a pre-transition snapshot — the state lives in the first — and the suite then asserts
|
|
9
|
+
* the untouched tree while claiming to assert the settled one.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mount(element: React.ReactElement): ReactTestRenderer;
|
|
12
|
+
/** Mount and read the tree. */
|
|
13
|
+
export declare const mounted: (element: React.ReactElement) => ReactTestRendererJSON;
|
|
14
|
+
/**
|
|
15
|
+
* Deliver ONE `onLayout` at `width` to the tree a MOUNTED renderer is showing, and read
|
|
16
|
+
* back what it settled on.
|
|
17
|
+
*
|
|
18
|
+
* Every size-aware widget in this package binds to the size of the VIEW rather than of
|
|
19
|
+
* the window, so its root node carries the `onLayout` and nothing downstream knows a size
|
|
20
|
+
* until one arrives. The missing-handler case is a THROW and not a skip: a widget that
|
|
21
|
+
* stopped emitting `onLayout` would otherwise leave every assertion below it reading the
|
|
22
|
+
* pre-layout tree and passing.
|
|
23
|
+
*
|
|
24
|
+
* Separate from {@link settled} because an UPDATE needs the same delivery on a renderer
|
|
25
|
+
* that is already mounted — a widget re-reads no size on its own, so a tree read straight
|
|
26
|
+
* after `renderer.update` is still the pre-layout one.
|
|
27
|
+
*/
|
|
28
|
+
export declare function deliverLayout(renderer: ReactTestRenderer, width: number, height?: number): ReactTestRendererJSON;
|
|
29
|
+
/**
|
|
30
|
+
* Mount, deliver ONE `onLayout` at `width`, and read the tree the widget settled on.
|
|
31
|
+
*
|
|
32
|
+
* ONE renderer, read twice — the reason is on {@link mount}.
|
|
33
|
+
*/
|
|
34
|
+
export declare const settled: (element: React.ReactElement, width: number, height?: number) => ReactTestRendererJSON;
|
|
35
|
+
/** A node's element children, with text children refused rather than silently skipped. */
|
|
36
|
+
export declare function childrenOf(node: ReactTestRendererJSON): ReactTestRendererJSON[];
|
|
37
|
+
/**
|
|
38
|
+
* The child at `index`, or a failure naming the count.
|
|
39
|
+
*
|
|
40
|
+
* An index into a `ReactTestRendererJSON[]` is `| undefined`, and the two ways out of
|
|
41
|
+
* that in an assertion are both worse than a throw: `?.` turns a missing node into a
|
|
42
|
+
* comparison against `undefined` that some matcher will accept, and a cast asserts the
|
|
43
|
+
* thing the test was supposed to check.
|
|
44
|
+
*/
|
|
45
|
+
export declare function at(nodes: ReactTestRendererJSON[], index: number): ReactTestRendererJSON;
|
|
46
|
+
/** The one element child, or a failure naming what was there instead. */
|
|
47
|
+
export declare function onlyChild(node: ReactTestRendererJSON): ReactTestRendererJSON;
|
|
48
|
+
/** The text a `Text` node holds, joined — `toJSON` reports it as a child array. */
|
|
49
|
+
export declare function textOf(node: ReactTestRendererJSON): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwActionRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boxed-list row with a title, a subtitle and a trailing slot.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THEIR LABEL RULE AND NOTHING ELSE. libadwaita binds
|
|
7
|
+
* `string_is_not_empty` onto both labels, so an empty title hides its label rather than
|
|
8
|
+
* leaving a blank line; on GTK the real `Adw.ActionRow` applies that binding in C, and on
|
|
9
|
+
* React Native `@gjsify/adwaita-core`'s `deriveRowLabels` — the same call
|
|
10
|
+
* `@gjsify/adwaita-web` and `@gjsify/adwaita-nativescript` make — applies it in
|
|
11
|
+
* TypeScript. Both suites assert the same four outputs of it rather than each side's own
|
|
12
|
+
* idea of "the subtitle is empty".
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdwActionRow(_props: AdwActionRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwActionRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./action-row.js').AdwActionRow} on GTK. */
|
|
5
|
+
export declare function AdwActionRow({ title, subtitle, activatable, onActivated, children, }: AdwActionRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwActionRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./action-row.js').AdwActionRow} on React Native. */
|
|
5
|
+
export declare function AdwActionRow({ title, subtitle, activatable, onActivated, children, }: AdwActionRowProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwAvatarProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A round avatar showing initials derived from a name, or a fallback icon.
|
|
5
|
+
*
|
|
6
|
+
* BOTH HALVES DERIVE THE SAME TWO THINGS FROM THE SAME PORT. The initials and the
|
|
7
|
+
* palette entry come from `@gjsify/adwaita-core`'s `avatarInitials` / `avatarColor` —
|
|
8
|
+
* `extract_initials_from_text` and `set_class_color` in TypeScript, hashing UTF-8 bytes
|
|
9
|
+
* as `g_str_hash` does. On GTK the real `Adw.Avatar` runs the C original and stamps
|
|
10
|
+
* `color11` on its internal gizmo; the React Native half paints the same palette entry.
|
|
11
|
+
* The suites assert that pair by NAME, not by "an avatar appeared".
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwAvatar(_props: AdwAvatarProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwAvatarProps } from '../props.js';
|
|
4
|
+
/** {@link import('./avatar.js').AdwAvatar} on GTK. */
|
|
5
|
+
export declare function AdwAvatar({ size, text, showInitials, iconName }: AdwAvatarProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwAvatarProps } from '../props.js';
|
|
4
|
+
/** {@link import('./avatar.js').AdwAvatar} on React Native. */
|
|
5
|
+
export declare function AdwAvatar({ size, text, showInitials }: AdwAvatarProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwBannerProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A full-width strip carrying one in-context message and an optional action button.
|
|
5
|
+
*
|
|
6
|
+
* `Adw.Banner` HAS NO ARITHMETIC — its whole specification is five property defaults
|
|
7
|
+
* and three derivations, all of them in `@gjsify/adwaita-core`. The two that are easy to
|
|
8
|
+
* get backwards are the button's visibility (`label && label[0]`, a FIRST-CHARACTER test,
|
|
9
|
+
* so a label of spaces still draws a button) and its mnemonic marker (the template pins
|
|
10
|
+
* the button to `use-underline=True` with no property to turn it off, and pins the TITLE
|
|
11
|
+
* to False, so exactly one of the two strings is stripped).
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwBanner(_props: AdwBannerProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwBannerProps } from '../props.js';
|
|
4
|
+
/** {@link import('./banner.js').AdwBanner} on GTK. */
|
|
5
|
+
export declare function AdwBanner({ title, buttonLabel, revealed, useMarkup, buttonStyle, onButtonClicked, }: AdwBannerProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwBannerProps } from '../props.js';
|
|
4
|
+
/** {@link import('./banner.js').AdwBanner} on React Native. */
|
|
5
|
+
export declare function AdwBanner({ title, buttonLabel, revealed, useMarkup, buttonStyle, onButtonClicked, }: AdwBannerProps): ReactElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwButtonContentProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* An icon paired with a label, for the inside of a button.
|
|
5
|
+
*
|
|
6
|
+
* THE DERIVATIONS ARE THE WIDGET. There is no layout arithmetic here — there are four
|
|
7
|
+
* questions (`buttonContentIconName`, `buttonContentIconExpands`,
|
|
8
|
+
* `buttonContentLabelVisible`, `buttonContentEllipsize`) and both halves ask
|
|
9
|
+
* `@gjsify/adwaita-core` all four. Two of them are places a renderer guesses wrong:
|
|
10
|
+
* an empty `icon-name` DRAWS `image-missing` rather than hiding the icon (libadwaita's
|
|
11
|
+
* own doc comments say otherwise and its code disagrees with them), and the icon takes
|
|
12
|
+
* the free space exactly when there is no label.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdwButtonContent(_props: AdwButtonContentProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwButtonContentProps } from '../props.js';
|
|
4
|
+
/** {@link import('./button-content.js').AdwButtonContent} on GTK. */
|
|
5
|
+
export declare function AdwButtonContent({ iconName, label, useUnderline, canShrink, }: AdwButtonContentProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwButtonContentProps } from '../props.js';
|
|
4
|
+
/** {@link import('./button-content.js').AdwButtonContent} on React Native. */
|
|
5
|
+
export declare function AdwButtonContent({ label, useUnderline, canShrink }: AdwButtonContentProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwButtonRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boxed-list row that behaves like a button.
|
|
5
|
+
*
|
|
6
|
+
* ALWAYS ACTIVATABLE, and that is a fact both halves read out of
|
|
7
|
+
* `@gjsify/adwaita-core`'s `BUTTON_ROW_ACTIVATABLE` rather than each writing `true`:
|
|
8
|
+
* the upstream template hardcodes `activatable=True`, the class documentation says
|
|
9
|
+
* "AdwButtonRow is always activatable", and the sibling `<AdwActionRow>` reads
|
|
10
|
+
* `activatable` as an ordinary prop — so one surface carrying two opposite meanings for
|
|
11
|
+
* the same word is exactly what the shared constant prevents.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwButtonRow(_props: AdwButtonRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwButtonRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./button-row.js').AdwButtonRow} on GTK. */
|
|
5
|
+
export declare function AdwButtonRow({ title, onActivated }: AdwButtonRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwButtonRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./button-row.js').AdwButtonRow} on React Native. */
|
|
5
|
+
export declare function AdwButtonRow({ title, onActivated }: AdwButtonRowProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwComboRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A row that picks one item out of a list.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THE SELECTION MODEL AND NOTHING ELSE. On GTK the real
|
|
7
|
+
* `Adw.ComboRow` drives a `GtkSingleSelection` over a `Gtk.StringList`; on React Native
|
|
8
|
+
* `@gjsify/adwaita-core`'s `ComboState` — the same index↔value mapping, the same autoselect
|
|
9
|
+
* on a replaced model, the same `n_items > 1` chooser rule — runs in TypeScript. Both sides
|
|
10
|
+
* are asked the same questions with the same options: how many items, which one is
|
|
11
|
+
* selected, and whether the row presents itself as a chooser at all.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwComboRow(_props: AdwComboRowProps): ReactElement | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwComboRowProps } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* `GTK_INVALID_LIST_POSITION` — `G_MAXUINT`, which GIR gives no constant for.
|
|
6
|
+
*
|
|
7
|
+
* Exported so the spec can assert the translation against the number libadwaita actually
|
|
8
|
+
* stores rather than against itself; `parity.spec.ts` allows a platform-only export beside
|
|
9
|
+
* the widget for exactly this.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GTK_INVALID_LIST_POSITION = 4294967295;
|
|
12
|
+
/** `AdwComboRow:selected` as `@gjsify/adwaita-core` spells it. */
|
|
13
|
+
export declare const comboSelectedIndex: (selected: number) => number;
|
|
14
|
+
/** {@link import('./combo-row.js').AdwComboRow} on GTK. */
|
|
15
|
+
export declare function AdwComboRow({ title, subtitle, model, selected, useSubtitle, onNotifySelected, }: AdwComboRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwComboRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./combo-row.js').AdwComboRow} on React Native. */
|
|
5
|
+
export declare function AdwComboRow({ title, subtitle, model, selected, useSubtitle, onNotifySelected, }: AdwComboRowProps): ReactElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwEntryRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boxed-list row that is itself a text entry.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE A TRUTH TABLE. `Adw.EntryRow` looks like layout and is
|
|
7
|
+
* almost none: `update_empty` is a five-output derivation over four inputs (text length ·
|
|
8
|
+
* editing · editable · the `text_changed` apply latch), and Enter dispatches to exactly
|
|
9
|
+
* one of two signals depending on that latch. On GTK the real widget computes it in C; on
|
|
10
|
+
* React Native `@gjsify/adwaita-core`'s `EntryRowState` — the same state machine
|
|
11
|
+
* `@gjsify/adwaita-web` and `@gjsify/adwaita-nativescript` compose — computes it in
|
|
12
|
+
* TypeScript. So the suites assert the same rows of the same table on both sides.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdwEntryRow(_props: AdwEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwEntryRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./entry-row.js').AdwEntryRow} on GTK. */
|
|
5
|
+
export declare function AdwEntryRow({ title, text, maxLength, editable, showApplyButton, onNotifyText, onApply, onEntryActivated, }: AdwEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwEntryRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./entry-row.js').AdwEntryRow} on React Native. */
|
|
5
|
+
export declare function AdwEntryRow({ title, text, maxLength, editable, showApplyButton, onNotifyText, onApply, onEntryActivated, }: AdwEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwExpanderRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boxed-list row that discloses further rows beneath itself.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE ONE DISCLOSURE MACHINE. `expanded` is idempotent — a set
|
|
7
|
+
* to the value already held changes nothing and notifies nobody — and that is GObject's
|
|
8
|
+
* own property gate on GTK and `@gjsify/adwaita-core`'s `ExpanderState` on React Native,
|
|
9
|
+
* the same state machine `@gjsify/adwaita-web`'s `<adw-expander-row>` and
|
|
10
|
+
* `@gjsify/adwaita-nativescript`'s `AdwExpanderRow` compose. So both suites assert the
|
|
11
|
+
* same three transitions rather than each side's own idea of "toggled".
|
|
12
|
+
*
|
|
13
|
+
* AND BOTH KEEP THE COLLAPSED CHILDREN IN THE TREE. GTK puts them under a
|
|
14
|
+
* `Gtk.Revealer`, which leaves them parented and UNMAPPED; the React Native half gives
|
|
15
|
+
* the disclosure `display: 'none'`, which is what the sibling renderers do. Unmounting
|
|
16
|
+
* them instead would look identical on screen and lose every child's state on a
|
|
17
|
+
* collapse.
|
|
18
|
+
*/
|
|
19
|
+
export declare function AdwExpanderRow(_props: AdwExpanderRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwExpanderRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./expander-row.js').AdwExpanderRow} on GTK. */
|
|
5
|
+
export declare function AdwExpanderRow({ title, subtitle, expanded, onNotifyExpanded, children, }: AdwExpanderRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwExpanderRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./expander-row.js').AdwExpanderRow} on React Native. */
|
|
5
|
+
export declare function AdwExpanderRow({ title, subtitle, expanded, onNotifyExpanded, children, }: AdwExpanderRowProps): ReactElement | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwHeaderBarProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* The start / centre / end bar at the top of a window.
|
|
5
|
+
*
|
|
6
|
+
* THE PHONE QUESTION IS THE CENTRE, and this package answers it the way
|
|
7
|
+
* `@gjsify/adwaita-nativescript` already did rather than inventing a third answer:
|
|
8
|
+
* `Adw.HeaderBar` has NO `title` property — its derived centre is a plain
|
|
9
|
+
* `gtk_label_new (NULL)` over a title RESOLVED from the navigation page, the dialog, the
|
|
10
|
+
* window and then the application name (`update_title`, adw-header-bar.c:475) — and both
|
|
11
|
+
* existing renderers instead expose `title`/`subtitle` on the bar and put an
|
|
12
|
+
* `AdwWindowTitle` in the centre. That is a DIVERGENCE, recorded as
|
|
13
|
+
* `HeaderBarRenderState.derivedSubtitle` in `@gjsify/adwaita-core`, and it is kept here
|
|
14
|
+
* because a declarative surface has no widget handoff to offer instead.
|
|
15
|
+
*
|
|
16
|
+
* WHAT THE TWO HALVES DO NOT SHARE is what happens when nothing is authored. On GTK the
|
|
17
|
+
* chain is REAL and free: authoring neither `title` nor `subtitle` installs no title
|
|
18
|
+
* widget at all, so libadwaita resolves the window's own title into its own label, which
|
|
19
|
+
* `header-bar.gtk.spec.tsx` reads back. React Native has no such ancestry to resolve
|
|
20
|
+
* from, so an unauthored title there is blank. Named in the README.
|
|
21
|
+
*
|
|
22
|
+
* `HeaderBarState` IS DELIBERATELY NOT USED. It is an imperative model over an
|
|
23
|
+
* identity-keyed child list — `packStart`, `packEnd`, `remove` — and a props object is
|
|
24
|
+
* already the whole state, recomputed on every render. Of the three rules it holds, two
|
|
25
|
+
* do not arise on this surface: `pack_end`'s prepend is invisible where the slot is
|
|
26
|
+
* written in draw order, and the "taking the centre back rebuilds the derived title"
|
|
27
|
+
* transition is just the next render. The third — the title-widget either/or — is one
|
|
28
|
+
* expression, and both halves below write the same one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function AdwHeaderBar(_props: AdwHeaderBarProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwHeaderBarProps } from '../props.js';
|
|
4
|
+
/** {@link import('./header-bar.js').AdwHeaderBar} on GTK. */
|
|
5
|
+
export declare function AdwHeaderBar({ titleWidget, title, subtitle, start, end }: AdwHeaderBarProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwHeaderBarProps } from '../props.js';
|
|
4
|
+
/** {@link import('./header-bar.js').AdwHeaderBar} on React Native. */
|
|
5
|
+
export declare function AdwHeaderBar({ titleWidget, title, subtitle, start, end }: AdwHeaderBarProps): ReactElement | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwNavigationPageProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* One page of a navigation view, or one pane of a navigation split view.
|
|
5
|
+
*
|
|
6
|
+
* IT CARRIES THREE VALUES AND DRAWS NONE OF THEM. `title`, `tag` and `can-pop` are
|
|
7
|
+
* read by whatever holds the page — the view's stack machine on both halves — and the
|
|
8
|
+
* page itself is a container. That is libadwaita's own shape: `AdwNavigationPage` is an
|
|
9
|
+
* `AdwBin` with three properties, and the title appears on screen only because the
|
|
10
|
+
* view puts it in a header bar.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AdwNavigationPage(_props: AdwNavigationPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./navigation-page.js').AdwNavigationPage} on GTK. */
|
|
5
|
+
export declare function AdwNavigationPage({ children, title, tag, canPop }: AdwNavigationPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./navigation-page.js').AdwNavigationPage} on React Native. */
|
|
5
|
+
export declare function AdwNavigationPage({ children }: AdwNavigationPageProps): ReactElement | null;
|