@mushi-mushi/web 1.32.2 → 1.33.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,12 +1,12 @@
1
- import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiReporterTimelineItem, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiReporterUpdates, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
2
- export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
1
+ import { MushiInitConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiReporterTimelineItem, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiReporterUpdates, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
2
+ export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiInitConfig, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
3
3
  import { g as ScreenshotFailureReason } from './timeline-B8nMyZyM.cjs';
4
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';
5
5
  export { MushiLocale, getAvailableLocales, getLocale } from './i18n/index.cjs';
6
6
 
7
7
  declare class Mushi {
8
8
  private constructor();
9
- static init(config: MushiConfig): MushiSDKInstance;
9
+ static init(config?: MushiInitConfig): MushiSDKInstance;
10
10
  static getInstance(): MushiSDKInstance | null;
11
11
  static destroy(): void;
12
12
  static diagnose(): Promise<MushiDiagnosticsResult>;
@@ -266,6 +266,18 @@ declare class MushiWidget {
266
266
  private bannerResizeObserver;
267
267
  /** Persisted FAB position when draggable is enabled. */
268
268
  private fabPos;
269
+ /** Storage key `fabPos` was loaded for. */
270
+ private fabPosKey;
271
+ private draggableSet;
272
+ /** px from the viewport bottom that clears fixed host bars. */
273
+ private barClearance;
274
+ private clampedForClearance;
275
+ private tuckCleanup;
276
+ private tuckTimer;
277
+ private resizeFrame;
278
+ private lateMeasureTimer;
279
+ private readonly onViewportResize;
280
+ private launcherDismissed;
269
281
  /** Cleanup fn for visualViewport keyboard listener. */
270
282
  private vvCleanup;
271
283
  /** Host-app user identity from `identify()` — shown as "Reporting as <name>". */
@@ -398,6 +410,14 @@ declare class MushiWidget {
398
410
  };
399
411
  private syncAttachedLaunchers;
400
412
  private syncSmartHide;
413
+ /** Tuck the launcher while anything scrolls (capture: inner scrollers count). A class toggle, not a rebuild, so focus and drag survive. */
414
+ private syncScrollTuck;
415
+ /**
416
+ * px that clears a bar docked at the viewport bottom, + 8px: a short fixed/sticky
417
+ * element, or a flow child of a fixed full-height shell. Scroller content never counts.
418
+ */
419
+ private measureFixedBars;
420
+ private dismissLauncherForSession;
401
421
  private shouldRenderTrigger;
402
422
  /** Height of the banner in px — used as a fallback before first layout. */
403
423
  private static readonly BANNER_HEIGHT;
@@ -429,6 +449,9 @@ declare class MushiWidget {
429
449
  private syncChrome;
430
450
  private syncTrigger;
431
451
  private buildTrigger;
452
+ private restoreFabPos;
453
+ /** Drag options, or null when fixed. The tab drags along its edge unless `draggable: false`. */
454
+ private dragOptions;
432
455
  private render;
433
456
  private renderPanel;
434
457
  /** On a new surface: the report textarea, else the title, so screen readers announce where they are. */
@@ -437,20 +460,28 @@ declare class MushiWidget {
437
460
  private captureFormDrafts;
438
461
  /** Replay values (and focus + caret) into fields a patch just created. */
439
462
  private restoreFormDrafts;
440
- /** Queries `avoidSelectors` and returns a top offset clearing all of them, or null. */
463
+ /**
464
+ * Queries `avoidSelectors` and returns a top offset clearing the ones in the
465
+ * top half of the viewport, or null. A bottom tab bar is ignored here: clearing
466
+ * it from the top edge would push the widget off-screen.
467
+ */
441
468
  private computeAvoidTopPx;
442
- /** Bottom offset so a bottom-anchored trigger clears avoided elements (tab bars, fixed CTAs). */
469
+ /**
470
+ * Bottom offset so a bottom-anchored trigger clears avoided elements in the
471
+ * bottom half of the viewport (tab bars, fixed CTAs). A top header is ignored
472
+ * here: clearing it from the bottom edge would push the widget off-screen.
473
+ */
443
474
  private computeAvoidBottomPx;
475
+ private hostCssVar;
444
476
  private applyInsetVars;
445
- /** Storage key for the FAB position, scoped to projectId when available. */
477
+ /** Per-site (origin) key; the FAB and the tab measure from different anchors. */
446
478
  private fabStorageKey;
447
479
  /**
448
- * Move the FAB to a translated offset (relative to its CSS anchor), clamped
449
- * inside the viewport safe area, optionally snapping to the nearest edge.
480
+ * Move the launcher to a translated offset (relative to its CSS anchor),
481
+ * clamped inside the safe area and above host bars. `end` snaps and persists.
450
482
  * The base position is derived by subtracting the applied drag offset.
451
483
  */
452
484
  private moveFab;
453
- /** Load previously persisted FAB position. */
454
485
  private loadFabPos;
455
486
  /** Attach Pointer Events-based drag to the trigger element. */
456
487
  private attachDragHandlers;
@@ -528,22 +559,33 @@ declare class MushiWidget {
528
559
  private handleMagicLinkSend;
529
560
  /** Open the widget on "Your reports" (`sdk.openReporter()`, the banner's link, a toast). */
530
561
  openReporter(): void;
562
+ /** @internal */
531
563
  getRecorderStep(): WidgetStep;
532
- /** QA / Playwright: report-screen IA without piercing the shadow root. */
564
+ /** @internal QA / Playwright: report-screen IA without piercing the shadow root. */
533
565
  getRecorderCategoryStepIA(): {
534
566
  sectionLabel: string;
535
567
  moreToggle: boolean;
536
568
  footerStepIndicators: number;
537
569
  };
570
+ /** @internal */
538
571
  getRecorderTrigger(): Element | null;
572
+ /** @internal */
539
573
  getRecorderCategoryButton(category: MushiReportCategory): Element | null;
574
+ /** @internal */
540
575
  getRecorderIntentButton(label: string): Element | null;
576
+ /** @internal */
541
577
  getRecorderSubmitButton(): Element | null;
578
+ /** @internal */
542
579
  recorderClickTrigger(): void;
580
+ /** @internal */
543
581
  recorderSelectCategory(category: MushiReportCategory): void;
582
+ /** @internal */
544
583
  recorderSelectIntent(label: string): void;
584
+ /** @internal */
545
585
  recorderFocusDescription(): void;
586
+ /** @internal */
546
587
  recorderSubmit(): void;
588
+ /** @internal */
547
589
  recorderOpenMyReports(): void;
548
590
  }
549
591
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiPrivacyConfig, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiReporterTimelineItem, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiReporterUpdates, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiTracePropagationConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
2
- export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
1
+ import { MushiInitConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiPrivacyConfig, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiReporterTimelineItem, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiReporterUpdates, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiTracePropagationConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
2
+ export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiInitConfig, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
3
3
 
4
4
  declare class Mushi {
5
5
  private constructor();
6
- static init(config: MushiConfig): MushiSDKInstance;
6
+ static init(config?: MushiInitConfig): MushiSDKInstance;
7
7
  static getInstance(): MushiSDKInstance | null;
8
8
  static destroy(): void;
9
9
  static diagnose(): Promise<MushiDiagnosticsResult>;
@@ -284,6 +284,18 @@ declare class MushiWidget {
284
284
  private bannerResizeObserver;
285
285
  /** Persisted FAB position when draggable is enabled. */
286
286
  private fabPos;
287
+ /** Storage key `fabPos` was loaded for. */
288
+ private fabPosKey;
289
+ private draggableSet;
290
+ /** px from the viewport bottom that clears fixed host bars. */
291
+ private barClearance;
292
+ private clampedForClearance;
293
+ private tuckCleanup;
294
+ private tuckTimer;
295
+ private resizeFrame;
296
+ private lateMeasureTimer;
297
+ private readonly onViewportResize;
298
+ private launcherDismissed;
287
299
  /** Cleanup fn for visualViewport keyboard listener. */
288
300
  private vvCleanup;
289
301
  /** Host-app user identity from `identify()` — shown as "Reporting as <name>". */
@@ -416,6 +428,14 @@ declare class MushiWidget {
416
428
  };
417
429
  private syncAttachedLaunchers;
418
430
  private syncSmartHide;
431
+ /** Tuck the launcher while anything scrolls (capture: inner scrollers count). A class toggle, not a rebuild, so focus and drag survive. */
432
+ private syncScrollTuck;
433
+ /**
434
+ * px that clears a bar docked at the viewport bottom, + 8px: a short fixed/sticky
435
+ * element, or a flow child of a fixed full-height shell. Scroller content never counts.
436
+ */
437
+ private measureFixedBars;
438
+ private dismissLauncherForSession;
419
439
  private shouldRenderTrigger;
420
440
  /** Height of the banner in px — used as a fallback before first layout. */
421
441
  private static readonly BANNER_HEIGHT;
@@ -447,6 +467,9 @@ declare class MushiWidget {
447
467
  private syncChrome;
448
468
  private syncTrigger;
449
469
  private buildTrigger;
470
+ private restoreFabPos;
471
+ /** Drag options, or null when fixed. The tab drags along its edge unless `draggable: false`. */
472
+ private dragOptions;
450
473
  private render;
451
474
  private renderPanel;
452
475
  /** On a new surface: the report textarea, else the title, so screen readers announce where they are. */
@@ -455,20 +478,28 @@ declare class MushiWidget {
455
478
  private captureFormDrafts;
456
479
  /** Replay values (and focus + caret) into fields a patch just created. */
457
480
  private restoreFormDrafts;
458
- /** Queries `avoidSelectors` and returns a top offset clearing all of them, or null. */
481
+ /**
482
+ * Queries `avoidSelectors` and returns a top offset clearing the ones in the
483
+ * top half of the viewport, or null. A bottom tab bar is ignored here: clearing
484
+ * it from the top edge would push the widget off-screen.
485
+ */
459
486
  private computeAvoidTopPx;
460
- /** Bottom offset so a bottom-anchored trigger clears avoided elements (tab bars, fixed CTAs). */
487
+ /**
488
+ * Bottom offset so a bottom-anchored trigger clears avoided elements in the
489
+ * bottom half of the viewport (tab bars, fixed CTAs). A top header is ignored
490
+ * here: clearing it from the bottom edge would push the widget off-screen.
491
+ */
461
492
  private computeAvoidBottomPx;
493
+ private hostCssVar;
462
494
  private applyInsetVars;
463
- /** Storage key for the FAB position, scoped to projectId when available. */
495
+ /** Per-site (origin) key; the FAB and the tab measure from different anchors. */
464
496
  private fabStorageKey;
465
497
  /**
466
- * Move the FAB to a translated offset (relative to its CSS anchor), clamped
467
- * inside the viewport safe area, optionally snapping to the nearest edge.
498
+ * Move the launcher to a translated offset (relative to its CSS anchor),
499
+ * clamped inside the safe area and above host bars. `end` snaps and persists.
468
500
  * The base position is derived by subtracting the applied drag offset.
469
501
  */
470
502
  private moveFab;
471
- /** Load previously persisted FAB position. */
472
503
  private loadFabPos;
473
504
  /** Attach Pointer Events-based drag to the trigger element. */
474
505
  private attachDragHandlers;
@@ -546,22 +577,33 @@ declare class MushiWidget {
546
577
  private handleMagicLinkSend;
547
578
  /** Open the widget on "Your reports" (`sdk.openReporter()`, the banner's link, a toast). */
548
579
  openReporter(): void;
580
+ /** @internal */
549
581
  getRecorderStep(): WidgetStep;
550
- /** QA / Playwright: report-screen IA without piercing the shadow root. */
582
+ /** @internal QA / Playwright: report-screen IA without piercing the shadow root. */
551
583
  getRecorderCategoryStepIA(): {
552
584
  sectionLabel: string;
553
585
  moreToggle: boolean;
554
586
  footerStepIndicators: number;
555
587
  };
588
+ /** @internal */
556
589
  getRecorderTrigger(): Element | null;
590
+ /** @internal */
557
591
  getRecorderCategoryButton(category: MushiReportCategory): Element | null;
592
+ /** @internal */
558
593
  getRecorderIntentButton(label: string): Element | null;
594
+ /** @internal */
559
595
  getRecorderSubmitButton(): Element | null;
596
+ /** @internal */
560
597
  recorderClickTrigger(): void;
598
+ /** @internal */
561
599
  recorderSelectCategory(category: MushiReportCategory): void;
600
+ /** @internal */
562
601
  recorderSelectIntent(label: string): void;
602
+ /** @internal */
563
603
  recorderFocusDescription(): void;
604
+ /** @internal */
564
605
  recorderSubmit(): void;
606
+ /** @internal */
565
607
  recorderOpenMyReports(): void;
566
608
  }
567
609
 
@@ -624,6 +666,8 @@ interface MushiLocale {
624
666
  submitting: string;
625
667
  submitted: string;
626
668
  error: string;
669
+ /** Panel action that hides the floating launcher until the tab closes. */
670
+ hideLauncher?: string;
627
671
  };
628
672
  step1: {
629
673
  /** @deprecated The 3-step flow is retired (Plan 018); unused since 1.30. */