glitchgrab 1.68.1 → 1.68.2

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.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-Dadt801V.mjs';
3
- export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-Dadt801V.mjs';
2
+ import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-CN-BjNB6.mjs';
3
+ export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-CN-BjNB6.mjs';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-Dadt801V.js';
3
- export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-Dadt801V.js';
2
+ import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-CN-BjNB6.js';
3
+ export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-CN-BjNB6.js';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
package/dist/index.js CHANGED
@@ -2096,18 +2096,6 @@ function AnnotationCanvas({ imageSrc, onSave, onCancel }) {
2096
2096
  }
2097
2097
  );
2098
2098
  }
2099
- var SEVERITY_LEVELS = [
2100
- "low",
2101
- "medium",
2102
- "high",
2103
- "critical"
2104
- ];
2105
- var SEVERITY_LABELS = {
2106
- low: "Low",
2107
- medium: "Medium",
2108
- high: "High",
2109
- critical: "Critical"
2110
- };
2111
2099
  var MAX_ASSIST_IMAGES = 3;
2112
2100
  var MAX_ASSIST_IMAGE_CHARS = 35e5;
2113
2101
  var MAX_ASSIST_FILES = 3;
@@ -2884,11 +2872,7 @@ function AssistSheet({
2884
2872
  onDescriptionChange,
2885
2873
  issueTitle,
2886
2874
  onIssueTitleChange,
2887
- severity,
2888
- onSeverityChange,
2889
- showSeverity,
2890
2875
  validationError,
2891
- severityRefused = false,
2892
2876
  onDuplicateChange,
2893
2877
  onConversationChange,
2894
2878
  isSubmitting,
@@ -2904,7 +2888,6 @@ function AssistSheet({
2904
2888
  }) {
2905
2889
  var _a;
2906
2890
  const narrow = useIsNarrow();
2907
- const severityAsked = showSeverity && currentTile === "BUG";
2908
2891
  const [messages, setMessages] = (0, import_react3.useState)([]);
2909
2892
  const [input, setInput] = (0, import_react3.useState)("");
2910
2893
  const [busy, setBusy] = (0, import_react3.useState)(false);
@@ -2930,15 +2913,13 @@ function AssistSheet({
2930
2913
  const [duplicate, setDuplicate] = (0, import_react3.useState)(null);
2931
2914
  const [glitchgrabOffer, setGlitchgrabOffer] = (0, import_react3.useState)(false);
2932
2915
  const [solved, setSolved] = (0, import_react3.useState)(null);
2933
- const needsSeverity = (tile) => showSeverity && tile === "BUG" && !severity;
2934
2916
  const [phase, setPhase] = (0, import_react3.useState)(
2935
- () => !typePicked ? "type" : currentTile === "RATING" ? "rating" : needsSeverity(currentTile) ? "severity" : "chat"
2917
+ () => !typePicked ? "type" : currentTile === "RATING" ? "rating" : "chat"
2936
2918
  );
2937
2919
  const scrollRef = (0, import_react3.useRef)(null);
2938
2920
  const draftRef = (0, import_react3.useRef)(null);
2939
2921
  const composerRef = (0, import_react3.useRef)(null);
2940
2922
  const seededRef = (0, import_react3.useRef)(false);
2941
- const seedPendingRef = (0, import_react3.useRef)(false);
2942
2923
  const resumeAskRef = (0, import_react3.useRef)(false);
2943
2924
  const eventsRef = (0, import_react3.useRef)([]);
2944
2925
  const inferredTypeRef = (0, import_react3.useRef)(false);
@@ -3206,10 +3187,6 @@ function AssistSheet({
3206
3187
  }
3207
3188
  return;
3208
3189
  }
3209
- if (phase === "severity") {
3210
- seedPendingRef.current = true;
3211
- return;
3212
- }
3213
3190
  seedFromDescription();
3214
3191
  }, []);
3215
3192
  function seedFromDescription() {
@@ -3219,14 +3196,6 @@ function AssistSheet({
3219
3196
  setMessages(history2);
3220
3197
  void runTurn(history2);
3221
3198
  }
3222
- function answerSeverity(value) {
3223
- onSeverityChange(value);
3224
- setPhase("chat");
3225
- if (seedPendingRef.current) {
3226
- seedPendingRef.current = false;
3227
- seedFromDescription();
3228
- }
3229
- }
3230
3199
  function send2(text) {
3231
3200
  const value = text.trim();
3232
3201
  if (!value || busy) return;
@@ -3319,7 +3288,6 @@ function AssistSheet({
3319
3288
  setShowChats(false);
3320
3289
  setViewingChat(null);
3321
3290
  resumeAskRef.current = (last == null ? void 0 : last.role) === "user";
3322
- seedPendingRef.current = false;
3323
3291
  }
3324
3292
  (0, import_react3.useEffect)(() => {
3325
3293
  if (!resumeAskRef.current) return;
@@ -3707,7 +3675,6 @@ function AssistSheet({
3707
3675
  ),
3708
3676
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { fontSize: "11.5px", color: t.textMuted, marginTop: "3px" }, children: [
3709
3677
  phase === "type" || !typePicked || inferredTypeRef.current && phase !== "draft" ? null : reportTypeLabel,
3710
- phase !== "type" && severityAsked && severity ? ` \xB7 ${SEVERITY_LABELS[severity]}` : null,
3711
3678
  projectSlot ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { marginLeft: "6px" }, children: projectSlot }) : null
3712
3679
  ] })
3713
3680
  ] }),
@@ -3818,63 +3785,6 @@ function AssistSheet({
3818
3785
  minWidth: 0
3819
3786
  },
3820
3787
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: showChats ? "none" : "contents" }, children: [
3821
- phase === "severity" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
3822
- resumeCard,
3823
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [
3824
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Avatar, { who: "assistant", theme: t }),
3825
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3826
- "div",
3827
- {
3828
- style: {
3829
- padding: "9px 12px",
3830
- borderRadius: "12px 12px 12px 4px",
3831
- backgroundColor: t.bgSecondary,
3832
- fontSize: "13px",
3833
- lineHeight: 1.55,
3834
- maxWidth: "88%"
3835
- },
3836
- children: "How bad is it?"
3837
- }
3838
- )
3839
- ] }),
3840
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3841
- "div",
3842
- {
3843
- role: "radiogroup",
3844
- "aria-label": "Severity",
3845
- style: {
3846
- display: "flex",
3847
- flexWrap: "wrap",
3848
- gap: "6px",
3849
- paddingLeft: "32px"
3850
- },
3851
- children: SEVERITY_LEVELS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3852
- "button",
3853
- {
3854
- type: "button",
3855
- role: "radio",
3856
- "aria-checked": severity === s,
3857
- "data-gg-chip": "",
3858
- "data-gg-severity": s,
3859
- onClick: () => answerSeverity(s),
3860
- style: {
3861
- border: `1px solid ${t.inputBorder}`,
3862
- background: "transparent",
3863
- color: t.textMuted,
3864
- borderRadius: "999px",
3865
- // Same as the picker and option chips — one chip size.
3866
- padding: "8px 12px",
3867
- fontSize: "12px",
3868
- fontFamily: "inherit",
3869
- cursor: "pointer"
3870
- },
3871
- children: SEVERITY_LABELS[s]
3872
- },
3873
- s
3874
- ))
3875
- }
3876
- )
3877
- ] }),
3878
3788
  phase === "rating" && !submitted && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
