@mushi-mushi/web 1.10.0 → 1.11.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.cjs +64 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +64 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1834,7 +1834,11 @@ function reporterStatusLabel(status) {
|
|
|
1834
1834
|
case "fixed":
|
|
1835
1835
|
case "resolved":
|
|
1836
1836
|
case "completed":
|
|
1837
|
-
return "Fixed";
|
|
1837
|
+
return "Fixed \u2014 confirm?";
|
|
1838
|
+
case "verified":
|
|
1839
|
+
return "Verified";
|
|
1840
|
+
case "reopened":
|
|
1841
|
+
return "Reopened";
|
|
1838
1842
|
case "dismissed":
|
|
1839
1843
|
return "Closed";
|
|
1840
1844
|
default:
|
|
@@ -1859,6 +1863,10 @@ function reporterStatusTone(status) {
|
|
|
1859
1863
|
case "resolved":
|
|
1860
1864
|
case "completed":
|
|
1861
1865
|
return "fixed";
|
|
1866
|
+
case "verified":
|
|
1867
|
+
return "fixed";
|
|
1868
|
+
case "reopened":
|
|
1869
|
+
return "fixing";
|
|
1862
1870
|
case "dismissed":
|
|
1863
1871
|
return "closed";
|
|
1864
1872
|
default:
|
|
@@ -2939,6 +2947,12 @@ var MushiWidget = class _MushiWidget {
|
|
|
2939
2947
|
<div class="mushi-thread">
|
|
2940
2948
|
${this.reporterLoading ? '<p class="mushi-muted">Loading thread\u2026</p>' : comments || '<p class="mushi-muted">No developer replies yet.</p>'}
|
|
2941
2949
|
</div>
|
|
2950
|
+
${["fixed", "resolved", "verified"].includes(status) ? `
|
|
2951
|
+
<div class="mushi-verify-actions" role="group" aria-label="Fix verification">
|
|
2952
|
+
<button type="button" class="mushi-intent-btn" data-action="reporter-confirms">Yes, fixed for me</button>
|
|
2953
|
+
<button type="button" class="mushi-intent-btn" data-action="reporter-not-fixed">Not fixed yet</button>
|
|
2954
|
+
</div>
|
|
2955
|
+
` : ""}
|
|
2942
2956
|
<textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
|
|
2943
2957
|
<button type="button" class="mushi-submit" data-action="reporter-reply">
|
|
2944
2958
|
<span>Reply</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
|
|
@@ -3270,6 +3284,12 @@ var MushiWidget = class _MushiWidget {
|
|
|
3270
3284
|
panel.querySelector('[data-action="reporter-reply"]')?.addEventListener("click", () => {
|
|
3271
3285
|
void this.submitReporterReply(panel);
|
|
3272
3286
|
});
|
|
3287
|
+
panel.querySelector('[data-action="reporter-confirms"]')?.addEventListener("click", () => {
|
|
3288
|
+
void this.submitReporterFeedback("confirms");
|
|
3289
|
+
});
|
|
3290
|
+
panel.querySelector('[data-action="reporter-not-fixed"]')?.addEventListener("click", () => {
|
|
3291
|
+
void this.submitReporterFeedback("not_fixed");
|
|
3292
|
+
});
|
|
3273
3293
|
panel.querySelector('[data-action="copy-report-id"]')?.addEventListener("click", (e) => {
|
|
3274
3294
|
const btn = e.currentTarget;
|
|
3275
3295
|
const id = btn.dataset.copyId;
|
|
@@ -3451,6 +3471,21 @@ var MushiWidget = class _MushiWidget {
|
|
|
3451
3471
|
this.render();
|
|
3452
3472
|
}
|
|
3453
3473
|
}
|
|
3474
|
+
async submitReporterFeedback(signal) {
|
|
3475
|
+
const reportId = this.selectedReportId;
|
|
3476
|
+
if (!reportId || this.reporterLoading) return;
|
|
3477
|
+
this.reporterLoading = true;
|
|
3478
|
+
this.render();
|
|
3479
|
+
try {
|
|
3480
|
+
await this.callbacks.onReporterFeedback?.(reportId, signal);
|
|
3481
|
+
await this.loadReporterReports();
|
|
3482
|
+
if (reportId) await this.loadReporterComments(reportId);
|
|
3483
|
+
} catch (err) {
|
|
3484
|
+
this.reporterError = err instanceof Error ? err.message : "Could not send feedback.";
|
|
3485
|
+
this.reporterLoading = false;
|
|
3486
|
+
this.render();
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3454
3489
|
async submitReporterReply(panel) {
|
|
3455
3490
|
const reportId = this.selectedReportId;
|
|
3456
3491
|
const textarea = panel.querySelector('[data-role="reporter-reply"]');
|
|
@@ -5304,7 +5339,7 @@ function createProactiveManager(config = {}) {
|
|
|
5304
5339
|
|
|
5305
5340
|
// src/version.ts
|
|
5306
5341
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
5307
|
-
var MUSHI_SDK_VERSION = "1.
|
|
5342
|
+
var MUSHI_SDK_VERSION = "1.11.0" ;
|
|
5308
5343
|
|
|
5309
5344
|
// src/mushi.ts
|
|
5310
5345
|
var instance = null;
|
|
@@ -5583,6 +5618,16 @@ function createInstance(config) {
|
|
|
5583
5618
|
const result = await apiClient2.replyToReporterReport(reportId, core.getReporterToken(), body);
|
|
5584
5619
|
if (!result.ok) throw new Error(result.error?.message ?? "Could not send reply");
|
|
5585
5620
|
},
|
|
5621
|
+
async onReporterFeedback(reportId, signal, note) {
|
|
5622
|
+
const result = await apiClient2.replyToReporterReport(reportId, core.getReporterToken(), note ?? "", signal);
|
|
5623
|
+
if (!result.ok) throw new Error(result.error?.message ?? "Could not send feedback");
|
|
5624
|
+
return result.data?.feedback ?? null;
|
|
5625
|
+
},
|
|
5626
|
+
async onReporterReopen(reportId, note) {
|
|
5627
|
+
const result = await apiClient2.reopenReporterReport(reportId, core.getReporterToken(), note);
|
|
5628
|
+
if (!result.ok) throw new Error(result.error?.message ?? "Could not reopen report");
|
|
5629
|
+
return result.data?.outcome ?? null;
|
|
5630
|
+
},
|
|
5586
5631
|
onLeaderboardOpen() {
|
|
5587
5632
|
widget.setLeaderboard(null, true);
|
|
5588
5633
|
void fetchLeaderboard(10).then((entries) => {
|
|
@@ -6159,6 +6204,19 @@ function createInstance(config) {
|
|
|
6159
6204
|
if (!result.ok) return null;
|
|
6160
6205
|
return result.data?.comment ?? null;
|
|
6161
6206
|
},
|
|
6207
|
+
async submitFeedbackSignal(reportId, signal, note) {
|
|
6208
|
+
const result = await apiClient2.replyToReporterReport(reportId, core.getReporterToken(), note ?? "", signal);
|
|
6209
|
+
if (!result.ok) return null;
|
|
6210
|
+
return result.data?.feedback ?? null;
|
|
6211
|
+
},
|
|
6212
|
+
async reopenReport(reportId, note) {
|
|
6213
|
+
const result = await apiClient2.reopenReporterReport(reportId, core.getReporterToken(), note);
|
|
6214
|
+
if (!result.ok) return null;
|
|
6215
|
+
return result.data?.outcome ?? null;
|
|
6216
|
+
},
|
|
6217
|
+
openMyReports() {
|
|
6218
|
+
widget.recorderOpenMyReports();
|
|
6219
|
+
},
|
|
6162
6220
|
async getHallOfFame(limit = 20) {
|
|
6163
6221
|
const result = await apiClient2.getHallOfFame(limit);
|
|
6164
6222
|
if (!result.ok) return [];
|
|
@@ -6485,6 +6543,10 @@ function createNoopInstance() {
|
|
|
6485
6543
|
listMyReports: async () => [],
|
|
6486
6544
|
listMyComments: async () => [],
|
|
6487
6545
|
replyToReport: async () => null,
|
|
6546
|
+
submitFeedbackSignal: async () => null,
|
|
6547
|
+
reopenReport: async () => null,
|
|
6548
|
+
openMyReports: () => {
|
|
6549
|
+
},
|
|
6488
6550
|
getHallOfFame: async () => []
|
|
6489
6551
|
};
|
|
6490
6552
|
}
|