feedback-vos 1.0.30 → 1.0.31
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 +19 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +226 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +228 -101
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +126 -38
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,54 @@
|
|
|
1
|
-
import { ChatTeardropDots, ArrowLeft, X, Paperclip,
|
|
1
|
+
import { ChatTeardropDots, ArrowLeft, X, Paperclip, PencilSimple, Camera, CircleNotch, ArrowCounterClockwise, Trash, Check } from 'phosphor-react';
|
|
2
2
|
import { Popover } from '@headlessui/react';
|
|
3
3
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import html2canvas from 'html2canvas';
|
|
6
6
|
|
|
7
7
|
// src/lib/svg-assets.ts
|
|
8
8
|
var bugImageUrl = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTcuNzUwMDcgNEM4Ljc1MDA3IDMgOC4wMDAwNyAwIDYuMzEyMDcgMEM0LjYyNDA3IDAgNC43NTAwNyAyIDUuNzUwMDcgMkM2Ljc1MDA3IDIgNi43NTAwNyA0IDYuNzUwMDcgNUM2Ljc1MDA3IDYgNy43NTAwNyA0IDcuNzUwMDcgNFpNMy41NjcwNyA1LjcyQzQuNTY3MDcgNC43MiAzLjgxNzA3IDEuNzIgMi4xMjkwNyAxLjcyQzAuNDQxMDY4IDEuNzIgMC41NjcwNjggMy43MiAxLj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c1IDEuMTY2NjMgMjguMjE4MSAxLjE2NjYzIDI5Ljg3NUMxLjE2NjYzIDMxLjUzMTkgMi41MDk3NyAzMi44NzUgNC4xNjY2MyAzMi44NzVaIiBmaWxsPSIjODVDOEY4Ii8+Cjwvc3ZnPg==";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
// src/lib/theme.ts
|
|
13
|
+
function getThemeClasses(theme) {
|
|
14
|
+
return {
|
|
15
|
+
// Background colors - light mode is now softer (gray-50 instead of white)
|
|
16
|
+
bgPrimary: theme === "dark" ? "bg-zinc-900" : "bg-gray-50",
|
|
17
|
+
bgSecondary: theme === "dark" ? "bg-zinc-800" : "bg-gray-100",
|
|
18
|
+
bgTertiary: theme === "dark" ? "bg-zinc-700" : "bg-gray-200",
|
|
19
|
+
bgHover: theme === "dark" ? "hover:bg-zinc-600" : "hover:bg-gray-200",
|
|
20
|
+
bgHoverSecondary: theme === "dark" ? "hover:bg-zinc-700" : "hover:bg-gray-200",
|
|
21
|
+
// Text colors
|
|
22
|
+
textPrimary: theme === "dark" ? "text-zinc-100" : "text-gray-900",
|
|
23
|
+
textSecondary: theme === "dark" ? "text-zinc-300" : "text-gray-700",
|
|
24
|
+
textTertiary: theme === "dark" ? "text-zinc-400" : "text-gray-600",
|
|
25
|
+
textMuted: theme === "dark" ? "text-neutral-400" : "text-gray-500",
|
|
26
|
+
// Border colors
|
|
27
|
+
borderPrimary: theme === "dark" ? "border-zinc-700" : "border-gray-300",
|
|
28
|
+
borderSecondary: theme === "dark" ? "border-zinc-600" : "border-gray-300",
|
|
29
|
+
borderHover: theme === "dark" ? "hover:border-zinc-500" : "hover:border-gray-400",
|
|
30
|
+
// Canvas/Editor background
|
|
31
|
+
canvasBg: theme === "dark" ? "bg-zinc-900" : "bg-gray-200",
|
|
32
|
+
// Overlay
|
|
33
|
+
overlay: theme === "dark" ? "bg-black/80" : "bg-black/60",
|
|
34
|
+
// Focus ring offset
|
|
35
|
+
focusRingOffset: theme === "dark" ? "focus:ring-offset-zinc-900" : "focus:ring-offset-gray-50",
|
|
36
|
+
// Button variants
|
|
37
|
+
buttonSecondary: theme === "dark" ? "bg-zinc-800 hover:bg-zinc-700 text-zinc-100" : "bg-gray-200 hover:bg-gray-300 text-gray-900",
|
|
38
|
+
buttonTertiary: theme === "dark" ? "bg-zinc-700 hover:bg-zinc-600 text-zinc-100" : "bg-gray-300 hover:bg-gray-400 text-gray-900",
|
|
39
|
+
// Icon colors - make icons more visible (darker for better contrast)
|
|
40
|
+
iconColor: theme === "dark" ? "text-zinc-100" : "text-gray-900"
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function getDefaultTheme() {
|
|
44
|
+
if (typeof process !== "undefined" && process.env.NEXT_PUBLIC_FEEDBACK_THEME === "light") {
|
|
45
|
+
return "light";
|
|
46
|
+
}
|
|
47
|
+
return "dark";
|
|
48
|
+
}
|
|
49
|
+
function CloseButton({ className = "", title = "Close feedback form", theme = "dark" }) {
|
|
50
|
+
const themeClasses = getThemeClasses(theme);
|
|
51
|
+
return /* @__PURE__ */ jsx(Popover.Button, { className: `${themeClasses.textTertiary} ${theme === "dark" ? "hover:text-zinc-100" : "hover:text-gray-900"} ${className}`, title, children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-5 h-5" }) });
|
|
13
52
|
}
|
|
14
53
|
|
|
15
54
|
// src/lib/translations.ts
|
|
@@ -64,24 +103,25 @@ var translations = {
|
|
|
64
103
|
function getTranslations(lang = "en") {
|
|
65
104
|
return translations[lang];
|
|
66
105
|
}
|
|
67
|
-
function FeedbackTypeStep({ onFeedbackTypeChanged, language }) {
|
|
106
|
+
function FeedbackTypeStep({ onFeedbackTypeChanged, language, theme }) {
|
|
68
107
|
const t = getTranslations(language);
|
|
69
108
|
const feedbackTypes = getFeedbackTypes(language);
|
|
109
|
+
const themeClasses = getThemeClasses(theme);
|
|
70
110
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
111
|
/* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
72
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
73
|
-
/* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton })
|
|
112
|
+
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl leading-6 ${themeClasses.textPrimary}`, children: t.form.header }),
|
|
113
|
+
/* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme })
|
|
74
114
|
] }),
|
|
75
115
|
/* @__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
116
|
return /* @__PURE__ */ jsxs(
|
|
77
117
|
"button",
|
|
78
118
|
{
|
|
79
|
-
className:
|
|
119
|
+
className: `${themeClasses.bgSecondary} 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
120
|
type: "button",
|
|
81
121
|
onClick: () => onFeedbackTypeChanged(key),
|
|
82
122
|
children: [
|
|
83
123
|
/* @__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:
|
|
124
|
+
/* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm text-center ${themeClasses.textPrimary}`, children: value.title })
|
|
85
125
|
]
|
|
86
126
|
},
|
|
87
127
|
key
|
|
@@ -96,13 +136,15 @@ function ScreenshotEditor({
|
|
|
96
136
|
screenshot,
|
|
97
137
|
onSave,
|
|
98
138
|
onCancel,
|
|
99
|
-
language
|
|
139
|
+
language,
|
|
140
|
+
theme = "dark"
|
|
100
141
|
}) {
|
|
101
142
|
const canvasRef = useRef(null);
|
|
102
143
|
const [isDrawing, setIsDrawing] = useState(false);
|
|
103
144
|
const [color, setColor] = useState("#ef4444");
|
|
104
145
|
const [brushSize, setBrushSize] = useState(3);
|
|
105
146
|
const [image, setImage] = useState(null);
|
|
147
|
+
const themeClasses = getThemeClasses(theme);
|
|
106
148
|
const t = {
|
|
107
149
|
en: {
|
|
108
150
|
save: "Save",
|
|
@@ -226,16 +268,16 @@ function ScreenshotEditor({
|
|
|
226
268
|
const maxWidth = 600;
|
|
227
269
|
const displayWidth = image ? Math.min(maxWidth, image.width) : maxWidth;
|
|
228
270
|
const displayHeight = image ? displayWidth / image.width * image.height : 400;
|
|
229
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
230
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
231
|
-
/* @__PURE__ */ jsx("h3", { className:
|
|
271
|
+
return /* @__PURE__ */ jsx("div", { className: `fixed inset-0 z-50 flex items-center justify-center ${themeClasses.overlay} p-2 md:p-4`, children: /* @__PURE__ */ jsxs("div", { className: `${themeClasses.bgSecondary} rounded-lg shadow-xl max-w-4xl w-full max-h-[95vh] md:max-h-[90vh] overflow-auto`, children: [
|
|
272
|
+
/* @__PURE__ */ jsxs("div", { className: `sticky top-0 ${themeClasses.bgSecondary} border-b ${themeClasses.borderPrimary} p-2 md:p-4 flex items-center justify-between z-10 gap-2`, children: [
|
|
273
|
+
/* @__PURE__ */ jsx("h3", { className: `text-base md:text-lg font-semibold ${themeClasses.textPrimary} truncate`, children: language === "nl" ? "Teken op screenshot" : "Draw on screenshot" }),
|
|
232
274
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-1 md:gap-2 flex-shrink-0", children: [
|
|
233
275
|
/* @__PURE__ */ jsx(
|
|
234
276
|
"button",
|
|
235
277
|
{
|
|
236
278
|
type: "button",
|
|
237
279
|
onClick: undo,
|
|
238
|
-
className:
|
|
280
|
+
className: `p-1.5 md:p-2 ${themeClasses.buttonTertiary} rounded-md ${themeClasses.textPrimary} transition-colors touch-manipulation`,
|
|
239
281
|
title: t.undo,
|
|
240
282
|
children: /* @__PURE__ */ jsx(ArrowCounterClockwise, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
241
283
|
}
|
|
@@ -245,7 +287,7 @@ function ScreenshotEditor({
|
|
|
245
287
|
{
|
|
246
288
|
type: "button",
|
|
247
289
|
onClick: clearCanvas,
|
|
248
|
-
className:
|
|
290
|
+
className: `p-1.5 md:p-2 ${themeClasses.buttonTertiary} rounded-md ${themeClasses.textPrimary} transition-colors touch-manipulation`,
|
|
249
291
|
title: t.clear,
|
|
250
292
|
children: /* @__PURE__ */ jsx(Trash, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
251
293
|
}
|
|
@@ -255,7 +297,7 @@ function ScreenshotEditor({
|
|
|
255
297
|
{
|
|
256
298
|
type: "button",
|
|
257
299
|
onClick: onCancel,
|
|
258
|
-
className:
|
|
300
|
+
className: `p-1.5 md:p-2 ${themeClasses.buttonTertiary} rounded-md ${themeClasses.textPrimary} transition-colors touch-manipulation`,
|
|
259
301
|
title: t.cancel,
|
|
260
302
|
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
261
303
|
}
|
|
@@ -265,7 +307,7 @@ function ScreenshotEditor({
|
|
|
265
307
|
{
|
|
266
308
|
type: "button",
|
|
267
309
|
onClick: handleSave,
|
|
268
|
-
className: "p-1.5 md:p-2 bg-brand-500 hover:bg-brand-400 rounded-md text-
|
|
310
|
+
className: "p-1.5 md:p-2 bg-brand-500 hover:bg-brand-400 rounded-md text-white transition-colors touch-manipulation",
|
|
269
311
|
title: t.save,
|
|
270
312
|
children: /* @__PURE__ */ jsx(Check, { weight: "bold", className: "w-4 h-4 md:w-5 md:h-5" })
|
|
271
313
|
}
|
|
@@ -274,13 +316,13 @@ function ScreenshotEditor({
|
|
|
274
316
|
] }),
|
|
275
317
|
/* @__PURE__ */ jsxs("div", { className: "p-3 md:p-4", children: [
|
|
276
318
|
/* @__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:
|
|
319
|
+
/* @__PURE__ */ jsx("label", { className: `text-xs md:text-sm ${themeClasses.textSecondary} whitespace-nowrap`, children: language === "nl" ? "Kleur:" : "Color:" }),
|
|
278
320
|
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 md:gap-2 flex-wrap", children: colors.map((c) => /* @__PURE__ */ jsx(
|
|
279
321
|
"button",
|
|
280
322
|
{
|
|
281
323
|
type: "button",
|
|
282
324
|
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
|
|
325
|
+
className: `w-7 h-7 md:w-8 md:h-8 rounded-full border-2 transition-all touch-manipulation ${color === c ? `${theme === "dark" ? "border-zinc-100" : "border-gray-900"} scale-110` : `${themeClasses.borderSecondary} ${themeClasses.borderHover}`}`,
|
|
284
326
|
style: { backgroundColor: c },
|
|
285
327
|
title: c
|
|
286
328
|
},
|
|
@@ -288,7 +330,7 @@ function ScreenshotEditor({
|
|
|
288
330
|
)) })
|
|
289
331
|
] }),
|
|
290
332
|
/* @__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:
|
|
333
|
+
/* @__PURE__ */ jsx("label", { className: `text-xs md:text-sm ${themeClasses.textSecondary} whitespace-nowrap`, children: language === "nl" ? "Grootte:" : "Size:" }),
|
|
292
334
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full md:w-auto", children: [
|
|
293
335
|
/* @__PURE__ */ jsx(
|
|
294
336
|
"input",
|
|
@@ -301,10 +343,10 @@ function ScreenshotEditor({
|
|
|
301
343
|
className: "flex-1 md:flex-none md:max-w-xs"
|
|
302
344
|
}
|
|
303
345
|
),
|
|
304
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
346
|
+
/* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm ${themeClasses.textTertiary} w-6 md:w-8 text-right`, children: brushSize })
|
|
305
347
|
] })
|
|
306
348
|
] }),
|
|
307
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
349
|
+
/* @__PURE__ */ jsx("div", { className: `flex justify-center ${themeClasses.canvasBg} rounded-lg p-2 md:p-4 overflow-auto`, children: /* @__PURE__ */ jsx(
|
|
308
350
|
"canvas",
|
|
309
351
|
{
|
|
310
352
|
ref: canvasRef,
|
|
@@ -315,7 +357,7 @@ function ScreenshotEditor({
|
|
|
315
357
|
onTouchStart: startDrawing,
|
|
316
358
|
onTouchMove: draw,
|
|
317
359
|
onTouchEnd: stopDrawing,
|
|
318
|
-
className:
|
|
360
|
+
className: `cursor-crosshair border ${themeClasses.borderPrimary} rounded touch-none`,
|
|
319
361
|
style: {
|
|
320
362
|
width: `${displayWidth}px`,
|
|
321
363
|
height: `${displayHeight}px`,
|
|
@@ -330,17 +372,22 @@ function ScreenshotEditor({
|
|
|
330
372
|
function ScreenshotButton({
|
|
331
373
|
screenshot,
|
|
332
374
|
onScreenshotTook,
|
|
333
|
-
language = "en"
|
|
375
|
+
language = "en",
|
|
376
|
+
theme = "dark"
|
|
334
377
|
}) {
|
|
335
378
|
const [isTakenScreenshot, setIsTakenScreenShot] = useState(false);
|
|
336
379
|
const [showEditor, setShowEditor] = useState(false);
|
|
337
380
|
const [tempScreenshot, setTempScreenshot] = useState(null);
|
|
381
|
+
const themeClasses = getThemeClasses(theme);
|
|
338
382
|
async function handleTakeScreenshot() {
|
|
339
383
|
setIsTakenScreenShot(true);
|
|
340
|
-
const canvas = await html2canvas(document.querySelector("html")
|
|
384
|
+
const canvas = await html2canvas(document.querySelector("html"), {
|
|
385
|
+
ignoreElements: (element) => {
|
|
386
|
+
return element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
341
389
|
const base64image = canvas.toDataURL("image/png");
|
|
342
|
-
|
|
343
|
-
setShowEditor(true);
|
|
390
|
+
onScreenshotTook(base64image);
|
|
344
391
|
setIsTakenScreenShot(false);
|
|
345
392
|
}
|
|
346
393
|
function handleEditorSave(editedScreenshot) {
|
|
@@ -366,61 +413,104 @@ function ScreenshotButton({
|
|
|
366
413
|
screenshot: tempScreenshot || screenshot,
|
|
367
414
|
onSave: handleEditorSave,
|
|
368
415
|
onCancel: handleEditorCancel,
|
|
369
|
-
language
|
|
416
|
+
language,
|
|
417
|
+
theme
|
|
370
418
|
}
|
|
371
419
|
),
|
|
372
|
-
screenshot
|
|
373
|
-
"
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
420
|
+
screenshot ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
421
|
+
/* @__PURE__ */ jsxs("div", { className: "relative group", children: [
|
|
422
|
+
/* @__PURE__ */ jsx(
|
|
423
|
+
"div",
|
|
424
|
+
{
|
|
425
|
+
className: `p-1 w-10 h-10 rounded-md border ${themeClasses.borderSecondary} flex
|
|
426
|
+
justify-end items-end relative overflow-hidden`,
|
|
427
|
+
style: {
|
|
428
|
+
backgroundImage: `url(${screenshot})`,
|
|
429
|
+
backgroundPosition: "center",
|
|
430
|
+
backgroundSize: "cover"
|
|
431
|
+
},
|
|
432
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors rounded-md" })
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
/* @__PURE__ */ jsx(
|
|
436
|
+
"button",
|
|
437
|
+
{
|
|
438
|
+
type: "button",
|
|
439
|
+
onClick: (e) => {
|
|
440
|
+
e.stopPropagation();
|
|
441
|
+
onScreenshotTook(null);
|
|
442
|
+
},
|
|
443
|
+
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",
|
|
444
|
+
title: language === "nl" ? "Verwijderen" : "Delete",
|
|
445
|
+
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-3 h-3 text-white" })
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
] }),
|
|
449
|
+
/* @__PURE__ */ jsx(
|
|
450
|
+
"button",
|
|
451
|
+
{
|
|
452
|
+
type: "button",
|
|
453
|
+
onClick: handleEditScreenshot,
|
|
454
|
+
className: `p-2 ${themeClasses.bgSecondary} rounded-md border-transparent ${themeClasses.bgHoverSecondary}
|
|
455
|
+
transition-colors focus:outline-none focus:ring-2
|
|
456
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500`,
|
|
457
|
+
title: language === "nl" ? "Bewerk screenshot" : "Edit screenshot",
|
|
458
|
+
children: /* @__PURE__ */ jsx(PencilSimple, { weight: "bold", className: `w-5 h-5 ${themeClasses.textPrimary}` })
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
] }) : /* @__PURE__ */ jsx(
|
|
386
462
|
"button",
|
|
387
463
|
{
|
|
388
464
|
type: "button",
|
|
389
|
-
className:
|
|
465
|
+
className: `p-2 ${themeClasses.bgSecondary} rounded-md border-transparent ${themeClasses.bgHoverSecondary}
|
|
466
|
+
transition-colors focus:outline-none focus:ring-2
|
|
467
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500`,
|
|
390
468
|
onClick: handleTakeScreenshot,
|
|
391
|
-
children: isTakenScreenshot ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(Camera, { weight: "bold", className:
|
|
469
|
+
children: isTakenScreenshot ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(Camera, { weight: "bold", className: `w-6 h-6 ${themeClasses.iconColor}` })
|
|
392
470
|
}
|
|
393
471
|
)
|
|
394
472
|
] });
|
|
395
473
|
}
|
|
396
474
|
if (screenshot) {
|
|
397
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
475
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
476
|
+
/* @__PURE__ */ jsxs("div", { className: "relative group", children: [
|
|
477
|
+
/* @__PURE__ */ jsx(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
className: `p-1 w-10 h-10 rounded-md border ${themeClasses.borderSecondary} flex
|
|
481
|
+
justify-end items-end relative overflow-hidden`,
|
|
482
|
+
style: {
|
|
483
|
+
backgroundImage: `url(${screenshot})`,
|
|
484
|
+
backgroundPosition: "center",
|
|
485
|
+
backgroundSize: "cover"
|
|
486
|
+
},
|
|
487
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors rounded-md" })
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
/* @__PURE__ */ jsx(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
type: "button",
|
|
494
|
+
onClick: (e) => {
|
|
495
|
+
e.stopPropagation();
|
|
496
|
+
onScreenshotTook(null);
|
|
497
|
+
},
|
|
498
|
+
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",
|
|
499
|
+
title: language === "nl" ? "Verwijderen" : "Delete",
|
|
500
|
+
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-3 h-3 text-white" })
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
] }),
|
|
398
504
|
/* @__PURE__ */ jsx(
|
|
399
505
|
"button",
|
|
400
506
|
{
|
|
401
507
|
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
508
|
onClick: handleEditScreenshot,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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" })
|
|
509
|
+
className: `p-2 ${themeClasses.bgSecondary} rounded-md border-transparent ${themeClasses.bgHoverSecondary}
|
|
510
|
+
transition-colors focus:outline-none focus:ring-2
|
|
511
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500`,
|
|
512
|
+
title: language === "nl" ? "Bewerk screenshot" : "Edit screenshot",
|
|
513
|
+
children: /* @__PURE__ */ jsx(PencilSimple, { weight: "bold", className: `w-5 h-5 ${themeClasses.textPrimary}` })
|
|
424
514
|
}
|
|
425
515
|
)
|
|
426
516
|
] });
|
|
@@ -429,9 +519,11 @@ function ScreenshotButton({
|
|
|
429
519
|
"button",
|
|
430
520
|
{
|
|
431
521
|
type: "button",
|
|
432
|
-
className:
|
|
522
|
+
className: `p-2 ${themeClasses.bgSecondary} rounded-md border-transparent ${themeClasses.bgHoverSecondary}
|
|
523
|
+
transitions-colors focus:outline-none focus:ring-2
|
|
524
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500`,
|
|
433
525
|
onClick: handleTakeScreenshot,
|
|
434
|
-
children: isTakenScreenshot ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(Camera, { weight: "bold", className:
|
|
526
|
+
children: isTakenScreenshot ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(Camera, { weight: "bold", className: `w-6 h-6 ${themeClasses.iconColor}` })
|
|
435
527
|
}
|
|
436
528
|
);
|
|
437
529
|
}
|
|
@@ -443,10 +535,12 @@ function FileUploadButton({
|
|
|
443
535
|
maxFileSize = DEFAULT_MAX_FILE_SIZE,
|
|
444
536
|
maxTotalSize = DEFAULT_MAX_TOTAL_SIZE,
|
|
445
537
|
acceptedTypes = "image/*,.pdf,.doc,.docx,.txt",
|
|
446
|
-
language = "en"
|
|
538
|
+
language = "en",
|
|
539
|
+
theme = "dark"
|
|
447
540
|
}) {
|
|
448
541
|
const fileInputRef = useRef(null);
|
|
449
542
|
const [error, setError] = useState(null);
|
|
543
|
+
const themeClasses = getThemeClasses(theme);
|
|
450
544
|
const translations2 = {
|
|
451
545
|
en: {
|
|
452
546
|
upload: "Upload file",
|
|
@@ -532,10 +626,12 @@ function FileUploadButton({
|
|
|
532
626
|
"button",
|
|
533
627
|
{
|
|
534
628
|
type: "button",
|
|
535
|
-
className:
|
|
629
|
+
className: `p-2 ${themeClasses.bgSecondary} rounded-md border-transparent ${themeClasses.bgHoverSecondary}
|
|
630
|
+
transitions-colors focus:outline-none focus:ring-2
|
|
631
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500`,
|
|
536
632
|
onClick: handleButtonClick,
|
|
537
633
|
title: t.upload,
|
|
538
|
-
children: /* @__PURE__ */ jsx(Paperclip, { weight: "bold", className:
|
|
634
|
+
children: /* @__PURE__ */ jsx(Paperclip, { weight: "bold", className: `w-6 h-6 ${themeClasses.iconColor}` })
|
|
539
635
|
}
|
|
540
636
|
),
|
|
541
637
|
/* @__PURE__ */ jsx(
|
|
@@ -552,7 +648,7 @@ function FileUploadButton({
|
|
|
552
648
|
files.map((uploadedFile) => /* @__PURE__ */ jsxs(
|
|
553
649
|
"div",
|
|
554
650
|
{
|
|
555
|
-
className:
|
|
651
|
+
className: `flex items-center gap-1 ${themeClasses.bgSecondary} rounded-md px-2 py-1 text-xs`,
|
|
556
652
|
children: [
|
|
557
653
|
uploadedFile.preview ? /* @__PURE__ */ jsx(
|
|
558
654
|
"img",
|
|
@@ -561,14 +657,14 @@ function FileUploadButton({
|
|
|
561
657
|
alt: uploadedFile.file.name,
|
|
562
658
|
className: "w-5 h-5 md:w-6 md:h-6 object-cover rounded flex-shrink-0"
|
|
563
659
|
}
|
|
564
|
-
) : /* @__PURE__ */ jsx(Paperclip, { className:
|
|
565
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
660
|
+
) : /* @__PURE__ */ jsx(Paperclip, { className: `w-3 h-3 md:w-4 md:h-4 flex-shrink-0 ${themeClasses.iconColor}` }),
|
|
661
|
+
/* @__PURE__ */ jsx("span", { className: `${themeClasses.textSecondary} max-w-[80px] md:max-w-[100px] truncate`, title: uploadedFile.file.name, children: uploadedFile.file.name }),
|
|
566
662
|
/* @__PURE__ */ jsx(
|
|
567
663
|
"button",
|
|
568
664
|
{
|
|
569
665
|
type: "button",
|
|
570
666
|
onClick: () => handleRemoveFile(uploadedFile.id),
|
|
571
|
-
className: "text-zinc-
|
|
667
|
+
className: `${themeClasses.textTertiary} ${theme === "dark" ? "hover:text-zinc-100" : "hover:text-gray-900"} transition-colors flex-shrink-0 touch-manipulation`,
|
|
572
668
|
title: t.remove,
|
|
573
669
|
children: /* @__PURE__ */ jsx(X, { weight: "bold", className: "w-3 h-3 md:w-4 md:h-4" })
|
|
574
670
|
}
|
|
@@ -579,7 +675,7 @@ function FileUploadButton({
|
|
|
579
675
|
))
|
|
580
676
|
] }),
|
|
581
677
|
error && /* @__PURE__ */ jsx("p", { className: "text-xs text-red-400", children: error }),
|
|
582
|
-
files.length > 0 && /* @__PURE__ */ jsxs("p", { className:
|
|
678
|
+
files.length > 0 && /* @__PURE__ */ jsxs("p", { className: `text-xs ${themeClasses.textTertiary}`, children: [
|
|
583
679
|
files.length,
|
|
584
680
|
" ",
|
|
585
681
|
t.files,
|
|
@@ -1104,10 +1200,12 @@ function FeedbackContentStep({
|
|
|
1104
1200
|
onFeedbackSent,
|
|
1105
1201
|
integration,
|
|
1106
1202
|
githubConfig,
|
|
1107
|
-
language
|
|
1203
|
+
language,
|
|
1204
|
+
theme
|
|
1108
1205
|
}) {
|
|
1109
1206
|
const t = getTranslations(language);
|
|
1110
1207
|
const feedbackTypes = getFeedbackTypes(language);
|
|
1208
|
+
const themeClasses = getThemeClasses(theme);
|
|
1111
1209
|
const [screenshot, setScreenshot] = useState(null);
|
|
1112
1210
|
const [uploadedFiles, setUploadedFiles] = useState([]);
|
|
1113
1211
|
const feedbackTypeData = feedbackTypes[feedbackType];
|
|
@@ -1146,17 +1244,17 @@ function FeedbackContentStep({
|
|
|
1146
1244
|
}
|
|
1147
1245
|
}
|
|
1148
1246
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1149
|
-
/* @__PURE__ */ jsxs("header", { className: "relative w-full
|
|
1247
|
+
/* @__PURE__ */ jsxs("header", { className: "relative w-full", children: [
|
|
1150
1248
|
/* @__PURE__ */ jsx(
|
|
1151
1249
|
"button",
|
|
1152
1250
|
{
|
|
1153
1251
|
type: "button",
|
|
1154
|
-
className:
|
|
1252
|
+
className: `absolute top-0 left-0 ${themeClasses.textTertiary} ${theme === "dark" ? "hover:text-zinc-100" : "hover:text-gray-900"} z-10 p-2 md:p-2.5`,
|
|
1155
1253
|
onClick: onFeedbackRestartRequest,
|
|
1156
|
-
children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-
|
|
1254
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-5 h-5 md:w-5 md:h-5" })
|
|
1157
1255
|
}
|
|
1158
1256
|
),
|
|
1159
|
-
/* @__PURE__ */ jsxs("span", { className:
|
|
1257
|
+
/* @__PURE__ */ jsxs("span", { className: `text-lg md:text-xl leading-6 flex items-center gap-2 pl-10 md:pl-12 pr-10 md:pr-12 ${themeClasses.textPrimary}`, children: [
|
|
1160
1258
|
/* @__PURE__ */ jsx(
|
|
1161
1259
|
"img",
|
|
1162
1260
|
{
|
|
@@ -1167,13 +1265,17 @@ function FeedbackContentStep({
|
|
|
1167
1265
|
),
|
|
1168
1266
|
feedbackTypeData.title
|
|
1169
1267
|
] }),
|
|
1170
|
-
/* @__PURE__ */ jsx(CloseButton, { className: "absolute top-
|
|
1268
|
+
/* @__PURE__ */ jsx(CloseButton, { className: "absolute top-0 right-0 p-2 md:p-2.5", title: t.form.closeButton, theme })
|
|
1171
1269
|
] }),
|
|
1172
1270
|
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmitFeedback, className: "my-3 md:my-4 w-full", children: [
|
|
1173
1271
|
/* @__PURE__ */ jsx(
|
|
1174
1272
|
"textarea",
|
|
1175
1273
|
{
|
|
1176
|
-
className:
|
|
1274
|
+
className: `w-full min-h-[100px] md:min-h-[112px] text-sm
|
|
1275
|
+
${themeClasses.textPrimary} border-2 border-brand-500 bg-transparent rounded-md p-2 md:p-3
|
|
1276
|
+
${theme === "dark" ? "placeholder:text-zinc-400" : "placeholder:text-gray-500"}
|
|
1277
|
+
focus:border-brand-500 focus:ring-brand-500 focus:ring-1 resize-none focus:outline-none
|
|
1278
|
+
${theme === "dark" ? "scrollbar-thumb-zinc-700" : "scrollbar-thumb-gray-400"} scrollbar-track-transparent scrollbar-thin`,
|
|
1177
1279
|
placeholder: t.content.placeholder,
|
|
1178
1280
|
onChange: (e) => setComment(e.target.value)
|
|
1179
1281
|
}
|
|
@@ -1183,7 +1285,8 @@ function FeedbackContentStep({
|
|
|
1183
1285
|
{
|
|
1184
1286
|
files: uploadedFiles,
|
|
1185
1287
|
onFilesChanged: setUploadedFiles,
|
|
1186
|
-
language
|
|
1288
|
+
language,
|
|
1289
|
+
theme
|
|
1187
1290
|
}
|
|
1188
1291
|
) }),
|
|
1189
1292
|
/* @__PURE__ */ jsxs("footer", { className: "flex gap-2 mt-3", children: [
|
|
@@ -1192,7 +1295,8 @@ function FeedbackContentStep({
|
|
|
1192
1295
|
{
|
|
1193
1296
|
screenshot,
|
|
1194
1297
|
onScreenshotTook: setScreenshot,
|
|
1195
|
-
language
|
|
1298
|
+
language,
|
|
1299
|
+
theme
|
|
1196
1300
|
}
|
|
1197
1301
|
),
|
|
1198
1302
|
/* @__PURE__ */ jsx(
|
|
@@ -1200,7 +1304,11 @@ function FeedbackContentStep({
|
|
|
1200
1304
|
{
|
|
1201
1305
|
type: "submit",
|
|
1202
1306
|
disabled: comment.length === 0 || isSendingFeedback,
|
|
1203
|
-
className:
|
|
1307
|
+
className: `p-2 bg-brand-500 rounded-md border-transparent flex-1 justify-center
|
|
1308
|
+
items-center text-sm hover:bg-brand-300 focus:outline-none focus:ring-2
|
|
1309
|
+
focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500
|
|
1310
|
+
transition-colors disabled:opacity-50 disabled:cursor-not-allowed
|
|
1311
|
+
disabled:hover:bg-brand-500 flex text-white`,
|
|
1204
1312
|
children: isSendingFeedback ? /* @__PURE__ */ jsx(Loading, {}) : t.content.sendButton
|
|
1205
1313
|
}
|
|
1206
1314
|
)
|
|
@@ -1208,22 +1316,23 @@ function FeedbackContentStep({
|
|
|
1208
1316
|
] })
|
|
1209
1317
|
] });
|
|
1210
1318
|
}
|
|
1211
|
-
function FeedbackSuccessStep({ onFeedbackRestartRequest, language }) {
|
|
1319
|
+
function FeedbackSuccessStep({ onFeedbackRestartRequest, language, theme }) {
|
|
1212
1320
|
const t = getTranslations(language);
|
|
1321
|
+
const themeClasses = getThemeClasses(theme);
|
|
1213
1322
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1214
|
-
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton }) }),
|
|
1323
|
+
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme }) }),
|
|
1215
1324
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-8 md:py-10 w-full max-w-[304px] px-2", children: [
|
|
1216
1325
|
/* @__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: [
|
|
1217
1326
|
/* @__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" }),
|
|
1218
1327
|
/* @__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" })
|
|
1219
1328
|
] }),
|
|
1220
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
1329
|
+
/* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl mt-2 text-center ${themeClasses.textPrimary}`, children: t.success.message }),
|
|
1221
1330
|
/* @__PURE__ */ jsx(
|
|
1222
1331
|
"button",
|
|
1223
1332
|
{
|
|
1224
1333
|
type: "button",
|
|
1225
1334
|
onClick: onFeedbackRestartRequest,
|
|
1226
|
-
className:
|
|
1335
|
+
className: `py-2 px-6 mt-6 ${themeClasses.buttonSecondary} rounded-md border-transparent text-sm leading-6 focus:outline-none focus:ring-2 focus:ring-offset-2 ${themeClasses.focusRingOffset} focus:ring-brand-500 transition-colors`,
|
|
1227
1336
|
children: t.success.sendAnother
|
|
1228
1337
|
}
|
|
1229
1338
|
)
|
|
@@ -1256,15 +1365,16 @@ function getFeedbackTypes(language = "en") {
|
|
|
1256
1365
|
}
|
|
1257
1366
|
};
|
|
1258
1367
|
}
|
|
1259
|
-
function WidgetForm({ integration, githubConfig, language }) {
|
|
1368
|
+
function WidgetForm({ integration, githubConfig, language, theme }) {
|
|
1260
1369
|
const [feedbackType, setFeedbackType] = useState(null);
|
|
1261
1370
|
const [feedbackSent, setFeedbackSent] = useState(false);
|
|
1371
|
+
const themeClasses = getThemeClasses(theme);
|
|
1262
1372
|
function handleRestartFeedback() {
|
|
1263
1373
|
setFeedbackSent(false);
|
|
1264
1374
|
setFeedbackType(null);
|
|
1265
1375
|
}
|
|
1266
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
1267
|
-
feedbackSent ? /* @__PURE__ */ jsx(FeedbackSuccessStep, { onFeedbackRestartRequest: handleRestartFeedback, language }) : /* @__PURE__ */ jsx(Fragment, { children: !feedbackType ? /* @__PURE__ */ jsx(FeedbackTypeStep, { onFeedbackTypeChanged: setFeedbackType, language }) : /* @__PURE__ */ jsx(
|
|
1376
|
+
return /* @__PURE__ */ jsxs("div", { className: `${themeClasses.bgPrimary} p-3 md:p-4 relative rounded-2xl mb-4 flex flex-col items-center shadow-lg w-[calc(100vw-2rem)] md:w-auto md:min-w-[384px] max-w-md`, children: [
|
|
1377
|
+
feedbackSent ? /* @__PURE__ */ jsx(FeedbackSuccessStep, { onFeedbackRestartRequest: handleRestartFeedback, language, theme }) : /* @__PURE__ */ jsx(Fragment, { children: !feedbackType ? /* @__PURE__ */ jsx(FeedbackTypeStep, { onFeedbackTypeChanged: setFeedbackType, language, theme }) : /* @__PURE__ */ jsx(
|
|
1268
1378
|
FeedbackContentStep,
|
|
1269
1379
|
{
|
|
1270
1380
|
feedbackType,
|
|
@@ -1272,10 +1382,11 @@ function WidgetForm({ integration, githubConfig, language }) {
|
|
|
1272
1382
|
onFeedbackSent: () => setFeedbackSent(true),
|
|
1273
1383
|
integration,
|
|
1274
1384
|
githubConfig,
|
|
1275
|
-
language
|
|
1385
|
+
language,
|
|
1386
|
+
theme
|
|
1276
1387
|
}
|
|
1277
1388
|
) }),
|
|
1278
|
-
/* @__PURE__ */ jsx("footer", { className:
|
|
1389
|
+
/* @__PURE__ */ jsx("footer", { className: `text-xs ${themeClasses.textMuted} mt-2`, children: /* @__PURE__ */ jsx(
|
|
1279
1390
|
"a",
|
|
1280
1391
|
{
|
|
1281
1392
|
className: "underline underline-offset-2",
|
|
@@ -1293,13 +1404,25 @@ function getDefaultLanguage() {
|
|
|
1293
1404
|
}
|
|
1294
1405
|
return "en";
|
|
1295
1406
|
}
|
|
1407
|
+
function isWidgetEnabled() {
|
|
1408
|
+
if (typeof process !== "undefined" && process.env.NEXT_PUBLIC_FEEDBACK_ENABLED !== void 0) {
|
|
1409
|
+
const enabled = process.env.NEXT_PUBLIC_FEEDBACK_ENABLED.toLowerCase();
|
|
1410
|
+
return enabled !== "false" && enabled !== "0";
|
|
1411
|
+
}
|
|
1412
|
+
return true;
|
|
1413
|
+
}
|
|
1296
1414
|
function Widget({
|
|
1297
1415
|
integration,
|
|
1298
1416
|
githubConfig,
|
|
1299
1417
|
position = "bottom-right",
|
|
1300
|
-
language
|
|
1418
|
+
language,
|
|
1419
|
+
theme
|
|
1301
1420
|
}) {
|
|
1421
|
+
if (!isWidgetEnabled()) {
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1302
1424
|
const finalLanguage = language || getDefaultLanguage();
|
|
1425
|
+
const finalTheme = theme || getDefaultTheme();
|
|
1303
1426
|
const t = getTranslations(finalLanguage);
|
|
1304
1427
|
const positionClasses = {
|
|
1305
1428
|
"bottom-right": "bottom-4 right-4 md:bottom-8 md:right-8",
|
|
@@ -1307,14 +1430,18 @@ function Widget({
|
|
|
1307
1430
|
"top-right": "top-4 right-4 md:top-8 md:right-8",
|
|
1308
1431
|
"top-left": "top-4 left-4 md:top-8 md:left-4"
|
|
1309
1432
|
};
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1312
|
-
|
|
1433
|
+
const isTop = position.includes("top");
|
|
1434
|
+
const isLeft = position.includes("left");
|
|
1435
|
+
const panelPositionClass = isTop ? "absolute top-full mt-2" : "absolute bottom-full mb-2";
|
|
1436
|
+
const panelAlignmentClass = isLeft ? "left-0" : "right-0";
|
|
1437
|
+
return /* @__PURE__ */ jsx("div", { "data-feedback-widget": "true", className: `fixed ${positionClasses[position]} z-50`, children: /* @__PURE__ */ jsxs(Popover, { className: "relative", children: [
|
|
1438
|
+
/* @__PURE__ */ jsx(Popover.Panel, { className: `${panelPositionClass} ${panelAlignmentClass}`, children: /* @__PURE__ */ jsx(
|
|
1313
1439
|
WidgetForm,
|
|
1314
1440
|
{
|
|
1315
1441
|
integration,
|
|
1316
1442
|
githubConfig,
|
|
1317
|
-
language: finalLanguage
|
|
1443
|
+
language: finalLanguage,
|
|
1444
|
+
theme: finalTheme
|
|
1318
1445
|
}
|
|
1319
1446
|
) }),
|
|
1320
1447
|
/* @__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: [
|
|
@@ -1324,7 +1451,7 @@ function Widget({
|
|
|
1324
1451
|
t.widget.button
|
|
1325
1452
|
] })
|
|
1326
1453
|
] })
|
|
1327
|
-
] });
|
|
1454
|
+
] }) });
|
|
1328
1455
|
}
|
|
1329
1456
|
|
|
1330
1457
|
export { Widget };
|