convex-feedback-ui 0.2.0-beta.5 → 0.2.0-beta.7
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 +38 -17
- package/dist/.tsbuildinfo +1 -1
- package/dist/native/expo/EditEntryScreen.d.ts +11 -0
- package/dist/native/expo/EditEntryScreen.d.ts.map +1 -0
- package/dist/native/expo/EditEntryScreen.js +54 -0
- package/dist/native/expo/EditEntryScreen.js.map +1 -0
- package/dist/native/expo/ExpoFeedbackBody.d.ts.map +1 -1
- package/dist/native/expo/ExpoFeedbackBody.js +1 -1
- package/dist/native/expo/ExpoFeedbackBody.js.map +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.d.ts +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.d.ts.map +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.js +8 -15
- package/dist/native/expo/FeedbackCreateStackLayout.js.map +1 -1
- package/dist/native/expo/FeedbackRoutes.d.ts +1 -0
- package/dist/native/expo/FeedbackRoutes.d.ts.map +1 -1
- package/dist/native/expo/FeedbackRoutes.js +32 -9
- package/dist/native/expo/FeedbackRoutes.js.map +1 -1
- 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 +42 -10
- package/dist/native/expo/FeedbackStack.js.map +1 -1
- package/dist/native/expo/FeedbackStackLayout.d.ts +1 -1
- package/dist/native/expo/FeedbackStackLayout.d.ts.map +1 -1
- package/dist/native/expo/FeedbackStackLayout.js +10 -1
- package/dist/native/expo/FeedbackStackLayout.js.map +1 -1
- package/dist/native/expo/RoadmapRoutes.d.ts +8 -0
- package/dist/native/expo/RoadmapRoutes.d.ts.map +1 -1
- package/dist/native/expo/RoadmapRoutes.js +16 -6
- package/dist/native/expo/RoadmapRoutes.js.map +1 -1
- package/dist/native/expo/RoadmapScreen.d.ts +13 -0
- package/dist/native/expo/RoadmapScreen.d.ts.map +1 -1
- package/dist/native/expo/RoadmapScreen.js +6 -4
- package/dist/native/expo/RoadmapScreen.js.map +1 -1
- package/dist/native/expo/RoadmapStackLayout.d.ts +8 -1
- package/dist/native/expo/RoadmapStackLayout.d.ts.map +1 -1
- package/dist/native/expo/RoadmapStackLayout.js +11 -1
- package/dist/native/expo/RoadmapStackLayout.js.map +1 -1
- package/dist/native/expo/index.d.ts +1 -0
- package/dist/native/expo/index.d.ts.map +1 -1
- package/dist/native/expo/index.js +1 -0
- package/dist/native/expo/index.js.map +1 -1
- package/dist/native/expo/routes.d.ts +5 -1
- package/dist/native/expo/routes.d.ts.map +1 -1
- package/dist/native/expo/routes.js +32 -2
- package/dist/native/expo/routes.js.map +1 -1
- package/dist/native/expo/stackInsets.d.ts +19 -0
- package/dist/native/expo/stackInsets.d.ts.map +1 -0
- package/dist/native/expo/stackInsets.js +32 -0
- package/dist/native/expo/stackInsets.js.map +1 -0
- package/dist/native/expo/types.d.ts +29 -3
- package/dist/native/expo/types.d.ts.map +1 -1
- package/dist/native/expo/useStackHeaderHeight.d.ts +10 -0
- package/dist/native/expo/useStackHeaderHeight.d.ts.map +1 -0
- package/dist/native/expo/useStackHeaderHeight.js +25 -0
- package/dist/native/expo/useStackHeaderHeight.js.map +1 -0
- package/dist/native/shared/helpers.d.ts +5 -1
- package/dist/native/shared/helpers.d.ts.map +1 -1
- package/dist/native/shared/helpers.js +7 -3
- package/dist/native/shared/helpers.js.map +1 -1
- package/dist/native/shared/ui/BodyContent.d.ts +1 -1
- package/dist/native/shared/ui/BodyContent.d.ts.map +1 -1
- package/dist/native/shared/ui/BodyContent.js +2 -2
- package/dist/native/shared/ui/BodyContent.js.map +1 -1
- package/dist/native/shared/ui/EditEntry.d.ts +22 -0
- package/dist/native/shared/ui/EditEntry.d.ts.map +1 -0
- package/dist/native/shared/ui/EditEntry.js +112 -0
- package/dist/native/shared/ui/EditEntry.js.map +1 -0
- package/dist/native/shared/ui/EntryDetail.d.ts +1 -1
- package/dist/native/shared/ui/EntryDetail.d.ts.map +1 -1
- package/dist/native/shared/ui/EntryDetail.js +9 -2
- package/dist/native/shared/ui/EntryDetail.js.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/RoadmapBoard.d.ts +15 -25
- package/dist/native/shared/ui/RoadmapBoard.d.ts.map +1 -1
- package/dist/native/shared/ui/RoadmapBoard.js +9 -19
- package/dist/native/shared/ui/RoadmapBoard.js.map +1 -1
- package/dist/native/shared/ui/RoadmapScreen.d.ts +24 -7
- package/dist/native/shared/ui/RoadmapScreen.d.ts.map +1 -1
- package/dist/native/shared/ui/RoadmapScreen.js +12 -6
- package/dist/native/shared/ui/RoadmapScreen.js.map +1 -1
- package/dist/native/shared/ui/primitives.d.ts +1 -1
- package/dist/native/shared/ui/primitives.d.ts.map +1 -1
- package/dist/native/shared/ui/primitives.js +6 -3
- package/dist/native/shared/ui/primitives.js.map +1 -1
- package/dist/react/css.d.ts +1 -0
- package/dist/react/css.d.ts.map +1 -1
- package/dist/react/css.js +1 -0
- package/dist/react/css.js.map +1 -1
- package/dist/react/primitives.d.ts +1 -1
- package/dist/react/primitives.d.ts.map +1 -1
- package/dist/react/primitives.js +2 -1
- package/dist/react/primitives.js.map +1 -1
- package/dist/react/screen.d.ts.map +1 -1
- package/dist/react/screen.js +41 -2
- package/dist/react/screen.js.map +1 -1
- package/dist/react/styles.css +41 -1
- package/dist/shared/messages.d.ts.map +1 -1
- package/dist/shared/messages.js +7 -0
- package/dist/shared/messages.js.map +1 -1
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +1 -0
- package/dist/shared/theme.js.map +1 -1
- package/dist/shared/types/context.d.ts +2 -0
- package/dist/shared/types/context.d.ts.map +1 -1
- package/dist/shared/types/messages.d.ts +16 -2
- package/dist/shared/types/messages.d.ts.map +1 -1
- package/dist/shared/types/screen.d.ts +6 -2
- package/dist/shared/types/screen.d.ts.map +1 -1
- package/dist/shared/types/theme.d.ts +2 -0
- package/dist/shared/types/theme.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/native/expo/EditEntryScreen.tsx +159 -0
- package/src/native/expo/ExpoFeedbackBody.tsx +2 -0
- package/src/native/expo/FeedbackCreateStackLayout.tsx +0 -12
- package/src/native/expo/FeedbackRoutes.tsx +63 -13
- package/src/native/expo/FeedbackStack.tsx +70 -4
- package/src/native/expo/FeedbackStackLayout.tsx +15 -0
- package/src/native/expo/README.md +52 -6
- package/src/native/expo/RoadmapRoutes.tsx +28 -7
- package/src/native/expo/RoadmapScreen.tsx +34 -6
- package/src/native/expo/RoadmapStackLayout.tsx +13 -0
- package/src/native/expo/index.ts +1 -0
- package/src/native/expo/routes.ts +44 -2
- package/src/native/expo/stackInsets.ts +42 -0
- package/src/native/expo/types.ts +29 -3
- package/src/native/expo/useStackHeaderHeight.ts +41 -0
- package/src/native/native/README.md +9 -3
- package/src/native/shared/helpers.ts +15 -3
- package/src/native/shared/ui/BodyContent.tsx +2 -0
- package/src/native/shared/ui/EditEntry.tsx +297 -0
- package/src/native/shared/ui/EntryDetail.tsx +28 -1
- package/src/native/shared/ui/FeedbackScreenList.tsx +2 -0
- package/src/native/shared/ui/RoadmapBoard.tsx +19 -43
- package/src/native/shared/ui/RoadmapScreen.tsx +32 -9
- package/src/native/shared/ui/primitives.tsx +6 -2
- package/src/react/css.tsx +2 -0
- package/src/react/primitives.tsx +2 -0
- package/src/react/screen.tsx +143 -5
- package/src/react/styles.css +41 -1
- package/src/shared/README.md +3 -1
- package/src/shared/messages.ts +7 -0
- package/src/shared/theme.ts +1 -0
- package/src/shared/types/context.ts +3 -0
- package/src/shared/types/messages.ts +23 -2
- package/src/shared/types/screen.ts +8 -2
- package/src/shared/types/theme.ts +3 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
     
