@mushi-mushi/web 1.33.0 → 1.33.3
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/LICENSE +1 -1
- package/README.md +3 -1
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.js.map +1 -1
- package/dist/i18n/index.cjs +10 -0
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +4 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +10 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +51 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +51 -9
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +19 -19
- package/dist/otel.cjs.map +1 -1
- package/dist/otel.js.map +1 -1
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -74,8 +74,13 @@ interface WidgetSubmitOutcome {
|
|
|
74
74
|
* - rate_limited: 429 — user should wait before sending more
|
|
75
75
|
* - quota: 403 entitlement/quota — will not succeed on retry
|
|
76
76
|
* - permanent: validation / payload too large — dropped, not queued
|
|
77
|
+
* - blocked: stopped on the device before any send (pre-filter, on-device
|
|
78
|
+
* classifier, sampleRate, or the host's beforeSend) — nothing queued
|
|
79
|
+
* - throttled: the SDK's own send limiter refused it — nothing queued
|
|
80
|
+
* `blocked` and `throttled` mean the report was NOT sent: the widget keeps
|
|
81
|
+
* the reporter's text and says so instead of showing a receipt.
|
|
77
82
|
*/
|
|
78
|
-
failureKind?: 'offline' | 'retrying' | 'rate_limited' | 'quota' | 'permanent';
|
|
83
|
+
failureKind?: 'offline' | 'retrying' | 'rate_limited' | 'quota' | 'permanent' | 'blocked' | 'throttled';
|
|
79
84
|
/** The report went through but its screenshot had to be shed (couldn't
|
|
80
85
|
* compress under the wire budget, or the server said PAYLOAD_TOO_LARGE).
|
|
81
86
|
* The success receipt says so instead of implying the image landed. */
|
|
@@ -261,6 +266,8 @@ declare class MushiWidget {
|
|
|
261
266
|
private lastSubmitQueuedOffline;
|
|
262
267
|
private lastSubmitFailureKind;
|
|
263
268
|
private lastSubmitScreenshotDropped;
|
|
269
|
+
/** The last submit never left the device; the report step says why. */
|
|
270
|
+
private submitNotSent;
|
|
264
271
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
265
272
|
private bannerDismissed;
|
|
266
273
|
private bannerResizeObserver;
|
|
@@ -505,6 +512,8 @@ declare class MushiWidget {
|
|
|
505
512
|
private handleAction;
|
|
506
513
|
private goBack;
|
|
507
514
|
private submitReport;
|
|
515
|
+
/** Back to the report step with the reporter's text, saying the report was not sent. */
|
|
516
|
+
private showNotSent;
|
|
508
517
|
private loadFeatureBoard;
|
|
509
518
|
private voteFeatureBoard;
|
|
510
519
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -92,8 +92,13 @@ interface WidgetSubmitOutcome {
|
|
|
92
92
|
* - rate_limited: 429 — user should wait before sending more
|
|
93
93
|
* - quota: 403 entitlement/quota — will not succeed on retry
|
|
94
94
|
* - permanent: validation / payload too large — dropped, not queued
|
|
95
|
+
* - blocked: stopped on the device before any send (pre-filter, on-device
|
|
96
|
+
* classifier, sampleRate, or the host's beforeSend) — nothing queued
|
|
97
|
+
* - throttled: the SDK's own send limiter refused it — nothing queued
|
|
98
|
+
* `blocked` and `throttled` mean the report was NOT sent: the widget keeps
|
|
99
|
+
* the reporter's text and says so instead of showing a receipt.
|
|
95
100
|
*/
|
|
96
|
-
failureKind?: 'offline' | 'retrying' | 'rate_limited' | 'quota' | 'permanent';
|
|
101
|
+
failureKind?: 'offline' | 'retrying' | 'rate_limited' | 'quota' | 'permanent' | 'blocked' | 'throttled';
|
|
97
102
|
/** The report went through but its screenshot had to be shed (couldn't
|
|
98
103
|
* compress under the wire budget, or the server said PAYLOAD_TOO_LARGE).
|
|
99
104
|
* The success receipt says so instead of implying the image landed. */
|
|
@@ -279,6 +284,8 @@ declare class MushiWidget {
|
|
|
279
284
|
private lastSubmitQueuedOffline;
|
|
280
285
|
private lastSubmitFailureKind;
|
|
281
286
|
private lastSubmitScreenshotDropped;
|
|
287
|
+
/** The last submit never left the device; the report step says why. */
|
|
288
|
+
private submitNotSent;
|
|
282
289
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
283
290
|
private bannerDismissed;
|
|
284
291
|
private bannerResizeObserver;
|
|
@@ -523,6 +530,8 @@ declare class MushiWidget {
|
|
|
523
530
|
private handleAction;
|
|
524
531
|
private goBack;
|
|
525
532
|
private submitReport;
|
|
533
|
+
/** Back to the report step with the reporter's text, saying the report was not sent. */
|
|
534
|
+
private showNotSent;
|
|
526
535
|
private loadFeatureBoard;
|
|
527
536
|
private voteFeatureBoard;
|
|
528
537
|
/**
|
|
@@ -729,6 +738,10 @@ interface MushiLocale {
|
|
|
729
738
|
screenshotRetry: string;
|
|
730
739
|
/** Offered after a failed capture: user-consented tab share (getDisplayMedia). */
|
|
731
740
|
screenshotShareTab: string;
|
|
741
|
+
/** The report was stopped on the device (filter, classifier, host hook); the text is kept. */
|
|
742
|
+
notSentBlocked: string;
|
|
743
|
+
/** The SDK's own send limiter refused the report; the text is kept. */
|
|
744
|
+
notSentThrottled: string;
|
|
732
745
|
/** Why the last capture failed, shown under the attachment row. */
|
|
733
746
|
screenshotErrors: {
|
|
734
747
|
permission: string;
|
package/dist/index.js
CHANGED
|
@@ -177,6 +177,9 @@ function formatReceiptTime(date, locale) {
|
|
|
177
177
|
function escapeHtml(value) {
|
|
178
178
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
179
179
|
}
|
|
180
|
+
function isNotSentOutcome(outcome) {
|
|
181
|
+
return outcome?.failureKind === "blocked" || outcome?.failureKind === "throttled";
|
|
182
|
+
}
|
|
180
183
|
function renderAppIconHtml(opts) {
|
|
181
184
|
const domain = opts.appDomain ?? resolveProjectDomain({
|
|
182
185
|
project_id: opts.projectId,
|
|
@@ -274,6 +277,8 @@ var en = {
|
|
|
274
277
|
screenshotCapturing: "Taking screenshot\u2026",
|
|
275
278
|
screenshotRetry: "Try again",
|
|
276
279
|
screenshotShareTab: "Share this tab instead",
|
|
280
|
+
notSentBlocked: "Not sent. This report was filtered out before sending. Your text is still here; add a little more detail and try again.",
|
|
281
|
+
notSentThrottled: "Not sent. Too many reports in a short time. Your text is still here; wait a minute and try again.",
|
|
277
282
|
screenshotErrors: {
|
|
278
283
|
permission: "Screen capture was blocked. Allow it, then try again.",
|
|
279
284
|
unsupported: "This browser can't capture the page. Describe it instead.",
|
|
@@ -451,6 +456,8 @@ var ja = {
|
|
|
451
456
|
screenshotCapturing: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u64AE\u5F71\u4E2D\u2026",
|
|
452
457
|
screenshotRetry: "\u3082\u3046\u4E00\u5EA6",
|
|
453
458
|
screenshotShareTab: "\u3053\u306E\u30BF\u30D6\u3092\u5171\u6709\u3057\u3066\u64AE\u5F71",
|
|
459
|
+
notSentBlocked: "\u9001\u4FE1\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u9001\u4FE1\u524D\u306E\u30C1\u30A7\u30C3\u30AF\u3067\u9664\u5916\u3055\u308C\u307E\u3057\u305F\u3002\u5165\u529B\u5185\u5BB9\u306F\u6B8B\u3063\u3066\u3044\u307E\u3059\u3002\u8A73\u3057\u304F\u66F8\u304D\u8DB3\u3057\u3066\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
460
|
+
notSentThrottled: "\u9001\u4FE1\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u77ED\u6642\u9593\u306B\u9001\u4FE1\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u5165\u529B\u5185\u5BB9\u306F\u6B8B\u3063\u3066\u3044\u307E\u3059\u30021\u5206\u307B\u3069\u5F85\u3063\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
454
461
|
screenshotErrors: {
|
|
455
462
|
permission: "\u753B\u9762\u306E\u53D6\u5F97\u304C\u30D6\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
456
463
|
unsupported: "\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u306F\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
@@ -628,6 +635,8 @@ var th = {
|
|
|
628
635
|
screenshotCapturing: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E16\u0E48\u0E32\u0E22\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u2026",
|
|
629
636
|
screenshotRetry: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
630
637
|
screenshotShareTab: "\u0E41\u0E0A\u0E23\u0E4C\u0E41\u0E17\u0E47\u0E1A\u0E19\u0E35\u0E49\u0E41\u0E17\u0E19",
|
|
638
|
+
notSentBlocked: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E2A\u0E48\u0E07 \u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49\u0E16\u0E39\u0E01\u0E01\u0E23\u0E2D\u0E07\u0E2D\u0E2D\u0E01\u0E01\u0E48\u0E2D\u0E19\u0E2A\u0E48\u0E07 \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E22\u0E31\u0E07\u0E2D\u0E22\u0E39\u0E48 \u0E40\u0E1E\u0E34\u0E48\u0E21\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E2D\u0E35\u0E01\u0E40\u0E25\u0E47\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
639
|
+
notSentThrottled: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E2A\u0E48\u0E07 \u0E2A\u0E48\u0E07\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E21\u0E32\u0E01\u0E40\u0E01\u0E34\u0E19\u0E44\u0E1B\u0E43\u0E19\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E31\u0E49\u0E19\u0E46 \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E22\u0E31\u0E07\u0E2D\u0E22\u0E39\u0E48 \u0E23\u0E2D\u0E2A\u0E31\u0E01\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E19\u0E32\u0E17\u0E35\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
631
640
|
screenshotErrors: {
|
|
632
641
|
permission: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E16\u0E39\u0E01\u0E1A\u0E25\u0E47\u0E2D\u0E01 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
633
642
|
unsupported: "\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E19\u0E35\u0E49\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E2B\u0E19\u0E49\u0E32\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",
|
|
@@ -805,6 +814,8 @@ var es = {
|
|
|
805
814
|
screenshotCapturing: "Tomando captura\u2026",
|
|
806
815
|
screenshotRetry: "Reintentar",
|
|
807
816
|
screenshotShareTab: "Compartir esta pesta\xF1a",
|
|
817
|
+
notSentBlocked: "No se envi\xF3. El reporte se filtr\xF3 antes de enviarse. Tu texto sigue aqu\xED; a\xF1ade algo m\xE1s de detalle e int\xE9ntalo de nuevo.",
|
|
818
|
+
notSentThrottled: "No se envi\xF3. Demasiados reportes en poco tiempo. Tu texto sigue aqu\xED; espera un minuto e int\xE9ntalo de nuevo.",
|
|
808
819
|
screenshotErrors: {
|
|
809
820
|
permission: "Se bloque\xF3 la captura. Perm\xEDtela y reintenta.",
|
|
810
821
|
unsupported: "Este navegador no puede capturar la p\xE1gina. Descr\xEDbelo.",
|
|
@@ -982,6 +993,8 @@ var zh = {
|
|
|
982
993
|
screenshotCapturing: "\u6B63\u5728\u622A\u56FE\u2026",
|
|
983
994
|
screenshotRetry: "\u518D\u8BD5\u4E00\u6B21",
|
|
984
995
|
screenshotShareTab: "\u5171\u4EAB\u6B64\u6807\u7B7E\u9875\u6765\u622A\u56FE",
|
|
996
|
+
notSentBlocked: "\u672A\u53D1\u9001\u3002\u8BE5\u53CD\u9988\u5728\u53D1\u9001\u524D\u88AB\u8FC7\u6EE4\u3002\u4F60\u7684\u6587\u5B57\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\uFF0C\u8BF7\u8865\u5145\u4E00\u4E9B\u7EC6\u8282\u540E\u91CD\u8BD5\u3002",
|
|
997
|
+
notSentThrottled: "\u672A\u53D1\u9001\u3002\u77ED\u65F6\u95F4\u5185\u63D0\u4EA4\u8FC7\u591A\u3002\u4F60\u7684\u6587\u5B57\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\uFF0C\u8BF7\u7B49\u5F85\u4E00\u5206\u949F\u540E\u91CD\u8BD5\u3002",
|
|
985
998
|
screenshotErrors: {
|
|
986
999
|
permission: "\u622A\u56FE\u88AB\u62E6\u622A\u4E86\u3002\u8BF7\u5141\u8BB8\u540E\u518D\u8BD5\u3002",
|
|
987
1000
|
unsupported: "\u6B64\u6D4F\u89C8\u5668\u65E0\u6CD5\u622A\u56FE\u3002\u8BF7\u7528\u6587\u5B57\u63CF\u8FF0\u3002",
|
|
@@ -1373,13 +1386,14 @@ function reportView(ctx) {
|
|
|
1373
1386
|
const shot = ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview${ctx.previewOpen ? " open" : ""}"><button type="button" class="mushi-thumb" data-action="toggle-preview" aria-expanded="${ctx.previewOpen}"><img src="${esc(ctx.screenshotPreview)}" alt="${esc(s3.screenshotPreviewAlt)}" /></button><figcaption><span class="mushi-attach-name">${esc(s3.screenshotAttached)}</span>${ctx.screenshotHint ? `<span class="mushi-screenshot-hint">${esc(ctx.screenshotHint)}</span>` : ""}<span class="mushi-attach-actions">${ctx.callbacks.onScreenshotAnnotateRequest ? btn("annotate-screenshot", esc(p.markUp), "mushi-link-btn") : ""}${ctx.allowScreenshotRemove ? btn("remove-screenshot", esc(p.remove), "mushi-link-btn") : ""}</span></figcaption></figure><div class="mushi-annotate-host" data-role="annotate-host"></div>` : ctx.screenshotAvailable ? btn("screenshot", `${ctx.screenshotCapturing ? spin : '<span aria-hidden="true">\u{1F4F7}</span>'}${esc(shotLabel)}`, `mushi-attach-btn${ctx.screenshotError ? " error" : ""}`, `${ctx.screenshotCapturing ? " disabled" : ""} aria-label="${esc(shotLabel)}"`) : "";
|
|
1374
1387
|
const element = ctx.elementAvailable ? btn("element", `${ctx.elementCapturing ? spin : '<span aria-hidden="true">\u2316</span>'}${esc(elLabel)}`, `mushi-attach-btn${ctx.elementSelected ? " active" : ""}${ctx.elementError ? " error" : ""}`, `${ctx.elementCapturing ? " disabled" : ""} aria-label="${esc(elLabel)}"`) : "";
|
|
1375
1388
|
const reason = ctx.screenshotError && ctx.screenshotErrorReason ? `<p class="mushi-note mushi-error-inline" role="status" data-role="screenshot-reason">${esc(s3.screenshotErrors[ctx.screenshotErrorReason])}${ctx.callbacks.onScreenshotShareTabRequest ? ` ${btn("screenshot-share-tab", esc(s3.screenshotShareTab), "mushi-link-btn")}` : ""}</p>` : "";
|
|
1389
|
+
const notSent = ctx.submitNotSent ? `<p class="mushi-note mushi-error-inline" data-role="not-sent">${esc(ctx.submitNotSent === "throttled" ? s3.notSentThrottled : s3.notSentBlocked)}</p>` : "";
|
|
1376
1390
|
const who = ctx.identifiedUser?.name ?? ctx.identifiedUser?.email;
|
|
1377
1391
|
const feature = ctx.chip === "idea";
|
|
1378
1392
|
const hint = ctx.canSend ? esc(s3.submitHint.replace("{key}", submitShortcutKey(readPlatform()))) : esc(ctx.rc.ui.addWords);
|
|
1379
1393
|
return {
|
|
1380
1394
|
header: renderHeader(ctx, ctx.config.expandedTitle || p.title),
|
|
1381
1395
|
lead: `<textarea class="mushi-textarea" data-role="description" rows="3" maxlength="${DESCRIPTION_MAX_LENGTH}" placeholder="${esc(feature ? s3.featurePlaceholder : s3.descriptionPlaceholder)}" aria-label="${esc(p.title)}" aria-describedby="mushi-hint"></textarea>`,
|
|
1382
|
-
body: `${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}<div class="mushi-chips"><div class="mushi-chip-group" role="radiogroup" aria-label="${esc(p.title)}">${chips}</div>${more}</div>${intentRow}<div class="mushi-attachments">${shot}${element}</div>${reason}<p class="mushi-note">\u{1F512} ${esc(p.privacy)}</p>${who ? `<p class="mushi-note">\u{1F464} ${esc(who)}</p>` : ""}${ctx.draftLength > DESCRIPTION_MAX_LENGTH - 400 ? `<p class="mushi-note" aria-live="polite">${ctx.draftLength}/${DESCRIPTION_MAX_LENGTH}</p>` : ""}${ctx.launcherDismissible ? `<p class="mushi-note">${btn("hide-launcher", esc(t.widget.hideLauncher ?? HIDE_LAUNCHER_FALLBACK), "mushi-link-btn")}</p>` : ""}`,
|
|
1396
|
+
body: `${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}<div class="mushi-chips"><div class="mushi-chip-group" role="radiogroup" aria-label="${esc(p.title)}">${chips}</div>${more}</div>${intentRow}<div class="mushi-attachments">${shot}${element}</div>${reason}${notSent}<p class="mushi-note">\u{1F512} ${esc(p.privacy)}</p>${who ? `<p class="mushi-note">\u{1F464} ${esc(who)}</p>` : ""}${ctx.draftLength > DESCRIPTION_MAX_LENGTH - 400 ? `<p class="mushi-note" aria-live="polite">${ctx.draftLength}/${DESCRIPTION_MAX_LENGTH}</p>` : ""}${ctx.launcherDismissible ? `<p class="mushi-note">${btn("hide-launcher", esc(t.widget.hideLauncher ?? HIDE_LAUNCHER_FALLBACK), "mushi-link-btn")}</p>` : ""}`,
|
|
1383
1397
|
footer: `<span class="mushi-footer-hint" id="mushi-hint" data-role="hint">${hint}</span><button type="button" class="mushi-submit" data-action="submit" aria-disabled="${!ctx.canSend || ctx.submitting}"${ctx.submitting ? ' aria-busy="true"' : ""}>${esc(ctx.submitting ? t.widget.submitting : p.send)}</button>`
|
|
1384
1398
|
};
|
|
1385
1399
|
}
|
|
@@ -1609,6 +1623,8 @@ var MushiWidget = class _MushiWidget {
|
|
|
1609
1623
|
lastSubmitQueuedOffline = false;
|
|
1610
1624
|
lastSubmitFailureKind;
|
|
1611
1625
|
lastSubmitScreenshotDropped = false;
|
|
1626
|
+
/** The last submit never left the device; the report step says why. */
|
|
1627
|
+
submitNotSent = null;
|
|
1612
1628
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
1613
1629
|
bannerDismissed = false;
|
|
1614
1630
|
bannerResizeObserver = null;
|
|
@@ -1808,6 +1824,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
1808
1824
|
this.lastSubmitQueuedOffline = false;
|
|
1809
1825
|
this.lastSubmitFailureKind = void 0;
|
|
1810
1826
|
this.lastSubmitScreenshotDropped = false;
|
|
1827
|
+
this.submitNotSent = null;
|
|
1811
1828
|
this.emailOptInOpen = false;
|
|
1812
1829
|
this.emailState = "idle";
|
|
1813
1830
|
this.drafts = {};
|
|
@@ -3071,6 +3088,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3071
3088
|
lastSubmitQueuedOffline: this.lastSubmitQueuedOffline,
|
|
3072
3089
|
lastSubmitFailureKind: this.lastSubmitFailureKind,
|
|
3073
3090
|
lastSubmitScreenshotDropped: this.lastSubmitScreenshotDropped,
|
|
3091
|
+
submitNotSent: this.submitNotSent,
|
|
3074
3092
|
channels: this.channels,
|
|
3075
3093
|
emailOptInOpen: this.emailOptInOpen,
|
|
3076
3094
|
emailState: this.emailState,
|
|
@@ -3410,6 +3428,8 @@ var MushiWidget = class _MushiWidget {
|
|
|
3410
3428
|
this.lastSubmitQueuedOffline = false;
|
|
3411
3429
|
this.lastSubmitFailureKind = void 0;
|
|
3412
3430
|
this.lastSubmitScreenshotDropped = false;
|
|
3431
|
+
this.submitNotSent = null;
|
|
3432
|
+
const keptDrafts = { ...this.drafts };
|
|
3413
3433
|
this.render();
|
|
3414
3434
|
const outcomeP = (async () => {
|
|
3415
3435
|
try {
|
|
@@ -3427,8 +3447,16 @@ var MushiWidget = class _MushiWidget {
|
|
|
3427
3447
|
return { reportId: null, queuedOffline: true };
|
|
3428
3448
|
}
|
|
3429
3449
|
})();
|
|
3450
|
+
let settled;
|
|
3451
|
+
void outcomeP.then((outcome) => {
|
|
3452
|
+
settled = outcome;
|
|
3453
|
+
});
|
|
3430
3454
|
this.successTimer = setTimeout(() => {
|
|
3431
3455
|
this.successTimer = null;
|
|
3456
|
+
if (isNotSentOutcome(settled)) {
|
|
3457
|
+
this.showNotSent(settled.failureKind, keptDrafts);
|
|
3458
|
+
return;
|
|
3459
|
+
}
|
|
3432
3460
|
this.submitting = false;
|
|
3433
3461
|
this.step = "success";
|
|
3434
3462
|
this.drafts = {};
|
|
@@ -3436,6 +3464,10 @@ var MushiWidget = class _MushiWidget {
|
|
|
3436
3464
|
this.announce(this.rc.ui.sent);
|
|
3437
3465
|
void outcomeP.then((outcome) => {
|
|
3438
3466
|
if (this.step !== "success" || !outcome) return;
|
|
3467
|
+
if (isNotSentOutcome(outcome)) {
|
|
3468
|
+
this.showNotSent(outcome.failureKind, keptDrafts);
|
|
3469
|
+
return;
|
|
3470
|
+
}
|
|
3439
3471
|
this.lastReportId = outcome.reportId ?? null;
|
|
3440
3472
|
this.lastSubmitQueuedOffline = Boolean(outcome.queuedOffline);
|
|
3441
3473
|
this.lastSubmitFailureKind = outcome.failureKind;
|
|
@@ -3444,6 +3476,16 @@ var MushiWidget = class _MushiWidget {
|
|
|
3444
3476
|
});
|
|
3445
3477
|
}, 500);
|
|
3446
3478
|
}
|
|
3479
|
+
/** Back to the report step with the reporter's text, saying the report was not sent. */
|
|
3480
|
+
showNotSent(kind, keptDrafts) {
|
|
3481
|
+
this.submitting = false;
|
|
3482
|
+
this.step = "report";
|
|
3483
|
+
this.drafts = keptDrafts;
|
|
3484
|
+
this.submitNotSent = kind;
|
|
3485
|
+
this.render();
|
|
3486
|
+
const s3 = this.locale.step3;
|
|
3487
|
+
this.announce(kind === "throttled" ? s3.notSentThrottled : s3.notSentBlocked);
|
|
3488
|
+
}
|
|
3447
3489
|
// ─── Your reports ──────────────────────────────────────────────────
|
|
3448
3490
|
async loadFeatureBoard() {
|
|
3449
3491
|
this.step = "roadmap";
|
|
@@ -6312,7 +6354,7 @@ function createProactiveManager(config = {}) {
|
|
|
6312
6354
|
|
|
6313
6355
|
// src/version.ts
|
|
6314
6356
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
6315
|
-
var MUSHI_SDK_VERSION = "1.33.
|
|
6357
|
+
var MUSHI_SDK_VERSION = "1.33.3" ;
|
|
6316
6358
|
function resolveReportAppVersion(config, environment) {
|
|
6317
6359
|
if (config.appVersion) return config.appVersion;
|
|
6318
6360
|
const vercelId = config.integrations?.vercel?.analyticsId;
|
|
@@ -6796,8 +6838,7 @@ function createInstance(config) {
|
|
|
6796
6838
|
log.info("Report submitted", { category, userCategory, intent });
|
|
6797
6839
|
if (pendingProactiveTrigger) proactiveManager?.recordSubmission();
|
|
6798
6840
|
await autoCaptureScreenshot("submit");
|
|
6799
|
-
|
|
6800
|
-
return outcome ?? { reportId: null, queuedOffline: true };
|
|
6841
|
+
return submitReport(category, description, intent, userCategory);
|
|
6801
6842
|
},
|
|
6802
6843
|
onOpen: () => {
|
|
6803
6844
|
log.debug("Widget opened");
|
|
@@ -7232,10 +7273,11 @@ function createInstance(config) {
|
|
|
7232
7273
|
}
|
|
7233
7274
|
}
|
|
7234
7275
|
async function submitReport(category, description, intent, userCategory) {
|
|
7276
|
+
const notSent = (failureKind) => ({ reportId: null, queuedOffline: false, failureKind });
|
|
7235
7277
|
const filterResult = preFilter.check(description);
|
|
7236
7278
|
if (!filterResult.passed) {
|
|
7237
7279
|
log.info("Report blocked by pre-filter", { reason: filterResult.reason });
|
|
7238
|
-
return
|
|
7280
|
+
return notSent("blocked");
|
|
7239
7281
|
}
|
|
7240
7282
|
const wasm = config.preFilter?.wasmClassifier;
|
|
7241
7283
|
if (wasm) {
|
|
@@ -7256,7 +7298,7 @@ function createInstance(config) {
|
|
|
7256
7298
|
confidence: verdict.confidence,
|
|
7257
7299
|
reason: verdict.reason
|
|
7258
7300
|
});
|
|
7259
|
-
return
|
|
7301
|
+
return notSent("blocked");
|
|
7260
7302
|
}
|
|
7261
7303
|
log.debug("On-device classifier verdict", { ...verdict });
|
|
7262
7304
|
} catch (err) {
|
|
@@ -7269,12 +7311,12 @@ function createInstance(config) {
|
|
|
7269
7311
|
if (isAutomatic && config.sampleRate !== void 0 && config.sampleRate < 1) {
|
|
7270
7312
|
if (config.sampleRate <= 0 || Math.random() > config.sampleRate) {
|
|
7271
7313
|
log.debug("Report dropped by sampleRate", { sampleRate: config.sampleRate, trigger: pendingProactiveTrigger });
|
|
7272
|
-
return
|
|
7314
|
+
return notSent("blocked");
|
|
7273
7315
|
}
|
|
7274
7316
|
}
|
|
7275
7317
|
if (!rateLimiter.tryConsume()) {
|
|
7276
7318
|
log.warn("Report throttled \u2014 rate limit exceeded");
|
|
7277
|
-
return
|
|
7319
|
+
return notSent("throttled");
|
|
7278
7320
|
}
|
|
7279
7321
|
const scrubbedDescription = piiScrubber.scrub(preFilter.truncate(description));
|
|
7280
7322
|
const sentryCtx = config.sentry ? captureSentryContext(config.sentry) : void 0;
|
|
@@ -7370,7 +7412,7 @@ function createInstance(config) {
|
|
|
7370
7412
|
]);
|
|
7371
7413
|
if (hookResult === null) {
|
|
7372
7414
|
log.info("Report dropped by beforeSend hook", { reportId: report.id });
|
|
7373
|
-
return;
|
|
7415
|
+
return notSent("blocked");
|
|
7374
7416
|
}
|
|
7375
7417
|
finalReport = hookResult;
|
|
7376
7418
|
} catch (err) {
|