@mushi-mushi/react-native 0.18.1 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @mushi-mushi/react-native
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a8f183e: Show the captured screenshot as a visible preview with a configurable
8
+ "remove anything sensitive" privacy caption, so reporters can see and consent to
9
+ exactly what gets sent.
10
+
11
+ - **core/types**: new `widget.screenshotSensitiveHint?: boolean | string` config.
12
+ `true` (default) shows the localized caption, a string overrides it verbatim,
13
+ `false` hides the caption (the preview + remove control always remain). Travels
14
+ in the `widget` block of `GET /v1/sdk/config`, so it's settable per-host via the
15
+ SDK and remotely via the Mushi console runtime config.
16
+ - **web/widget**: the details step now renders the attached screenshot as an
17
+ `<img>` preview (previously only a "Screenshot attached ✓" label) with an
18
+ optional privacy caption beneath it. The preview stays in sync through the
19
+ annotate/markup flow and clears when the screenshot is removed. Image `src` and
20
+ caption are HTML-escaped. New `en`/`es`/`ja`/`th` strings.
21
+ - **react-native**: the bottom sheet's existing screenshot thumbnail gains the
22
+ same configurable privacy caption, resolved by the provider from
23
+ `widget.screenshotSensitiveHint`.
24
+
25
+ This lets privacy-sensitive hosts (e.g. finance apps) enable screenshot capture
26
+ with an explicit user-facing review-and-remove step instead of disabling it
27
+ outright.
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [a8f183e]
32
+ - Updated dependencies [a8f183e]
33
+ - @mushi-mushi/core@1.19.0
34
+
3
35
  ## 0.18.1
4
36
 
5
37
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -364,7 +364,8 @@ var MushiBottomSheet = ({
364
364
  visible,
365
365
  onClose,
366
366
  screenshotDataUrl,
367
- onClearScreenshot
367
+ onClearScreenshot,
368
+ screenshotSensitiveHint
368
369
  }) => {
369
370
  const mushi = useMushiContext();
370
371
  const scheme = (0, import_react_native2.useColorScheme)();
@@ -656,7 +657,7 @@ var MushiBottomSheet = ({
656
657
  ),
657
658
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native2.View, { style: s.screenshotMeta, children: [
658
659
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [s.screenshotLabel, { color: colors.text }], children: "Screenshot attached" }),
659
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [s.screenshotSub, { color: colors.sub }], children: "Helps the team see the issue" })
660
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [s.screenshotSub, { color: colors.sub }], children: screenshotSensitiveHint && screenshotSensitiveHint.trim() ? `\u26A0 ${screenshotSensitiveHint}` : "Helps the team see the issue" })
660
661
  ] }),
661
662
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
662
663
  import_react_native2.TouchableOpacity,
@@ -1080,11 +1081,17 @@ var s2 = import_react_native3.StyleSheet.create({
1080
1081
 
1081
1082
  // src/version.ts
1082
1083
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/react-native";
1083
- var MUSHI_SDK_VERSION = "0.18.1" ? "0.18.1" : "0.17.0";
1084
+ var MUSHI_SDK_VERSION = "0.19.0" ? "0.19.0" : "0.17.0";
1084
1085
 
1085
1086
  // src/provider.tsx
1086
1087
  var import_jsx_runtime3 = require("react/jsx-runtime");
1087
1088
  var MushiContext = (0, import_react3.createContext)(null);
1089
+ var DEFAULT_SCREENSHOT_HINT = "Check the preview \u2014 remove it if any private info (balances, personal details) is visible.";
1090
+ function resolveScreenshotHint(v) {
1091
+ if (v === false) return null;
1092
+ if (typeof v === "string") return v.trim() ? v : null;
1093
+ return DEFAULT_SCREENSHOT_HINT;
1094
+ }
1088
1095
  function breadcrumbToTimelineKind(category) {
1089
1096
  switch (category) {
1090
1097
  case "navigation":
@@ -1532,7 +1539,8 @@ function MushiProvider({ children, config: configProp, ...barePropConfig }) {
1532
1539
  visible: sheetVisible,
1533
1540
  onClose: close,
1534
1541
  screenshotDataUrl: sheetScreenshot ?? void 0,
1535
- onClearScreenshot: () => setSheetScreenshot(null)
1542
+ onClearScreenshot: () => setSheetScreenshot(null),
1543
+ screenshotSensitiveHint: resolveScreenshotHint(config.widget?.screenshotSensitiveHint)
1536
1544
  }
1537
1545
  )
1538
1546
  ] });
package/dist/index.d.cts CHANGED
@@ -66,6 +66,16 @@ interface MushiRNConfig {
66
66
  left?: number;
67
67
  right?: number;
68
68
  };
69
+ /**
70
+ * Privacy nudge shown beneath the attached-screenshot preview, reminding
71
+ * the reporter to remove anything sensitive (balances, PII) before sending.
72
+ * The sheet always shows the captured image as a preview the user can
73
+ * remove; this only controls the caption.
74
+ * - `true` (default) — show the default caption.
75
+ * - string — show this custom caption.
76
+ * - `false` — hide the caption (preview + remove still show).
77
+ */
78
+ screenshotSensitiveHint?: boolean | string;
69
79
  };
