@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/dist/index.d.cts CHANGED
@@ -137,10 +137,14 @@ declare class MushiWidget {
137
137
  * landing on the intent picker the user explicitly skipped.
138
138
  */
139
139
  private viaFeatureRequest;
140
+ /** Whether the category list is fully expanded (progressive disclosure). */
141
+ private showAllCategories;
140
142
  private screenshotAttached;
141
143
  private screenshotCapturing;
142
144
  private screenshotError;
143
145
  private allowScreenshotRemove;
146
+ /** Data URL of the attached screenshot, rendered as a visible preview. */
147
+ private screenshotPreview;
144
148
  private elementSelected;
145
149
  private elementCapturing;
146
150
  private submitting;
@@ -254,6 +258,15 @@ declare class MushiWidget {
254
258
  setTrigger(trigger: NonNullable<MushiWidgetConfig['trigger']>): void;
255
259
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
256
260
  setScreenshotAttached(attached: boolean): void;
261
+ /** Provide the captured screenshot data URL so the widget can preview it. */
262
+ setScreenshotPreview(dataUrl: string | null): void;
263
+ /**
264
+ * Resolve the privacy caption shown beside the screenshot preview from the
265
+ * `screenshotSensitiveHint` widget config (kept in sync via updateConfig, so
266
+ * it honours console/runtime config): `false` → hidden, a non-empty string →
267
+ * that copy, anything else (`true`/unset) → the localized default.
268
+ */
269
+ private resolveScreenshotHint;
257
270
  setAllowScreenshotRemove(allow: boolean): void;
258
271
  setElementSelected(selected: boolean): void;
259
272
  setScreenshotCapturing(capturing: boolean): void;
@@ -505,6 +518,10 @@ interface MushiLocale {
505
518
  screenshotAttached: string;
506
519
  screenshotCapturing: string;
507
520
  screenshotFailed: string;
521
+ /** Alt text for the attached-screenshot preview image. */
522
+ screenshotPreviewAlt: string;
523
+ /** Default privacy caption shown beside the screenshot preview. */
524
+ screenshotSensitiveHint: string;
508
525
  elementButton: string;
509
526
  elementSelected: string;
510
527
  elementCapturing: string;
package/dist/index.d.ts CHANGED
@@ -137,10 +137,14 @@ declare class MushiWidget {
137
137
  * landing on the intent picker the user explicitly skipped.
138
138
  */
139
139
  private viaFeatureRequest;
140
+ /** Whether the category list is fully expanded (progressive disclosure). */
141
+ private showAllCategories;
140
142
  private screenshotAttached;
141
143
  private screenshotCapturing;
142
144
  private screenshotError;
143
145
  private allowScreenshotRemove;
146
+ /** Data URL of the attached screenshot, rendered as a visible preview. */
147
+ private screenshotPreview;
144
148
  private elementSelected;
145
149
  private elementCapturing;
146
150
  private submitting;
@@ -254,6 +258,15 @@ declare class MushiWidget {
254
258
  setTrigger(trigger: NonNullable<MushiWidgetConfig['trigger']>): void;
255
259
  attachTo(selectorOrElement: string | Element, options?: MushiWidgetConfig): () => void;
256
260
  setScreenshotAttached(attached: boolean): void;
261
+ /** Provide the captured screenshot data URL so the widget can preview it. */
262
+ setScreenshotPreview(dataUrl: string | null): void;
263
+ /**
264
+ * Resolve the privacy caption shown beside the screenshot preview from the
265
+ * `screenshotSensitiveHint` widget config (kept in sync via updateConfig, so
266
+ * it honours console/runtime config): `false` → hidden, a non-empty string →
267
+ * that copy, anything else (`true`/unset) → the localized default.
268
+ */
269
+ private resolveScreenshotHint;
257
270
  setAllowScreenshotRemove(allow: boolean): void;
258
271
  setElementSelected(selected: boolean): void;
259
272
  setScreenshotCapturing(capturing: boolean): void;
@@ -505,6 +518,10 @@ interface MushiLocale {
505
518
  screenshotAttached: string;
506
519
  screenshotCapturing: string;
507
520
  screenshotFailed: string;
521
+ /** Alt text for the attached-screenshot preview image. */
522
+ screenshotPreviewAlt: string;
523
+ /** Default privacy caption shown beside the screenshot preview. */
524
+ screenshotSensitiveHint: string;
508
525
  elementButton: string;
509
526
  elementSelected: string;
510
527
  elementCapturing: string;
package/dist/index.js CHANGED
@@ -82,6 +82,8 @@ var en = {
82
82
  screenshotAttached: "Screenshot attached \u2713",
83
83
  screenshotCapturing: "Taking screenshot\u2026",
84
84
  screenshotFailed: "Couldn't capture \u2014 describe it instead",
85
+ screenshotPreviewAlt: "Preview of the screenshot that will be sent",
86
+ screenshotSensitiveHint: "Check the preview \u2014 remove it if any private info (balances, personal details) is visible.",
85
87
  elementButton: "Select Element",
86
88
  elementSelected: "Element selected \u2713",
87
89
  elementCapturing: "Click anything on the page\u2026",
@@ -142,6 +144,8 @@ var ja = {
142
144
  screenshotAttached: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8\u6E08\u307F \u2713",
143
145
  screenshotCapturing: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u64AE\u5F71\u4E2D\u2026",
144
146
  screenshotFailed: "\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F \u2014 \u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044",
147
+ screenshotPreviewAlt: "\u9001\u4FE1\u3055\u308C\u308B\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
148
+ 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",
145
149
  elementButton: "\u8981\u7D20\u3092\u9078\u629E",
146
150
  elementSelected: "\u8981\u7D20\u9078\u629E\u6E08\u307F \u2713",
147
151
  elementCapturing: "\u30DA\u30FC\u30B8\u4E0A\u306E\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF\u2026",
@@ -202,6 +206,8 @@ var th = {
202
206
  screenshotAttached: "\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E41\u0E25\u0E49\u0E27 \u2713",
203
207
  screenshotCapturing: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E16\u0E48\u0E32\u0E22\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u2026",
204
208
  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",
209
+ 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",
210
+ 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",
205
211
  elementButton: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A",
206
212
  elementSelected: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E41\u0E25\u0E49\u0E27 \u2713",
207
213
  elementCapturing: "\u0E04\u0E25\u0E34\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E1A\u0E19\u0E2B\u0E19\u0E49\u0E32\u2026",
@@ -262,6 +268,8 @@ var es = {
262
268
  screenshotAttached: "Captura adjunta \u2713",
263
269
  screenshotCapturing: "Tomando captura\u2026",
264
270
  screenshotFailed: "No se pudo capturar \u2014 descr\xEDbelo en su lugar",
271
+ screenshotPreviewAlt: "Vista previa de la captura que se enviar\xE1",
272
+ screenshotSensitiveHint: "Revisa la vista previa \u2014 qu\xEDtala si se ve informaci\xF3n privada (saldos, datos personales).",
265
273
  elementButton: "Seleccionar elemento",
266
274
  elementSelected: "Elemento seleccionado \u2713",
267
275
  elementCapturing: "Haz clic en cualquier elemento\u2026",
@@ -485,9 +493,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
485
493
 
486
494
  .mushi-panel {
487
495
  position: fixed;
488
- width: 384px;
496
+ width: 360px;
489
497
  max-width: calc(100vw - 32px);
490
- max-height: min(640px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
498
+ max-height: min(480px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
491
499
  background: ${paper};
492
500
  border: 1px solid ${ruleStrong};
493
501
  border-radius: 6px;
@@ -573,12 +581,12 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
573
581
  }
574
582
 
575
583
  .mushi-header {
576
- padding: 18px 20px 14px;
584
+ padding: 13px 18px 10px;
577
585
  border-bottom: 1px solid ${rule};
578
586
  display: grid;
579
587
  grid-template-columns: auto 1fr auto;
580
588
  align-items: end;
581
- gap: 12px;
589
+ gap: 10px;
582
590
  }
583
591
  .mushi-header-mark {
584
592
  display: inline-flex;
@@ -653,17 +661,22 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
653
661
  background: none;
654
662
  border: none;
655
663
  cursor: pointer;
656
- padding: 0;
664
+ padding: 3px 0;
657
665
  margin: 0 0 2px;
666
+ min-height: 22px;
658
667
  color: ${inkMuted};
659
668
  font-family: ${fontMono};
660
- font-size: 10px;
669
+ font-size: 11px;
661
670
  font-weight: 500;
662
- letter-spacing: 0.12em;
671
+ letter-spacing: 0.06em;
663
672
  text-transform: uppercase;
664
673
  line-height: 1.2;
665
674
  border-radius: 0;
675
+ display: inline-flex;
676
+ align-items: center;
677
+ gap: 4px;
666
678
  transition: color 150ms ${easeStamp};
679
+ white-space: nowrap;
667
680
  }
668
681
  .mushi-close:hover { color: ${widgetAccent}; }
669
682
  .mushi-back:hover { color: ${ink}; }
@@ -696,9 +709,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
696
709
  display: grid;
697
710
  grid-template-columns: auto 1fr auto;
698
711
  align-items: center;
699
- gap: 14px;
712
+ gap: 12px;
700
713
  width: 100%;
701
- padding: 14px 0;
714
+ padding: 11px 0;
702
715
  border: none;
703
716
  border-bottom: 1px solid ${rule};
704
717
  background: transparent;
@@ -1095,6 +1108,30 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1095
1108
  .mushi-annotate-host:empty {
1096
1109
  margin-top: 0;
1097
1110
  }
1111
+ .mushi-screenshot-preview {
1112
+ margin: 10px 0 0;
1113
+ display: flex;
1114
+ flex-direction: column;
1115
+ gap: 6px;
1116
+ }
1117
+ .mushi-screenshot-preview img {
1118
+ display: block;
1119
+ max-width: 100%;
1120
+ max-height: 160px;
1121
+ width: auto;
1122
+ border: 1px solid ${ruleStrong};
1123
+ border-radius: 3px;
1124
+ object-fit: contain;
1125
+ align-self: flex-start;
1126
+ }
1127
+ .mushi-screenshot-hint {
1128
+ margin: 0;
1129
+ color: ${inkMuted};
1130
+ font-family: ${fontMono};
1131
+ font-size: 10.5px;
1132
+ line-height: 1.4;
1133
+ letter-spacing: 0.02em;
1134
+ }
1098
1135
  .mushi-annotate-toolbar {
1099
1136
  display: flex;
1100
1137
  flex-wrap: wrap;
@@ -1922,6 +1959,56 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1922
1959
 
1923
1960
  .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}
1924
1961
  .mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
1962
+ /* \u2500\u2500 "More issue types \u2192" toggle (progressive disclosure) \u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1963
+ .mushi-more-toggle {
1964
+ display: flex;
1965
+ align-items: center;
1966
+ gap: 8px;
1967
+ width: 100%;
1968
+ padding: 11px 0;
1969
+ border: none;
1970
+ border-top: 1px dashed ${rule};
1971
+ background: transparent;
1972
+ cursor: pointer;
1973
+ color: ${inkMuted};
1974
+ font-family: ${fontBody};
1975
+ font-size: 13px;
1976
+ text-align: left;
1977
+ transition: color 180ms ${easeStamp};
1978
+ }
1979
+ .mushi-more-toggle:hover { color: ${widgetAccent}; }
1980
+ .mushi-more-toggle:hover .mushi-more-toggle-arrow { transform: translateX(3px); }
1981
+ .mushi-more-toggle-text { flex: 1; }
1982
+ .mushi-more-toggle-count {
1983
+ font-family: ${fontMono};
1984
+ font-size: 10px;
1985
+ letter-spacing: 0.08em;
1986
+ text-transform: uppercase;
1987
+ color: ${inkFaint};
1988
+ background: ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.06)"};
1989
+ padding: 2px 6px;
1990
+ border-radius: 10px;
1991
+ }
1992
+ .mushi-more-toggle-arrow {
1993
+ font-size: 14px;
1994
+ opacity: 0.5;
1995
+ transition: transform 180ms ${easeStamp};
1996
+ }
1997
+ /* \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 */
1998
+ @keyframes mushi-step-in {
1999
+ 0% { opacity: 0; transform: translateX(8px); }
2000
+ 100% { opacity: 1; transform: translateX(0); }
2001
+ }
2002
+ .mushi-body {
2003
+ animation: mushi-step-in 160ms ease both;
2004
+ }
2005
+ @media (prefers-reduced-motion: reduce) {
2006
+ .mushi-body { animation: none; }
2007
+ }
2008
+ /* Expanded secondary categories animate in */
2009
+ .mushi-categories-expanded {
2010
+ animation: mushi-step-in 180ms ease both;
2011
+ }
1925
2012
  .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}
1926
2013
  .mushi-link-btn:hover{opacity:0.8}
1927
2014
  .mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}
@@ -1962,7 +2049,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1962
2049
 
1963
2050
  // src/version.ts
1964
2051
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
1965
- var MUSHI_SDK_VERSION = "1.17.0" ;
2052
+ var MUSHI_SDK_VERSION = "1.19.0" ;
1966
2053
 
1967
2054
  // src/widget-helpers.ts
1968
2055
  var CATEGORY_ICONS = {
@@ -2165,7 +2252,7 @@ function renderBrandFooter(ctx) {
2165
2252
  function renderHeader(ctx, opts) {
2166
2253
  const t = ctx.locale;
2167
2254
  const { title, showBack = false, step, eyebrow } = opts;
2168
- 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>`;
2255
+ 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>`;
2169
2256
  const counterHtml = step ? `<span class="mushi-step-counter" aria-label="Step ${step} of ${TOTAL_STEPS}"><b>${pad2(step)}</b> / ${pad2(TOTAL_STEPS)}</span>` : "";
2170
2257
  return `
2171
2258
  <div class="mushi-header">
@@ -2176,7 +2263,7 @@ function renderHeader(ctx, opts) {
2176
2263
  </div>
2177
2264
  <div class="mushi-header-meta">
2178
2265
  ${counterHtml}
2179
- <button type="button" class="mushi-close" data-action="close" aria-label="${t.widget.close}">\u2715</button>
2266
+ <button type="button" class="mushi-close" data-action="close" aria-label="${escapeHtml(t.widget.close)}">\u2715</button>
2180
2267
  </div>
2181
2268
  </div>
2182
2269
  `;
@@ -2203,20 +2290,32 @@ function renderCategoryStep(ctx) {
2203
2290
  label: t.step1.categories[id],
2204
2291
  desc: t.step1.categoryDescriptions[id]
2205
2292
  }));
2206
- const categories = categoryEntries.map(({ id, icon, label, desc }) => `
2207
- <button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
2208
- <span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
2209
- <div class="mushi-option-text">
2210
- <span class="mushi-option-label">${escapeHtml(label)}</span>
2211
- ${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
2212
- </div>
2213
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2214
- </button>
2215
- `).join("");
2293
+ const renderEntry = ({ id, icon, label, desc }) => `
2294
+ <button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
2295
+ <span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
2296
+ <div class="mushi-option-text">
2297
+ <span class="mushi-option-label">${escapeHtml(label)}</span>
2298
+ ${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
2299
+ </div>
2300
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2301
+ </button>
2302
+ `;
2303
+ const isCustom = ctx.config.categories && ctx.config.categories.length > 0;
2304
+ const PRIMARY_LIMIT = 1;
2305
+ const primaryEntries = isCustom ? categoryEntries : categoryEntries.slice(0, PRIMARY_LIMIT);
2306
+ const secondaryEntries = isCustom ? [] : categoryEntries.slice(PRIMARY_LIMIT);
2307
+ const hasMore = secondaryEntries.length > 0;
2308
+ const primaryCategories = primaryEntries.map(renderEntry).join("");
2309
+ const secondaryCategories = secondaryEntries.map(renderEntry).join("");
2310
+ const secondaryHtml = hasMore ? ctx.showAllCategories ? `<div class="mushi-categories-expanded">${secondaryCategories}</div>` : `<button type="button" class="mushi-more-toggle" data-action="show-all-categories">
2311
+ <span class="mushi-more-toggle-text">More issue types</span>
2312
+ <span class="mushi-more-toggle-count">${secondaryEntries.length} more</span>
2313
+ <span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
2314
+ </button>` : "";
2216
2315
  return `
2217
2316
  ${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
2218
2317
  ${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
2219
- <div class="mushi-body" role="radiogroup" aria-label="${t.step1.heading}">
2318
+ <div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
2220
2319
  <button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
2221
2320
  <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
2222
2321
  <div class="mushi-option-text">
@@ -2235,7 +2334,8 @@ function renderCategoryStep(ctx) {
2235
2334
  </div>
2236
2335
  <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2237
2336
  </button>` : ""}
2238
- ${categories}
2337
+ ${primaryCategories}
2338
+ ${secondaryHtml}
2239
2339
  ${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
2240
2340
  <div class="mushi-community-footer">
2241
2341
  <button type="button" class="mushi-link-btn mushi-community-btn" data-action="open-account">
@@ -2576,9 +2676,9 @@ function renderDetailsStep(ctx) {
2576
2676
  <div class="mushi-textarea-wrap">
2577
2677
  <textarea
2578
2678
  class="mushi-textarea"
2579
- placeholder="${t.step3.descriptionPlaceholder}"
2679
+ placeholder="${escapeHtml(t.step3.descriptionPlaceholder)}"
2580
2680
  rows="4"
2581
- aria-label="${t.step3.heading}"
2681
+ aria-label="${escapeHtml(t.step3.heading)}"
2582
2682
  autofocus
2583
2683
  ></textarea>
2584
2684
  <div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">
@@ -2605,6 +2705,10 @@ function renderDetailsStep(ctx) {
2605
2705
  ${escapeHtml(elementLabel)}
2606
2706
  </button>
2607
2707
  </div>
2708
+ ${ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview">
2709
+ <img src="${escapeHtml(ctx.screenshotPreview)}" alt="${escapeHtml(t.step3.screenshotPreviewAlt)}" />
2710
+ ${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
2711
+ </figure>` : ""}
2608
2712
  <div class="mushi-error" style="display:none" role="alert"></div>
2609
2713
  </div>
2610
2714
  <div class="mushi-footer">
@@ -2622,7 +2726,7 @@ function renderSuccessStep(ctx) {
2622
2726
  const stamp = ctx.submittedAt ?? /* @__PURE__ */ new Date();
2623
2727
  const time = stamp.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false });
2624
2728
  return `
2625
- ${renderHeader(ctx, { title: t.widget.title, eyebrow: "Mushi \xB7 Receipt" })}
2729
+ ${renderHeader(ctx, { title: t.widget.title, showBack: true, eyebrow: "Mushi \xB7 Receipt" })}
2626
2730
  <div class="mushi-body">
2627
2731
  <div class="mushi-success">
2628
2732
  <div class="mushi-success-stamp" aria-hidden="true">
@@ -2797,6 +2901,7 @@ var MushiWidget = class _MushiWidget {
2797
2901
  draggable: config.draggable ?? false,
2798
2902
  brandFooter: config.brandFooter ?? true,
2799
2903
  outdatedBanner: config.outdatedBanner ?? "auto",
2904
+ screenshotSensitiveHint: config.screenshotSensitiveHint ?? true,
2800
2905
  betaMode: config.betaMode ?? {},
2801
2906
  minDescriptionLength: config.minDescriptionLength ?? 20,
2802
2907
  dashboardUrl: config.dashboardUrl ?? "",
@@ -2837,10 +2942,14 @@ var MushiWidget = class _MushiWidget {
2837
2942
  * landing on the intent picker the user explicitly skipped.
2838
2943
  */
2839
2944
  viaFeatureRequest = false;
2945
+ /** Whether the category list is fully expanded (progressive disclosure). */
2946
+ showAllCategories = false;
2840
2947
  screenshotAttached = false;
2841
2948
  screenshotCapturing = false;
2842
2949
  screenshotError = false;
2843
2950
  allowScreenshotRemove = true;
2951
+ /** Data URL of the attached screenshot, rendered as a visible preview. */
2952
+ screenshotPreview = null;
2844
2953
  elementSelected = false;
2845
2954
  elementCapturing = false;
2846
2955
  submitting = false;
@@ -2952,6 +3061,7 @@ var MushiWidget = class _MushiWidget {
2952
3061
  ...config.draggable !== void 0 ? { draggable: config.draggable } : {},
2953
3062
  ...config.brandFooter !== void 0 ? { brandFooter: config.brandFooter } : {},
2954
3063
  ...config.outdatedBanner !== void 0 ? { outdatedBanner: config.outdatedBanner } : {},
3064
+ ...config.screenshotSensitiveHint !== void 0 ? { screenshotSensitiveHint: config.screenshotSensitiveHint } : {},
2955
3065
  ...config.betaMode !== void 0 ? { betaMode: config.betaMode } : {},
2956
3066
  ...config.minDescriptionLength !== void 0 ? { minDescriptionLength: config.minDescriptionLength } : {},
2957
3067
  ...config.dashboardUrl !== void 0 ? { dashboardUrl: config.dashboardUrl } : {},
@@ -3007,6 +3117,7 @@ var MushiWidget = class _MushiWidget {
3007
3117
  this.screenshotAttached = false;
3008
3118
  this.screenshotCapturing = false;
3009
3119
  this.screenshotError = false;
3120
+ this.screenshotPreview = null;
3010
3121
  this.elementSelected = false;
3011
3122
  this.elementCapturing = false;
3012
3123
  this.submitting = false;
@@ -3044,6 +3155,7 @@ var MushiWidget = class _MushiWidget {
3044
3155
  close() {
3045
3156
  if (!this.isOpen) return;
3046
3157
  this.isOpen = false;
3158
+ this.showAllCategories = false;
3047
3159
  this.render();
3048
3160
  this.callbacks.onClose();
3049
3161
  }
@@ -3144,8 +3256,26 @@ var MushiWidget = class _MushiWidget {
3144
3256
  }
3145
3257
  setScreenshotAttached(attached) {
3146
3258
  this.screenshotAttached = attached;
3259
+ if (!attached) this.screenshotPreview = null;
3260
+ if (this.isOpen) this.render();
3261
+ }
3262
+ /** Provide the captured screenshot data URL so the widget can preview it. */
3263
+ setScreenshotPreview(dataUrl) {
3264
+ this.screenshotPreview = dataUrl;
3147
3265
  if (this.isOpen) this.render();
3148
3266
  }
3267
+ /**
3268
+ * Resolve the privacy caption shown beside the screenshot preview from the
3269
+ * `screenshotSensitiveHint` widget config (kept in sync via updateConfig, so
3270
+ * it honours console/runtime config): `false` → hidden, a non-empty string →
3271
+ * that copy, anything else (`true`/unset) → the localized default.
3272
+ */
3273
+ resolveScreenshotHint() {
3274
+ const v = this.config.screenshotSensitiveHint;
3275
+ if (v === false) return null;
3276
+ if (typeof v === "string") return v.trim() ? v : null;
3277
+ return this.locale.step3.screenshotSensitiveHint;
3278
+ }
3149
3279
  setAllowScreenshotRemove(allow) {
3150
3280
  this.allowScreenshotRemove = allow;
3151
3281
  if (this.isOpen) this.render();
@@ -4014,6 +4144,8 @@ var MushiWidget = class _MushiWidget {
4014
4144
  testerInfo: this.testerInfo,
4015
4145
  screenshotCapturing: this.screenshotCapturing,
4016
4146
  screenshotAttached: this.screenshotAttached,
4147
+ screenshotPreview: this.screenshotPreview,
4148
+ screenshotHint: this.resolveScreenshotHint(),
4017
4149
  reporterError: this.reporterError,
4018
4150
  magicLinkError: this.magicLinkError,
4019
4151
  elementCapturing: this.elementCapturing,
@@ -4050,7 +4182,8 @@ var MushiWidget = class _MushiWidget {
4050
4182
  categoryIcon: (id) => this.categoryIcon(id),
4051
4183
  assistantTurns: this.assistantTurns,
4052
4184
  assistantSending: this.assistantSending,
4053
- assistantError: this.assistantError
4185
+ assistantError: this.assistantError,
4186
+ showAllCategories: this.showAllCategories
4054
4187
  };
4055
4188
  }
4056
4189
  attachHandlers(panel) {
@@ -4081,7 +4214,21 @@ var MushiWidget = class _MushiWidget {
4081
4214
  this.step = "category";
4082
4215
  } else if (this.step === "assistant") {
4083
4216
  this.step = "category";
4217
+ } else if (this.step === "account") {
4218
+ this.step = "category";
4219
+ } else if (this.step === "cross-app-reports") {
4220
+ this.step = "account";
4221
+ } else if (this.step === "success") {
4222
+ this.step = "category";
4223
+ this.selectedCategory = null;
4224
+ this.selectedIntent = null;
4225
+ this.viaFeatureRequest = false;
4084
4226
  }
4227
+ if (this.step === "category") this.showAllCategories = false;
4228
+ this.render();
4229
+ });
4230
+ panel.querySelector('[data-action="show-all-categories"]')?.addEventListener("click", () => {
4231
+ this.showAllCategories = true;
4085
4232
  this.render();
4086
4233
  });
4087
4234
  panel.querySelector('[data-action="assistant"]')?.addEventListener("click", () => {
@@ -6874,6 +7021,7 @@ function createInstance(config) {
6874
7021
  log.debug("Auto-capturing screenshot", { when, mode });
6875
7022
  pendingScreenshot = await takeScreenshotWithoutChrome();
6876
7023
  widget.setScreenshotAttached(pendingScreenshot !== null);
7024
+ widget.setScreenshotPreview(pendingScreenshot);
6877
7025
  }
6878
7026
  widget = new MushiWidget(bootstrapConfig.widget, {
6879
7027
  onSubmit: async ({ category, userCategory, description, intent }) => {
@@ -6905,6 +7053,7 @@ function createInstance(config) {
6905
7053
  log.debug("Taking screenshot");
6906
7054
  pendingScreenshot = await takeScreenshotWithoutChrome();
6907
7055
  widget.setScreenshotAttached(pendingScreenshot !== null);
7056
+ widget.setScreenshotPreview(pendingScreenshot);
6908
7057
  },
6909
7058
  onScreenshotRemove: () => {
6910
7059
  log.debug("Screenshot attachment removed");
@@ -6929,6 +7078,7 @@ function createInstance(config) {
6929
7078
  {
6930
7079
  pendingScreenshot = session.getDataUrl();
6931
7080
  widget.setScreenshotAttached(true);
7081
+ widget.setScreenshotPreview(pendingScreenshot);
6932
7082
  }
6933
7083
  session.destroy();
6934
7084
  toolbar.remove();