3879
3789
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [
3880
3790
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Avatar, { who: "assistant", theme: t }),
@@ -4477,71 +4387,6 @@ function AssistSheet({
4477
4387
  }
4478
4388
  }
4479
4389
  ),
4480
- severityAsked && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
4481
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4482
- "span",
4483
- {
4484
- style: {
4485
- fontSize: "11.5px",
4486
- color: t.textMuted,
4487
- display: "block",
4488
- marginBottom: "6px"
4489
- },
4490
- children: [
4491
- "How bad is it?",
4492
- !severity && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4493
- "span",
4494
- {
4495
- style: {
4496
- marginLeft: "6px",
4497
- fontSize: "11px",
4498
- color: severityRefused ? "#ef4444" : t.textMuted
4499
- },
4500
- children: "\xB7 required"
4501
- }
4502
- )
4503
- ]
4504
- }
4505
- ),
4506
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4507
- "div",
4508
- {
4509
- role: "radiogroup",
4510
- "aria-label": "Severity",
4511
- style: { display: "flex", gap: "6px" },
4512
- children: SEVERITY_LEVELS.map((s) => {
4513
- const on = severity === s;
4514
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4515
- "button",
4516
- {
4517
- type: "button",
4518
- onClick: () => onSeverityChange(s),
4519
- role: "radio",
4520
- "aria-checked": on,
4521
- style: {
4522
- flex: 1,
4523
- minWidth: 0,
4524
- padding: "8px 2px",
4525
- borderRadius: "8px",
4526
- border: `1px solid ${on ? t.accent : severityRefused ? "#ef4444" : t.inputBorder}`,
4527
- backgroundColor: on ? t.accent : "transparent",
4528
- color: on ? t.accentText : t.textMuted,
4529
- fontSize: "12px",
4530
- fontWeight: 600,
4531
- fontFamily: "inherit",
4532
- whiteSpace: "nowrap",
4533
- overflow: "hidden",
4534
- textOverflow: "ellipsis",
4535
- cursor: "pointer"
4536
- },
4537
- children: SEVERITY_LABELS[s]
4538
- },
4539
- s
4540
- );
4541
- })
4542
- }
4543
- )
4544
- ] }),
4545
4390
  attachmentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: { fontSize: "11.5px", color: t.textMuted }, children: [
4546
4391
  attachmentCount,
4547
4392
  " ",
@@ -4597,7 +4442,7 @@ function AssistSheet({
4597
4442
  ]
4598
4443
  }
4599
4444
  ),