|
|
2
2
|
|
|
3
3
|
[Vite demo](https://convex-feedback-vite.vercel.app/) • [Expo demo](https://convex-feedback-expo.vercel.app/) • [React Native demo](https://convex-feedback-native.vercel.app/)
|
|
4
4
|
|
|
@@ -61,6 +61,11 @@ The default stylesheet:
|
|
|
61
61
|
- allows normal host CSS, Tailwind, or CSS-module classes to override defaults;
|
|
62
62
|
- can be omitted entirely if you want to provide your own styling.
|
|
63
63
|
|
|
64
|
+
On entry detail, the prebuilt feedback screens show an Edit action only when the server identifies the current viewer as the entry author. The form edits the title and details; entry type remains admin-controlled. The backend rechecks authorship when the update mutation runs, so hiding the action is
|
|
65
|
+
only a presentation convenience and is not the authorization boundary. Stack-enabled Expo screens place this action in the native right toolbar; non-stacked native screens keep it alongside the entry details.
|
|
66
|
+
|
|
67
|
+
In stack mode, opening the action pushes a native form-sheet editor on iOS (and a modal stack screen on Android) with cancel and save controls in the top toolbar. Edit-screen copy is configurable through `messages.form`.
|
|
68
|
+
|
|
64
69
|
Key colors can be overridden directly:
|
|
65
70
|
|
|
66
71
|
```tsx
|
|
@@ -69,6 +74,7 @@ Key colors can be overridden directly:
|
|
|
69
74
|
primaryColor="#6d5efc"
|
|
70
75
|
backgroundColor="#0d0d10"
|
|
71
76
|
surfaceColor="#17171b"
|
|
77
|
+
inputColor="#1f1f25"
|
|
72
78
|
textColor="#ffffff"
|
|
73
79
|
mutedColor="#a0a0aa"
|
|
74
80
|
borderColor="#2d2d34"
|
|
@@ -91,6 +97,7 @@ import { FeedbackScreen } from "convex-feedback-ui/native";
|
|
|
91
97
|
primary: "#6d5efc",
|
|
92
98
|
background: "#ffffff",
|
|
93
99
|
surface: "#ffffff",
|
|
100
|
+
input: "#f7f7fa",
|
|
94
101
|
},
|
|
95
102
|
}}
|
|
96
103
|
/>;
|
|
@@ -98,6 +105,8 @@ import { FeedbackScreen } from "convex-feedback-ui/native";
|
|
|
98
105
|
|
|
99
106
|
The native `FeedbackScreen` includes the feedback UI using React Native components.
|
|
100
107
|
|
|
108
|
+
The native roadmap exports also include the reusable `RoadmapBoard` and `RoadmapScreenContent`. Their `topInset` defaults to `0`, while `bottomInset` defaults to the bottom safe-area inset. These props describe space occupied by host navigation chrome: an explicit `bottomInset` is the total space, including the safe area, and replaces the default even when set to `0`. NativeTabs normally bounds content above its tab bar, so it should be left unset there.
|
|
109
|
+
|
|
101
110
|
## Expo Router
|
|
102
111
|
|
|
103
112
|
Expo Router projects can use the `/expo` entry point:
|
|
@@ -112,6 +121,7 @@ import { FeedbackScreen } from "convex-feedback-ui/expo";
|
|
|
112
121
|
primary: "#6d5efc",
|
|
113
122
|
background: "#ffffff",
|
|
114
123
|
surface: "#ffffff",
|
|
124
|
+
input: "#f7f7fa",
|
|
115
125
|
},
|
|
116
126
|
}}
|
|
117
127
|
/>;
|
|
@@ -159,11 +169,19 @@ its text label:
|
|
|
159
169
|
hooks={feedbackHooks}
|
|
160
170
|
androidToolbarIcons={{
|
|
161
171
|
create: require("./assets/add.png"),
|
|
172
|
+
edit: require("./assets/edit.png"),
|
|
173
|
+
save: require("./assets/check.png"),
|
|
162
174
|
back: require("./assets/back.png"),
|
|
163
175
|
}}
|
|
164
176
|
/>
|
|
165
177
|
```
|
|
166
178
|
|
|
179
|
+
### Roadmap stack insets
|
|
180
|
+
|
|
181
|
+
The stack-enabled Expo `RoadmapScreen` and routed `RoadmapStackLayout` use a transparent native header by default. The board automatically reserves the measured native-stack header height; if that context is unavailable, the fallback is 44 points on iOS or 56 points on Android, plus the top safe-area inset. If `headerTransparent` is `false`, the native stack already places the board below the header and the automatic top inset is `0`. Set `topInset` to override that space, including with `0`.
|
|
182
|
+
|
|
183
|
+
The routed and stack-enabled roadmap also renders its native bottom search toolbar on iOS 26 and newer and includes its standard 44-point height in the default `bottomInset`. Android and older iOS versions do not receive an empty toolbar. If your host draws a toolbar or tab bar over the screen, pass `bottomInset` as the total occupied height, including the safe area; an explicit value replaces the automatic default, including `0`. NativeTabs content is already bounded above the tab bar, so omit `bottomInset` there.
|
|
184
|
+
|
|
167
185
|
### Using the Expo screen without stack integration
|
|
168
186
|
|
|
169
187
|
Expo projects do not have to use the native stack integration.
|
|
@@ -188,11 +206,12 @@ small route files while the package supplies their layouts and screens:
|
|
|
188
206
|
app/feedback/
|
|
189
207
|
├── _layout.tsx
|
|
190
208
|
├── index.tsx
|
|
191
|
-
├── [entryId]
|
|
209
|
+
├── [entryId]/
|
|
210
|
+
│ ├── index.tsx
|
|
211
|
+
│ └── edit.tsx
|
|
192
212
|
└── new/
|
|
193
213
|
├── _layout.tsx
|
|
194
|
-
|
|
195
|
-
└── [entryId].tsx
|
|
214
|
+
└── index.tsx
|
|
196
215
|
```
|
|
197
216
|
|
|
198
217
|
The layout owns the feedback providers and keeps them mounted across the board,
|
|
@@ -214,6 +233,8 @@ export default function Layout() {
|
|
|
214
233
|
hooks={feedbackHooks}
|
|
215
234
|
androidToolbarIcons={{
|
|
216
235
|
create: require("../../assets/add.png"),
|
|
236
|
+
edit: require("../../assets/edit.png"),
|
|
237
|
+
save: require("../../assets/check.png"),
|
|
217
238
|
back: require("../../assets/back.png"),
|
|
218
239
|
close: require("../../assets/close.png"),
|
|
219
240
|
}}
|
|
@@ -232,9 +253,12 @@ Each page file only needs to re-export its package screen:
|
|
|
232
253
|
// app/feedback/index.tsx
|
|
233
254
|
export { FeedbackBoardScreen as default } from "convex-feedback-ui/expo";
|
|
234
255
|
|
|
235
|
-
// app/feedback/[entryId].tsx
|
|
256
|
+
// app/feedback/[entryId]/index.tsx
|
|
236
257
|
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
237
258
|
|
|
259
|
+
// app/feedback/[entryId]/edit.tsx
|
|
260
|
+
export { FeedbackEditScreen as default } from "convex-feedback-ui/expo";
|
|
261
|
+
|
|
238
262
|
// app/feedback/new/_layout.tsx
|
|
239
263
|
import {
|
|
240
264
|
FeedbackCreateStackLayout,
|
|
@@ -246,9 +270,6 @@ export default FeedbackCreateStackLayout;
|
|
|
246
270
|
|
|
247
271
|
// app/feedback/new/index.tsx
|
|
248
272
|
export { CreateFeedbackScreen as default } from "convex-feedback-ui/expo";
|
|
249
|
-
|
|
250
|
-
// app/feedback/new/[entryId].tsx
|
|
251
|
-
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
252
273
|
```
|
|
253
274
|
|
|
254
275
|
`FeedbackStackLayout` uses these route names by default:
|
|
@@ -257,18 +278,20 @@ export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
|
257
278
|
{
|
|
258
279
|
board: "index",
|
|
259
280
|
entry: "[entryId]",
|
|
281
|
+
edit: "[entryId]/edit",
|
|
260
282
|
create: "new",
|
|
261
283
|
}
|
|
262
284
|
```
|
|
263
285
|
|
|
264
286
|
Names can be partially overridden when the files use a different structure.
|
|
265
287
|
The create name identifies its nested route directory, and the entry route must
|
|
266
|
-
|
|
267
|
-
|
|
288
|
+
retain the `[entryId]` dynamic segment. The edit route must be nested beneath
|
|
289
|
+
the entry route:
|
|
268
290
|
|
|
269
291
|
```tsx
|
|
270
292
|
const routes = {
|
|
271
293
|
entry: "entry/[entryId]",
|
|
294
|
+
edit: "entry/[entryId]/edit",
|
|
272
295
|
create: "create",
|
|
273
296
|
};
|
|
274
297
|
|
|
@@ -279,12 +302,7 @@ export default function Layout() {
|
|
|
279
302
|
}
|
|
280
303
|
```
|
|
281
304
|
|
|
282
|
-
The board's search and loaded list remain mounted when another screen is
|
|
283
|
-
pushed, so returning restores the prior query and scroll position. The create
|
|
284
|
-
route is a modal navigator by default. Duplicate suggestions push the normal
|
|
285
|
-
detail screen inside that modal's stack, with back and close controls. After
|
|
286
|
-
creation, the complete modal is dismissed and the created entry replaces it on
|
|
287
|
-
the board stack.
|
|
305
|
+
The board's search and loaded list remain mounted when another screen is pushed, so returning restores the prior query and scroll position. The create route is a modal navigator by default. Duplicate suggestions push the main entry-detail route, with the create modal remaining available behind it. After creation, the complete modal is dismissed and the created entry replaces it on the board stack.
|
|
288
306
|
|
|
289
307
|
See `packages/example-expo-routed` for a complete application.
|
|
290
308
|
|
|
@@ -328,6 +346,10 @@ entry route is supplied. The board title and search field are rendered by the
|
|
|
328
346
|
Expo Router Stack, and `RoadmapBoard` is exported from the native entry points
|
|
329
347
|
for sharing the admin-style stage layout with custom cards.
|
|
330
348
|
|
|
349
|
+
On this routed stack, `topInset` and `bottomInset` can be supplied on
|
|
350
|
+
`RoadmapStackLayout` to replace the automatic header and bottom-toolbar
|
|
351
|
+
spacing.
|
|
352
|
+
|
|
331
353
|
## Diagnostic metadata
|
|
332
354
|
|
|
333
355
|
Prebuilt screens can collect creation-time diagnostic metadata for feedback entries. Collection is disabled by default and never applies to comments.
|
|
@@ -367,7 +389,6 @@ Or combine global defaults with per-kind behavior:
|
|
|
367
389
|
- A kind set to `false` disables all metadata collection for that kind.
|
|
368
390
|
- Collection happens only when the user finally submits.
|
|
369
391
|
- Unavailable or failed collection sources are omitted without blocking feedback submission.
|
|
370
|
-
|
|
371
392
|
- Web defaults include `platform`, `user agent`, `language`, `timezone`, `screen` and `viewport` dimensions, and `device pixel ratio`.
|
|
372
393
|
- React Native defaults include `platform`, `OS` version, available device model, screen `dimensions`, `pixel ratio`, and `font scale`.
|
|
373
394
|
- The Expo entry point additionally uses `expo-constants` for app `version`, `build` number, `application ID`, `Expo runtime version`, and execution `environment` when available.
|