@mushi-mushi/web 1.2.0 → 1.3.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/CONTRIBUTING.md +11 -0
- package/dist/index.cjs +566 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +566 -84
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -21,6 +21,7 @@ declare class Mushi {
|
|
|
21
21
|
* user-facing ARIA / keyboard wiring.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail';
|
|
24
25
|
interface WidgetRewardsState {
|
|
25
26
|
tier: {
|
|
26
27
|
slug: string;
|
|
@@ -62,12 +63,22 @@ declare class MushiWidget {
|
|
|
62
63
|
private selectedCategory;
|
|
63
64
|
private selectedIntent;
|
|
64
65
|
private screenshotAttached;
|
|
66
|
+
private screenshotCapturing;
|
|
67
|
+
private screenshotError;
|
|
65
68
|
private allowScreenshotRemove;
|
|
66
69
|
private elementSelected;
|
|
70
|
+
private elementCapturing;
|
|
67
71
|
private submitting;
|
|
72
|
+
/** Hint element injected outside the shadow DOM during element selection. */
|
|
73
|
+
private selectorHint;
|
|
68
74
|
private triggerVisible;
|
|
69
75
|
private triggerShrunk;
|
|
70
76
|
private triggerHiddenByScroll;
|
|
77
|
+
/** Milliseconds since mount — used for the 30s first-time nudge gate. */
|
|
78
|
+
private mountedAt;
|
|
79
|
+
private nudgeShown;
|
|
80
|
+
private nudgeEl;
|
|
81
|
+
private nudgeTimer;
|
|
71
82
|
private sdkFreshness;
|
|
72
83
|
private reporterReports;
|
|
73
84
|
private reporterComments;
|
|
@@ -104,6 +115,18 @@ declare class MushiWidget {
|
|
|
104
115
|
setScreenshotAttached(attached: boolean): void;
|
|
105
116
|
setAllowScreenshotRemove(allow: boolean): void;
|
|
106
117
|
setElementSelected(selected: boolean): void;
|
|
118
|
+
setScreenshotCapturing(capturing: boolean): void;
|
|
119
|
+
setScreenshotError(failed: boolean): void;
|
|
120
|
+
setElementCapturing(capturing: boolean): void;
|
|
121
|
+
/** Hide the widget panel (but keep the host element) during element selection
|
|
122
|
+
* so the user can click any element on the page without the panel
|
|
123
|
+
* intercepting the event. */
|
|
124
|
+
hidePanel(): void;
|
|
125
|
+
showPanel(): void;
|
|
126
|
+
private showSelectorHint;
|
|
127
|
+
private removeSelectorHint;
|
|
128
|
+
private showNudge;
|
|
129
|
+
private removeNudge;
|
|
107
130
|
setSdkFreshness(info: {
|
|
108
131
|
latest: string | null;
|
|
109
132
|
current: string;
|
|
@@ -154,6 +177,7 @@ declare class MushiWidget {
|
|
|
154
177
|
private renderReportsStep;
|
|
155
178
|
private renderReportDetailStep;
|
|
156
179
|
private renderIntentStep;
|
|
180
|
+
private effectiveMinLength;
|
|
157
181
|
private renderDetailsStep;
|
|
158
182
|
/**
|
|
159
183
|
* Editorial success state: 朱印-style red stamp ring with the kanji
|
|
@@ -182,6 +206,16 @@ declare class MushiWidget {
|
|
|
182
206
|
private loadReporterReports;
|
|
183
207
|
private loadReporterComments;
|
|
184
208
|
private submitReporterReply;
|
|
209
|
+
getRecorderStep(): WidgetStep;
|
|
210
|
+
getRecorderTrigger(): Element | null;
|
|
211
|
+
getRecorderCategoryButton(category: MushiReportCategory): Element | null;
|
|
212
|
+
getRecorderIntentButton(label: string): Element | null;
|
|
213
|
+
getRecorderSubmitButton(): Element | null;
|
|
214
|
+
recorderClickTrigger(): void;
|
|
215
|
+
recorderSelectCategory(category: MushiReportCategory): void;
|
|
216
|
+
recorderSelectIntent(label: string): void;
|
|
217
|
+
recorderFocusDescription(): void;
|
|
218
|
+
recorderSubmit(): void;
|
|
185
219
|
}
|
|
186
220
|
|
|
187
221
|
interface ConsoleCapture {
|
|
@@ -204,12 +238,20 @@ interface NetworkCaptureOptions {
|
|
|
204
238
|
declare function createNetworkCapture(options?: NetworkCaptureOptions): NetworkCapture;
|
|
205
239
|
|
|
206
240
|
interface ScreenshotCapture {
|
|
207
|
-
take(): Promise<
|
|
241
|
+
take(): Promise<ScreenshotResult>;
|
|
208
242
|
updateOptions(options: ScreenshotCaptureOptions): void;
|
|
209
243
|
}
|
|
210
244
|
interface ScreenshotCaptureOptions {
|
|
211
245
|
privacy?: MushiPrivacyConfig;
|
|
212
246
|
}
|
|
247
|
+
type ScreenshotResult = {
|
|
248
|
+
ok: true;
|
|
249
|
+
dataUrl: string;
|
|
250
|
+
} | {
|
|
251
|
+
ok: false;
|
|
252
|
+
reason: 'tainted' | 'load-error' | 'unsupported' | 'cancelled' | 'error';
|
|
253
|
+
message?: string;
|
|
254
|
+
};
|
|
213
255
|
declare function createScreenshotCapture(options?: ScreenshotCaptureOptions): ScreenshotCapture;
|
|
214
256
|
|
|
215
257
|
interface PerformanceCapture {
|
|
@@ -265,9 +307,17 @@ interface MushiLocale {
|
|
|
265
307
|
descriptionPlaceholder: string;
|
|
266
308
|
screenshotButton: string;
|
|
267
309
|
screenshotAttached: string;
|
|
310
|
+
screenshotCapturing: string;
|
|
311
|
+
screenshotFailed: string;
|
|
268
312
|
elementButton: string;
|
|
269
313
|
elementSelected: string;
|
|
314
|
+
elementCapturing: string;
|
|
315
|
+
elementSelectorHint: string;
|
|
270
316
|
optional: string;
|
|
317
|
+
/** Inline validation: description is below the minimum length. */
|
|
318
|
+
tooShort: string;
|
|
319
|
+
/** Example starter chips rendered above the textarea to lower the barrier. */
|
|
320
|
+
examplePrompts: string[];
|
|
271
321
|
};
|
|
272
322
|
}
|
|
273
323
|
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare class Mushi {
|
|
|
21
21
|
* user-facing ARIA / keyboard wiring.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail';
|
|
24
25
|
interface WidgetRewardsState {
|
|
25
26
|
tier: {
|
|
26
27
|
slug: string;
|
|
@@ -62,12 +63,22 @@ declare class MushiWidget {
|
|
|
62
63
|
private selectedCategory;
|
|
63
64
|
private selectedIntent;
|
|
64
65
|
private screenshotAttached;
|
|
66
|
+
private screenshotCapturing;
|
|
67
|
+
private screenshotError;
|
|
65
68
|
private allowScreenshotRemove;
|
|
66
69
|
private elementSelected;
|
|
70
|
+
private elementCapturing;
|
|
67
71
|
private submitting;
|
|
72
|
+
/** Hint element injected outside the shadow DOM during element selection. */
|
|
73
|
+
private selectorHint;
|
|
68
74
|
private triggerVisible;
|
|
69
75
|
private triggerShrunk;
|
|
70
76
|
private triggerHiddenByScroll;
|
|
77
|
+
/** Milliseconds since mount — used for the 30s first-time nudge gate. */
|
|
78
|
+
private mountedAt;
|
|
79
|
+
private nudgeShown;
|
|
80
|
+
private nudgeEl;
|
|
81
|
+
private nudgeTimer;
|
|
71
82
|
private sdkFreshness;
|
|
72
83
|
private reporterReports;
|
|
73
84
|
private reporterComments;
|
|
@@ -104,6 +115,18 @@ declare class MushiWidget {
|
|
|
104
115
|
setScreenshotAttached(attached: boolean): void;
|
|
105
116
|
setAllowScreenshotRemove(allow: boolean): void;
|
|
106
117
|
setElementSelected(selected: boolean): void;
|
|
118
|
+
setScreenshotCapturing(capturing: boolean): void;
|
|
119
|
+
setScreenshotError(failed: boolean): void;
|
|
120
|
+
setElementCapturing(capturing: boolean): void;
|
|
121
|
+
/** Hide the widget panel (but keep the host element) during element selection
|
|
122
|
+
* so the user can click any element on the page without the panel
|
|
123
|
+
* intercepting the event. */
|
|
124
|
+
hidePanel(): void;
|
|
125
|
+
showPanel(): void;
|
|
126
|
+
private showSelectorHint;
|
|
127
|
+
private removeSelectorHint;
|
|
128
|
+
private showNudge;
|
|
129
|
+
private removeNudge;
|
|
107
130
|
setSdkFreshness(info: {
|
|
108
131
|
latest: string | null;
|
|
109
132
|
current: string;
|
|
@@ -154,6 +177,7 @@ declare class MushiWidget {
|
|
|
154
177
|
private renderReportsStep;
|
|
155
178
|
private renderReportDetailStep;
|
|
156
179
|
private renderIntentStep;
|
|
180
|
+
private effectiveMinLength;
|
|
157
181
|
private renderDetailsStep;
|
|
158
182
|
/**
|
|
159
183
|
* Editorial success state: 朱印-style red stamp ring with the kanji
|
|
@@ -182,6 +206,16 @@ declare class MushiWidget {
|
|
|
182
206
|
private loadReporterReports;
|
|
183
207
|
private loadReporterComments;
|
|
184
208
|
private submitReporterReply;
|
|
209
|
+
getRecorderStep(): WidgetStep;
|
|
210
|
+
getRecorderTrigger(): Element | null;
|
|
211
|
+
getRecorderCategoryButton(category: MushiReportCategory): Element | null;
|
|
212
|
+
getRecorderIntentButton(label: string): Element | null;
|
|
213
|
+
getRecorderSubmitButton(): Element | null;
|
|
214
|
+
recorderClickTrigger(): void;
|
|
215
|
+
recorderSelectCategory(category: MushiReportCategory): void;
|
|
216
|
+
recorderSelectIntent(label: string): void;
|
|
217
|
+
recorderFocusDescription(): void;
|
|
218
|
+
recorderSubmit(): void;
|
|
185
219
|
}
|
|
186
220
|
|
|
187
221
|
interface ConsoleCapture {
|
|
@@ -204,12 +238,20 @@ interface NetworkCaptureOptions {
|
|
|
204
238
|
declare function createNetworkCapture(options?: NetworkCaptureOptions): NetworkCapture;
|
|
205
239
|
|
|
206
240
|
interface ScreenshotCapture {
|
|
207
|
-
take(): Promise<
|
|
241
|
+
take(): Promise<ScreenshotResult>;
|
|
208
242
|
updateOptions(options: ScreenshotCaptureOptions): void;
|
|
209
243
|
}
|
|
210
244
|
interface ScreenshotCaptureOptions {
|
|
211
245
|
privacy?: MushiPrivacyConfig;
|
|
212
246
|
}
|
|
247
|
+
type ScreenshotResult = {
|
|
248
|
+
ok: true;
|
|
249
|
+
dataUrl: string;
|
|
250
|
+
} | {
|
|
251
|
+
ok: false;
|
|
252
|
+
reason: 'tainted' | 'load-error' | 'unsupported' | 'cancelled' | 'error';
|
|
253
|
+
message?: string;
|
|
254
|
+
};
|
|
213
255
|
declare function createScreenshotCapture(options?: ScreenshotCaptureOptions): ScreenshotCapture;
|
|
214
256
|
|
|
215
257
|
interface PerformanceCapture {
|
|
@@ -265,9 +307,17 @@ interface MushiLocale {
|
|
|
265
307
|
descriptionPlaceholder: string;
|
|
266
308
|
screenshotButton: string;
|
|
267
309
|
screenshotAttached: string;
|
|
310
|
+
screenshotCapturing: string;
|
|
311
|
+
screenshotFailed: string;
|
|
268
312
|
elementButton: string;
|
|
269
313
|
elementSelected: string;
|
|
314
|
+
elementCapturing: string;
|
|
315
|
+
elementSelectorHint: string;
|
|
270
316
|
optional: string;
|
|
317
|
+
/** Inline validation: description is below the minimum length. */
|
|
318
|
+
tooShort: string;
|
|
319
|
+
/** Example starter chips rendered above the textarea to lower the barrier. */
|
|
320
|
+
examplePrompts: string[];
|
|
271
321
|
};
|
|
272
322
|
}
|
|
273
323
|
|