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.
Files changed (149) hide show
  1. package/README.md +38 -17
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/native/expo/EditEntryScreen.d.ts +11 -0
  4. package/dist/native/expo/EditEntryScreen.d.ts.map +1 -0
  5. package/dist/native/expo/EditEntryScreen.js +54 -0
  6. package/dist/native/expo/EditEntryScreen.js.map +1 -0
  7. package/dist/native/expo/ExpoFeedbackBody.d.ts.map +1 -1
  8. package/dist/native/expo/ExpoFeedbackBody.js +1 -1
  9. package/dist/native/expo/ExpoFeedbackBody.js.map +1 -1
  10. package/dist/native/expo/FeedbackCreateStackLayout.d.ts +1 -1
  11. package/dist/native/expo/FeedbackCreateStackLayout.d.ts.map +1 -1
  12. package/dist/native/expo/FeedbackCreateStackLayout.js +8 -15
  13. package/dist/native/expo/FeedbackCreateStackLayout.js.map +1 -1
  14. package/dist/native/expo/FeedbackRoutes.d.ts +1 -0
  15. package/dist/native/expo/FeedbackRoutes.d.ts.map +1 -1
  16. package/dist/native/expo/FeedbackRoutes.js +32 -9
  17. package/dist/native/expo/FeedbackRoutes.js.map +1 -1
  18. package/dist/native/expo/FeedbackStack.d.ts +1 -1
  19. package/dist/native/expo/FeedbackStack.d.ts.map +1 -1
  20. package/dist/native/expo/FeedbackStack.js +42 -10
  21. package/dist/native/expo/FeedbackStack.js.map +1 -1
  22. package/dist/native/expo/FeedbackStackLayout.d.ts +1 -1
  23. package/dist/native/expo/FeedbackStackLayout.d.ts.map +1 -1
  24. package/dist/native/expo/FeedbackStackLayout.js +10 -1
  25. package/dist/native/expo/FeedbackStackLayout.js.map +1 -1
  26. package/dist/native/expo/RoadmapRoutes.d.ts +8 -0
  27. package/dist/native/expo/RoadmapRoutes.d.ts.map +1 -1
  28. package/dist/native/expo/RoadmapRoutes.js +16 -6
  29. package/dist/native/expo/RoadmapRoutes.js.map +1 -1
  30. package/dist/native/expo/RoadmapScreen.d.ts +13 -0
  31. package/dist/native/expo/RoadmapScreen.d.ts.map +1 -1
  32. package/dist/native/expo/RoadmapScreen.js +6 -4
  33. package/dist/native/expo/RoadmapScreen.js.map +1 -1
  34. package/dist/native/expo/RoadmapStackLayout.d.ts +8 -1
  35. package/dist/native/expo/RoadmapStackLayout.d.ts.map +1 -1
  36. package/dist/native/expo/RoadmapStackLayout.js +11 -1
  37. package/dist/native/expo/RoadmapStackLayout.js.map +1 -1
  38. package/dist/native/expo/index.d.ts +1 -0
  39. package/dist/native/expo/index.d.ts.map +1 -1
  40. package/dist/native/expo/index.js +1 -0
  41. package/dist/native/expo/index.js.map +1 -1
  42. package/dist/native/expo/routes.d.ts +5 -1
  43. package/dist/native/expo/routes.d.ts.map +1 -1
  44. package/dist/native/expo/routes.js +32 -2
  45. package/dist/native/expo/routes.js.map +1 -1
  46. package/dist/native/expo/stackInsets.d.ts +19 -0
  47. package/dist/native/expo/stackInsets.d.ts.map +1 -0
  48. package/dist/native/expo/stackInsets.js +32 -0
  49. package/dist/native/expo/stackInsets.js.map +1 -0
  50. package/dist/native/expo/types.d.ts +29 -3
  51. package/dist/native/expo/types.d.ts.map +1 -1
  52. package/dist/native/expo/useStackHeaderHeight.d.ts +10 -0
  53. package/dist/native/expo/useStackHeaderHeight.d.ts.map +1 -0
  54. package/dist/native/expo/useStackHeaderHeight.js +25 -0
  55. package/dist/native/expo/useStackHeaderHeight.js.map +1 -0
  56. package/dist/native/shared/helpers.d.ts +5 -1
  57. package/dist/native/shared/helpers.d.ts.map +1 -1
  58. package/dist/native/shared/helpers.js +7 -3
  59. package/dist/native/shared/helpers.js.map +1 -1
  60. package/dist/native/shared/ui/BodyContent.d.ts +1 -1
  61. package/dist/native/shared/ui/BodyContent.d.ts.map +1 -1
  62. package/dist/native/shared/ui/BodyContent.js +2 -2
  63. package/dist/native/shared/ui/BodyContent.js.map +1 -1
  64. package/dist/native/shared/ui/EditEntry.d.ts +22 -0
  65. package/dist/native/shared/ui/EditEntry.d.ts.map +1 -0
  66. package/dist/native/shared/ui/EditEntry.js +112 -0
  67. package/dist/native/shared/ui/EditEntry.js.map +1 -0
  68. package/dist/native/shared/ui/EntryDetail.d.ts +1 -1
  69. package/dist/native/shared/ui/EntryDetail.d.ts.map +1 -1
  70. package/dist/native/shared/ui/EntryDetail.js +9 -2
  71. package/dist/native/shared/ui/EntryDetail.js.map +1 -1
  72. package/dist/native/shared/ui/FeedbackScreenList.d.ts +1 -1
  73. package/dist/native/shared/ui/FeedbackScreenList.d.ts.map +1 -1
  74. package/dist/native/shared/ui/FeedbackScreenList.js +2 -2
  75. package/dist/native/shared/ui/FeedbackScreenList.js.map +1 -1
  76. package/dist/native/shared/ui/RoadmapBoard.d.ts +15 -25
  77. package/dist/native/shared/ui/RoadmapBoard.d.ts.map +1 -1
  78. package/dist/native/shared/ui/RoadmapBoard.js +9 -19
  79. package/dist/native/shared/ui/RoadmapBoard.js.map +1 -1
  80. package/dist/native/shared/ui/RoadmapScreen.d.ts +24 -7
  81. package/dist/native/shared/ui/RoadmapScreen.d.ts.map +1 -1
  82. package/dist/native/shared/ui/RoadmapScreen.js +12 -6
  83. package/dist/native/shared/ui/RoadmapScreen.js.map +1 -1
  84. package/dist/native/shared/ui/primitives.d.ts +1 -1
  85. package/dist/native/shared/ui/primitives.d.ts.map +1 -1
  86. package/dist/native/shared/ui/primitives.js +6 -3
  87. package/dist/native/shared/ui/primitives.js.map +1 -1
  88. package/dist/react/css.d.ts +1 -0
  89. package/dist/react/css.d.ts.map +1 -1
  90. package/dist/react/css.js +1 -0
  91. package/dist/react/css.js.map +1 -1
  92. package/dist/react/primitives.d.ts +1 -1
  93. package/dist/react/primitives.d.ts.map +1 -1
  94. package/dist/react/primitives.js +2 -1
  95. package/dist/react/primitives.js.map +1 -1
  96. package/dist/react/screen.d.ts.map +1 -1
  97. package/dist/react/screen.js +41 -2
  98. package/dist/react/screen.js.map +1 -1
  99. package/dist/react/styles.css +41 -1
  100. package/dist/shared/messages.d.ts.map +1 -1
  101. package/dist/shared/messages.js +7 -0
  102. package/dist/shared/messages.js.map +1 -1
  103. package/dist/shared/theme.d.ts.map +1 -1
  104. package/dist/shared/theme.js +1 -0
  105. package/dist/shared/theme.js.map +1 -1
  106. package/dist/shared/types/context.d.ts +2 -0
  107. package/dist/shared/types/context.d.ts.map +1 -1
  108. package/dist/shared/types/messages.d.ts +16 -2
  109. package/dist/shared/types/messages.d.ts.map +1 -1
  110. package/dist/shared/types/screen.d.ts +6 -2
  111. package/dist/shared/types/screen.d.ts.map +1 -1
  112. package/dist/shared/types/theme.d.ts +2 -0
  113. package/dist/shared/types/theme.d.ts.map +1 -1
  114. package/package.json +2 -2
  115. package/src/native/expo/EditEntryScreen.tsx +159 -0
  116. package/src/native/expo/ExpoFeedbackBody.tsx +2 -0
  117. package/src/native/expo/FeedbackCreateStackLayout.tsx +0 -12
  118. package/src/native/expo/FeedbackRoutes.tsx +63 -13
  119. package/src/native/expo/FeedbackStack.tsx +70 -4
  120. package/src/native/expo/FeedbackStackLayout.tsx +15 -0
  121. package/src/native/expo/README.md +52 -6
  122. package/src/native/expo/RoadmapRoutes.tsx +28 -7
  123. package/src/native/expo/RoadmapScreen.tsx +34 -6
  124. package/src/native/expo/RoadmapStackLayout.tsx +13 -0
  125. package/src/native/expo/index.ts +1 -0
  126. package/src/native/expo/routes.ts +44 -2
  127. package/src/native/expo/stackInsets.ts +42 -0
  128. package/src/native/expo/types.ts +29 -3
  129. package/src/native/expo/useStackHeaderHeight.ts +41 -0
  130. package/src/native/native/README.md +9 -3
  131. package/src/native/shared/helpers.ts +15 -3
  132. package/src/native/shared/ui/BodyContent.tsx +2 -0
  133. package/src/native/shared/ui/EditEntry.tsx +297 -0
  134. package/src/native/shared/ui/EntryDetail.tsx +28 -1
  135. package/src/native/shared/ui/FeedbackScreenList.tsx +2 -0
  136. package/src/native/shared/ui/RoadmapBoard.tsx +19 -43
  137. package/src/native/shared/ui/RoadmapScreen.tsx +32 -9
  138. package/src/native/shared/ui/primitives.tsx +6 -2
  139. package/src/react/css.tsx +2 -0
  140. package/src/react/primitives.tsx +2 -0
  141. package/src/react/screen.tsx +143 -5
  142. package/src/react/styles.css +41 -1
  143. package/src/shared/README.md +3 -1
  144. package/src/shared/messages.ts +7 -0
  145. package/src/shared/theme.ts +1 -0
  146. package/src/shared/types/context.ts +3 -0
  147. package/src/shared/types/messages.ts +23 -2
  148. package/src/shared/types/screen.ts +8 -2
  149. package/src/shared/types/theme.ts +3 -0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![npm version](https://badge.fury.io/js/convex-feedback-ui.svg)](https://badge.fury.io/js/convex-feedback-ui) [![Convex Component](https://www.convex.dev/components/badge/convex-feedback)](https://www.convex.dev/components/convex-feedback) ![NPM License](https://img.shields.io/npm/l/convex-feedback-ui) ![NPM Downloads](https://img.shields.io/npm/dw/convex-feedback-ui) ![GitHub forks](https://img.shields.io/github/forks/moumen-io/convex-feedback) ![GitHub Repo stars](https://img.shields.io/github/stars/moumen-io/convex-feedback)
1
+ ![npm version](https://badge.fury.io/js/convex-feedback-ui.svg) ![Convex Component](https://www.convex.dev/components/badge/convex-feedback) ![NPM License](https://img.shields.io/npm/l/convex-feedback-ui) ![NPM Downloads](https://img.shields.io/npm/dw/convex-feedback-ui) ![GitHub forks](https://img.shields.io/github/forks/moumen-io/convex-feedback) ![GitHub Repo stars](https://img.shields.io/github/stars/moumen-io/convex-feedback)
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].tsx
209
+ ├── [entryId]/
210
+ │ ├── index.tsx
211
+ │ └── edit.tsx
192
212
  └── new/
193
213
  ├── _layout.tsx
194
- ├── index.tsx
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
- exist both beside that directory and inside it while retaining the `[entryId]`
267
- dynamic segment:
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.