@monetize.software/sdk 3.0.0-alpha.1 → 3.0.0-alpha.2

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.
@@ -1197,6 +1197,13 @@ function Zt({
1197
1197
  if (e.auth)
1198
1198
  return e.auth.onAuthChange((h) => m(h));
1199
1199
  }, [e.auth]), M(() => {
1200
+ if (typeof e.onBootstrapChange == "function")
1201
+ return e.onBootstrapChange((h) => {
1202
+ p(
1203
+ (u) => u.status === "ready" ? { status: "ready", data: h } : u
1204
+ );
1205
+ });
1206
+ }, [e]), M(() => {
1200
1207
  if (!t || c.status === "ready" || c.status === "loading") return;
1201
1208
  let h = !1;
1202
1209
  return p({ status: "loading" }), e.bootstrap().then((u) => {
@@ -1727,6 +1734,19 @@ class he {
1727
1734
  onUserChange(t) {
1728
1735
  return this.on("userChange", t);
1729
1736
  }
1737
+ /**
1738
+ * Заменить cachedBootstrap живыми данными — для preview-режима в редакторе
1739
+ * админки. Если модалка открыта, PaywallRoot подписан на onBootstrapChange
1740
+ * и перерендерится мгновенно. До open() — затравка для bootstrap()-effect'а.
1741
+ *
1742
+ * См. {@link BillingClientOptions.preview} — обычно эту опцию ставят на
1743
+ * клиент, чтобы заодно отключить сетевой revalidate. setBootstrap технически
1744
+ * работает и в production-режиме, но конкуренция с revalidate'ом из сети
1745
+ * почти всегда нежелательна.
1746
+ */
1747
+ setBootstrap(t) {
1748
+ this.billing.setBootstrap(t);
1749
+ }
1730
1750
  on(t, i) {
1731
1751
  let n = this.listeners.get(t);
1732
1752
  return n || (n = /* @__PURE__ */ new Set(), this.listeners.set(t, n)), n.add(i), () => n.delete(i);
@@ -2206,4 +2226,4 @@ export {
2206
2226
  he as P,
2207
2227
  $t as b
2208
2228
  };
2209
- //# sourceMappingURL=PaywallUI-BHp9afFC.js.map
2229
+ //# sourceMappingURL=PaywallUI-CRTEPjJm.js.map