rivia 0.0.11 → 0.0.13
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.js +21 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1542,6 +1542,16 @@ var RIVIA_TOUR = function() {
|
|
|
1542
1542
|
return STATE.tips;
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
|
+
function getStepUrlInfo(step) {
|
|
1546
|
+
if (!step) return null;
|
|
1547
|
+
const targetUrl = step.targetUrl || "All pages";
|
|
1548
|
+
const isAvailable = isStepAvailableOnCurrentPage(step);
|
|
1549
|
+
return {
|
|
1550
|
+
targetUrl,
|
|
1551
|
+
isAvailable,
|
|
1552
|
+
displayText: isAvailable ? "\u2713 On this page" : `\u{1F4CD} Go to: ${targetUrl}`
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1545
1555
|
async function showStep(i, isPreview = false) {
|
|
1546
1556
|
uploadVisitedPagesInBackground(STATE.tour_id, user_var12, i);
|
|
1547
1557
|
console.log("Showing step", i, "of", STATE.tips.length);
|
|
@@ -1553,7 +1563,7 @@ var RIVIA_TOUR = function() {
|
|
|
1553
1563
|
cleanupAllOverlays();
|
|
1554
1564
|
if (step.card_type === "welcome") {
|
|
1555
1565
|
if (isPreview) {
|
|
1556
|
-
showWelcomeCardPreview(step, i);
|
|
1566
|
+
await showWelcomeCardPreview(step, i);
|
|
1557
1567
|
} else {
|
|
1558
1568
|
showWelcomeCardEditModal(i);
|
|
1559
1569
|
}
|
|
@@ -1561,7 +1571,7 @@ var RIVIA_TOUR = function() {
|
|
|
1561
1571
|
}
|
|
1562
1572
|
if (step.card_type === "modal_dialog") {
|
|
1563
1573
|
if (isPreview) {
|
|
1564
|
-
showModalDialogPreview(step, i);
|
|
1574
|
+
await showModalDialogPreview(step, i);
|
|
1565
1575
|
} else {
|
|
1566
1576
|
showModalDialogEditModal(i);
|
|
1567
1577
|
}
|
|
@@ -1569,7 +1579,7 @@ var RIVIA_TOUR = function() {
|
|
|
1569
1579
|
}
|
|
1570
1580
|
if (step.card_type === "feedback") {
|
|
1571
1581
|
if (isPreview) {
|
|
1572
|
-
showFeedbackCardPreview(step, i);
|
|
1582
|
+
await showFeedbackCardPreview(step, i);
|
|
1573
1583
|
} else {
|
|
1574
1584
|
showFeedbackCardEditModal(i);
|
|
1575
1585
|
}
|
|
@@ -1590,7 +1600,7 @@ var RIVIA_TOUR = function() {
|
|
|
1590
1600
|
targetElement.style.outlineOffset = "2px";
|
|
1591
1601
|
targetElement.style.backgroundColor = "rgba(37, 99, 235, 0.1)";
|
|
1592
1602
|
}
|
|
1593
|
-
setTimeout(() => {
|
|
1603
|
+
setTimeout(async () => {
|
|
1594
1604
|
const highlightedElement = document.querySelector('[data-rivia-highlight="true"]');
|
|
1595
1605
|
if (!highlightedElement && targetElement) {
|
|
1596
1606
|
targetElement.setAttribute("data-rivia-highlight", "true");
|
|
@@ -1633,7 +1643,7 @@ var RIVIA_TOUR = function() {
|
|
|
1633
1643
|
} else {
|
|
1634
1644
|
console.warn("No selector found in step:", step);
|
|
1635
1645
|
}
|
|
1636
|
-
setTimeout(() => {
|
|
1646
|
+
setTimeout(async () => {
|
|
1637
1647
|
console.log("Creating video UI after scroll delay...");
|
|
1638
1648
|
const highlightedElement = document.querySelector('[data-rivia-highlight="true"]');
|
|
1639
1649
|
console.log("Highlighted element for video positioning:", highlightedElement);
|
|
@@ -1682,10 +1692,10 @@ var RIVIA_TOUR = function() {
|
|
|
1682
1692
|
}
|
|
1683
1693
|
}
|
|
1684
1694
|
}
|
|
1685
|
-
setTimeout(() => {
|
|
1686
|
-
const tip2 = createTooltip({ ...step, isPreview });
|
|
1695
|
+
setTimeout(async () => {
|
|
1696
|
+
const tip2 = await createTooltip({ ...step, isPreview });
|
|
1687
1697
|
if (tip2) {
|
|
1688
|
-
attachNavigationButtons(tip2, i, isPreview);
|
|
1698
|
+
await attachNavigationButtons(tip2, i, isPreview);
|
|
1689
1699
|
try {
|
|
1690
1700
|
tip2.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
1691
1701
|
} catch (e) {
|
|
@@ -1715,7 +1725,7 @@ var RIVIA_TOUR = function() {
|
|
|
1715
1725
|
el.style.backgroundColor = "rgba(37, 99, 235, 0.1)";
|
|
1716
1726
|
}
|
|
1717
1727
|
}
|
|
1718
|
-
const tip = createTooltip({ ...step, isPreview });
|
|
1728
|
+
const tip = await createTooltip({ ...step, isPreview });
|
|
1719
1729
|
console.log("nextUrl for step", step.nextUrl);
|
|
1720
1730
|
if (!tip) {
|
|
1721
1731
|
const stepUrlInfo = getStepUrlInfo(step);
|
|
@@ -1743,7 +1753,7 @@ var RIVIA_TOUR = function() {
|
|
|
1743
1753
|
}
|
|
1744
1754
|
return;
|
|
1745
1755
|
}
|
|
1746
|
-
attachNavigationButtons(tip, i, isPreview);
|
|
1756
|
+
await attachNavigationButtons(tip, i, isPreview);
|
|
1747
1757
|
setTimeout(() => {
|
|
1748
1758
|
try {
|
|
1749
1759
|
tip.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
@@ -3015,7 +3025,7 @@ var RIVIA_TOUR = function() {
|
|
|
3015
3025
|
urlStatus.title = stepUrlInfo.displayText;
|
|
3016
3026
|
}
|
|
3017
3027
|
}
|
|
3018
|
-
|
|
3028
|
+
function playTour() {
|
|
3019
3029
|
if (STATE.is_completed)
|
|
3020
3030
|
return;
|
|
3021
3031
|
if (!STATE.tips.length) {
|