70
80
  capture?: {
71
81
  console?: boolean;
@@ -220,6 +230,11 @@ interface MushiBottomSheetProps {
220
230
  screenshotDataUrl?: string;
221
231
  /** Called when the user removes the attached screenshot. */
222
232
  onClearScreenshot?: () => void;
233
+ /**
234
+ * Privacy caption shown beneath the screenshot preview. `null` hides it.
235
+ * Resolved by the provider from `widget.screenshotSensitiveHint`.
236
+ */
237
+ screenshotSensitiveHint?: string | null;
223
238
  }
224
239
  declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
225
240
 
package/dist/index.d.ts CHANGED
@@ -66,6 +66,16 @@ interface MushiRNConfig {
66
66
  left?: number;
67
67
  right?: number;
68
68
  };
69
+ /**
70
+ * Privacy nudge shown beneath the attached-screenshot preview, reminding
71
+ * the reporter to remove anything sensitive (balances, PII) before sending.
72
+ * The sheet always shows the captured image as a preview the user can
73
+ * remove; this only controls the caption.
74
+ * - `true` (default) — show the default caption.
75
+ * - string — show this custom caption.
76
+ * - `false` — hide the caption (preview + remove still show).
77
+ */
78
+ screenshotSensitiveHint?: boolean | string;
69
79
  };
70
80
  capture?: {
71
81
  console?: boolean;
@@ -220,6 +230,11 @@ interface MushiBottomSheetProps {
220
230
  screenshotDataUrl?: string;
221
231
  /** Called when the user removes the attached screenshot. */
222
232
  onClearScreenshot?: () => void;
233
+ /**
234
+ * Privacy caption shown beneath the screenshot preview. `null` hides it.
235
+ * Resolved by the provider from `widget.screenshotSensitiveHint`.
236
+ */
237
+ screenshotSensitiveHint?: string | null;
223
238
  }
224
239
  declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
225
240
 
package/dist/index.js CHANGED
@@ -358,7 +358,8 @@ var MushiBottomSheet = ({
358
358
  visible,
359
359
  onClose,
360
360
  screenshotDataUrl,
361
- onClearScreenshot
361
+ onClearScreenshot,
362
+ screenshotSensitiveHint
362
363
  }) => {
363
364
  const mushi = useMushiContext();
364
365
  const scheme = useColorScheme();
@@ -650,7 +651,7 @@ var MushiBottomSheet = ({
650
651
  ),
651
652
  /* @__PURE__ */ jsxs(View, { style: s.screenshotMeta, children: [
652
653
  /* @__PURE__ */ jsx(Text, { style: [s.screenshotLabel, { color: colors.text }], children: "Screenshot attached" }),
653
- /* @__PURE__ */ jsx(Text, { style: [s.screenshotSub, { color: colors.sub }], children: "Helps the team see the issue" })
654
+ /* @__PURE__ */ jsx(Text, { style: [s.screenshotSub, { color: colors.sub }], children: screenshotSensitiveHint && screenshotSensitiveHint.trim() ? `\u26A0 ${screenshotSensitiveHint}` : "Helps the team see the issue" })
654
655
  ] }),
655
656
  /* @__PURE__ */ jsx(
656
657
  TouchableOpacity,
@@ -1081,11 +1082,17 @@ var s2 = StyleSheet2.create({
1081
1082
 
1082
1083
  // src/version.ts
1083
1084
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/react-native";
1084
- var MUSHI_SDK_VERSION = "0.18.1" ? "0.18.1" : "0.17.0";
1085
+ var MUSHI_SDK_VERSION = "0.19.0" ? "0.19.0" : "0.17.0";
1085
1086
 
1086
1087
  // src/provider.tsx
1087
1088
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1088
1089
  var MushiContext = createContext(null);
1090
+ var DEFAULT_SCREENSHOT_HINT = "Check the preview \u2014 remove it if any private info (balances, personal details) is visible.";
1091
+ function resolveScreenshotHint(v) {
1092
+ if (v === false) return null;
1093
+ if (typeof v === "string") return v.trim() ? v : null;
1094
+ return DEFAULT_SCREENSHOT_HINT;
1095
+ }
1089
1096
  function breadcrumbToTimelineKind(category) {
1090
1097
  switch (category) {
1091
1098
  case "navigation":
@@ -1533,7 +1540,8 @@ function MushiProvider({ children, config: configProp, ...barePropConfig }) {
1533
1540
  visible: sheetVisible,
1534
1541
  onClose: close,
1535
1542
  screenshotDataUrl: sheetScreenshot ?? void 0,
1536
- onClearScreenshot: () => setSheetScreenshot(null)
1543
+ onClearScreenshot: () => setSheetScreenshot(null),
1544
+ screenshotSensitiveHint: resolveScreenshotHint(config.widget?.screenshotSensitiveHint)
1537
1545
  }
1538
1546
  )
1539
1547
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/react-native",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native SDK for Mushi Mushi — shake-to-report, bottom sheet widget, full context capture",
6
6
  "main": "./dist/index.cjs",
@@ -33,7 +33,7 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@mushi-mushi/core": "^1.17.0"
36
+ "@mushi-mushi/core": "^1.19.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^19.2.17",