@sphoro/bugcatch-web-sdk 0.19.0 → 0.21.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/README.md +54 -1
- package/dist/bugcatch-call.umd.js +1 -1
- package/dist/bugcatch-core.es.js +652 -497
- package/dist/bugcatch-core.es.js.map +1 -1
- package/dist/bugcatch-panel.es.js +1307 -964
- package/dist/bugcatch-panel.es.js.map +1 -1
- package/dist/bugcatch-panel.umd.js +291 -158
- package/dist/bugcatch-panel.umd.js.map +1 -1
- package/dist/bugcatch.standalone.umd.js +284 -151
- package/dist/bugcatch.standalone.umd.js.map +1 -1
- package/dist/bugcatch.umd.js +8 -8
- package/dist/bugcatch.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/feedback.js +94 -0
- package/src/identity.js +1 -1
- package/src/index.d.ts +65 -6
- package/src/index.js +111 -7
- package/src/panel/call.js +3 -2
- package/src/panel/compose.js +8 -4
- package/src/panel/feedback.js +205 -0
- package/src/panel/icons.js +6 -0
- package/src/panel/index.js +91 -12
- package/src/panel/rate-due.js +155 -0
- package/src/panel/rating.js +87 -0
- package/src/panel/signin.js +1 -1
- package/src/panel/styles.js +75 -0
- package/src/panel/thread.js +3 -72
- package/src/widget.js +14 -1
package/src/widget.js
CHANGED
|
@@ -423,7 +423,13 @@ export function mountWidget(client) {
|
|
|
423
423
|
open = openPanelWhenLoaded();
|
|
424
424
|
});
|
|
425
425
|
|
|
426
|
+
// Which form the next panel opens on: BugCatch.open({ mode }) sets it just
|
|
427
|
+
// before pressing the launcher, and a person pressing it gets the report form.
|
|
428
|
+
let nextMode = 'report';
|
|
429
|
+
|
|
426
430
|
function openPanelWhenLoaded() {
|
|
431
|
+
let mode = nextMode;
|
|
432
|
+
nextMode = 'report';
|
|
427
433
|
hideLoadFailure();
|
|
428
434
|
// The panel says it again, at the top, with the rest of what is live.
|
|
429
435
|
hideNotice();
|
|
@@ -437,6 +443,8 @@ export function mountWidget(client) {
|
|
|
437
443
|
const pending = {
|
|
438
444
|
close: () => (panel ? panel.close() : cancel()),
|
|
439
445
|
destroy: () => (panel ? panel.destroy() : cancel()),
|
|
446
|
+
// Asked again while it is on its way, or once it is open.
|
|
447
|
+
setMode: (m) => { if (panel) panel.setMode?.(m); else mode = m; },
|
|
440
448
|
};
|
|
441
449
|
|
|
442
450
|
launcher.setAttribute('aria-busy', 'true');
|
|
@@ -452,6 +460,7 @@ export function mountWidget(client) {
|
|
|
452
460
|
client,
|
|
453
461
|
preloadCall,
|
|
454
462
|
themeControls,
|
|
463
|
+
mode,
|
|
455
464
|
onClose: () => {
|
|
456
465
|
open = null;
|
|
457
466
|
dock.classList.remove('over');
|
|
@@ -558,7 +567,11 @@ export function mountWidget(client) {
|
|
|
558
567
|
// Integration hook: BugCatch.open() / close() / isOpen() drive the same
|
|
559
568
|
// launcher a person would press, so there is one way in to the panel.
|
|
560
569
|
client.widgetControls = {
|
|
561
|
-
open: () => {
|
|
570
|
+
open: (mode) => {
|
|
571
|
+
if (open) { if (mode) open.setMode(mode); return; }
|
|
572
|
+
nextMode = mode || 'report';
|
|
573
|
+
launcher.click();
|
|
574
|
+
},
|
|
562
575
|
close: () => { open?.close(); },
|
|
563
576
|
isOpen: () => Boolean(open),
|
|
564
577
|
};
|