@rocapine/react-native-onboarding 1.0.0 → 1.1.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/README.md +12 -4
- package/dist/OnboardingStudioClient.d.ts.map +1 -1
- package/dist/OnboardingStudioClient.js +8 -2
- package/dist/OnboardingStudioClient.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/onboarding-example.d.ts +149 -0
- package/dist/onboarding-example.d.ts.map +1 -0
- package/dist/onboarding-example.js +116 -0
- package/dist/onboarding-example.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/OnboardingStudioClient.ts +15 -2
- package/src/index.ts +1 -1
- package/src/onboarding-example.ts +115 -0
- package/src/types.ts +4 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @rocapine/react-native-onboarding
|
|
1
|
+
# @rocapine/react-native-onboarding
|
|
2
2
|
|
|
3
3
|
**A CMS-driven onboarding system for React Native mobile apps.**
|
|
4
4
|
|
|
@@ -23,7 +23,7 @@ Build beautiful, customizable onboarding flows that update instantly without app
|
|
|
23
23
|
### Installation
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npm install @rocapine/react-native-onboarding
|
|
26
|
+
npm install @rocapine/react-native-onboarding
|
|
27
27
|
npx expo install expo-router
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
OnboardingProvider,
|
|
35
35
|
OnboardingStudioClient,
|
|
36
36
|
ProgressBar,
|
|
37
|
-
} from "@rocapine/react-native-onboarding
|
|
37
|
+
} from "@rocapine/react-native-onboarding";
|
|
38
38
|
|
|
39
39
|
const client = new OnboardingStudioClient("your-project-id", {
|
|
40
40
|
appVersion: "1.0.0",
|
|
@@ -60,7 +60,7 @@ export default function RootLayout() {
|
|
|
60
60
|
import {
|
|
61
61
|
useOnboardingQuestions,
|
|
62
62
|
OnboardingPage,
|
|
63
|
-
} from "@rocapine/react-native-onboarding
|
|
63
|
+
} from "@rocapine/react-native-onboarding";
|
|
64
64
|
|
|
65
65
|
export default function OnboardingScreen() {
|
|
66
66
|
const { step, isLastStep } = useOnboardingQuestions({ stepNumber: 1 });
|
|
@@ -201,6 +201,14 @@ npm start
|
|
|
201
201
|
|
|
202
202
|
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
203
203
|
|
|
204
|
+
### Publishing:
|
|
205
|
+
|
|
206
|
+
- Bump version and commit "chore: bump version"
|
|
207
|
+
- Publish
|
|
208
|
+
```
|
|
209
|
+
npm publish --access public
|
|
210
|
+
```
|
|
211
|
+
|
|
204
212
|
---
|
|
205
213
|
|
|
206
214
|
## 📧 Support
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingStudioClient.d.ts","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,EAC7B,iBAAiB,EACjB,YAAY,EACb,MAAM,SAAS,CAAC;AAIjB,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,6BAA6B,CAAC;gBAElC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,6BAA6B;IAS/D,QAAQ,CAAC,QAAQ,SAAS,YAAY,GAAG,kBAAkB,EAC/D,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QAAC,OAAO,EAAE,uBAAuB,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"OnboardingStudioClient.d.ts","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,EAC7B,iBAAiB,EACjB,YAAY,EACb,MAAM,SAAS,CAAC;AAIjB,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,6BAA6B,CAAC;gBAElC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,6BAA6B;IAS/D,QAAQ,CAAC,QAAQ,SAAS,YAAY,GAAG,kBAAkB,EAC/D,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QAAC,OAAO,EAAE,uBAAuB,CAAA;KAAE,CAAC;CA2E7E"}
|
|
@@ -37,7 +37,12 @@ class OnboardingStudioClient {
|
|
|
37
37
|
const url = `${this.baseUrl}/get-onboarding-steps?${urlParams.toString()}`;
|
|
38
38
|
console.info("OnboardingStudioClient getSteps url", url);
|
|
39
39
|
try {
|
|
40
|
-
const response = await
|
|
40
|
+
const response = await Promise.race(this.options.timeout
|
|
41
|
+
? [
|
|
42
|
+
fetch(url),
|
|
43
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("timeout")), this.options.timeout)),
|
|
44
|
+
]
|
|
45
|
+
: [fetch(url)]);
|
|
41
46
|
if (!response.ok) {
|
|
42
47
|
throw new Error(`Failed to fetch onboarding steps: ${response.status} ${response.statusText}`);
|
|
43
48
|
}
|
|
@@ -52,8 +57,9 @@ class OnboardingStudioClient {
|
|
|
52
57
|
};
|
|
53
58
|
}
|
|
54
59
|
catch (error) {
|
|
55
|
-
console.error(error);
|
|
60
|
+
console.error("OnboardingStudioClient getSteps error", error);
|
|
56
61
|
if (this.options.fallbackOnboarding) {
|
|
62
|
+
console.warn("OnboardingStudioClient getSteps fallback onboarding");
|
|
57
63
|
return {
|
|
58
64
|
data: this.options.fallbackOnboarding,
|
|
59
65
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingStudioClient.js","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":";;;AAUA,+CAAwC;AAExC,MAAa,sBAAsB;IAKjC,YAAY,SAAiB,EAAE,OAAsC;QACnE,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO;YACV,OAAO,CAAC,OAAO;gBACf,uDAAuD,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,iBAAqC,EACrC,iBAAqC;QAErC,OAAO,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAEzC,MAAM,SAAS,GAAG,IAAI,eAAe,EAAE,CAAC;QACxC,+BAA+B;QAC/B,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACzD,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACL,CAAC;QAED,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9C,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,uBAAQ,CAAC,EAAE,CAAC,CAAC;QAE1C,MAAM,UAAU,GA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ist/index.d.ts
CHANGED
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;
|
|
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,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ exports.OnboardingStudioClient = void 0;
|
|
|
19
19
|
var OnboardingStudioClient_1 = require("./OnboardingStudioClient");
|
|
20
20
|
Object.defineProperty(exports, "OnboardingStudioClient", { enumerable: true, get: function () { return OnboardingStudioClient_1.OnboardingStudioClient; } });
|
|
21
21
|
__exportStar(require("./types"), exports);
|
|
22
|
+
__exportStar(require("./onboarding-example"), exports);
|
|
22
23
|
// Hooks and providers
|
|
23
24
|
__exportStar(require("./infra"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wBAAwB;AACxB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,0CAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wBAAwB;AACxB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,0CAAwB;AACxB,uDAAqC;AACrC,sBAAsB;AACtB,0CAAwB"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export declare const onboardingExample: {
|
|
2
|
+
metadata: {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
audienceId: undefined;
|
|
6
|
+
audienceName: undefined;
|
|
7
|
+
audienceOrder: undefined;
|
|
8
|
+
draft: true;
|
|
9
|
+
};
|
|
10
|
+
steps: ({
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
payload: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
mediaSource: {
|
|
18
|
+
url: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
answers?: undefined;
|
|
22
|
+
infoBox?: undefined;
|
|
23
|
+
subtitle?: undefined;
|
|
24
|
+
multipleAnswer?: undefined;
|
|
25
|
+
pickerType?: undefined;
|
|
26
|
+
steps?: undefined;
|
|
27
|
+
variant?: undefined;
|
|
28
|
+
duration?: undefined;
|
|
29
|
+
didYouKnowImages?: undefined;
|
|
30
|
+
socialProofs?: undefined;
|
|
31
|
+
rateTheAppButtonLabel?: undefined;
|
|
32
|
+
};
|
|
33
|
+
figmaUrl: null;
|
|
34
|
+
customPayload: {};
|
|
35
|
+
continueButtonLabel: string;
|
|
36
|
+
displayProgressHeader: true;
|
|
37
|
+
} | {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
payload: {
|
|
42
|
+
title: string;
|
|
43
|
+
answers: {
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[];
|
|
47
|
+
infoBox: null;
|
|
48
|
+
subtitle: null;
|
|
49
|
+
multipleAnswer: boolean;
|
|
50
|
+
description?: undefined;
|
|
51
|
+
mediaSource?: undefined;
|
|
52
|
+
pickerType?: undefined;
|
|
53
|
+
steps?: undefined;
|
|
54
|
+
variant?: undefined;
|
|
55
|
+
duration?: undefined;
|
|
56
|
+
didYouKnowImages?: undefined;
|
|
57
|
+
socialProofs?: undefined;
|
|
58
|
+
rateTheAppButtonLabel?: undefined;
|
|
59
|
+
};
|
|
60
|
+
figmaUrl: null;
|
|
61
|
+
customPayload: {};
|
|
62
|
+
displayProgressHeader: true;
|
|
63
|
+
continueButtonLabel?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
payload: {
|
|
69
|
+
title: string;
|
|
70
|
+
pickerType: string;
|
|
71
|
+
description: string;
|
|
72
|
+
mediaSource?: undefined;
|
|
73
|
+
answers?: undefined;
|
|
74
|
+
infoBox?: undefined;
|
|
75
|
+
subtitle?: undefined;
|
|
76
|
+
multipleAnswer?: undefined;
|
|
77
|
+
steps?: undefined;
|
|
78
|
+
variant?: undefined;
|
|
79
|
+
duration?: undefined;
|
|
80
|
+
didYouKnowImages?: undefined;
|
|
81
|
+
socialProofs?: undefined;
|
|
82
|
+
rateTheAppButtonLabel?: undefined;
|
|
83
|
+
};
|
|
84
|
+
figmaUrl: null;
|
|
85
|
+
customPayload: {};
|
|
86
|
+
continueButtonLabel: string;
|
|
87
|
+
displayProgressHeader: true;
|
|
88
|
+
} | {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
type: string;
|
|
92
|
+
payload: {
|
|
93
|
+
steps: {
|
|
94
|
+
label: string;
|
|
95
|
+
completed: string;
|
|
96
|
+
}[];
|
|
97
|
+
title: string;
|
|
98
|
+
variant: string;
|
|
99
|
+
duration: number;
|
|
100
|
+
didYouKnowImages: {
|
|
101
|
+
url: string;
|
|
102
|
+
type: string;
|
|
103
|
+
}[];
|
|
104
|
+
description?: undefined;
|
|
105
|
+
mediaSource?: undefined;
|
|
106
|
+
answers?: undefined;
|
|
107
|
+
infoBox?: undefined;
|
|
108
|
+
subtitle?: undefined;
|
|
109
|
+
multipleAnswer?: undefined;
|
|
110
|
+
pickerType?: undefined;
|
|
111
|
+
socialProofs?: undefined;
|
|
112
|
+
rateTheAppButtonLabel?: undefined;
|
|
113
|
+
};
|
|
114
|
+
figmaUrl: null;
|
|
115
|
+
customPayload: {};
|
|
116
|
+
continueButtonLabel: string;
|
|
117
|
+
displayProgressHeader: false;
|
|
118
|
+
} | {
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
type: string;
|
|
122
|
+
payload: {
|
|
123
|
+
title: string;
|
|
124
|
+
subtitle: string;
|
|
125
|
+
socialProofs: {
|
|
126
|
+
content: string;
|
|
127
|
+
authorName: string;
|
|
128
|
+
numberOfStar: number;
|
|
129
|
+
}[];
|
|
130
|
+
rateTheAppButtonLabel: string;
|
|
131
|
+
description?: undefined;
|
|
132
|
+
mediaSource?: undefined;
|
|
133
|
+
answers?: undefined;
|
|
134
|
+
infoBox?: undefined;
|
|
135
|
+
multipleAnswer?: undefined;
|
|
136
|
+
pickerType?: undefined;
|
|
137
|
+
steps?: undefined;
|
|
138
|
+
variant?: undefined;
|
|
139
|
+
duration?: undefined;
|
|
140
|
+
didYouKnowImages?: undefined;
|
|
141
|
+
};
|
|
142
|
+
figmaUrl: null;
|
|
143
|
+
customPayload: {};
|
|
144
|
+
continueButtonLabel: string;
|
|
145
|
+
displayProgressHeader: false;
|
|
146
|
+
})[];
|
|
147
|
+
configuration: {};
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=onboarding-example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-example.d.ts","sourceRoot":"","sources":["../src/onboarding-example.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHR,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onboardingExample = void 0;
|
|
4
|
+
exports.onboardingExample = {
|
|
5
|
+
metadata: {
|
|
6
|
+
id: "example-onboarding",
|
|
7
|
+
name: "Example Onboarding",
|
|
8
|
+
audienceId: undefined,
|
|
9
|
+
audienceName: undefined,
|
|
10
|
+
audienceOrder: undefined,
|
|
11
|
+
draft: true,
|
|
12
|
+
},
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
id: "welcome",
|
|
16
|
+
name: "Welcome",
|
|
17
|
+
type: "MediaContent",
|
|
18
|
+
payload: {
|
|
19
|
+
title: "Welcome Test 11/12!",
|
|
20
|
+
description: "Get started with your personalized experience",
|
|
21
|
+
mediaSource: {
|
|
22
|
+
url: "https://api-ninjas.com/images/cats/abyssinian.jpg",
|
|
23
|
+
type: "image",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
figmaUrl: null,
|
|
27
|
+
customPayload: {},
|
|
28
|
+
continueButtonLabel: "Continue",
|
|
29
|
+
displayProgressHeader: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "question-favorite-color",
|
|
33
|
+
name: "Favorite Color",
|
|
34
|
+
type: "Question",
|
|
35
|
+
payload: {
|
|
36
|
+
title: "What's your favorite color?",
|
|
37
|
+
answers: [
|
|
38
|
+
{ label: "Red", value: "red" },
|
|
39
|
+
{ label: "Blue", value: "blue" },
|
|
40
|
+
{ label: "Green", value: "green" },
|
|
41
|
+
{ label: "Yellow", value: "yellow" },
|
|
42
|
+
],
|
|
43
|
+
infoBox: null,
|
|
44
|
+
subtitle: null,
|
|
45
|
+
multipleAnswer: false,
|
|
46
|
+
},
|
|
47
|
+
figmaUrl: null,
|
|
48
|
+
customPayload: {},
|
|
49
|
+
displayProgressHeader: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "picker-name",
|
|
53
|
+
name: "Name",
|
|
54
|
+
type: "Picker",
|
|
55
|
+
payload: {
|
|
56
|
+
title: "What's your name?",
|
|
57
|
+
pickerType: "name",
|
|
58
|
+
description: "",
|
|
59
|
+
},
|
|
60
|
+
figmaUrl: null,
|
|
61
|
+
customPayload: {},
|
|
62
|
+
continueButtonLabel: "Continue",
|
|
63
|
+
displayProgressHeader: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "loader-creating-profile",
|
|
67
|
+
name: "Creating Profile",
|
|
68
|
+
type: "Loader",
|
|
69
|
+
payload: {
|
|
70
|
+
steps: [
|
|
71
|
+
{
|
|
72
|
+
label: "Processing your information",
|
|
73
|
+
completed: "Information processed",
|
|
74
|
+
},
|
|
75
|
+
{ label: "Setting up your profile", completed: "Profile ready" },
|
|
76
|
+
{ label: "Preparing your experience", completed: "All set!" },
|
|
77
|
+
],
|
|
78
|
+
title: "Creating your personalized profile...",
|
|
79
|
+
variant: "bars",
|
|
80
|
+
duration: 2000,
|
|
81
|
+
didYouKnowImages: [
|
|
82
|
+
{ url: "https://picsum.photos/300/200?random=1", type: "image" },
|
|
83
|
+
{ url: "https://picsum.photos/300/200?random=2", type: "image" },
|
|
84
|
+
{ url: "https://picsum.photos/300/200?random=3", type: "image" },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
figmaUrl: null,
|
|
88
|
+
customPayload: {},
|
|
89
|
+
continueButtonLabel: "Continue",
|
|
90
|
+
displayProgressHeader: false,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "ratings-app",
|
|
94
|
+
name: "Rate the App",
|
|
95
|
+
type: "Ratings",
|
|
96
|
+
payload: {
|
|
97
|
+
title: "Enjoying the app?",
|
|
98
|
+
subtitle: "How do you rate our app?",
|
|
99
|
+
socialProofs: [
|
|
100
|
+
{
|
|
101
|
+
content: "This app is amazing! It helped me get started quickly and the experience is so smooth.",
|
|
102
|
+
authorName: "happyuser2024",
|
|
103
|
+
numberOfStar: 5,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
rateTheAppButtonLabel: "Rate the App",
|
|
107
|
+
},
|
|
108
|
+
figmaUrl: null,
|
|
109
|
+
customPayload: {},
|
|
110
|
+
continueButtonLabel: "Continue",
|
|
111
|
+
displayProgressHeader: false,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
configuration: {},
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=onboarding-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-example.js","sourceRoot":"","sources":["../src/onboarding-example.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAG;IAC/B,QAAQ,EAAE;QACR,EAAE,EAAE,oBAAoB;QACxB,IAAI,EAAE,oBAAoB;QAC1B,UAAU,EAAE,SAAS;QACrB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,SAAS;QACxB,KAAK,EAAE,IAAI;KACZ;IACD,KAAK,EAAE;QACL;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACP,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EAAE,+CAA+C;gBAC5D,WAAW,EAAE;oBACX,GAAG,EAAE,mDAAmD;oBACxD,IAAI,EAAE,OAAO;iBACd;aACF;YACD,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,EAAE;YACjB,mBAAmB,EAAE,UAAU;YAC/B,qBAAqB,EAAE,IAAI;SAC5B;QACD;YACE,EAAE,EAAE,yBAAyB;YAC7B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,6BAA6B;gBACpC,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,QA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AE,EAAE,aAAa;YACjB,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,KAAK,EAAE,mBAAmB;gBAC1B,QAAQ,EAAE,0BAA0B;gBACpC,YAAY,EAAE;oBACZ;wBACE,OAAO,EACL,wFAAwF;wBAC1F,UAAU,EAAE,eAAe;wBAC3B,YAAY,EAAE,CAAC;qBAChB;iBACF;gBACD,qBAAqB,EAAE,cAAc;aACtC;YACD,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,EAAE;YACjB,mBAAmB,EAAE,UAAU;YAC/B,qBAAqB,EAAE,KAAK;SAC7B;KACF;IACD,aAAa,EAAE,EAAE;CACG,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa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,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocapine/react-native-onboarding",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"prepare": "npm run build",
|
|
10
9
|
"watch": "tsc --watch",
|
|
11
10
|
"patch": "npm version patch && npm run build && npm publish"
|
|
12
11
|
},
|
|
@@ -59,7 +59,19 @@ export class OnboardingStudioClient {
|
|
|
59
59
|
const url = `${this.baseUrl}/get-onboarding-steps?${urlParams.toString()}`;
|
|
60
60
|
console.info("OnboardingStudioClient getSteps url", url);
|
|
61
61
|
try {
|
|
62
|
-
const response = await
|
|
62
|
+
const response = await Promise.race(
|
|
63
|
+
this.options.timeout
|
|
64
|
+
? [
|
|
65
|
+
fetch(url),
|
|
66
|
+
new Promise<Response>((_, reject) =>
|
|
67
|
+
setTimeout(
|
|
68
|
+
() => reject(new Error("timeout")),
|
|
69
|
+
this.options.timeout
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
]
|
|
73
|
+
: [fetch(url)]
|
|
74
|
+
);
|
|
63
75
|
if (!response.ok) {
|
|
64
76
|
throw new Error(
|
|
65
77
|
`Failed to fetch onboarding steps: ${response.status} ${response.statusText}`
|
|
@@ -75,8 +87,9 @@ export class OnboardingStudioClient {
|
|
|
75
87
|
},
|
|
76
88
|
};
|
|
77
89
|
} catch (error) {
|
|
78
|
-
console.error(error);
|
|
90
|
+
console.error("OnboardingStudioClient getSteps error", error);
|
|
79
91
|
if (this.options.fallbackOnboarding) {
|
|
92
|
+
console.warn("OnboardingStudioClient getSteps fallback onboarding");
|
|
80
93
|
return {
|
|
81
94
|
data: this.options.fallbackOnboarding as Onboarding<StepType>,
|
|
82
95
|
headers: {
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Onboarding } from "./types";
|
|
2
|
+
|
|
3
|
+
export const onboardingExample = {
|
|
4
|
+
metadata: {
|
|
5
|
+
id: "example-onboarding",
|
|
6
|
+
name: "Example Onboarding",
|
|
7
|
+
audienceId: undefined,
|
|
8
|
+
audienceName: undefined,
|
|
9
|
+
audienceOrder: undefined,
|
|
10
|
+
draft: true,
|
|
11
|
+
},
|
|
12
|
+
steps: [
|
|
13
|
+
{
|
|
14
|
+
id: "welcome",
|
|
15
|
+
name: "Welcome",
|
|
16
|
+
type: "MediaContent",
|
|
17
|
+
payload: {
|
|
18
|
+
title: "Welcome Test 11/12!",
|
|
19
|
+
description: "Get started with your personalized experience",
|
|
20
|
+
mediaSource: {
|
|
21
|
+
url: "https://api-ninjas.com/images/cats/abyssinian.jpg",
|
|
22
|
+
type: "image",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
figmaUrl: null,
|
|
26
|
+
customPayload: {},
|
|
27
|
+
continueButtonLabel: "Continue",
|
|
28
|
+
displayProgressHeader: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "question-favorite-color",
|
|
32
|
+
name: "Favorite Color",
|
|
33
|
+
type: "Question",
|
|
34
|
+
payload: {
|
|
35
|
+
title: "What's your favorite color?",
|
|
36
|
+
answers: [
|
|
37
|
+
{ label: "Red", value: "red" },
|
|
38
|
+
{ label: "Blue", value: "blue" },
|
|
39
|
+
{ label: "Green", value: "green" },
|
|
40
|
+
{ label: "Yellow", value: "yellow" },
|
|
41
|
+
],
|
|
42
|
+
infoBox: null,
|
|
43
|
+
subtitle: null,
|
|
44
|
+
multipleAnswer: false,
|
|
45
|
+
},
|
|
46
|
+
figmaUrl: null,
|
|
47
|
+
customPayload: {},
|
|
48
|
+
displayProgressHeader: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "picker-name",
|
|
52
|
+
name: "Name",
|
|
53
|
+
type: "Picker",
|
|
54
|
+
payload: {
|
|
55
|
+
title: "What's your name?",
|
|
56
|
+
pickerType: "name",
|
|
57
|
+
description: "",
|
|
58
|
+
},
|
|
59
|
+
figmaUrl: null,
|
|
60
|
+
customPayload: {},
|
|
61
|
+
continueButtonLabel: "Continue",
|
|
62
|
+
displayProgressHeader: true,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "loader-creating-profile",
|
|
66
|
+
name: "Creating Profile",
|
|
67
|
+
type: "Loader",
|
|
68
|
+
payload: {
|
|
69
|
+
steps: [
|
|
70
|
+
{
|
|
71
|
+
label: "Processing your information",
|
|
72
|
+
completed: "Information processed",
|
|
73
|
+
},
|
|
74
|
+
{ label: "Setting up your profile", completed: "Profile ready" },
|
|
75
|
+
{ label: "Preparing your experience", completed: "All set!" },
|
|
76
|
+
],
|
|
77
|
+
title: "Creating your personalized profile...",
|
|
78
|
+
variant: "bars",
|
|
79
|
+
duration: 2000,
|
|
80
|
+
didYouKnowImages: [
|
|
81
|
+
{ url: "https://picsum.photos/300/200?random=1", type: "image" },
|
|
82
|
+
{ url: "https://picsum.photos/300/200?random=2", type: "image" },
|
|
83
|
+
{ url: "https://picsum.photos/300/200?random=3", type: "image" },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
figmaUrl: null,
|
|
87
|
+
customPayload: {},
|
|
88
|
+
continueButtonLabel: "Continue",
|
|
89
|
+
displayProgressHeader: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "ratings-app",
|
|
93
|
+
name: "Rate the App",
|
|
94
|
+
type: "Ratings",
|
|
95
|
+
payload: {
|
|
96
|
+
title: "Enjoying the app?",
|
|
97
|
+
subtitle: "How do you rate our app?",
|
|
98
|
+
socialProofs: [
|
|
99
|
+
{
|
|
100
|
+
content:
|
|
101
|
+
"This app is amazing! It helped me get started quickly and the experience is so smooth.",
|
|
102
|
+
authorName: "happyuser2024",
|
|
103
|
+
numberOfStar: 5,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
rateTheAppButtonLabel: "Rate the App",
|
|
107
|
+
},
|
|
108
|
+
figmaUrl: null,
|
|
109
|
+
customPayload: {},
|
|
110
|
+
continueButtonLabel: "Continue",
|
|
111
|
+
displayProgressHeader: false,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
configuration: {},
|
|
115
|
+
} satisfies Onboarding;
|
package/src/types.ts
CHANGED
|
@@ -13,11 +13,14 @@ export type BaseStepType = {
|
|
|
13
13
|
figmaUrl?: string | null;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export type OnboardingStudioClientOptions<
|
|
16
|
+
export type OnboardingStudioClientOptions<
|
|
17
|
+
StepType extends BaseStepType = BaseStepType
|
|
18
|
+
> = {
|
|
17
19
|
appVersion?: string;
|
|
18
20
|
isSandbox?: boolean;
|
|
19
21
|
baseUrl?: string;
|
|
20
22
|
fallbackOnboarding?: Onboarding<StepType>;
|
|
23
|
+
timeout?: number;
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
export type OnboardingOptions = {
|