4600
- !submitted && !showChats && phase !== "severity" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4445
+ !submitted && !showChats && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4601
4446
  "div",
4602
4447
  {
4603
4448
  style: {
@@ -5858,7 +5703,6 @@ function detectHostAccent() {
5858
5703
  return null;
5859
5704
  }
5860
5705
  }
5861
- var SEVERITY_REQUIRED = "Pick how bad it is before sending.";
5862
5706
  var SHOT_WAIT_MS = 3e3;
5863
5707
  var SIMILAR_WAIT_MS = 2500;
5864
5708
  var MAX_SIMILAR_SHOWN = 3;
@@ -6089,7 +5933,6 @@ function ReportDialog({
6089
5933
  assistContext = null,
6090
5934
  transcribeAudio: transcribeAudio2,
6091
5935
  types,
6092
- showSeverity = true,
6093
5936
  captureScreenshot = captureDefaultScreenshot,
6094
5937
  reporter: reporter2,
6095
5938
  onClose,
@@ -6216,14 +6059,12 @@ function ReportDialog({
6216
6059
  }, [isOpen]);
6217
6060
  const [step, setStep] = (0, import_react.useState)(1);
6218
6061
  const [reportType, setReportType] = (0, import_react.useState)("BUG");
6219
- const [severity, setSeverity] = (0, import_react.useState)(null);
6220
6062
  const [validationError, setValidationError] = (0, import_react.useState)(null);
6221
6063
  const [placeholderIdx, setPlaceholderIdx] = (0, import_react.useState)(0);
6222
6064
  const [rating, setRating] = (0, import_react.useState)(0);
6223
6065
  const [hoveredStar, setHoveredStar] = (0, import_react.useState)(0);
6224
6066
  const isRating = reportType === "RATING";
6225
6067
  const submitDisabled = isSubmitting || (isRating ? rating < 1 : !description.trim());
6226
- const needsSeverity = validationError === SEVERITY_REQUIRED && showSeverity && reportType === "BUG" && !severity;
6227
6068
  const availableTypes = types != null ? types : [
6228
6069
  "BUG",
6229
6070
  "FEATURE_REQUEST",
@@ -6568,7 +6409,6 @@ function ReportDialog({
6568
6409
  setPickedSimilar(null);
6569
6410
  setCheckingSimilar(false);
6570
6411
  setAttachingTo(null);
6571
- setSeverity(null);
6572
6412
  setValidationError(null);
6573
6413
  setSelfReportFrom(null);
6574
6414
  setVoiceError(null);
@@ -6794,11 +6634,6 @@ function ReportDialog({
6794
6634
  setStep(2);
6795
6635
  return;
6796
6636
  }
6797
- if (showSeverity && reportType === "BUG" && !severity) {
6798
- setValidationError(SEVERITY_REQUIRED);
6799
- setStep(2);
6800
- return;
6801
- }
6802
6637
  const duplicateOf = (_a2 = opts == null ? void 0 : opts.duplicateOf) != null ? _a2 : duplicateIssueNumber;
6803
6638
  const attachKind = (opts == null ? void 0 : opts.duplicateOf) ? (_b = opts.kind) != null ? _b : "duplicate" : duplicateKind;
6804
6639
  if (findSimilarIssues2 && !(opts == null ? void 0 : opts.skipSimilar) && !duplicateOf) {
@@ -6839,9 +6674,6 @@ function ReportDialog({
6839
6674
  const metadata = {};
6840
6675
  if (shots.length > 0) metadata.screenshots = JSON.stringify(shots);
6841
6676
  if (attachments.length > 0) metadata.attachments = JSON.stringify(attachments);
6842
- if (showSeverity && reportType === "BUG" && severity) {
6843
- metadata.severity = severity;
6844
- }
6845
6677
  if (duplicateOf) {
6846
6678
  metadata.duplicateIssueNumber = String(duplicateOf);
6847
6679
  if (attachKind === "related") metadata.duplicateKind = "related";
@@ -8607,82 +8439,6 @@ function ReportDialog({
8607
8439
  }
8608
8440
  )
8609
8441
  ] }),
8610
- showSeverity && reportType === "BUG" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { marginTop: "10px" }, children: [
8611
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
8612
- "span",
8613
- {
8614
- style: {
8615
- fontSize: "12px",
8616
- color: t.textMuted,
8617
- marginBottom: "6px",
8618
- display: "flex",
8619
- alignItems: "center",
8620
- gap: "6px"
8621
- },
8622
- children: [
8623
- "How bad is it?",
8624
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
8625
- "span",
8626
- {
8627
- style: {
8628
- color: severity ? t.textMuted : needsSeverity ? "#ef4444" : t.textMuted,
8629
- fontSize: "11px"
8630
- },
8631
- children: severity ? "" : "\xB7 required"
8632
- }
8633
- )
8634
- ]
8635
- }
8636
- ),
8637
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
8638
- "div",
8639
- {
8640
- role: "radiogroup",
8641
- "aria-label": "Severity",
8642
- style: { display: "flex", gap: "6px" },
8643
- children: SEVERITY_LEVELS.map((s) => {
8644
- const on = severity === s;
8645
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
8646
- "button",
8647
- {
8648
- type: "button",
8649
- role: "radio",
8650
- "aria-checked": on,
8651
- onClick: () => {
8652
- setSeverity(s);
8653
- if (validationError)
8654
- setValidationError(null);
8655
- },
8656
- style: {
8657
- flex: 1,
8658
- minWidth: 0,
8659
- // 9px + 12px line + borders clears a 36px
8660
- // tap target; 6px left it at ~29px.
8661
- padding: "9px 2px",
8662
- borderRadius: "6px",
8663
- border: `1px solid ${on ? t.accent : needsSeverity ? "#ef4444" : t.inputBorder}`,
8664
- background: on ? t.accent : "transparent",
8665
- color: on ? t.accentText : t.text,
8666
- fontSize: "12px",
8667
- fontWeight: 600,
8668
- cursor: "pointer",
8669
- fontFamily: "inherit",
8670
- whiteSpace: "nowrap",
8671
- // Four labels where there were three: clip
8672
- // rather than spill if a host squeezes the
8673
- // dialog below ~260px.
8674
- overflow: "hidden",
8675
- textOverflow: "ellipsis",
8676
- transition: "all 0.15s ease"
8677
- },
8678
- children: SEVERITY_LABELS[s]
8679
- },
8680
- s
8681
- );
8682
- })
8683
- }
8684
- )
8685
- ] }),
8686
8442
  validationError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
8687
8443
  "p",
8688
8444
  {
@@ -9033,14 +8789,6 @@ function ReportDialog({
9033
8789
  },
9034
8790
  issueTitle,
9035
8791
  onIssueTitleChange: setIssueTitle,
9036
- severity,
9037
- onSeverityChange: (value) => {
9038
- setSeverity(value);
9039
- if (validationError) setValidationError(null);
9040
- },
9041
- showSeverity,
9042
- validationError,
9043
- severityRefused: needsSeverity,
9044
8792
  isSubmitting,
9045
8793
  submitted,
9046
8794
  onSend: () => void handleSubmit(),
@@ -11081,7 +10829,6 @@ function GlitchgrabProviderInner({
11081
10829
  children,
11082
10830
  fallback,
11083
10831
  types,
11084
- showSeverity,
11085
10832
  ignoreErrors,
11086
10833
  release: release2,
11087
10834
  context: appContext2,
@@ -11656,7 +11403,6 @@ function GlitchgrabProviderInner({
11656
11403
  reportGlitchgrabProblem: glitchgrabReport ? reportGlitchgrabProblem : void 0,
11657
11404
  transcribeAudio: aiBlockedUnsigned ? void 0 : transcribe,
11658
11405
  types,
11659
- showSeverity,
11660
11406
  reporter: reporter2,
11661
11407
  chatHistoryKey: chatHistoryKey("sdk", token, session == null ? void 0 : session.userId),
11662
11408
  headerSlot: projectName ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { fontSize: 11, color: "#9aa0a6" }, children: [