feedback-vos 1.0.29 → 1.0.30
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/index.js +351 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +353 -47
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +363 -36
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChatTeardropDots, ArrowLeft, X, Paperclip, Trash, Camera, CircleNotch } from 'phosphor-react';
|
|
1
|
+
import { ChatTeardropDots, ArrowLeft, X, Paperclip, Trash, Camera, CircleNotch, ArrowCounterClockwise, Check } from 'phosphor-react';
|
|
2
2
|
import { Popover } from '@headlessui/react';
|
|
3
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
+
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import html2canvas from 'html2canvas';
|
|
6
6
|
|
|
@@ -69,19 +69,19 @@ function FeedbackTypeStep({ onFeedbackTypeChanged, language }) {
|
|
|
69
69
|
const feedbackTypes = getFeedbackTypes(language);
|
|
70
70
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
71
|
/* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
72
|
-
/* @__PURE__ */ jsx("span", { className: "text-xl leading-6", children: t.form.header }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg md:text-xl leading-6", children: t.form.header }),
|
|
73
73
|
/* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton })
|
|
74
74
|
] }),
|
|
75
|
-
/* @__PURE__ */ jsx("div", { className: "flex py-8 gap-2 w-full", children: Object.entries(feedbackTypes).map(([key, value]) => {
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "flex py-6 md:py-8 gap-2 md:gap-2 w-full justify-center md:justify-start flex-wrap", children: Object.entries(feedbackTypes).map(([key, value]) => {
|
|
76
76
|
return /* @__PURE__ */ jsxs(
|
|
77
77
|
"button",
|
|
78
78
|
{
|
|
79
|
-
className: "bg-zinc-800 rounded py-5 w-24
|
|
79
|
+
className: "bg-zinc-800 rounded py-4 md:py-5 flex-1 min-w-[80px] md:w-24 flex flex-col items-center gap-2 border-2 border-transparent hover:border-brand-500 focus:border-brand-500 focus:outline-none transition-colors",
|
|
80
80
|
type: "button",
|
|
81
81
|
onClick: () => onFeedbackTypeChanged(key),
|
|
82
82
|
children: [
|
|
83
|
-
/* @__PURE__ */ jsx("img", { src: value.image.source, alt: value.image.alt }),
|
|
84
|
-
/* @__PURE__ */ jsx("span", { children: value.title })
|
|
83
|
+
/* @__PURE__ */ jsx("img", { src: value.image.source, alt: value.image.alt, className: "w-5 h-5 md:w-6 md:h-6" }),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs md:text-sm text-center", children: value.title })
|
|
85
85
|
]
|
|
86
86
|
},
|
|
87
87
|
key
|
|
@@ -92,33 +92,338 @@ function FeedbackTypeStep({ onFeedbackTypeChanged, language }) {
|
|
|
92
92
|
function Loading() {
|
|
93
93
|
return /* @__PURE__ */ jsx("div", { className: "w-4 h-4 flex items-center justify-center overflow-hidden ", children: /* @__PURE__ */ jsx(CircleNotch, { weight: "bold", className: "w-4 h-4 animate-spin" }) });
|
|
94
94
|
}
|
|
95
|
+
function ScreenshotEditor({
|
|
96
|
+
screenshot,
|
|
97
|
+
onSave,
|
|
98
|
+
onCancel,
|
|
99
|
+
language
|
|
100
|
+
}) {
|
|
101
|
+
const canvasRef = useRef(null);
|
|
102
|
+
const [isDrawing, setIsDrawing] = useState(false);
|
|
103
|
+
const [color, setColor] = useState("#ef4444");
|
|
104
|
+
const [brushSize, setBrushSize] = useState(3);
|
|
105
|
+
const [image, setImage] = useState(null);
|
|
106
|
+
const t = {
|
|
107
|
+
en: {
|
|
108
|
+
save: "Save",
|
|
109
|
+
cancel: "Cancel",
|
|
110
|
+
clear: "Clear",
|
|
111
|
+
undo: "Undo"
|
|
112
|
+
},
|
|
113
|
+
nl: {
|
|
114
|
+
save: "Opslaan",
|
|
115
|
+
cancel: "Annuleren",
|
|
116
|
+
clear: "Wissen",
|
|
117
|
+
undo: "Ongedaan maken"
|
|
118
|
+
}
|
|
119
|
+
}[language];
|
|
120
|
+
const colors = [
|
|
121
|
+
"#ef4444",
|
|
122
|
+
// red-500
|
|
123
|
+
"#f59e0b",
|
|
124
|
+
// amber-500
|
|
125
|
+
"#eab308",
|
|
126
|
+
// yellow-500
|
|
127
|
+
"#22c55e",
|
|
128
|
+
// green-500
|
|
129
|
+
"#3b82f6",
|
|
130
|
+
// blue-500
|
|
131
|
+
"#8b5cf6",
|
|
132
|
+
// violet-500
|
|
133
|
+
"#ec4899",
|
|
134
|
+
// pink-500
|
|
135
|
+
"#ffffff",
|
|
136
|
+
// white
|
|
137
|
+
"#000000"
|
|
138
|
+
// black
|
|
139
|
+
];
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
const img = new Image();
|
|
142
|
+
img.onload = () => {
|
|
143
|
+
setImage(img);
|
|
144
|
+
if (canvasRef.current) {
|
|
145
|
+
const canvas = canvasRef.current;
|
|
146
|
+
canvas.width = img.width;
|
|
147
|
+
canvas.height = img.height;
|
|
148
|
+
const ctx = canvas.getContext("2d");
|
|
149
|
+
if (ctx) {
|
|
150
|
+
ctx.drawImage(img, 0, 0);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
img.src = screenshot;
|
|
155
|
+
}, [screenshot]);
|
|
156
|
+
const getCoordinates = useCallback((e) => {
|
|
157
|
+
const canvas = canvasRef.current;
|
|
158
|
+
if (!canvas) return { x: 0, y: 0 };
|
|
159
|
+
const rect = canvas.getBoundingClientRect();
|
|
160
|
+
const scaleX = canvas.width / rect.width;
|
|
161
|
+
const scaleY = canvas.height / rect.height;
|
|
162
|
+
if ("touches" in e) {
|
|
163
|
+
const touch = e.touches[0] || e.changedTouches[0];
|
|
164
|
+
return {
|
|
165
|
+
x: (touch.clientX - rect.left) * scaleX,
|
|
166
|
+
y: (touch.clientY - rect.top) * scaleY
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
return {
|
|
170
|
+
x: (e.clientX - rect.left) * scaleX,
|
|
171
|
+
y: (e.clientY - rect.top) * scaleY
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}, []);
|
|
175
|
+
const startDrawing = useCallback((e) => {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
const canvas = canvasRef.current;
|
|
178
|
+
if (!canvas) return;
|
|
179
|
+
const ctx = canvas.getContext("2d");
|
|
180
|
+
if (!ctx) return;
|
|
181
|
+
const { x, y } = getCoordinates(e);
|
|
182
|
+
setIsDrawing(true);
|
|
183
|
+
ctx.beginPath();
|
|
184
|
+
ctx.moveTo(x, y);
|
|
185
|
+
ctx.strokeStyle = color;
|
|
186
|
+
ctx.lineWidth = brushSize;
|
|
187
|
+
ctx.lineCap = "round";
|
|
188
|
+
ctx.lineJoin = "round";
|
|
189
|
+
}, [color, brushSize, getCoordinates]);
|
|
190
|
+
const draw = useCallback((e) => {
|
|
191
|
+
if (!isDrawing) return;
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
const canvas = canvasRef.current;
|
|
194
|
+
if (!canvas) return;
|
|
195
|
+
const ctx = canvas.getContext("2d");
|
|
196
|
+
if (!ctx) return;
|
|
197
|
+
const { x, y } = getCoordinates(e);
|
|
198
|
+
ctx.lineTo(x, y);
|
|
199
|
+
ctx.stroke();
|
|
200
|
+
}, [isDrawing, getCoordinates]);
|
|
201
|
+
const stopDrawing = useCallback(() => {
|
|
202
|
+
setIsDrawing(false);
|
|
203
|
+
}, []);
|
|
204
|
+
const clearCanvas = () => {
|
|
205
|
+
const canvas = canvasRef.current;
|
|
206
|
+
if (!canvas || !image) return;
|
|
207
|
+
const ctx = canvas.getContext("2d");
|
|
208
|
+
if (!ctx) return;
|
|
209
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
210
|
+
ctx.drawImage(image, 0, 0);
|
|
211
|
+
};
|
|
212
|
+
const undo = () => {
|
|
213
|
+
const canvas = canvasRef.current;
|
|
214
|
+
if (!canvas || !image) return;
|
|
215
|
+
const ctx = canvas.getContext("2d");
|
|
216
|
+
if (!ctx) return;
|
|
217
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
218
|
+
ctx.drawImage(image, 0, 0);
|
|
219
|
+
};
|
|
220
|
+
const handleSave = () => {
|
|
221
|
+
const canvas = canvasRef.current;
|
|
222
|
+
if (!canvas) return;
|
|
223
|
+
const editedScreenshot = canvas.toDataURL("image/png");
|
|
224
|
+
onSave(editedScreenshot);
|
|
225
|
+
};
|
|
226
|
+
const maxWidth = 600;
|
|
227
|
+
const displayWidth = image ? Math.min(maxWidth, image.width) : maxWidth;
|
|
228
|
+
const displayHeight = image ? displayWidth / image.width * image.height : 400;
|
|
229
|
+
return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-2 md:p-4", children: /* @__PURE__ */ jsxs("div", { className: "bg-zinc-800 rounded-lg shadow-xl max-w-4xl w-full max-h-[95vh] md:max-h-[90vh] overflow-auto", children: [
|
|
230
|
+
/* @__PURE__ */ jsxs("div", { className: "sticky top-0 bg-zinc-800 border-b border-zinc-700 p-2 md:p-4 flex items-center justify-between z-10 gap-2", children: [
|
|
231
|
+
/* @__PURE__ */ jsx("h3", { className: "text-base md:text-lg font-semibold text-zinc-100 truncate", children: language === "nl" ? "Teken op screenshot" : "Draw on screenshot" }),
|
|
232
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1 md:gap-2 flex-shrink-0", children: [
|
|
233
|
+
/* @__PURE__ */ jsx(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
type: "button",
|
|
237
|
+
onClick: undo,
|
|
238
|
+
className: "p-1.5 md:p-2 bg-zinc-700 hover:bg-zinc-600 rounded-md text-zinc-100 transition-colors touch-manipulation",
|
|
239
|
+
title: t.undo,
|
|
240
|
+
children: /* @__PURE__ */ jsx(ArrowCounterClockwise, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
/* @__PURE__ */ jsx(
|
|
244
|
+
"button",
|
|
245
|
+
{
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: clearCanvas,
|
|
248
|
+
className: "p-1.5 md:p-2 bg-zinc-700 hover:bg-zinc-600 rounded-md text-zinc-100 transition-colors touch-manipulation",
|
|
249
|
+
title: t.clear,
|
|
250
|
+
children: /* @__PURE__ */ jsx(Trash, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsx(
|
|
254
|
+
"button",
|
|
255
|
+
{
|
|
256
|
+
type: "button",
|
|
257
|
+
onClick: onCancel,
|
|
258
|
+
className: "p-1.5 md:p-2 bg-zinc-700 hover:bg-zinc-600 rounded-md text-zinc-100 transition-colors touch-manipulation",
|
|
259
|
+
title: t.cancel,
|
|
260
|
+
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ jsx(
|
|
264
|
+
"button",
|
|
265
|
+
{
|
|
266
|
+
type: "button",
|
|
267
|
+
onClick: handleSave,
|
|
268
|
+
className: "p-1.5 md:p-2 bg-brand-500 hover:bg-brand-400 rounded-md text-zinc-100 transition-colors touch-manipulation",
|
|
269
|
+
title: t.save,
|
|
270
|
+
children: /* @__PURE__ */ jsx(Check, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] })
|
|
274
|
+
] }),
|
|
275
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3 md:p-4", children: [
|
|
276
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 md:mb-4 flex flex-col md:flex-row items-start md:items-center gap-2 md:gap-4", children: [
|
|
277
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs md:text-sm text-zinc-300 whitespace-nowrap", children: language === "nl" ? "Kleur:" : "Color:" }),
|
|
278
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 md:gap-2 flex-wrap", children: colors.map((c) => /* @__PURE__ */ jsx(
|
|
279
|
+
"button",
|
|
280
|
+
{
|
|
281
|
+
type: "button",
|
|
282
|
+
onClick: () => setColor(c),
|
|
283
|
+
className: `w-7 h-7 md:w-8 md:h-8 rounded-full border-2 transition-all touch-manipulation ${color === c ? "border-zinc-100 scale-110" : "border-zinc-600 hover:border-zinc-500"}`,
|
|
284
|
+
style: { backgroundColor: c },
|
|
285
|
+
title: c
|
|
286
|
+
},
|
|
287
|
+
c
|
|
288
|
+
)) })
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 md:mb-4 flex flex-col md:flex-row items-start md:items-center gap-2 md:gap-4", children: [
|
|
291
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs md:text-sm text-zinc-300 whitespace-nowrap", children: language === "nl" ? "Grootte:" : "Size:" }),
|
|
292
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full md:w-auto", children: [
|
|
293
|
+
/* @__PURE__ */ jsx(
|
|
294
|
+
"input",
|
|
295
|
+
{
|
|
296
|
+
type: "range",
|
|
297
|
+
min: "1",
|
|
298
|
+
max: "10",
|
|
299
|
+
value: brushSize,
|
|
300
|
+
onChange: (e) => setBrushSize(Number(e.target.value)),
|
|
301
|
+
className: "flex-1 md:flex-none md:max-w-xs"
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs md:text-sm text-zinc-400 w-6 md:w-8 text-right", children: brushSize })
|
|
305
|
+
] })
|
|
306
|
+
] }),
|
|
307
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center bg-zinc-900 rounded-lg p-2 md:p-4 overflow-auto", children: /* @__PURE__ */ jsx(
|
|
308
|
+
"canvas",
|
|
309
|
+
{
|
|
310
|
+
ref: canvasRef,
|
|
311
|
+
onMouseDown: startDrawing,
|
|
312
|
+
onMouseMove: draw,
|
|
313
|
+
onMouseUp: stopDrawing,
|
|
314
|
+
onMouseLeave: stopDrawing,
|
|
315
|
+
onTouchStart: startDrawing,
|
|
316
|
+
onTouchMove: draw,
|
|
317
|
+
onTouchEnd: stopDrawing,
|
|
318
|
+
className: "cursor-crosshair border border-zinc-700 rounded touch-none",
|
|
319
|
+
style: {
|
|
320
|
+
width: `${displayWidth}px`,
|
|
321
|
+
height: `${displayHeight}px`,
|
|
322
|
+
maxWidth: "100%",
|
|
323
|
+
maxHeight: "calc(95vh - 200px)"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
) })
|
|
327
|
+
] })
|
|
328
|
+
] }) });
|
|
329
|
+
}
|
|
95
330
|
function ScreenshotButton({
|
|
96
331
|
screenshot,
|
|
97
|
-
onScreenshotTook
|
|
332
|
+
onScreenshotTook,
|
|
333
|
+
language = "en"
|
|
98
334
|
}) {
|
|
99
335
|
const [isTakenScreenshot, setIsTakenScreenShot] = useState(false);
|
|
336
|
+
const [showEditor, setShowEditor] = useState(false);
|
|
337
|
+
const [tempScreenshot, setTempScreenshot] = useState(null);
|
|
100
338
|
async function handleTakeScreenshot() {
|
|
101
339
|
setIsTakenScreenShot(true);
|
|
102
340
|
const canvas = await html2canvas(document.querySelector("html"));
|
|
103
341
|
const base64image = canvas.toDataURL("image/png");
|
|
104
|
-
|
|
342
|
+
setTempScreenshot(base64image);
|
|
343
|
+
setShowEditor(true);
|
|
105
344
|
setIsTakenScreenShot(false);
|
|
106
345
|
}
|
|
346
|
+
function handleEditorSave(editedScreenshot) {
|
|
347
|
+
onScreenshotTook(editedScreenshot);
|
|
348
|
+
setShowEditor(false);
|
|
349
|
+
setTempScreenshot(null);
|
|
350
|
+
}
|
|
351
|
+
function handleEditorCancel() {
|
|
352
|
+
setShowEditor(false);
|
|
353
|
+
setTempScreenshot(null);
|
|
354
|
+
}
|
|
355
|
+
function handleEditScreenshot() {
|
|
356
|
+
if (screenshot) {
|
|
357
|
+
setTempScreenshot(screenshot);
|
|
358
|
+
setShowEditor(true);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (showEditor && (tempScreenshot || screenshot)) {
|
|
362
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
363
|
+
/* @__PURE__ */ jsx(
|
|
364
|
+
ScreenshotEditor,
|
|
365
|
+
{
|
|
366
|
+
screenshot: tempScreenshot || screenshot,
|
|
367
|
+
onSave: handleEditorSave,
|
|
368
|
+
onCancel: handleEditorCancel,
|
|
369
|
+
language
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
screenshot && !tempScreenshot ? /* @__PURE__ */ jsx(
|
|
373
|
+
"button",
|
|
374
|
+
{
|
|
375
|
+
type: "button",
|
|
376
|
+
className: "p-1 w-10 h-10 rounded-md border-transparent flex \n justify-end items-end text-zinc-400 hover:text-zinc-100 transition-colors",
|
|
377
|
+
onClick: () => onScreenshotTook(null),
|
|
378
|
+
style: {
|
|
379
|
+
backgroundImage: `url(${screenshot})`,
|
|
380
|
+
backgroundPosition: "right bottom",
|
|
381
|
+
backgroundSize: 180
|
|
382
|
+
},
|
|
383
|
+
children: /* @__PURE__ */ jsx(Trash, { weight: "fill" })
|
|
384
|
+
}
|
|
385
|
+
) : /* @__PURE__ */ jsx(
|
|
386
|
+
"button",
|
|
387
|
+
{
|
|
388
|
+
type: "button",
|
|
389
|
+
className: "p-2 bg-zinc-800 rounded-md border-transparent hover:bg-zinc-700\n transitions-colors focus:outline-none focus:ring-2\n focus:ring-offset-2 focus:ring-offset-zinc-900 focus:ring-brand-500",
|
|
390
|
+
onClick: handleTakeScreenshot,
|
|
391
|
+
children: isTakenScreenshot ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(Camera, { weight: "bold", className: "w-6 h-6" })
|
|
392
|
+
}
|
|
393
|
+
)
|
|
394
|
+
] });
|
|
395
|
+
}
|
|
107
396
|
if (screenshot) {
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
397
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative group", children: [
|
|
398
|
+
/* @__PURE__ */ jsx(
|
|
399
|
+
"button",
|
|
400
|
+
{
|
|
401
|
+
type: "button",
|
|
402
|
+
className: "p-1 w-10 h-10 rounded-md border-transparent flex \n justify-end items-end text-zinc-400 hover:text-zinc-100 transition-colors relative",
|
|
403
|
+
onClick: handleEditScreenshot,
|
|
404
|
+
style: {
|
|
405
|
+
backgroundImage: `url(${screenshot})`,
|
|
406
|
+
backgroundPosition: "right bottom",
|
|
407
|
+
backgroundSize: 180
|
|
408
|
+
},
|
|
409
|
+
title: language === "nl" ? "Klik om te bewerken" : "Click to edit",
|
|
410
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors rounded-md" })
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
/* @__PURE__ */ jsx(
|
|
414
|
+
"button",
|
|
415
|
+
{
|
|
416
|
+
type: "button",
|
|
417
|
+
onClick: (e) => {
|
|
418
|
+
e.stopPropagation();
|
|
419
|
+
onScreenshotTook(null);
|
|
420
|
+
},
|
|
421
|
+
className: "absolute -top-1 -right-1 w-4 h-4 bg-red-500 hover:bg-red-600 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10",
|
|
422
|
+
title: language === "nl" ? "Verwijderen" : "Delete",
|
|
423
|
+
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-3 h-3 text-white" })
|
|
424
|
+
}
|
|
425
|
+
)
|
|
426
|
+
] });
|
|
122
427
|
}
|
|
123
428
|
return /* @__PURE__ */ jsx(
|
|
124
429
|
"button",
|
|
@@ -254,18 +559,18 @@ function FileUploadButton({
|
|
|
254
559
|
{
|
|
255
560
|
src: uploadedFile.preview,
|
|
256
561
|
alt: uploadedFile.file.name,
|
|
257
|
-
className: "w-6 h-6 object-cover rounded"
|
|
562
|
+
className: "w-5 h-5 md:w-6 md:h-6 object-cover rounded flex-shrink-0"
|
|
258
563
|
}
|
|
259
|
-
) : /* @__PURE__ */ jsx(Paperclip, { className: "w-4 h-4" }),
|
|
260
|
-
/* @__PURE__ */ jsx("span", { className: "text-zinc-300 max-w-[100px] truncate", title: uploadedFile.file.name, children: uploadedFile.file.name }),
|
|
564
|
+
) : /* @__PURE__ */ jsx(Paperclip, { className: "w-3 h-3 md:w-4 md:h-4 flex-shrink-0" }),
|
|
565
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-300 max-w-[80px] md:max-w-[100px] truncate", title: uploadedFile.file.name, children: uploadedFile.file.name }),
|
|
261
566
|
/* @__PURE__ */ jsx(
|
|
262
567
|
"button",
|
|
263
568
|
{
|
|
264
569
|
type: "button",
|
|
265
570
|
onClick: () => handleRemoveFile(uploadedFile.id),
|
|
266
|
-
className: "text-zinc-400 hover:text-zinc-100 transition-colors",
|
|
571
|
+
className: "text-zinc-400 hover:text-zinc-100 transition-colors flex-shrink-0 touch-manipulation",
|
|
267
572
|
title: t.remove,
|
|
268
|
-
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-4 h-4" })
|
|
573
|
+
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-3 h-3 md:w-4 md:h-4" })
|
|
269
574
|
}
|
|
270
575
|
)
|
|
271
576
|
]
|
|
@@ -841,34 +1146,34 @@ function FeedbackContentStep({
|
|
|
841
1146
|
}
|
|
842
1147
|
}
|
|
843
1148
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
844
|
-
/* @__PURE__ */ jsxs("header", { className: "relative w-full pr-8", children: [
|
|
1149
|
+
/* @__PURE__ */ jsxs("header", { className: "relative w-full pr-8 md:pr-8", children: [
|
|
845
1150
|
/* @__PURE__ */ jsx(
|
|
846
1151
|
"button",
|
|
847
1152
|
{
|
|
848
1153
|
type: "button",
|
|
849
|
-
className: "absolute top-5 left-5 text-zinc-400 hover:text-zinc-100 z-10",
|
|
1154
|
+
className: "absolute top-3 md:top-5 left-3 md:left-5 text-zinc-400 hover:text-zinc-100 z-10 p-1",
|
|
850
1155
|
onClick: onFeedbackRestartRequest,
|
|
851
|
-
children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-4 h-4" })
|
|
1156
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-4 h-4 md:w-4 md:h-4" })
|
|
852
1157
|
}
|
|
853
1158
|
),
|
|
854
|
-
/* @__PURE__ */ jsxs("span", { className: "text-xl leading-6 flex items-center gap-2 mt-2 pl-10", children: [
|
|
1159
|
+
/* @__PURE__ */ jsxs("span", { className: "text-lg md:text-xl leading-6 flex items-center gap-2 mt-2 pl-8 md:pl-10", children: [
|
|
855
1160
|
/* @__PURE__ */ jsx(
|
|
856
1161
|
"img",
|
|
857
1162
|
{
|
|
858
1163
|
src: feedbackTypeData.image.source,
|
|
859
1164
|
alt: feedbackTypeData.image.alt,
|
|
860
|
-
className: "w-6 h-6"
|
|
1165
|
+
className: "w-5 h-5 md:w-6 md:h-6"
|
|
861
1166
|
}
|
|
862
1167
|
),
|
|
863
1168
|
feedbackTypeData.title
|
|
864
1169
|
] }),
|
|
865
|
-
/* @__PURE__ */ jsx(CloseButton, { className: "absolute top-5 right-5", title: t.form.closeButton })
|
|
1170
|
+
/* @__PURE__ */ jsx(CloseButton, { className: "absolute top-3 md:top-5 right-3 md:right-5", title: t.form.closeButton })
|
|
866
1171
|
] }),
|
|
867
|
-
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmitFeedback, className: "my-4 w-full", children: [
|
|
1172
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmitFeedback, className: "my-3 md:my-4 w-full", children: [
|
|
868
1173
|
/* @__PURE__ */ jsx(
|
|
869
1174
|
"textarea",
|
|
870
1175
|
{
|
|
871
|
-
className: "min-
|
|
1176
|
+
className: "w-full min-h-[100px] md:min-h-[112px] text-sm \n placeholder-zinc-400 text-zinc-100 border border-zinc-600 bg-transparent rounded-md p-2 md:p-3\n focus:border-brand-500 focus:ring-brand-500 focus:ring-1 resize-none focus:outline-none\n scrollbar-thumb-zinc-700 scrollbar-track-transparent scrollbar-thin",
|
|
872
1177
|
placeholder: t.content.placeholder,
|
|
873
1178
|
onChange: (e) => setComment(e.target.value)
|
|
874
1179
|
}
|
|
@@ -881,12 +1186,13 @@ function FeedbackContentStep({
|
|
|
881
1186
|
language
|
|
882
1187
|
}
|
|
883
1188
|
) }),
|
|
884
|
-
/* @__PURE__ */ jsxs("footer", { className: "
|
|
1189
|
+
/* @__PURE__ */ jsxs("footer", { className: "flex gap-2 mt-3", children: [
|
|
885
1190
|
/* @__PURE__ */ jsx(
|
|
886
1191
|
ScreenshotButton,
|
|
887
1192
|
{
|
|
888
1193
|
screenshot,
|
|
889
|
-
onScreenshotTook: setScreenshot
|
|
1194
|
+
onScreenshotTook: setScreenshot,
|
|
1195
|
+
language
|
|
890
1196
|
}
|
|
891
1197
|
),
|
|
892
1198
|
/* @__PURE__ */ jsx(
|
|
@@ -894,7 +1200,7 @@ function FeedbackContentStep({
|
|
|
894
1200
|
{
|
|
895
1201
|
type: "submit",
|
|
896
1202
|
disabled: comment.length === 0 || isSendingFeedback,
|
|
897
|
-
className: "p-2 bg-brand-500 rounded-md border-transparent flex-1 justify-center\n items-center text-sm hover:bg-brand-300 focus:outline-none focus:ring-2\n focus:ring-offset-2 focus:ring-offset-zinc-900 focus:ring-brand-500\n transition-colors disabled:opacity-50 disabled:cursor-not-allowed\n disabled:hover:bg-brand-500",
|
|
1203
|
+
className: "p-2 bg-brand-500 rounded-md border-transparent flex-1 justify-center\n items-center text-sm hover:bg-brand-300 focus:outline-none focus:ring-2\n focus:ring-offset-2 focus:ring-offset-zinc-900 focus:ring-brand-500\n transition-colors disabled:opacity-50 disabled:cursor-not-allowed\n disabled:hover:bg-brand-500 flex",
|
|
898
1204
|
children: isSendingFeedback ? /* @__PURE__ */ jsx(Loading, {}) : t.content.sendButton
|
|
899
1205
|
}
|
|
900
1206
|
)
|
|
@@ -906,12 +1212,12 @@ function FeedbackSuccessStep({ onFeedbackRestartRequest, language }) {
|
|
|
906
1212
|
const t = getTranslations(language);
|
|
907
1213
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
908
1214
|
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton }) }),
|
|
909
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-10 w-[304px]", children: [
|
|
910
|
-
/* @__PURE__ */ jsxs("svg", { width: "41", height: "40", viewBox: "0 0 41 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1215
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-8 md:py-10 w-full max-w-[304px] px-2", children: [
|
|
1216
|
+
/* @__PURE__ */ jsxs("svg", { width: "41", height: "40", viewBox: "0 0 41 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "w-10 h-10 md:w-[41px] md:h-[40px]", children: [
|
|
911
1217
|
/* @__PURE__ */ jsx("path", { d: "M38.5 34C38.5 36.209 36.709 38 34.5 38H6.5C4.291 38 2.5 36.209 2.5 34V6C2.5 3.791 4.291 2 6.5 2H34.5C36.709 2 38.5 3.791 38.5 6V34Z", fill: "#77B255" }),
|
|
912
1218
|
/* @__PURE__ */ jsx("path", { d: "M31.78 8.36202C30.624 7.61102 29.076 7.94002 28.322 9.09802L17.436 25.877L12.407 21.227C11.393 20.289 9.81103 20.352 8.87403 21.365C7.93703 22.379 7.99903 23.961 9.01303 24.898L16.222 31.564C16.702 32.009 17.312 32.229 17.918 32.229C18.591 32.229 19.452 31.947 20.017 31.09C20.349 30.584 32.517 11.82 32.517 11.82C33.268 10.661 32.938 9.11302 31.78 8.36202Z", fill: "white" })
|
|
913
1219
|
] }),
|
|
914
|
-
/* @__PURE__ */ jsx("span", { className: "text-xl mt-2", children: t.success.message }),
|
|
1220
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg md:text-xl mt-2 text-center", children: t.success.message }),
|
|
915
1221
|
/* @__PURE__ */ jsx(
|
|
916
1222
|
"button",
|
|
917
1223
|
{
|
|
@@ -957,7 +1263,7 @@ function WidgetForm({ integration, githubConfig, language }) {
|
|
|
957
1263
|
setFeedbackSent(false);
|
|
958
1264
|
setFeedbackType(null);
|
|
959
1265
|
}
|
|
960
|
-
return /* @__PURE__ */ jsxs("div", { className: "bg-zinc-900 p-4 relative rounded-2xl mb-4 flex flex-col items-center shadow-lg w-[calc(100vw-2rem)] md:w-auto", children: [
|
|
1266
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-zinc-900 p-3 md:p-4 relative rounded-2xl mb-4 flex flex-col items-center shadow-lg w-[calc(100vw-2rem)] md:w-auto max-w-md", children: [
|
|
961
1267
|
feedbackSent ? /* @__PURE__ */ jsx(FeedbackSuccessStep, { onFeedbackRestartRequest: handleRestartFeedback, language }) : /* @__PURE__ */ jsx(Fragment, { children: !feedbackType ? /* @__PURE__ */ jsx(FeedbackTypeStep, { onFeedbackTypeChanged: setFeedbackType, language }) : /* @__PURE__ */ jsx(
|
|
962
1268
|
FeedbackContentStep,
|
|
963
1269
|
{
|
|
@@ -969,7 +1275,7 @@ function WidgetForm({ integration, githubConfig, language }) {
|
|
|
969
1275
|
language
|
|
970
1276
|
}
|
|
971
1277
|
) }),
|
|
972
|
-
/* @__PURE__ */ jsx("footer", { className: "text-xs text-neutral-400", children: /* @__PURE__ */ jsx(
|
|
1278
|
+
/* @__PURE__ */ jsx("footer", { className: "text-xs text-neutral-400 mt-2", children: /* @__PURE__ */ jsx(
|
|
973
1279
|
"a",
|
|
974
1280
|
{
|
|
975
1281
|
className: "underline underline-offset-2",
|
|
@@ -1011,9 +1317,9 @@ function Widget({
|
|
|
1011
1317
|
language: finalLanguage
|
|
1012
1318
|
}
|
|
1013
1319
|
) }),
|
|
1014
|
-
/* @__PURE__ */ jsxs(Popover.Button, { className: "bg-brand-500 rounded-full px-3 h-12 text-white flex items-center group focus:outline-none", children: [
|
|
1015
|
-
/* @__PURE__ */ jsx(ChatTeardropDots, { className: "w-6 h-6" }),
|
|
1016
|
-
/* @__PURE__ */ jsxs("span", { className: "max-w-0 overflow-hidden group-hover:max-w-xs transition-all duration-500 ease-linear", children: [
|
|
1320
|
+
/* @__PURE__ */ jsxs(Popover.Button, { className: "bg-brand-500 rounded-full px-3 md:px-3 h-12 text-white flex items-center group focus:outline-none shadow-lg hover:shadow-xl transition-shadow", children: [
|
|
1321
|
+
/* @__PURE__ */ jsx(ChatTeardropDots, { className: "w-6 h-6 flex-shrink-0" }),
|
|
1322
|
+
/* @__PURE__ */ jsxs("span", { className: "max-w-0 overflow-hidden group-hover:max-w-xs md:group-hover:max-w-xs transition-all duration-500 ease-linear hidden md:block", children: [
|
|
1017
1323
|
/* @__PURE__ */ jsx("span", { className: "pl-2" }),
|
|
1018
1324
|
t.widget.button
|
|
1019
1325
|
] })
|