@mushi-mushi/web 1.22.4 → 1.23.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
@@ -146,10 +146,32 @@ declare class MushiWidget {
146
146
  private screenshotCapturing;
147
147
  private screenshotError;
148
148
  private allowScreenshotRemove;
149
+ /**
150
+ * Whether the screenshot / element-select tools are actually usable
151
+ * (capture module present + not disabled by config). Unavailable tools are
152
+ * hidden from the details step — a rendered button whose handler silently
153
+ * no-ops reads as a bug to the reporter.
154
+ */
155
+ private screenshotAvailable;
156
+ private elementAvailable;
157
+ /**
158
+ * In-progress form input preserved across full shadow-DOM re-renders.
159
+ * render() rebuilds the panel with `innerHTML = ''`, which used to destroy
160
+ * whatever the reporter had typed whenever a background refresh (60s inbox
161
+ * poll, visibilitychange refetch, screenshot attach) fired mid-typing.
162
+ * Captured from the live DOM right before teardown, replayed right after.
163
+ */
164
+ private draftDescription;
165
+ private draftEmail;
166
+ private draftReply;
167
+ private draftFocus;
168
+ private draftSelStart;
169
+ private draftSelEnd;
149
170
  /** Data URL of the attached screenshot, rendered as a visible preview. */
150
171
  private screenshotPreview;
151
172
  private elementSelected;
152
173
  private elementCapturing;
174
+ private elementError;
153
175
  private submitting;
154
176
  /** Hint element injected outside the shadow DOM during element selection. */
155
177
  private selectorHint;
@@ -278,7 +300,14 @@ declare class MushiWidget {
278
300
  */
279
301
  private resolveScreenshotHint;
280
302
  setAllowScreenshotRemove(allow: boolean): void;
303
+ /** Show/hide the attachment tools based on what the SDK can actually do. */
304
+ setCaptureAvailability(availability: {
305
+ screenshot?: boolean;
306
+ element?: boolean;
307
+ }): void;
281
308
  setElementSelected(selected: boolean): void;
309
+ /** Surface a failed/cancelled element-selection attempt (mirrors setScreenshotError). */
310
+ setElementError(failed: boolean): void;
282
311
  setScreenshotCapturing(capturing: boolean): void;
283
312
  setScreenshotError(failed: boolean): void;
284
313
  setElementCapturing(capturing: boolean): void;
@@ -367,6 +396,11 @@ declare class MushiWidget {
367
396
  private detectEnvironment;
368
397
  private isRouteHidden;
369
398
  private getTheme;
399
+ /** Snapshot in-progress form input from the live DOM before teardown. */
400
+ private captureFormDrafts;
401
+ /** Replay captured drafts (value + focus + caret) into a freshly built panel. */
402
+ private restoreFormDrafts;
403
+ private clearFormDrafts;
370
404
  private render;
371
405
  /**
372
406
  * Queries each `avoidSelectors` element in the host document and returns
@@ -423,6 +457,8 @@ declare class MushiWidget {
423
457
  private submitReporterReopen;
424
458
  /** Refresh My Reports data for unread badges without opening the inbox panel. */
425
459
  refreshReporterInboxQuiet(): Promise<void>;
460
+ /** Patch the "Your reports (N new)" nav label in place, if it is rendered. */
461
+ private updateReportsBadgeText;
426
462
  private loadReporterReports;
427
463
  private loadReporterComments;
428
464
  private submitReporterFeedback;
package/dist/index.d.ts CHANGED
@@ -146,10 +146,32 @@ declare class MushiWidget {
146
146
  private screenshotCapturing;
147
147
  private screenshotError;
148
148
  private allowScreenshotRemove;
149
+ /**
150
+ * Whether the screenshot / element-select tools are actually usable
151
+ * (capture module present + not disabled by config). Unavailable tools are
152
+ * hidden from the details step — a rendered button whose handler silently
153
+ * no-ops reads as a bug to the reporter.
154
+ */
155
+ private screenshotAvailable;
156
+ private elementAvailable;
157
+ /**
158
+ * In-progress form input preserved across full shadow-DOM re-renders.
159
+ * render() rebuilds the panel with `innerHTML = ''`, which used to destroy
160
+ * whatever the reporter had typed whenever a background refresh (60s inbox
161
+ * poll, visibilitychange refetch, screenshot attach) fired mid-typing.
162
+ * Captured from the live DOM right before teardown, replayed right after.
163
+ */
164
+ private draftDescription;
165
+ private draftEmail;
166
+ private draftReply;
167
+ private draftFocus;
168
+ private draftSelStart;
169
+ private draftSelEnd;
149
170
  /** Data URL of the attached screenshot, rendered as a visible preview. */
150
171
  private screenshotPreview;
151
172
  private elementSelected;
152
173
  private elementCapturing;
174
+ private elementError;
153
175
  private submitting;
154
176
  /** Hint element injected outside the shadow DOM during element selection. */
155
177
  private selectorHint;
@@ -278,7 +300,14 @@ declare class MushiWidget {
278
300
  */
279
301
  private resolveScreenshotHint;
280
302
  setAllowScreenshotRemove(allow: boolean): void;
303
+ /** Show/hide the attachment tools based on what the SDK can actually do. */
304
+ setCaptureAvailability(availability: {
305
+ screenshot?: boolean;
306
+ element?: boolean;
307
+ }): void;
281
308
  setElementSelected(selected: boolean): void;
309
+ /** Surface a failed/cancelled element-selection attempt (mirrors setScreenshotError). */
310
+ setElementError(failed: boolean): void;
282
311
  setScreenshotCapturing(capturing: boolean): void;
283
312
  setScreenshotError(failed: boolean): void;
284
313
  setElementCapturing(capturing: boolean): void;
@@ -367,6 +396,11 @@ declare class MushiWidget {
367
396
  private detectEnvironment;
368
397
  private isRouteHidden;
369
398
  private getTheme;
399
+ /** Snapshot in-progress form input from the live DOM before teardown. */
400
+ private captureFormDrafts;
401
+ /** Replay captured drafts (value + focus + caret) into a freshly built panel. */
402
+ private restoreFormDrafts;
403
+ private clearFormDrafts;
370
404
  private render;
371
405
  /**
372
406
  * Queries each `avoidSelectors` element in the host document and returns
@@ -423,6 +457,8 @@ declare class MushiWidget {
423
457
  private submitReporterReopen;
424
458
  /** Refresh My Reports data for unread badges without opening the inbox panel. */
425
459
  refreshReporterInboxQuiet(): Promise<void>;
460
+ /** Patch the "Your reports (N new)" nav label in place, if it is rendered. */
461
+ private updateReportsBadgeText;
426
462
  private loadReporterReports;
427
463
  private loadReporterComments;
428
464
  private submitReporterFeedback;