convex-feedback-ui 0.2.0-beta.8 → 0.2.0
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 +5 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/native/expo/FeedbackRoutes.js +6 -7
- package/dist/native/expo/FeedbackRoutes.js.map +1 -1
- package/dist/native/expo/RoadmapRoutes.d.ts.map +1 -1
- package/dist/native/expo/RoadmapRoutes.js +4 -5
- package/dist/native/expo/RoadmapRoutes.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/navigation.d.ts +11 -0
- package/dist/native/expo/navigation.d.ts.map +1 -0
- package/dist/native/expo/navigation.js +13 -0
- package/dist/native/expo/navigation.js.map +1 -0
- package/dist/native/expo/routes.d.ts +9 -1
- package/dist/native/expo/routes.d.ts.map +1 -1
- package/dist/native/expo/routes.js +15 -1
- package/dist/native/expo/routes.js.map +1 -1
- package/dist/native/shared/ui/CommentBranch.d.ts.map +1 -1
- package/dist/native/shared/ui/CommentBranch.js +4 -4
- package/dist/native/shared/ui/CommentBranch.js.map +1 -1
- package/dist/native/shared/ui/RoadmapBoard.d.ts +3 -1
- package/dist/native/shared/ui/RoadmapBoard.d.ts.map +1 -1
- package/dist/native/shared/ui/RoadmapBoard.js +2 -1
- package/dist/native/shared/ui/RoadmapBoard.js.map +1 -1
- package/dist/native/shared/ui/RoadmapScreen.d.ts.map +1 -1
- package/dist/native/shared/ui/RoadmapScreen.js +4 -1
- package/dist/native/shared/ui/RoadmapScreen.js.map +1 -1
- package/dist/native/shared/ui/primitives.d.ts.map +1 -1
- package/dist/native/shared/ui/primitives.js +3 -3
- package/dist/native/shared/ui/primitives.js.map +1 -1
- package/dist/react/primitives.js +2 -2
- package/dist/react/primitives.js.map +1 -1
- package/dist/react/roadmap.js +3 -1
- package/dist/react/roadmap.js.map +1 -1
- package/dist/react/screen.js +1 -1
- package/dist/react/screen.js.map +1 -1
- package/dist/shared/messages.d.ts.map +1 -1
- package/dist/shared/messages.js +0 -1
- package/dist/shared/messages.js.map +1 -1
- package/dist/shared/types/messages.d.ts +0 -2
- package/dist/shared/types/messages.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/native/expo/FeedbackRoutes.tsx +8 -8
- package/src/native/expo/RoadmapRoutes.tsx +4 -5
- package/src/native/expo/index.ts +1 -0
- package/src/native/expo/navigation.ts +20 -0
- package/src/native/expo/routes.ts +23 -1
- package/src/native/shared/ui/CommentBranch.tsx +3 -8
- package/src/native/shared/ui/RoadmapBoard.tsx +4 -0
- package/src/native/shared/ui/RoadmapScreen.tsx +6 -2
- package/src/native/shared/ui/primitives.tsx +3 -4
- package/src/react/README.md +4 -0
- package/src/react/primitives.tsx +2 -2
- package/src/react/roadmap.tsx +5 -1
- package/src/react/screen.tsx +1 -1
- package/src/shared/messages.ts +0 -1
- package/src/shared/types/messages.ts +0 -3
|
@@ -54,6 +54,8 @@ export interface RoadmapBoardProps {
|
|
|
54
54
|
bottomInset?: number;
|
|
55
55
|
style?: StyleProp<ViewStyle>;
|
|
56
56
|
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
57
|
+
/** Additional styles for each stage column. */
|
|
58
|
+
stageStyle?: StyleProp<ViewStyle>;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
export interface RoadmapBoardCardProps extends Pick<
|
|
@@ -117,6 +119,7 @@ export function RoadmapBoard({
|
|
|
117
119
|
bottomInset,
|
|
118
120
|
style,
|
|
119
121
|
contentContainerStyle,
|
|
122
|
+
stageStyle,
|
|
120
123
|
}: RoadmapBoardProps) {
|
|
121
124
|
const insets = useSafeAreaInsets();
|
|
122
125
|
const resolvedBottomInset = bottomInset ?? insets.bottom;
|
|
@@ -173,6 +176,7 @@ export function RoadmapBoard({
|
|
|
173
176
|
borderColor: resolvedColors.border,
|
|
174
177
|
backgroundColor: resolvedColors.surfaceMuted,
|
|
175
178
|
},
|
|
179
|
+
stageStyle,
|
|
176
180
|
]}
|
|
177
181
|
>
|
|
178
182
|
<View
|
|
@@ -167,10 +167,14 @@ export function RoadmapScreenContent({
|
|
|
167
167
|
...colors
|
|
168
168
|
}: RoadmapScreenContentProps) {
|
|
169
169
|
const [selected, setSelected] = useState<RoadmapItem | null>(null);
|
|
170
|
+
const { hooks } = useFeedbackBody();
|
|
171
|
+
const selectedQuery = hooks.useRoadmapItem(selected?.id);
|
|
172
|
+
const authoritativeSelected =
|
|
173
|
+
selectedQuery === undefined ? selected : selectedQuery;
|
|
170
174
|
|
|
171
175
|
return (
|
|
172
176
|
<FeedbackBoard.Root {...colors}>
|
|
173
|
-
{
|
|
177
|
+
{authoritativeSelected === null ? (
|
|
174
178
|
<RoadmapBoardContent
|
|
175
179
|
pageSize={pageSize}
|
|
176
180
|
onItemOpen={setSelected}
|
|
@@ -182,7 +186,7 @@ export function RoadmapScreenContent({
|
|
|
182
186
|
/>
|
|
183
187
|
) : (
|
|
184
188
|
<RoadmapDetailPage
|
|
185
|
-
item={
|
|
189
|
+
item={authoritativeSelected}
|
|
186
190
|
entryPageSize={entryPageSize}
|
|
187
191
|
onEntryOpen={onEntryOpen}
|
|
188
192
|
onBack={() => setSelected(null)}
|
|
@@ -535,21 +535,20 @@ function CommentRoot({ comment, style, ...props }: CommentRootProps) {
|
|
|
535
535
|
}
|
|
536
536
|
function CommentBody({ style, children, ...props }: TextProps) {
|
|
537
537
|
const comment = useCommentContext();
|
|
538
|
-
const {
|
|
538
|
+
const { theme, unstyled } = useFeedbackUi();
|
|
539
539
|
return (
|
|
540
540
|
<Text
|
|
541
541
|
{...props}
|
|
542
542
|
style={combineStyle<TextStyle>(
|
|
543
543
|
!unstyled,
|
|
544
544
|
{
|
|
545
|
-
color:
|
|
546
|
-
comment.body === null ? theme.colors.mutedText : theme.colors.text,
|
|
545
|
+
color: theme.colors.text,
|
|
547
546
|
lineHeight: 20,
|
|
548
547
|
},
|
|
549
548
|
style,
|
|
550
549
|
)}
|
|
551
550
|
>
|
|
552
|
-
{children ?? comment.body
|
|
551
|
+
{children ?? comment.body}
|
|
553
552
|
</Text>
|
|
554
553
|
);
|
|
555
554
|
}
|
package/src/react/README.md
CHANGED
|
@@ -5,3 +5,7 @@ The web layer is CSS-framework agnostic. Import `convex-feedback-ui/styles.css`
|
|
|
5
5
|
Default selectors are scoped beneath `.cf-board` and use low-specificity `:where(...)` selectors so host CSS, CSS Modules, Tailwind classes, or inline styles can override them without a specificity fight.
|
|
6
6
|
|
|
7
7
|
Use compound primitives for custom layouts, `FeedbackScreen` for the feedback board, or `RoadmapScreen` for public roadmap browsing. Interactive leaf primitives accept render-function children to replace their visual implementation while retaining typed state and actions. Pass `onUnauthenticated` to let the host open its auth UI when an anonymous visitor selects an authenticated-only action.
|
|
8
|
+
|
|
9
|
+
The UI consumes hooks created from the host's generated API. Configure
|
|
10
|
+
authentication, lifecycle callbacks, and callback rejection behavior in the
|
|
11
|
+
headless `exposeFeedbackApi` wrapper; see the [canonical callback reference](../../../convex-feedback/README.md#lifecycle-callbacks).
|
package/src/react/primitives.tsx
CHANGED
|
@@ -409,13 +409,13 @@ function CommentRoot({ comment, className, ...props }: CommentRootProps) {
|
|
|
409
409
|
|
|
410
410
|
function CommentBody(props: HTMLAttributes<HTMLParagraphElement>) {
|
|
411
411
|
const comment = useCommentContext();
|
|
412
|
-
const {
|
|
412
|
+
const { unstyled } = useFeedbackUi();
|
|
413
413
|
return (
|
|
414
414
|
<p
|
|
415
415
|
{...props}
|
|
416
416
|
className={classes(unstyled, "cf-comment__body", props.className)}
|
|
417
417
|
>
|
|
418
|
-
{props.children ?? comment.body
|
|
418
|
+
{props.children ?? comment.body}
|
|
419
419
|
</p>
|
|
420
420
|
);
|
|
421
421
|
}
|
package/src/react/roadmap.tsx
CHANGED
|
@@ -61,9 +61,13 @@ function RoadmapScreenInner({
|
|
|
61
61
|
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
62
62
|
const roadmap = hooks.useRoadmap();
|
|
63
63
|
const search = hooks.useSearchRoadmap(query);
|
|
64
|
+
const selectedQuery = hooks.useRoadmapItem(selectedId);
|
|
64
65
|
const searching = query.trim().length > 0;
|
|
65
66
|
const items = searching ? (search ?? []) : roadmap.results;
|
|
66
|
-
const
|
|
67
|
+
const optimisticSelected =
|
|
68
|
+
items.find((item) => item.id === selectedId) ?? null;
|
|
69
|
+
const selected =
|
|
70
|
+
selectedQuery === undefined ? optimisticSelected : selectedQuery;
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
73
|
<FeedbackBoard.Root {...colors}>
|
package/src/react/screen.tsx
CHANGED
|
@@ -857,7 +857,7 @@ function CommentBranch({ comment, entryId }: FeedbackScreenCommentBranchProps) {
|
|
|
857
857
|
disabled={isAuthenticated === undefined || likeAction.pending}
|
|
858
858
|
onToggle={toggleLike}
|
|
859
859
|
/>
|
|
860
|
-
{comment.
|
|
860
|
+
{comment.depth < maxCommentDepth && (
|
|
861
861
|
<Comment.Reply
|
|
862
862
|
disabled={isAuthenticated === undefined || replyAction.pending}
|
|
863
863
|
onActivate={() => {
|
package/src/shared/messages.ts
CHANGED
|
@@ -99,7 +99,6 @@ export const englishFeedbackMessages: FeedbackMessages = {
|
|
|
99
99
|
viewReplies: (count) =>
|
|
100
100
|
`View ${count} ${count === 1 ? "reply" : "replies"}`,
|
|
101
101
|
hideReplies: "Hide replies",
|
|
102
|
-
deleted: "Comment deleted",
|
|
103
102
|
noComments: "No comments yet.",
|
|
104
103
|
loadMore: "Load more comments",
|
|
105
104
|
},
|
|
@@ -210,9 +210,6 @@ export interface FeedbackMessages {
|
|
|
210
210
|
/** Collapses an expanded reply branch. */
|
|
211
211
|
hideReplies: string;
|
|
212
212
|
|
|
213
|
-
/** Placeholder copy for a soft-deleted comment. */
|
|
214
|
-
deleted: string;
|
|
215
|
-
|
|
216
213
|
/** Empty-state copy when no comments exist. */
|
|
217
214
|
noComments: string;
|
|
218
215
|
|