@hook-sdk/template 0.16.0 → 0.18.0
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.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -282,6 +282,7 @@ function usePaywallState() {
|
|
|
282
282
|
const status = subscription.status();
|
|
283
283
|
const daysLeftInTrial = subscription.daysLeftInTrial();
|
|
284
284
|
const initialLoadComplete = subscription.initialLoadComplete;
|
|
285
|
+
const hasAccess = subscription.hasAccess;
|
|
285
286
|
const pixPending = useMemo2(() => {
|
|
286
287
|
const sdkPix = subscription.pixPending;
|
|
287
288
|
if (!sdkPix) return null;
|
|
@@ -485,6 +486,7 @@ function usePaywallState() {
|
|
|
485
486
|
return {
|
|
486
487
|
// Subscription status (reactive, proxied from SDK)
|
|
487
488
|
status,
|
|
489
|
+
hasAccess,
|
|
488
490
|
daysLeftInTrial,
|
|
489
491
|
initialLoadComplete,
|
|
490
492
|
// Plan derivation from config (sync, no fetch)
|
|
@@ -528,9 +530,10 @@ var BLOCKING = /* @__PURE__ */ new Set([
|
|
|
528
530
|
]);
|
|
529
531
|
function SubscriptionGate({ Paywall, children }) {
|
|
530
532
|
const { mode } = useTemplateConfig();
|
|
531
|
-
const { status, initialLoadComplete } = usePaywallState();
|
|
533
|
+
const { status, hasAccess, initialLoadComplete } = usePaywallState();
|
|
532
534
|
if (mode === "free") return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
533
535
|
if (!initialLoadComplete && status === "none") return null;
|
|
536
|
+
if (hasAccess === true && status !== "none") return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
534
537
|
if (BLOCKING.has(status)) return /* @__PURE__ */ jsx5(Paywall, {});
|
|
535
538
|
return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
536
539
|
}
|