@saasquatch/squatch-js 2.3.2-14 → 2.3.2-19
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/demo/toolbar.tsx +49 -12
- package/dist/squatch.min.js +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/demo/toolbar.tsx
CHANGED
|
@@ -298,7 +298,12 @@ function VersionList(props) {
|
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
async function getMockWidget(
|
|
301
|
+
async function getMockWidget(
|
|
302
|
+
widget,
|
|
303
|
+
engagementMedium,
|
|
304
|
+
element?: HTMLElement,
|
|
305
|
+
showWidget?: boolean
|
|
306
|
+
) {
|
|
302
307
|
window["mockWidget"] = widget;
|
|
303
308
|
window["sandbox"].initObj = {
|
|
304
309
|
...window["sandbox"].initObj,
|
|
@@ -318,10 +323,12 @@ async function getMockWidget(widget, engagementMedium, element?: HTMLElement) {
|
|
|
318
323
|
)
|
|
319
324
|
);
|
|
320
325
|
document.getElementById("squatchembed").innerHTML = "";
|
|
321
|
-
window["squatch"].widgets().upsertUser({
|
|
326
|
+
await window["squatch"].widgets().upsertUser({
|
|
322
327
|
...window["sandbox"].initObj,
|
|
323
328
|
element,
|
|
324
329
|
});
|
|
330
|
+
|
|
331
|
+
if (showWidget) element.open();
|
|
325
332
|
}
|
|
326
333
|
|
|
327
334
|
async function getCustomWidget(engagementMedium) {
|
|
@@ -417,41 +424,64 @@ function MockedWidgets(props) {
|
|
|
417
424
|
<br />
|
|
418
425
|
<button
|
|
419
426
|
onClick={() =>
|
|
420
|
-
getMockWidget(
|
|
427
|
+
getMockWidget(
|
|
428
|
+
"QuirksVanillaGA",
|
|
429
|
+
engagementMedium,
|
|
430
|
+
element,
|
|
431
|
+
showWidget
|
|
432
|
+
)
|
|
421
433
|
}
|
|
422
434
|
>
|
|
423
435
|
Quirks mode - Vanilla
|
|
424
436
|
</button>
|
|
425
437
|
<button
|
|
426
|
-
onClick={() =>
|
|
438
|
+
onClick={() =>
|
|
439
|
+
getMockWidget("QuirksMintGA", engagementMedium, element, showWidget)
|
|
440
|
+
}
|
|
427
441
|
>
|
|
428
442
|
Quirks mode - Mint
|
|
429
443
|
</button>
|
|
430
444
|
<button
|
|
431
|
-
onClick={() =>
|
|
445
|
+
onClick={() =>
|
|
446
|
+
getMockWidget("classic", engagementMedium, element, showWidget)
|
|
447
|
+
}
|
|
432
448
|
>
|
|
433
449
|
Classic
|
|
434
450
|
</button>
|
|
435
451
|
<button
|
|
436
|
-
onClick={() =>
|
|
452
|
+
onClick={() =>
|
|
453
|
+
getMockWidget("MintGA", engagementMedium, element, showWidget)
|
|
454
|
+
}
|
|
437
455
|
>
|
|
438
456
|
GA - Mint
|
|
439
457
|
</button>
|
|
440
458
|
<button
|
|
441
|
-
onClick={() =>
|
|
459
|
+
onClick={() =>
|
|
460
|
+
getMockWidget("VanillaGA", engagementMedium, element, showWidget)
|
|
461
|
+
}
|
|
442
462
|
>
|
|
443
463
|
GA - Vanilla
|
|
444
464
|
</button>
|
|
445
465
|
<button
|
|
446
466
|
onClick={() =>
|
|
447
|
-
getMockWidget(
|
|
467
|
+
getMockWidget(
|
|
468
|
+
"MintGAContainer",
|
|
469
|
+
engagementMedium,
|
|
470
|
+
element,
|
|
471
|
+
showWidget
|
|
472
|
+
)
|
|
448
473
|
}
|
|
449
474
|
>
|
|
450
475
|
Mint - With Container
|
|
451
476
|
</button>
|
|
452
477
|
<button
|
|
453
478
|
onClick={() =>
|
|
454
|
-
getMockWidget(
|
|
479
|
+
getMockWidget(
|
|
480
|
+
"QuirksMintGAContainer",
|
|
481
|
+
engagementMedium,
|
|
482
|
+
element,
|
|
483
|
+
showWidget
|
|
484
|
+
)
|
|
455
485
|
}
|
|
456
486
|
>
|
|
457
487
|
Quirks mode - Mint - With Container
|
|
@@ -461,7 +491,8 @@ function MockedWidgets(props) {
|
|
|
461
491
|
getMockWidget(
|
|
462
492
|
"MintGAContainerDisplayBlock",
|
|
463
493
|
engagementMedium,
|
|
464
|
-
element
|
|
494
|
+
element,
|
|
495
|
+
showWidget
|
|
465
496
|
)
|
|
466
497
|
}
|
|
467
498
|
>
|
|
@@ -472,7 +503,8 @@ function MockedWidgets(props) {
|
|
|
472
503
|
getMockWidget(
|
|
473
504
|
"QuirksMintGAContainerDisplayBlock",
|
|
474
505
|
engagementMedium,
|
|
475
|
-
element
|
|
506
|
+
element,
|
|
507
|
+
showWidget
|
|
476
508
|
)
|
|
477
509
|
}
|
|
478
510
|
>
|
|
@@ -480,7 +512,12 @@ function MockedWidgets(props) {
|
|
|
480
512
|
</button>
|
|
481
513
|
<button
|
|
482
514
|
onClick={() =>
|
|
483
|
-
getMockWidget(
|
|
515
|
+
getMockWidget(
|
|
516
|
+
"VanillaGANoContainer",
|
|
517
|
+
engagementMedium,
|
|
518
|
+
element,
|
|
519
|
+
showWidget
|
|
520
|
+
)
|
|
484
521
|
}
|
|
485
522
|
>
|
|
486
523
|
Vanilla - No Container
|