convex-feedback-ui 0.2.0-beta.6 → 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 +25 -10
- 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/RoadmapScreen.js +2 -2
- package/dist/native/expo/RoadmapScreen.js.map +1 -1
- package/dist/native/expo/RoadmapStackLayout.d.ts +1 -1
- package/dist/native/expo/RoadmapStackLayout.d.ts.map +1 -1
- package/dist/native/expo/RoadmapStackLayout.js +2 -1
- package/dist/native/expo/RoadmapStackLayout.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/types.d.ts +10 -3
- package/dist/native/expo/types.d.ts.map +1 -1
- 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/RoadmapScreen.d.ts +1 -1
- package/dist/native/shared/ui/RoadmapScreen.d.ts.map +1 -1
- 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 +15 -6
- package/src/native/expo/RoadmapScreen.tsx +2 -0
- package/src/native/expo/RoadmapStackLayout.tsx +2 -0
- package/src/native/expo/routes.ts +44 -2
- package/src/native/expo/types.ts +10 -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/RoadmapScreen.tsx +1 -0
- 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
|
@@ -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
|
/>;
|
|
@@ -114,6 +121,7 @@ import { FeedbackScreen } from "convex-feedback-ui/expo";
|
|
|
114
121
|
primary: "#6d5efc",
|
|
115
122
|
background: "#ffffff",
|
|
116
123
|
surface: "#ffffff",
|
|
124
|
+
input: "#f7f7fa",
|
|
117
125
|
},
|
|
118
126
|
}}
|
|
119
127
|
/>;
|
|
@@ -161,6 +169,8 @@ its text label:
|
|
|
161
169
|
hooks={feedbackHooks}
|
|
162
170
|
androidToolbarIcons={{
|
|
163
171
|
create: require("./assets/add.png"),
|
|
172
|
+
edit: require("./assets/edit.png"),
|
|
173
|
+
save: require("./assets/check.png"),
|
|
164
174
|
back: require("./assets/back.png"),
|
|
165
175
|
}}
|
|
166
176
|
/>
|
|
@@ -196,11 +206,12 @@ small route files while the package supplies their layouts and screens:
|
|
|
196
206
|
app/feedback/
|
|
197
207
|
├── _layout.tsx
|
|
198
208
|
├── index.tsx
|
|
199
|
-
├── [entryId]
|
|
209
|
+
├── [entryId]/
|
|
210
|
+
│ ├── index.tsx
|
|
211
|
+
│ └── edit.tsx
|
|
200
212
|
└── new/
|
|
201
213
|
├── _layout.tsx
|
|
202
|
-
|
|
203
|
-
└── [entryId].tsx
|
|
214
|
+
└── index.tsx
|
|
204
215
|
```
|
|
205
216
|
|
|
206
217
|
The layout owns the feedback providers and keeps them mounted across the board,
|
|
@@ -222,6 +233,8 @@ export default function Layout() {
|
|
|
222
233
|
hooks={feedbackHooks}
|
|
223
234
|
androidToolbarIcons={{
|
|
224
235
|
create: require("../../assets/add.png"),
|
|
236
|
+
edit: require("../../assets/edit.png"),
|
|
237
|
+
save: require("../../assets/check.png"),
|
|
225
238
|
back: require("../../assets/back.png"),
|
|
226
239
|
close: require("../../assets/close.png"),
|
|
227
240
|
}}
|
|
@@ -240,9 +253,12 @@ Each page file only needs to re-export its package screen:
|
|
|
240
253
|
// app/feedback/index.tsx
|
|
241
254
|
export { FeedbackBoardScreen as default } from "convex-feedback-ui/expo";
|
|
242
255
|
|
|
243
|
-
// app/feedback/[entryId].tsx
|
|
256
|
+
// app/feedback/[entryId]/index.tsx
|
|
244
257
|
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
245
258
|
|
|
259
|
+
// app/feedback/[entryId]/edit.tsx
|
|
260
|
+
export { FeedbackEditScreen as default } from "convex-feedback-ui/expo";
|
|
261
|
+
|
|
246
262
|
// app/feedback/new/_layout.tsx
|
|
247
263
|
import {
|
|
248
264
|
FeedbackCreateStackLayout,
|
|
@@ -254,9 +270,6 @@ export default FeedbackCreateStackLayout;
|
|
|
254
270
|
|
|
255
271
|
// app/feedback/new/index.tsx
|
|
256
272
|
export { CreateFeedbackScreen as default } from "convex-feedback-ui/expo";
|
|
257
|
-
|
|
258
|
-
// app/feedback/new/[entryId].tsx
|
|
259
|
-
export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
260
273
|
```
|
|
261
274
|
|
|
262
275
|
`FeedbackStackLayout` uses these route names by default:
|
|
@@ -265,18 +278,20 @@ export { FeedbackEntryScreen as default } from "convex-feedback-ui/expo";
|
|
|
265
278
|
{
|
|
266
279
|
board: "index",
|
|
267
280
|
entry: "[entryId]",
|
|
281
|
+
edit: "[entryId]/edit",
|
|
268
282
|
create: "new",
|
|
269
283
|
}
|
|
270
284
|
```
|
|
271
285
|
|
|
272
286
|
Names can be partially overridden when the files use a different structure.
|
|
273
287
|
The create name identifies its nested route directory, and the entry route must
|
|
274
|
-
|
|
275
|
-
|
|
288
|
+
retain the `[entryId]` dynamic segment. The edit route must be nested beneath
|
|
289
|
+
the entry route:
|
|
276
290
|
|
|
277
291
|
```tsx
|
|
278
292
|
const routes = {
|
|
279
293
|
entry: "entry/[entryId]",
|
|
294
|
+
edit: "entry/[entryId]/edit",
|
|
280
295
|
create: "create",
|
|
281
296
|
};
|
|
282
297
|
|
|
@@ -287,7 +302,7 @@ export default function Layout() {
|
|
|
287
302
|
}
|
|
288
303
|
```
|
|
289
304
|
|
|
290
|
-
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
|
|
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.
|
|
291
306
|
|
|
292
307
|
See `packages/example-expo-routed` for a complete application.
|
|
293
308
|
|