@mushi-mushi/react-native 0.19.1 → 0.20.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 +32 -0
- package/CONTRIBUTING.md +14 -2
- package/README.md +0 -1
- package/SECURITY.md +1 -1
- package/dist/index.cjs +394 -122
- package/dist/index.d.cts +56 -3
- package/dist/index.d.ts +56 -3
- package/dist/index.js +360 -84
- package/package.json +9 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, FC, ReactElement } from 'react';
|
|
3
|
-
import { MushiRewardsConfig, MushiPageContext, MushiBreadcrumb, MushiReporterReport, MushiReporterComment, MushiHallOfFameEntry, MushiTierResult, MushiReputationResult } from '@mushi-mushi/core';
|
|
3
|
+
import { MushiRewardsConfig, MushiPageContext, MushiBreadcrumb, MushiReporterReport, MushiReporterComment, MushiHallOfFameEntry, MushiTierResult, MushiReputationResult, MushiAssistantReply } from '@mushi-mushi/core';
|
|
4
4
|
export { MushiHallOfFameEntry, MushiReporterComment, MushiReporterReport } from '@mushi-mushi/core';
|
|
5
5
|
|
|
6
6
|
interface ConsoleEntry {
|
|
@@ -58,7 +58,7 @@ interface MushiRNConfig {
|
|
|
58
58
|
onFixStatusChanged?: (reportId: string, status: string) => void;
|
|
59
59
|
};
|
|
60
60
|
widget?: {
|
|
61
|
-
trigger?: 'shake' | 'button' | 'both' | 'manual' | 'auto' | 'edge-tab' | 'hidden' | 'attach';
|
|
61
|
+
trigger?: 'shake' | 'button' | 'both' | 'manual' | 'auto' | 'banner' | 'edge-tab' | 'hidden' | 'attach';
|
|
62
62
|
shakeThreshold?: number;
|
|
63
63
|
buttonPosition?: 'bottom-right' | 'bottom-left';
|
|
64
64
|
inset?: {
|
|
@@ -76,6 +76,19 @@ interface MushiRNConfig {
|
|
|
76
76
|
* - `false` — hide the caption (preview + remove still show).
|
|
77
77
|
*/
|
|
78
78
|
screenshotSensitiveHint?: boolean | string;
|
|
79
|
+
/** Banner strip when trigger is `banner` (web parity). */
|
|
80
|
+
banner?: {
|
|
81
|
+
message?: string;
|
|
82
|
+
label?: string;
|
|
83
|
+
};
|
|
84
|
+
/** Poll interval (ms) for My Reports while the inbox tab is open. 0 = off (default). */
|
|
85
|
+
inboxPollIntervalMs?: number;
|
|
86
|
+
};
|
|
87
|
+
assistant?: {
|
|
88
|
+
enabled?: boolean;
|
|
89
|
+
label?: string;
|
|
90
|
+
greeting?: string;
|
|
91
|
+
suggestions?: string[];
|
|
79
92
|
};
|
|
80
93
|
capture?: {
|
|
81
94
|
console?: boolean;
|
|
@@ -177,6 +190,10 @@ interface MushiRNInstance {
|
|
|
177
190
|
getTier(): Promise<MushiTierResult | null>;
|
|
178
191
|
/** Returns the current user's reputation + point totals. */
|
|
179
192
|
getReputation(): Promise<MushiReputationResult | null>;
|
|
193
|
+
/** Open the sheet on the Ask tab when assistant is enabled. */
|
|
194
|
+
openAssistant(): void;
|
|
195
|
+
/** One assistant turn — uses published page context when available. */
|
|
196
|
+
askAssistant(message: string, threadId?: string | null): Promise<MushiAssistantReply | null>;
|
|
180
197
|
}
|
|
181
198
|
declare function MushiProvider({ children, config: configProp, ...barePropConfig }: MushiRNConfig & {
|
|
182
199
|
children: ReactNode;
|
|
@@ -228,6 +245,8 @@ declare function useMushiWidget(): {
|
|
|
228
245
|
interface MushiBottomSheetProps {
|
|
229
246
|
visible: boolean;
|
|
230
247
|
onClose: () => void;
|
|
248
|
+
/** Tab to select when the sheet opens (controlled by MushiProvider). */
|
|
249
|
+
preferredTab?: 'report' | 'inbox' | 'assistant';
|
|
231
250
|
/** Base64 data-URI of the screenshot captured before the sheet opened. Optional. */
|
|
232
251
|
screenshotDataUrl?: string;
|
|
233
252
|
/** Called when the user removes the attached screenshot. */
|
|
@@ -237,6 +256,13 @@ interface MushiBottomSheetProps {
|
|
|
237
256
|
* Resolved by the provider from `widget.screenshotSensitiveHint`.
|
|
238
257
|
*/
|
|
239
258
|
screenshotSensitiveHint?: string | null;
|
|
259
|
+
/** When true, renders an Ask tab with page-aware assistant (web parity). */
|
|
260
|
+
assistantEnabled?: boolean;
|
|
261
|
+
assistantLabel?: string;
|
|
262
|
+
assistantGreeting?: string;
|
|
263
|
+
assistantSuggestions?: string[];
|
|
264
|
+
/** Poll My Reports while inbox tab is open. 0 disables polling. */
|
|
265
|
+
inboxPollIntervalMs?: number;
|
|
240
266
|
}
|
|
241
267
|
declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
|
|
242
268
|
|
|
@@ -275,6 +301,33 @@ interface MushiFloatingButtonProps {
|
|
|
275
301
|
}
|
|
276
302
|
declare const MushiFloatingButton: FC<MushiFloatingButtonProps>;
|
|
277
303
|
|
|
304
|
+
/**
|
|
305
|
+
* FILE: MushiBanner.tsx
|
|
306
|
+
* PURPOSE: Native bottom strip launcher — parity with web `trigger: 'banner'`.
|
|
307
|
+
*
|
|
308
|
+
* OVERVIEW:
|
|
309
|
+
* - Fixed neon strip using shared MUSHI_BANNER_NEON tokens from @mushi-mushi/core
|
|
310
|
+
* - Tap opens the report sheet; optional dismiss hides until next cold start
|
|
311
|
+
* - Reports layout height so Capacitor/RN hosts can pad content (banner-offset contract)
|
|
312
|
+
*
|
|
313
|
+
* DEPENDENCIES:
|
|
314
|
+
* - @mushi-mushi/core (MUSHI_BANNER_NEON, MUSHI_COPY, MUSHI_GEOMETRY)
|
|
315
|
+
*
|
|
316
|
+
* USAGE:
|
|
317
|
+
* - Rendered by MushiProvider when widget.trigger === 'banner'
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
interface MushiBannerProps {
|
|
321
|
+
onPress: () => void;
|
|
322
|
+
onDismiss?: () => void;
|
|
323
|
+
message?: string;
|
|
324
|
+
label?: string;
|
|
325
|
+
/** Fires with measured banner height (px) for host safe-area / inset padding. */
|
|
326
|
+
onLayoutHeight?: (height: number) => void;
|
|
327
|
+
}
|
|
328
|
+
declare const MUSHI_BANNER_DEFAULT_HEIGHT: 36;
|
|
329
|
+
declare const MushiBanner: FC<MushiBannerProps>;
|
|
330
|
+
|
|
278
331
|
interface MushiTriggerProps {
|
|
279
332
|
/** A single React Native element that accepts `onPress`. */
|
|
280
333
|
children: ReactElement<{
|
|
@@ -333,4 +386,4 @@ declare class AsyncStorageQueue {
|
|
|
333
386
|
private getAsyncStorage;
|
|
334
387
|
}
|
|
335
388
|
|
|
336
|
-
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, MushiTrigger, type MushiTriggerProps, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
|
389
|
+
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MUSHI_BANNER_DEFAULT_HEIGHT, MushiBanner, type MushiBannerProps, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, MushiTrigger, type MushiTriggerProps, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, FC, ReactElement } from 'react';
|
|
3
|
-
import { MushiRewardsConfig, MushiPageContext, MushiBreadcrumb, MushiReporterReport, MushiReporterComment, MushiHallOfFameEntry, MushiTierResult, MushiReputationResult } from '@mushi-mushi/core';
|
|
3
|
+
import { MushiRewardsConfig, MushiPageContext, MushiBreadcrumb, MushiReporterReport, MushiReporterComment, MushiHallOfFameEntry, MushiTierResult, MushiReputationResult, MushiAssistantReply } from '@mushi-mushi/core';
|
|
4
4
|
export { MushiHallOfFameEntry, MushiReporterComment, MushiReporterReport } from '@mushi-mushi/core';
|
|
5
5
|
|
|
6
6
|
interface ConsoleEntry {
|
|
@@ -58,7 +58,7 @@ interface MushiRNConfig {
|
|
|
58
58
|
onFixStatusChanged?: (reportId: string, status: string) => void;
|
|
59
59
|
};
|
|
60
60
|
widget?: {
|
|
61
|
-
trigger?: 'shake' | 'button' | 'both' | 'manual' | 'auto' | 'edge-tab' | 'hidden' | 'attach';
|
|
61
|
+
trigger?: 'shake' | 'button' | 'both' | 'manual' | 'auto' | 'banner' | 'edge-tab' | 'hidden' | 'attach';
|
|
62
62
|
shakeThreshold?: number;
|
|
63
63
|
buttonPosition?: 'bottom-right' | 'bottom-left';
|
|
64
64
|
inset?: {
|
|
@@ -76,6 +76,19 @@ interface MushiRNConfig {
|
|
|
76
76
|
* - `false` — hide the caption (preview + remove still show).
|
|
77
77
|
*/
|
|
78
78
|
screenshotSensitiveHint?: boolean | string;
|
|
79
|
+
/** Banner strip when trigger is `banner` (web parity). */
|
|
80
|
+
banner?: {
|
|
81
|
+
message?: string;
|
|
82
|
+
label?: string;
|
|
83
|
+
};
|
|
84
|
+
/** Poll interval (ms) for My Reports while the inbox tab is open. 0 = off (default). */
|
|
85
|
+
inboxPollIntervalMs?: number;
|
|
86
|
+
};
|
|
87
|
+
assistant?: {
|
|
88
|
+
enabled?: boolean;
|
|
89
|
+
label?: string;
|
|
90
|
+
greeting?: string;
|
|
91
|
+
suggestions?: string[];
|
|
79
92
|
};
|
|
80
93
|
capture?: {
|
|
81
94
|
console?: boolean;
|
|
@@ -177,6 +190,10 @@ interface MushiRNInstance {
|
|
|
177
190
|
getTier(): Promise<MushiTierResult | null>;
|
|
178
191
|
/** Returns the current user's reputation + point totals. */
|
|
179
192
|
getReputation(): Promise<MushiReputationResult | null>;
|
|
193
|
+
/** Open the sheet on the Ask tab when assistant is enabled. */
|
|
194
|
+
openAssistant(): void;
|
|
195
|
+
/** One assistant turn — uses published page context when available. */
|
|
196
|
+
askAssistant(message: string, threadId?: string | null): Promise<MushiAssistantReply | null>;
|
|
180
197
|
}
|
|
181
198
|
declare function MushiProvider({ children, config: configProp, ...barePropConfig }: MushiRNConfig & {
|
|
182
199
|
children: ReactNode;
|
|
@@ -228,6 +245,8 @@ declare function useMushiWidget(): {
|
|
|
228
245
|
interface MushiBottomSheetProps {
|
|
229
246
|
visible: boolean;
|
|
230
247
|
onClose: () => void;
|
|
248
|
+
/** Tab to select when the sheet opens (controlled by MushiProvider). */
|
|
249
|
+
preferredTab?: 'report' | 'inbox' | 'assistant';
|
|
231
250
|
/** Base64 data-URI of the screenshot captured before the sheet opened. Optional. */
|
|
232
251
|
screenshotDataUrl?: string;
|
|
233
252
|
/** Called when the user removes the attached screenshot. */
|
|
@@ -237,6 +256,13 @@ interface MushiBottomSheetProps {
|
|
|
237
256
|
* Resolved by the provider from `widget.screenshotSensitiveHint`.
|
|
238
257
|
*/
|
|
239
258
|
screenshotSensitiveHint?: string | null;
|
|
259
|
+
/** When true, renders an Ask tab with page-aware assistant (web parity). */
|
|
260
|
+
assistantEnabled?: boolean;
|
|
261
|
+
assistantLabel?: string;
|
|
262
|
+
assistantGreeting?: string;
|
|
263
|
+
assistantSuggestions?: string[];
|
|
264
|
+
/** Poll My Reports while inbox tab is open. 0 disables polling. */
|
|
265
|
+
inboxPollIntervalMs?: number;
|
|
240
266
|
}
|
|
241
267
|
declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
|
|
242
268
|
|
|
@@ -275,6 +301,33 @@ interface MushiFloatingButtonProps {
|
|
|
275
301
|
}
|
|
276
302
|
declare const MushiFloatingButton: FC<MushiFloatingButtonProps>;
|
|
277
303
|
|
|
304
|
+
/**
|
|
305
|
+
* FILE: MushiBanner.tsx
|
|
306
|
+
* PURPOSE: Native bottom strip launcher — parity with web `trigger: 'banner'`.
|
|
307
|
+
*
|
|
308
|
+
* OVERVIEW:
|
|
309
|
+
* - Fixed neon strip using shared MUSHI_BANNER_NEON tokens from @mushi-mushi/core
|
|
310
|
+
* - Tap opens the report sheet; optional dismiss hides until next cold start
|
|
311
|
+
* - Reports layout height so Capacitor/RN hosts can pad content (banner-offset contract)
|
|
312
|
+
*
|
|
313
|
+
* DEPENDENCIES:
|
|
314
|
+
* - @mushi-mushi/core (MUSHI_BANNER_NEON, MUSHI_COPY, MUSHI_GEOMETRY)
|
|
315
|
+
*
|
|
316
|
+
* USAGE:
|
|
317
|
+
* - Rendered by MushiProvider when widget.trigger === 'banner'
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
interface MushiBannerProps {
|
|
321
|
+
onPress: () => void;
|
|
322
|
+
onDismiss?: () => void;
|
|
323
|
+
message?: string;
|
|
324
|
+
label?: string;
|
|
325
|
+
/** Fires with measured banner height (px) for host safe-area / inset padding. */
|
|
326
|
+
onLayoutHeight?: (height: number) => void;
|
|
327
|
+
}
|
|
328
|
+
declare const MUSHI_BANNER_DEFAULT_HEIGHT: 36;
|
|
329
|
+
declare const MushiBanner: FC<MushiBannerProps>;
|
|
330
|
+
|
|
278
331
|
interface MushiTriggerProps {
|
|
279
332
|
/** A single React Native element that accepts `onPress`. */
|
|
280
333
|
children: ReactElement<{
|
|
@@ -333,4 +386,4 @@ declare class AsyncStorageQueue {
|
|
|
333
386
|
private getAsyncStorage;
|
|
334
387
|
}
|
|
335
388
|
|
|
336
|
-
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, MushiTrigger, type MushiTriggerProps, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
|
389
|
+
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MUSHI_BANNER_DEFAULT_HEIGHT, MushiBanner, type MushiBannerProps, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, MushiTrigger, type MushiTriggerProps, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|