@mushi-mushi/web 1.37.0 → 1.38.0

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.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MushiInitConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiReporterTimelineItem, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiReporterUpdates, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
2
2
  export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiInitConfig, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
3
- import { g as ScreenshotFailureReason } from './timeline-B8nMyZyM.cjs';
4
- export { C as ConsoleCapture, E as ElementSelector, N as NetworkCapture, P as PerformanceCapture, S as ScreenshotCapture, T as TimelineCapture, c as createConsoleCapture, a as createElementSelector, b as createNetworkCapture, d as createPerformanceCapture, e as createScreenshotCapture, f as createTimelineCapture } from './timeline-B8nMyZyM.cjs';
3
+ import { g as ScreenshotFailureReason } from './timeline-DoBCj4dt.cjs';
4
+ export { C as ConsoleCapture, E as ElementSelector, N as NetworkCapture, P as PerformanceCapture, S as ScreenshotCapture, T as TimelineCapture, c as createConsoleCapture, a as createElementSelector, b as createNetworkCapture, d as createPerformanceCapture, e as createScreenshotCapture, f as createTimelineCapture } from './timeline-DoBCj4dt.cjs';
5
5
  export { MushiLocale, getAvailableLocales, getLocale } from './i18n/index.cjs';
6
6
 
7
7
  declare class Mushi {
@@ -99,6 +99,13 @@ interface WidgetCallbacks {
99
99
  description: string;
100
100
  intent?: string;
101
101
  }): void | Promise<WidgetSubmitOutcome | void>;
102
+ /**
103
+ * Runs when the reporter presses Send, before `onSubmit`. Resolves `true`
104
+ * when it just attached a screenshot the reporter has not seen (the
105
+ * `on-report` capture): the widget then stays on the report step with the
106
+ * preview open and waits for a second Send, so no image leaves unseen.
107
+ */
108
+ onBeforeSubmit?(): boolean | Promise<boolean>;
102
109
  onOpen(): void;
103
110
  onClose(): void;
104
111
  /** "Bug reports by Mushi Mushi" mark: impression once per widget instance, click per activation → loop_* events. */
@@ -201,6 +208,8 @@ declare class MushiWidget {
201
208
  /** The reporter asked for (or marked up) the screenshot — an auto-capture on open doesn't count as saying something. */
202
209
  private screenshotByUser;
203
210
  private previewOpen;
211
+ /** Send just captured the screenshot: it stays open for review until a second Send. */
212
+ private screenshotReview;
204
213
  private allowScreenshotRemove;
205
214
  /** Unusable tools are hidden — a button whose handler no-ops reads as a bug. */
206
215
  private screenshotAvailable;
package/dist/index.d.ts CHANGED
@@ -28,6 +28,10 @@ interface ScreenshotCaptureOptions {
28
28
  * - error: anything else
29
29
  */
30
30
  type ScreenshotFailureReason = 'taint' | 'timeout' | 'unsupported' | 'csp' | 'error';
31
+ /**
32
+ * The capture code lives in ./screenshot-dom and loads on the first
33
+ * screenshot, so a page that never takes one never downloads it.
34
+ */
31
35
  declare function createScreenshotCapture(options?: ScreenshotCaptureOptions): ScreenshotCapture;
32
36
 
33
37
  /**
@@ -117,6 +121,13 @@ interface WidgetCallbacks {
117
121
  description: string;
118
122
  intent?: string;
119
123
  }): void | Promise<WidgetSubmitOutcome | void>;
124
+ /**
125
+ * Runs when the reporter presses Send, before `onSubmit`. Resolves `true`
126
+ * when it just attached a screenshot the reporter has not seen (the
127
+ * `on-report` capture): the widget then stays on the report step with the
128
+ * preview open and waits for a second Send, so no image leaves unseen.
129
+ */
130
+ onBeforeSubmit?(): boolean | Promise<boolean>;
120
131
  onOpen(): void;
121
132
  onClose(): void;
122
133
  /** "Bug reports by Mushi Mushi" mark: impression once per widget instance, click per activation → loop_* events. */
@@ -219,6 +230,8 @@ declare class MushiWidget {
219
230
  /** The reporter asked for (or marked up) the screenshot — an auto-capture on open doesn't count as saying something. */
220
231
  private screenshotByUser;
221
232
  private previewOpen;
233
+ /** Send just captured the screenshot: it stays open for review until a second Send. */
234
+ private screenshotReview;
222
235
  private allowScreenshotRemove;
223
236
  /** Unusable tools are hidden — a button whose handler no-ops reads as a bug. */
224
237
  private screenshotAvailable;
@@ -648,7 +661,13 @@ interface ElementSelector {
648
661
  deactivate(): void;
649
662
  isActive(): boolean;
650
663
  }
651
- declare function createElementSelector(): ElementSelector;
664
+ /**
665
+ * @param privateSelector CSS selector for areas whose text never leaves the
666
+ * page (the screenshot redaction list). An element inside one, or holding
667
+ * one, is reported without its text.
668
+ * @param scrubText Runs over the element text that is kept (the PII scrubber).
669
+ */
670
+ declare function createElementSelector(privateSelector?: () => string, scrubText?: (text: string) => string): ElementSelector;
652
671
 
653
672
  interface TimelineCapture {
654
673
  setScreen(screen: {
@@ -742,6 +761,8 @@ interface MushiLocale {
742
761
  notSentBlocked: string;
743
762
  /** The SDK's own send limiter refused the report; the text is kept. */
744
763
  notSentThrottled: string;
764
+ /** Shown after Send captured a screenshot the reporter hasn't seen yet: check it, then Send again. */
765
+ screenshotReview: string;
745
766
  /** Why the last capture failed, shown under the attachment row. */
746
767
  screenshotErrors: {
747
768
  permission: string;