@rocapine/react-native-onboarding 1.60.0 → 1.62.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/OnboardingStudioClient.d.ts +23 -5
- package/dist/OnboardingStudioClient.d.ts.map +1 -1
- package/dist/OnboardingStudioClient.js +82 -6
- package/dist/OnboardingStudioClient.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/infra/provider/OnboardingProvider.d.ts +37 -1
- package/dist/infra/provider/OnboardingProvider.d.ts.map +1 -1
- package/dist/infra/provider/OnboardingProvider.js +76 -2
- package/dist/infra/provider/OnboardingProvider.js.map +1 -1
- package/dist/infra/queries/cacheKey.d.ts +22 -4
- package/dist/infra/queries/cacheKey.d.ts.map +1 -1
- package/dist/infra/queries/cacheKey.js +26 -5
- package/dist/infra/queries/cacheKey.js.map +1 -1
- package/dist/paywalls/PaywallProvider.d.ts +66 -0
- package/dist/paywalls/PaywallProvider.d.ts.map +1 -0
- package/dist/paywalls/PaywallProvider.js +227 -0
- package/dist/paywalls/PaywallProvider.js.map +1 -0
- package/dist/paywalls/getPaywalls.query.d.ts +37 -0
- package/dist/paywalls/getPaywalls.query.d.ts.map +1 -0
- package/dist/paywalls/getPaywalls.query.js +114 -0
- package/dist/paywalls/getPaywalls.query.js.map +1 -0
- package/dist/paywalls/present.d.ts +100 -0
- package/dist/paywalls/present.d.ts.map +1 -0
- package/dist/paywalls/present.js +113 -0
- package/dist/paywalls/present.js.map +1 -0
- package/dist/paywalls/types.d.ts +95 -0
- package/dist/paywalls/types.d.ts.map +1 -0
- package/dist/paywalls/types.js +10 -0
- package/dist/paywalls/types.js.map +1 -0
- package/dist/paywalls/usePaywall.d.ts +29 -0
- package/dist/paywalls/usePaywall.d.ts.map +1 -0
- package/dist/paywalls/usePaywall.js +17 -0
- package/dist/paywalls/usePaywall.js.map +1 -0
- package/dist/products/ProductRuntimeContext.d.ts +15 -0
- package/dist/products/ProductRuntimeContext.d.ts.map +1 -0
- package/dist/products/ProductRuntimeContext.js +19 -0
- package/dist/products/ProductRuntimeContext.js.map +1 -0
- package/dist/products/adapters/expoIap.d.ts +4 -0
- package/dist/products/adapters/expoIap.d.ts.map +1 -0
- package/dist/products/adapters/expoIap.js +95 -0
- package/dist/products/adapters/expoIap.js.map +1 -0
- package/dist/products/adapters/revenueCat.d.ts +7 -0
- package/dist/products/adapters/revenueCat.d.ts.map +1 -0
- package/dist/products/adapters/revenueCat.js +116 -0
- package/dist/products/adapters/revenueCat.js.map +1 -0
- package/dist/products/adapters/stub.d.ts +8 -0
- package/dist/products/adapters/stub.d.ts.map +1 -0
- package/dist/products/adapters/stub.js +21 -0
- package/dist/products/adapters/stub.js.map +1 -0
- package/dist/products/derive.d.ts +19 -0
- package/dist/products/derive.d.ts.map +1 -0
- package/dist/products/derive.js +79 -0
- package/dist/products/derive.js.map +1 -0
- package/dist/products/duration.d.ts +3 -0
- package/dist/products/duration.d.ts.map +1 -0
- package/dist/products/duration.js +25 -0
- package/dist/products/duration.js.map +1 -0
- package/dist/products/index.d.ts +10 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +23 -0
- package/dist/products/index.js.map +1 -0
- package/dist/products/mergeProductRuntimes.d.ts +55 -0
- package/dist/products/mergeProductRuntimes.d.ts.map +1 -0
- package/dist/products/mergeProductRuntimes.js +79 -0
- package/dist/products/mergeProductRuntimes.js.map +1 -0
- package/dist/products/toVariables.d.ts +18 -0
- package/dist/products/toVariables.d.ts.map +1 -0
- package/dist/products/toVariables.js +52 -0
- package/dist/products/toVariables.js.map +1 -0
- package/dist/products/types.d.ts +96 -0
- package/dist/products/types.d.ts.map +1 -0
- package/dist/products/types.js +3 -0
- package/dist/products/types.js.map +1 -0
- package/dist/products/useProducts.d.ts +12 -0
- package/dist/products/useProducts.d.ts.map +1 -0
- package/dist/products/useProducts.js +90 -0
- package/dist/products/useProducts.js.map +1 -0
- package/dist/screens/elements/AnimatedTextElement.d.ts +1 -24
- package/dist/screens/elements/AnimatedTextElement.d.ts.map +1 -1
- package/dist/screens/elements/BaseBoxProps.d.ts +1 -24
- package/dist/screens/elements/BaseBoxProps.d.ts.map +1 -1
- package/dist/screens/elements/ButtonElement.d.ts +6 -121
- package/dist/screens/elements/ButtonElement.d.ts.map +1 -1
- package/dist/screens/elements/CarouselElement.d.ts +1 -24
- package/dist/screens/elements/CarouselElement.d.ts.map +1 -1
- package/dist/screens/elements/CheckboxGroupElement.d.ts +1 -24
- package/dist/screens/elements/CheckboxGroupElement.d.ts.map +1 -1
- package/dist/screens/elements/DatePickerElement.d.ts +1 -24
- package/dist/screens/elements/DatePickerElement.d.ts.map +1 -1
- package/dist/screens/elements/DrawingPadElement.d.ts +1 -24
- package/dist/screens/elements/DrawingPadElement.d.ts.map +1 -1
- package/dist/screens/elements/IconElement.d.ts +1 -24
- package/dist/screens/elements/IconElement.d.ts.map +1 -1
- package/dist/screens/elements/ImageElement.d.ts +1 -24
- package/dist/screens/elements/ImageElement.d.ts.map +1 -1
- package/dist/screens/elements/InputElement.d.ts +1 -24
- package/dist/screens/elements/InputElement.d.ts.map +1 -1
- package/dist/screens/elements/KeyboardAvoidingViewElement.d.ts +1 -24
- package/dist/screens/elements/KeyboardAvoidingViewElement.d.ts.map +1 -1
- package/dist/screens/elements/LottieElement.d.ts +1 -24
- package/dist/screens/elements/LottieElement.d.ts.map +1 -1
- package/dist/screens/elements/ProgressIndicatorElement.d.ts +1 -24
- package/dist/screens/elements/ProgressIndicatorElement.d.ts.map +1 -1
- package/dist/screens/elements/ProgressiveBlurImageElement.d.ts +1 -24
- package/dist/screens/elements/ProgressiveBlurImageElement.d.ts.map +1 -1
- package/dist/screens/elements/RadioGroupElement.d.ts +1 -24
- package/dist/screens/elements/RadioGroupElement.d.ts.map +1 -1
- package/dist/screens/elements/RichTextElement.d.ts +1 -24
- package/dist/screens/elements/RichTextElement.d.ts.map +1 -1
- package/dist/screens/elements/RiveElement.d.ts +1 -24
- package/dist/screens/elements/RiveElement.d.ts.map +1 -1
- package/dist/screens/elements/SafeAreaViewElement.d.ts +1 -24
- package/dist/screens/elements/SafeAreaViewElement.d.ts.map +1 -1
- package/dist/screens/elements/ScrollViewElement.d.ts +1 -24
- package/dist/screens/elements/ScrollViewElement.d.ts.map +1 -1
- package/dist/screens/elements/SliderElement.d.ts +1 -24
- package/dist/screens/elements/SliderElement.d.ts.map +1 -1
- package/dist/screens/elements/StackElement.d.ts +1 -24
- package/dist/screens/elements/StackElement.d.ts.map +1 -1
- package/dist/screens/elements/TextElement.d.ts +1 -24
- package/dist/screens/elements/TextElement.d.ts.map +1 -1
- package/dist/screens/elements/TypewriterTextElement.d.ts +1 -24
- package/dist/screens/elements/TypewriterTextElement.d.ts.map +1 -1
- package/dist/screens/elements/VideoElement.d.ts +1 -24
- package/dist/screens/elements/VideoElement.d.ts.map +1 -1
- package/dist/screens/elements/WheelPickerElement.d.ts +1 -24
- package/dist/screens/elements/WheelPickerElement.d.ts.map +1 -1
- package/dist/screens/elements/ZStackElement.d.ts +1 -24
- package/dist/screens/elements/ZStackElement.d.ts.map +1 -1
- package/dist/steps/Carousel/types.d.ts +1 -1
- package/dist/steps/Commitment/types.d.ts +1 -1
- package/dist/steps/ComposableScreen/types.d.ts +1 -1
- package/dist/steps/Loader/types.d.ts +1 -1
- package/dist/steps/MediaContent/types.d.ts +1 -1
- package/dist/steps/Picker/types.d.ts +1 -1
- package/dist/steps/Question/types.d.ts +1 -1
- package/dist/steps/Ratings/types.d.ts +1 -1
- package/dist/steps/common.types.d.ts +44 -30
- package/dist/steps/common.types.d.ts.map +1 -1
- package/dist/steps/common.types.js +27 -3
- package/dist/steps/common.types.js.map +1 -1
- package/package.json +1 -1
- package/src/OnboardingStudioClient.ts +110 -7
- package/src/__tests__/mergeProductRuntimes.test.ts +172 -0
- package/src/__tests__/productAdapters.test.ts +58 -0
- package/src/__tests__/productDerive.test.ts +111 -0
- package/src/__tests__/productVariables.test.ts +109 -0
- package/src/__tests__/resolveLocalProductArgs.test.ts +41 -0
- package/src/index.ts +14 -0
- package/src/infra/provider/OnboardingProvider.tsx +101 -2
- package/src/infra/queries/cacheKey.ts +27 -4
- package/src/paywalls/PaywallProvider.tsx +342 -0
- package/src/paywalls/__tests__/getPaywalls.test.ts +334 -0
- package/src/paywalls/__tests__/present.test.ts +190 -0
- package/src/paywalls/getPaywalls.query.ts +123 -0
- package/src/paywalls/present.ts +141 -0
- package/src/paywalls/types.ts +99 -0
- package/src/paywalls/usePaywall.ts +35 -0
- package/src/products/ProductRuntimeContext.tsx +17 -0
- package/src/products/adapters/expoIap.ts +93 -0
- package/src/products/adapters/revenueCat.ts +108 -0
- package/src/products/adapters/stub.ts +20 -0
- package/src/products/derive.ts +93 -0
- package/src/products/duration.ts +21 -0
- package/src/products/index.ts +20 -0
- package/src/products/mergeProductRuntimes.ts +78 -0
- package/src/products/toVariables.ts +54 -0
- package/src/products/types.ts +88 -0
- package/src/products/useProducts.ts +106 -0
- package/src/steps/common.types.ts +83 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseIsoDuration = void 0;
|
|
4
|
+
// Store-standard ISO-8601 subscription periods only: P1W / P1M / P3M / P1Y / P7D.
|
|
5
|
+
// Time components (PT1H) are not subscription periods and are rejected rather
|
|
6
|
+
// than silently coerced — a wrong period would corrupt every per-period price.
|
|
7
|
+
const ISO_PERIOD = /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?$/;
|
|
8
|
+
const DAYS_PER = { year: 365, month: 30, week: 7, day: 1 };
|
|
9
|
+
/** ISO-8601 period → whole days. `null` when unparseable or empty (bare "P"). */
|
|
10
|
+
const parseIsoDuration = (iso) => {
|
|
11
|
+
if (!iso)
|
|
12
|
+
return null;
|
|
13
|
+
const m = ISO_PERIOD.exec(iso);
|
|
14
|
+
if (!m)
|
|
15
|
+
return null;
|
|
16
|
+
const [, y, mo, w, d] = m;
|
|
17
|
+
if (!y && !mo && !w && !d)
|
|
18
|
+
return null;
|
|
19
|
+
return (Number(y !== null && y !== void 0 ? y : 0) * DAYS_PER.year +
|
|
20
|
+
Number(mo !== null && mo !== void 0 ? mo : 0) * DAYS_PER.month +
|
|
21
|
+
Number(w !== null && w !== void 0 ? w : 0) * DAYS_PER.week +
|
|
22
|
+
Number(d !== null && d !== void 0 ? d : 0) * DAYS_PER.day);
|
|
23
|
+
};
|
|
24
|
+
exports.parseIsoDuration = parseIsoDuration;
|
|
25
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../src/products/duration.ts"],"names":[],"mappings":";;;AAAA,kFAAkF;AAClF,8EAA8E;AAC9E,+EAA+E;AAC/E,MAAM,UAAU,GAAG,iDAAiD,CAAC;AAErE,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAW,CAAC;AAEpE,iFAAiF;AAC1E,MAAM,gBAAgB,GAAG,CAAC,GAA8B,EAAiB,EAAE;IAChF,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CACL,MAAM,CAAC,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;QAC9B,MAAM,CAAC,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK;QAChC,MAAM,CAAC,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;QAC9B,MAAM,CAAC,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAC9B,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { ProductRef, ProductPeriod, ResolvedProduct, DerivedProductFields, ProductWithDerived, PurchaseResult, RestoreResult, ProductProvider, ProductStatus, ProductRuntime, } from "./types";
|
|
2
|
+
export { parseIsoDuration } from "./duration";
|
|
3
|
+
export { formatCurrency, deriveProductFields, deriveAll } from "./derive";
|
|
4
|
+
export { productVariables } from "./toVariables";
|
|
5
|
+
export { useProducts } from "./useProducts";
|
|
6
|
+
export { ProductRuntimeContext, useProductRuntime } from "./ProductRuntimeContext";
|
|
7
|
+
export { stubProductProvider } from "./adapters/stub";
|
|
8
|
+
export { revenueCatProductProvider } from "./adapters/revenueCat";
|
|
9
|
+
export { expoIapProductProvider } from "./adapters/expoIap";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/products/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expoIapProductProvider = exports.revenueCatProductProvider = exports.stubProductProvider = exports.useProductRuntime = exports.ProductRuntimeContext = exports.useProducts = exports.productVariables = exports.deriveAll = exports.deriveProductFields = exports.formatCurrency = exports.parseIsoDuration = void 0;
|
|
4
|
+
var duration_1 = require("./duration");
|
|
5
|
+
Object.defineProperty(exports, "parseIsoDuration", { enumerable: true, get: function () { return duration_1.parseIsoDuration; } });
|
|
6
|
+
var derive_1 = require("./derive");
|
|
7
|
+
Object.defineProperty(exports, "formatCurrency", { enumerable: true, get: function () { return derive_1.formatCurrency; } });
|
|
8
|
+
Object.defineProperty(exports, "deriveProductFields", { enumerable: true, get: function () { return derive_1.deriveProductFields; } });
|
|
9
|
+
Object.defineProperty(exports, "deriveAll", { enumerable: true, get: function () { return derive_1.deriveAll; } });
|
|
10
|
+
var toVariables_1 = require("./toVariables");
|
|
11
|
+
Object.defineProperty(exports, "productVariables", { enumerable: true, get: function () { return toVariables_1.productVariables; } });
|
|
12
|
+
var useProducts_1 = require("./useProducts");
|
|
13
|
+
Object.defineProperty(exports, "useProducts", { enumerable: true, get: function () { return useProducts_1.useProducts; } });
|
|
14
|
+
var ProductRuntimeContext_1 = require("./ProductRuntimeContext");
|
|
15
|
+
Object.defineProperty(exports, "ProductRuntimeContext", { enumerable: true, get: function () { return ProductRuntimeContext_1.ProductRuntimeContext; } });
|
|
16
|
+
Object.defineProperty(exports, "useProductRuntime", { enumerable: true, get: function () { return ProductRuntimeContext_1.useProductRuntime; } });
|
|
17
|
+
var stub_1 = require("./adapters/stub");
|
|
18
|
+
Object.defineProperty(exports, "stubProductProvider", { enumerable: true, get: function () { return stub_1.stubProductProvider; } });
|
|
19
|
+
var revenueCat_1 = require("./adapters/revenueCat");
|
|
20
|
+
Object.defineProperty(exports, "revenueCatProductProvider", { enumerable: true, get: function () { return revenueCat_1.revenueCatProductProvider; } });
|
|
21
|
+
var expoIap_1 = require("./adapters/expoIap");
|
|
22
|
+
Object.defineProperty(exports, "expoIapProductProvider", { enumerable: true, get: function () { return expoIap_1.expoIapProductProvider; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/products/index.ts"],"names":[],"mappings":";;;AAYA,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,mCAA0E;AAAjE,wGAAA,cAAc,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,mGAAA,SAAS,OAAA;AACvD,6CAAiD;AAAxC,+GAAA,gBAAgB,OAAA;AACzB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iEAAmF;AAA1E,8HAAA,qBAAqB,OAAA;AAAE,0HAAA,iBAAiB,OAAA;AACjD,wCAAsD;AAA7C,2GAAA,mBAAmB,OAAA;AAC5B,oDAAkE;AAAzD,uHAAA,yBAAyB,OAAA;AAClC,8CAA4D;AAAnD,iHAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ProductRuntime } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Publishes ONE `ProductRuntime` out of the shared context runtime (a
|
|
4
|
+
* `PaywallProvider` ancestor's catalog union) and this `OnboardingProvider`'s
|
|
5
|
+
* own local resolution of its `productRefs` prop.
|
|
6
|
+
*
|
|
7
|
+
* Finding 5, 2026-08-17 final review: `OnboardingProvider` used to zero the
|
|
8
|
+
* local ref set out entirely whenever a context runtime existed, on the
|
|
9
|
+
* assumption that the paywall catalog's product union is always a superset of
|
|
10
|
+
* whatever `productRefs` the host declares — an assumption about a
|
|
11
|
+
* host-supplied prop, not a property of the code. That silently broke a
|
|
12
|
+
* documented Phase 3 prop the moment a host added a `PaywallProvider` above
|
|
13
|
+
* an existing `OnboardingProvider`: `productRefs` keys absent from the
|
|
14
|
+
* catalog union resolved to nothing, with no error and nothing that
|
|
15
|
+
* type-checks. `productRefs` is therefore ALWAYS resolved locally now,
|
|
16
|
+
* regardless of whether a context runtime exists (see
|
|
17
|
+
* `resolveLocalProductArgs`) — this function unions the result back into the
|
|
18
|
+
* one `ProductRuntime` the rest of the app reads.
|
|
19
|
+
*
|
|
20
|
+
* **Callers MUST memoize this** (`OnboardingProvider.tsx` wraps it in
|
|
21
|
+
* `useMemo`, keyed on the four arguments) — round 2 of the final review (N1)
|
|
22
|
+
* found the object literal below allocated fresh, plus a fresh `purchase`
|
|
23
|
+
* closure, on every call, which breaks `ScreenHost.products`'s "referentially
|
|
24
|
+
* stable across variable writes" contract when called inline in a render
|
|
25
|
+
* body.
|
|
26
|
+
*
|
|
27
|
+
* Returns `contextRuntime` UNCHANGED when there is nothing local to add
|
|
28
|
+
* (`hasLocalRefs` false — the common case: no host-declared `productRefs`),
|
|
29
|
+
* so the well-established "one shared runtime, no local round trip" identity
|
|
30
|
+
* and behavior is untouched for every app that doesn't use this prop.
|
|
31
|
+
*
|
|
32
|
+
* `purchase` routes by key: a key resolved by the LOCAL runtime purchases
|
|
33
|
+
* through the local provider (it is the only one that resolved it); anything
|
|
34
|
+
* else — including an unknown key — goes through the context runtime, which
|
|
35
|
+
* already reports "No resolved product for key" for that case (`useProducts.
|
|
36
|
+
* purchase`), so no separate handling is needed here. `restore` delegates to
|
|
37
|
+
* the context runtime only: restoring is a whole store-account operation, not
|
|
38
|
+
* scoped to individual refs, so one call through the shared adapter is
|
|
39
|
+
* correct even with a local ref set also present — the same billing adapter
|
|
40
|
+
* type is the expected real-world setup for both `productProvider` props.
|
|
41
|
+
*
|
|
42
|
+
* `hasLocalProvider` (N3, round 2): a host can declare `productRefs` with NO
|
|
43
|
+
* local `productProvider` — nothing unusual, since the shared context runtime
|
|
44
|
+
* is normally expected to cover everything. `useProducts` then never leaves
|
|
45
|
+
* `"idle"` for the local runtime (it bails before ever calling a provider it
|
|
46
|
+
* doesn't have — `useProducts.ts`), and a naive `mergeStatus` would drag the
|
|
47
|
+
* context runtime's `"ready"` down to `"idle"` FOREVER, closing every
|
|
48
|
+
* `renderWhen: {"products.loaded": {eq:"true"}}` gate for good — the same
|
|
49
|
+
* "idle blocks readiness when there's nothing to actually wait for" trap
|
|
50
|
+
* `computeIsReady` (`present.ts`) already special-cases for an empty ref set.
|
|
51
|
+
* When there is no local provider, the local runtime has nothing pending, so
|
|
52
|
+
* the merged status is just the context runtime's.
|
|
53
|
+
*/
|
|
54
|
+
export declare const mergeProductRuntimes: (contextRuntime: ProductRuntime, localRuntime: ProductRuntime, hasLocalRefs: boolean, hasLocalProvider: boolean) => ProductRuntime;
|
|
55
|
+
//# sourceMappingURL=mergeProductRuntimes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeProductRuntimes.d.ts","sourceRoot":"","sources":["../../src/products/mergeProductRuntimes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAS7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,oBAAoB,GAC/B,gBAAgB,cAAc,EAC9B,cAAc,cAAc,EAC5B,cAAc,OAAO,EACrB,kBAAkB,OAAO,KACxB,cAWF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeProductRuntimes = void 0;
|
|
4
|
+
const mergeStatus = (a, b) => {
|
|
5
|
+
if (a === "error" || b === "error")
|
|
6
|
+
return "error";
|
|
7
|
+
if (a === "ready" && b === "ready")
|
|
8
|
+
return "ready";
|
|
9
|
+
if (a === "loading" || b === "loading")
|
|
10
|
+
return "loading";
|
|
11
|
+
return "idle";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Publishes ONE `ProductRuntime` out of the shared context runtime (a
|
|
15
|
+
* `PaywallProvider` ancestor's catalog union) and this `OnboardingProvider`'s
|
|
16
|
+
* own local resolution of its `productRefs` prop.
|
|
17
|
+
*
|
|
18
|
+
* Finding 5, 2026-08-17 final review: `OnboardingProvider` used to zero the
|
|
19
|
+
* local ref set out entirely whenever a context runtime existed, on the
|
|
20
|
+
* assumption that the paywall catalog's product union is always a superset of
|
|
21
|
+
* whatever `productRefs` the host declares — an assumption about a
|
|
22
|
+
* host-supplied prop, not a property of the code. That silently broke a
|
|
23
|
+
* documented Phase 3 prop the moment a host added a `PaywallProvider` above
|
|
24
|
+
* an existing `OnboardingProvider`: `productRefs` keys absent from the
|
|
25
|
+
* catalog union resolved to nothing, with no error and nothing that
|
|
26
|
+
* type-checks. `productRefs` is therefore ALWAYS resolved locally now,
|
|
27
|
+
* regardless of whether a context runtime exists (see
|
|
28
|
+
* `resolveLocalProductArgs`) — this function unions the result back into the
|
|
29
|
+
* one `ProductRuntime` the rest of the app reads.
|
|
30
|
+
*
|
|
31
|
+
* **Callers MUST memoize this** (`OnboardingProvider.tsx` wraps it in
|
|
32
|
+
* `useMemo`, keyed on the four arguments) — round 2 of the final review (N1)
|
|
33
|
+
* found the object literal below allocated fresh, plus a fresh `purchase`
|
|
34
|
+
* closure, on every call, which breaks `ScreenHost.products`'s "referentially
|
|
35
|
+
* stable across variable writes" contract when called inline in a render
|
|
36
|
+
* body.
|
|
37
|
+
*
|
|
38
|
+
* Returns `contextRuntime` UNCHANGED when there is nothing local to add
|
|
39
|
+
* (`hasLocalRefs` false — the common case: no host-declared `productRefs`),
|
|
40
|
+
* so the well-established "one shared runtime, no local round trip" identity
|
|
41
|
+
* and behavior is untouched for every app that doesn't use this prop.
|
|
42
|
+
*
|
|
43
|
+
* `purchase` routes by key: a key resolved by the LOCAL runtime purchases
|
|
44
|
+
* through the local provider (it is the only one that resolved it); anything
|
|
45
|
+
* else — including an unknown key — goes through the context runtime, which
|
|
46
|
+
* already reports "No resolved product for key" for that case (`useProducts.
|
|
47
|
+
* purchase`), so no separate handling is needed here. `restore` delegates to
|
|
48
|
+
* the context runtime only: restoring is a whole store-account operation, not
|
|
49
|
+
* scoped to individual refs, so one call through the shared adapter is
|
|
50
|
+
* correct even with a local ref set also present — the same billing adapter
|
|
51
|
+
* type is the expected real-world setup for both `productProvider` props.
|
|
52
|
+
*
|
|
53
|
+
* `hasLocalProvider` (N3, round 2): a host can declare `productRefs` with NO
|
|
54
|
+
* local `productProvider` — nothing unusual, since the shared context runtime
|
|
55
|
+
* is normally expected to cover everything. `useProducts` then never leaves
|
|
56
|
+
* `"idle"` for the local runtime (it bails before ever calling a provider it
|
|
57
|
+
* doesn't have — `useProducts.ts`), and a naive `mergeStatus` would drag the
|
|
58
|
+
* context runtime's `"ready"` down to `"idle"` FOREVER, closing every
|
|
59
|
+
* `renderWhen: {"products.loaded": {eq:"true"}}` gate for good — the same
|
|
60
|
+
* "idle blocks readiness when there's nothing to actually wait for" trap
|
|
61
|
+
* `computeIsReady` (`present.ts`) already special-cases for an empty ref set.
|
|
62
|
+
* When there is no local provider, the local runtime has nothing pending, so
|
|
63
|
+
* the merged status is just the context runtime's.
|
|
64
|
+
*/
|
|
65
|
+
const mergeProductRuntimes = (contextRuntime, localRuntime, hasLocalRefs, hasLocalProvider) => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (!hasLocalRefs)
|
|
68
|
+
return contextRuntime;
|
|
69
|
+
return {
|
|
70
|
+
products: Object.assign(Object.assign({}, contextRuntime.products), localRuntime.products),
|
|
71
|
+
status: hasLocalProvider ? mergeStatus(contextRuntime.status, localRuntime.status) : contextRuntime.status,
|
|
72
|
+
error: (_a = contextRuntime.error) !== null && _a !== void 0 ? _a : localRuntime.error,
|
|
73
|
+
purchasing: contextRuntime.purchasing || localRuntime.purchasing,
|
|
74
|
+
purchase: (key) => key in localRuntime.products ? localRuntime.purchase(key) : contextRuntime.purchase(key),
|
|
75
|
+
restore: contextRuntime.restore,
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
exports.mergeProductRuntimes = mergeProductRuntimes;
|
|
79
|
+
//# sourceMappingURL=mergeProductRuntimes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeProductRuntimes.js","sourceRoot":"","sources":["../../src/products/mergeProductRuntimes.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,CAAC,CAAgB,EAAE,CAAgB,EAAiB,EAAE;IACxE,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IACnD,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IACnD,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACI,MAAM,oBAAoB,GAAG,CAClC,cAA8B,EAC9B,YAA4B,EAC5B,YAAqB,EACrB,gBAAyB,EACT,EAAE;;IAClB,IAAI,CAAC,YAAY;QAAE,OAAO,cAAc,CAAC;IACzC,OAAO;QACL,QAAQ,kCAAO,cAAc,CAAC,QAAQ,GAAK,YAAY,CAAC,QAAQ,CAAE;QAClE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM;QAC1G,KAAK,EAAE,MAAA,cAAc,CAAC,KAAK,mCAAI,YAAY,CAAC,KAAK;QACjD,UAAU,EAAE,cAAc,CAAC,UAAU,IAAI,YAAY,CAAC,UAAU;QAChE,QAAQ,EAAE,CAAC,GAAW,EAAE,EAAE,CACxB,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1F,OAAO,EAAE,cAAc,CAAC,OAAO;KAChC,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,oBAAoB,wBAgB/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComposableVariableEntry } from "../steps/ComposableScreen/types";
|
|
2
|
+
import type { ProductRuntime } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Resolved products → the variable bag, as FLAT DOTTED KEYS
|
|
5
|
+
* (`product.yearly.pricePerWeek`). `interpolate()` resolves `{{key}}` with a
|
|
6
|
+
* flat `variables[key]` lookup and `evaluateCondition` reads `flatVariables`
|
|
7
|
+
* the same way, so this needs no engine change.
|
|
8
|
+
*
|
|
9
|
+
* Optional fields are OMITTED when absent rather than emitted empty: a missing
|
|
10
|
+
* key interpolates to "" anyway, but `evaluateCondition`'s `is_empty`/
|
|
11
|
+
* `is_not_empty` treat an empty string identically to a missing key, so that
|
|
12
|
+
* pair doesn't actually depend on this. It's `is_null`/`is_not_null` that do —
|
|
13
|
+
* they only treat null/undefined as null, so an emitted `""` would read as
|
|
14
|
+
* "not null" — so omitting is what makes
|
|
15
|
+
* `renderWhen: { "product.x.savingsPct": { is_not_null: true } }` behave.
|
|
16
|
+
*/
|
|
17
|
+
export declare const productVariables: (runtime: Pick<ProductRuntime, "products" | "status" | "error" | "purchasing">) => Record<string, ComposableVariableEntry>;
|
|
18
|
+
//# sourceMappingURL=toVariables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toVariables.d.ts","sourceRoot":"","sources":["../../src/products/toVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC,KAC5E,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAkCxC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productVariables = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Resolved products → the variable bag, as FLAT DOTTED KEYS
|
|
6
|
+
* (`product.yearly.pricePerWeek`). `interpolate()` resolves `{{key}}` with a
|
|
7
|
+
* flat `variables[key]` lookup and `evaluateCondition` reads `flatVariables`
|
|
8
|
+
* the same way, so this needs no engine change.
|
|
9
|
+
*
|
|
10
|
+
* Optional fields are OMITTED when absent rather than emitted empty: a missing
|
|
11
|
+
* key interpolates to "" anyway, but `evaluateCondition`'s `is_empty`/
|
|
12
|
+
* `is_not_empty` treat an empty string identically to a missing key, so that
|
|
13
|
+
* pair doesn't actually depend on this. It's `is_null`/`is_not_null` that do —
|
|
14
|
+
* they only treat null/undefined as null, so an emitted `""` would read as
|
|
15
|
+
* "not null" — so omitting is what makes
|
|
16
|
+
* `renderWhen: { "product.x.savingsPct": { is_not_null: true } }` behave.
|
|
17
|
+
*/
|
|
18
|
+
const productVariables = (runtime) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const out = {};
|
|
21
|
+
const put = (key, value) => {
|
|
22
|
+
if (value === undefined || value === null)
|
|
23
|
+
return;
|
|
24
|
+
out[key] = { value: String(value) };
|
|
25
|
+
};
|
|
26
|
+
for (const [key, p] of Object.entries(runtime.products)) {
|
|
27
|
+
const b = `product.${key}`;
|
|
28
|
+
put(`${b}.productId`, p.productId);
|
|
29
|
+
put(`${b}.title`, p.title);
|
|
30
|
+
put(`${b}.description`, p.description);
|
|
31
|
+
put(`${b}.price`, p.price);
|
|
32
|
+
put(`${b}.priceAmount`, p.priceAmount);
|
|
33
|
+
put(`${b}.currencyCode`, p.currencyCode);
|
|
34
|
+
put(`${b}.period`, p.period);
|
|
35
|
+
put(`${b}.periodCount`, p.periodCount);
|
|
36
|
+
put(`${b}.pricePerWeek`, p.pricePerWeek);
|
|
37
|
+
put(`${b}.pricePerWeekAmount`, p.pricePerWeekAmount);
|
|
38
|
+
put(`${b}.pricePerMonth`, p.pricePerMonth);
|
|
39
|
+
put(`${b}.pricePerMonthAmount`, p.pricePerMonthAmount);
|
|
40
|
+
put(`${b}.pricePerYear`, p.pricePerYear);
|
|
41
|
+
put(`${b}.pricePerYearAmount`, p.pricePerYearAmount);
|
|
42
|
+
put(`${b}.savingsPct`, p.savingsPct);
|
|
43
|
+
put(`${b}.trialDays`, p.trialDays);
|
|
44
|
+
put(`${b}.introPrice`, (_a = p.introOffer) === null || _a === void 0 ? void 0 : _a.price);
|
|
45
|
+
}
|
|
46
|
+
out["products.loaded"] = { value: runtime.status === "ready" ? "true" : "false" };
|
|
47
|
+
out["products.purchasing"] = { value: runtime.purchasing ? "true" : "false" };
|
|
48
|
+
out["products.error"] = { value: (_b = runtime.error) !== null && _b !== void 0 ? _b : "" };
|
|
49
|
+
return out;
|
|
50
|
+
};
|
|
51
|
+
exports.productVariables = productVariables;
|
|
52
|
+
//# sourceMappingURL=toVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toV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zC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACrD,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;QAC3C,GAAG,CAAC,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC;QACvD,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;QACzC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACrD,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;QACrC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;QACnC,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,MAAA,CAAC,CAAC,UAAU,0CAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,GAAG,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAClF,GAAG,CAAC,qBAAqB,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9E,GAAG,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,EAAE,EAAE,CAAC;IAEvD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AApCW,QAAA,gBAAgB,oBAoC3B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** A product slot declared by the author: a stable key plus per-store ids. */
|
|
2
|
+
export type ProductRef = {
|
|
3
|
+
/** Author-chosen slot name used in variables, e.g. "yearly" → product.yearly.price */
|
|
4
|
+
key: string;
|
|
5
|
+
/** App Store product identifier. */
|
|
6
|
+
ios?: string;
|
|
7
|
+
/** Play product identifier. `productId:basePlanId` — RevenueCat's convention. */
|
|
8
|
+
android?: string;
|
|
9
|
+
/** Another slot's key; savingsPct is computed against it. */
|
|
10
|
+
compareTo?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ProductPeriod = "week" | "month" | "year" | "lifetime";
|
|
13
|
+
/** A product as the store reports it. Prices here are authoritative. */
|
|
14
|
+
export type ResolvedProduct = {
|
|
15
|
+
key: string;
|
|
16
|
+
/** The identifier resolved for THIS platform. */
|
|
17
|
+
productId: string;
|
|
18
|
+
store: "app_store" | "play_store";
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
/** Store-localized, pre-formatted, e.g. "$59.99". Display this. */
|
|
22
|
+
price: string;
|
|
23
|
+
priceAmount: number;
|
|
24
|
+
currencyCode: string;
|
|
25
|
+
period: ProductPeriod | null;
|
|
26
|
+
periodCount: number;
|
|
27
|
+
/** ISO-8601 duration, e.g. "P1Y". null for non-subscriptions. */
|
|
28
|
+
periodIso: string | null;
|
|
29
|
+
introOffer?: {
|
|
30
|
+
price: string;
|
|
31
|
+
priceAmount: number;
|
|
32
|
+
period: ProductPeriod;
|
|
33
|
+
periodCount: number;
|
|
34
|
+
cycles: number;
|
|
35
|
+
};
|
|
36
|
+
trial?: {
|
|
37
|
+
period: ProductPeriod;
|
|
38
|
+
periodCount: number;
|
|
39
|
+
days: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Computed by the SDK, never by an adapter — so every provider produces
|
|
44
|
+
* identical semantics and formatting.
|
|
45
|
+
*/
|
|
46
|
+
export type DerivedProductFields = {
|
|
47
|
+
pricePerWeek?: string;
|
|
48
|
+
pricePerWeekAmount?: number;
|
|
49
|
+
pricePerMonth?: string;
|
|
50
|
+
pricePerMonthAmount?: number;
|
|
51
|
+
pricePerYear?: string;
|
|
52
|
+
pricePerYearAmount?: number;
|
|
53
|
+
/** Whole percent cheaper than `compareTo`, normalized per day. Absent if not cheaper. */
|
|
54
|
+
savingsPct?: number;
|
|
55
|
+
trialDays?: number;
|
|
56
|
+
};
|
|
57
|
+
export type ProductWithDerived = ResolvedProduct & DerivedProductFields;
|
|
58
|
+
export type PurchaseResult = {
|
|
59
|
+
status: "purchased";
|
|
60
|
+
productKey: string;
|
|
61
|
+
entitlements?: string[];
|
|
62
|
+
} | {
|
|
63
|
+
status: "cancelled";
|
|
64
|
+
} | {
|
|
65
|
+
status: "pending";
|
|
66
|
+
} | {
|
|
67
|
+
status: "error";
|
|
68
|
+
error: Error;
|
|
69
|
+
};
|
|
70
|
+
export type RestoreResult = {
|
|
71
|
+
status: "restored";
|
|
72
|
+
entitlements: string[];
|
|
73
|
+
} | {
|
|
74
|
+
status: "nothing_to_restore";
|
|
75
|
+
} | {
|
|
76
|
+
status: "error";
|
|
77
|
+
error: Error;
|
|
78
|
+
};
|
|
79
|
+
/** The vendor seam. Implement this to back paywalls with any billing SDK. */
|
|
80
|
+
export interface ProductProvider {
|
|
81
|
+
getProducts(refs: ProductRef[]): Promise<ResolvedProduct[]>;
|
|
82
|
+
purchase(product: ResolvedProduct): Promise<PurchaseResult>;
|
|
83
|
+
restore(): Promise<RestoreResult>;
|
|
84
|
+
}
|
|
85
|
+
export type ProductStatus = "idle" | "loading" | "ready" | "error";
|
|
86
|
+
/** What a host puts on ScreenHost.products; what press actions dispatch through. */
|
|
87
|
+
export type ProductRuntime = {
|
|
88
|
+
products: Record<string, ProductWithDerived>;
|
|
89
|
+
status: ProductStatus;
|
|
90
|
+
error?: string;
|
|
91
|
+
/** In-flight purchase guard, surfaced as the `products.purchasing` variable. */
|
|
92
|
+
purchasing: boolean;
|
|
93
|
+
purchase: (key: string) => Promise<PurchaseResult>;
|
|
94
|
+
restore: () => Promise<RestoreResult>;
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@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AAG,OAAO,GAAG,OAAO,CAAC;AAEnE,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC7C,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACnD,OAAO,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/products/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProductProvider, ProductRef, ProductRuntime } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `refs` through `provider` once per (refs, provider) pair and exposes
|
|
4
|
+
* a referentially stable ProductRuntime.
|
|
5
|
+
*
|
|
6
|
+
* Stability matters: this object lands in RenderContext's dependency array, so
|
|
7
|
+
* an identity change on every render would re-render every memoized element on
|
|
8
|
+
* every variable write — undoing the Phase 1 memoization work. It is memoized on
|
|
9
|
+
* its actual contents, and purchase/restore are useCallback-stable.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useProducts: (refs: ProductRef[] | undefined, provider: ProductProvider | undefined, locale?: string) => ProductRuntime;
|
|
12
|
+
//# sourceMappingURL=useProducts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../src/products/useProducts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,cAAc,EAKf,MAAM,SAAS,CAAC;AAIjB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,UAAU,EAAE,GAAG,SAAS,EAC9B,UAAU,eAAe,GAAG,SAAS,EACrC,SAAS,MAAM,KACd,cA8EF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useProducts = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const derive_1 = require("./derive");
|
|
6
|
+
const EMPTY_PRODUCTS = {};
|
|
7
|
+
/**
|
|
8
|
+
* Resolves `refs` through `provider` once per (refs, provider) pair and exposes
|
|
9
|
+
* a referentially stable ProductRuntime.
|
|
10
|
+
*
|
|
11
|
+
* Stability matters: this object lands in RenderContext's dependency array, so
|
|
12
|
+
* an identity change on every render would re-render every memoized element on
|
|
13
|
+
* every variable write — undoing the Phase 1 memoization work. It is memoized on
|
|
14
|
+
* its actual contents, and purchase/restore are useCallback-stable.
|
|
15
|
+
*/
|
|
16
|
+
const useProducts = (refs, provider, locale) => {
|
|
17
|
+
const [products, setProducts] = (0, react_1.useState)(EMPTY_PRODUCTS);
|
|
18
|
+
const [status, setStatus] = (0, react_1.useState)("idle");
|
|
19
|
+
const [error, setError] = (0, react_1.useState)(undefined);
|
|
20
|
+
const [purchasing, setPurchasing] = (0, react_1.useState)(false);
|
|
21
|
+
// Refs so the callbacks below never need to be re-created.
|
|
22
|
+
const productsRef = (0, react_1.useRef)(products);
|
|
23
|
+
productsRef.current = products;
|
|
24
|
+
const providerRef = (0, react_1.useRef)(provider);
|
|
25
|
+
providerRef.current = provider;
|
|
26
|
+
// Key the effect on the refs' identity CONTENT, not the array identity — a
|
|
27
|
+
// host passing an inline array literal would otherwise refetch every render.
|
|
28
|
+
const refsKey = (0, react_1.useMemo)(() => (refs !== null && refs !== void 0 ? refs : []).map((r) => { var _a, _b, _c; return `${r.key}|${(_a = r.ios) !== null && _a !== void 0 ? _a : ""}|${(_b = r.android) !== null && _b !== void 0 ? _b : ""}|${(_c = r.compareTo) !== null && _c !== void 0 ? _c : ""}`; }).join(","), [refs]);
|
|
29
|
+
const refsRef = (0, react_1.useRef)(refs);
|
|
30
|
+
refsRef.current = refs;
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
const current = refsRef.current;
|
|
33
|
+
const prov = providerRef.current;
|
|
34
|
+
if (!prov || !current || current.length === 0) {
|
|
35
|
+
setStatus("idle");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let cancelled = false;
|
|
39
|
+
setStatus("loading");
|
|
40
|
+
setError(undefined);
|
|
41
|
+
prov
|
|
42
|
+
.getProducts(current)
|
|
43
|
+
.then((resolved) => {
|
|
44
|
+
if (cancelled)
|
|
45
|
+
return;
|
|
46
|
+
setProducts((0, derive_1.deriveAll)(resolved, current, locale));
|
|
47
|
+
setStatus("ready");
|
|
48
|
+
})
|
|
49
|
+
.catch((e) => {
|
|
50
|
+
if (cancelled)
|
|
51
|
+
return;
|
|
52
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
53
|
+
setStatus("error");
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
cancelled = true;
|
|
57
|
+
};
|
|
58
|
+
}, [refsKey, locale]);
|
|
59
|
+
const purchase = (0, react_1.useCallback)(async (key) => {
|
|
60
|
+
const prov = providerRef.current;
|
|
61
|
+
const product = productsRef.current[key];
|
|
62
|
+
if (!prov || !product) {
|
|
63
|
+
return { status: "error", error: new Error(`No resolved product for key "${key}"`) };
|
|
64
|
+
}
|
|
65
|
+
setPurchasing(true);
|
|
66
|
+
try {
|
|
67
|
+
return await prov.purchase(product);
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
return { status: "error", error: e instanceof Error ? e : new Error(String(e)) };
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
setPurchasing(false);
|
|
74
|
+
}
|
|
75
|
+
}, []);
|
|
76
|
+
const restore = (0, react_1.useCallback)(async () => {
|
|
77
|
+
const prov = providerRef.current;
|
|
78
|
+
if (!prov)
|
|
79
|
+
return { status: "error", error: new Error("No ProductProvider") };
|
|
80
|
+
try {
|
|
81
|
+
return await prov.restore();
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
return { status: "error", error: e instanceof Error ? e : new Error(String(e)) };
|
|
85
|
+
}
|
|
86
|
+
}, []);
|
|
87
|
+
return (0, react_1.useMemo)(() => ({ products, status, error, purchasing, purchase, restore }), [products, status, error, purchasing, purchase, restore]);
|
|
88
|
+
};
|
|
89
|
+
exports.useProducts = useProducts;
|
|
90
|
+
//# sourceMappingURL=useProducts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProducts.js","sourceRoot":"","sources":["../../src/products/useProducts.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAC1E,qCAAqC;AAWrC,MAAM,cAAc,GAAuC,EAAE,CAAC;AAE9D;;;;;;;;GAQG;AACI,MAAM,WAAW,GAAG,CACzB,IAA8B,EAC9B,QAAqC,EACrC,MAAe,EACC,EAAE;IAClB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAqC,cAAc,CAAC,CAAC;IAC7F,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAgB,MAAM,CAAC,CAAC;IAC5D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAqB,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,2DAA2D;IAC3D,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC/B,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE/B,2EAA2E;IAC3E,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,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9E,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAClE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,CACzD,CAAC;AACJ,CAAC,CAAC;AAlFW,QAAA,WAAW,eAkFtB"}
|
|
@@ -288,30 +288,7 @@ export declare const AnimatedTextElementPropsSchema: z.ZodObject<{
|
|
|
288
288
|
degrees: z.ZodOptional<z.ZodNumber>;
|
|
289
289
|
}, z.core.$strip>>;
|
|
290
290
|
}, z.core.$strip>>;
|
|
291
|
-
onPress: z.ZodOptional<z.ZodArray<z.
|
|
292
|
-
type: z.ZodLiteral<"custom">;
|
|
293
|
-
function: z.ZodString;
|
|
294
|
-
variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
295
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
296
|
-
type: z.ZodLiteral<"setVariable">;
|
|
297
|
-
name: z.ZodString;
|
|
298
|
-
value: z.ZodString;
|
|
299
|
-
label: z.ZodOptional<z.ZodString>;
|
|
300
|
-
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
301
|
-
literal: "literal";
|
|
302
|
-
expression: "expression";
|
|
303
|
-
}>>;
|
|
304
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
305
|
-
string: "string";
|
|
306
|
-
int: "int";
|
|
307
|
-
float: "float";
|
|
308
|
-
}>>;
|
|
309
|
-
arrayOp: z.ZodOptional<z.ZodEnum<{
|
|
310
|
-
append: "append";
|
|
311
|
-
remove: "remove";
|
|
312
|
-
toggle: "toggle";
|
|
313
|
-
}>>;
|
|
314
|
-
}, z.core.$strip>]>>>;
|
|
291
|
+
onPress: z.ZodOptional<z.ZodArray<z.ZodType<import("./ButtonElement").ButtonAction, unknown, z.core.$ZodTypeInternals<import("./ButtonElement").ButtonAction, unknown>>>>;
|
|
315
292
|
from: z.ZodOptional<z.ZodNumber>;
|
|
316
293
|
to: z.ZodNumber;
|
|
317
294
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedTextElement.d.ts","sourceRoot":"","sources":["../../../src/screens/elements/AnimatedTextElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAsB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,IAAI,CAAC,E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C,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBzC,CAAC"}
|
|
@@ -468,29 +468,6 @@ export declare const BaseBoxPropsSchema: z.ZodObject<{
|
|
|
468
468
|
degrees: z.ZodOptional<z.ZodNumber>;
|
|
469
469
|
}, z.core.$strip>>;
|
|
470
470
|
}, z.core.$strip>>;
|
|
471
|
-
onPress: z.ZodOptional<z.ZodArray<z.
|
|
472
|
-
type: z.ZodLiteral<"custom">;
|
|
473
|
-
function: z.ZodString;
|
|
474
|
-
variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
475
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
476
|
-
type: z.ZodLiteral<"setVariable">;
|
|
477
|
-
name: z.ZodString;
|
|
478
|
-
value: z.ZodString;
|
|
479
|
-
label: z.ZodOptional<z.ZodString>;
|
|
480
|
-
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
481
|
-
literal: "literal";
|
|
482
|
-
expression: "expression";
|
|
483
|
-
}>>;
|
|
484
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
485
|
-
string: "string";
|
|
486
|
-
int: "int";
|
|
487
|
-
float: "float";
|
|
488
|
-
}>>;
|
|
489
|
-
arrayOp: z.ZodOptional<z.ZodEnum<{
|
|
490
|
-
append: "append";
|
|
491
|
-
remove: "remove";
|
|
492
|
-
toggle: "toggle";
|
|
493
|
-
}>>;
|
|
494
|
-
}, z.core.$strip>]>>>;
|
|
471
|
+
onPress: z.ZodOptional<z.ZodArray<z.ZodType<ButtonAction, unknown, z.core.$ZodTypeInternals<ButtonAction, unknown>>>>;
|
|
495
472
|
}, z.core.$strip>;
|
|
496
473
|
//# sourceMappingURL=BaseBoxProps.d.ts.map
|