react-os-shell 0.2.37 → 0.2.39
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.d.ts +5 -0
- package/dist/index.js +105 -93
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -339,6 +339,11 @@ type ReportType = 'bug' | 'suggestion';
|
|
|
339
339
|
interface BugReportSubmission {
|
|
340
340
|
description: string;
|
|
341
341
|
reportType: ReportType;
|
|
342
|
+
/** The screenshot the user actually wants to send. Reflects any in-dialog
|
|
343
|
+
* annotation: callers should upload THIS blob, not the original capture
|
|
344
|
+
* they passed into `openBugReportDialog`. May be null if the original
|
|
345
|
+
* capture failed and the user submitted without uploading a fallback. */
|
|
346
|
+
screenshot: Blob | null;
|
|
342
347
|
}
|
|
343
348
|
/** Generic bug-report record shape consumed by the shell's list/detail UI. */
|
|
344
349
|
interface BugReport {
|
package/dist/index.js
CHANGED
|
@@ -488,6 +488,7 @@ function BugReportProvider({ children }) {
|
|
|
488
488
|
setScreenshot(s);
|
|
489
489
|
setDescription("");
|
|
490
490
|
setReportType("bug");
|
|
491
|
+
setAnnotating(false);
|
|
491
492
|
setOpen(true);
|
|
492
493
|
return new Promise((resolve) => {
|
|
493
494
|
resolveRef.current = resolve;
|
|
@@ -506,112 +507,123 @@ function BugReportProvider({ children }) {
|
|
|
506
507
|
return () => URL.revokeObjectURL(url);
|
|
507
508
|
}, [screenshot]);
|
|
508
509
|
const handleSubmit = () => {
|
|
510
|
+
setAnnotating(false);
|
|
509
511
|
setOpen(false);
|
|
510
|
-
resolveRef.current?.({ description: description.trim(), reportType });
|
|
512
|
+
resolveRef.current?.({ description: description.trim(), reportType, screenshot });
|
|
511
513
|
};
|
|
512
514
|
const handleCancel = () => {
|
|
515
|
+
setAnnotating(false);
|
|
513
516
|
setOpen(false);
|
|
514
517
|
resolveRef.current?.(null);
|
|
515
518
|
};
|
|
516
519
|
const isBug = reportType === "bug";
|
|
517
520
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
518
521
|
children,
|
|
519
|
-
/* @__PURE__ */ jsxs(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
522
|
+
/* @__PURE__ */ jsxs(
|
|
523
|
+
Dialog,
|
|
524
|
+
{
|
|
525
|
+
open,
|
|
526
|
+
onClose: annotating ? () => {
|
|
527
|
+
} : handleCancel,
|
|
528
|
+
className: "relative z-[9999]",
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 bg-black/40" }),
|
|
531
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 flex items-center justify-center p-4", children: /* @__PURE__ */ jsxs(DialogPanel, { className: "w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl", children: [
|
|
532
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-base font-semibold text-gray-900", children: "Suggestion or Bug" }),
|
|
533
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-500", children: "A screenshot of your current view will be sent to the admin team." }),
|
|
534
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 inline-flex rounded-lg border border-gray-300 bg-gray-50 p-0.5", children: [
|
|
535
|
+
/* @__PURE__ */ jsx(
|
|
536
|
+
"button",
|
|
537
|
+
{
|
|
538
|
+
type: "button",
|
|
539
|
+
onClick: () => setReportType("bug"),
|
|
540
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${isBug ? "bg-white text-gray-900 shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
|
|
541
|
+
children: "Bug"
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ jsx(
|
|
545
|
+
"button",
|
|
546
|
+
{
|
|
547
|
+
type: "button",
|
|
548
|
+
onClick: () => setReportType("suggestion"),
|
|
549
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${!isBug ? "bg-white text-gray-900 shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
|
|
550
|
+
children: "Suggestion"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] }),
|
|
554
|
+
previewUrl && /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
555
|
+
/* @__PURE__ */ jsxs("div", { className: "relative rounded-md border border-gray-200 overflow-hidden bg-gray-50 max-h-64", children: [
|
|
556
|
+
/* @__PURE__ */ jsx("img", { src: previewUrl, alt: "Screenshot preview", className: "w-full h-auto max-h-64 object-contain" }),
|
|
557
|
+
/* @__PURE__ */ jsxs(
|
|
558
|
+
"button",
|
|
559
|
+
{
|
|
560
|
+
type: "button",
|
|
561
|
+
onClick: () => setAnnotating(true),
|
|
562
|
+
className: "absolute top-2 right-2 inline-flex items-center gap-1 px-2.5 py-1 rounded-md bg-white/95 backdrop-blur border border-gray-200 shadow-sm text-xs font-medium text-gray-700 hover:bg-white",
|
|
563
|
+
title: "Mark up the screenshot \u2014 circle, arrow, mosaic, text\u2026",
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ jsx("svg", { className: "h-3.5 w-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.7, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125" }) }),
|
|
566
|
+
"Annotate"
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
)
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-gray-400", children: "Click Annotate to mark up the screenshot before sending." })
|
|
572
|
+
] }),
|
|
573
|
+
!previewUrl && /* @__PURE__ */ jsx(UploadDropZone, { onSelect: (blob) => setScreenshot(blob) }),
|
|
574
|
+
/* @__PURE__ */ jsxs("label", { className: "mt-4 block text-sm font-medium text-gray-700", children: [
|
|
575
|
+
isBug ? "What went wrong?" : "What's your suggestion?",
|
|
576
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-gray-400 ml-1", children: "(optional)" })
|
|
577
|
+
] }),
|
|
578
|
+
/* @__PURE__ */ jsx(
|
|
579
|
+
"textarea",
|
|
549
580
|
{
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
581
|
+
autoFocus: true,
|
|
582
|
+
value: description,
|
|
583
|
+
onChange: (e) => setDescription(e.target.value),
|
|
584
|
+
onKeyDown: (e) => {
|
|
585
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) handleSubmit();
|
|
586
|
+
},
|
|
587
|
+
placeholder: isBug ? "Briefly describe the issue, what you were doing, what you expected to happen\u2026" : "Briefly describe what would make this better\u2026",
|
|
588
|
+
rows: 3,
|
|
589
|
+
className: "mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none resize-none"
|
|
558
590
|
}
|
|
559
|
-
)
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
/* @__PURE__ */ jsx(
|
|
584
|
-
"button",
|
|
585
|
-
{
|
|
586
|
-
type: "button",
|
|
587
|
-
onClick: handleCancel,
|
|
588
|
-
className: "bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",
|
|
589
|
-
children: "Cancel"
|
|
590
|
-
}
|
|
591
|
-
),
|
|
592
|
-
/* @__PURE__ */ jsx(
|
|
593
|
-
"button",
|
|
591
|
+
),
|
|
592
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex justify-end gap-3", children: [
|
|
593
|
+
/* @__PURE__ */ jsx(
|
|
594
|
+
"button",
|
|
595
|
+
{
|
|
596
|
+
type: "button",
|
|
597
|
+
onClick: handleCancel,
|
|
598
|
+
className: "bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",
|
|
599
|
+
children: "Cancel"
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
/* @__PURE__ */ jsx(
|
|
603
|
+
"button",
|
|
604
|
+
{
|
|
605
|
+
type: "button",
|
|
606
|
+
onClick: handleSubmit,
|
|
607
|
+
className: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",
|
|
608
|
+
children: "Send"
|
|
609
|
+
}
|
|
610
|
+
)
|
|
611
|
+
] })
|
|
612
|
+
] }) }),
|
|
613
|
+
annotating && previewUrl && /* @__PURE__ */ jsx(
|
|
614
|
+
BugReportAnnotator,
|
|
594
615
|
{
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
616
|
+
src: previewUrl,
|
|
617
|
+
onApply: (blob) => {
|
|
618
|
+
setScreenshot(blob);
|
|
619
|
+
setAnnotating(false);
|
|
620
|
+
},
|
|
621
|
+
onCancel: () => setAnnotating(false)
|
|
599
622
|
}
|
|
600
623
|
)
|
|
601
|
-
]
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
BugReportAnnotator,
|
|
605
|
-
{
|
|
606
|
-
src: previewUrl,
|
|
607
|
-
onApply: (blob) => {
|
|
608
|
-
setScreenshot(blob);
|
|
609
|
-
setAnnotating(false);
|
|
610
|
-
},
|
|
611
|
-
onCancel: () => setAnnotating(false)
|
|
612
|
-
}
|
|
613
|
-
)
|
|
614
|
-
] })
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
)
|
|
615
627
|
] });
|
|
616
628
|
}
|
|
617
629
|
var LazyImageAnnotator = lazy(() => import('./ImageAnnotator-CTTMAY5Z.js'));
|
|
@@ -849,7 +861,7 @@ function StatusBadge({ status }) {
|
|
|
849
861
|
}
|
|
850
862
|
|
|
851
863
|
// src/version.ts
|
|
852
|
-
var VERSION = "0.2.
|
|
864
|
+
var VERSION = "0.2.39" ;
|
|
853
865
|
var APP_VERSION = VERSION;
|
|
854
866
|
|
|
855
867
|
// src/changelog.ts
|