@nibgate/sdk 0.2.34 → 0.2.36
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/nibgate.js +20 -8
- package/dist/nibgate.js.map +2 -2
- package/dist/nibgate.min.js +29 -27
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/default-ui.js +17 -8
package/dist/nibgate.js
CHANGED
|
@@ -27358,9 +27358,11 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27358
27358
|
<div style="font-size:50px;font-weight:700;letter-spacing:-.03em;color:${theme.fg};margin-bottom:12px">${esc(resource.price)} USDC</div>
|
|
27359
27359
|
<div style="font-size:21px;color:${theme.muted};margin-bottom:48px">Pay to unlock this content</div>
|
|
27360
27360
|
<div data-nibgate-wallet-label class="nui-mono" style="font-size:18px;color:${theme.muted};margin-bottom:40px;min-height:28px">Connect wallet</div>
|
|
27361
|
-
<div data-nibgate-unlock-wrap style="width:100%;position:relative;border-radius:10px;
|
|
27362
|
-
<
|
|
27363
|
-
|
|
27361
|
+
<div data-nibgate-unlock-wrap style="width:100%;position:relative;border-radius:10px;cursor:pointer">
|
|
27362
|
+
<button type="button" data-nibgate-unlock disabled style="width:100%;padding:14px 0;font-size:17px;font-weight:600;line-height:1;border:0;border-radius:10px;outline:none;cursor:pointer;position:relative;overflow:hidden;color:#fff;background:${theme.accent};box-shadow:0 4px 12px rgba(0,0,0,0.15);transition:transform .1s,box-shadow .1s;font-family:inherit;display:flex;align-items:center;justify-content:center">
|
|
27363
|
+
<div data-nibgate-unlock-progress style="position:absolute;inset:0;width:0%;background:rgba(255,255,255,0.55);border-radius:10px;transition:width .05s linear"></div>
|
|
27364
|
+
<span data-nibgate-unlock-text style="position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px">${unlockSVG}Hold to pay</span>
|
|
27365
|
+
</button></div>
|
|
27364
27366
|
<div class="nui-stat" style="text-align:center;margin-top:16px" data-nibgate-status></div>
|
|
27365
27367
|
</div>
|
|
27366
27368
|
<div data-nibgate-premium hidden style="margin-top:32px;border-top:1px solid ${theme.border};padding-top:32px">${options.premiumContentHTML || ""}</div>
|
|
@@ -27405,6 +27407,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27405
27407
|
const wrap3 = card.querySelector("[data-nibgate-unlock-wrap]");
|
|
27406
27408
|
const prog = card.querySelector("[data-nibgate-unlock-progress]");
|
|
27407
27409
|
const btn = card.querySelector("[data-nibgate-unlock]");
|
|
27410
|
+
const textEl = card.querySelector("[data-nibgate-unlock-text]");
|
|
27408
27411
|
const HOLD_MS = 1500;
|
|
27409
27412
|
let holdTimer = null, holdActive = false, holdComplete = false;
|
|
27410
27413
|
const ctrl = createEvmGatewayUnlock(resource, {
|
|
@@ -27444,7 +27447,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27444
27447
|
label.innerHTML = "Connect wallet";
|
|
27445
27448
|
btn.disabled = true;
|
|
27446
27449
|
btn.style.cursor = "default";
|
|
27447
|
-
|
|
27450
|
+
textEl.innerHTML = unlockSVG + "Hold to pay";
|
|
27448
27451
|
}
|
|
27449
27452
|
}
|
|
27450
27453
|
function attachBalClick() {
|
|
@@ -27455,7 +27458,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27455
27458
|
}
|
|
27456
27459
|
}
|
|
27457
27460
|
function setBtnText(t) {
|
|
27458
|
-
|
|
27461
|
+
textEl.innerHTML = unlockSVG + t;
|
|
27459
27462
|
}
|
|
27460
27463
|
function resetHold() {
|
|
27461
27464
|
holdActive = false;
|
|
@@ -27497,9 +27500,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27497
27500
|
resetHold();
|
|
27498
27501
|
}
|
|
27499
27502
|
label.addEventListener("click", (e) => {
|
|
27500
|
-
if (
|
|
27501
|
-
ctrl.disconnect().then(updateLabel);
|
|
27502
|
-
} else if (!ctrl.getWalletAddress()) {
|
|
27503
|
+
if (!ctrl.getWalletAddress()) {
|
|
27503
27504
|
ctrl.connect().then(updateLabel).catch(() => updateLabel());
|
|
27504
27505
|
}
|
|
27505
27506
|
});
|
|
@@ -27508,6 +27509,17 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
27508
27509
|
document.addEventListener("mouseup", cancelHold);
|
|
27509
27510
|
document.addEventListener("touchend", cancelHold);
|
|
27510
27511
|
wrap3.addEventListener("mouseleave", cancelHold);
|
|
27512
|
+
function pressIn() {
|
|
27513
|
+
if (!btn.style.transform || btn.style.transform === "none" || btn.style.transform === "") btn.style.transform = "scale(0.97)";
|
|
27514
|
+
}
|
|
27515
|
+
function pressOut() {
|
|
27516
|
+
if (!holdActive) btn.style.transform = "";
|
|
27517
|
+
}
|
|
27518
|
+
btn.addEventListener("mousedown", pressIn);
|
|
27519
|
+
btn.addEventListener("touchstart", pressIn, { passive: true });
|
|
27520
|
+
btn.addEventListener("mouseup", pressOut);
|
|
27521
|
+
btn.addEventListener("touchend", pressOut);
|
|
27522
|
+
btn.addEventListener("mouseleave", pressOut);
|
|
27511
27523
|
setTimeout(updateLabel, 200);
|
|
27512
27524
|
const cleanup = () => {
|
|
27513
27525
|
document.removeEventListener("mouseup", cancelHold);
|