@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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.63
4
+
5
+ - Keep managed checkout verification collapsed until Cloudflare requires buyer interaction.
6
+
3
7
  ## 1.0.62
4
8
 
5
9
  - Fail open with an unavailable callback when the hosted checkout verification broker never completes its ready handshake.
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 = "72px";
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 === "success") callbacks.onSuccess(message.token);
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
  };