@mushi-mushi/web 0.7.0 → 0.9.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,11 +1,12 @@
1
- import { MushiConfig, MushiSDKInstance, MushiWidgetConfig, MushiReportCategory, MushiConsoleEntry, MushiNetworkEntry, MushiPerformanceMetrics, MushiSelectedElement } from '@mushi-mushi/core';
2
- export { MushiConfig, MushiConsoleEntry, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiWidgetConfig } from '@mushi-mushi/core';
1
+ import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiWidgetConfig, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiPrivacyConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig } 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';
3
3
 
4
4
  declare class Mushi {
5
5
  private constructor();
6
6
  static init(config: MushiConfig): MushiSDKInstance;
7
7
  static getInstance(): MushiSDKInstance | null;
8
8
  static destroy(): void;
9
+ static diagnose(): Promise<MushiDiagnosticsResult>;
9
10
  }
10
11
 
11
12
  /**
@@ -29,9 +30,14 @@ interface WidgetCallbacks {
29
30
  onOpen(): void;
30
31
  onClose(): void;
31
32
  onScreenshotRequest(): void;
33
+ onScreenshotRemove?(): void;
32
34
  onElementSelectorRequest?(): void;
35
+ onReporterReportsRequest?(): Promise<MushiReporterReport[]>;
36
+ onReporterCommentsRequest?(reportId: string): Promise<MushiReporterComment[]>;
37
+ onReporterReply?(reportId: string, body: string): Promise<void>;
33
38
  }
34
39
  declare class MushiWidget {
40
+ private readonly sdkVersion;
35
41
  private host;
36
42
  private shadow;
37
43
  private config;
@@ -42,11 +48,18 @@ declare class MushiWidget {
42
48
  private selectedCategory;
43
49
  private selectedIntent;
44
50
  private screenshotAttached;
51
+ private allowScreenshotRemove;
45
52
  private elementSelected;
46
53
  private submitting;
47
54
  private triggerVisible;
48
55
  private triggerShrunk;
49
56
  private triggerHiddenByScroll;
57
+ private sdkFreshness;
58
+ private reporterReports;
59
+ private reporterComments;
60
+ private selectedReportId;
61
+ private reporterLoading;
62
+ private reporterError;
50
63
  private attachedLaunchers;
51
64
  private smartHideCleanup;
52
65
  private smartHideTimer;
@@ -60,8 +73,9 @@ declare class MushiWidget {
60
73
  * root) for up to ~3.3s after destroy. */
61
74
  private successTimer;
62
75
  private autoCloseTimer;
63
- constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks);
76
+ constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks, sdkVersion?: string);
64
77
  mount(): void;
78
+ getIsMounted(): boolean;
65
79
  updateConfig(config?: MushiWidgetConfig): void;
