@ciridae/ui 1.0.1 → 1.0.3
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/dist/app/auth.d.ts +10 -0
- package/dist/app/auth.js +60 -0
- package/dist/app/error-boundary.d.ts +18 -0
- package/dist/app/error-boundary.js +45 -0
- package/dist/app/feedback.d.ts +12 -0
- package/dist/app/feedback.js +128 -0
- package/dist/app/index.d.ts +8 -0
- package/dist/app/index.js +8 -0
- package/dist/app/request-errors.d.ts +63 -0
- package/dist/app/request-errors.js +172 -0
- package/dist/app/sentry.d.ts +18 -0
- package/dist/app/sentry.js +52 -0
- package/dist/app/telemetry.d.ts +7 -0
- package/dist/app/telemetry.js +28 -0
- package/dist/app/trail.d.ts +9 -0
- package/dist/app/trail.js +18 -0
- package/dist/chat/chat-query-keys.d.ts +3 -3
- package/dist/chat/contract.d.ts +15 -15
- package/dist/chat/conversation-items-query-options.d.ts +114 -114
- package/dist/chat/conversation-source.d.ts +75 -0
- package/dist/chat/conversation-source.js +1 -0
- package/dist/chat/message-text.d.ts +1 -1
- package/dist/chat/message-text.js +114 -46
- package/dist/chat/use-conversation-list.d.ts +6 -6
- package/dist/components/activity-feed.d.ts +2 -2
- package/dist/components/agent-work.d.ts +3 -3
- package/dist/components/app-frame.d.ts +79 -0
- package/dist/components/app-frame.js +92 -0
- package/dist/components/app-navigation.d.ts +3 -3
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/brand-icons.d.ts +3 -3
- package/dist/components/bulk-action-bar.d.ts +1 -1
- package/dist/components/button.d.ts +4 -4
- package/dist/components/calendar.d.ts +1 -1
- package/dist/components/centered-page.d.ts +1 -1
- package/dist/components/chart.d.ts +22 -2
- package/dist/components/chart.js +239 -44
- package/dist/components/chat-client-source.d.ts +16 -0
- package/dist/components/chat-client-source.js +256 -0
- package/dist/components/chat-page.d.ts +9 -8
- package/dist/components/chat-page.js +7 -11
- package/dist/components/chat-sheet-controller.d.ts +10 -14
- package/dist/components/chat-sheet-controller.js +2 -3
- package/dist/components/chat-sheet.d.ts +10 -11
- package/dist/components/chat-sheet.js +135 -273
- package/dist/components/chat.d.ts +22 -8
- package/dist/components/chat.js +128 -33
- package/dist/components/checkbox-item.d.ts +1 -1
- package/dist/components/checkbox-list.d.ts +1 -1
- package/dist/components/chip.d.ts +1 -1
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/color-theme.d.ts +1 -1
- package/dist/components/column-settings.d.ts +1 -1
- package/dist/components/command-menu.d.ts +1 -1
- package/dist/components/command-palette.d.ts +3 -3
- package/dist/components/command-palette.js +1 -2
- package/dist/components/copyable-id.d.ts +22 -5
- package/dist/components/copyable-id.js +46 -6
- package/dist/components/data-display.d.ts +4 -4
- package/dist/components/data-grid.d.ts +10 -10
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-time.d.ts +1 -1
- package/dist/components/dialog-height-context.d.ts +1 -1
- package/dist/components/document-viewer.d.ts +2 -2
- package/dist/components/drawer.d.ts +6 -6
- package/dist/components/dropzone.d.ts +4 -4
- package/dist/components/editable-field.d.ts +2 -2
- package/dist/components/email-input.d.ts +1 -1
- package/dist/components/environment-frame.d.ts +1 -1
- package/dist/components/expandable-text.d.ts +1 -1
- package/dist/components/feedback-screenshot.d.ts +1 -1
- package/dist/components/feedback-sheet.d.ts +18 -3
- package/dist/components/feedback-sheet.js +216 -55
- package/dist/components/field-context.d.ts +1 -1
- package/dist/components/filter-bar.d.ts +3 -3
- package/dist/components/filter-bar.js +4 -1
- package/dist/components/form-controls.d.ts +4 -4
- package/dist/components/form-layout.d.ts +7 -7
- package/dist/components/hotkeys.d.ts +2 -2
- package/dist/components/icon.d.ts +2 -2
- package/dist/components/input.d.ts +4 -4
- package/dist/components/input.js +3 -2
- package/dist/components/keyboard-shortcuts.d.ts +2 -2
- package/dist/components/keycap.d.ts +2 -2
- package/dist/components/layout.d.ts +15 -15
- package/dist/components/lightbox.d.ts +9 -3
- package/dist/components/lightbox.js +11 -8
- package/dist/components/link.d.ts +1 -1
- package/dist/components/locale.d.ts +32 -2
- package/dist/components/locale.js +25 -1
- package/dist/components/log-list.d.ts +3 -3
- package/dist/components/mention-input.d.ts +2 -2
- package/dist/components/menu.d.ts +2 -2
- package/dist/components/meter.d.ts +1 -1
- package/dist/components/navigation.d.ts +2 -2
- package/dist/components/notification-tray.d.ts +1 -1
- package/dist/components/overlays.d.ts +4 -4
- package/dist/components/page-frame.d.ts +4 -4
- package/dist/components/panel.d.ts +4 -4
- package/dist/components/profile-header.d.ts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/project-avatar.d.ts +1 -1
- package/dist/components/radio-card.d.ts +2 -2
- package/dist/components/record.d.ts +4 -4
- package/dist/components/resolved-file-url.d.ts +19 -0
- package/dist/components/resolved-file-url.js +49 -0
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/secret-dialog.d.ts +1 -1
- package/dist/components/segmented-bar.d.ts +1 -1
- package/dist/components/select.d.ts +4 -4
- package/dist/components/settings.d.ts +4 -4
- package/dist/components/shell-skeleton.d.ts +1 -1
- package/dist/components/shell.d.ts +19 -19
- package/dist/components/shell.js +3 -1
- package/dist/components/side-panel.d.ts +3 -3
- package/dist/components/sidebar.d.ts +6 -6
- package/dist/components/site-banner.d.ts +2 -2
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeletons.d.ts +5 -5
- package/dist/components/stages.d.ts +5 -5
- package/dist/components/stat-card.d.ts +3 -3
- package/dist/components/status-banner.d.ts +1 -1
- package/dist/components/status.d.ts +2 -2
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/theme-customizer.d.ts +2 -2
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/use-new-version-available.d.ts +6 -0
- package/dist/components/use-new-version-available.js +29 -0
- package/dist/components/user-chip.d.ts +3 -3
- package/dist/components/wizard.d.ts +2 -2
- package/dist/feedback/contract.d.ts +136 -136
- package/dist/feedback/feedback-controller.d.ts +6 -6
- package/dist/feedback/generated/zod.gen.d.ts +28 -28
- package/dist/feedback/operator-contract.d.ts +11 -11
- package/dist/feedback/operator-controller.d.ts +32 -13
- package/dist/feedback/operator-controller.js +44 -11
- package/dist/styled-system/styles.css +203 -59
- package/dist/theme/tokens.js +17 -8
- package/package.json +32 -3
|
@@ -63,10 +63,10 @@ export declare const zHttpErrorResponse: z.ZodObject<{
|
|
|
63
63
|
export declare const zFeedbackStatusEvent: z.ZodObject<{
|
|
64
64
|
id: z.ZodString;
|
|
65
65
|
status: z.ZodEnum<{
|
|
66
|
-
in_progress: "in_progress";
|
|
67
|
-
completed: "completed";
|
|
68
66
|
received: "received";
|
|
67
|
+
in_progress: "in_progress";
|
|
69
68
|
discussion_required: "discussion_required";
|
|
69
|
+
completed: "completed";
|
|
70
70
|
no_action: "no_action";
|
|
71
71
|
withdrawn: "withdrawn";
|
|
72
72
|
}>;
|
|
@@ -169,10 +169,10 @@ export declare const zFeedbackSummary: z.ZodObject<{
|
|
|
169
169
|
my_team: "my_team";
|
|
170
170
|
}>;
|
|
171
171
|
status: z.ZodEnum<{
|
|
172
|
-
in_progress: "in_progress";
|
|
173
|
-
completed: "completed";
|
|
174
172
|
received: "received";
|
|
173
|
+
in_progress: "in_progress";
|
|
175
174
|
discussion_required: "discussion_required";
|
|
175
|
+
completed: "completed";
|
|
176
176
|
no_action: "no_action";
|
|
177
177
|
withdrawn: "withdrawn";
|
|
178
178
|
}>;
|
|
@@ -210,10 +210,10 @@ export declare const zFeedbackListResponse: z.ZodObject<{
|
|
|
210
210
|
my_team: "my_team";
|
|
211
211
|
}>;
|
|
212
212
|
status: z.ZodEnum<{
|
|
213
|
-
in_progress: "in_progress";
|
|
214
|
-
completed: "completed";
|
|
215
213
|
received: "received";
|
|
214
|
+
in_progress: "in_progress";
|
|
216
215
|
discussion_required: "discussion_required";
|
|
216
|
+
completed: "completed";
|
|
217
217
|
no_action: "no_action";
|
|
218
218
|
withdrawn: "withdrawn";
|
|
219
219
|
}>;
|
|
@@ -283,10 +283,10 @@ export declare const zFeedbackItem: z.ZodObject<{
|
|
|
283
283
|
my_team: "my_team";
|
|
284
284
|
}>;
|
|
285
285
|
status: z.ZodEnum<{
|
|
286
|
-
in_progress: "in_progress";
|
|
287
|
-
completed: "completed";
|
|
288
286
|
received: "received";
|
|
287
|
+
in_progress: "in_progress";
|
|
289
288
|
discussion_required: "discussion_required";
|
|
289
|
+
completed: "completed";
|
|
290
290
|
no_action: "no_action";
|
|
291
291
|
withdrawn: "withdrawn";
|
|
292
292
|
}>;
|
|
@@ -300,10 +300,10 @@ export declare const zFeedbackItem: z.ZodObject<{
|
|
|
300
300
|
statusTimeline: z.ZodArray<z.ZodObject<{
|
|
301
301
|
id: z.ZodString;
|
|
302
302
|
status: z.ZodEnum<{
|
|
303
|
-
in_progress: "in_progress";
|
|
304
|
-
completed: "completed";
|
|
305
303
|
received: "received";
|
|
304
|
+
in_progress: "in_progress";
|
|
306
305
|
discussion_required: "discussion_required";
|
|
306
|
+
completed: "completed";
|
|
307
307
|
no_action: "no_action";
|
|
308
308
|
withdrawn: "withdrawn";
|
|
309
309
|
}>;
|
|
@@ -360,10 +360,10 @@ export declare const zListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeed
|
|
|
360
360
|
my_team: "my_team";
|
|
361
361
|
}>;
|
|
362
362
|
status: z.ZodEnum<{
|
|
363
|
-
in_progress: "in_progress";
|
|
364
|
-
completed: "completed";
|
|
365
363
|
received: "received";
|
|
364
|
+
in_progress: "in_progress";
|
|
366
365
|
discussion_required: "discussion_required";
|
|
366
|
+
completed: "completed";
|
|
367
367
|
no_action: "no_action";
|
|
368
368
|
withdrawn: "withdrawn";
|
|
369
369
|
}>;
|
|
@@ -426,10 +426,10 @@ export declare const zCreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFe
|
|
|
426
426
|
my_team: "my_team";
|
|
427
427
|
}>;
|
|
428
428
|
status: z.ZodEnum<{
|
|
429
|
-
in_progress: "in_progress";
|
|
430
|
-
completed: "completed";
|
|
431
429
|
received: "received";
|
|
430
|
+
in_progress: "in_progress";
|
|
432
431
|
discussion_required: "discussion_required";
|
|
432
|
+
completed: "completed";
|
|
433
433
|
no_action: "no_action";
|
|
434
434
|
withdrawn: "withdrawn";
|
|
435
435
|
}>;
|
|
@@ -443,10 +443,10 @@ export declare const zCreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFe
|
|
|
443
443
|
statusTimeline: z.ZodArray<z.ZodObject<{
|
|
444
444
|
id: z.ZodString;
|
|
445
445
|
status: z.ZodEnum<{
|
|
446
|
-
in_progress: "in_progress";
|
|
447
|
-
completed: "completed";
|
|
448
446
|
received: "received";
|
|
447
|
+
in_progress: "in_progress";
|
|
449
448
|
discussion_required: "discussion_required";
|
|
449
|
+
completed: "completed";
|
|
450
450
|
no_action: "no_action";
|
|
451
451
|
withdrawn: "withdrawn";
|
|
452
452
|
}>;
|
|
@@ -503,10 +503,10 @@ export declare const zGetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedb
|
|
|
503
503
|
my_team: "my_team";
|
|
504
504
|
}>;
|
|
505
505
|
status: z.ZodEnum<{
|
|
506
|
-
in_progress: "in_progress";
|
|
507
|
-
completed: "completed";
|
|
508
506
|
received: "received";
|
|
507
|
+
in_progress: "in_progress";
|
|
509
508
|
discussion_required: "discussion_required";
|
|
509
|
+
completed: "completed";
|
|
510
510
|
no_action: "no_action";
|
|
511
511
|
withdrawn: "withdrawn";
|
|
512
512
|
}>;
|
|
@@ -520,10 +520,10 @@ export declare const zGetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedb
|
|
|
520
520
|
statusTimeline: z.ZodArray<z.ZodObject<{
|
|
521
521
|
id: z.ZodString;
|
|
522
522
|
status: z.ZodEnum<{
|
|
523
|
-
in_progress: "in_progress";
|
|
524
|
-
completed: "completed";
|
|
525
523
|
received: "received";
|
|
524
|
+
in_progress: "in_progress";
|
|
526
525
|
discussion_required: "discussion_required";
|
|
526
|
+
completed: "completed";
|
|
527
527
|
no_action: "no_action";
|
|
528
528
|
withdrawn: "withdrawn";
|
|
529
529
|
}>;
|
|
@@ -584,10 +584,10 @@ export declare const zUpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFe
|
|
|
584
584
|
my_team: "my_team";
|
|
585
585
|
}>;
|
|
586
586
|
status: z.ZodEnum<{
|
|
587
|
-
in_progress: "in_progress";
|
|
588
|
-
completed: "completed";
|
|
589
587
|
received: "received";
|
|
588
|
+
in_progress: "in_progress";
|
|
590
589
|
discussion_required: "discussion_required";
|
|
590
|
+
completed: "completed";
|
|
591
591
|
no_action: "no_action";
|
|
592
592
|
withdrawn: "withdrawn";
|
|
593
593
|
}>;
|
|
@@ -601,10 +601,10 @@ export declare const zUpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFe
|
|
|
601
601
|
statusTimeline: z.ZodArray<z.ZodObject<{
|
|
602
602
|
id: z.ZodString;
|
|
603
603
|
status: z.ZodEnum<{
|
|
604
|
-
in_progress: "in_progress";
|
|
605
|
-
completed: "completed";
|
|
606
604
|
received: "received";
|
|
605
|
+
in_progress: "in_progress";
|
|
607
606
|
discussion_required: "discussion_required";
|
|
607
|
+
completed: "completed";
|
|
608
608
|
no_action: "no_action";
|
|
609
609
|
withdrawn: "withdrawn";
|
|
610
610
|
}>;
|
|
@@ -661,10 +661,10 @@ export declare const zWithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironment
|
|
|
661
661
|
my_team: "my_team";
|
|
662
662
|
}>;
|
|
663
663
|
status: z.ZodEnum<{
|
|
664
|
-
in_progress: "in_progress";
|
|
665
|
-
completed: "completed";
|
|
666
664
|
received: "received";
|
|
665
|
+
in_progress: "in_progress";
|
|
667
666
|
discussion_required: "discussion_required";
|
|
667
|
+
completed: "completed";
|
|
668
668
|
no_action: "no_action";
|
|
669
669
|
withdrawn: "withdrawn";
|
|
670
670
|
}>;
|
|
@@ -678,10 +678,10 @@ export declare const zWithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironment
|
|
|
678
678
|
statusTimeline: z.ZodArray<z.ZodObject<{
|
|
679
679
|
id: z.ZodString;
|
|
680
680
|
status: z.ZodEnum<{
|
|
681
|
-
in_progress: "in_progress";
|
|
682
|
-
completed: "completed";
|
|
683
681
|
received: "received";
|
|
682
|
+
in_progress: "in_progress";
|
|
684
683
|
discussion_required: "discussion_required";
|
|
684
|
+
completed: "completed";
|
|
685
685
|
no_action: "no_action";
|
|
686
686
|
withdrawn: "withdrawn";
|
|
687
687
|
}>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
declare const feedbackTriageStatusSchema: z.ZodEnum<{
|
|
3
|
-
in_progress: "in_progress";
|
|
4
|
-
completed: "completed";
|
|
5
3
|
received: "received";
|
|
4
|
+
in_progress: "in_progress";
|
|
6
5
|
discussion_required: "discussion_required";
|
|
6
|
+
completed: "completed";
|
|
7
7
|
no_action: "no_action";
|
|
8
8
|
}>;
|
|
9
9
|
declare const operatorFeedbackSummarySchema: z.ZodObject<{
|
|
10
10
|
status: z.ZodEnum<{
|
|
11
|
-
in_progress: "in_progress";
|
|
12
|
-
completed: "completed";
|
|
13
11
|
received: "received";
|
|
12
|
+
in_progress: "in_progress";
|
|
14
13
|
discussion_required: "discussion_required";
|
|
14
|
+
completed: "completed";
|
|
15
15
|
no_action: "no_action";
|
|
16
16
|
withdrawn: "withdrawn";
|
|
17
17
|
}>;
|
|
@@ -22,21 +22,21 @@ declare const operatorFeedbackSummarySchema: z.ZodObject<{
|
|
|
22
22
|
}>;
|
|
23
23
|
description: z.ZodString;
|
|
24
24
|
id: z.ZodUUID;
|
|
25
|
-
createdAt: z.ZodISODateTime;
|
|
26
25
|
subject: z.ZodString;
|
|
27
26
|
urgency: z.ZodEnum<{
|
|
28
27
|
normal: "normal";
|
|
29
28
|
emergency: "emergency";
|
|
30
29
|
}>;
|
|
30
|
+
createdAt: z.ZodISODateTime;
|
|
31
31
|
updatedAt: z.ZodISODateTime;
|
|
32
32
|
reporterEmail: z.ZodNullable<z.ZodString>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
34
|
declare const operatorFeedbackItemSchema: z.ZodObject<{
|
|
35
35
|
status: z.ZodEnum<{
|
|
36
|
-
in_progress: "in_progress";
|
|
37
|
-
completed: "completed";
|
|
38
36
|
received: "received";
|
|
37
|
+
in_progress: "in_progress";
|
|
39
38
|
discussion_required: "discussion_required";
|
|
39
|
+
completed: "completed";
|
|
40
40
|
no_action: "no_action";
|
|
41
41
|
withdrawn: "withdrawn";
|
|
42
42
|
}>;
|
|
@@ -47,12 +47,12 @@ declare const operatorFeedbackItemSchema: z.ZodObject<{
|
|
|
47
47
|
}>;
|
|
48
48
|
description: z.ZodString;
|
|
49
49
|
id: z.ZodUUID;
|
|
50
|
-
createdAt: z.ZodISODateTime;
|
|
51
50
|
subject: z.ZodString;
|
|
52
51
|
urgency: z.ZodEnum<{
|
|
53
52
|
normal: "normal";
|
|
54
53
|
emergency: "emergency";
|
|
55
54
|
}>;
|
|
55
|
+
createdAt: z.ZodISODateTime;
|
|
56
56
|
updatedAt: z.ZodISODateTime;
|
|
57
57
|
reporterEmail: z.ZodNullable<z.ZodString>;
|
|
58
58
|
canReply: z.ZodBoolean;
|
|
@@ -81,10 +81,10 @@ declare const operatorFeedbackItemSchema: z.ZodObject<{
|
|
|
81
81
|
declare const operatorFeedbackListResponseSchema: z.ZodObject<{
|
|
82
82
|
items: z.ZodArray<z.ZodObject<{
|
|
83
83
|
status: z.ZodEnum<{
|
|
84
|
-
in_progress: "in_progress";
|
|
85
|
-
completed: "completed";
|
|
86
84
|
received: "received";
|
|
85
|
+
in_progress: "in_progress";
|
|
87
86
|
discussion_required: "discussion_required";
|
|
87
|
+
completed: "completed";
|
|
88
88
|
no_action: "no_action";
|
|
89
89
|
withdrawn: "withdrawn";
|
|
90
90
|
}>;
|
|
@@ -95,12 +95,12 @@ declare const operatorFeedbackListResponseSchema: z.ZodObject<{
|
|
|
95
95
|
}>;
|
|
96
96
|
description: z.ZodString;
|
|
97
97
|
id: z.ZodUUID;
|
|
98
|
-
createdAt: z.ZodISODateTime;
|
|
99
98
|
subject: z.ZodString;
|
|
100
99
|
urgency: z.ZodEnum<{
|
|
101
100
|
normal: "normal";
|
|
102
101
|
emergency: "emergency";
|
|
103
102
|
}>;
|
|
103
|
+
createdAt: z.ZodISODateTime;
|
|
104
104
|
updatedAt: z.ZodISODateTime;
|
|
105
105
|
reporterEmail: z.ZodNullable<z.ZodString>;
|
|
106
106
|
}, z.core.$strip>>;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
1
2
|
import { type FeedbackOperatorClientConfig } from "./operator-client.js";
|
|
3
|
+
import type { FeedbackTriageStatus } from "./operator-contract.js";
|
|
4
|
+
import type { FeedbackOperatorProps } from "../components/feedback-sheet.js";
|
|
2
5
|
type FeedbackOperatorControllerConfig = FeedbackOperatorClientConfig & {
|
|
6
|
+
/** Keeps one operator's cached feedback apart from another's, such as their user id. */
|
|
3
7
|
cacheScope: string;
|
|
4
8
|
};
|
|
5
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The operator's feedback queries: every reporter's items while `active`, the open one with its
|
|
11
|
+
* conversation, and the status change and reply, each resolving once both are refetched.
|
|
12
|
+
*/
|
|
13
|
+
declare function useFeedbackOperatorController(config: FeedbackOperatorControllerConfig, openFeedbackId: string | undefined, active?: boolean): {
|
|
6
14
|
getAttachmentUrl: (feedbackId: string, attachmentId: string) => Promise<string>;
|
|
7
|
-
itemQuery:
|
|
8
|
-
status: "
|
|
15
|
+
itemQuery: UseQueryResult<NoInfer<{
|
|
16
|
+
status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
|
|
9
17
|
type: "general" | "bug" | "feature";
|
|
10
18
|
description: string;
|
|
11
19
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
20
|
subject: string;
|
|
14
21
|
urgency: "normal" | "emergency";
|
|
22
|
+
createdAt: string;
|
|
15
23
|
updatedAt: string;
|
|
16
24
|
reporterEmail: string | null;
|
|
17
25
|
canReply: boolean;
|
|
@@ -34,26 +42,29 @@ declare function useFeedbackOperatorController(config: FeedbackOperatorControlle
|
|
|
34
42
|
editedAt_epoch_milliseconds: number | null;
|
|
35
43
|
}[];
|
|
36
44
|
}>, Error>;
|
|
37
|
-
itemsQuery:
|
|
38
|
-
status: "
|
|
45
|
+
itemsQuery: UseQueryResult<NoInfer<{
|
|
46
|
+
status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
|
|
39
47
|
type: "general" | "bug" | "feature";
|
|
40
48
|
description: string;
|
|
41
49
|
id: string;
|
|
42
|
-
createdAt: string;
|
|
43
50
|
subject: string;
|
|
44
51
|
urgency: "normal" | "emergency";
|
|
52
|
+
createdAt: string;
|
|
45
53
|
updatedAt: string;
|
|
46
54
|
reporterEmail: string | null;
|
|
47
55
|
}[]>, Error>;
|
|
48
|
-
messageMutation: import("@tanstack/react-query
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
messageMutation: import("@tanstack/react-query").UseMutationResult<import("./contract.js").FeedbackMessage, Error, {
|
|
57
|
+
feedbackId: string;
|
|
58
|
+
body: string;
|
|
59
|
+
}, unknown>;
|
|
60
|
+
statusMutation: import("@tanstack/react-query").UseMutationResult<{
|
|
61
|
+
status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
|
|
51
62
|
type: "general" | "bug" | "feature";
|
|
52
63
|
description: string;
|
|
53
64
|
id: string;
|
|
54
|
-
createdAt: string;
|
|
55
65
|
subject: string;
|
|
56
66
|
urgency: "normal" | "emergency";
|
|
67
|
+
createdAt: string;
|
|
57
68
|
updatedAt: string;
|
|
58
69
|
reporterEmail: string | null;
|
|
59
70
|
canReply: boolean;
|
|
@@ -75,6 +86,14 @@ declare function useFeedbackOperatorController(config: FeedbackOperatorControlle
|
|
|
75
86
|
createdAt_epoch_milliseconds: number;
|
|
76
87
|
editedAt_epoch_milliseconds: number | null;
|
|
77
88
|
}[];
|
|
78
|
-
}, Error,
|
|
89
|
+
}, Error, {
|
|
90
|
+
feedbackId: string;
|
|
91
|
+
status: FeedbackTriageStatus;
|
|
92
|
+
}, unknown>;
|
|
79
93
|
};
|
|
80
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The feedback sheet's `operator` tab, run against the API: pass it while the viewer answers
|
|
96
|
+
* feedback, with `active` while the sheet is open.
|
|
97
|
+
*/
|
|
98
|
+
declare function useFeedbackOperatorSheet(config: FeedbackOperatorControllerConfig, active: boolean): FeedbackOperatorProps;
|
|
99
|
+
export { type FeedbackOperatorControllerConfig, useFeedbackOperatorController, useFeedbackOperatorSheet, };
|
|
@@ -2,7 +2,11 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createFeedbackOperatorClient } from "./operator-client.js";
|
|
4
4
|
import { requireConfig } from "./require-config.js";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The operator's feedback queries: every reporter's items while `active`, the open one with its
|
|
7
|
+
* conversation, and the status change and reply, each resolving once both are refetched.
|
|
8
|
+
*/
|
|
9
|
+
function useFeedbackOperatorController(config, openFeedbackId, active = true) {
|
|
6
10
|
const { baseUrl, cacheScope: configuredCacheScope, getBearerToken } = config;
|
|
7
11
|
const client = React.useMemo(() => createFeedbackOperatorClient({ baseUrl, getBearerToken }), [baseUrl, getBearerToken]);
|
|
8
12
|
const cacheScope = requireConfig(configuredCacheScope, "cacheScope");
|
|
@@ -11,21 +15,23 @@ function useFeedbackOperatorController(config, selectedFeedbackId) {
|
|
|
11
15
|
const itemsQuery = useQuery({
|
|
12
16
|
queryKey: [...queryRoot, "items"],
|
|
13
17
|
queryFn: ({ signal }) => client.list({ signal }),
|
|
18
|
+
enabled: active,
|
|
14
19
|
retry: false,
|
|
15
20
|
});
|
|
16
21
|
const itemQuery = useQuery({
|
|
17
|
-
queryKey: [...queryRoot, "item",
|
|
18
|
-
queryFn: ({ signal }) => client.get(
|
|
19
|
-
enabled:
|
|
22
|
+
queryKey: [...queryRoot, "item", openFeedbackId],
|
|
23
|
+
queryFn: ({ signal }) => client.get(requireOpenFeedbackId(openFeedbackId), { signal }),
|
|
24
|
+
enabled: active && openFeedbackId !== undefined,
|
|
20
25
|
retry: false,
|
|
21
26
|
});
|
|
27
|
+
const refresh = () => queryClient.invalidateQueries({ queryKey: queryRoot });
|
|
22
28
|
const statusMutation = useMutation({
|
|
23
|
-
mutationFn: (status) => client.updateStatus(
|
|
24
|
-
onSuccess:
|
|
29
|
+
mutationFn: ({ feedbackId, status }) => client.updateStatus(feedbackId, status),
|
|
30
|
+
onSuccess: refresh,
|
|
25
31
|
});
|
|
26
32
|
const messageMutation = useMutation({
|
|
27
|
-
mutationFn: (body) => client.createMessage(
|
|
28
|
-
onSuccess:
|
|
33
|
+
mutationFn: ({ feedbackId, body }) => client.createMessage(feedbackId, body),
|
|
34
|
+
onSuccess: refresh,
|
|
29
35
|
});
|
|
30
36
|
return {
|
|
31
37
|
getAttachmentUrl: (feedbackId, attachmentId) => client.getAttachmentUrl(feedbackId, attachmentId),
|
|
@@ -35,9 +41,36 @@ function useFeedbackOperatorController(config, selectedFeedbackId) {
|
|
|
35
41
|
statusMutation,
|
|
36
42
|
};
|
|
37
43
|
}
|
|
38
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The feedback sheet's `operator` tab, run against the API: pass it while the viewer answers
|
|
46
|
+
* feedback, with `active` while the sheet is open.
|
|
47
|
+
*/
|
|
48
|
+
function useFeedbackOperatorSheet(config, active) {
|
|
49
|
+
const [openFeedbackId, setOpenFeedbackId] = React.useState();
|
|
50
|
+
const { itemsQuery, itemQuery, messageMutation, statusMutation } = useFeedbackOperatorController(config, openFeedbackId, active);
|
|
51
|
+
return {
|
|
52
|
+
items: toLoadState(itemsQuery),
|
|
53
|
+
onOpenItem: setOpenFeedbackId,
|
|
54
|
+
item: openFeedbackId === undefined ? undefined : toLoadState(itemQuery),
|
|
55
|
+
onReply: async (feedbackId, body) => {
|
|
56
|
+
await messageMutation.mutateAsync({ feedbackId, body });
|
|
57
|
+
},
|
|
58
|
+
onStatusChange: async (feedbackId, status) => {
|
|
59
|
+
await statusMutation.mutateAsync({ feedbackId, status });
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** A query as the sheet reads it: loading until its first answer, then its data or failure. */
|
|
64
|
+
function toLoadState(query) {
|
|
65
|
+
if (query.isPending)
|
|
66
|
+
return { status: "loading" };
|
|
67
|
+
if (query.isError)
|
|
68
|
+
return { status: "error", error: query.error, retry: () => void query.refetch() };
|
|
69
|
+
return { status: "loaded", data: query.data };
|
|
70
|
+
}
|
|
71
|
+
function requireOpenFeedbackId(feedbackId) {
|
|
39
72
|
if (feedbackId === undefined)
|
|
40
|
-
throw new Error("
|
|
73
|
+
throw new Error("Open feedback before loading it.");
|
|
41
74
|
return feedbackId;
|
|
42
75
|
}
|
|
43
|
-
export { useFeedbackOperatorController };
|
|
76
|
+
export { useFeedbackOperatorController, useFeedbackOperatorSheet, };
|