convex-feedback-ui 0.1.5 → 0.1.6
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 +124 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/native/expo/ExpoFeedbackBody.d.ts +1 -1
- package/dist/native/expo/ExpoFeedbackBody.d.ts.map +1 -1
- package/dist/native/expo/ExpoFeedbackBody.js +2 -2
- package/dist/native/expo/ExpoFeedbackBody.js.map +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.d.ts +3 -0
- package/dist/native/expo/FeedbackCreateStackLayout.d.ts.map +1 -0
- package/dist/native/expo/FeedbackCreateStackLayout.js +35 -0
- package/dist/native/expo/FeedbackCreateStackLayout.js.map +1 -0
- package/dist/native/expo/FeedbackRoutes.d.ts +4 -0
- package/dist/native/expo/FeedbackRoutes.d.ts.map +1 -0
- package/dist/native/expo/FeedbackRoutes.js +76 -0
- package/dist/native/expo/FeedbackRoutes.js.map +1 -0
- package/dist/native/expo/FeedbackStack.d.ts +1 -1
- package/dist/native/expo/FeedbackStack.d.ts.map +1 -1
- package/dist/native/expo/FeedbackStack.js +4 -2
- package/dist/native/expo/FeedbackStack.js.map +1 -1
- package/dist/native/expo/FeedbackStackLayout.d.ts +3 -0
- package/dist/native/expo/FeedbackStackLayout.d.ts.map +1 -0
- package/dist/native/expo/FeedbackStackLayout.js +54 -0
- package/dist/native/expo/FeedbackStackLayout.js.map +1 -0
- package/dist/native/expo/RoutedFeedbackContext.d.ts +4 -0
- package/dist/native/expo/RoutedFeedbackContext.d.ts.map +1 -0
- package/dist/native/expo/RoutedFeedbackContext.js +11 -0
- package/dist/native/expo/RoutedFeedbackContext.js.map +1 -0
- package/dist/native/expo/RoutedFeedbackModalContext.d.ts +7 -0
- package/dist/native/expo/RoutedFeedbackModalContext.d.ts.map +1 -0
- package/dist/native/expo/RoutedFeedbackModalContext.js +7 -0
- package/dist/native/expo/RoutedFeedbackModalContext.js.map +1 -0
- package/dist/native/expo/index.d.ts +4 -0
- package/dist/native/expo/index.d.ts.map +1 -1
- package/dist/native/expo/index.js +4 -0
- package/dist/native/expo/index.js.map +1 -1
- package/dist/native/expo/routes.d.ts +16 -0
- package/dist/native/expo/routes.d.ts.map +1 -0
- package/dist/native/expo/routes.js +23 -0
- package/dist/native/expo/routes.js.map +1 -0
- package/dist/native/expo/types.d.ts +51 -1
- package/dist/native/expo/types.d.ts.map +1 -1
- package/dist/native/shared/ui/FeedbackScreenList.d.ts +1 -1
- package/dist/native/shared/ui/FeedbackScreenList.d.ts.map +1 -1
- package/dist/native/shared/ui/FeedbackScreenList.js +2 -2
- package/dist/native/shared/ui/FeedbackScreenList.js.map +1 -1
- package/dist/native/shared/ui/NewEntry.d.ts +10 -0
- package/dist/native/shared/ui/NewEntry.d.ts.map +1 -1
- package/dist/native/shared/ui/NewEntry.js +2 -2
- package/dist/native/shared/ui/NewEntry.js.map +1 -1
- package/dist/shared/types/screen.d.ts +4 -0
- package/dist/shared/types/screen.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/native/expo/ExpoFeedbackBody.tsx +6 -1
- package/src/native/expo/FeedbackCreateStackLayout.tsx +62 -0
- package/src/native/expo/FeedbackRoutes.tsx +204 -0
- package/src/native/expo/FeedbackStack.tsx +16 -4
- package/src/native/expo/FeedbackStackLayout.tsx +116 -0
- package/src/native/expo/README.md +24 -0
- package/src/native/expo/RoutedFeedbackContext.tsx +20 -0
- package/src/native/expo/RoutedFeedbackModalContext.tsx +14 -0
- package/src/native/expo/index.ts +4 -0
- package/src/native/expo/routes.ts +41 -0
- package/src/native/expo/types.ts +63 -1
- package/src/native/shared/ui/FeedbackScreenList.tsx +2 -1
- package/src/native/shared/ui/NewEntry.tsx +2 -2
- package/src/shared/types/screen.ts +4 -0
package/README.md
CHANGED
|
@@ -121,6 +121,20 @@ Stack options can be customized through `StackOptions`:
|
|
|
121
121
|
/>
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
+
iOS toolbar actions keep their package-provided SF Symbols. Android accepts
|
|
125
|
+
host-provided image sources; when an image is omitted, the action falls back to
|
|
126
|
+
its text label:
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
<FeedbackScreen
|
|
130
|
+
hooks={feedbackHooks}
|
|
131
|
+
androidToolbarIcons={{
|
|
132
|
+
create: require("./assets/add.png"),
|
|
133
|
+
back: require("./assets/back.png"),
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
```
|
|
137
|
+
|
|
124
138
|
### Using the Expo screen without stack integration
|
|
125
139
|
|
|
126
140
|
Expo projects do not have to use the native stack integration.
|
|
@@ -135,6 +149,116 @@ When `useStack={false}`, the Expo convenience screen behaves like the regular Re
|
|
|
135
149
|
|
|
136
150
|
`StackOptions` is only available when stack integration is enabled.
|
|
137
151
|
|
|
152
|
+
### Routed Expo navigation
|
|
153
|
+
|
|
154
|
+
For real stacked routes, use the additive routed API. Expo Router discovers
|
|
155
|
+
routes from the application's `app` directory, so the host application supplies
|
|
156
|
+
small route files while the package supplies their layouts and screens:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
app/feedback/
|
|
160
|
+
├── _layout.tsx
|
|
161
|
+
├── index.tsx
|
|
162
|
+
├── [entryId].tsx
|
|
163
|
+
└── new/
|
|
164
|
+
├── _layout.tsx
|
|
165
|
+
├── index.tsx
|
|
166
|
+
└── [entryId].tsx
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The layout owns the feedback providers and keeps them mounted across the board,
|
|
170
|
+
entry-detail, and create-entry routes:
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
// app/feedback/_layout.tsx
|
|
174
|
+
import {
|
|
175
|
+
FeedbackStackLayout,
|
|
176
|
+
feedbackStackSettings,
|
|
177
|
+
} from "convex-feedback-ui/expo";
|
|
178
|
+
import { feedbackHooks } from "../../feedback";
|
|
179
|
+
|
|
180
|
+
export const unstable_settings = feedbackStackSettings;
|
|
181
|
+
|
|
182
|
+
export default function Layout() {
|
|
183
|
+
return (
|
|
184
|
+
<FeedbackStackLayout
|
|
185
|
+
hooks={feedbackHooks}
|
|
186
|
+
androidToolbarIcons={{
|
|
187
|
+
create: require("../../assets/add.png"),
|
|
188
|
+
back: require("../../assets/back.png"),
|
|
189
|
+
close: require("../../assets/close.png"),
|
|
190
|
+
}}
|
|
191
|
+
screenOptions={{ headerTintColor: "#5b5bd6" }}
|
|
192
|
+
boardOptions={{ headerLargeTitleEnabled: true }}
|
|
193
|
+
entryOptions={{ headerBackTitle: "Feedback" }}
|
|
194
|
+
createOptions={{ presentation: "formSheet" }}
|
|
195
|
+
/>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Each page file only needs to re-export its package screen:
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
// app/feedback/index.tsx
|
|
204
|
+
export { FeedbackBoardScreen as default } from "convex-feedback-ui/expo";
|
|
205
|
+
|
|
206
|
+
// app/feedback/[entryId].tsx
|
|
207
|
+
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
208
|
+
|
|
209
|
+
// app/feedback/new/_layout.tsx
|
|
210
|
+
import {
|
|
211
|
+
FeedbackCreateStackLayout,
|
|
212
|
+
feedbackCreateStackSettings,
|
|
213
|
+
} from "convex-feedback-ui/expo";
|
|
214
|
+
|
|
215
|
+
export const unstable_settings = feedbackCreateStackSettings;
|
|
216
|
+
export default FeedbackCreateStackLayout;
|
|
217
|
+
|
|
218
|
+
// app/feedback/new/index.tsx
|
|
219
|
+
export { CreateFeedbackScreen as default } from "convex-feedback-ui/expo";
|
|
220
|
+
|
|
221
|
+
// app/feedback/new/[entryId].tsx
|
|
222
|
+
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`FeedbackStackLayout` uses these route names by default:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
{
|
|
229
|
+
board: "index",
|
|
230
|
+
entry: "[entryId]",
|
|
231
|
+
create: "new",
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Names can be partially overridden when the files use a different structure.
|
|
236
|
+
The create name identifies its nested route directory, and the entry route must
|
|
237
|
+
exist both beside that directory and inside it while retaining the `[entryId]`
|
|
238
|
+
dynamic segment:
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
const routes = {
|
|
242
|
+
entry: "entry/[entryId]",
|
|
243
|
+
create: "create",
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export const unstable_settings = createFeedbackStackSettings(routes);
|
|
247
|
+
|
|
248
|
+
export default function Layout() {
|
|
249
|
+
return <FeedbackStackLayout hooks={feedbackHooks} routes={routes} />;
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The board's search and loaded list remain mounted when another screen is
|
|
254
|
+
pushed, so returning restores the prior query and scroll position. The create
|
|
255
|
+
route is a modal navigator by default. Duplicate suggestions push the normal
|
|
256
|
+
detail screen inside that modal's stack, with back and close controls. After
|
|
257
|
+
creation, the complete modal is dismissed and the created entry replaces it on
|
|
258
|
+
the board stack.
|
|
259
|
+
|
|
260
|
+
See `packages/example-expo-routed` for a complete application.
|
|
261
|
+
|
|
138
262
|
## Diagnostic metadata
|
|
139
263
|
|
|
140
264
|
Prebuilt screens can collect creation-time diagnostic metadata for feedback entries. Collection is disabled by default and never applies to comments.
|