@rocapine/react-native-onboarding 1.71.0 → 1.72.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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/paywalls/types.d.ts +64 -1
- package/dist/paywalls/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/paywalls/types.ts +63 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type { Condition } from "./evaluateCondition";
|
|
|
16
16
|
export type { LeafCondition, ConditionGroup, ConditionValue, ConditionOperator, Branch, NextStep, } from "./steps/common.types";
|
|
17
17
|
export { BaseStepTypeSchema, LeafConditionSchema, ConditionGroupSchema, BranchSchema, NextStepSchema, ConditionOperatorSchema, ConditionValueSchema, UNARY_CONDITION_OPERATORS, isUnaryConditionOperator, ONBOARDING_END_STEP_ID, } from "./steps/common.types";
|
|
18
18
|
export * from "./products";
|
|
19
|
-
export type { Paywall, PaywallCatalog, PaywallOptions, GetPaywallsResponseHeaders, PresentResult, PresentErrorReason, } from "./paywalls/types";
|
|
19
|
+
export type { Paywall, PaywallCustomPayload, PaywallCatalog, PaywallOptions, GetPaywallsResponseHeaders, PresentResult, PresentErrorReason, } from "./paywalls/types";
|
|
20
20
|
export { PaywallProvider, usePaywallHost } from "./paywalls/PaywallProvider";
|
|
21
21
|
export type { PaywallContextValue } from "./paywalls/PaywallProvider";
|
|
22
22
|
export { usePaywall } from "./paywalls/usePaywall";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,4BAA4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AA,wBAAwB,OAAA;AACxB,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,gHAAA,uBAAuB,OAAA;AAEzB,+EAA+E;AAC/E,2EAA2E;AAC3E,qDAI+B;AAH7B,wHAAA,yBAAyB,OAAA;AACzB,wHAAA,yBAAyB,OAAA;AACzB,uHAAA,wBAAwB,OAAA;AAG1B,sBAAsB;AACtB,0CAAwB;AAGxB,0EAAyE;AAAhE,sHAAA,iBAAiB,OAAA;AAC1B,YAAY;AACZ,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,yDAAwF;AAA/E,sHAAA,iBAAiB,OAAA;AAAE,iHAAA,YAAY,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAU1D,qDAW8B;AAV5B,kHAAA,kBAAkB,OAAA;AAClB,mHAAA,mBAAmB,OAAA;AACnB,oHAAA,oBAAoB,OAAA;AACpB,4GAAA,YAAY,OAAA;AACZ,8GAAA,cAAc,OAAA;AACd,uHAAA,uBAAuB,OAAA;AACvB,oHAAA,oBAAoB,OAAA;AACpB,yHAAA,yBAAyB,OAAA;AACzB,wHAAA,wBAAwB,OAAA;AACxB,sHAAA,sBAAsB,OAAA;AAExB,oEAAoE;AACpE,6CAA2B;AAe3B,8DAA6E;AAApE,kHAAA,eAAe,OAAA;AAAE,iHAAA,cAAc,OAAA;AAExC,oDAAmD;AAA1C,wGAAA,UAAU,OAAA"}
|
package/dist/paywalls/types.d.ts
CHANGED
|
@@ -41,7 +41,62 @@ export type Paywall = {
|
|
|
41
41
|
stripe?: StripeProductRef;
|
|
42
42
|
}>;
|
|
43
43
|
configuration: Record<string, unknown> | null;
|
|
44
|
+
/**
|
|
45
|
+
* Who draws this paywall. `"elements"` (the default) renders the authored
|
|
46
|
+
* `elements` tree; `"custom"` hands it to a screen the HOST registered under
|
|
47
|
+
* `customScreenId` (see `PaywallHost`'s `customScreens` prop in the UI
|
|
48
|
+
* package), and `elements` is then ignored entirely.
|
|
49
|
+
*
|
|
50
|
+
* A property of the PAYWALL, not the moment — the same reasoning as
|
|
51
|
+
* `billing` above: one moment audience can weight an element-tree variant
|
|
52
|
+
* against a native-screen variant and ramp the change as an A/B test.
|
|
53
|
+
*
|
|
54
|
+
* OPTIONAL, and absent means `"elements"`. Not because the studio omits it
|
|
55
|
+
* (it always sends a value) but because a device on a NEW SDK can be talking
|
|
56
|
+
* to an OLDER `get-paywalls` that predates the field. Treating absent as
|
|
57
|
+
* `"custom"`, or as an error, would break every existing paywall on that
|
|
58
|
+
* pairing; treating it as `"elements"` is exactly the old behaviour.
|
|
59
|
+
*/
|
|
60
|
+
renderMode?: "elements" | "custom";
|
|
61
|
+
/**
|
|
62
|
+
* Which host-registered screen renders this paywall. Meaningful only when
|
|
63
|
+
* `renderMode` is `"custom"`.
|
|
64
|
+
*
|
|
65
|
+
* Nullable as well as optional: the studio accepts a custom paywall with no
|
|
66
|
+
* screen id (it warns rather than refusing), so an empty value is a state
|
|
67
|
+
* that genuinely arrives. `PaywallHost` reports it as
|
|
68
|
+
* `{ status: "error", reason: "unknown-custom-screen" }` rather than opening
|
|
69
|
+
* an empty full-screen Modal.
|
|
70
|
+
*/
|
|
71
|
+
customScreenId?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* The product map handed to that screen: slot key to per-platform store
|
|
74
|
+
* product id. This is the one thing a native paywall cannot get from
|
|
75
|
+
* anywhere else — the moment waterfall picked THIS variant, and which
|
|
76
|
+
* products it offers is an authoring decision, not something compiled into
|
|
77
|
+
* the app.
|
|
78
|
+
*
|
|
79
|
+
* Deliberately NOT the same thing as `products` above. Those slots exist to
|
|
80
|
+
* feed `{{product.<key>.price}}` interpolation into an element tree, and a
|
|
81
|
+
* custom screen has no interpolation — so a custom paywall carries product
|
|
82
|
+
* IDS and no prices, and the SDK resolves no store products for it at all
|
|
83
|
+
* (`collectProductRefs` does not walk this map). A native paywall asks the
|
|
84
|
+
* store for its own display prices, which is exactly what it does not need
|
|
85
|
+
* the studio for.
|
|
86
|
+
*/
|
|
87
|
+
customPayload?: PaywallCustomPayload;
|
|
44
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* `Paywall.customPayload` — slot key to per-platform product id.
|
|
91
|
+
*
|
|
92
|
+
* Both platform fields are optional: a paywall shipped on one platform only is
|
|
93
|
+
* legitimate, and so is a key whose ids have not been filled in yet (the
|
|
94
|
+
* studio warns about that rather than refusing to save it).
|
|
95
|
+
*/
|
|
96
|
+
export type PaywallCustomPayload = Record<string, {
|
|
97
|
+
ios?: string;
|
|
98
|
+
android?: string;
|
|
99
|
+
}>;
|
|
45
100
|
/** Full response body of `GET get-paywalls`. */
|
|
46
101
|
export type PaywallCatalog = {
|
|
47
102
|
metadata: {
|
|
@@ -147,8 +202,16 @@ export interface GetPaywallsResponseHeaders {
|
|
|
147
202
|
* Modal, a `presentation: "modal"` route, a StoreKit alert).
|
|
148
203
|
* - `paywall-disappeared` — the moment vanished from the catalog while it
|
|
149
204
|
* was on screen (a studio publish, or a query-key change mid-presentation).
|
|
205
|
+
* - `unknown-custom-screen` — the paywall is `renderMode: "custom"` and names
|
|
206
|
+
* a `customScreenId` this host did not register (or names none at all), so
|
|
207
|
+
* there was nothing to render and the Modal was never opened. Deliberately
|
|
208
|
+
* NOT folded into `parse-error`: that one is a CMS **data** bug the author
|
|
209
|
+
* must fix, this is a HOST **wiring** bug the app must fix — opposite
|
|
210
|
+
* remedies, and conflating them is the exact mistake this union's split
|
|
211
|
+
* already exists to avoid. `PaywallHost` logs both the missing id and the
|
|
212
|
+
* ids that ARE registered, which is usually the whole diagnosis.
|
|
150
213
|
*/
|
|
151
|
-
export type PresentErrorReason = "unknown-moment" | "already-presenting" | "parse-error" | "render-error" | "host-never-presented" | "paywall-disappeared";
|
|
214
|
+
export type PresentErrorReason = "unknown-moment" | "already-presenting" | "parse-error" | "render-error" | "host-never-presented" | "paywall-disappeared" | "unknown-custom-screen";
|
|
152
215
|
export type PresentResult = {
|
|
153
216
|
status: "purchased" | "dismissed" | "cancelled" | "error";
|
|
154
217
|
/** Why it failed. Set on `"error"` only — see `PresentErrorReason`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/paywalls/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0FAA0F;IAC1F,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;KAC3B,CAAC,CAAC;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/paywalls/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,E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ACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,0BAA0B;IACzC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IAC1D,uEAAuE;IACvE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocapine/react-native-onboarding",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.72.0",
|
|
4
4
|
"description": "Headless React Native SDK for Rocapine Onboarding Studio - Data fetching, state management, and hooks",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -90,6 +90,9 @@ export * from "./products";
|
|
|
90
90
|
// Paywalls (paywall phase 5) — catalog types, provider, and the `usePaywall` hook
|
|
91
91
|
export type {
|
|
92
92
|
Paywall,
|
|
93
|
+
// Exported so a host's custom paywall screen can type the product map it
|
|
94
|
+
// receives without restating the shape.
|
|
95
|
+
PaywallCustomPayload,
|
|
93
96
|
PaywallCatalog,
|
|
94
97
|
PaywallOptions,
|
|
95
98
|
GetPaywallsResponseHeaders,
|
package/src/paywalls/types.ts
CHANGED
|
@@ -43,8 +43,61 @@ export type Paywall = {
|
|
|
43
43
|
stripe?: StripeProductRef;
|
|
44
44
|
}>;
|
|
45
45
|
configuration: Record<string, unknown> | null;
|
|
46
|
+
/**
|
|
47
|
+
* Who draws this paywall. `"elements"` (the default) renders the authored
|
|
48
|
+
* `elements` tree; `"custom"` hands it to a screen the HOST registered under
|
|
49
|
+
* `customScreenId` (see `PaywallHost`'s `customScreens` prop in the UI
|
|
50
|
+
* package), and `elements` is then ignored entirely.
|
|
51
|
+
*
|
|
52
|
+
* A property of the PAYWALL, not the moment — the same reasoning as
|
|
53
|
+
* `billing` above: one moment audience can weight an element-tree variant
|
|
54
|
+
* against a native-screen variant and ramp the change as an A/B test.
|
|
55
|
+
*
|
|
56
|
+
* OPTIONAL, and absent means `"elements"`. Not because the studio omits it
|
|
57
|
+
* (it always sends a value) but because a device on a NEW SDK can be talking
|
|
58
|
+
* to an OLDER `get-paywalls` that predates the field. Treating absent as
|
|
59
|
+
* `"custom"`, or as an error, would break every existing paywall on that
|
|
60
|
+
* pairing; treating it as `"elements"` is exactly the old behaviour.
|
|
61
|
+
*/
|
|
62
|
+
renderMode?: "elements" | "custom";
|
|
63
|
+
/**
|
|
64
|
+
* Which host-registered screen renders this paywall. Meaningful only when
|
|
65
|
+
* `renderMode` is `"custom"`.
|
|
66
|
+
*
|
|
67
|
+
* Nullable as well as optional: the studio accepts a custom paywall with no
|
|
68
|
+
* screen id (it warns rather than refusing), so an empty value is a state
|
|
69
|
+
* that genuinely arrives. `PaywallHost` reports it as
|
|
70
|
+
* `{ status: "error", reason: "unknown-custom-screen" }` rather than opening
|
|
71
|
+
* an empty full-screen Modal.
|
|
72
|
+
*/
|
|
73
|
+
customScreenId?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* The product map handed to that screen: slot key to per-platform store
|
|
76
|
+
* product id. This is the one thing a native paywall cannot get from
|
|
77
|
+
* anywhere else — the moment waterfall picked THIS variant, and which
|
|
78
|
+
* products it offers is an authoring decision, not something compiled into
|
|
79
|
+
* the app.
|
|
80
|
+
*
|
|
81
|
+
* Deliberately NOT the same thing as `products` above. Those slots exist to
|
|
82
|
+
* feed `{{product.<key>.price}}` interpolation into an element tree, and a
|
|
83
|
+
* custom screen has no interpolation — so a custom paywall carries product
|
|
84
|
+
* IDS and no prices, and the SDK resolves no store products for it at all
|
|
85
|
+
* (`collectProductRefs` does not walk this map). A native paywall asks the
|
|
86
|
+
* store for its own display prices, which is exactly what it does not need
|
|
87
|
+
* the studio for.
|
|
88
|
+
*/
|
|
89
|
+
customPayload?: PaywallCustomPayload;
|
|
46
90
|
};
|
|
47
91
|
|
|
92
|
+
/**
|
|
93
|
+
* `Paywall.customPayload` — slot key to per-platform product id.
|
|
94
|
+
*
|
|
95
|
+
* Both platform fields are optional: a paywall shipped on one platform only is
|
|
96
|
+
* legitimate, and so is a key whose ids have not been filled in yet (the
|
|
97
|
+
* studio warns about that rather than refusing to save it).
|
|
98
|
+
*/
|
|
99
|
+
export type PaywallCustomPayload = Record<string, { ios?: string; android?: string }>;
|
|
100
|
+
|
|
48
101
|
/** Full response body of `GET get-paywalls`. */
|
|
49
102
|
export type PaywallCatalog = {
|
|
50
103
|
metadata: {
|
|
@@ -153,6 +206,14 @@ export interface GetPaywallsResponseHeaders {
|
|
|
153
206
|
* Modal, a `presentation: "modal"` route, a StoreKit alert).
|
|
154
207
|
* - `paywall-disappeared` — the moment vanished from the catalog while it
|
|
155
208
|
* was on screen (a studio publish, or a query-key change mid-presentation).
|
|
209
|
+
* - `unknown-custom-screen` — the paywall is `renderMode: "custom"` and names
|
|
210
|
+
* a `customScreenId` this host did not register (or names none at all), so
|
|
211
|
+
* there was nothing to render and the Modal was never opened. Deliberately
|
|
212
|
+
* NOT folded into `parse-error`: that one is a CMS **data** bug the author
|
|
213
|
+
* must fix, this is a HOST **wiring** bug the app must fix — opposite
|
|
214
|
+
* remedies, and conflating them is the exact mistake this union's split
|
|
215
|
+
* already exists to avoid. `PaywallHost` logs both the missing id and the
|
|
216
|
+
* ids that ARE registered, which is usually the whole diagnosis.
|
|
156
217
|
*/
|
|
157
218
|
export type PresentErrorReason =
|
|
158
219
|
| "unknown-moment"
|
|
@@ -160,7 +221,8 @@ export type PresentErrorReason =
|
|
|
160
221
|
| "parse-error"
|
|
161
222
|
| "render-error"
|
|
162
223
|
| "host-never-presented"
|
|
163
|
-
| "paywall-disappeared"
|
|
224
|
+
| "paywall-disappeared"
|
|
225
|
+
| "unknown-custom-screen";
|
|
164
226
|
|
|
165
227
|
export type PresentResult = {
|
|
166
228
|
status: "purchased" | "dismissed" | "cancelled" | "error";
|