@ciridae/ui 1.2.0 → 1.2.2
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/components/command-menu.js +1 -1
- package/dist/components/drawer.js +8 -1
- package/dist/components/environment-frame.js +15 -1
- package/dist/components/feedback-screenshot.d.ts +7 -0
- package/dist/components/feedback-screenshot.js +41 -2
- package/dist/components/feedback-sheet.d.ts +5 -2
- package/dist/components/feedback-sheet.js +27 -8
- package/dist/components/lightbox.js +3 -1
- package/dist/components/locale.d.ts +0 -1
- package/dist/components/locale.js +0 -1
- package/dist/components/overlays.js +2 -2
- package/dist/components/shell.js +2 -1
- package/dist/feedback/client.js +11 -2
- package/dist/feedback/contract.d.ts +1 -0
- package/dist/feedback/generated/index.d.ts +1 -1
- package/dist/feedback/generated/types.gen.d.ts +379 -5
- package/dist/feedback/generated/zod.gen.d.ts +329 -6
- package/dist/feedback/generated/zod.gen.js +130 -7
- package/dist/preset.js +2 -0
- package/dist/styled-system/styles.css +27 -15
- package/dist/styled-system/tokens/index.mjs +8 -0
- package/dist/styled-system/tokens/tokens.d.ts +1 -1
- package/package.json +2 -1
|
@@ -50,7 +50,7 @@ const popup = css({
|
|
|
50
50
|
transitionDuration: "fast",
|
|
51
51
|
"&[data-starting-style], &[data-ending-style]": { opacity: "[0]" },
|
|
52
52
|
_motionReduce: { transition: "[none]" },
|
|
53
|
-
_phone: { top: "layout.pageGap" },
|
|
53
|
+
_phone: { top: "[calc(token(spacing.layout.bannerInset) + token(spacing.layout.pageGap))]" },
|
|
54
54
|
"& > [cmdk-root]": {
|
|
55
55
|
display: "flex",
|
|
56
56
|
flexDirection: "column",
|
|
@@ -9,7 +9,14 @@ import { HotkeyLayer } from "./hotkeys.js";
|
|
|
9
9
|
import { icon } from "./icon.js";
|
|
10
10
|
import { Eyebrow, heading } from "./layout.js";
|
|
11
11
|
import { useCiridaeLocale } from "./locale.js";
|
|
12
|
-
const viewport = css({
|
|
12
|
+
const viewport = css({
|
|
13
|
+
position: "fixed",
|
|
14
|
+
top: "layout.bannerInset",
|
|
15
|
+
insetInline: "none",
|
|
16
|
+
bottom: "none",
|
|
17
|
+
zIndex: "drawer",
|
|
18
|
+
pointerEvents: "none",
|
|
19
|
+
});
|
|
13
20
|
/*
|
|
14
21
|
* A drawer sits beside the page, which stays usable: no scrim. The shell's padding is what keeps
|
|
15
22
|
* the sheet off the window's edges, level with the main panel; a phone takes the sheet to the
|
|
@@ -54,6 +54,20 @@ function rememberDismissedForSession() {
|
|
|
54
54
|
console.warn(`Could not save ${dismissedStorageKey}; the strip stays hidden until the page reloads`, error);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
/** Overlays portal out of the frame, so the strip's height reaches them from the document root. */
|
|
58
|
+
function publishBannerInset(banner) {
|
|
59
|
+
if (!banner)
|
|
60
|
+
return;
|
|
61
|
+
const root = document.documentElement;
|
|
62
|
+
const observer = new ResizeObserver(() => {
|
|
63
|
+
root.style.setProperty("--environment-banner-inset", `${banner.offsetHeight}px`);
|
|
64
|
+
});
|
|
65
|
+
observer.observe(banner);
|
|
66
|
+
return () => {
|
|
67
|
+
observer.disconnect();
|
|
68
|
+
root.style.removeProperty("--environment-banner-inset");
|
|
69
|
+
};
|
|
70
|
+
}
|
|
57
71
|
/** An environment strip, which the reader can dismiss for the session, and the AppShell viewport below it. */
|
|
58
72
|
export function EnvironmentFrame({ label, tone = "info", children, className, ...props }) {
|
|
59
73
|
const { labels } = useCiridaeLocale();
|
|
@@ -63,5 +77,5 @@ export function EnvironmentFrame({ label, tone = "info", children, className, ..
|
|
|
63
77
|
rememberDismissedForSession();
|
|
64
78
|
setDismissed(true);
|
|
65
79
|
};
|
|
66
|
-
return (_jsxs("div", { ...props, className: cx(frame, className), children: [shown && (_jsx(SiteBanner, { className: environmentBanner, tone: tone, onDismiss: dismiss, children: typeof label === "string" ? labels.shell.environment(label) : label })), _jsx("div", { className: viewport, children: children })] }));
|
|
80
|
+
return (_jsxs("div", { ...props, className: cx(frame, className), children: [shown && (_jsx(SiteBanner, { ref: publishBannerInset, className: environmentBanner, tone: tone, onDismiss: dismiss, children: typeof label === "string" ? labels.shell.environment(label) : label })), _jsx("div", { className: viewport, children: children })] }));
|
|
67
81
|
}
|
|
@@ -10,6 +10,13 @@ export type PlacedScreenshotPointer = FeedbackScreenshotPointer & {
|
|
|
10
10
|
};
|
|
11
11
|
/** The most pointers one screenshot takes. */
|
|
12
12
|
export declare const MAX_SCREENSHOT_POINTERS = 7;
|
|
13
|
+
/**
|
|
14
|
+
* The page as a PNG object URL, captured once `enabled` turns on: undefined while it renders, null
|
|
15
|
+
* when it could not be. Portaled layers, such as the feedback sheet itself, are left out.
|
|
16
|
+
*/
|
|
17
|
+
export declare function usePageScreenshot(enabled: boolean): string | null | undefined;
|
|
18
|
+
/** The screenshot as a file to upload with the feedback. */
|
|
19
|
+
export declare function screenshotFile(src: string): Promise<File>;
|
|
13
20
|
/** The thumbnail beside "Include a screenshot", and the dialog it opens to annotate it. */
|
|
14
21
|
export declare function FeedbackScreenshot({ src, pointers, onPointersChange, disabled, }: {
|
|
15
22
|
src: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* The feedback form's screenshot: a thumbnail that opens a dialog where clicking the image drops a
|
|
3
|
+
* The feedback form's screenshot: the page captured under the sheet, and a thumbnail that opens a dialog where clicking the image drops a
|
|
4
4
|
* numbered pointer, each with a note. Pointers sit at fractions of the image's width and height,
|
|
5
5
|
* so they land on the same spot at any size.
|
|
6
6
|
*/
|
|
7
7
|
import { XIcon } from "@phosphor-icons/react";
|
|
8
|
-
import {
|
|
8
|
+
import { snapdom } from "@zumer/snapdom";
|
|
9
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
10
|
import { css } from "#primitives/css";
|
|
10
11
|
import { IconButton } from "./button.js";
|
|
11
12
|
import { Textarea } from "./form-controls.js";
|
|
@@ -118,6 +119,44 @@ const thumbnailCount = css({
|
|
|
118
119
|
lineHeight: "tight",
|
|
119
120
|
fontVariantNumeric: "tabular-nums",
|
|
120
121
|
});
|
|
122
|
+
/**
|
|
123
|
+
* The page as a PNG object URL, captured once `enabled` turns on: undefined while it renders, null
|
|
124
|
+
* when it could not be. Portaled layers, such as the feedback sheet itself, are left out.
|
|
125
|
+
*/
|
|
126
|
+
export function usePageScreenshot(enabled) {
|
|
127
|
+
const [src, setSrc] = useState();
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
if (!enabled)
|
|
130
|
+
return;
|
|
131
|
+
let live = true;
|
|
132
|
+
let url;
|
|
133
|
+
snapdom(document.body, { exclude: ["[data-base-ui-portal]"], excludeMode: "remove" })
|
|
134
|
+
.then((capture) => capture.toBlob({ type: "png" }))
|
|
135
|
+
.then((blob) => {
|
|
136
|
+
url = URL.createObjectURL(blob);
|
|
137
|
+
if (live)
|
|
138
|
+
setSrc(url);
|
|
139
|
+
else
|
|
140
|
+
URL.revokeObjectURL(url);
|
|
141
|
+
})
|
|
142
|
+
.catch((error) => {
|
|
143
|
+
console.warn("Could not capture the page for feedback", error);
|
|
144
|
+
if (live)
|
|
145
|
+
setSrc(null);
|
|
146
|
+
});
|
|
147
|
+
return () => {
|
|
148
|
+
live = false;
|
|
149
|
+
if (url)
|
|
150
|
+
URL.revokeObjectURL(url);
|
|
151
|
+
};
|
|
152
|
+
}, [enabled]);
|
|
153
|
+
return src;
|
|
154
|
+
}
|
|
155
|
+
/** The screenshot as a file to upload with the feedback. */
|
|
156
|
+
export async function screenshotFile(src) {
|
|
157
|
+
const blob = await (await fetch(src)).blob();
|
|
158
|
+
return new File([blob], `screenshot.${blob.type.split("/")[1] ?? "png"}`, { type: blob.type });
|
|
159
|
+
}
|
|
121
160
|
function placeAt(pointer) {
|
|
122
161
|
return { left: `${pointer.x * 100}%`, top: `${pointer.y * 100}%` };
|
|
123
162
|
}
|
|
@@ -10,7 +10,7 @@ export type FeedbackSheetValues = {
|
|
|
10
10
|
includeScreenshot: boolean;
|
|
11
11
|
/** Pointers on the screenshot, in order; empty when it is not included. */
|
|
12
12
|
annotations: FeedbackScreenshotPointer[];
|
|
13
|
-
/** Files to upload with the feedback, within `feedbackAttachmentLimits`. */
|
|
13
|
+
/** Files to upload with the feedback, the screenshot among them, within `feedbackAttachmentLimits`. */
|
|
14
14
|
attachments: File[];
|
|
15
15
|
};
|
|
16
16
|
export type { FeedbackScreenshotPointer };
|
|
@@ -31,7 +31,10 @@ export type FeedbackLabels = CiridaeLabels["feedback"];
|
|
|
31
31
|
export declare function formatFeedbackDescription({ whatHappened, annotations }: FeedbackSheetValues): string;
|
|
32
32
|
export type FeedbackFormProps = {
|
|
33
33
|
where: FeedbackWhere;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The page as the person sees it, as a same-origin image, object or data URL, since it is
|
|
36
|
+
* fetched to upload; captured on open when left out.
|
|
37
|
+
*/
|
|
35
38
|
screenshot?: string;
|
|
36
39
|
/** Sends the feedback; rejecting shows the failed state with the message kept for a retry. */
|
|
37
40
|
onSubmit: (values: FeedbackSheetValues) => Promise<{
|
|
@@ -20,7 +20,7 @@ import { useCopy } from "./copyable-id.js";
|
|
|
20
20
|
import { DateTime } from "./date-time.js";
|
|
21
21
|
import { Drawer, DrawerBody, DrawerField, DrawerFooter, DrawerForm } from "./drawer.js";
|
|
22
22
|
import { Dropzone, DropzoneFileList, DropzonePad } from "./dropzone.js";
|
|
23
|
-
import { FeedbackScreenshot, } from "./feedback-screenshot.js";
|
|
23
|
+
import { FeedbackScreenshot, screenshotFile, usePageScreenshot, } from "./feedback-screenshot.js";
|
|
24
24
|
import { FilterBar, matchesFilter } from "./filter-bar.js";
|
|
25
25
|
import { Checkbox, Textarea } from "./form-controls.js";
|
|
26
26
|
import { directional, icon, Spinner } from "./icon.js";
|
|
@@ -123,8 +123,6 @@ const screenshotPreview = css({
|
|
|
123
123
|
borderRadius: "keycap",
|
|
124
124
|
background: "bg.field",
|
|
125
125
|
color: "fg.muted",
|
|
126
|
-
fontSize: "code",
|
|
127
|
-
fontWeight: "medium",
|
|
128
126
|
});
|
|
129
127
|
const sent = css({
|
|
130
128
|
display: "flex",
|
|
@@ -283,6 +281,13 @@ export function FeedbackForm({ where: about, screenshot, onSubmit, errorDetail,
|
|
|
283
281
|
const [sendState, setSendState] = useState({ status: "idle" });
|
|
284
282
|
const messageErrorId = useId();
|
|
285
283
|
const submitting = sendState.status === "submitting";
|
|
284
|
+
const captured = usePageScreenshot(screenshot === undefined);
|
|
285
|
+
const image = screenshot ?? captured;
|
|
286
|
+
// Sending waits for an included screenshot that is still capturing.
|
|
287
|
+
const capturing = includeScreenshot && image === undefined;
|
|
288
|
+
const { count, bytes } = feedbackAttachmentLimits;
|
|
289
|
+
// An included screenshot, captured or still capturing, takes one of the slots.
|
|
290
|
+
const fileSlots = count - (includeScreenshot && image !== null ? 1 : 0);
|
|
286
291
|
const reset = () => {
|
|
287
292
|
setKind("wrong");
|
|
288
293
|
setWhatHappened("");
|
|
@@ -295,18 +300,17 @@ export function FeedbackForm({ where: about, screenshot, onSubmit, errorDetail,
|
|
|
295
300
|
};
|
|
296
301
|
// Keeps what fits the limits and names the first file or limit that did not.
|
|
297
302
|
const addAttachments = (files) => {
|
|
298
|
-
const { count, bytes } = feedbackAttachmentLimits;
|
|
299
303
|
const empty = files.find((file) => file.size === 0);
|
|
300
304
|
const oversize = files.find((file) => file.size > bytes);
|
|
301
305
|
const fitting = files.filter((file) => file.size > 0 && file.size <= bytes);
|
|
302
|
-
const added = fitting.slice(0, Math.max(0,
|
|
306
|
+
const added = fitting.slice(0, Math.max(0, fileSlots - attachments.length));
|
|
303
307
|
setAttachments([...attachments, ...added]);
|
|
304
308
|
setAttachmentError(oversize
|
|
305
309
|
? labels.fileTooLarge(oversize.name, formatFileSize(bytes))
|
|
306
310
|
: empty
|
|
307
311
|
? labels.fileEmpty(empty.name)
|
|
308
312
|
: added.length < fitting.length
|
|
309
|
-
? labels.tooManyFiles(
|
|
313
|
+
? labels.tooManyFiles(fileSlots)
|
|
310
314
|
: null);
|
|
311
315
|
};
|
|
312
316
|
const removeAttachment = (removed) => {
|
|
@@ -321,6 +325,21 @@ export function FeedbackForm({ where: about, screenshot, onSubmit, errorDetail,
|
|
|
321
325
|
setValidation(null);
|
|
322
326
|
setSendState({ status: "submitting" });
|
|
323
327
|
try {
|
|
328
|
+
const screenshotUpload = includeScreenshot && image ? await screenshotFile(image) : null;
|
|
329
|
+
// Files added while the screenshot was off can leave it no slot, and a long page can
|
|
330
|
+
// capture over the size limit.
|
|
331
|
+
const limitError = !screenshotUpload
|
|
332
|
+
? null
|
|
333
|
+
: screenshotUpload.size > bytes
|
|
334
|
+
? labels.fileTooLarge(screenshotUpload.name, formatFileSize(bytes))
|
|
335
|
+
: attachments.length >= count
|
|
336
|
+
? labels.tooManyFiles(count - 1)
|
|
337
|
+
: null;
|
|
338
|
+
if (limitError) {
|
|
339
|
+
setAttachmentError(limitError);
|
|
340
|
+
setSendState({ status: "idle" });
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
324
343
|
const { reference } = await onSubmit({
|
|
325
344
|
kind,
|
|
326
345
|
whatHappened: whatHappened.trim(),
|
|
@@ -328,7 +347,7 @@ export function FeedbackForm({ where: about, screenshot, onSubmit, errorDetail,
|
|
|
328
347
|
annotations: includeScreenshot
|
|
329
348
|
? pointers.map((pointer) => ({ x: pointer.x, y: pointer.y, note: pointer.note.trim() }))
|
|
330
349
|
: [],
|
|
331
|
-
attachments,
|
|
350
|
+
attachments: screenshotUpload ? [...attachments, screenshotUpload] : attachments,
|
|
332
351
|
});
|
|
333
352
|
setSendState({ status: "sent", reference });
|
|
334
353
|
}
|
|
@@ -343,7 +362,7 @@ export function FeedbackForm({ where: about, screenshot, onSubmit, errorDetail,
|
|
|
343
362
|
return (_jsxs(DrawerForm, { noValidate: true, onSubmit: (event) => {
|
|
344
363
|
event.preventDefault();
|
|
345
364
|
void send();
|
|
346
|
-
}, children: [_jsxs(Dropzone, { render: _jsx(DrawerBody, { className: body }), disabled: submitting, onFiles: addAttachments, children: [sendState.status === "error" && (_jsx(FailedNotice, { title: labels.sendFailed, children: errorDetail?.(sendState.error) })), _jsx(DrawerField, { label: labels.type, children: _jsx(Select, { label: labels.type, size: "medium", options: kindOptions(labels), value: kind, disabled: submitting, onValueChange: (value) => isFeedbackKind(value) && setKind(value) }) }), _jsx(DrawerField, { label: labels.where, children: _jsx("div", { className: where, children: whereContent }) }), _jsx(DrawerField, { label: labels.whatHappened, error: validation, children: _jsx(Textarea, { className: message, value: whatHappened, placeholder: labels.whatHappenedPlaceholder, "aria-invalid": validation ? true : undefined, "aria-describedby": validation ? messageErrorId : undefined, disabled: submitting, onChange: (event) => setWhatHappened(event.target.value) }) }), _jsxs("div", { className: screenshotRow, children: [_jsx(Checkbox, { checked: includeScreenshot, disabled: submitting, onCheckedChange: (checked) => setIncludeScreenshot(checked), children: _jsx("span", { className: screenshotCopy, children: labels.includeScreenshot }) }),
|
|
365
|
+
}, children: [_jsxs(Dropzone, { render: _jsx(DrawerBody, { className: body }), disabled: submitting, onFiles: addAttachments, children: [sendState.status === "error" && (_jsx(FailedNotice, { title: labels.sendFailed, children: errorDetail?.(sendState.error) })), _jsx(DrawerField, { label: labels.type, children: _jsx(Select, { label: labels.type, size: "medium", options: kindOptions(labels), value: kind, disabled: submitting, onValueChange: (value) => isFeedbackKind(value) && setKind(value) }) }), _jsx(DrawerField, { label: labels.where, children: _jsx("div", { className: where, children: whereContent }) }), _jsx(DrawerField, { label: labels.whatHappened, error: validation, children: _jsx(Textarea, { className: message, value: whatHappened, placeholder: labels.whatHappenedPlaceholder, "aria-invalid": validation ? true : undefined, "aria-describedby": validation ? messageErrorId : undefined, disabled: submitting, onChange: (event) => setWhatHappened(event.target.value) }) }), image !== null && (_jsxs("div", { className: screenshotRow, children: [_jsx(Checkbox, { checked: includeScreenshot, disabled: submitting, onCheckedChange: (checked) => setIncludeScreenshot(checked), children: _jsx("span", { className: screenshotCopy, children: labels.includeScreenshot }) }), image ? (_jsx(FeedbackScreenshot, { src: image, pointers: pointers, onPointersChange: setPointers, disabled: submitting || !includeScreenshot })) : (_jsx("span", { className: screenshotPreview, children: _jsx(Spinner, {}) }))] })), _jsxs(DrawerField, { label: labels.attachments, error: attachmentError, children: [_jsx(DropzoneFileList, { files: attachments, pending: submitting, disabled: submitting, onRemove: removeAttachment }), _jsx(DropzonePad, {})] })] }), _jsxs(DrawerFooter, { children: [_jsx(Button, { size: "medium", variant: "secondary", disabled: submitting, onClick: onClose, children: locale.common.cancel }), _jsx(Button, { type: "submit", size: "medium", disabled: capturing, loading: submitting, icon: sendState.status === "error" ? (_jsx(ArrowClockwiseIcon, { className: icon({ size: "small" }) })) : undefined, children: submitting
|
|
347
366
|
? labels.sending
|
|
348
367
|
: sendState.status === "error"
|
|
349
368
|
? locale.common.tryAgain
|
|
@@ -16,7 +16,9 @@ import { useCiridaeLocale } from "./locale.js";
|
|
|
16
16
|
import { useResolvedFileUrl } from "./resolved-file-url.js";
|
|
17
17
|
const popup = css({
|
|
18
18
|
position: "fixed",
|
|
19
|
-
|
|
19
|
+
top: "layout.bannerInset",
|
|
20
|
+
insetInline: "none",
|
|
21
|
+
bottom: "none",
|
|
20
22
|
zIndex: "dialog",
|
|
21
23
|
display: "grid",
|
|
22
24
|
gridTemplateRows: "auto minmax(0, 1fr)",
|
|
@@ -169,7 +169,6 @@ export const englishLabels = {
|
|
|
169
169
|
whatHappened: "What happened?",
|
|
170
170
|
whatHappenedPlaceholder: "Tell us what happened",
|
|
171
171
|
includeScreenshot: "Include a screenshot",
|
|
172
|
-
preview: "Preview",
|
|
173
172
|
attachments: "Attachments",
|
|
174
173
|
kindWrong: "Something is wrong",
|
|
175
174
|
kindIdea: "An idea",
|
|
@@ -38,13 +38,13 @@ const dialogShell = css.raw({
|
|
|
38
38
|
"--dialog-sheet": "token(sizes.overlay.dialog)",
|
|
39
39
|
zIndex: "dialog",
|
|
40
40
|
position: "fixed",
|
|
41
|
-
top: "[50%]",
|
|
41
|
+
top: "[calc(50% + token(spacing.layout.bannerInset) / 2)]",
|
|
42
42
|
left: "[50%]",
|
|
43
43
|
display: "grid",
|
|
44
44
|
gridTemplateRows: "minmax(0, 1fr)",
|
|
45
45
|
width: "[calc(100vw - token(spacing.layout.pageGap) * 2)]",
|
|
46
46
|
maxWidth: "[calc(var(--dialog-sheet) + 2 * (token(spacing.layout.tightGap) + token(sizes.border.hairline)))]",
|
|
47
|
-
maxHeight: "[calc(100dvh - token(spacing.layout.pageGap) * 2)]",
|
|
47
|
+
maxHeight: "[calc(100dvh - token(spacing.layout.bannerInset) - token(spacing.layout.pageGap) * 2)]",
|
|
48
48
|
padding: "layout.tightGap",
|
|
49
49
|
border: "1px solid token(colors.border.control)",
|
|
50
50
|
borderRadius: "shell",
|
package/dist/components/shell.js
CHANGED
|
@@ -55,7 +55,8 @@ const sidebar = css({
|
|
|
55
55
|
// button, with its full labelled content rather than the rail.
|
|
56
56
|
_phone: {
|
|
57
57
|
position: "fixed",
|
|
58
|
-
|
|
58
|
+
top: "layout.bannerInset",
|
|
59
|
+
bottom: "none",
|
|
59
60
|
insetInlineStart: "none",
|
|
60
61
|
zIndex: "drawer",
|
|
61
62
|
width: "shell.sidebar",
|
package/dist/feedback/client.js
CHANGED
|
@@ -32,15 +32,24 @@ class FeedbackClient {
|
|
|
32
32
|
__classPrivateFieldSet(this, _FeedbackClient_getBearerToken, config.getBearerToken, "f");
|
|
33
33
|
}
|
|
34
34
|
async create(input, options) {
|
|
35
|
+
const pageUrl = input.pageUrl ?? globalThis.location?.href;
|
|
36
|
+
const page = pageUrl ? new URL(pageUrl) : undefined;
|
|
37
|
+
if (page) {
|
|
38
|
+
page.username = "";
|
|
39
|
+
page.password = "";
|
|
40
|
+
page.search = "";
|
|
41
|
+
page.hash = "";
|
|
42
|
+
}
|
|
43
|
+
const payload = { ...input, pageUrl: page?.toString() };
|
|
35
44
|
let form;
|
|
36
45
|
if (options?.files?.length) {
|
|
37
46
|
form = new FormData();
|
|
38
|
-
form.append("feedback", JSON.stringify(
|
|
47
|
+
form.append("feedback", JSON.stringify(payload));
|
|
39
48
|
for (const file of options.files)
|
|
40
49
|
form.append("files", file);
|
|
41
50
|
}
|
|
42
51
|
return __classPrivateFieldGet(this, _FeedbackClient_instances, "m", _FeedbackClient_request).call(this, "/", feedbackItemSchema, {
|
|
43
|
-
body: form ? undefined :
|
|
52
|
+
body: form ? undefined : payload,
|
|
44
53
|
form,
|
|
45
54
|
headers: { "Idempotency-Key": options?.idempotencyKey ?? crypto.randomUUID() },
|
|
46
55
|
method: "POST",
|
|
@@ -28,6 +28,7 @@ declare const feedbackCreateInputSchema: z.ZodObject<{
|
|
|
28
28
|
just_me: "just_me";
|
|
29
29
|
my_team: "my_team";
|
|
30
30
|
}>>>;
|
|
31
|
+
pageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
31
32
|
}, z.core.$strict>;
|
|
32
33
|
declare const feedbackErrorResponseSchema: z.ZodObject<{
|
|
33
34
|
detail: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { BodyCreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPost, ClientOptions, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostData, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostError, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostErrors, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostResponse, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostResponses, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostData, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostError, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostErrors, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostResponse, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostResponses, FeedbackAttachment, FeedbackCreateRequest, FeedbackErrorDetail, FeedbackErrorResponse, FeedbackItem, FeedbackListResponse, FeedbackMessage, FeedbackMessageAuthor, FeedbackMessageCreateRequest, FeedbackStatusEvent, FeedbackSummary, FeedbackUpdateRequest, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetData, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetError, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetErrors, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetResponse, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetResponses, HttpErrorResponse, HttpValidationError, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetData, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetError, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetErrors, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetResponse, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetResponses, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchData, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchError, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchErrors, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchResponse, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchResponses, ValidationError, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostData, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostError, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostErrors, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostResponse, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostResponses } from './types.gen';
|
|
1
|
+
export type { BodyCreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPost, ClientOptions, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostData, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostError, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostErrors, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostResponse, CreateFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdMessagesPostResponses, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostData, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostError, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostErrors, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostResponse, CreateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackPostResponses, CreateOperatorFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdMessagesPostData, CreateOperatorFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdMessagesPostError, CreateOperatorFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdMessagesPostErrors, CreateOperatorFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdMessagesPostResponse, CreateOperatorFeedbackMessageV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdMessagesPostResponses, FeedbackAttachment, FeedbackCreateRequest, FeedbackErrorDetail, FeedbackErrorResponse, FeedbackItem, FeedbackListResponse, FeedbackMessage, FeedbackMessageAuthor, FeedbackMessageCreateRequest, FeedbackStatusEvent, FeedbackSummary, FeedbackUpdateRequest, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetData, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetError, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetErrors, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetResponse, GetFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdGetResponses, GetOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdGetData, GetOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdGetError, GetOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdGetErrors, GetOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdGetResponse, GetOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdGetResponses, HttpErrorResponse, HttpValidationError, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetData, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetError, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetErrors, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetResponse, ListFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackGetResponses, ListOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorGetData, ListOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorGetError, ListOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorGetErrors, ListOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorGetResponse, ListOperatorFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorGetResponses, OperatorFeedbackItem, OperatorFeedbackListResponse, OperatorFeedbackStatusUpdateRequest, OperatorFeedbackSummary, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchData, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchError, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchErrors, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchResponse, UpdateFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdPatchResponses, UpdateOperatorFeedbackStatusV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdPatchData, UpdateOperatorFeedbackStatusV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdPatchError, UpdateOperatorFeedbackStatusV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdPatchErrors, UpdateOperatorFeedbackStatusV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdPatchResponse, UpdateOperatorFeedbackStatusV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackOperatorFeedbackIdPatchResponses, ValidationError, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostData, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostError, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostErrors, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostResponse, WithdrawFeedbackV1ProjectsProjectIdEnvironmentsEnvironmentFeedbackFeedbackIdWithdrawPostResponses } from './types.gen';
|