66
80
  open(options?: {
67
81
  category?: MushiReportCategory;
@@ -73,7 +87,14 @@ declare class MushiWidget {
73
87
  setTrigger(trigger: NonNullable<MushiWidgetConfig['trigger']>): void;
74
88
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
75
89
  setScreenshotAttached(attached: boolean): void;
90
+ setAllowScreenshotRemove(allow: boolean): void;
76
91
  setElementSelected(selected: boolean): void;
92
+ setSdkFreshness(info: {
93
+ latest: string | null;
94
+ current: string;
95
+ deprecated: boolean;
96
+ message?: string | null;
97
+ }): void;
77
98
  destroy(): void;
78
99
  private syncAttachedLaunchers;
79
100
  private syncSmartHide;
@@ -86,6 +107,8 @@ declare class MushiWidget {
86
107
  private render;
87
108
  private applyInsetVars;
88
109
  private renderStep;
110
+ private renderOutdatedBanner;
111
+ private renderBrandFooter;
89
112
  /**
90
113
  * Editorial masthead. Always carries:
91
114
  * • the brand mark (虫 kanji on vermillion, "MUSHI" in mono above)
@@ -104,6 +127,8 @@ declare class MushiWidget {
104
127
  */
105
128
  private renderStepIndicator;
106
129
  private renderCategoryStep;
130
+ private renderReportsStep;
131
+ private renderReportDetailStep;
107
132
  private renderIntentStep;
108
133
  private renderDetailsStep;
109
134
  /**
@@ -117,6 +142,10 @@ declare class MushiWidget {
117
142
  private renderSuccessStep;
118
143
  private attachHandlers;
119
144
  private trapFocus;
145
+ private unreadCount;
146
+ private loadReporterReports;
147
+ private loadReporterComments;
148
+ private submitReporterReply;
120
149
  }
121
150
 
122
151
  interface ConsoleCapture {
@@ -129,14 +158,23 @@ declare function createConsoleCapture(): ConsoleCapture;
129
158
  interface NetworkCapture {
130
159
  getEntries(): MushiNetworkEntry[];
131
160
  clear(): void;
161
+ updateOptions(options: NetworkCaptureOptions): void;
132
162
  destroy(): void;
133
163
  }
134
- declare function createNetworkCapture(): NetworkCapture;
164
+ interface NetworkCaptureOptions {
165
+ apiEndpoint?: string;
166
+ ignoreUrls?: MushiUrlMatcher[];
167
+ }
168
+ declare function createNetworkCapture(options?: NetworkCaptureOptions): NetworkCapture;
135
169
 
136
170
  interface ScreenshotCapture {
137
171
  take(): Promise<string | null>;
172
+ updateOptions(options: ScreenshotCaptureOptions): void;
138
173
  }
139
- declare function createScreenshotCapture(): ScreenshotCapture;
174
+ interface ScreenshotCaptureOptions {
175
+ privacy?: MushiPrivacyConfig;
176
+ }
177
+ declare function createScreenshotCapture(options?: ScreenshotCaptureOptions): ScreenshotCapture;
140
178
 
141
179
  interface PerformanceCapture {
142
180
  getMetrics(): MushiPerformanceMetrics;
@@ -151,6 +189,21 @@ interface ElementSelector {
151
189
  }
152
190
  declare function createElementSelector(): ElementSelector;
153
191
 
192
+ interface TimelineCapture {
193
+ setScreen(screen: {
194
+ name: string;
195
+ route?: string;
196
+ feature?: string;
197
+ }): void;
198
+ getEntries(input?: {
199
+ consoleLogs?: MushiConsoleEntry[] | null;
200
+ networkLogs?: MushiNetworkEntry[] | null;
201
+ }): MushiTimelineEntry[];
202
+ clear(): void;
203
+ destroy(): void;
204
+ }
205
+ declare function createTimelineCapture(): TimelineCapture;
206
+
154
207
  interface MushiLocale {
155
208
  widget: {
156
209
  trigger: string;
@@ -201,7 +254,8 @@ declare function createProactiveManager(config?: Partial<ProactiveConfig>): Proa
201
254
  interface ProactiveTriggerConfig {
202
255
  rageClick?: boolean;
203
256
  longTask?: boolean;
204
- apiCascade?: boolean;
257
+ apiCascade?: boolean | MushiApiCascadeConfig;
258
+ apiEndpoint?: string;
205
259
  errorBoundary?: boolean;
206
260
  }
207
261
  interface ProactiveTriggerCallbacks {
@@ -212,4 +266,4 @@ interface ProactiveTriggerCleanup {
212
266
  }
213
267
  declare function setupProactiveTriggers(callbacks: ProactiveTriggerCallbacks, config?: ProactiveTriggerConfig): ProactiveTriggerCleanup;
214
268
 
215
- export { type ConsoleCapture, type ElementSelector, Mushi, type MushiLocale, MushiWidget, type NetworkCapture, type PerformanceCapture, type ProactiveConfig, type ProactiveManager, type ProactiveTriggerCallbacks, type ProactiveTriggerCleanup, type ScreenshotCapture, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, getAvailableLocales, getLocale, setupProactiveTriggers };
269
+ export { type ConsoleCapture, type ElementSelector, Mushi, type MushiLocale, MushiWidget, type NetworkCapture, type PerformanceCapture, type ProactiveConfig, type ProactiveManager, type ProactiveTriggerCallbacks, type ProactiveTriggerCleanup, type ScreenshotCapture, type TimelineCapture, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, createTimelineCapture, getAvailableLocales, getLocale, setupProactiveTriggers };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { MushiConfig, MushiSDKInstance, MushiWidgetConfig, MushiReportCategory, MushiConsoleEntry, MushiNetworkEntry, MushiPerformanceMetrics, MushiSelectedElement } from '@mushi-mushi/core';
2
- export { MushiConfig, MushiConsoleEntry, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiWidgetConfig } from '@mushi-mushi/core';
1
+ import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiWidgetConfig, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiPrivacyConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig } 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';
3
3
 
4
4
  declare class Mushi {
5
5
  private constructor();
6
6
  static init(config: MushiConfig): MushiSDKInstance;
7
7
  static getInstance(): MushiSDKInstance | null;
8
8
  static destroy(): void;
9
+ static diagnose(): Promise<MushiDiagnosticsResult>;
9
10
  }
10
11
 
11
12
  /**
@@ -29,9 +30,14 @@ interface WidgetCallbacks {
29
30
  onOpen(): void;
30
31
  onClose(): void;
31
32
  onScreenshotRequest(): void;
33
+ onScreenshotRemove?(): void;
32
34
  onElementSelectorRequest?(): void;
35
+ onReporterReportsRequest?(): Promise<MushiReporterReport[]>;
36
+ onReporterCommentsRequest?(reportId: string): Promise<MushiReporterComment[]>;
37
+ onReporterReply?(reportId: string, body: string): Promise<void>;
33
38
  }
34
39
  declare class MushiWidget {
40
+ private readonly sdkVersion;
35
41
  private host;
36
42
  private shadow;
37
43
  private config;
@@ -42,11 +48,18 @@ declare class MushiWidget {
42
48
  private selectedCategory;
43
49
  private selectedIntent;
44
50
  private screenshotAttached;
51
+ private allowScreenshotRemove;
45
52
  private elementSelected;
46
53
  private submitting;
47
54
  private triggerVisible;
48
55
  private triggerShrunk;
49
56
  private triggerHiddenByScroll;
57
+ private sdkFreshness;
58
+ private reporterReports;
59
+ private reporterComments;
60
+ private selectedReportId;
61
+ private reporterLoading;
62
+ private reporterError;
50
63
  private attachedLaunchers;
51
64
  private smartHideCleanup;
52
65
  private smartHideTimer;
@@ -60,8 +73,9 @@ declare class MushiWidget {
60
73
  * root) for up to ~3.3s after destroy. */
61
74
  private successTimer;
62
75
  private autoCloseTimer;
63
- constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks);
76
+ constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks, sdkVersion?: string);
64
77
  mount(): void;
78
+ getIsMounted(): boolean;
65
79
  updateConfig(config?: MushiWidgetConfig): void;
66
80
  open(options?: {
67
81
  category?: MushiReportCategory;
@@ -73,7 +87,14 @@ declare class MushiWidget {
73
87
  setTrigger(trigger: NonNullable<MushiWidgetConfig['trigger']>): void;
74
88
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
75
89
  setScreenshotAttached(attached: boolean): void;
90
+ setAllowScreenshotRemove(allow: boolean): void;
76
91
  setElementSelected(selected: boolean): void;
92
+ setSdkFreshness(info: {
93
+ latest: string | null;
94
+ current: string;
95
+ deprecated: boolean;
96
+ message?: string | null;
97
+ }): void;
77
98
  destroy(): void;
78
99
  private syncAttachedLaunchers;
79
100
  private syncSmartHide;
@@ -86,6 +107,8 @@ declare class MushiWidget {
86
107
  private render;
87
108
  private applyInsetVars;
88
109
  private renderStep;
110
+ private renderOutdatedBanner;
111
+ private renderBrandFooter;
89
112
  /**
90
113
  * Editorial masthead. Always carries:
91
114
  * • the brand mark (虫 kanji on vermillion, "MUSHI" in mono above)
@@ -104,6 +127,8 @@ declare class MushiWidget {
104
127
  */
105
128
  private renderStepIndicator;
106
129
  private renderCategoryStep;
130
+ private renderReportsStep;
131
+ private renderReportDetailStep;
107
132
  private renderIntentStep;
108
133
  private renderDetailsStep;
109
134
  /**
@@ -117,6 +142,10 @@ declare class MushiWidget {
117
142
  private renderSuccessStep;
118
143
  private attachHandlers;
119
144
  private trapFocus;
145
+ private unreadCount;
146
+ private loadReporterReports;
147
+ private loadReporterComments;
148
+ private submitReporterReply;
120
149
  }
121
150
 
122
151
  interface ConsoleCapture {
@@ -129,14 +158,23 @@ declare function createConsoleCapture(): ConsoleCapture;
129
158
  interface NetworkCapture {
130
159
  getEntries(): MushiNetworkEntry[];
131
160
  clear(): void;
161
+ updateOptions(options: NetworkCaptureOptions): void;
132
162
  destroy(): void;
133
163
  }
134
- declare function createNetworkCapture(): NetworkCapture;
164
+ interface NetworkCaptureOptions {
165
+ apiEndpoint?: string;
166
+ ignoreUrls?: MushiUrlMatcher[];
167
+ }
168
+ declare function createNetworkCapture(options?: NetworkCaptureOptions): NetworkCapture;
135
169
 
136
170
  interface ScreenshotCapture {
137
171
  take(): Promise<string | null>;
172
+ updateOptions(options: ScreenshotCaptureOptions): void;
138
173
  }
139
- declare function createScreenshotCapture(): ScreenshotCapture;
174
+ interface ScreenshotCaptureOptions {
175
+ privacy?: MushiPrivacyConfig;
176
+ }
177
+ declare function createScreenshotCapture(options?: ScreenshotCaptureOptions): ScreenshotCapture;
140
178
 
141
179
  interface PerformanceCapture {
142
180
  getMetrics(): MushiPerformanceMetrics;
@@ -151,6 +189,21 @@ interface ElementSelector {
151
189
  }
152
190
  declare function createElementSelector(): ElementSelector;
153
191
 
192
+ interface TimelineCapture {
193
+ setScreen(screen: {
194
+ name: string;
195
+ route?: string;
196
+ feature?: string;
197
+ }): void;
198
+ getEntries(input?: {
199
+ consoleLogs?: MushiConsoleEntry[] | null;
200
+ networkLogs?: MushiNetworkEntry[] | null;
201
+ }): MushiTimelineEntry[];
202
+ clear(): void;
203
+ destroy(): void;
204
+ }
205
+ declare function createTimelineCapture(): TimelineCapture;
206
+
154
207
  interface MushiLocale {
155
208
  widget: {
156
209
  trigger: string;
@@ -201,7 +254,8 @@ declare function createProactiveManager(config?: Partial<ProactiveConfig>): Proa
201
254
  interface ProactiveTriggerConfig {
202
255
  rageClick?: boolean;
203
256
  longTask?: boolean;
204
- apiCascade?: boolean;
257
+ apiCascade?: boolean | MushiApiCascadeConfig;
258
+ apiEndpoint?: string;
205
259
  errorBoundary?: boolean;
206
260
  }
207
261
  interface ProactiveTriggerCallbacks {
@@ -212,4 +266,4 @@ interface ProactiveTriggerCleanup {
212
266
  }
213
267
  declare function setupProactiveTriggers(callbacks: ProactiveTriggerCallbacks, config?: ProactiveTriggerConfig): ProactiveTriggerCleanup;
214
268
 
215
- export { type ConsoleCapture, type ElementSelector, Mushi, type MushiLocale, MushiWidget, type NetworkCapture, type PerformanceCapture, type ProactiveConfig, type ProactiveManager, type ProactiveTriggerCallbacks, type ProactiveTriggerCleanup, type ScreenshotCapture, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, getAvailableLocales, getLocale, setupProactiveTriggers };
269
+ export { type ConsoleCapture, type ElementSelector, Mushi, type MushiLocale, MushiWidget, type NetworkCapture, type PerformanceCapture, type ProactiveConfig, type ProactiveManager, type ProactiveTriggerCallbacks, type ProactiveTriggerCleanup, type ScreenshotCapture, type TimelineCapture, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, createTimelineCapture, getAvailableLocales, getLocale, setupProactiveTriggers };