@marktiderman/genesis-ui-native 3.5.1 → 3.7.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 +115 -7
- package/dist/{chunk-ONH2PCGH.js → chunk-3KFUS7O6.js} +9 -15
- package/dist/chunk-3KFUS7O6.js.map +1 -0
- package/dist/{chunk-LBVD7XXL.js → chunk-7NDKIIOT.js} +627 -20
- package/dist/chunk-7NDKIIOT.js.map +1 -0
- package/dist/chunk-CAI7LGN6.js +39 -0
- package/dist/chunk-CAI7LGN6.js.map +1 -0
- package/dist/{chunk-ABVSSJNT.js → chunk-GBNIBHSU.js} +198 -168
- package/dist/chunk-GBNIBHSU.js.map +1 -0
- package/dist/chunk-IXC3LO2K.js +410 -0
- package/dist/chunk-IXC3LO2K.js.map +1 -0
- package/dist/{chunk-GHYUNNNU.js → chunk-KH2RVAI5.js} +174 -93
- package/dist/chunk-KH2RVAI5.js.map +1 -0
- package/dist/{chunk-6KWEAGRD.js → chunk-O4BMDV7I.js} +110 -17
- package/dist/chunk-O4BMDV7I.js.map +1 -0
- package/dist/chunk-RTYO24SC.js +105 -0
- package/dist/chunk-RTYO24SC.js.map +1 -0
- package/dist/{chunk-D5RKSPMH.js → chunk-YWDDDYDI.js} +4 -3
- package/dist/chunk-YWDDDYDI.js.map +1 -0
- package/dist/components/index.d.ts +382 -10
- package/dist/components/index.js +6 -5
- package/dist/data/index.d.ts +68 -4
- package/dist/data/index.js +231 -30
- package/dist/data/index.js.map +1 -1
- package/dist/hooks/index.d.ts +90 -2
- package/dist/hooks/index.js +3 -3
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/icons/lucide.js +7 -1
- package/dist/icons/lucide.js.map +1 -1
- package/dist/{inbox-page-BEarNEIP.d.ts → inbox-page-B7_Oi2fS.d.ts} +2 -44
- package/dist/index.d.ts +8 -5
- package/dist/index.js +9 -8
- package/dist/layouts/index.d.ts +40 -51
- package/dist/layouts/index.js +6 -4
- package/dist/{native-modules-PwnGltOU.d.ts → native-modules-DEJJQhDx.d.ts} +55 -1
- package/package.json +101 -4
- package/src/__tests__/doctor-rules.test.ts +87 -0
- package/src/__tests__/native-modules-lists.test.tsx +1 -0
- package/src/components/__tests__/button-haptic.test.tsx +52 -0
- package/src/components/__tests__/composer-bar.test.tsx +79 -0
- package/src/components/__tests__/gallery-card.test.tsx +59 -0
- package/src/components/__tests__/gallery-grid.test.tsx +160 -0
- package/src/components/__tests__/lightbox-resnap.test.tsx +50 -0
- package/src/components/__tests__/lightbox-zoom.test.ts +33 -0
- package/src/components/__tests__/lightbox.test.tsx +141 -0
- package/src/components/__tests__/live-indicator.test.tsx +72 -0
- package/src/components/__tests__/rating.test.tsx +82 -0
- package/src/components/__tests__/thread-list.test.tsx +219 -0
- package/src/components/button.tsx +18 -1
- package/src/components/composer-bar.tsx +276 -0
- package/src/components/drawer.tsx +15 -9
- package/src/components/gallery-card.tsx +109 -0
- package/src/components/gallery-grid.tsx +285 -0
- package/src/components/gallery-layout.ts +2 -0
- package/src/components/gallery-types.ts +2 -0
- package/src/components/index.ts +44 -0
- package/src/components/lightbox-zoom.tsx +282 -0
- package/src/components/lightbox.tsx +342 -0
- package/src/components/live-indicator.tsx +139 -0
- package/src/components/rating.tsx +128 -0
- package/src/components/skeleton.tsx +9 -4
- package/src/components/thread-list.tsx +457 -0
- package/src/components/toast.tsx +7 -4
- package/src/data/NativeConflictSheet.tsx +181 -0
- package/src/data/NativeResourceForm.tsx +15 -1
- package/src/data/index.ts +2 -0
- package/src/data/resource-view/NativeRecordView.tsx +85 -8
- package/src/data/resource-view/NativeResourceView.tsx +79 -32
- package/src/data/resource-view/__tests__/native-record-view.test.tsx +95 -1
- package/src/data/resource-view/__tests__/native-resource-gallery.test.tsx +125 -0
- package/src/hooks/__tests__/use-haptics.test.tsx +146 -0
- package/src/hooks/__tests__/use-motion.test.tsx +106 -0
- package/src/hooks/__tests__/use-thread-jump.test.tsx +88 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-haptics.ts +64 -0
- package/src/hooks/use-motion.ts +128 -0
- package/src/hooks/use-press-feedback.ts +87 -0
- package/src/hooks/use-thread-jump.ts +110 -0
- package/src/icon-names.ts +6 -0
- package/src/icons/lucide.ts +12 -0
- package/src/layouts/__tests__/inbox-page.test.tsx +6 -0
- package/src/layouts/__tests__/thread-page.test.tsx +114 -14
- package/src/layouts/inbox-page.tsx +6 -55
- package/src/layouts/index.ts +2 -0
- package/src/layouts/thread-page.tsx +326 -262
- package/src/native-modules.tsx +20 -2
- package/dist/chunk-6KWEAGRD.js.map +0 -1
- package/dist/chunk-7PCWEY6R.js +0 -27
- package/dist/chunk-7PCWEY6R.js.map +0 -1
- package/dist/chunk-ABVSSJNT.js.map +0 -1
- package/dist/chunk-D5RKSPMH.js.map +0 -1
- package/dist/chunk-GHYUNNNU.js.map +0 -1
- package/dist/chunk-LBVD7XXL.js.map +0 -1
- package/dist/chunk-ONH2PCGH.js.map +0 -1
- package/dist/chunk-Z3AQYVUA.js +0 -36
- package/dist/chunk-Z3AQYVUA.js.map +0 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { ReactNode } from 'react';
|
|
2
|
+
import react__default, { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import { TextProps, AccessibilityState, ScrollViewProps, TextInputProps, ViewProps, ColorValue, SwitchProps } from 'react-native';
|
|
6
|
-
import {
|
|
7
|
-
export { G as GenesisDatePickerComponent, a as GenesisDatePickerProps,
|
|
6
|
+
import { H as HapticKind, r as NativeIconName, b as GenesisGlassModule } from '../native-modules-DEJJQhDx.js';
|
|
7
|
+
export { G as GenesisDatePickerComponent, a as GenesisDatePickerProps, d as GenesisIconComponent, e as GenesisIconSet, f as GenesisImageComponent, g as GenesisImageProps, h as GenesisListComponent, i as GenesisListProps, j as GenesisModules, k as GenesisModulesProvider, l as GenesisModulesProviderProps, m as GenesisNavigationModule, n as GenesisNavigationTheme, o as GenesisReanimatedModule, p as GenesisSymbolComponent, q as GenesisSymbolProps, K as KeyboardAvoidingLike, N as NATIVE_ICON_NAMES, S as SF_SYMBOLS, u as useGenesisModules } from '../native-modules-DEJJQhDx.js';
|
|
8
|
+
import { ComposerMode } from '@marktiderman/genesis-core/conversation';
|
|
9
|
+
export { ComposerMode, ComposerTone } from '@marktiderman/genesis-core/conversation';
|
|
10
|
+
import { GalleryItem, GalleryTileAspect } from '@marktiderman/genesis-core/gallery';
|
|
11
|
+
export { DEFAULT_GALLERY_RATIO, GALLERY_DEFAULTS, GalleryItem, GalleryTileAspect, JustifiedRow, JustifiedTile, galleryItemRatio, justifyRows } from '@marktiderman/genesis-core/gallery';
|
|
8
12
|
|
|
9
13
|
declare const textVariants: (props?: ({
|
|
10
14
|
preset?: "h1" | "h2" | "h3" | "h4" | "body" | "body-sm" | "caption" | "label" | null | undefined;
|
|
@@ -48,8 +52,13 @@ interface NativeButtonProps extends VariantProps<typeof buttonVariants> {
|
|
|
48
52
|
accessibilityHint?: string;
|
|
49
53
|
/** Merged with the button's own `disabled` and `busy`: `{ selected: true }` for a vote cast, a filter on. */
|
|
50
54
|
accessibilityState?: AccessibilityState;
|
|
55
|
+
/**
|
|
56
|
+
* A haptic through `GenesisModules.haptics` (`light` for a vote, `success` for a save): it plays
|
|
57
|
+
* when the press counts, except `select`, which ticks on press-in as `usePressFeedback` does. Default none.
|
|
58
|
+
*/
|
|
59
|
+
haptic?: HapticKind | undefined;
|
|
51
60
|
}
|
|
52
|
-
declare function NativeButton({ className, textClassName, variant, size, children, onPress, disabled, loading, accessibilityState, ...props }: NativeButtonProps): react.JSX.Element;
|
|
61
|
+
declare function NativeButton({ className, textClassName, variant, size, children, onPress, disabled, loading, accessibilityState, haptic, ...props }: NativeButtonProps): react.JSX.Element;
|
|
53
62
|
|
|
54
63
|
interface NativeCardProps {
|
|
55
64
|
className?: string;
|
|
@@ -560,10 +569,10 @@ interface NativeRefreshControlProps {
|
|
|
560
569
|
declare function NativeRefreshControl({ tintColor, colors, testID, ...rest }: NativeRefreshControlProps): react.JSX.Element;
|
|
561
570
|
|
|
562
571
|
declare const badgeVariants: (props?: ({
|
|
563
|
-
variant?: "
|
|
572
|
+
variant?: "info" | "success" | "warning" | "default" | "secondary" | "outline" | "destructive" | "muted" | null | undefined;
|
|
564
573
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
565
574
|
declare const badgeTextVariants: (props?: ({
|
|
566
|
-
variant?: "
|
|
575
|
+
variant?: "info" | "success" | "warning" | "default" | "secondary" | "outline" | "destructive" | "muted" | null | undefined;
|
|
567
576
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
568
577
|
interface NativeBadgeProps extends VariantProps<typeof badgeVariants> {
|
|
569
578
|
className?: string;
|
|
@@ -627,13 +636,13 @@ interface NativeLoadingStateProps {
|
|
|
627
636
|
declare function NativeLoadingState({ label, accessibilityLabel, size, fullScreen, safeAreaEdges, color, className, testID, }: NativeLoadingStateProps): react.JSX.Element;
|
|
628
637
|
|
|
629
638
|
declare const alertVariants: (props?: ({
|
|
630
|
-
variant?: "
|
|
639
|
+
variant?: "info" | "success" | "warning" | "default" | "destructive" | null | undefined;
|
|
631
640
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
632
641
|
declare const alertTitleTextVariants: (props?: ({
|
|
633
|
-
variant?: "
|
|
642
|
+
variant?: "info" | "success" | "warning" | "default" | "destructive" | null | undefined;
|
|
634
643
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
635
644
|
declare const alertDescriptionTextVariants: (props?: ({
|
|
636
|
-
variant?: "
|
|
645
|
+
variant?: "info" | "success" | "warning" | "default" | "destructive" | null | undefined;
|
|
637
646
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
638
647
|
interface NativeAlertProps extends VariantProps<typeof alertVariants> {
|
|
639
648
|
className?: string;
|
|
@@ -1095,4 +1104,367 @@ interface NativeGlassSurfaceProps {
|
|
|
1095
1104
|
}
|
|
1096
1105
|
declare function NativeGlassSurface({ children, className, fallbackClassName, radius, tintColor, interactive, glassEffectStyle, testID, }: NativeGlassSurfaceProps): react.JSX.Element;
|
|
1097
1106
|
|
|
1098
|
-
|
|
1107
|
+
/**
|
|
1108
|
+
* NativeThreadList — a conversation's list: oldest first, top to bottom (the
|
|
1109
|
+
* order VoiceOver reads), that opens at the newest row, follows new rows only
|
|
1110
|
+
* while you're at the bottom, keeps your place while earlier rows load at the
|
|
1111
|
+
* top, and can go to one row (a search result, the first unread).
|
|
1112
|
+
*
|
|
1113
|
+
* The atom under ThreadPage, and the one any app builds its own thread from:
|
|
1114
|
+
* it renders the rows it's given and never fetches. Earlier pages come from
|
|
1115
|
+
* `onLoadEarlier`, a row out of reach from `onLoadUntil(id)`.
|
|
1116
|
+
*
|
|
1117
|
+
* FlashList v2 (`GenesisModules.list`) when the app passed it: its chat mode
|
|
1118
|
+
* (`startRenderingFromBottom`, `autoscrollToBottomThreshold`, the first
|
|
1119
|
+
* visible row held when rows prepend). Without it, FlatList, which keeps its
|
|
1120
|
+
* place with `maintainVisibleContentPosition` (anchored past the header) and
|
|
1121
|
+
* follows the bottom by hand.
|
|
1122
|
+
*
|
|
1123
|
+
* Not inverted: in an inverted FlashList a new row at index 0 lands under the
|
|
1124
|
+
* composer, and VoiceOver reads each day's heading after its messages.
|
|
1125
|
+
*
|
|
1126
|
+
* Earlier rows load by themselves near the top, and the explicit "Load
|
|
1127
|
+
* earlier" button stays: VoiceOver can't reach rows a virtualized list hasn't
|
|
1128
|
+
* rendered. Going to a row waits for `loading`, loads until it's held,
|
|
1129
|
+
* scrolls to it (again after FlashList's own placement on open), highlights
|
|
1130
|
+
* it for two seconds and announces it. Reduce Motion scrolls without
|
|
1131
|
+
* animating.
|
|
1132
|
+
*
|
|
1133
|
+
* Promoted from genesis-chat's thread and its `useJumpToMessage` (G4); chat
|
|
1134
|
+
* moves onto it later.
|
|
1135
|
+
*
|
|
1136
|
+
* @stability Beta
|
|
1137
|
+
*/
|
|
1138
|
+
|
|
1139
|
+
/** The scroll event fields the list reads. */
|
|
1140
|
+
interface ScrollMetrics {
|
|
1141
|
+
contentOffset: {
|
|
1142
|
+
y: number;
|
|
1143
|
+
};
|
|
1144
|
+
contentSize: {
|
|
1145
|
+
height: number;
|
|
1146
|
+
};
|
|
1147
|
+
layoutMeasurement: {
|
|
1148
|
+
height: number;
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
/** Points from the bottom that still count as "at the bottom". */
|
|
1152
|
+
declare const THREAD_AT_BOTTOM_POINTS = 120;
|
|
1153
|
+
/** Whether a scroll position is at (or near) the bottom of its content. */
|
|
1154
|
+
declare function threadNearBottom(m: ScrollMetrics, slack?: number): boolean;
|
|
1155
|
+
/**
|
|
1156
|
+
* How the list is set up. FlashList follows by itself, within
|
|
1157
|
+
* `THREAD_AT_BOTTOM_POINTS` of the bottom (its threshold is a fraction of the
|
|
1158
|
+
* viewport: a fifth until the viewport's height is known); FlatList keeps its
|
|
1159
|
+
* place on prepend, anchored on the first row past the header (index 1: the
|
|
1160
|
+
* header is child 0), and the list follows the bottom by hand.
|
|
1161
|
+
*/
|
|
1162
|
+
declare function threadListMode(flash: boolean, reducedMotion: boolean, viewportHeight?: number): {
|
|
1163
|
+
followsByHand: boolean;
|
|
1164
|
+
maintainVisibleContentPosition: Record<string, unknown>;
|
|
1165
|
+
};
|
|
1166
|
+
interface NativeThreadListHandle {
|
|
1167
|
+
/** Go to the newest row (after a send: what you send is what you look at next). */
|
|
1168
|
+
scrollToEnd: (options?: {
|
|
1169
|
+
animated?: boolean;
|
|
1170
|
+
}) => void;
|
|
1171
|
+
}
|
|
1172
|
+
/** What `renderItem` is told about a row besides the row itself. */
|
|
1173
|
+
interface ThreadRowInfo {
|
|
1174
|
+
index: number;
|
|
1175
|
+
/** The row a jump just landed on, for two seconds. */
|
|
1176
|
+
highlighted: boolean;
|
|
1177
|
+
}
|
|
1178
|
+
interface NativeThreadListProps<T> {
|
|
1179
|
+
/** Oldest first. */
|
|
1180
|
+
data: readonly T[];
|
|
1181
|
+
/** A row's id. It must stay the same across refreshes (from a cache to the server), or rows jump. */
|
|
1182
|
+
keyExtractor: (row: T) => string;
|
|
1183
|
+
renderItem: (row: T, info: ThreadRowInfo) => ReactElement | null;
|
|
1184
|
+
/** Rows of different shapes recycle apart (FlashList): "mine", "theirs", "event". */
|
|
1185
|
+
getItemType?: (row: T) => string;
|
|
1186
|
+
/** The first page is loading: shows `loadingView` (a skeleton by default), and a jump waits. */
|
|
1187
|
+
loading?: boolean;
|
|
1188
|
+
loadingView?: ReactNode;
|
|
1189
|
+
/** There are earlier rows: loads them near the top, and shows the "Load earlier" button. */
|
|
1190
|
+
hasEarlier?: boolean;
|
|
1191
|
+
onLoadEarlier?: () => void;
|
|
1192
|
+
loadingEarlier?: boolean;
|
|
1193
|
+
earlierLabel?: string;
|
|
1194
|
+
/** Replaces the default "Load earlier" button. */
|
|
1195
|
+
renderEarlier?: (props: {
|
|
1196
|
+
loading: boolean;
|
|
1197
|
+
onPress: () => void;
|
|
1198
|
+
label: string;
|
|
1199
|
+
testID: string;
|
|
1200
|
+
}) => ReactNode;
|
|
1201
|
+
/** Go to this row, loading earlier pages with `onLoadUntil` until it's here. A new id, or the same one after `null`, goes again. */
|
|
1202
|
+
jumpTo?: string | null;
|
|
1203
|
+
/**
|
|
1204
|
+
* The id `jumpTo` names a row by, when it isn't the row's key: a message keyed by the id the
|
|
1205
|
+
* phone gave it (so it keeps its row when the server's copy lands) and gone to by the server's
|
|
1206
|
+
* id. `null` for a row that can't be gone to (a day heading). `keyExtractor` by default.
|
|
1207
|
+
* Pass a stable function (module scope, or `useCallback`): a new one each render re-renders every row.
|
|
1208
|
+
*/
|
|
1209
|
+
jumpId?: (row: T) => string | null | undefined;
|
|
1210
|
+
/** Load earlier pages until the row is held; resolve false when it can't be found. */
|
|
1211
|
+
onLoadUntil?: (id: string) => Promise<boolean>;
|
|
1212
|
+
/** What VoiceOver says on arriving at `jumpTo`. */
|
|
1213
|
+
jumpAnnouncement?: (row: T) => string;
|
|
1214
|
+
/** The row couldn't be found (deleted, out of reach). The list goes back to the newest row first. */
|
|
1215
|
+
onJumpFailed?: (id: string) => void;
|
|
1216
|
+
/** Whether the reader is at the bottom, as it changes (to show a "new messages" pill, say). */
|
|
1217
|
+
onAtBottomChange?: (atBottom: boolean) => void;
|
|
1218
|
+
/** Above the first row, before the "Load earlier" button: what the thread is about. */
|
|
1219
|
+
header?: ReactNode;
|
|
1220
|
+
/** Under the last row: who is typing, a "Sending…" line. */
|
|
1221
|
+
footer?: ReactNode;
|
|
1222
|
+
/** Shown instead of the rows when there are none. */
|
|
1223
|
+
empty?: ReactNode;
|
|
1224
|
+
testID?: string;
|
|
1225
|
+
}
|
|
1226
|
+
/** A conversation's list. See the module docs. */
|
|
1227
|
+
declare const NativeThreadList: <T>(props: NativeThreadListProps<T> & {
|
|
1228
|
+
ref?: React.Ref<NativeThreadListHandle>;
|
|
1229
|
+
}) => ReactElement | null;
|
|
1230
|
+
|
|
1231
|
+
interface NativeComposerBarProps {
|
|
1232
|
+
value: string;
|
|
1233
|
+
onChangeText: (text: string) => void;
|
|
1234
|
+
onSend: () => void;
|
|
1235
|
+
/** A send is in flight: the button spins and won't send twice. */
|
|
1236
|
+
sending?: boolean;
|
|
1237
|
+
/** Turns sending off (besides a blank value). */
|
|
1238
|
+
disabled?: boolean;
|
|
1239
|
+
placeholder?: string;
|
|
1240
|
+
/** Send's label, to VoiceOver. Default "Send". */
|
|
1241
|
+
sendLabel?: string;
|
|
1242
|
+
sendingLabel?: string;
|
|
1243
|
+
maxLength?: number;
|
|
1244
|
+
/** The input grows to this many lines, then scrolls. Default 6. */
|
|
1245
|
+
maxLines?: number;
|
|
1246
|
+
/** Ways to send ("Reply", "Internal note"). Two or more show the picker. */
|
|
1247
|
+
modes?: readonly ComposerMode[];
|
|
1248
|
+
/** The chosen mode's id. Default the first. */
|
|
1249
|
+
mode?: string;
|
|
1250
|
+
onModeChange?: (id: string) => void;
|
|
1251
|
+
leading?: ReactNode;
|
|
1252
|
+
trailing?: ReactNode;
|
|
1253
|
+
above?: ReactNode;
|
|
1254
|
+
/**
|
|
1255
|
+
* Whether there's nothing to send. By default, a blank `value`; pass `false` when attachments
|
|
1256
|
+
* are waiting and no text is needed.
|
|
1257
|
+
*/
|
|
1258
|
+
empty?: boolean;
|
|
1259
|
+
/** Takes Send's place (the same 44pt spot) while there's nothing to send and nothing sending: a hold-to-record mic. */
|
|
1260
|
+
idleAction?: ReactNode;
|
|
1261
|
+
/** Shown instead of `leading` and the input (a recording in progress). Label it yourself: it's one region to VoiceOver. */
|
|
1262
|
+
replaceInput?: ReactNode;
|
|
1263
|
+
/** Touch and hold Send for these (one runs straight away; several open a menu). Each is also an accessibility action on Send. */
|
|
1264
|
+
sendActions?: readonly ComposerSendAction[];
|
|
1265
|
+
/** Title of the menu when there are several `sendActions`. */
|
|
1266
|
+
sendActionsTitle?: string;
|
|
1267
|
+
/** The hint on Send when it has `sendActions`. Default "Touch and hold for more options". */
|
|
1268
|
+
sendActionsHint?: string;
|
|
1269
|
+
/** Passed to the input (to insert at the cursor, say). */
|
|
1270
|
+
onSelectionChange?: (e: {
|
|
1271
|
+
nativeEvent: {
|
|
1272
|
+
selection: {
|
|
1273
|
+
start: number;
|
|
1274
|
+
end: number;
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
}) => void;
|
|
1278
|
+
/** The input takes text (default). When false, nothing sends and the input reads as disabled. */
|
|
1279
|
+
editable?: boolean;
|
|
1280
|
+
testID?: string;
|
|
1281
|
+
}
|
|
1282
|
+
/** Another way to send (touch and hold Send). */
|
|
1283
|
+
interface ComposerSendAction {
|
|
1284
|
+
id: string;
|
|
1285
|
+
label: string;
|
|
1286
|
+
onPress: () => void;
|
|
1287
|
+
destructive?: boolean;
|
|
1288
|
+
}
|
|
1289
|
+
declare function NativeComposerBar({ value, onChangeText, onSend, sending, disabled, placeholder, sendLabel, sendingLabel, maxLength, maxLines, modes, mode, onModeChange, leading, trailing, above, empty, idleAction, replaceInput, sendActions, sendActionsTitle, sendActionsHint, onSelectionChange, editable, testID, }: NativeComposerBarProps): react.JSX.Element;
|
|
1290
|
+
|
|
1291
|
+
type NativeRatingSize = "sm" | "md" | "lg";
|
|
1292
|
+
interface NativeRatingProps {
|
|
1293
|
+
/** The score, 0..`max`. Fractions round to the nearest star. */
|
|
1294
|
+
value: number;
|
|
1295
|
+
/** Number of stars. Default 5. */
|
|
1296
|
+
max?: number;
|
|
1297
|
+
/** Makes the stars tappable; absent, the rating is read-only. */
|
|
1298
|
+
onChange?: (value: number) => void;
|
|
1299
|
+
/** Read-only even with `onChange`. */
|
|
1300
|
+
readOnly?: boolean;
|
|
1301
|
+
/** Default "md". */
|
|
1302
|
+
size?: NativeRatingSize;
|
|
1303
|
+
/** The control's accessible name ("Service rating"): read-only reads "Service rating: 3 of 5 stars". */
|
|
1304
|
+
label?: string;
|
|
1305
|
+
/** The accessibility text for a value, in place of "N of M stars" (read-only label, each radio's label and value). */
|
|
1306
|
+
getLabel?: (value: number, max: number) => string;
|
|
1307
|
+
className?: string;
|
|
1308
|
+
testID?: string;
|
|
1309
|
+
}
|
|
1310
|
+
/** The value after pressing `star`: that star, or 0 when it is the current value (a press clears). */
|
|
1311
|
+
declare function nextRating(value: number, star: number): number;
|
|
1312
|
+
declare function NativeRating({ value, max, onChange, readOnly, size, label, getLabel, className, testID, }: NativeRatingProps): react.JSX.Element;
|
|
1313
|
+
|
|
1314
|
+
type NativeGalleryLayout = "justified" | "grid";
|
|
1315
|
+
interface NativeGalleryGridProps {
|
|
1316
|
+
items: GalleryItem[];
|
|
1317
|
+
/** Default "justified". */
|
|
1318
|
+
layout?: NativeGalleryLayout;
|
|
1319
|
+
/** Grid layout only: tiles per row. Default 3. */
|
|
1320
|
+
columns?: number;
|
|
1321
|
+
/** Grid layout only: each tile's shape, a ratio or `"item"` for the item's own. Default 1 (square), as on web. */
|
|
1322
|
+
aspectRatio?: GalleryTileAspect;
|
|
1323
|
+
/** Justified layout only: target row height in points. Default 180. */
|
|
1324
|
+
rowHeight?: number;
|
|
1325
|
+
/** Points between tiles. Default 4. */
|
|
1326
|
+
gap?: number;
|
|
1327
|
+
/** Called on a press. Not called when `onSelectionChange` is set: a press then only toggles the selection. */
|
|
1328
|
+
onItemPress?: (item: GalleryItem, index: number) => void;
|
|
1329
|
+
/** Replaces the tile's content (the image by default). */
|
|
1330
|
+
renderItem?: (item: GalleryItem, index: number) => ReactNode;
|
|
1331
|
+
/** Overlaid top-left of the default tile. */
|
|
1332
|
+
renderBadges?: (item: GalleryItem, index: number) => ReactNode;
|
|
1333
|
+
/** Ids of the selected items. With `onSelectionChange`, a press toggles the tile. */
|
|
1334
|
+
selected?: string[];
|
|
1335
|
+
onSelectionChange?: (ids: string[], detail: {
|
|
1336
|
+
item: GalleryItem;
|
|
1337
|
+
index: number;
|
|
1338
|
+
}) => void;
|
|
1339
|
+
/** Called when scrolling nears the last rows (FlatList's `onEndReached`): the hook for "load more" (NativeResourceView's name). */
|
|
1340
|
+
loadMore?: () => void;
|
|
1341
|
+
/** @deprecated Use `loadMore`. */
|
|
1342
|
+
onNearEnd?: () => void;
|
|
1343
|
+
/** Above the first row, scrolling with it. */
|
|
1344
|
+
header?: ReactNode;
|
|
1345
|
+
/** Below the last row (a "Loading more" spinner). */
|
|
1346
|
+
footer?: ReactNode;
|
|
1347
|
+
/** Groups items (in order of first appearance), each under a header reading the key (a view's `groupBy`, for an array). */
|
|
1348
|
+
groupBy?: (item: GalleryItem) => string;
|
|
1349
|
+
/** @deprecated Use `groupBy`. */
|
|
1350
|
+
getGroup?: (item: GalleryItem) => string;
|
|
1351
|
+
className?: string;
|
|
1352
|
+
testID?: string;
|
|
1353
|
+
}
|
|
1354
|
+
declare function NativeGalleryGrid({ items, layout, columns, aspectRatio, rowHeight, gap, onItemPress, renderItem, renderBadges, selected, onSelectionChange, loadMore: loadMoreProp, onNearEnd, header, footer, groupBy: groupByProp, getGroup, className, testID, }: NativeGalleryGridProps): react.JSX.Element;
|
|
1355
|
+
|
|
1356
|
+
/** The viewer's words, for another language. */
|
|
1357
|
+
interface NativeLightboxLabels {
|
|
1358
|
+
close: string;
|
|
1359
|
+
/** The pager's value for screen readers: "3 of 12". */
|
|
1360
|
+
position: (n: number, count: number) => string;
|
|
1361
|
+
/** The pager's hint for screen readers, when there's more than one. */
|
|
1362
|
+
pagerHint: string;
|
|
1363
|
+
/** A picture with no `alt`. */
|
|
1364
|
+
photo: (n: number, count: number) => string;
|
|
1365
|
+
}
|
|
1366
|
+
declare const defaultNativeLightboxLabels: NativeLightboxLabels;
|
|
1367
|
+
interface NativeLightboxProps {
|
|
1368
|
+
open: boolean;
|
|
1369
|
+
onOpenChange: (open: boolean) => void;
|
|
1370
|
+
items: GalleryItem[];
|
|
1371
|
+
/** The item shown, 0-based. */
|
|
1372
|
+
index: number;
|
|
1373
|
+
onIndexChange: (index: number) => void;
|
|
1374
|
+
/** Replaces the default caption (the item's `caption`). */
|
|
1375
|
+
renderCaption?: (item: GalleryItem, index: number) => ReactNode;
|
|
1376
|
+
/** Top-right slot: icon buttons for the current item. */
|
|
1377
|
+
renderActions?: (item: GalleryItem, index: number) => ReactNode;
|
|
1378
|
+
/** Replaces the page's picture (a video player, a before/after view); fills the page. */
|
|
1379
|
+
renderMedia?: (item: GalleryItem, index: number) => ReactNode;
|
|
1380
|
+
/** In the top bar, and the viewer's accessibility label. */
|
|
1381
|
+
title?: string;
|
|
1382
|
+
/** Under the title in the top bar. */
|
|
1383
|
+
description?: ReactNode;
|
|
1384
|
+
/** Pinch or double-tap the built-in photo pages to zoom. Default true. */
|
|
1385
|
+
zoomable?: boolean;
|
|
1386
|
+
/** A pull down at full size closes the viewer. Default true. */
|
|
1387
|
+
swipeToDismiss?: boolean;
|
|
1388
|
+
labels?: Partial<NativeLightboxLabels>;
|
|
1389
|
+
testID?: string;
|
|
1390
|
+
}
|
|
1391
|
+
declare function NativeLightbox({ open, onOpenChange, items, index, onIndexChange, renderCaption, renderActions, renderMedia, title, description, zoomable, swipeToDismiss, labels: labelOverrides, testID, }: NativeLightboxProps): react.JSX.Element;
|
|
1392
|
+
|
|
1393
|
+
/** Points pulled down (or dragged, on Android) that close the viewer on release. */
|
|
1394
|
+
declare const LIGHTBOX_DISMISS_DISTANCE = 110;
|
|
1395
|
+
/** Or a quick flick down, in points per millisecond. */
|
|
1396
|
+
declare const LIGHTBOX_DISMISS_VELOCITY = 1.1;
|
|
1397
|
+
/** How far a photo zooms in. */
|
|
1398
|
+
declare const LIGHTBOX_MAX_ZOOM = 4;
|
|
1399
|
+
/** Between two taps (each fires on release) for a double tap: a quick one measured 330ms apart on iOS. */
|
|
1400
|
+
declare const LIGHTBOX_DOUBLE_TAP_MS = 400;
|
|
1401
|
+
/** Whether a drag down that ended here closes the viewer. */
|
|
1402
|
+
declare function lightboxShouldDismiss(dy: number, vy: number): boolean;
|
|
1403
|
+
/** The zoom a pinch has reached: from where it started, by how far the fingers spread. */
|
|
1404
|
+
declare function lightboxPinchScale(startScale: number, startDistance: number, distance: number): number;
|
|
1405
|
+
/** Points between two touches. */
|
|
1406
|
+
declare function lightboxTouchDistance(touches: readonly {
|
|
1407
|
+
pageX: number;
|
|
1408
|
+
pageY: number;
|
|
1409
|
+
}[]): number;
|
|
1410
|
+
/** How far a zoomed photo may pan before an edge shows, per axis. */
|
|
1411
|
+
declare function lightboxPanLimit(scale: number, size: number): number;
|
|
1412
|
+
interface NativeZoomablePhotoProps {
|
|
1413
|
+
src: string;
|
|
1414
|
+
alt?: string;
|
|
1415
|
+
width: number;
|
|
1416
|
+
height: number;
|
|
1417
|
+
/** The page on screen: another page resets its zoom. */
|
|
1418
|
+
active: boolean;
|
|
1419
|
+
onZoomChange: (zoomed: boolean) => void;
|
|
1420
|
+
/** Pinch and double-tap zoom (on by default). Off, the page still pulls down to close. */
|
|
1421
|
+
zoomable?: boolean;
|
|
1422
|
+
/** How far it's pulled down, for the backdrop's fade; null when swiping down doesn't close. */
|
|
1423
|
+
onPull: ((dy: number) => void) | null;
|
|
1424
|
+
onDismiss: () => void;
|
|
1425
|
+
/** A single tap (shows or hides the viewer's chrome). */
|
|
1426
|
+
onTap: () => void;
|
|
1427
|
+
testID: string;
|
|
1428
|
+
}
|
|
1429
|
+
/** The page: iOS's zooming scroll view, or Android's pinch and pan. */
|
|
1430
|
+
declare function NativeZoomablePhoto(props: NativeZoomablePhotoProps): react.JSX.Element;
|
|
1431
|
+
|
|
1432
|
+
interface NativeGalleryCardProps {
|
|
1433
|
+
/** The cover picture. Without it the cover is a placeholder. */
|
|
1434
|
+
src?: string;
|
|
1435
|
+
alt?: string;
|
|
1436
|
+
title?: string;
|
|
1437
|
+
subtitle?: string;
|
|
1438
|
+
/** Over the cover, top-left (a `NativeBadge`, a `NativeLiveIndicator`). */
|
|
1439
|
+
badges?: ReactNode;
|
|
1440
|
+
/** Over the cover, top-right (an icon button, a menu). */
|
|
1441
|
+
actions?: ReactNode;
|
|
1442
|
+
/** Cover width ÷ height. Default 4/3. */
|
|
1443
|
+
ratio?: number;
|
|
1444
|
+
/** Draws the cover as a skeleton. */
|
|
1445
|
+
loading?: boolean;
|
|
1446
|
+
onPress?: () => void;
|
|
1447
|
+
className?: string;
|
|
1448
|
+
testID?: string;
|
|
1449
|
+
}
|
|
1450
|
+
declare function NativeGalleryCard({ src, alt, title, subtitle, badges, actions, ratio, loading, onPress, className, testID, }: NativeGalleryCardProps): react.JSX.Element;
|
|
1451
|
+
|
|
1452
|
+
type NativeLiveIndicatorVariant = "pill" | "dot";
|
|
1453
|
+
type NativeLiveIndicatorState = "live" | "idle" | "offline";
|
|
1454
|
+
interface NativeLiveIndicatorProps {
|
|
1455
|
+
/** Default true. `live={false}` is `state="idle"`. */
|
|
1456
|
+
live?: boolean;
|
|
1457
|
+
/** Overrides `live`: "live", "idle" (grey) or "offline" (faint). */
|
|
1458
|
+
state?: NativeLiveIndicatorState;
|
|
1459
|
+
/** Visible text and screen-reader label. Default follows the state: "Live", "Idle" or "Offline". */
|
|
1460
|
+
label?: string;
|
|
1461
|
+
/** After the label ("12 watching", "since 9:00"). */
|
|
1462
|
+
detail?: string;
|
|
1463
|
+
/** "pill" (default): dot and label on a rounded surface. "dot": the dot alone. */
|
|
1464
|
+
variant?: NativeLiveIndicatorVariant;
|
|
1465
|
+
className?: string;
|
|
1466
|
+
testID?: string;
|
|
1467
|
+
}
|
|
1468
|
+
declare function NativeLiveIndicator({ live, state, label, detail, variant, className, testID, }: NativeLiveIndicatorProps): react.JSX.Element;
|
|
1469
|
+
|
|
1470
|
+
export { Box, type BoxBackground, type BoxProps, type ComposerSendAction, FULL_SCREEN_DARK, type FlexAlign, type FlexJustify, GenesisGlassModule, Grid, type GridProps, Inline, type InlineProps, LIGHTBOX_DISMISS_DISTANCE, LIGHTBOX_DISMISS_VELOCITY, LIGHTBOX_DOUBLE_TAP_MS, LIGHTBOX_MAX_ZOOM, NativeAccordion, NativeAccordionContent, type NativeAccordionContentProps, NativeAccordionItem, type NativeAccordionItemProps, type NativeAccordionProps, NativeAccordionTrigger, type NativeAccordionTriggerProps, type NativeAccordionType, NativeAlert, NativeAlertDescription, type NativeAlertDescriptionProps, type NativeAlertProps, NativeAlertTitle, type NativeAlertTitleProps, NativeAvatar, type NativeAvatarProps, NativeBadge, type NativeBadgeProps, NativeBanner, type NativeBannerProps, NativeButton, type NativeButtonProps, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, type NativeCardProps, NativeCardTitle, type NativeCardTitleProps, NativeCheckbox, type NativeCheckboxProps, NativeChip, NativeChipGroup, type NativeChipGroupMode, type NativeChipGroupProps, type NativeChipProps, NativeCombobox, type NativeComboboxOption, type NativeComboboxProps, NativeComposerBar, type NativeComposerBarProps, NativeDatePicker, type NativeDatePickerProps, NativeDialog, NativeDialogContent, type NativeDialogContentProps, NativeDialogDescription, type NativeDialogDescriptionProps, NativeDialogFooter, type NativeDialogFooterProps, NativeDialogHeader, type NativeDialogHeaderProps, type NativeDialogProps, NativeDialogTitle, type NativeDialogTitleProps, NativeDrawer, type NativeDrawerProps, NativeDropdownMenu, NativeDropdownMenuContent, type NativeDropdownMenuContentProps, NativeDropdownMenuItem, type NativeDropdownMenuItemProps, type NativeDropdownMenuProps, NativeDropdownMenuTrigger, type NativeDropdownMenuTriggerProps, NativeEmptyState, type NativeEmptyStateProps, type NativeEmptyStateVariant, NativeFullScreenModal, type NativeFullScreenModalProps, NativeGalleryCard, type NativeGalleryCardProps, NativeGalleryGrid, type NativeGalleryGridProps, type NativeGalleryLayout, NativeGlassSurface, type NativeGlassSurfaceProps, NativeHeaderCard, type NativeHeaderCardProps, NativeIcon, NativeIconName, type NativeIconProps, NativeImage, type NativeImageProps, NativeInlineAlert, type NativeInlineAlertProps, type NativeInlineAlertVariant, NativeInput, type NativeInputProps, NativeLabel, type NativeLabelProps, NativeLightbox, type NativeLightboxLabels, type NativeLightboxProps, NativeListItem, NativeListItemDivider, type NativeListItemProps, NativeLiveIndicator, type NativeLiveIndicatorProps, type NativeLiveIndicatorState, type NativeLiveIndicatorVariant, NativeLoadingState, type NativeLoadingStateEdge, type NativeLoadingStateProps, NativeNumberInput, type NativeNumberInputProps, NativePagination, type NativePaginationProps, NativePopover, NativePopoverContent, type NativePopoverContentProps, type NativePopoverProps, NativePopoverTrigger, type NativePopoverTriggerProps, NativeProgress, type NativeProgressProps, NativeRadioGroup, NativeRadioGroupItem, type NativeRadioGroupItemProps, type NativeRadioGroupProps, NativeRangeSlider, type NativeRangeSliderProps, NativeRating, type NativeRatingProps, type NativeRatingSize, NativeRefreshControl, type NativeRefreshControlProps, NativeSearchBar, type NativeSearchBarProps, NativeSectionListHeader, type NativeSectionListHeaderProps, NativeSegmentedControl, type NativeSegmentedControlOption, type NativeSegmentedControlProps, NativeSelect, NativeSelectContent, type NativeSelectContentProps, NativeSelectItem, type NativeSelectItemProps, type NativeSelectProps, NativeSelectTrigger, type NativeSelectTriggerProps, NativeSeparator, type NativeSeparatorProps, NativeSheet, type NativeSheetLibrary, type NativeSheetProps, NativeSheetProvider, type NativeSheetProviderProps, NativeSheetScrollView, NativeSkeleton, type NativeSkeletonProps, NativeSlider, type NativeSliderProps, NativeStepper, type NativeStepperProps, type NativeStepperStep, NativeSwitch, type NativeSwitchProps, NativeTabs, NativeTabsContent, type NativeTabsContentProps, NativeTabsList, type NativeTabsListProps, type NativeTabsProps, NativeTabsTrigger, type NativeTabsTriggerProps, NativeText, type NativeTextProps, NativeTextarea, type NativeTextareaProps, NativeThreadList, type NativeThreadListHandle, type NativeThreadListProps, NativeTimePicker, type NativeTimePickerProps, type NativeToastOptions, NativeToastProvider, type NativeToastProviderProps, type NativeToastVariant, NativeToggle, type NativeToggleProps, NativeTooltip, NativeTooltipContent, type NativeTooltipContentProps, type NativeTooltipProps, NativeTooltipTrigger, type NativeTooltipTriggerProps, NativeZoomablePhoto, type NativeZoomablePhotoProps, type SpaceToken, type SpacingPrefix, Stack, type StackProps, THREAD_AT_BOTTOM_POINTS, type TextPreset, type ThreadRowInfo, alertVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, defaultNativeLightboxLabels, lightboxPanLimit, lightboxPinchScale, lightboxShouldDismiss, lightboxTouchDistance, nextRating, spaceScale, spacingClass, textVariants, threadListMode, threadNearBottom, toggleVariants, useLiquidGlass, useReduceTransparency, useToast };
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { Box, FULL_SCREEN_DARK, Grid, Inline, NativeAccordion, NativeAccordionContent, NativeAccordionItem, NativeAccordionTrigger, NativeChip, NativeChipGroup, NativeCombobox, NativeDialog, NativeDialogContent, NativeDialogDescription, NativeDialogFooter, NativeDialogHeader, NativeDialogTitle, NativeDrawer, NativeDropdownMenu, NativeDropdownMenuContent, NativeDropdownMenuItem, NativeDropdownMenuTrigger, NativeFullScreenModal, NativeGlassSurface, NativeHeaderCard, NativeNumberInput, NativePagination, NativePopover, NativePopoverContent, NativePopoverTrigger, NativeProgress, NativeRadioGroup, NativeRadioGroupItem, NativeRangeSlider, NativeSlider, NativeStepper, NativeTabs, NativeTabsContent, NativeTabsList, NativeTabsTrigger, NativeToastProvider, NativeToggle, NativeTooltip, NativeTooltipContent, NativeTooltipTrigger, Stack, spaceScale, spacingClass, toggleVariants, useLiquidGlass, useReduceTransparency, useToast } from '../chunk-
|
|
2
|
-
export { NativeAlert, NativeAlertDescription, NativeAlertTitle, NativeAvatar, NativeBanner, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, NativeCardTitle, NativeCheckbox, NativeDatePicker, NativeImage, NativeInlineAlert, NativeLabel, NativeSearchBar, NativeSegmentedControl, NativeSelect, NativeSelectContent, NativeSelectItem, NativeSelectTrigger, NativeSeparator, NativeSheet, NativeSheetProvider, NativeSheetScrollView,
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import '../chunk-
|
|
1
|
+
export { Box, FULL_SCREEN_DARK, Grid, Inline, LIGHTBOX_DISMISS_DISTANCE, LIGHTBOX_DISMISS_VELOCITY, LIGHTBOX_DOUBLE_TAP_MS, LIGHTBOX_MAX_ZOOM, NativeAccordion, NativeAccordionContent, NativeAccordionItem, NativeAccordionTrigger, NativeChip, NativeChipGroup, NativeCombobox, NativeDialog, NativeDialogContent, NativeDialogDescription, NativeDialogFooter, NativeDialogHeader, NativeDialogTitle, NativeDrawer, NativeDropdownMenu, NativeDropdownMenuContent, NativeDropdownMenuItem, NativeDropdownMenuTrigger, NativeFullScreenModal, NativeGalleryCard, NativeGlassSurface, NativeHeaderCard, NativeLightbox, NativeLiveIndicator, NativeNumberInput, NativePagination, NativePopover, NativePopoverContent, NativePopoverTrigger, NativeProgress, NativeRadioGroup, NativeRadioGroupItem, NativeRangeSlider, NativeRating, NativeSlider, NativeStepper, NativeTabs, NativeTabsContent, NativeTabsList, NativeTabsTrigger, NativeToastProvider, NativeToggle, NativeTooltip, NativeTooltipContent, NativeTooltipTrigger, NativeZoomablePhoto, Stack, defaultNativeLightboxLabels, lightboxPanLimit, lightboxPinchScale, lightboxShouldDismiss, lightboxTouchDistance, nextRating, spaceScale, spacingClass, toggleVariants, useLiquidGlass, useReduceTransparency, useToast } from '../chunk-7NDKIIOT.js';
|
|
2
|
+
export { DEFAULT_GALLERY_RATIO, GALLERY_DEFAULTS, NativeAlert, NativeAlertDescription, NativeAlertTitle, NativeAvatar, NativeBanner, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, NativeCardTitle, NativeCheckbox, NativeDatePicker, NativeGalleryGrid, NativeImage, NativeInlineAlert, NativeLabel, NativeSearchBar, NativeSegmentedControl, NativeSelect, NativeSelectContent, NativeSelectItem, NativeSelectTrigger, NativeSeparator, NativeSheet, NativeSheetProvider, NativeSheetScrollView, NativeSwitch, NativeTextarea, NativeTimePicker, alertVariants, galleryItemRatio, justifyRows } from '../chunk-KH2RVAI5.js';
|
|
3
|
+
export { NativeComposerBar, NativeThreadList, THREAD_AT_BOTTOM_POINTS, threadListMode, threadNearBottom } from '../chunk-IXC3LO2K.js';
|
|
4
|
+
export { NATIVE_ICON_NAMES, NativeBadge, NativeButton, NativeEmptyState, NativeIcon, NativeInput, NativeListItem, NativeListItemDivider, NativeLoadingState, NativeRefreshControl, NativeSectionListHeader, NativeSkeleton, NativeText, SF_SYMBOLS, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, textVariants } from '../chunk-O4BMDV7I.js';
|
|
5
|
+
import '../chunk-CAI7LGN6.js';
|
|
6
|
+
export { GenesisModulesProvider, useGenesisModules } from '../chunk-RTYO24SC.js';
|
|
6
7
|
import '../chunk-OHZD7KRO.js';
|
|
7
8
|
import '../chunk-DGUM43GV.js';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { ResourceFormFieldDef, BaseRecord, DataRow, FieldReference, ResourceContract } from '@marktiderman/genesis-core';
|
|
3
|
+
import { ResourceFormFieldDef, BaseRecord, DataRow, FieldReference, WriteConflict, ResourceContract } from '@marktiderman/genesis-core';
|
|
4
4
|
import { Control, UseFormReturn } from 'react-hook-form';
|
|
5
5
|
import { UseResourceOptions } from '@marktiderman/genesis-core/hooks';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { ResourceView, DisplayHint, ResolvedFormField, ResolvedLink, Allowed, RowSummary, RowPicture, Viewer, ViewGallery, ResolvedColumn, RecordView } from '@marktiderman/genesis-core/resource-view';
|
|
7
|
+
import { b as InboxPageSlotMap, e as ScreenHeaderProps } from '../inbox-page-B7_Oi2fS.js';
|
|
8
|
+
import { InboxSwipeAction } from '@marktiderman/genesis-core/conversation';
|
|
8
9
|
import { ReadinessLabels } from '@marktiderman/genesis-core/resource';
|
|
9
10
|
import '@marktiderman/genesis-core/slots';
|
|
10
11
|
import 'react-native';
|
|
@@ -522,6 +523,12 @@ interface NativeResourceViewProps<T extends Row$1 = Row$1> extends NativeResourc
|
|
|
522
523
|
mode?: NativeResourceViewMode;
|
|
523
524
|
/** Columns in grid mode (React Native's FlatList name). Default 2. */
|
|
524
525
|
numColumns?: number;
|
|
526
|
+
/**
|
|
527
|
+
* With `mode="grid"`: overrides the view's `gallery` block, or adds one. With a gallery, grid mode
|
|
528
|
+
* draws a photo per row in justified rows (NativeGalleryGrid, the web's layout) in place of
|
|
529
|
+
* cards; a row without an image is a placeholder tile, and a press opens the row as a card's does.
|
|
530
|
+
*/
|
|
531
|
+
gallery?: Partial<ViewGallery>;
|
|
525
532
|
/**
|
|
526
533
|
* Draws each row (list) or card (grid) yourself, as the web's `renderCard`. Spread
|
|
527
534
|
* `card.pressableProps` on your Pressable for the press, long press and accessibility; the
|
|
@@ -627,6 +634,61 @@ declare function useNativeResourceViewMessages(): NativeResourceViewMessages;
|
|
|
627
634
|
/** Draw one value: the empty mark for no value or a value the row (or viewer) hides (`when`), else its hint's renderer. */
|
|
628
635
|
declare function useDisplayCell(): (column: ResolvedColumn<Record<string, unknown>>, row: Record<string, unknown>) => ReactNode;
|
|
629
636
|
|
|
637
|
+
/** The words NativeConflictSheet shows. The same keys as genesis-ui's `uiMessages.conflict`. */
|
|
638
|
+
interface NativeConflictSheetMessages {
|
|
639
|
+
/** `{noun}`: the record's noun ("task"). */
|
|
640
|
+
title: string;
|
|
641
|
+
description: string;
|
|
642
|
+
/** When their change already matches what was tried. */
|
|
643
|
+
same: string;
|
|
644
|
+
theirs: string;
|
|
645
|
+
mine: string;
|
|
646
|
+
/** An empty value in the comparison. */
|
|
647
|
+
empty: string;
|
|
648
|
+
/** Their value for a field their row as read here doesn't carry. */
|
|
649
|
+
unknown: string;
|
|
650
|
+
keepMine: string;
|
|
651
|
+
takeTheirs: string;
|
|
652
|
+
/** When "keep mine" failed for another reason (offline, refused). */
|
|
653
|
+
failed: string;
|
|
654
|
+
yes: string;
|
|
655
|
+
no: string;
|
|
656
|
+
/** The noun when the screen gave none. */
|
|
657
|
+
record: string;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Props for {@link NativeConflictSheet}.
|
|
661
|
+
*
|
|
662
|
+
* @stability Beta
|
|
663
|
+
*/
|
|
664
|
+
interface NativeConflictSheetProps {
|
|
665
|
+
/** The conflict to show (`writeConflict(error, values)`); null keeps it closed. */
|
|
666
|
+
conflict: WriteConflict | null;
|
|
667
|
+
/** The record's noun ("task"), for the title. */
|
|
668
|
+
noun?: string;
|
|
669
|
+
/** A field's label. Default: the field name, title-cased. */
|
|
670
|
+
label?: (field: string) => string;
|
|
671
|
+
/** A field's value as shown. Default: plain text. */
|
|
672
|
+
format?: (field: string, value: unknown) => ReactNode;
|
|
673
|
+
/** Save these values over theirs, at the version the conflict reported. The sheet waits for it. */
|
|
674
|
+
onKeepMine: () => void | Promise<void>;
|
|
675
|
+
/** Drop these values and show their row. */
|
|
676
|
+
onTakeTheirs: () => void;
|
|
677
|
+
/** Closed without choosing: the changes stay where they are, unsaved. */
|
|
678
|
+
onDismiss: () => void;
|
|
679
|
+
messages?: Partial<NativeConflictSheetMessages>;
|
|
680
|
+
testID?: string;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* The phone's ConflictSheet: when a save met someone else's change, a bottom
|
|
684
|
+
* sheet shows their value above the one this person tried to save, for each
|
|
685
|
+
* field where they differ, then "Take theirs" or "Keep mine".
|
|
686
|
+
* NativeRecordView's settings sections open it on a `conflict`.
|
|
687
|
+
*
|
|
688
|
+
* @stability Beta
|
|
689
|
+
*/
|
|
690
|
+
declare function NativeConflictSheet({ conflict, noun, label, format, onKeepMine, onTakeTheirs, onDismiss, messages, testID, }: NativeConflictSheetProps): react.JSX.Element;
|
|
691
|
+
|
|
630
692
|
type Row = Record<string, unknown>;
|
|
631
693
|
type AnyRecordView<T extends Row> = RecordView<ResourceContract<any>, T & DataRow>;
|
|
632
694
|
/**
|
|
@@ -649,6 +711,8 @@ interface NativeRecordViewMessages extends ReadinessLabels {
|
|
|
649
711
|
/** The back row of a section opened from the list of sections. */
|
|
650
712
|
allSections: string;
|
|
651
713
|
notANumber: string;
|
|
714
|
+
/** The conflict sheet's words (NativeConflictSheet's English when unset). */
|
|
715
|
+
conflict?: Partial<NativeConflictSheetMessages>;
|
|
652
716
|
}
|
|
653
717
|
declare const defaultNativeRecordViewMessages: NativeRecordViewMessages;
|
|
654
718
|
/** Up to this many sections show as a segmented control; more are pushed rows. */
|
|
@@ -747,4 +811,4 @@ declare const defaultNativeResourceWorkspaceMessages: NativeRecordViewMessages;
|
|
|
747
811
|
*/
|
|
748
812
|
declare function parseSettingNumber(text: string): number | null;
|
|
749
813
|
|
|
750
|
-
export { type AnyResourceView, DEFAULT_MAX_PAGES, type DisplayContext, type DisplayRenderer, type DisplayRenderers, DisplayRenderersProvider, type DisplayTimeZones, DisplayTimeZonesProvider, type NativeCardFieldDef, NativeDataFilters, type NativeDataFiltersProps, NativeDataPageShell, type NativeDataPageShellProps, type NativeDetailField, NativeDetailPanel, type NativeDetailPanelProps, NativeEmptyState, type NativeEmptyStateProps, type NativeFormField, type NativeFormFieldKind, NativeRecordView, type NativeRecordViewHeaderProps, NativeRecordViewMenu, type NativeRecordViewMessages, type NativeRecordViewProps, type NativeResourceCardActions, type NativeResourceCardPressableProps, NativeResourceForm, NativeResourceFormFieldRenderer, type NativeResourceFormFieldRendererProps, type NativeResourceFormProps, NativeResourceFormSheet, type NativeResourceFormSheetProps, NativeResourcePage, type NativeResourcePageProps, type NativeResourceRowItem, type NativeResourceScreenCan, type NativeResourceSection, type NativeResourceSwipeAction, type NativeResourceSwipeableProps, NativeResourceView, type NativeResourceViewMessages, NativeResourceViewMessagesProvider, type NativeResourceViewMode, type NativeResourceViewOptions, type NativeResourceViewProps, NativeResourceWorkspace, type NativeResourceWorkspaceHeaderProps, NativeResourceWorkspaceMenu, type NativeResourceWorkspaceMessages, type NativeResourceWorkspaceProps, SEARCH_DEBOUNCE_MS, SEGMENTED_SECTIONS_MAX, type SaveResult, type UseNativeResourceViewReturn, allowed, dateToDay, dayToDate, defaultNativeRecordViewMessages, defaultNativeResourceViewMessages, defaultNativeResourceWorkspaceMessages, displayText, formFieldsFor, formatDay, formatInstant, getNativeRecordViewStackOptions, getNativeResourceWorkspaceStackOptions, nativeDisplayRenderers, openableUrl, parseSettingNumber, resolveZone, rowItem, screenValues, sectionsFor, serverSort, serverSorts, swipeActionsFor, useDisplayCell, useDisplayTimeZones, useNativeResourceView, useNativeResourceViewMessages, validateValues, writableValues };
|
|
814
|
+
export { type AnyResourceView, DEFAULT_MAX_PAGES, type DisplayContext, type DisplayRenderer, type DisplayRenderers, DisplayRenderersProvider, type DisplayTimeZones, DisplayTimeZonesProvider, type NativeCardFieldDef, NativeConflictSheet, type NativeConflictSheetMessages, type NativeConflictSheetProps, NativeDataFilters, type NativeDataFiltersProps, NativeDataPageShell, type NativeDataPageShellProps, type NativeDetailField, NativeDetailPanel, type NativeDetailPanelProps, NativeEmptyState, type NativeEmptyStateProps, type NativeFormField, type NativeFormFieldKind, NativeRecordView, type NativeRecordViewHeaderProps, NativeRecordViewMenu, type NativeRecordViewMessages, type NativeRecordViewProps, type NativeResourceCardActions, type NativeResourceCardPressableProps, NativeResourceForm, NativeResourceFormFieldRenderer, type NativeResourceFormFieldRendererProps, type NativeResourceFormProps, NativeResourceFormSheet, type NativeResourceFormSheetProps, NativeResourcePage, type NativeResourcePageProps, type NativeResourceRowItem, type NativeResourceScreenCan, type NativeResourceSection, type NativeResourceSwipeAction, type NativeResourceSwipeableProps, NativeResourceView, type NativeResourceViewMessages, NativeResourceViewMessagesProvider, type NativeResourceViewMode, type NativeResourceViewOptions, type NativeResourceViewProps, NativeResourceWorkspace, type NativeResourceWorkspaceHeaderProps, NativeResourceWorkspaceMenu, type NativeResourceWorkspaceMessages, type NativeResourceWorkspaceProps, SEARCH_DEBOUNCE_MS, SEGMENTED_SECTIONS_MAX, type SaveResult, type UseNativeResourceViewReturn, allowed, dateToDay, dayToDate, defaultNativeRecordViewMessages, defaultNativeResourceViewMessages, defaultNativeResourceWorkspaceMessages, displayText, formFieldsFor, formatDay, formatInstant, getNativeRecordViewStackOptions, getNativeResourceWorkspaceStackOptions, nativeDisplayRenderers, openableUrl, parseSettingNumber, resolveZone, rowItem, screenValues, sectionsFor, serverSort, serverSorts, swipeActionsFor, useDisplayCell, useDisplayTimeZones, useNativeResourceView, useNativeResourceViewMessages, validateValues, writableValues };
|