@marktiderman/genesis-ui-native 3.4.0 → 3.5.1
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 +24 -0
- package/dist/{chunk-VZ3PQLZ4.js → chunk-ABVSSJNT.js} +3 -3
- package/dist/{chunk-VZ3PQLZ4.js.map → chunk-ABVSSJNT.js.map} +1 -1
- package/dist/{chunk-ZHVQTMNV.js → chunk-ONH2PCGH.js} +7 -4
- package/dist/chunk-ONH2PCGH.js.map +1 -0
- package/dist/data/index.d.ts +62 -2
- package/dist/data/index.js +205 -64
- package/dist/data/index.js.map +1 -1
- package/dist/{inbox-page-DZUR-PJ1.d.ts → inbox-page-BEarNEIP.d.ts} +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/index.d.ts +2 -2
- package/dist/layouts/index.js +2 -2
- package/package.json +2 -2
- package/src/data/resource-view/NativeLinkPicker.tsx +1 -1
- package/src/data/resource-view/NativeRecordView.tsx +15 -5
- package/src/data/resource-view/NativeResourceView.tsx +296 -50
- package/src/data/resource-view/__tests__/native-link-picker.test.tsx +16 -0
- package/src/data/resource-view/__tests__/native-record-view.test.tsx +11 -0
- package/src/data/resource-view/__tests__/native-resource-view-delete.test.tsx +171 -0
- package/src/data/resource-view/__tests__/native-resource-view.test.tsx +226 -2
- package/src/data/resource-view/index.ts +8 -1
- package/src/data/resource-view/mapping.ts +3 -0
- package/src/data/resource-view/use-native-resource-view.ts +41 -3
- package/src/layouts/__tests__/screen-container.test.tsx +51 -2
- package/src/layouts/screen-container.tsx +20 -1
- package/dist/chunk-ZHVQTMNV.js.map +0 -1
package/README.md
CHANGED
|
@@ -82,6 +82,30 @@ A route whose only screen is a full-screen `NativeLoadingState` (a redirect or l
|
|
|
82
82
|
optionally with `Stack.Screen` options) counts as a screen for `native-screen-layout`; one that
|
|
83
83
|
also renders other content, imports it, or uses `fullScreen={false}` still needs a layout.
|
|
84
84
|
|
|
85
|
+
## Pull to refresh: `ScreenContainer onRefresh`
|
|
86
|
+
|
|
87
|
+
A screen that isn't a list (a dashboard, a profile) gets pull to refresh from its container, as
|
|
88
|
+
`InboxPage` and `NotificationsPage` have it. `onRefresh` puts a theme-tinted `NativeRefreshControl`
|
|
89
|
+
on the body; `refreshing` shows the spinner. Pulling needs a scroll view, so `onRefresh` makes the
|
|
90
|
+
body scroll (as `scroll` does). Without `onRefresh` nothing changes.
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { ScreenContainer } from "@marktiderman/genesis-ui-native";
|
|
94
|
+
|
|
95
|
+
<ScreenContainer onRefresh={() => refetch()} refreshing={isRefetching}>{body}</ScreenContainer>;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Never use it around a list (`FlatList`, `SectionList`, `NativeResourceView`, `InboxPage`): a list
|
|
99
|
+
inside a ScrollView stops virtualizing and React Native warns. Those lists have their own pull to
|
|
100
|
+
refresh (`refreshControl`, or built in).
|
|
101
|
+
|
|
102
|
+
## Lists as cards: `NativeResourceView mode="grid"` and `renderCard`
|
|
103
|
+
|
|
104
|
+
`NativeResourceView` draws a view as cards with `mode="grid"` (`numColumns`, default 2), and an
|
|
105
|
+
app's own row or card with `renderCard(row, index, card)`; spread `card.pressableProps` on its
|
|
106
|
+
Pressable for the built-in press, long press and accessibility. Sections, paging, refresh, the
|
|
107
|
+
empty state and swipe actions stay. See docs/RESOURCE-VIEW.md, "Cards and custom rows".
|
|
108
|
+
|
|
85
109
|
## Keyboard toolbar
|
|
86
110
|
|
|
87
111
|
`KeyboardScrollProvider` (from `/layouts`) takes an optional `toolbar`: react-native-keyboard-controller's
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-
|
|
1
|
+
import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-ONH2PCGH.js';
|
|
2
2
|
import { NativeText, NativeListItem, NativeButton, useGenesisModules, NativeSectionListHeader, NativeEmptyState, NativeInput } from './chunk-6KWEAGRD.js';
|
|
3
3
|
import { useThemeRoles, useThemeMode } from './chunk-Z3AQYVUA.js';
|
|
4
4
|
import { cn } from './chunk-OHZD7KRO.js';
|
|
@@ -1119,5 +1119,5 @@ function googleProvider({ onPress, label = "Continue with Google", icon, disable
|
|
|
1119
1119
|
}
|
|
1120
1120
|
|
|
1121
1121
|
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NotificationsPage, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar };
|
|
1122
|
-
//# sourceMappingURL=chunk-
|
|
1123
|
-
//# sourceMappingURL=chunk-
|
|
1122
|
+
//# sourceMappingURL=chunk-ABVSSJNT.js.map
|
|
1123
|
+
//# sourceMappingURL=chunk-ABVSSJNT.js.map
|