@mushi-mushi/web 1.17.0 → 1.19.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/README.md +3 -3
- package/dist/index.cjs +178 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +178 -28
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +358 -270
- package/dist/mushi.loader.global.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ Each trigger respects its config flag — set `rageClick: false` to disable rage
|
|
|
88
88
|
|
|
89
89
|
## Bundle Size
|
|
90
90
|
|
|
91
|
-
~7 KB brotli, enforced at **
|
|
91
|
+
~7 KB brotli, enforced at **72 KB gzipped** (105 KB uncompressed) via `size-limit` in CI — budget raised for the 2026 editorial widget refresh + screenshot preview/consent surface. Requires `@mushi-mushi/core` as a dependency (not bundled inline). The `./test-utils` entry is a separate artifact and is never pulled into production bundles.
|
|
92
92
|
|
|
93
93
|
## Quick Start
|
|
94
94
|
|
|
@@ -398,7 +398,7 @@ report — without you having to plumb it through the report payload yourself:
|
|
|
398
398
|
const mushi = Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
|
|
399
399
|
|
|
400
400
|
// Identify the active reporter (also sent to Sentry if @sentry/browser is loaded).
|
|
401
|
-
mushi.identify(
|
|
401
|
+
mushi.identify('usr_42', { email: 'aya@example.com', segment: 'beta' });
|
|
402
402
|
|
|
403
403
|
// Sticky scalar tags. Up to 64 keys; values are string | number | boolean.
|
|
404
404
|
mushi.setTag('feature', 'checkout-v2');
|
|
@@ -531,4 +531,4 @@ MIT
|
|
|
531
531
|
<!-- mushi-readme-stats-footer -->
|
|
532
532
|
---
|
|
533
533
|
|
|
534
|
-
<sub>Monorepo scale (June 2026):
|
|
534
|
+
<sub>Monorepo scale (June 2026): 50 edge functions · 278 SQL migrations · 13 outbound plugins · 11 inbound adapters · 19 pipeline agents. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
|
package/dist/index.cjs
CHANGED
|
@@ -84,6 +84,8 @@ var en = {
|
|
|
84
84
|
screenshotAttached: "Screenshot attached \u2713",
|
|
85
85
|
screenshotCapturing: "Taking screenshot\u2026",
|
|
86
86
|
screenshotFailed: "Couldn't capture \u2014 describe it instead",
|
|
87
|
+
screenshotPreviewAlt: "Preview of the screenshot that will be sent",
|
|
88
|
+
screenshotSensitiveHint: "Check the preview \u2014 remove it if any private info (balances, personal details) is visible.",
|
|
87
89
|
elementButton: "Select Element",
|
|
88
90
|
elementSelected: "Element selected \u2713",
|
|
89
91
|
elementCapturing: "Click anything on the page\u2026",
|
|
@@ -144,6 +146,8 @@ var ja = {
|
|
|
144
146
|
screenshotAttached: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8\u6E08\u307F \u2713",
|
|
145
147
|
screenshotCapturing: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u64AE\u5F71\u4E2D\u2026",
|
|
146
148
|
screenshotFailed: "\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F \u2014 \u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044",
|
|
149
|
+
screenshotPreviewAlt: "\u9001\u4FE1\u3055\u308C\u308B\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
150
|
+
screenshotSensitiveHint: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u78BA\u8A8D\u3057\u3001\u6B8B\u9AD8\u3084\u500B\u4EBA\u60C5\u5831\u306A\u3069\u304C\u5199\u3063\u3066\u3044\u308C\u3070\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
147
151
|
elementButton: "\u8981\u7D20\u3092\u9078\u629E",
|
|
148
152
|
elementSelected: "\u8981\u7D20\u9078\u629E\u6E08\u307F \u2713",
|
|
149
153
|
elementCapturing: "\u30DA\u30FC\u30B8\u4E0A\u306E\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF\u2026",
|
|
@@ -204,6 +208,8 @@ var th = {
|
|
|
204
208
|
screenshotAttached: "\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E41\u0E25\u0E49\u0E27 \u2713",
|
|
205
209
|
screenshotCapturing: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E16\u0E48\u0E32\u0E22\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u2026",
|
|
206
210
|
screenshotFailed: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E16\u0E48\u0E32\u0E22\u0E20\u0E32\u0E1E\u0E44\u0E14\u0E49 \u2014 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",
|
|
211
|
+
screenshotPreviewAlt: "\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E17\u0E35\u0E48\u0E08\u0E30\u0E16\u0E39\u0E01\u0E2A\u0E48\u0E07",
|
|
212
|
+
screenshotSensitiveHint: "\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E20\u0E32\u0E1E \u2014 \u0E2B\u0E32\u0E01\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E15\u0E31\u0E27 (\u0E22\u0E2D\u0E14\u0E40\u0E07\u0E34\u0E19 \u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25) \u0E42\u0E1B\u0E23\u0E14\u0E25\u0E1A\u0E2D\u0E2D\u0E01",
|
|
207
213
|
elementButton: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A",
|
|
208
214
|
elementSelected: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E41\u0E25\u0E49\u0E27 \u2713",
|
|
209
215
|
elementCapturing: "\u0E04\u0E25\u0E34\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E1A\u0E19\u0E2B\u0E19\u0E49\u0E32\u2026",
|
|
@@ -264,6 +270,8 @@ var es = {
|
|
|
264
270
|
screenshotAttached: "Captura adjunta \u2713",
|
|
265
271
|
screenshotCapturing: "Tomando captura\u2026",
|
|
266
272
|
screenshotFailed: "No se pudo capturar \u2014 descr\xEDbelo en su lugar",
|
|
273
|
+
screenshotPreviewAlt: "Vista previa de la captura que se enviar\xE1",
|
|
274
|
+
screenshotSensitiveHint: "Revisa la vista previa \u2014 qu\xEDtala si se ve informaci\xF3n privada (saldos, datos personales).",
|
|
267
275
|
elementButton: "Seleccionar elemento",
|
|
268
276
|
elementSelected: "Elemento seleccionado \u2713",
|
|
269
277
|
elementCapturing: "Haz clic en cualquier elemento\u2026",
|
|
@@ -487,9 +495,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
487
495
|
|
|
488
496
|
.mushi-panel {
|
|
489
497
|
position: fixed;
|
|
490
|
-
width:
|
|
498
|
+
width: 360px;
|
|
491
499
|
max-width: calc(100vw - 32px);
|
|
492
|
-
max-height: min(
|
|
500
|
+
max-height: min(480px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
|
|
493
501
|
background: ${paper};
|
|
494
502
|
border: 1px solid ${ruleStrong};
|
|
495
503
|
border-radius: 6px;
|
|
@@ -575,12 +583,12 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
575
583
|
}
|
|
576
584
|
|
|
577
585
|
.mushi-header {
|
|
578
|
-
padding: 18px
|
|
586
|
+
padding: 13px 18px 10px;
|
|
579
587
|
border-bottom: 1px solid ${rule};
|
|
580
588
|
display: grid;
|
|
581
589
|
grid-template-columns: auto 1fr auto;
|
|
582
590
|
align-items: end;
|
|
583
|
-
gap:
|
|
591
|
+
gap: 10px;
|
|
584
592
|
}
|
|
585
593
|
.mushi-header-mark {
|
|
586
594
|
display: inline-flex;
|
|
@@ -655,17 +663,22 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
655
663
|
background: none;
|
|
656
664
|
border: none;
|
|
657
665
|
cursor: pointer;
|
|
658
|
-
padding: 0;
|
|
666
|
+
padding: 3px 0;
|
|
659
667
|
margin: 0 0 2px;
|
|
668
|
+
min-height: 22px;
|
|
660
669
|
color: ${inkMuted};
|
|
661
670
|
font-family: ${fontMono};
|
|
662
|
-
font-size:
|
|
671
|
+
font-size: 11px;
|
|
663
672
|
font-weight: 500;
|
|
664
|
-
letter-spacing: 0.
|
|
673
|
+
letter-spacing: 0.06em;
|
|
665
674
|
text-transform: uppercase;
|
|
666
675
|
line-height: 1.2;
|
|
667
676
|
border-radius: 0;
|
|
677
|
+
display: inline-flex;
|
|
678
|
+
align-items: center;
|
|
679
|
+
gap: 4px;
|
|
668
680
|
transition: color 150ms ${easeStamp};
|
|
681
|
+
white-space: nowrap;
|
|
669
682
|
}
|
|
670
683
|
.mushi-close:hover { color: ${widgetAccent}; }
|
|
671
684
|
.mushi-back:hover { color: ${ink}; }
|
|
@@ -698,9 +711,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
698
711
|
display: grid;
|
|
699
712
|
grid-template-columns: auto 1fr auto;
|
|
700
713
|
align-items: center;
|
|
701
|
-
gap:
|
|
714
|
+
gap: 12px;
|
|
702
715
|
width: 100%;
|
|
703
|
-
padding:
|
|
716
|
+
padding: 11px 0;
|
|
704
717
|
border: none;
|
|
705
718
|
border-bottom: 1px solid ${rule};
|
|
706
719
|
background: transparent;
|
|
@@ -1097,6 +1110,30 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1097
1110
|
.mushi-annotate-host:empty {
|
|
1098
1111
|
margin-top: 0;
|
|
1099
1112
|
}
|
|
1113
|
+
.mushi-screenshot-preview {
|
|
1114
|
+
margin: 10px 0 0;
|
|
1115
|
+
display: flex;
|
|
1116
|
+
flex-direction: column;
|
|
1117
|
+
gap: 6px;
|
|
1118
|
+
}
|
|
1119
|
+
.mushi-screenshot-preview img {
|
|
1120
|
+
display: block;
|
|
1121
|
+
max-width: 100%;
|
|
1122
|
+
max-height: 160px;
|
|
1123
|
+
width: auto;
|
|
1124
|
+
border: 1px solid ${ruleStrong};
|
|
1125
|
+
border-radius: 3px;
|
|
1126
|
+
object-fit: contain;
|
|
1127
|
+
align-self: flex-start;
|
|
1128
|
+
}
|
|
1129
|
+
.mushi-screenshot-hint {
|
|
1130
|
+
margin: 0;
|
|
1131
|
+
color: ${inkMuted};
|
|
1132
|
+
font-family: ${fontMono};
|
|
1133
|
+
font-size: 10.5px;
|
|
1134
|
+
line-height: 1.4;
|
|
1135
|
+
letter-spacing: 0.02em;
|
|
1136
|
+
}
|
|
1100
1137
|
.mushi-annotate-toolbar {
|
|
1101
1138
|
display: flex;
|
|
1102
1139
|
flex-wrap: wrap;
|
|
@@ -1924,6 +1961,56 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1924
1961
|
|
|
1925
1962
|
.mushi-community-footer{display:flex;align-items:center;gap:8px;padding:10px 0 2px;border-top:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.07)"};margin-top:8px;flex-wrap:wrap}
|
|
1926
1963
|
.mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1964
|
+
/* \u2500\u2500 "More issue types \u2192" toggle (progressive disclosure) \u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1965
|
+
.mushi-more-toggle {
|
|
1966
|
+
display: flex;
|
|
1967
|
+
align-items: center;
|
|
1968
|
+
gap: 8px;
|
|
1969
|
+
width: 100%;
|
|
1970
|
+
padding: 11px 0;
|
|
1971
|
+
border: none;
|
|
1972
|
+
border-top: 1px dashed ${rule};
|
|
1973
|
+
background: transparent;
|
|
1974
|
+
cursor: pointer;
|
|
1975
|
+
color: ${inkMuted};
|
|
1976
|
+
font-family: ${fontBody};
|
|
1977
|
+
font-size: 13px;
|
|
1978
|
+
text-align: left;
|
|
1979
|
+
transition: color 180ms ${easeStamp};
|
|
1980
|
+
}
|
|
1981
|
+
.mushi-more-toggle:hover { color: ${widgetAccent}; }
|
|
1982
|
+
.mushi-more-toggle:hover .mushi-more-toggle-arrow { transform: translateX(3px); }
|
|
1983
|
+
.mushi-more-toggle-text { flex: 1; }
|
|
1984
|
+
.mushi-more-toggle-count {
|
|
1985
|
+
font-family: ${fontMono};
|
|
1986
|
+
font-size: 10px;
|
|
1987
|
+
letter-spacing: 0.08em;
|
|
1988
|
+
text-transform: uppercase;
|
|
1989
|
+
color: ${inkFaint};
|
|
1990
|
+
background: ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.06)"};
|
|
1991
|
+
padding: 2px 6px;
|
|
1992
|
+
border-radius: 10px;
|
|
1993
|
+
}
|
|
1994
|
+
.mushi-more-toggle-arrow {
|
|
1995
|
+
font-size: 14px;
|
|
1996
|
+
opacity: 0.5;
|
|
1997
|
+
transition: transform 180ms ${easeStamp};
|
|
1998
|
+
}
|
|
1999
|
+
/* \u2500\u2500 Step slide-in \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
2000
|
+
@keyframes mushi-step-in {
|
|
2001
|
+
0% { opacity: 0; transform: translateX(8px); }
|
|
2002
|
+
100% { opacity: 1; transform: translateX(0); }
|
|
2003
|
+
}
|
|
2004
|
+
.mushi-body {
|
|
2005
|
+
animation: mushi-step-in 160ms ease both;
|
|
2006
|
+
}
|
|
2007
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2008
|
+
.mushi-body { animation: none; }
|
|
2009
|
+
}
|
|
2010
|
+
/* Expanded secondary categories animate in */
|
|
2011
|
+
.mushi-categories-expanded {
|
|
2012
|
+
animation: mushi-step-in 180ms ease both;
|
|
2013
|
+
}
|
|
1927
2014
|
.mushi-link-btn{background:none;border:none;padding:4px 2px;cursor:pointer;color:${widgetAccent};font-size:12px;font-family:${fontMono};text-decoration:underline;text-underline-offset:2px}
|
|
1928
2015
|
.mushi-link-btn:hover{opacity:0.8}
|
|
1929
2016
|
.mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}
|
|
@@ -1964,7 +2051,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1964
2051
|
|
|
1965
2052
|
// src/version.ts
|
|
1966
2053
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
1967
|
-
var MUSHI_SDK_VERSION = "1.
|
|
2054
|
+
var MUSHI_SDK_VERSION = "1.19.0" ;
|
|
1968
2055
|
|
|
1969
2056
|
// src/widget-helpers.ts
|
|
1970
2057
|
var CATEGORY_ICONS = {
|
|
@@ -2167,7 +2254,7 @@ function renderBrandFooter(ctx) {
|
|
|
2167
2254
|
function renderHeader(ctx, opts) {
|
|
2168
2255
|
const t = ctx.locale;
|
|
2169
2256
|
const { title, showBack = false, step, eyebrow } = opts;
|
|
2170
|
-
const eyebrowHtml = showBack ? `<button type="button" class="mushi-back" data-action="back" aria-label="${t.widget.back}">\u2190</button>` : `<span class="mushi-header-eyebrow">${eyebrow ?? "Mushi \xB7 Report"}</span>`;
|
|
2257
|
+
const eyebrowHtml = showBack ? `<button type="button" class="mushi-back" data-action="back" aria-label="${escapeHtml(t.widget.back)}">\u2190 ${escapeHtml(t.widget.back)}</button>` : `<span class="mushi-header-eyebrow">${escapeHtml(eyebrow ?? "Mushi \xB7 Report")}</span>`;
|
|
2171
2258
|
const counterHtml = step ? `<span class="mushi-step-counter" aria-label="Step ${step} of ${TOTAL_STEPS}"><b>${pad2(step)}</b> / ${pad2(TOTAL_STEPS)}</span>` : "";
|
|
2172
2259
|
return `
|
|
2173
2260
|
<div class="mushi-header">
|
|
@@ -2178,7 +2265,7 @@ function renderHeader(ctx, opts) {
|
|
|
2178
2265
|
</div>
|
|
2179
2266
|
<div class="mushi-header-meta">
|
|
2180
2267
|
${counterHtml}
|
|
2181
|
-
<button type="button" class="mushi-close" data-action="close" aria-label="${t.widget.close}">\u2715</button>
|
|
2268
|
+
<button type="button" class="mushi-close" data-action="close" aria-label="${escapeHtml(t.widget.close)}">\u2715</button>
|
|
2182
2269
|
</div>
|
|
2183
2270
|
</div>
|
|
2184
2271
|
`;
|
|
@@ -2205,20 +2292,32 @@ function renderCategoryStep(ctx) {
|
|
|
2205
2292
|
label: t.step1.categories[id],
|
|
2206
2293
|
desc: t.step1.categoryDescriptions[id]
|
|
2207
2294
|
}));
|
|
2208
|
-
const
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2295
|
+
const renderEntry = ({ id, icon, label, desc }) => `
|
|
2296
|
+
<button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
|
|
2297
|
+
<span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
|
|
2298
|
+
<div class="mushi-option-text">
|
|
2299
|
+
<span class="mushi-option-label">${escapeHtml(label)}</span>
|
|
2300
|
+
${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
|
|
2301
|
+
</div>
|
|
2302
|
+
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
2303
|
+
</button>
|
|
2304
|
+
`;
|
|
2305
|
+
const isCustom = ctx.config.categories && ctx.config.categories.length > 0;
|
|
2306
|
+
const PRIMARY_LIMIT = 1;
|
|
2307
|
+
const primaryEntries = isCustom ? categoryEntries : categoryEntries.slice(0, PRIMARY_LIMIT);
|
|
2308
|
+
const secondaryEntries = isCustom ? [] : categoryEntries.slice(PRIMARY_LIMIT);
|
|
2309
|
+
const hasMore = secondaryEntries.length > 0;
|
|
2310
|
+
const primaryCategories = primaryEntries.map(renderEntry).join("");
|
|
2311
|
+
const secondaryCategories = secondaryEntries.map(renderEntry).join("");
|
|
2312
|
+
const secondaryHtml = hasMore ? ctx.showAllCategories ? `<div class="mushi-categories-expanded">${secondaryCategories}</div>` : `<button type="button" class="mushi-more-toggle" data-action="show-all-categories">
|
|
2313
|
+
<span class="mushi-more-toggle-text">More issue types</span>
|
|
2314
|
+
<span class="mushi-more-toggle-count">${secondaryEntries.length} more</span>
|
|
2315
|
+
<span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
|
|
2316
|
+
</button>` : "";
|
|
2218
2317
|
return `
|
|
2219
2318
|
${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
|
|
2220
2319
|
${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
|
|
2221
|
-
<div class="mushi-body" role="radiogroup" aria-label="${t.step1.heading}">
|
|
2320
|
+
<div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
|
|
2222
2321
|
<button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
|
|
2223
2322
|
<span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
|
|
2224
2323
|
<div class="mushi-option-text">
|
|
@@ -2237,7 +2336,8 @@ function renderCategoryStep(ctx) {
|
|
|
2237
2336
|
</div>
|
|
2238
2337
|
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
2239
2338
|
</button>` : ""}
|
|
2240
|
-
${
|
|
2339
|
+
${primaryCategories}
|
|
2340
|
+
${secondaryHtml}
|
|
2241
2341
|
${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
|
|
2242
2342
|
<div class="mushi-community-footer">
|
|
2243
2343
|
<button type="button" class="mushi-link-btn mushi-community-btn" data-action="open-account">
|
|
@@ -2578,9 +2678,9 @@ function renderDetailsStep(ctx) {
|
|
|
2578
2678
|
<div class="mushi-textarea-wrap">
|
|
2579
2679
|
<textarea
|
|
2580
2680
|
class="mushi-textarea"
|
|
2581
|
-
placeholder="${t.step3.descriptionPlaceholder}"
|
|
2681
|
+
placeholder="${escapeHtml(t.step3.descriptionPlaceholder)}"
|
|
2582
2682
|
rows="4"
|
|
2583
|
-
aria-label="${t.step3.heading}"
|
|
2683
|
+
aria-label="${escapeHtml(t.step3.heading)}"
|
|
2584
2684
|
autofocus
|
|
2585
2685
|
></textarea>
|
|
2586
2686
|
<div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">
|
|
@@ -2607,6 +2707,10 @@ function renderDetailsStep(ctx) {
|
|
|
2607
2707
|
${escapeHtml(elementLabel)}
|
|
2608
2708
|
</button>
|
|
2609
2709
|
</div>
|
|
2710
|
+
${ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview">
|
|
2711
|
+
<img src="${escapeHtml(ctx.screenshotPreview)}" alt="${escapeHtml(t.step3.screenshotPreviewAlt)}" />
|
|
2712
|
+
${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
|
|
2713
|
+
</figure>` : ""}
|
|
2610
2714
|
<div class="mushi-error" style="display:none" role="alert"></div>
|
|
2611
2715
|
</div>
|
|
2612
2716
|
<div class="mushi-footer">
|
|
@@ -2624,7 +2728,7 @@ function renderSuccessStep(ctx) {
|
|
|
2624
2728
|
const stamp = ctx.submittedAt ?? /* @__PURE__ */ new Date();
|
|
2625
2729
|
const time = stamp.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false });
|
|
2626
2730
|
return `
|
|
2627
|
-
${renderHeader(ctx, { title: t.widget.title, eyebrow: "Mushi \xB7 Receipt" })}
|
|
2731
|
+
${renderHeader(ctx, { title: t.widget.title, showBack: true, eyebrow: "Mushi \xB7 Receipt" })}
|
|
2628
2732
|
<div class="mushi-body">
|
|
2629
2733
|
<div class="mushi-success">
|
|
2630
2734
|
<div class="mushi-success-stamp" aria-hidden="true">
|
|
@@ -2799,6 +2903,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2799
2903
|
draggable: config.draggable ?? false,
|
|
2800
2904
|
brandFooter: config.brandFooter ?? true,
|
|
2801
2905
|
outdatedBanner: config.outdatedBanner ?? "auto",
|
|
2906
|
+
screenshotSensitiveHint: config.screenshotSensitiveHint ?? true,
|
|
2802
2907
|
betaMode: config.betaMode ?? {},
|
|
2803
2908
|
minDescriptionLength: config.minDescriptionLength ?? 20,
|
|
2804
2909
|
dashboardUrl: config.dashboardUrl ?? "",
|
|
@@ -2839,10 +2944,14 @@ var MushiWidget = class _MushiWidget {
|
|
|
2839
2944
|
* landing on the intent picker the user explicitly skipped.
|
|
2840
2945
|
*/
|
|
2841
2946
|
viaFeatureRequest = false;
|
|
2947
|
+
/** Whether the category list is fully expanded (progressive disclosure). */
|
|
2948
|
+
showAllCategories = false;
|
|
2842
2949
|
screenshotAttached = false;
|
|
2843
2950
|
screenshotCapturing = false;
|
|
2844
2951
|
screenshotError = false;
|
|
2845
2952
|
allowScreenshotRemove = true;
|
|
2953
|
+
/** Data URL of the attached screenshot, rendered as a visible preview. */
|
|
2954
|
+
screenshotPreview = null;
|
|
2846
2955
|
elementSelected = false;
|
|
2847
2956
|
elementCapturing = false;
|
|
2848
2957
|
submitting = false;
|
|
@@ -2954,6 +3063,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2954
3063
|
...config.draggable !== void 0 ? { draggable: config.draggable } : {},
|
|
2955
3064
|
...config.brandFooter !== void 0 ? { brandFooter: config.brandFooter } : {},
|
|
2956
3065
|
...config.outdatedBanner !== void 0 ? { outdatedBanner: config.outdatedBanner } : {},
|
|
3066
|
+
...config.screenshotSensitiveHint !== void 0 ? { screenshotSensitiveHint: config.screenshotSensitiveHint } : {},
|
|
2957
3067
|
...config.betaMode !== void 0 ? { betaMode: config.betaMode } : {},
|
|
2958
3068
|
...config.minDescriptionLength !== void 0 ? { minDescriptionLength: config.minDescriptionLength } : {},
|
|
2959
3069
|
...config.dashboardUrl !== void 0 ? { dashboardUrl: config.dashboardUrl } : {},
|
|
@@ -3009,6 +3119,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3009
3119
|
this.screenshotAttached = false;
|
|
3010
3120
|
this.screenshotCapturing = false;
|
|
3011
3121
|
this.screenshotError = false;
|
|
3122
|
+
this.screenshotPreview = null;
|
|
3012
3123
|
this.elementSelected = false;
|
|
3013
3124
|
this.elementCapturing = false;
|
|
3014
3125
|
this.submitting = false;
|
|
@@ -3046,6 +3157,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3046
3157
|
close() {
|
|
3047
3158
|
if (!this.isOpen) return;
|
|
3048
3159
|
this.isOpen = false;
|
|
3160
|
+
this.showAllCategories = false;
|
|
3049
3161
|
this.render();
|
|
3050
3162
|
this.callbacks.onClose();
|
|
3051
3163
|
}
|
|
@@ -3146,8 +3258,26 @@ var MushiWidget = class _MushiWidget {
|
|
|
3146
3258
|
}
|
|
3147
3259
|
setScreenshotAttached(attached) {
|
|
3148
3260
|
this.screenshotAttached = attached;
|
|
3261
|
+
if (!attached) this.screenshotPreview = null;
|
|
3262
|
+
if (this.isOpen) this.render();
|
|
3263
|
+
}
|
|
3264
|
+
/** Provide the captured screenshot data URL so the widget can preview it. */
|
|
3265
|
+
setScreenshotPreview(dataUrl) {
|
|
3266
|
+
this.screenshotPreview = dataUrl;
|
|
3149
3267
|
if (this.isOpen) this.render();
|
|
3150
3268
|
}
|
|
3269
|
+
/**
|
|
3270
|
+
* Resolve the privacy caption shown beside the screenshot preview from the
|
|
3271
|
+
* `screenshotSensitiveHint` widget config (kept in sync via updateConfig, so
|
|
3272
|
+
* it honours console/runtime config): `false` → hidden, a non-empty string →
|
|
3273
|
+
* that copy, anything else (`true`/unset) → the localized default.
|
|
3274
|
+
*/
|
|
3275
|
+
resolveScreenshotHint() {
|
|
3276
|
+
const v = this.config.screenshotSensitiveHint;
|
|
3277
|
+
if (v === false) return null;
|
|
3278
|
+
if (typeof v === "string") return v.trim() ? v : null;
|
|
3279
|
+
return this.locale.step3.screenshotSensitiveHint;
|
|
3280
|
+
}
|
|
3151
3281
|
setAllowScreenshotRemove(allow) {
|
|
3152
3282
|
this.allowScreenshotRemove = allow;
|
|
3153
3283
|
if (this.isOpen) this.render();
|
|
@@ -4016,6 +4146,8 @@ var MushiWidget = class _MushiWidget {
|
|
|
4016
4146
|
testerInfo: this.testerInfo,
|
|
4017
4147
|
screenshotCapturing: this.screenshotCapturing,
|
|
4018
4148
|
screenshotAttached: this.screenshotAttached,
|
|
4149
|
+
screenshotPreview: this.screenshotPreview,
|
|
4150
|
+
screenshotHint: this.resolveScreenshotHint(),
|
|
4019
4151
|
reporterError: this.reporterError,
|
|
4020
4152
|
magicLinkError: this.magicLinkError,
|
|
4021
4153
|
elementCapturing: this.elementCapturing,
|
|
@@ -4052,7 +4184,8 @@ var MushiWidget = class _MushiWidget {
|
|
|
4052
4184
|
categoryIcon: (id) => this.categoryIcon(id),
|
|
4053
4185
|
assistantTurns: this.assistantTurns,
|
|
4054
4186
|
assistantSending: this.assistantSending,
|
|
4055
|
-
assistantError: this.assistantError
|
|
4187
|
+
assistantError: this.assistantError,
|
|
4188
|
+
showAllCategories: this.showAllCategories
|
|
4056
4189
|
};
|
|
4057
4190
|
}
|
|
4058
4191
|
attachHandlers(panel) {
|
|
@@ -4083,7 +4216,21 @@ var MushiWidget = class _MushiWidget {
|
|
|
4083
4216
|
this.step = "category";
|
|
4084
4217
|
} else if (this.step === "assistant") {
|
|
4085
4218
|
this.step = "category";
|
|
4219
|
+
} else if (this.step === "account") {
|
|
4220
|
+
this.step = "category";
|
|
4221
|
+
} else if (this.step === "cross-app-reports") {
|
|
4222
|
+
this.step = "account";
|
|
4223
|
+
} else if (this.step === "success") {
|
|
4224
|
+
this.step = "category";
|
|
4225
|
+
this.selectedCategory = null;
|
|
4226
|
+
this.selectedIntent = null;
|
|
4227
|
+
this.viaFeatureRequest = false;
|
|
4086
4228
|
}
|
|
4229
|
+
if (this.step === "category") this.showAllCategories = false;
|
|
4230
|
+
this.render();
|
|
4231
|
+
});
|
|
4232
|
+
panel.querySelector('[data-action="show-all-categories"]')?.addEventListener("click", () => {
|
|
4233
|
+
this.showAllCategories = true;
|
|
4087
4234
|
this.render();
|
|
4088
4235
|
});
|
|
4089
4236
|
panel.querySelector('[data-action="assistant"]')?.addEventListener("click", () => {
|
|
@@ -6876,6 +7023,7 @@ function createInstance(config) {
|
|
|
6876
7023
|
log.debug("Auto-capturing screenshot", { when, mode });
|
|
6877
7024
|
pendingScreenshot = await takeScreenshotWithoutChrome();
|
|
6878
7025
|
widget.setScreenshotAttached(pendingScreenshot !== null);
|
|
7026
|
+
widget.setScreenshotPreview(pendingScreenshot);
|
|
6879
7027
|
}
|
|
6880
7028
|
widget = new MushiWidget(bootstrapConfig.widget, {
|
|
6881
7029
|
onSubmit: async ({ category, userCategory, description, intent }) => {
|
|
@@ -6907,6 +7055,7 @@ function createInstance(config) {
|
|
|
6907
7055
|
log.debug("Taking screenshot");
|
|
6908
7056
|
pendingScreenshot = await takeScreenshotWithoutChrome();
|
|
6909
7057
|
widget.setScreenshotAttached(pendingScreenshot !== null);
|
|
7058
|
+
widget.setScreenshotPreview(pendingScreenshot);
|
|
6910
7059
|
},
|
|
6911
7060
|
onScreenshotRemove: () => {
|
|
6912
7061
|
log.debug("Screenshot attachment removed");
|
|
@@ -6931,6 +7080,7 @@ function createInstance(config) {
|
|
|
6931
7080
|
{
|
|
6932
7081
|
pendingScreenshot = session.getDataUrl();
|
|
6933
7082
|
widget.setScreenshotAttached(true);
|
|
7083
|
+
widget.setScreenshotPreview(pendingScreenshot);
|
|
6934
7084
|
}
|
|
6935
7085
|
session.destroy();
|
|
6936
7086
|
toolbar.remove();
|