feedback-vos 1.0.36 → 1.0.38

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.mjs CHANGED
@@ -12,30 +12,30 @@ var thoughtImageUrl = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0
12
12
  // src/lib/theme.ts
13
13
  function getThemeClasses(theme) {
14
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",
15
+ // Background colors - light mode uses white for better clarity
16
+ bgPrimary: theme === "dark" ? "bg-zinc-900" : "bg-white",
17
+ bgSecondary: theme === "dark" ? "bg-zinc-800" : "bg-gray-50",
18
+ bgTertiary: theme === "dark" ? "bg-zinc-700" : "bg-gray-100",
19
+ bgHover: theme === "dark" ? "hover:bg-zinc-600" : "hover:bg-gray-100",
20
+ bgHoverSecondary: theme === "dark" ? "hover:bg-zinc-700" : "hover:bg-gray-50",
21
21
  // Text colors
22
22
  textPrimary: theme === "dark" ? "text-zinc-100" : "text-gray-900",
23
23
  textSecondary: theme === "dark" ? "text-zinc-300" : "text-gray-700",
24
24
  textTertiary: theme === "dark" ? "text-zinc-400" : "text-gray-600",
25
25
  textMuted: theme === "dark" ? "text-neutral-400" : "text-gray-500",
26
- // Border colors
27
- borderPrimary: theme === "dark" ? "border-zinc-700" : "border-gray-300",
26
+ // Border colors - stronger borders in light mode for better definition
27
+ borderPrimary: theme === "dark" ? "border-zinc-700" : "border-gray-200",
28
28
  borderSecondary: theme === "dark" ? "border-zinc-600" : "border-gray-300",
29
29
  borderHover: theme === "dark" ? "hover:border-zinc-500" : "hover:border-gray-400",
30
30
  // Canvas/Editor background
31
- canvasBg: theme === "dark" ? "bg-zinc-900" : "bg-gray-200",
31
+ canvasBg: theme === "dark" ? "bg-zinc-900" : "bg-gray-100",
32
32
  // Overlay
33
33
  overlay: theme === "dark" ? "bg-black/80" : "bg-black/60",
34
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",
35
+ focusRingOffset: theme === "dark" ? "focus:ring-offset-zinc-900" : "focus:ring-offset-white",
36
+ // Button variants - clearer distinction in light mode
37
+ buttonSecondary: theme === "dark" ? "bg-zinc-800 hover:bg-zinc-700 text-zinc-100" : "bg-white hover:bg-gray-50 text-gray-900 border border-gray-200",
38
+ buttonTertiary: theme === "dark" ? "bg-zinc-700 hover:bg-zinc-600 text-zinc-100" : "bg-gray-50 hover:bg-gray-100 text-gray-900 border border-gray-200",
39
39
  // Icon colors - make icons more visible (darker for better contrast)
40
40
  iconColor: theme === "dark" ? "text-zinc-100" : "text-gray-900"
41
41
  };
