feedback-vos 1.0.40 → 1.0.42

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  A beautiful, customizable feedback widget for Next.js applications with built-in GitHub Issues integration.
4
4
 
5
+ ## Links
6
+
7
+ - 📦 [NPM Package](https://www.npmjs.com/package/feedback-vos)
8
+ - 🐙 [GitHub Repository](https://github.com/klaas-sysop/feedback-vos)
9
+ - 🎨 [Live Demo](https://feedback.vossendesign.nl/)
10
+
5
11
  ## Features
6
12
 
7
13
  - 🎨 Modern and responsive design with dark/light theme support
package/dist/index.js CHANGED
@@ -271,8 +271,21 @@ function ScreenshotEditor({
271
271
  const editedScreenshot = canvas.toDataURL("image/png");
272
272
  onSave(editedScreenshot);
273
273
  };
274
- const maxWidth = 600;
275
- const displayWidth = image ? Math.min(maxWidth, image.width) : maxWidth;
274
+ const [maxDisplayWidth, setMaxDisplayWidth] = react$1.useState(600);
275
+ react$1.useEffect(() => {
276
+ const updateMaxWidth = () => {
277
+ if (window.innerWidth >= 768) {
278
+ const availableWidth = window.innerWidth * 0.9 - 64;
279
+ setMaxDisplayWidth(Math.max(1200, Math.min(availableWidth, 1600)));
280
+ } else {
281
+ setMaxDisplayWidth(600);
282
+ }
283
+ };
284
+ updateMaxWidth();
285
+ window.addEventListener("resize", updateMaxWidth);
286
+ return () => window.removeEventListener("resize", updateMaxWidth);
287
+ }, []);
288
+ const displayWidth = image ? Math.min(maxDisplayWidth, image.width) : maxDisplayWidth;
276
289
  const displayHeight = image ? displayWidth / image.width * image.height : 400;
277
290
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `fixed inset-0 z-50 flex items-center justify-center ${themeClasses.overlay} p-2 md:p-4`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${themeClasses.bgSecondary} rounded-lg shadow-xl max-w-4xl w-full max-h-[95vh] md:max-h-[90vh] overflow-auto`, children: [
278
291
  /* @__PURE__ */ jsxRuntime.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: [
@@ -387,23 +400,30 @@ function ScreenshotButton({
387
400
  const themeClasses = getThemeClasses(theme);
388
401
  async function handleTakeScreenshot() {
389
402
  setIsTakenScreenShot(true);
390
- const canvas = await html2canvas__default.default(document.documentElement, {
403
+ const canvas = await html2canvas__default.default(document.body, {
391
404
  width: window.innerWidth,
392
405
  height: window.innerHeight,
393
- x: 0,
394
- y: 0,
395
406
  windowWidth: window.innerWidth,
396
407
  windowHeight: window.innerHeight,
408
+ scrollX: -window.scrollX,
409
+ scrollY: -window.scrollY,
397
410
  scale: 1,
398
411
  // Use scale 1 for consistent sizing
399
412
  useCORS: true,
413
+ allowTaint: true,
414
+ // Allow external images for better rendering
415
+ backgroundColor: null,
416
+ // Preserve page background
417
+ removeContainer: false,
418
+ // Maintain proper container rendering
400
419
  logging: false,
401
420
  ignoreElements: (element) => {
402
421
  return element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
403
422
  }
404
423
  });
405
- const targetWidth = 1920;
406
- const targetHeight = 1080;
424
+ const isMobile = window.innerWidth < 768;
425
+ const targetWidth = isMobile ? 1080 : 1920;
426
+ const targetHeight = isMobile ? 1920 : 1080;
407
427
  const normalizedCanvas = document.createElement("canvas");
408
428
  normalizedCanvas.width = targetWidth;
409
429
  normalizedCanvas.height = targetHeight;