@shoppexio/storefront 1.0.62 → 1.0.63
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/CHANGELOG.md +4 -0
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -20388,7 +20388,7 @@ var TURNSTILE_FRAME_READY_TIMEOUT_MS = 1e4;
|
|
|
20388
20388
|
function readFrameMessage(value, nonce) {
|
|
20389
20389
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
20390
20390
|
const record2 = value;
|
|
20391
|
-
if (record2.source !== TURNSTILE_FRAME_MESSAGE_SOURCE || record2.version !== TURNSTILE_FRAME_MESSAGE_VERSION || record2.nonce !== nonce || !["ready", "success", "expired", "timeout", "error"].includes(String(record2.type))) return null;
|
|
20391
|
+
if (record2.source !== TURNSTILE_FRAME_MESSAGE_SOURCE || record2.version !== TURNSTILE_FRAME_MESSAGE_VERSION || record2.nonce !== nonce || !["ready", "visible", "hidden", "success", "expired", "timeout", "error"].includes(String(record2.type))) return null;
|
|
20392
20392
|
if (record2.type === "success" && (typeof record2.token !== "string" || !record2.token.trim())) {
|
|
20393
20393
|
return null;
|
|
20394
20394
|
}
|
|
@@ -20417,7 +20417,7 @@ function mountCheckoutChallenge(container, challenge, callbacks) {
|
|
|
20417
20417
|
frame.referrerPolicy = "no-referrer";
|
|
20418
20418
|
frame.style.border = "0";
|
|
20419
20419
|
frame.style.width = "100%";
|
|
20420
|
-
frame.style.height = "
|
|
20420
|
+
frame.style.height = "0";
|
|
20421
20421
|
let disposed = false;
|
|
20422
20422
|
let ready = false;
|
|
20423
20423
|
const readyTimeout = win.setTimeout(() => {
|
|
@@ -20429,7 +20429,12 @@ function mountCheckoutChallenge(container, challenge, callbacks) {
|
|
|
20429
20429
|
if (!message) return;
|
|
20430
20430
|
ready = true;
|
|
20431
20431
|
win.clearTimeout(readyTimeout);
|
|
20432
|
-
if (message.type === "
|
|
20432
|
+
if (message.type === "visible") frame.style.height = "72px";
|
|
20433
|
+
if (message.type === "hidden") frame.style.height = "0";
|
|
20434
|
+
if (message.type === "success") {
|
|
20435
|
+
frame.style.height = "0";
|
|
20436
|
+
callbacks.onSuccess(message.token);
|
|
20437
|
+
}
|
|
20433
20438
|
if (message.type === "expired" || message.type === "timeout") callbacks.onExpired?.();
|
|
20434
20439
|
if (message.type === "error") callbacks.onUnavailable?.();
|
|
20435
20440
|
};
|