@saasquatch/squatch-js 2.3.2-20 → 2.3.2-21
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 +34 -33
- package/dist/squatch.WidgetApi.js +1395 -0
- package/dist/squatch.WidgetApi.min.js +8 -0
- package/dist/squatch.esm.js +1 -2
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +1 -2
- package/dist/squatch.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +2 -2
- package/dist/squatchjs.min.js +0 -13
package/demo/toolbar.tsx
CHANGED
|
@@ -323,6 +323,7 @@ async function getMockWidget(
|
|
|
323
323
|
)
|
|
324
324
|
);
|
|
325
325
|
document.getElementById("squatchembed").innerHTML = "";
|
|
326
|
+
|
|
326
327
|
await window["squatch"].widgets().upsertUser({
|
|
327
328
|
...window["sandbox"].initObj,
|
|
328
329
|
element,
|
|
@@ -353,7 +354,6 @@ async function getCustomWidget(engagementMedium) {
|
|
|
353
354
|
document.getElementById("squatchembed").innerHTML = "";
|
|
354
355
|
window["squatch"].widgets().upsertUser({
|
|
355
356
|
...window["sandbox"].initObj,
|
|
356
|
-
element: <div className="sam"></div>,
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -365,7 +365,6 @@ function MockedWidgets(props) {
|
|
|
365
365
|
// const [element, setElement] = useState(false);
|
|
366
366
|
const element = usePreload && document.getElementById("squatchembed");
|
|
367
367
|
|
|
368
|
-
console.log("engagement medium?", engagementMedium);
|
|
369
368
|
return (
|
|
370
369
|
<details
|
|
371
370
|
title={"Version: " + window["sandbox"].version || "Head"}
|
|
@@ -374,38 +373,41 @@ function MockedWidgets(props) {
|
|
|
374
373
|
>
|
|
375
374
|
<summary>Mocked Widgets</summary>
|
|
376
375
|
<h4>Engagement Medium</h4>
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
type="radio"
|
|
380
|
-
name="embed"
|
|
381
|
-
checked={engagementMedium === "EMBED"}
|
|
382
|
-
onClick={() => setEngagementMedium("EMBED")}
|
|
383
|
-
></input>
|
|
376
|
+
<form onSubmit={(e) => e.preventDefault()}>
|
|
377
|
+
<label>Embed</label>
|
|
384
378
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
></input>
|
|
392
|
-
<br />
|
|
393
|
-
<h4>Preload</h4>
|
|
394
|
-
<label>true</label>
|
|
395
|
-
<input
|
|
396
|
-
type="radio"
|
|
397
|
-
name="preload"
|
|
398
|
-
checked={usePreload === true}
|
|
399
|
-
onClick={() => setUsePreload(true)}
|
|
400
|
-
></input>
|
|
379
|
+
<input
|
|
380
|
+
type="radio"
|
|
381
|
+
name="embed"
|
|
382
|
+
checked={engagementMedium === "EMBED"}
|
|
383
|
+
onClick={() => setEngagementMedium("EMBED")}
|
|
384
|
+
></input>
|
|
401
385
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
386
|
+
<label>Popup</label>
|
|
387
|
+
<input
|
|
388
|
+
type="radio"
|
|
389
|
+
name="popup"
|
|
390
|
+
checked={engagementMedium === "POPUP"}
|
|
391
|
+
onClick={() => setEngagementMedium("POPUP")}
|
|
392
|
+
></input>
|
|
393
|
+
<br />
|
|
394
|
+
<h4>Preload</h4>
|
|
395
|
+
<label>true</label>
|
|
396
|
+
<input
|
|
397
|
+
type="radio"
|
|
398
|
+
name="preload"
|
|
399
|
+
checked={usePreload === true}
|
|
400
|
+
onClick={() => setUsePreload(true)}
|
|
401
|
+
></input>
|
|
402
|
+
|
|
403
|
+
<label>false</label>
|
|
404
|
+
<input
|
|
405
|
+
type="radio"
|
|
406
|
+
name="noPreload"
|
|
407
|
+
checked={usePreload === false}
|
|
408
|
+
onClick={() => setUsePreload(false)}
|
|
409
|
+
></input>
|
|
410
|
+
</form>
|
|
409
411
|
<br />
|
|
410
412
|
<button
|
|
411
413
|
onClick={() => {
|
|
@@ -413,7 +415,6 @@ function MockedWidgets(props) {
|
|
|
413
415
|
setShowWidget(false);
|
|
414
416
|
element?.close();
|
|
415
417
|
} else {
|
|
416
|
-
console.log("element?", element);
|
|
417
418
|
setShowWidget(true);
|
|
418
419
|
element?.open();
|
|
419
420
|
}
|