@gjsify/adwaita-react-native 0.45.0 → 0.47.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 +417 -14
- 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,15 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwNavigationSplitViewProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A sidebar beside content, which becomes a navigation stack when collapsed.
|
|
5
|
+
*
|
|
6
|
+
* THE SHARED HALF IS TWO THINGS, and both are `@gjsify/adwaita-core`'s. The WIDTH is
|
|
7
|
+
* `resolveNavigationSidebarWidth`, a port of the C that caps the sidebar's MAX BOUND by
|
|
8
|
+
* `width - content_min` and then clamps with GLib's `CLAMP` — which tests the high
|
|
9
|
+
* bound first and therefore disagrees with `Math.min(max, Math.max(min, x))` exactly
|
|
10
|
+
* where the bounds invert. The ORDERING is `resolveNavigationStack`, the table that
|
|
11
|
+
* keeps a LONE child visible whatever `show-content` says and makes the CONTENT the
|
|
12
|
+
* root page under `sidebar-position: end`. libadwaita runs the originals on GTK; the
|
|
13
|
+
* React Native half runs the ports, and the suites assert the same numbers on both.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AdwNavigationSplitView(_props: AdwNavigationSplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationSplitViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./navigation-split-view.js').AdwNavigationSplitView} on GTK. */
|
|
5
|
+
export declare function AdwNavigationSplitView({ children, sidebar, sidebarTag, contentTag, sidebarTitle, contentTitle, collapsed, showContent, sidebarPosition, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, sidebarWidthUnit, }: AdwNavigationSplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationSplitViewProps } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* {@link import('./navigation-split-view.js').AdwNavigationSplitView} on React Native.
|
|
6
|
+
*
|
|
7
|
+
* BEFORE THE FIRST LAYOUT there is no available width, so both panes render unsized for
|
|
8
|
+
* exactly one frame — the same one-frame case `AdwClamp` has, and for the same reason.
|
|
9
|
+
*/
|
|
10
|
+
export declare function AdwNavigationSplitView({ children, sidebar, sidebarTag, contentTag, collapsed, showContent, sidebarPosition, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, sidebarWidthUnit, }: AdwNavigationSplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwNavigationViewProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A stack of pages, one visible at a time.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THE STACK MACHINE AND NOTHING ELSE, and unlike every
|
|
7
|
+
* widget above this one that machine is real state rather than arithmetic: a page
|
|
8
|
+
* registry, a tag index, the static-versus-dynamic `remove_on_pop` lifecycle, six
|
|
9
|
+
* mutators and the back-button derivation. On GTK it is libadwaita's own C; on React
|
|
10
|
+
* Native it is `@gjsify/adwaita-core`'s `NavigationViewState`, the same class
|
|
11
|
+
* `@gjsify/adwaita-web` and `@gjsify/adwaita-nativescript` already run — so the three
|
|
12
|
+
* renderers answer one question about a given page chain, and the suites assert the
|
|
13
|
+
* same tag and the same tooltip on both halves rather than each side's own idea of
|
|
14
|
+
* "the top of the stack".
|
|
15
|
+
*/
|
|
16
|
+
export declare function AdwNavigationView(_props: AdwNavigationViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./navigation-view.js').AdwNavigationView} on GTK. */
|
|
5
|
+
export declare function AdwNavigationView({ children, animateTransitions, popOnEscape, ref, }: AdwNavigationViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwNavigationViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./navigation-view.js').AdwNavigationView} on React Native. */
|
|
5
|
+
export declare function AdwNavigationView({ children, animateTransitions, popOnEscape, ref, }: AdwNavigationViewProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwOverlaySplitViewProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A sidebar beside content, which slides OVER it when collapsed.
|
|
5
|
+
*
|
|
6
|
+
* IT IS NOT `AdwNavigationSplitView` WITH A DIFFERENT PAINT, and the width is where
|
|
7
|
+
* that shows: `resolveOverlaySidebarWidth` caps the RESULT by `width - content_min`
|
|
8
|
+
* where the navigation widget caps the BOUND, and a COLLAPSED overlay ignores the
|
|
9
|
+
* fraction entirely and clamps the VIEW width instead — 280 on a 360-point phone where
|
|
10
|
+
* a quarter would be 180. Both rules are `@gjsify/adwaita-core`'s port of the C, run by
|
|
11
|
+
* the React Native half and by libadwaita itself on GTK.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwOverlaySplitView(_props: AdwOverlaySplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwOverlaySplitViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./overlay-split-view.js').AdwOverlaySplitView} on GTK. */
|
|
5
|
+
export declare function AdwOverlaySplitView({ children, sidebar, collapsed, showSidebar, pinSidebar, sidebarPosition, enableShowGesture, enableHideGesture, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, sidebarWidthUnit, onNotifyShowSidebar, }: AdwOverlaySplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwOverlaySplitViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./overlay-split-view.js').AdwOverlaySplitView} on React Native. */
|
|
5
|
+
export declare function AdwOverlaySplitView({ children, sidebar, collapsed, showSidebar, pinSidebar, sidebarPosition, enableShowGesture, enableHideGesture, minSidebarWidth, maxSidebarWidth, sidebarWidthFraction, sidebarWidthUnit, onNotifyShowSidebar, }: AdwOverlaySplitViewProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwPasswordEntryRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* An entry row whose contents are masked, with a button that peeks at them.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE `update_empty` AND THE PEEK PAIR. On GTK the real
|
|
7
|
+
* `Adw.PasswordEntryRow` runs both in C; on React Native `@gjsify/adwaita-core`'s
|
|
8
|
+
* `EntryRowState` and the `PasswordEntryRowState` that COMPOSES it — mirroring the C, which
|
|
9
|
+
* subclasses but reaches its parent through a private hook — run them in TypeScript. The
|
|
10
|
+
* mask is the assertion both suites share: masked on mount, clear after one press of the
|
|
11
|
+
* peek button, and the peek button's accessible name flipping with it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwPasswordEntryRow(_props: AdwPasswordEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwPasswordEntryRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./password-entry-row.js').AdwPasswordEntryRow} on GTK. */
|
|
5
|
+
export declare function AdwPasswordEntryRow({ title, text, maxLength, editable, showApplyButton, onNotifyText, onApply, onEntryActivated, }: AdwPasswordEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwPasswordEntryRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./password-entry-row.js').AdwPasswordEntryRow} on React Native. */
|
|
5
|
+
export declare function AdwPasswordEntryRow({ title, text, maxLength, editable, showApplyButton, onNotifyText, onApply, onEntryActivated, }: AdwPasswordEntryRowProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwPreferencesGroupProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A titled card of preference rows.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THEIR ARITHMETIC AND NOTHING ELSE. On GTK libadwaita runs
|
|
7
|
+
* `update_title_visibility`, `update_description_visibility`, `update_header_visibility`,
|
|
8
|
+
* `is_single_line` and `update_listbox_visibility` in C; on React Native
|
|
9
|
+
* `@gjsify/adwaita-core`'s `derivePreferencesGroupHeader` — one function that answers all
|
|
10
|
+
* five — runs them in TypeScript. Both suites assert the same five answers for the same
|
|
11
|
+
* inputs rather than each side's own idea of "the header is showing".
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwPreferencesGroup(_props: AdwPreferencesGroupProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwPreferencesGroupProps } from '../props.js';
|
|
4
|
+
/** {@link import('./preferences-group.js').AdwPreferencesGroup} on GTK. */
|
|
5
|
+
export declare function AdwPreferencesGroup({ children, title, description }: AdwPreferencesGroupProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwPreferencesGroupProps } from '../props.js';
|
|
4
|
+
/** {@link import('./preferences-group.js').AdwPreferencesGroup} on React Native. */
|
|
5
|
+
export declare function AdwPreferencesGroup({ children, title, description }: AdwPreferencesGroupProps): ReactElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwPreferencesPageProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A scrolling page of preference groups.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THE PAGE'S CONTRACT AND NOT ITS SCROLLER. On GTK the real
|
|
7
|
+
* `Adw.PreferencesPage` is an `AdwBin` around a `GtkScrolledWindow`; on React Native the
|
|
8
|
+
* page is a plain column, because `ScrollView` is a COMPOSITE that moves props into a
|
|
9
|
+
* content container and `testing/react-native.ts` may only double a host element with its
|
|
10
|
+
* props forwarded. The divergence is one-directional, named in the README, and does not
|
|
11
|
+
* touch what the page IS — four identity properties a view switcher reads and one
|
|
12
|
+
* description it draws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdwPreferencesPage(_props: AdwPreferencesPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwPreferencesPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./preferences-page.js').AdwPreferencesPage} on GTK. */
|
|
5
|
+
export declare function AdwPreferencesPage({ children, title, iconName, name, description, descriptionCentered, useUnderline, }: AdwPreferencesPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwPreferencesPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./preferences-page.js').AdwPreferencesPage} on React Native. */
|
|
5
|
+
export declare function AdwPreferencesPage({ children, title: _title, iconName: _iconName, name: _name, description, descriptionCentered, useUnderline: _useUnderline, }: AdwPreferencesPageProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwSpinRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A row holding a number with a stepper.
|
|
5
|
+
*
|
|
6
|
+
* THE TWO IMPLEMENTATIONS SHARE THE CLAMP AND NOTHING ELSE. On GTK a real `Gtk.Adjustment`
|
|
7
|
+
* bounds the value in C; on React Native `@gjsify/adwaita-core`'s `SpinState` — the same
|
|
8
|
+
* clamp on every mutation, the same re-clamp when a bound moves under a value — runs in
|
|
9
|
+
* TypeScript. Both suites assert the same number for the same authored range, including the
|
|
10
|
+
* two cases a naive port gets wrong: a value authored OUTSIDE the range, and a stepper press
|
|
11
|
+
* that would leave it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwSpinRow(_props: AdwSpinRowProps): ReactElement | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwSpinRowProps } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* `SpinState`'s own defaults, which are the ones the React Native half falls back to.
|
|
6
|
+
*
|
|
7
|
+
* Exported so the spec asserts the two halves against ONE table rather than each against its
|
|
8
|
+
* own literals. They are not libadwaita's: a bare `Gtk.Adjustment` is 0…0 with a step of 0,
|
|
9
|
+
* which is a spin row that cannot move. `@gjsify/adwaita-core` picked 0…100 step 1, both
|
|
10
|
+
* sibling renderers use it, and the GTK half adopts it here rather than shipping a widget
|
|
11
|
+
* whose omitted range means something else than it does on a phone.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ADW_SPIN_ROW_DEFAULTS: {
|
|
14
|
+
readonly lower: 0;
|
|
15
|
+
readonly upper: 100;
|
|
16
|
+
readonly stepIncrement: 1;
|
|
17
|
+
readonly value: 0;
|
|
18
|
+
};
|
|
19
|
+
/** {@link import('./spin-row.js').AdwSpinRow} on GTK. */
|
|
20
|
+
export declare function AdwSpinRow({ title, subtitle, value, lower, upper, stepIncrement, digits, onNotifyValue, }: AdwSpinRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwSpinRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./spin-row.js').AdwSpinRow} on React Native. */
|
|
5
|
+
export declare function AdwSpinRow({ title, subtitle, value, lower, upper, stepIncrement, digits, onNotifyValue, }: AdwSpinRowProps): ReactElement | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwSpinnerProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A busy indicator.
|
|
5
|
+
*
|
|
6
|
+
* THE SHARED NUMBERS ARE THE BOX AND THE RING, and they are deliberately two numbers:
|
|
7
|
+
* `adw_spinner_measure` reports `MIN_SIZE` as both the minimum and the natural size with
|
|
8
|
+
* no upper bound, while `adw_spinner_paintable_snapshot_with_weight` caps only the RADIUS
|
|
9
|
+
* and still centres on the box. `@gjsify/adwaita-core`'s `resolveSpinnerSize` and
|
|
10
|
+
* `spinnerGeometry` are that split, and both halves run them.
|
|
11
|
+
*
|
|
12
|
+
* What the React Native half cannot carry is the breathing ARC, and the divergence is
|
|
13
|
+
* named in the README rather than approximated with a rotating quarter-circle — which is
|
|
14
|
+
* a different animation with a different period, and the one thing the core's own header
|
|
15
|
+
* says not to copy.
|
|
16
|
+
*/
|
|
17
|
+
export declare function AdwSpinner(_props: AdwSpinnerProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwSpinnerProps } from '../props.js';
|
|
4
|
+
/** {@link import('./spinner.js').AdwSpinner} on GTK. */
|
|
5
|
+
export declare function AdwSpinner({ widthRequest, heightRequest }: AdwSpinnerProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwSpinnerProps } from '../props.js';
|
|
4
|
+
/** {@link import('./spinner.js').AdwSpinner} on React Native. */
|
|
5
|
+
export declare function AdwSpinner({ widthRequest, heightRequest }: AdwSpinnerProps): ReactElement | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwStatusPageProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A centred empty state: an icon, a title, a description and one child.
|
|
5
|
+
*
|
|
6
|
+
* THE PARTS ARE BUILT ONCE AND SHOWN OR HIDDEN, which is `adw-status-page.ui`'s own
|
|
7
|
+
* shape: every part binds its `visible` to a closure over the property that feeds it
|
|
8
|
+
* (:23-28, :41-46, :57-62), so a page with only a description opens without a blank line
|
|
9
|
+
* above it. The predicate is `string_is_not_empty` — the FIRST BYTE, never trimmed — and
|
|
10
|
+
* both halves take it from `@gjsify/adwaita-core` rather than writing `.length === 0`
|
|
11
|
+
* again, which is what both other renderers had done.
|
|
12
|
+
*
|
|
13
|
+
* `iconName` is the one prop that does not reach both halves; the reason is on the prop.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AdwStatusPage(_props: AdwStatusPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwStatusPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./status-page.js').AdwStatusPage} on GTK. */
|
|
5
|
+
export declare function AdwStatusPage({ children, iconName, title, description }: AdwStatusPageProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwStatusPageProps } from '../props.js';
|
|
4
|
+
/** {@link import('./status-page.js').AdwStatusPage} on React Native. */
|
|
5
|
+
export declare function AdwStatusPage({ children, title, description }: AdwStatusPageProps): ReactElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwSwitchRowProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boxed-list row whose trailing control is a switch.
|
|
5
|
+
*
|
|
6
|
+
* THE WHOLE ROW IS THE CONTROL, not just the handle. `adw_switch_row_init` makes the row
|
|
7
|
+
* activatable and points its activatable-widget at the slider, and the class
|
|
8
|
+
* documentation states the outcome directly: "the user can control the switch by
|
|
9
|
+
* activating the row or by dragging on the switch handle". Both halves therefore have two
|
|
10
|
+
* routes into one transition, and both run them through
|
|
11
|
+
* `@gjsify/adwaita-core`'s `SwitchRowState` — `activate()` for the row, `setActive()` for
|
|
12
|
+
* the slider — so the `g_object_notify` gate on the second is the same gate on the first.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdwSwitchRow(_props: AdwSwitchRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwSwitchRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./switch-row.js').AdwSwitchRow} on GTK. */
|
|
5
|
+
export declare function AdwSwitchRow({ title, subtitle, active, onNotifyActive }: AdwSwitchRowProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwSwitchRowProps } from '../props.js';
|
|
4
|
+
/** {@link import('./switch-row.js').AdwSwitchRow} on React Native. */
|
|
5
|
+
export declare function AdwSwitchRow({ title, subtitle, active, onNotifyActive }: AdwSwitchRowProps): ReactElement | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwToastOverlayProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps content and shows one transient toast at a time over it.
|
|
5
|
+
*
|
|
6
|
+
* THIS IS THE ONE WIDGET IN THE PACKAGE WITH STATE RATHER THAN LAYOUT, and the two
|
|
7
|
+
* halves therefore hold it in two places on purpose. On GTK the queue is libadwaita's
|
|
8
|
+
* own: `adw_toast_overlay_add_toast` enqueues, the overlay shows one at a time and
|
|
9
|
+
* builds the `AdwToastWidget` itself, and nothing about it is reachable from a renderer.
|
|
10
|
+
* On React Native the queue is `@gjsify/adwaita-core`'s `AdwToastQueue` — the port of
|
|
11
|
+
* that policy — living in a `useRef` because it owns timers whose identity must survive
|
|
12
|
+
* a re-render, with only the VISIBLE toast in `useState` because that is what React
|
|
13
|
+
* re-renders on.
|
|
14
|
+
*
|
|
15
|
+
* So there is exactly one authority per half and neither is React's. What is asserted
|
|
16
|
+
* across them is the behaviour: two toasts added at once show ONE, on both.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AdwToastOverlay(_props: AdwToastOverlayProps): ReactElement | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwToastOverlayProps } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* `AdwToast.timeout` (ms) as `Adw.Toast:timeout` (whole seconds).
|
|
6
|
+
*
|
|
7
|
+
* Exported so `content.gtk.spec.tsx` can assert the conversion against
|
|
8
|
+
* libadwaita's own default instead of against itself; `parity.spec.ts` allows a
|
|
9
|
+
* platform-only export beside the widget for exactly this.
|
|
10
|
+
*
|
|
11
|
+
* IT ROUNDS UP, AND `Math.round` WAS THE FIRST VERSION AND WAS WRONG. `timeout: 0` is
|
|
12
|
+
* libadwaita's "until dismissed", so any rule that can take a POSITIVE millisecond count
|
|
13
|
+
* to 0 turns a brief toast into a permanent one — and `Math.round(400 / 1000)` is exactly
|
|
14
|
+
* that, caught by the row in `content.gtk.spec.tsx` that asserts the conversion. `ceil`
|
|
15
|
+
* cannot reach 0 from a positive input and leaves an authored 0 alone, so the one value
|
|
16
|
+
* that means something else keeps meaning it.
|
|
17
|
+
*
|
|
18
|
+
* It is lossy in the other direction and the README names that: GObject stores whole
|
|
19
|
+
* seconds, so 1500 ms is 2 s on GTK and stays 1500 ms on React Native.
|
|
20
|
+
*/
|
|
21
|
+
export declare const adwToastTimeoutSeconds: (milliseconds: number) => number;
|
|
22
|
+
/** {@link import('./toast-overlay.js').AdwToastOverlay} on GTK. */
|
|
23
|
+
export declare function AdwToastOverlay({ children, ref }: AdwToastOverlayProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwToastOverlayProps } from '../props.js';
|
|
4
|
+
/** {@link import('./toast-overlay.js').AdwToastOverlay} on React Native. */
|
|
5
|
+
export declare function AdwToastOverlay({ children, ref }: AdwToastOverlayProps): ReactElement | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwToolbarViewProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A content area framed by top and/or bottom bars.
|
|
5
|
+
*
|
|
6
|
+
* WHAT THE TWO HALVES SHARE IS THE ARRANGEMENT, NOT THE ARITHMETIC, and that is a
|
|
7
|
+
* measured statement rather than a shortcut. `adw_toolbar_view_size_allocate` is two
|
|
8
|
+
* chained GLib CLAMPs over the bars' MINIMUM and NATURAL heights — ported in
|
|
9
|
+
* `@gjsify/adwaita-core` as `toolbarViewAllocate` and held to vectors — and neither this
|
|
10
|
+
* half nor `@gjsify/adwaita-nativescript`'s can run it: both get an ALREADY-LAID-OUT size
|
|
11
|
+
* from their engine and never a child's intrinsic minimum, so feeding the measurement in
|
|
12
|
+
* as both `min` and `nat` would turn each CLAMP into the identity and dress a
|
|
13
|
+
* pass-through up as libadwaita's arithmetic. The consequence is real and one-directional
|
|
14
|
+
* — a STRETCHY bar keeps its natural height where libadwaita would shrink it toward its
|
|
15
|
+
* minimum to protect the content — and the README names it.
|
|
16
|
+
*
|
|
17
|
+
* The other half of the widget, `toolbarViewClasses`, is four STYLE CLASSES (`raised`,
|
|
18
|
+
* `border`, `undershoot-top`, `undershoot-bottom`), and React Native has no class system
|
|
19
|
+
* to stamp them into. So `topBarStyle` and `bottomBarStyle` reach the real widget on GTK
|
|
20
|
+
* and draw nothing on a phone; that too is named in the README and pinned by a test on
|
|
21
|
+
* each side.
|
|
22
|
+
*/
|
|
23
|
+
export declare function AdwToolbarView(_props: AdwToolbarViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwToolbarViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./toolbar-view.js').AdwToolbarView} on GTK. */
|
|
5
|
+
export declare function AdwToolbarView({ children, topBar, bottomBar, topBarStyle, bottomBarStyle, extendContentToTopEdge, extendContentToBottomEdge, }: AdwToolbarViewProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { AdwToolbarViewProps } from '../props.js';
|
|
4
|
+
/** {@link import('./toolbar-view.js').AdwToolbarView} on React Native. */
|
|
5
|
+
export declare function AdwToolbarView({ children, topBar, bottomBar, extendContentToTopEdge, extendContentToBottomEdge, }: AdwToolbarViewProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwViewStackProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* Named pages, one visible at a time.
|
|
5
|
+
*
|
|
6
|
+
* THE SELECTION IS THE SHARED HALF. Which page an omitted `visible-child-name` shows
|
|
7
|
+
* (the first VISIBLE one, and the auto-pick NOTIFIES), what an unknown name does
|
|
8
|
+
* (nothing — refused, not clamped), and where the selection goes when the visible page
|
|
9
|
+
* is hidden are `@gjsify/adwaita-core`'s `ViewStackState`, held to conformance vectors
|
|
10
|
+
* and already run by both other renderers. On GTK the original answers instead, and
|
|
11
|
+
* the suites assert the same name on both halves.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwViewStack(_props: AdwViewStackProps): ReactElement | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import type Adw from 'gi://Adw?version=1';
|
|
3
|
+
import { type ReactElement } from 'react';
|
|
4
|
+
import type { AdwViewStackPageProps, AdwViewStackProps } from '../props.js';
|
|
5
|
+
/**
|
|
6
|
+
* The page bodies, as children of an `<adw-view-stack>`.
|
|
7
|
+
*
|
|
8
|
+
* Exported because `view-switcher.gtk.tsx` builds the same stack; `parity.spec.ts`
|
|
9
|
+
* allows a platform-only export beside the widget, and the second copy is where a
|
|
10
|
+
* `slot`-versus-`layout` decision would drift.
|
|
11
|
+
*
|
|
12
|
+
* Each body gets its own `GtkBox` rather than being handed to `add_titled` directly:
|
|
13
|
+
* `child` is an arbitrary `ReactNode` with nothing to write a `slot` on, the same wall
|
|
14
|
+
* `header-bar.gtk.tsx` documents.
|
|
15
|
+
*/
|
|
16
|
+
export declare function viewStackChildren(pages: readonly AdwViewStackPageProps[]): ReactElement[];
|
|
17
|
+
/**
|
|
18
|
+
* Write the seven `Adw.ViewStackPage` properties `add_titled` cannot carry.
|
|
19
|
+
*
|
|
20
|
+
* IT RUNS AFTER EVERY COMMIT, WITH NO DEPENDENCY LIST, and that is deliberate: the page
|
|
21
|
+
* list is a prop array whose identity a caller has no reason to keep stable, so a
|
|
22
|
+
* dependency list over its contents would be a second hand-maintained copy of the same
|
|
23
|
+
* record. A redundant `g_object_set` with an unchanged value emits no `notify` and
|
|
24
|
+
* nothing else, so the cost is a property read per page per commit.
|
|
25
|
+
*
|
|
26
|
+
* AN OMITTED PROP IS LEFT ALONE rather than written as libadwaita's default — the rule
|
|
27
|
+
* `clamp.gtk.tsx` states — so the installed libadwaita stays the authority for its own
|
|
28
|
+
* defaults and a drift against `@gjsify/adwaita-core`'s transcription of them is visible
|
|
29
|
+
* instead of silent.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useViewStackPageProperties(stack: Adw.ViewStack | null, pages: readonly AdwViewStackPageProps[]): void;
|
|
32
|
+
/**
|
|
33
|
+
* The `notify::visible-child` handler both stack-owning components install.
|
|
34
|
+
*
|
|
35
|
+
* IT REPORTS NOTHING UNTIL THE WIDGET IS READABLE. libadwaita's auto-pick notifies from
|
|
36
|
+
* inside `adw_view_stack_add_titled` — child insertion is deliberately OUTSIDE gtk-host's
|
|
37
|
+
* host-write window, so the notify is delivered — and at that moment React has not yet
|
|
38
|
+
* committed the `ref`, so there is no stack to read the settled name off. Measured, the
|
|
39
|
+
* inline `stack?.visibleChildName ?? ''` this replaces reported `''` at mount: a name no
|
|
40
|
+
* page carries, on a callback whose whole contract is to name the page that is showing.
|
|
41
|
+
* The React Native half reports nothing there, because its subscription is installed in
|
|
42
|
+
* an effect after the pages are filled in.
|
|
43
|
+
*
|
|
44
|
+
* A change the CALLER made does not come back through here either — gtk-host drops the
|
|
45
|
+
* notify raised inside its own property write, the same rule `AdwExpanderRowProps`
|
|
46
|
+
* records for `onNotifyExpanded`. That one IS a divergence from the React Native half,
|
|
47
|
+
* which re-applies `visibleChildName` through `selectName` and reports what it settled
|
|
48
|
+
* on; the README names it. What both halves report is a change the USER made.
|
|
49
|
+
*/
|
|
50
|
+
export declare function visibleChildNotifier(stack: Adw.ViewStack | null, notify: ((name: string) => void) | undefined): (() => void) | undefined;
|
|
51
|
+
/** {@link import('./view-stack.js').AdwViewStack} on GTK. */
|
|
52
|
+
export declare function AdwViewStack({ pages, visibleChildName, onNotifyVisibleChild, }: AdwViewStackProps): ReactElement | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import { ViewSwitcherState } from '@gjsify/adwaita-core';
|
|
4
|
+
import type { AdwViewStackPageProps, AdwViewStackProps } from '../props.js';
|
|
5
|
+
/**
|
|
6
|
+
* The page model and its selection, shared with `view-switcher.native.tsx`.
|
|
7
|
+
*
|
|
8
|
+
* Exported because the switcher bundles the same stack; `parity.spec.ts` allows a
|
|
9
|
+
* platform-only export beside the widget, and a second copy of this wiring is where the
|
|
10
|
+
* two would come to disagree about what an unknown name does.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useViewStackSelection(pages: readonly AdwViewStackPageProps[], visibleChildName: string | undefined, onNotifyVisibleChild: ((name: string) => void) | undefined): ViewSwitcherState;
|
|
13
|
+
/**
|
|
14
|
+
* The page bodies, one per page, with only the selected one displayed.
|
|
15
|
+
*
|
|
16
|
+
* Shared with the switcher for the reason {@link useViewStackSelection} gives.
|
|
17
|
+
*/
|
|
18
|
+
export declare function viewStackBodies(pages: readonly AdwViewStackPageProps[], selected: number): ReactElement[];
|
|
19
|
+
/** {@link import('./view-stack.js').AdwViewStack} on React Native. */
|
|
20
|
+
export declare function AdwViewStack({ pages, visibleChildName, onNotifyVisibleChild, }: AdwViewStackProps): ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AdwViewSwitcherProps } from '../props.js';
|
|
3
|
+
/**
|
|
4
|
+
* A row of buttons over a view stack.
|
|
5
|
+
*
|
|
6
|
+
* WHAT EACH BUTTON SHOWS IS DERIVED, NOT AUTHORED, and that derivation is
|
|
7
|
+
* `@gjsify/adwaita-core`'s `buildViewSwitcherButtons`: a page with NEITHER a title NOR
|
|
8
|
+
* an icon has no button at all, a page with no icon gets `image-missing` rather than
|
|
9
|
+
* nothing, a badge above 999 reads `999+`, and the button's orientation follows the
|
|
10
|
+
* policy. libadwaita computes the same on GTK, so this widget's two halves differ in
|
|
11
|
+
* what they can DRAW and never in which buttons exist.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdwViewSwitcher(_props: AdwViewSwitcherProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource @gjsify/gtk-host/react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwViewSwitcherProps } from '../props.js';
|
|
4
|
+
/** {@link import('./view-switcher.js').AdwViewSwitcher} on GTK. */
|
|
5
|
+
export declare function AdwViewSwitcher({ pages, policy, visibleChildName, onNotifyVisibleChild, }: AdwViewSwitcherProps): ReactElement | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
|
+
import type { AdwViewSwitcherProps } from '../props.js';
|
|
4
|
+
/** {@link import('./view-switcher.js').AdwViewSwitcher} on React Native. */
|
|
5
|
+
export declare function AdwViewSwitcher({ pages, policy, visibleChildName, onNotifyVisibleChild, }: AdwViewSwitcherProps): ReactElement | null;
|