@@ -108,20 +108,20 @@ function FeedbackTypeStep({ onFeedbackTypeChanged, language, theme }) {
108
108
  const feedbackTypes = getFeedbackTypes(language);
109
109
  const themeClasses = getThemeClasses(theme);
110
110
  return /* @__PURE__ */ jsxs(Fragment, { children: [
111
- /* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between w-full gap-2", children: [
112
- /* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl leading-6 ${themeClasses.textPrimary}`, children: t.form.header }),
111
+ /* @__PURE__ */ jsxs("header", { className: `flex items-center justify-between w-full gap-2 ${theme === "light" ? "pb-3 mb-2 border-b border-gray-200" : "pb-2"}`, children: [
112
+ /* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl leading-6 font-semibold ${themeClasses.textPrimary}`, children: t.form.header }),
113
113
  /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme })
114
114
  ] }),
115
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]) => {
116
116
  return /* @__PURE__ */ jsxs(
117
117
  "button",
118
118
  {
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`,
119
+ className: `${themeClasses.bgSecondary} rounded-lg py-4 md:py-5 flex-1 min-w-[80px] md:w-24 flex flex-col items-center gap-2 border-2 ${theme === "light" ? "border-gray-200" : "border-transparent"} hover:border-brand-500 focus:border-brand-500 focus:outline-none transition-all shadow-sm hover:shadow-md ${theme === "light" ? "hover:bg-white" : ""}`,
120
120
  type: "button",
121
121
  onClick: () => onFeedbackTypeChanged(key),
122
122
  children: [
123
123
  /* @__PURE__ */ jsx("img", { src: value.image.source, alt: value.image.alt, className: "w-5 h-5 md:w-6 md:h-6" }),
124
- /* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm text-center ${themeClasses.textPrimary}`, children: value.title })
124
+ /* @__PURE__ */ jsx("span", { className: `text-xs md:text-sm text-center font-medium ${themeClasses.textPrimary}`, children: value.title })
125
125
  ]
126
126
  },
127
127
  key
@@ -381,7 +381,13 @@ function ScreenshotButton({
381
381
  const themeClasses = getThemeClasses(theme);
382
382
  async function handleTakeScreenshot() {
383
383
  setIsTakenScreenShot(true);
384
- const canvas = await html2canvas(document.querySelector("html"), {
384
+ const canvas = await html2canvas(document.body, {
385
+ width: window.innerWidth,
386
+ height: window.innerHeight,
387
+ scrollX: -window.scrollX,
388
+ scrollY: -window.scrollY,
389
+ windowWidth: window.innerWidth,
390
+ windowHeight: window.innerHeight,
385
391
  ignoreElements: (element) => {
386
392
  return element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
387
393
  }
@@ -737,8 +743,7 @@ async function uploadFileToRepo(token, owner, repo, file, folderPath, defaultBra
737
743
  }
738
744
  async function uploadScreenshotToRepo(token, owner, repo, screenshot, screenshotPath) {
739
745
  const compressedScreenshot = await compressScreenshot(screenshot, 1920, 0.7);
740
- const base64Data = compressedScreenshot.split(",")[1];
741
- const binaryData = Uint8Array.from(atob(base64Data), (c) => c.charCodeAt(0));
746
+ const base64Content = compressedScreenshot.includes(",") ? compressedScreenshot.split(",")[1] : compressedScreenshot;
742
747
  const repoResponse = await fetch(
743
748
  `https://api.github.com/repos/${owner}/${repo}`,
744
749
  {
@@ -759,7 +764,6 @@ async function uploadScreenshotToRepo(token, owner, repo, screenshot, screenshot
759
764
  const randomId = Math.random().toString(36).substring(2, 9);
760
765
  const filename = `feedback-${timestamp}-${randomId}.jpg`;
761
766
  const path = `${folderPath}/${filename}`;
762
- const base64Content = btoa(String.fromCharCode(...binaryData));
763
767
  const folderCheckUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${folderPath}`;
764
768
  try {
765
769
  const folderCheck = await fetch(folderCheckUrl, {
@@ -1244,7 +1248,7 @@ function FeedbackContentStep({
1244
1248
  }
1245
1249
  }
1246
1250
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1247
- /* @__PURE__ */ jsxs("header", { className: "relative w-full", children: [
1251
+ /* @__PURE__ */ jsxs("header", { className: `relative w-full ${theme === "light" ? "pb-3 mb-3 border-b border-gray-200" : "pb-2 mb-2"}`, children: [
1248
1252
  /* @__PURE__ */ jsx(
1249
1253
  "button",
1250
1254
  {
@@ -1254,7 +1258,7 @@ function FeedbackContentStep({
1254
1258
  children: /* @__PURE__ */ jsx(ArrowLeft, { weight: "bold", className: "w-5 h-5 md:w-5 md:h-5" })
1255
1259
  }
1256
1260
  ),
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: [
1261
+ /* @__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 font-semibold ${themeClasses.textPrimary}`, children: [
1258
1262
  /* @__PURE__ */ jsx(
1259
1263
  "img",
1260
1264
  {
@@ -1272,10 +1276,10 @@ function FeedbackContentStep({
1272
1276
  "textarea",
1273
1277
  {
1274
1278
  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
1279
+ ${themeClasses.textPrimary} border-2 ${theme === "light" ? "border-gray-300" : "border-brand-500"} ${theme === "light" ? "bg-gray-50" : "bg-transparent"} rounded-md p-2 md:p-3
1276
1280
  ${theme === "dark" ? "placeholder:text-zinc-400" : "placeholder:text-gray-500"}
1277
1281
  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`,
1282
+ ${theme === "dark" ? "scrollbar-thumb-zinc-700" : "scrollbar-thumb-gray-400"} scrollbar-track-transparent scrollbar-thin transition-colors`,
1279
1283
  placeholder: t.content.placeholder,
1280
1284
  onChange: (e) => setComment(e.target.value)
1281
1285
  }
@@ -1320,13 +1324,13 @@ function FeedbackSuccessStep({ onFeedbackRestartRequest, language, theme }) {
1320
1324
  const t = getTranslations(language);
1321
1325
  const themeClasses = getThemeClasses(theme);
1322
1326
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1323
- /* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme }) }),
1327
+ /* @__PURE__ */ jsx("header", { className: `flex items-center justify-end w-full ${theme === "light" ? "pb-3 mb-2 border-b border-gray-200" : "pb-2"}`, children: /* @__PURE__ */ jsx(CloseButton, { title: t.form.closeButton, theme }) }),
1324
1328
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-8 md:py-10 w-full max-w-[304px] px-2", children: [
1325
1329
  /* @__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: [
1326
1330
  /* @__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" }),
1327
1331
  /* @__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" })
1328
1332
  ] }),
1329
- /* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl mt-2 text-center ${themeClasses.textPrimary}`, children: t.success.message }),
1333
+ /* @__PURE__ */ jsx("span", { className: `text-lg md:text-xl mt-2 text-center font-medium ${themeClasses.textPrimary}`, children: t.success.message }),
1330
1334
  /* @__PURE__ */ jsx(
1331
1335
  "button",
1332
1336
  {
@@ -1373,7 +1377,7 @@ function WidgetForm({ integration, githubConfig, language, theme }) {
1373
1377
  setFeedbackSent(false);
1374
1378
  setFeedbackType(null);
1375
1379
  }
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: [
1380
+ return /* @__PURE__ */ jsxs("div", { className: `${themeClasses.bgPrimary} p-3 md:p-4 relative rounded-2xl mb-4 flex flex-col items-center ${theme === "light" ? "shadow-xl border border-gray-200" : "shadow-lg"} w-[calc(100vw-2rem)] md:w-auto md:min-w-[384px] max-w-md`, children: [
1377
1381
  feedbackSent ? /* @__PURE__ */ jsx(FeedbackSuccessStep, { onFeedbackRestartRequest: handleRestartFeedback, language, theme }) : /* @__PURE__ */ jsx(Fragment, { children: !feedbackType ? /* @__PURE__ */ jsx(FeedbackTypeStep, { onFeedbackTypeChanged: setFeedbackType, language, theme }) : /* @__PURE__ */ jsx(
1378
1382
  FeedbackContentStep,
1379
1383
  {