@mushi-mushi/web 1.13.0 → 1.14.1
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 +1 -1
- package/dist/index.cjs +1969 -1362
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -87
- package/dist/index.d.ts +93 -87
- package/dist/index.js +1969 -1362
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult,
|
|
1
|
+
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiTracePropagationConfig, MushiPrivacyConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig } from '@mushi-mushi/core';
|
|
2
2
|
export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
|
|
3
3
|
|
|
4
4
|
declare class Mushi {
|
|
@@ -10,18 +10,33 @@ declare class Mushi {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* FILE: packages/web/src/widget.ts
|
|
14
|
-
* PURPOSE:
|
|
15
|
-
*
|
|
13
|
+
* FILE: packages/web/src/widget-helpers.ts
|
|
14
|
+
* PURPOSE: Stateless helpers, constants, and shared types for the bug-capture
|
|
15
|
+
* widget. Extracted verbatim from widget.ts to keep that file focused
|
|
16
|
+
* on the MushiWidget class (DOM structure, state, lifecycle).
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* OVERVIEW:
|
|
19
|
+
* - Pure functions: reporter-status copy mappers, relative-time formatting,
|
|
20
|
+
* the step-number padder, the submit-shortcut detector, and HTML escaping.
|
|
21
|
+
* - Constants: category icon map, the feature-request intent wire string, the
|
|
22
|
+
* total step count, and the per-step ledger number.
|
|
23
|
+
* - Shared types: WidgetStep, the reporter status tone union, and the public
|
|
24
|
+
* WidgetRewardsState / WidgetSubmitOutcome / WidgetCallbacks contracts (these
|
|
25
|
+
* three are re-exported from widget.ts so existing `./widget` import sites and
|
|
26
|
+
* the package barrel keep working unchanged).
|
|
27
|
+
*
|
|
28
|
+
* DEPENDENCIES:
|
|
29
|
+
* - @mushi-mushi/core — report / reporter wire types referenced by the contracts.
|
|
30
|
+
*
|
|
31
|
+
* USAGE:
|
|
32
|
+
* - Imported by widget.ts (the MushiWidget class) and widget-render.ts (the
|
|
33
|
+
* stateless view layer). No DOM/browser state lives here.
|
|
34
|
+
*
|
|
35
|
+
* NOTES:
|
|
36
|
+
* - Behaviour-preserving move: bodies are identical to the pre-split widget.ts.
|
|
22
37
|
*/
|
|
23
38
|
|
|
24
|
-
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail' | 'leaderboard' | 'roadmap';
|
|
39
|
+
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail' | 'leaderboard' | 'roadmap' | 'account' | 'cross-app-reports';
|
|
25
40
|
interface WidgetRewardsState {
|
|
26
41
|
tier: {
|
|
27
42
|
slug: string;
|
|
@@ -77,7 +92,20 @@ interface WidgetCallbacks {
|
|
|
77
92
|
action: string;
|
|
78
93
|
}>;
|
|
79
94
|
onLeaderboardOpen?(): void;
|
|
95
|
+
/** Request a magic-link sign-in for the in-widget Mushi community. */
|
|
96
|
+
onMushiSignIn?(email: string): Promise<{
|
|
97
|
+
ok: boolean;
|
|
98
|
+
error?: string;
|
|
99
|
+
}>;
|
|
100
|
+
/** Fetch the global public leaderboard for the in-widget Mushi community. */
|
|
101
|
+
onGlobalLeaderboardOpen?(): void;
|
|
102
|
+
/** Fetch cross-app reports for the signed-in tester. */
|
|
103
|
+
onCrossAppReportsOpen?(): void;
|
|
104
|
+
/** Called when the user signs out of the in-widget community session.
|
|
105
|
+
* Host should clear any persisted tester JWT. */
|
|
106
|
+
onTesterSignOut?(): void;
|
|
80
107
|
}
|
|
108
|
+
|
|
81
109
|
declare class MushiWidget {
|
|
82
110
|
private readonly sdkVersion;
|
|
83
111
|
private host;
|
|
@@ -154,6 +182,27 @@ declare class MushiWidget {
|
|
|
154
182
|
private lastSubmitQueuedOffline;
|
|
155
183
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
156
184
|
private bannerDismissed;
|
|
185
|
+
/** Persisted FAB position when draggable is enabled. */
|
|
186
|
+
private fabPos;
|
|
187
|
+
/** Cleanup fn for visualViewport keyboard listener. */
|
|
188
|
+
private vvCleanup;
|
|
189
|
+
/** Mushi tester session JWT — set after in-widget sign-in or by mushi.ts. */
|
|
190
|
+
private testerJwt;
|
|
191
|
+
/** Tester identity (public_handle, display_name). */
|
|
192
|
+
private testerInfo;
|
|
193
|
+
/** Cross-app reports for the signed-in tester. */
|
|
194
|
+
private crossAppReports;
|
|
195
|
+
private crossAppLoading;
|
|
196
|
+
/** Global leaderboard entries (from mushi_testers, not org-scoped). */
|
|
197
|
+
private globalLeaderboard;
|
|
198
|
+
private globalLeaderboardLoading;
|
|
199
|
+
/** Reputation for the signed-in tester. */
|
|
200
|
+
private testerReputation;
|
|
201
|
+
/** Whether an in-widget magic-link email was just sent. */
|
|
202
|
+
private magicLinkSent;
|
|
203
|
+
private magicLinkEmail;
|
|
204
|
+
private magicLinkError;
|
|
205
|
+
private magicLinkSending;
|
|
157
206
|
constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks, sdkVersion?: string);
|
|
158
207
|
mount(): void;
|
|
159
208
|
getIsMounted(): boolean;
|
|
@@ -215,6 +264,14 @@ declare class MushiWidget {
|
|
|
215
264
|
total_points: number;
|
|
216
265
|
points_30d: number;
|
|
217
266
|
}> | null, loading?: boolean): void;
|
|
267
|
+
setTesterSession(jwt: string | null, info: {
|
|
268
|
+
id: string;
|
|
269
|
+
public_handle: string | null;
|
|
270
|
+
display_name: string | null;
|
|
271
|
+
} | null): void;
|
|
272
|
+
setGlobalLeaderboard(entries: MushiLeaderboardEntry[] | null, loading?: boolean): void;
|
|
273
|
+
setCrossAppReports(reports: MushiCrossAppReport[] | null, loading?: boolean): void;
|
|
274
|
+
setTesterReputation(rep: MushiTesterReputation | null): void;
|
|
218
275
|
destroy(): void;
|
|
219
276
|
/**
|
|
220
277
|
* Apply the SDK-owned pass-through layout to the host element so it is
|
|
@@ -271,89 +328,37 @@ declare class MushiWidget {
|
|
|
271
328
|
*/
|
|
272
329
|
private computeAvoidTopPx;
|
|
273
330
|
private applyInsetVars;
|
|
274
|
-
|
|
275
|
-
private
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
* Editorial masthead. Always carries:
|
|
279
|
-
* • the brand mark (虫 kanji on vermillion, "MUSHI" in mono above)
|
|
280
|
-
* • the page title (serif display)
|
|
281
|
-
* • the close affordance
|
|
282
|
-
*
|
|
283
|
-
* On sub-steps it additionally renders a back button (replacing the
|
|
284
|
-
* "MUSHI" eyebrow with a "← BACK" mono link) and a step counter
|
|
285
|
-
* ledger ("02 / 03") on the far right.
|
|
286
|
-
*/
|
|
287
|
-
private renderHeader;
|
|
288
|
-
/**
|
|
289
|
-
* Numeral step indicator: "01 — 02 — 03", with the active step in
|
|
290
|
-
* vermillion serif and completed steps struck through in mono.
|
|
291
|
-
* Replaces the original three-dot indicator (a generic SaaS pattern).
|
|
292
|
-
*/
|
|
293
|
-
private renderStepIndicator;
|
|
294
|
-
private renderCategoryStep;
|
|
295
|
-
/**
|
|
296
|
-
* First-class "Feature request" entry rendered at the top of the
|
|
297
|
-
* category step. Beta apps consistently get more useful signal when
|
|
298
|
-
* the user has a no-friction path to say "I wish this did X" — burying
|
|
299
|
-
* it as an intent under the "Other" category drops feature submissions
|
|
300
|
-
* by ~40% in industry studies (Userpilot, Usersnap 2025).
|
|
331
|
+
/** Storage key for the FAB position, scoped to projectId when available. */
|
|
332
|
+
private fabStorageKey;
|
|
333
|
+
/** Move the FAB to the given translated offset (relative to the inset origin),
|
|
334
|
+
* clamping inside viewport safe area, and optionally snap to nearest edge.
|
|
301
335
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
336
|
+
* The FAB's CSS anchor can be any corner (bottom-right, bottom-left, …) so we
|
|
337
|
+
* must derive the *base* position (CSS anchor with zero drag offset) to compute
|
|
338
|
+
* correct clamp bounds and snap targets. We do this by subtracting the
|
|
339
|
+
* already-applied drag offset from the live getBoundingClientRect() value. */
|
|
340
|
+
private moveFab;
|
|
341
|
+
/** Load previously persisted FAB position. */
|
|
342
|
+
private loadFabPos;
|
|
343
|
+
/** Attach Pointer Events-based drag to the trigger element. */
|
|
344
|
+
private attachDragHandlers;
|
|
345
|
+
/** Lift the panel above the software keyboard using visualViewport. */
|
|
346
|
+
private attachViewportHandlers;
|
|
347
|
+
private teardownViewportHandlers;
|
|
310
348
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
349
|
+
* Minimum description length, lowered for CJK locales where each character
|
|
350
|
+
* carries more meaning. Used by both the view layer (via renderCtx) and the
|
|
351
|
+
* details-step input validation in attachHandlers.
|
|
314
352
|
*/
|
|
315
|
-
private renderBetaStrip;
|
|
316
|
-
private renderReportsStep;
|
|
317
|
-
private renderRoadmapStep;
|
|
318
|
-
private renderLeaderboardStep;
|
|
319
|
-
private renderReportDetailStep;
|
|
320
|
-
private renderIntentStep;
|
|
321
353
|
private effectiveMinLength;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
* Editorial success state: 朱印-style red stamp ring with the kanji
|
|
325
|
-
* 受 ("received") at its centre, the localised "thank you" string
|
|
326
|
-
* in serif below, and a mono ledger receipt ("REPORT · HH:MM:SS").
|
|
327
|
-
* The ring + label animations are defined in styles.ts so this stays
|
|
328
|
-
* pure markup and `prefers-reduced-motion` flips them to the final
|
|
329
|
-
* frame instantly.
|
|
330
|
-
*/
|
|
331
|
-
private renderSuccessStep;
|
|
332
|
-
/**
|
|
333
|
-
* Two-way receipt block. Until the host's `onSubmit` resolves with a
|
|
334
|
-
* server-confirmed report id, we show a discreet "delivering..." pill so
|
|
335
|
-
* the user knows their submission is still in flight. Once we have the
|
|
336
|
-
* id, we surface a short monospaced id + a copy button + an optional
|
|
337
|
-
* "Track on Mushi" deep link to `dashboardUrl/reports/<id>` so the user
|
|
338
|
-
* can watch the status walk through queued -> classified -> fixed in
|
|
339
|
-
* real time (Peak-End rule: the last impression sticks). If we never
|
|
340
|
-
* get an id (offline retry queue), we say so explicitly rather than
|
|
341
|
-
* pretending everything is fine.
|
|
342
|
-
*/
|
|
343
|
-
private renderSuccessReceipt;
|
|
344
|
-
private renderSlaLine;
|
|
354
|
+
/** Tier accent colour for the rewards UI. */
|
|
355
|
+
private tierColor;
|
|
345
356
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* the user sees shapes their entire impression of the interaction).
|
|
357
|
+
* Build the read-only snapshot + bound helper closures the stateless view
|
|
358
|
+
* layer (widget-render.ts) renders from. Rebuilt once per render() pass so
|
|
359
|
+
* the HTML always reflects current state.
|
|
350
360
|
*/
|
|
351
|
-
private
|
|
352
|
-
private tierColor;
|
|
353
|
-
/** Compact rewards nudge rendered at the bottom of the category-step body. */
|
|
354
|
-
private renderRewardsNudge;
|
|
355
|
-
/** Points earned + tier progress shown on the success step. */
|
|
356
|
-
private renderSuccessRewards;
|
|
361
|
+
private renderCtx;
|
|
357
362
|
private attachHandlers;
|
|
358
363
|
private trapFocus;
|
|
359
364
|
private unreadCount;
|
|
@@ -364,6 +369,7 @@ declare class MushiWidget {
|
|
|
364
369
|
private loadReporterComments;
|
|
365
370
|
private submitReporterFeedback;
|
|
366
371
|
private submitReporterReply;
|
|
372
|
+
private handleMagicLinkSend;
|
|
367
373
|
getRecorderStep(): WidgetStep;
|
|
368
374
|
getRecorderTrigger(): Element | null;
|
|
369
375
|
getRecorderCategoryButton(category: MushiReportCategory): Element | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult,
|
|
1
|
+
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiConsoleEntry, MushiNetworkEntry, MushiUrlMatcher, MushiTracePropagationConfig, MushiPrivacyConfig, MushiPerformanceMetrics, MushiSelectedElement, MushiTimelineEntry, MushiApiCascadeConfig } from '@mushi-mushi/core';
|
|
2
2
|
export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
|
|
3
3
|
|
|
4
4
|
declare class Mushi {
|
|
@@ -10,18 +10,33 @@ declare class Mushi {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* FILE: packages/web/src/widget.ts
|
|
14
|
-
* PURPOSE:
|
|
15
|
-
*
|
|
13
|
+
* FILE: packages/web/src/widget-helpers.ts
|
|
14
|
+
* PURPOSE: Stateless helpers, constants, and shared types for the bug-capture
|
|
15
|
+
* widget. Extracted verbatim from widget.ts to keep that file focused
|
|
16
|
+
* on the MushiWidget class (DOM structure, state, lifecycle).
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* OVERVIEW:
|
|
19
|
+
* - Pure functions: reporter-status copy mappers, relative-time formatting,
|
|
20
|
+
* the step-number padder, the submit-shortcut detector, and HTML escaping.
|
|
21
|
+
* - Constants: category icon map, the feature-request intent wire string, the
|
|
22
|
+
* total step count, and the per-step ledger number.
|
|
23
|
+
* - Shared types: WidgetStep, the reporter status tone union, and the public
|
|
24
|
+
* WidgetRewardsState / WidgetSubmitOutcome / WidgetCallbacks contracts (these
|
|
25
|
+
* three are re-exported from widget.ts so existing `./widget` import sites and
|
|
26
|
+
* the package barrel keep working unchanged).
|
|
27
|
+
*
|
|
28
|
+
* DEPENDENCIES:
|
|
29
|
+
* - @mushi-mushi/core — report / reporter wire types referenced by the contracts.
|
|
30
|
+
*
|
|
31
|
+
* USAGE:
|
|
32
|
+
* - Imported by widget.ts (the MushiWidget class) and widget-render.ts (the
|
|
33
|
+
* stateless view layer). No DOM/browser state lives here.
|
|
34
|
+
*
|
|
35
|
+
* NOTES:
|
|
36
|
+
* - Behaviour-preserving move: bodies are identical to the pre-split widget.ts.
|
|
22
37
|
*/
|
|
23
38
|
|
|
24
|
-
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail' | 'leaderboard' | 'roadmap';
|
|
39
|
+
type WidgetStep = 'category' | 'intent' | 'details' | 'success' | 'reports' | 'report-detail' | 'leaderboard' | 'roadmap' | 'account' | 'cross-app-reports';
|
|
25
40
|
interface WidgetRewardsState {
|
|
26
41
|
tier: {
|
|
27
42
|
slug: string;
|
|
@@ -77,7 +92,20 @@ interface WidgetCallbacks {
|
|
|
77
92
|
action: string;
|
|
78
93
|
}>;
|
|
79
94
|
onLeaderboardOpen?(): void;
|
|
95
|
+
/** Request a magic-link sign-in for the in-widget Mushi community. */
|
|
96
|
+
onMushiSignIn?(email: string): Promise<{
|
|
97
|
+
ok: boolean;
|
|
98
|
+
error?: string;
|
|
99
|
+
}>;
|
|
100
|
+
/** Fetch the global public leaderboard for the in-widget Mushi community. */
|
|
101
|
+
onGlobalLeaderboardOpen?(): void;
|
|
102
|
+
/** Fetch cross-app reports for the signed-in tester. */
|
|
103
|
+
onCrossAppReportsOpen?(): void;
|
|
104
|
+
/** Called when the user signs out of the in-widget community session.
|
|
105
|
+
* Host should clear any persisted tester JWT. */
|
|
106
|
+
onTesterSignOut?(): void;
|
|
80
107
|
}
|
|
108
|
+
|
|
81
109
|
declare class MushiWidget {
|
|
82
110
|
private readonly sdkVersion;
|
|
83
111
|
private host;
|
|
@@ -154,6 +182,27 @@ declare class MushiWidget {
|
|
|
154
182
|
private lastSubmitQueuedOffline;
|
|
155
183
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
156
184
|
private bannerDismissed;
|
|
185
|
+
/** Persisted FAB position when draggable is enabled. */
|
|
186
|
+
private fabPos;
|
|
187
|
+
/** Cleanup fn for visualViewport keyboard listener. */
|
|
188
|
+
private vvCleanup;
|
|
189
|
+
/** Mushi tester session JWT — set after in-widget sign-in or by mushi.ts. */
|
|
190
|
+
private testerJwt;
|
|
191
|
+
/** Tester identity (public_handle, display_name). */
|
|
192
|
+
private testerInfo;
|
|
193
|
+
/** Cross-app reports for the signed-in tester. */
|
|
194
|
+
private crossAppReports;
|
|
195
|
+
private crossAppLoading;
|
|
196
|
+
/** Global leaderboard entries (from mushi_testers, not org-scoped). */
|
|
197
|
+
private globalLeaderboard;
|
|
198
|
+
private globalLeaderboardLoading;
|
|
199
|
+
/** Reputation for the signed-in tester. */
|
|
200
|
+
private testerReputation;
|
|
201
|
+
/** Whether an in-widget magic-link email was just sent. */
|
|
202
|
+
private magicLinkSent;
|
|
203
|
+
private magicLinkEmail;
|
|
204
|
+
private magicLinkError;
|
|
205
|
+
private magicLinkSending;
|
|
157
206
|
constructor(config: MushiWidgetConfig | undefined, callbacks: WidgetCallbacks, sdkVersion?: string);
|
|
158
207
|
mount(): void;
|
|
159
208
|
getIsMounted(): boolean;
|
|
@@ -215,6 +264,14 @@ declare class MushiWidget {
|
|
|
215
264
|
total_points: number;
|
|
216
265
|
points_30d: number;
|
|
217
266
|
}> | null, loading?: boolean): void;
|
|
267
|
+
setTesterSession(jwt: string | null, info: {
|
|
268
|
+
id: string;
|
|
269
|
+
public_handle: string | null;
|
|
270
|
+
display_name: string | null;
|
|
271
|
+
} | null): void;
|
|
272
|
+
setGlobalLeaderboard(entries: MushiLeaderboardEntry[] | null, loading?: boolean): void;
|
|
273
|
+
setCrossAppReports(reports: MushiCrossAppReport[] | null, loading?: boolean): void;
|
|
274
|
+
setTesterReputation(rep: MushiTesterReputation | null): void;
|
|
218
275
|
destroy(): void;
|
|
219
276
|
/**
|
|
220
277
|
* Apply the SDK-owned pass-through layout to the host element so it is
|
|
@@ -271,89 +328,37 @@ declare class MushiWidget {
|
|
|
271
328
|
*/
|
|
272
329
|
private computeAvoidTopPx;
|
|
273
330
|
private applyInsetVars;
|
|
274
|
-
|
|
275
|
-
private
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
* Editorial masthead. Always carries:
|
|
279
|
-
* • the brand mark (虫 kanji on vermillion, "MUSHI" in mono above)
|
|
280
|
-
* • the page title (serif display)
|
|
281
|
-
* • the close affordance
|
|
282
|
-
*
|
|
283
|
-
* On sub-steps it additionally renders a back button (replacing the
|
|
284
|
-
* "MUSHI" eyebrow with a "← BACK" mono link) and a step counter
|
|
285
|
-
* ledger ("02 / 03") on the far right.
|
|
286
|
-
*/
|
|
287
|
-
private renderHeader;
|
|
288
|
-
/**
|
|
289
|
-
* Numeral step indicator: "01 — 02 — 03", with the active step in
|
|
290
|
-
* vermillion serif and completed steps struck through in mono.
|
|
291
|
-
* Replaces the original three-dot indicator (a generic SaaS pattern).
|
|
292
|
-
*/
|
|
293
|
-
private renderStepIndicator;
|
|
294
|
-
private renderCategoryStep;
|
|
295
|
-
/**
|
|
296
|
-
* First-class "Feature request" entry rendered at the top of the
|
|
297
|
-
* category step. Beta apps consistently get more useful signal when
|
|
298
|
-
* the user has a no-friction path to say "I wish this did X" — burying
|
|
299
|
-
* it as an intent under the "Other" category drops feature submissions
|
|
300
|
-
* by ~40% in industry studies (Userpilot, Usersnap 2025).
|
|
331
|
+
/** Storage key for the FAB position, scoped to projectId when available. */
|
|
332
|
+
private fabStorageKey;
|
|
333
|
+
/** Move the FAB to the given translated offset (relative to the inset origin),
|
|
334
|
+
* clamping inside viewport safe area, and optionally snap to nearest edge.
|
|
301
335
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
336
|
+
* The FAB's CSS anchor can be any corner (bottom-right, bottom-left, …) so we
|
|
337
|
+
* must derive the *base* position (CSS anchor with zero drag offset) to compute
|
|
338
|
+
* correct clamp bounds and snap targets. We do this by subtracting the
|
|
339
|
+
* already-applied drag offset from the live getBoundingClientRect() value. */
|
|
340
|
+
private moveFab;
|
|
341
|
+
/** Load previously persisted FAB position. */
|
|
342
|
+
private loadFabPos;
|
|
343
|
+
/** Attach Pointer Events-based drag to the trigger element. */
|
|
344
|
+
private attachDragHandlers;
|
|
345
|
+
/** Lift the panel above the software keyboard using visualViewport. */
|
|
346
|
+
private attachViewportHandlers;
|
|
347
|
+
private teardownViewportHandlers;
|
|
310
348
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
349
|
+
* Minimum description length, lowered for CJK locales where each character
|
|
350
|
+
* carries more meaning. Used by both the view layer (via renderCtx) and the
|
|
351
|
+
* details-step input validation in attachHandlers.
|
|
314
352
|
*/
|
|
315
|
-
private renderBetaStrip;
|
|
316
|
-
private renderReportsStep;
|
|
317
|
-
private renderRoadmapStep;
|
|
318
|
-
private renderLeaderboardStep;
|
|
319
|
-
private renderReportDetailStep;
|
|
320
|
-
private renderIntentStep;
|
|
321
353
|
private effectiveMinLength;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
* Editorial success state: 朱印-style red stamp ring with the kanji
|
|
325
|
-
* 受 ("received") at its centre, the localised "thank you" string
|
|
326
|
-
* in serif below, and a mono ledger receipt ("REPORT · HH:MM:SS").
|
|
327
|
-
* The ring + label animations are defined in styles.ts so this stays
|
|
328
|
-
* pure markup and `prefers-reduced-motion` flips them to the final
|
|
329
|
-
* frame instantly.
|
|
330
|
-
*/
|
|
331
|
-
private renderSuccessStep;
|
|
332
|
-
/**
|
|
333
|
-
* Two-way receipt block. Until the host's `onSubmit` resolves with a
|
|
334
|
-
* server-confirmed report id, we show a discreet "delivering..." pill so
|
|
335
|
-
* the user knows their submission is still in flight. Once we have the
|
|
336
|
-
* id, we surface a short monospaced id + a copy button + an optional
|
|
337
|
-
* "Track on Mushi" deep link to `dashboardUrl/reports/<id>` so the user
|
|
338
|
-
* can watch the status walk through queued -> classified -> fixed in
|
|
339
|
-
* real time (Peak-End rule: the last impression sticks). If we never
|
|
340
|
-
* get an id (offline retry queue), we say so explicitly rather than
|
|
341
|
-
* pretending everything is fine.
|
|
342
|
-
*/
|
|
343
|
-
private renderSuccessReceipt;
|
|
344
|
-
private renderSlaLine;
|
|
354
|
+
/** Tier accent colour for the rewards UI. */
|
|
355
|
+
private tierColor;
|
|
345
356
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* the user sees shapes their entire impression of the interaction).
|
|
357
|
+
* Build the read-only snapshot + bound helper closures the stateless view
|
|
358
|
+
* layer (widget-render.ts) renders from. Rebuilt once per render() pass so
|
|
359
|
+
* the HTML always reflects current state.
|
|
350
360
|
*/
|
|
351
|
-
private
|
|
352
|
-
private tierColor;
|
|
353
|
-
/** Compact rewards nudge rendered at the bottom of the category-step body. */
|
|
354
|
-
private renderRewardsNudge;
|
|
355
|
-
/** Points earned + tier progress shown on the success step. */
|
|
356
|
-
private renderSuccessRewards;
|
|
361
|
+
private renderCtx;
|
|
357
362
|
private attachHandlers;
|
|
358
363
|
private trapFocus;
|
|
359
364
|
private unreadCount;
|
|
@@ -364,6 +369,7 @@ declare class MushiWidget {
|
|
|
364
369
|
private loadReporterComments;
|
|
365
370
|
private submitReporterFeedback;
|
|
366
371
|
private submitReporterReply;
|
|
372
|
+
private handleMagicLinkSend;
|
|
367
373
|
getRecorderStep(): WidgetStep;
|
|
368
374
|
getRecorderTrigger(): Element | null;
|
|
369
375
|
getRecorderCategoryButton(category: MushiReportCategory): Element | null;
|