@rocapine/react-native-onboarding 1.46.0 → 1.48.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.
Files changed (40) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/infra/hooks/index.d.ts +1 -0
  6. package/dist/infra/hooks/index.d.ts.map +1 -1
  7. package/dist/infra/hooks/index.js +3 -1
  8. package/dist/infra/hooks/index.js.map +1 -1
  9. package/dist/infra/hooks/useOnboardingNavigation.d.ts +8 -0
  10. package/dist/infra/hooks/useOnboardingNavigation.d.ts.map +1 -0
  11. package/dist/infra/hooks/useOnboardingNavigation.js +13 -0
  12. package/dist/infra/hooks/useOnboardingNavigation.js.map +1 -0
  13. package/dist/infra/hooks/useOnboardingStep.d.ts.map +1 -1
  14. package/dist/infra/hooks/useOnboardingStep.js +2 -3
  15. package/dist/infra/hooks/useOnboardingStep.js.map +1 -1
  16. package/dist/infra/navigation/expoRouterAdapter.d.ts +12 -0
  17. package/dist/infra/navigation/expoRouterAdapter.d.ts.map +1 -0
  18. package/dist/infra/navigation/expoRouterAdapter.js +39 -0
  19. package/dist/infra/navigation/expoRouterAdapter.js.map +1 -0
  20. package/dist/infra/navigation/types.d.ts +17 -0
  21. package/dist/infra/navigation/types.d.ts.map +1 -0
  22. package/dist/infra/navigation/types.js +3 -0
  23. package/dist/infra/navigation/types.js.map +1 -0
  24. package/dist/infra/provider/OnboardingProvider.d.ts +10 -1
  25. package/dist/infra/provider/OnboardingProvider.d.ts.map +1 -1
  26. package/dist/infra/provider/OnboardingProvider.js +4 -1
  27. package/dist/infra/provider/OnboardingProvider.js.map +1 -1
  28. package/dist/steps/Carousel/types.d.ts +49 -0
  29. package/dist/steps/Carousel/types.d.ts.map +1 -1
  30. package/dist/steps/Carousel/types.js +17 -1
  31. package/dist/steps/Carousel/types.js.map +1 -1
  32. package/package.json +5 -1
  33. package/src/index.ts +3 -0
  34. package/src/infra/hooks/index.ts +1 -0
  35. package/src/infra/hooks/useOnboardingNavigation.ts +11 -0
  36. package/src/infra/hooks/useOnboardingStep.ts +2 -2
  37. package/src/infra/navigation/expoRouterAdapter.ts +38 -0
  38. package/src/infra/navigation/types.ts +13 -0
  39. package/src/infra/provider/OnboardingProvider.tsx +13 -0
  40. package/src/steps/Carousel/types.ts +18 -0
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export * from "./onboarding-example";
4
4
  export type { ButtonAction, CustomButtonAction, SetVariableButtonAction, ComposableVariableEntry, ComposableVariableKind, WheelPickerElementProps, WheelPickerItem, WheelPickerRange, RichTextElementProps, ProgressiveBlurImageElementProps, BlurMask, LinearBlurMask, RadialBlurMask, BlurMaskStop, BlurAppear, ProgressIndicatorElementProps, ProgressEasing, AnimationEasing, SpringConfig, EnteringPreset, ExitingPreset, LayoutPreset, EffectPreset, EnteringAnimation, ExitingAnimation, LayoutAnimation, ElementEffect, ElementAnimation, ElementTransform, } from "./steps/ComposableScreen/types";
5
5
  export { ButtonActionSchema, CustomButtonActionSchema, SetVariableButtonActionSchema, WheelPickerElementPropsSchema, generateWheelPickerRangeItems, resolveWheelPickerItems, } from "./steps/ComposableScreen/types";
6
6
  export * from "./infra";
7
+ export type { OnboardingNavigationAdapter } from "./infra/navigation/types";
8
+ export { expoRouterAdapter } from "./infra/navigation/expoRouterAdapter";
7
9
  export { resolveNextStepNumber } from "./resolveNextStepNumber";
8
10
  export { evaluateCondition, evaluateLeaf, isConditionGroup } from "./evaluateCondition";
9
11
  export type { Condition } from "./evaluateCondition";
@@ -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,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gCAAgC,EAChC,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sBAAsB,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,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gCAAgC,EAChC,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isUnaryConditionOperator = exports.UNARY_CONDITION_OPERATORS = exports.ConditionValueSchema = exports.ConditionOperatorSchema = exports.NextStepSchema = exports.BranchSchema = exports.ConditionGroupSchema = exports.LeafConditionSchema = exports.BaseStepTypeSchema = exports.isConditionGroup = exports.evaluateLeaf = exports.evaluateCondition = exports.resolveNextStepNumber = exports.resolveWheelPickerItems = exports.generateWheelPickerRangeItems = exports.WheelPickerElementPropsSchema = exports.SetVariableButtonActionSchema = exports.CustomButtonActionSchema = exports.ButtonActionSchema = exports.OnboardingStudioClient = void 0;
17
+ exports.isUnaryConditionOperator = exports.UNARY_CONDITION_OPERATORS = exports.ConditionValueSchema = exports.ConditionOperatorSchema = exports.NextStepSchema = exports.BranchSchema = exports.ConditionGroupSchema = exports.LeafConditionSchema = exports.BaseStepTypeSchema = exports.isConditionGroup = exports.evaluateLeaf = exports.evaluateCondition = exports.resolveNextStepNumber = exports.expoRouterAdapter = exports.resolveWheelPickerItems = exports.generateWheelPickerRangeItems = exports.WheelPickerElementPropsSchema = exports.SetVariableButtonActionSchema = exports.CustomButtonActionSchema = exports.ButtonActionSchema = exports.OnboardingStudioClient = void 0;
18
18
  // Core client and types
19
19
  var OnboardingStudioClient_1 = require("./OnboardingStudioClient");
20
20
  Object.defineProperty(exports, "OnboardingStudioClient", { enumerable: true, get: function () { return OnboardingStudioClient_1.OnboardingStudioClient; } });
@@ -29,6 +29,8 @@ Object.defineProperty(exports, "generateWheelPickerRangeItems", { enumerable: tr
29
29
  Object.defineProperty(exports, "resolveWheelPickerItems", { enumerable: true, get: function () { return types_1.resolveWheelPickerItems; } });
30
30
  // Hooks and providers
31
31
  __exportStar(require("./infra"), exports);
32
+ var expoRouterAdapter_1 = require("./infra/navigation/expoRouterAdapter");
33
+ Object.defineProperty(exports, "expoRouterAdapter", { enumerable: true, get: function () { return expoRouterAdapter_1.expoRouterAdapter; } });
32
34
  // Branching
33
35
  var resolveNextStepNumber_1 = require("./resolveNextStepNumber");
34
36
  Object.defineProperty(exports, "resolveNextStepNumber", { enumerable: true, get: function () { return resolveNextStepNumber_1.resolveNextStepNumber; } });
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;AACxB,uDAAqC;AAiCrC,wDAOwC;AANtC,2GAAA,kBAAkB,OAAA;AAClB,iHAAA,wBAAwB,OAAA;AACxB,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,gHAAA,uBAAuB,OAAA;AAEzB,sBAAsB;AACtB,0CAAwB;AACxB,YAAY;AACZ,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,yDAAwF;AAA/E,sHAAA,iBAAiB,OAAA;AAAE,iHAAA,YAAY,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAU1D,qDAU8B;AAT5B,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"}
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;AAiCrC,wDAOwC;AANtC,2GAAA,kBAAkB,OAAA;AAClB,iHAAA,wBAAwB,OAAA;AACxB,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,gHAAA,uBAAuB,OAAA;AAEzB,sBAAsB;AACtB,0CAAwB;AAGxB,0EAAyE;AAAhE,sHAAA,iBAAiB,OAAA;AAC1B,YAAY;AACZ,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,yDAAwF;AAA/E,sHAAA,iBAAiB,OAAA;AAAE,iHAAA,YAAY,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAU1D,qDAU8B;AAT5B,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"}
@@ -1,3 +1,4 @@
1
1
  export { useOnboardingStep } from "./useOnboardingStep";
2
2
  export { useOnboarding } from "./useOnboarding";
3
+ export { useOnboardingNavigation } from "./useOnboardingNavigation";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infra/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infra/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useOnboarding = exports.useOnboardingStep = void 0;
3
+ exports.useOnboardingNavigation = exports.useOnboarding = exports.useOnboardingStep = void 0;
4
4
  var useOnboardingStep_1 = require("./useOnboardingStep");
5
5
  Object.defineProperty(exports, "useOnboardingStep", { enumerable: true, get: function () { return useOnboardingStep_1.useOnboardingStep; } });
6
6
  var useOnboarding_1 = require("./useOnboarding");
7
7
  Object.defineProperty(exports, "useOnboarding", { enumerable: true, get: function () { return useOnboarding_1.useOnboarding; } });
8
+ var useOnboardingNavigation_1 = require("./useOnboardingNavigation");
9
+ Object.defineProperty(exports, "useOnboardingNavigation", { enumerable: true, get: function () { return useOnboardingNavigation_1.useOnboardingNavigation; } });
8
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infra/hooks/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infra/hooks/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA"}
@@ -0,0 +1,8 @@
1
+ import type { OnboardingNavigationAdapter } from "../navigation/types";
2
+ /**
3
+ * Returns the navigation adapter provided to `OnboardingProvider` (defaults to
4
+ * the expo-router adapter). Used by UI components (e.g. ProgressBar) to perform
5
+ * back navigation without importing expo-router directly.
6
+ */
7
+ export declare const useOnboardingNavigation: () => OnboardingNavigationAdapter;
8
+ //# sourceMappingURL=useOnboardingNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnboardingNavigation.d.ts","sourceRoot":"","sources":["../../../src/infra/hooks/useOnboardingNavigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAO,2BACO,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOnboardingNavigation = void 0;
4
+ const react_1 = require("react");
5
+ const OnboardingProvider_1 = require("../provider/OnboardingProvider");
6
+ /**
7
+ * Returns the navigation adapter provided to `OnboardingProvider` (defaults to
8
+ * the expo-router adapter). Used by UI components (e.g. ProgressBar) to perform
9
+ * back navigation without importing expo-router directly.
10
+ */
11
+ const useOnboardingNavigation = () => (0, react_1.useContext)(OnboardingProvider_1.OnboardingProgressContext).navigation;
12
+ exports.useOnboardingNavigation = useOnboardingNavigation;
13
+ //# sourceMappingURL=useOnboardingNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnboardingNavigation.js","sourceRoot":"","sources":["../../../src/infra/hooks/useOnboardingNavigation.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,uEAA2E;AAG3E;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,GAAgC,EAAE,CACvE,IAAA,kBAAU,EAAC,8CAAyB,CAAC,CAAC,UAAU,CAAC;AADtC,QAAA,uBAAuB,2BACe"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOnboardingStep.d.ts","sourceRoot":"","sources":["../../../src/infra/hooks/useOnboardingStep.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAc,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,YAAY,GAAG,kBAAkB,EAClD,iBAEC;IACD,UAAU,EAAE,MAAM,CAAC;CACpB,KAAG;IACF,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,KAAK,EAAE,QAAQ,EAAE,CAAC;CA8CnB,CAAC"}
1
+ {"version":3,"file":"useOnboardingStep.d.ts","sourceRoot":"","sources":["../../../src/infra/hooks/useOnboardingStep.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAc,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,YAAY,GAAG,kBAAkB,EAClD,iBAEC;IACD,UAAU,EAAE,MAAM,CAAC;CACpB,KAAG;IACF,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,KAAK,EAAE,QAAQ,EAAE,CAAC;CA+CnB,CAAC"}
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useOnboardingStep = void 0;
4
4
  const react_1 = require("react");
5
5
  const react_query_1 = require("@tanstack/react-query");
6
- const expo_router_1 = require("expo-router");
7
6
  const OnboardingProvider_1 = require("../provider/OnboardingProvider");
8
7
  const getOnboarding_query_1 = require("../queries/getOnboarding.query");
9
8
  const useOnboardingStep = ({ stepNumber, }) => {
10
9
  // Get all config from context
11
- const { client, locale, customAudienceParams, setActiveStep, setTotalSteps, setOnboarding, } = (0, react_1.useContext)(OnboardingProvider_1.OnboardingProgressContext);
10
+ const { client, locale, customAudienceParams, setActiveStep, setTotalSteps, setOnboarding, navigation, } = (0, react_1.useContext)(OnboardingProvider_1.OnboardingProgressContext);
12
11
  // Build query with config from context
13
12
  const { data } = (0, react_query_1.useSuspenseQuery)((0, getOnboarding_query_1.getOnboardingQuery)(client, locale, customAudienceParams, setOnboarding));
14
13
  const steps = data.steps;
15
14
  const onboardingMetadata = data.metadata;
16
- (0, expo_router_1.useFocusEffect)((0, react_1.useCallback)(() => {
15
+ navigation.useFocusEffect((0, react_1.useCallback)(() => {
17
16
  var _a;
18
17
  const currentStep = steps[stepNumber - 1];
19
18
  setActiveStep({
@@ -1 +1 @@
1
- {"version":3,"file":"useOnboardingStep.js","sourceRoot":"","sources":["../../../src/infra/hooks/useOnboardingStep.ts"],"names":[],"mappings":";;;AAAA,iCAAgD;AAChD,uDAAyD;AACzD,6CAA6C;AAC7C,uEAA2E;AAC3E,wEAAoE;AAI7D,MAAM,iBAAiB,GAAG,CAE/B,EACA,UAAU,GAGX,EAMC,EAAE;IACF,8BAA8B;IAC9B,MAAM,EACJ,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,GACd,GAAG,IAAA,kBAAU,EAAC,8CAAyB,CAAC,CAAC;IAE1C,uCAAuC;IACvC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,8BAAgB,EAC/B,IAAA,wCAAkB,EAChB,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,aAA2D,CAC5D,CACF,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC;IAEzC,IAAA,4BAAc,EACZ,IAAA,mBAAW,EAAC,GAAG,EAAE;;QACf,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC1C,aAAa,CAAC;YACZ,MAAM,EAAE,UAAU;YAClB,qBAAqB,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,qBAAqB,mCAAI,IAAI;SAClE,CAAC,CAAC;QACH,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CACtD,CAAC;IAEF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,UAAU,IAAI,KAAK,CAAC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AAC;IAEF,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC;IAC9C,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;IAEjC,OAAO;QACL,IAAI;QACJ,UAAU;QACV,WAAW;QACX,kBAAkB;QAClB,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,iBAAiB,qBA0D5B"}
@@ -0,0 +1,12 @@
1
+ import type { OnboardingNavigationAdapter } from "./types";
2
+ /**
3
+ * Default navigation adapter. Binds to expo-router when available, otherwise
4
+ * degrades gracefully: focus effect runs as a mount/cb-change effect and the
5
+ * back button stays hidden (`canGoBack` returns false).
6
+ *
7
+ * Fields are bound once at module load, so the hook identities are stable —
8
+ * consumers may call `adapter.useFocusEffect(...)` / `adapter.useRouter()`
9
+ * directly without breaking the rules of hooks.
10
+ */
11
+ export declare const expoRouterAdapter: OnboardingNavigationAdapter;
12
+ //# sourceMappingURL=expoRouterAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRouterAdapter.d.ts","sourceRoot":"","sources":["../../../src/infra/navigation/expoRouterAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAY3D;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,2BAe/B,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.expoRouterAdapter = void 0;
5
+ const react_1 = require("react");
6
+ // expo-router is an OPTIONAL peer dependency. Lazily require it so the SDK
7
+ // loads (and the no-op fallbacks below take over) when it is not installed.
8
+ // Precedent: Pages/ComposableScreen/elements/haptics.ts (try/require/catch).
9
+ let expoRouter;
10
+ try {
11
+ expoRouter = require("expo-router");
12
+ }
13
+ catch (_b) {
14
+ /* expo-router not installed — fall back to no-op navigation */
15
+ }
16
+ /**
17
+ * Default navigation adapter. Binds to expo-router when available, otherwise
18
+ * degrades gracefully: focus effect runs as a mount/cb-change effect and the
19
+ * back button stays hidden (`canGoBack` returns false).
20
+ *
21
+ * Fields are bound once at module load, so the hook identities are stable —
22
+ * consumers may call `adapter.useFocusEffect(...)` / `adapter.useRouter()`
23
+ * directly without breaking the rules of hooks.
24
+ */
25
+ exports.expoRouterAdapter = {
26
+ useFocusEffect: (_a = expoRouter === null || expoRouter === void 0 ? void 0 : expoRouter.useFocusEffect) !== null && _a !== void 0 ? _a : ((effect) => {
27
+ (0, react_1.useEffect)(effect, [effect]);
28
+ }),
29
+ useRouter: expoRouter
30
+ ? () => {
31
+ const router = expoRouter.useRouter();
32
+ return {
33
+ canGoBack: () => router.canGoBack(),
34
+ goBack: () => router.back(),
35
+ };
36
+ }
37
+ : () => ({ canGoBack: () => false, goBack: () => { } }),
38
+ };
39
+ //# sourceMappingURL=expoRouterAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRouterAdapter.js","sourceRoot":"","sources":["../../../src/infra/navigation/expoRouterAdapter.ts"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAGlC,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,IAAI,UAAe,CAAC;AACpB,IAAI,CAAC;IACH,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACtC,CAAC;AAAC,WAAM,CAAC;IACP,+DAA+D;AACjE,CAAC;AAED;;;;;;;;GAQG;AACU,QAAA,iBAAiB,GAAgC;IAC5D,cAAc,EACZ,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,mCAC1B,CAAC,CAAC,MAAiC,EAAE,EAAE;QACrC,IAAA,iBAAS,EAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC;IACJ,SAAS,EAAE,UAAU;QACnB,CAAC,CAAC,GAAG,EAAE;YACH,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;YACtC,OAAO;gBACL,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;gBACnC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;aAC5B,CAAC;QACJ,CAAC;QACH,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;CACzD,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Navigation abstraction injected into the SDK so it does not hard-depend on
3
+ * any particular navigation library (expo-router, react-navigation, custom).
4
+ * The default implementation binds to expo-router when present
5
+ * (see `expoRouterAdapter`); hosts can override it via
6
+ * `OnboardingProvider`'s `navigation` prop.
7
+ */
8
+ export interface OnboardingNavigationAdapter {
9
+ /** Hook: re-run `effect` when the screen gains focus (expo-router `useFocusEffect` semantics). */
10
+ useFocusEffect: (effect: () => void | (() => void)) => void;
11
+ /** Hook: returns back-navigation controls. */
12
+ useRouter: () => {
13
+ canGoBack: () => boolean;
14
+ goBack: () => void;
15
+ };
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/infra/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kGAAkG;IAClG,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC;IAC5D,8CAA8C;IAC9C,SAAS,EAAE,MAAM;QAAE,SAAS,EAAE,MAAM,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CACnE"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/infra/navigation/types.ts"],"names":[],"mappings":""}
@@ -2,6 +2,7 @@ import { OnboardingStudioClient } from "../../OnboardingStudioClient";
2
2
  import { Onboarding } from "../../types";
3
3
  import { OnboardingStepType } from "../../steps/types";
4
4
  import { ComposableVariableEntry } from "../../steps/ComposableScreen/types";
5
+ import { OnboardingNavigationAdapter } from "../navigation/types";
5
6
  export type CustomActionHandler = (args: {
6
7
  variables: Record<string, ComposableVariableEntry | undefined>;
7
8
  }) => void | Promise<void>;
@@ -24,8 +25,15 @@ interface OnboardingProviderProps {
24
25
  * Defaults to `null`.
25
26
  */
26
27
  fontsFallback?: React.ReactNode;
28
+ /**
29
+ * Navigation adapter used for back navigation (ProgressBar back button) and
30
+ * the per-step focus effect. Defaults to an expo-router-backed adapter that
31
+ * degrades to a no-op when expo-router is not installed. Inject your own to
32
+ * support a different navigation library. Must be a stable reference.
33
+ */
34
+ navigation?: OnboardingNavigationAdapter;
27
35
  }
28
- export declare const OnboardingProvider: ({ children, client, locale, customAudienceParams, customActions, fontsFallback, }: OnboardingProviderProps) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const OnboardingProvider: ({ children, client, locale, customAudienceParams, customActions, fontsFallback, navigation, }: OnboardingProviderProps) => import("react/jsx-runtime").JSX.Element;
29
37
  export declare const OnboardingProgressContext: import("react").Context<{
30
38
  activeStep: {
31
39
  number: number;
@@ -46,6 +54,7 @@ export declare const OnboardingProgressContext: import("react").Context<{
46
54
  setVariable: (name: string, value: any) => void;
47
55
  getVariables: () => Record<string, any>;
48
56
  customActions: CustomActions;
57
+ navigation: OnboardingNavigationAdapter;
49
58
  }>;
50
59
  export {};
51
60
  //# sourceMappingURL=OnboardingProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingProvider.d.ts","sourceRoot":"","sources":["../../../src/infra/provider/On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;OAKG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C;AA6CD,eAAO,MAAM,kBAAkB,GAAI,+FAQhC,uBAAuB,4CA+CzB,CAAC;AAEF,eAAO,MAAM,yBAAyB;gBACxB;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE;mBAC/C,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;gBACrE,MAAM;mBACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;YAC9B,sBAAsB;YACtB,MAAM;0BACQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gBAC7B,UAAU,CAAC,kBAAkB,CAAC,GAAG,IAAI;mBAClC,CAAC,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,KAAK,IAAI;eACxD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;iBACjB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI;kBACjC,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;mBACxB,aAAa;gBAChB,2BAA2B;EAgBvC,CAAC"}
@@ -9,6 +9,7 @@ const getOnboarding_query_1 = require("../queries/getOnboarding.query");
9
9
  const FontLoader_1 = require("./FontLoader");
10
10
  const extractAssetUrls_1 = require("../preload/extractAssetUrls");
11
11
  const preloadAssets_1 = require("../preload/preloadAssets");
12
+ const expoRouterAdapter_1 = require("../navigation/expoRouterAdapter");
12
13
  const queryClient = new react_query_1.QueryClient({
13
14
  defaultOptions: {
14
15
  queries: {
@@ -36,7 +37,7 @@ const OnboardingDataGate = ({ client, locale, customAudienceParams, setOnboardin
36
37
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fontsFallback !== null && fontsFallback !== void 0 ? fontsFallback : null });
37
38
  return ((0, jsx_runtime_1.jsx)(FontLoader_1.FontLoaderGate, { fonts: data.fonts, fallback: fontsFallback, children: children }));
38
39
  };
39
- const OnboardingProvider = ({ children, client, locale = "en", customAudienceParams = {}, customActions = {}, fontsFallback, }) => {
40
+ const OnboardingProvider = ({ children, client, locale = "en", customAudienceParams = {}, customActions = {}, fontsFallback, navigation = expoRouterAdapter_1.expoRouterAdapter, }) => {
40
41
  const [activeStep, setActiveStep] = (0, react_1.useState)({
41
42
  number: 0,
42
43
  displayProgressHeader: false,
@@ -64,6 +65,7 @@ const OnboardingProvider = ({ children, client, locale = "en", customAudiencePar
64
65
  setVariable,
65
66
  getVariables,
66
67
  customActions,
68
+ navigation,
67
69
  }, children: (0, jsx_runtime_1.jsx)(OnboardingDataGate, { client: client, locale: locale, customAudienceParams: customAudienceParams, setOnboarding: setOnboarding, fontsFallback: fontsFallback, children: children }) }) }));
68
70
  };
69
71
  exports.OnboardingProvider = OnboardingProvider;
@@ -81,5 +83,6 @@ exports.OnboardingProgressContext = (0, react_1.createContext)({
81
83
  setVariable: () => { },
82
84
  getVariables: () => ({}),
83
85
  customActions: {},
86
+ navigation: expoRouterAdapter_1.expoRouterAdapter,
84
87
  });
85
88
  //# sourceMappingURL=OnboardingProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingProvider.js","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAgF;AAChF,uDAAmF;AACnF,yEAAsE;AACtE,wEAAoE;AAIpE,6CAA8C;AAC9C,kEAA+D;AAC/D,4DAAyD;AAEzD,MAAM,WAAW,GAAG,IAAI,yBAAW,CAAC;IAClC,cAAc,EAAE;QACd,OAAO,EAAE;YACP,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAC,CAAA;AAqCF,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,QAAQ,GACgB,EAAE,EAAE;IAC5B,MAAM,EAAE,IAAI,EA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EAAE,GAAG,CAAC;IACxB,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,GAAG,EAAE,GAAG,CAAC;IACxB,MAAM,EAAE,IAAI,+CAAsB,CAAC,EAAE,EAAE,EAAE,CAAC;IAC1C,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,EAAE;IACxB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,GAAG,EAAE,GAAG,CAAC;IACxB,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;IACtB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"OnboardingProvider.js","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAgF;AAChF,uDAAmF;AACnF,yEAAsE;AACtE,wEAAoE;AAIpE,6CAA8C;AAC9C,kEAA+D;AAC/D,4DAAyD;AAEzD,uEAAoE;AAEpE,MAAM,WAAW,GAAG,IAAI,yBAAW,CAAC;IAClC,cAAc,EAAE;QACd,OAAO,EAAE;YACP,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAC,CAAA;AA4CF,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,QAAQ,GACgB,EAAE,EAAE;IAC5B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAA,sBAAQ,EAC9B,IAAA,wCAAkB,EAAqB,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,aAAa,CAAC,CAC5F,CAAC;IAEF,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,4EAA4E;IAC5E,4DAA4D;IAC5D,MAAM,YAAY,GAAG,IAAA,cAAM,EAAwC,IAAI,CAAC,CAAC;IACzE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb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AS,EAAE,EAAE;IACb,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;IACtB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,qCAAiB;CAC9B,CAAC,CAAC"}
@@ -4,12 +4,44 @@ export declare const CarouselScreenSchema: z.ZodObject<{
4
4
  title: z.ZodString;
5
5
  subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
6
  }, z.core.$strip>;
7
+ export declare const CarouselPaginationSchema: z.ZodOptional<z.ZodObject<{
8
+ show: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
9
+ dotColor: z.ZodOptional<z.ZodString>;
10
+ activeDotColor: z.ZodOptional<z.ZodString>;
11
+ dotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
12
+ dotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
13
+ activeDotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
14
+ activeDotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15
+ gap: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
16
+ position: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
17
+ top: "top";
18
+ bottom: "bottom";
19
+ }>>>;
20
+ marginTop: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
21
+ marginBottom: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
22
+ }, z.core.$strip>>;
7
23
  export declare const CarouselStepPayloadSchema: z.ZodObject<{
8
24
  screens: z.ZodArray<z.ZodObject<{
9
25
  mediaUrl: z.ZodString;
10
26
  title: z.ZodString;
11
27
  subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
28
  }, z.core.$strip>>;
29
+ pagination: z.ZodOptional<z.ZodObject<{
30
+ show: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
31
+ dotColor: z.ZodOptional<z.ZodString>;
32
+ activeDotColor: z.ZodOptional<z.ZodString>;
33
+ dotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
34
+ dotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
35
+ activeDotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
36
+ activeDotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
37
+ gap: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
38
+ position: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
39
+ top: "top";
40
+ bottom: "bottom";
41
+ }>>>;
42
+ marginTop: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
43
+ marginBottom: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
44
+ }, z.core.$strip>>;
13
45
  }, z.core.$strip>;
14
46
  export declare const CarouselStepTypeSchema: z.ZodObject<{
15
47
  id: z.ZodString;
@@ -54,8 +86,25 @@ export declare const CarouselStepTypeSchema: z.ZodObject<{
54
86
  title: z.ZodString;
55
87
  subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
88
  }, z.core.$strip>>;
89
+ pagination: z.ZodOptional<z.ZodObject<{
90
+ show: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
91
+ dotColor: z.ZodOptional<z.ZodString>;
92
+ activeDotColor: z.ZodOptional<z.ZodString>;
93
+ dotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
94
+ dotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
95
+ activeDotWidth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
96
+ activeDotHeight: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
97
+ gap: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
98
+ position: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
99
+ top: "top";
100
+ bottom: "bottom";
101
+ }>>>;
102
+ marginTop: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
103
+ marginBottom: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
104
+ }, z.core.$strip>>;
57
105
  }, z.core.$strip>;
58
106
  }, z.core.$strip>;
59
107
  export type CarouselStepType = z.infer<typeof CarouselStepTypeSchema>;
60
108
  export type CarouselScreenType = z.infer<typeof CarouselScreenSchema>;
109
+ export type CarouselPaginationType = z.infer<typeof CarouselPaginationSchema>;
61
110
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/steps/Carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;iBAEpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/steps/Carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;kBAcxB,CAAC;AAEd,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;iBAGpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CarouselStepTypeSchema = exports.CarouselStepPayloadSchema = exports.CarouselScreenSchema = void 0;
3
+ exports.CarouselStepTypeSchema = exports.CarouselStepPayloadSchema = exports.CarouselPaginationSchema = exports.CarouselScreenSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const common_types_1 = require("../common.types");
6
6
  exports.CarouselScreenSchema = zod_1.z.object({
@@ -8,8 +8,24 @@ exports.CarouselScreenSchema = zod_1.z.object({
8
8
  title: zod_1.z.string(),
9
9
  subtitle: zod_1.z.string().nullish(),
10
10
  });
11
+ exports.CarouselPaginationSchema = zod_1.z
12
+ .object({
13
+ show: zod_1.z.boolean().optional().default(true),
14
+ dotColor: zod_1.z.string().optional(),
15
+ activeDotColor: zod_1.z.string().optional(),
16
+ dotWidth: zod_1.z.number().nonnegative().optional().default(8),
17
+ dotHeight: zod_1.z.number().nonnegative().optional().default(8),
18
+ activeDotWidth: zod_1.z.number().nonnegative().optional().default(24),
19
+ activeDotHeight: zod_1.z.number().nonnegative().optional().default(8),
20
+ gap: zod_1.z.number().nonnegative().optional().default(8),
21
+ position: zod_1.z.enum(["top", "bottom"]).optional().default("bottom"),
22
+ marginTop: zod_1.z.number().optional().default(20),
23
+ marginBottom: zod_1.z.number().optional().default(20),
24
+ })
25
+ .optional();
11
26
  exports.CarouselStepPayloadSchema = zod_1.z.object({
12
27
  screens: zod_1.z.array(exports.CarouselScreenSchema),
28
+ pagination: exports.CarouselPaginationSchema,
13
29
  });
14
30
  exports.CarouselStepTypeSchema = common_types_1.BaseStepTypeSchema.extend({
15
31
  type: zod_1.z.literal("Carousel"),
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/Carousel/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAAqD;AAExC,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;CAC/B,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC;CACvC,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,iCAAkB,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3B,OAAO,EAAE,iCAAyB;CACnC,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/steps/Carousel/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kDAAqD;AAExC,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;CAC/B,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EA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.46.0",
3
+ "version": "1.48.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",
@@ -37,6 +37,7 @@
37
37
  "peerDependencies": {
38
38
  "expo-font": "*",
39
39
  "expo-image": "*",
40
+ "expo-router": ">=3.0.0",
40
41
  "react": "*",
41
42
  "react-native": "*"
42
43
  },
@@ -46,6 +47,9 @@
46
47
  },
47
48
  "expo-image": {
48
49
  "optional": true
50
+ },
51
+ "expo-router": {
52
+ "optional": true
49
53
  }
50
54
  },
51
55
  "files": [
package/src/index.ts CHANGED
@@ -44,6 +44,9 @@ export {
44
44
  } from "./steps/ComposableScreen/types";
45
45
  // Hooks and providers
46
46
  export * from "./infra";
47
+ // Navigation adapter (dependency-injected navigation)
48
+ export type { OnboardingNavigationAdapter } from "./infra/navigation/types";
49
+ export { expoRouterAdapter } from "./infra/navigation/expoRouterAdapter";
47
50
  // Branching
48
51
  export { resolveNextStepNumber } from "./resolveNextStepNumber";
49
52
  export { evaluateCondition, evaluateLeaf, isConditionGroup } from "./evaluateCondition";
@@ -1,2 +1,3 @@
1
1
  export { useOnboardingStep } from "./useOnboardingStep";
2
2
  export { useOnboarding } from "./useOnboarding";
3
+ export { useOnboardingNavigation } from "./useOnboardingNavigation";
@@ -0,0 +1,11 @@
1
+ import { useContext } from "react";
2
+ import { OnboardingProgressContext } from "../provider/OnboardingProvider";
3
+ import type { OnboardingNavigationAdapter } from "../navigation/types";
4
+
5
+ /**
6
+ * Returns the navigation adapter provided to `OnboardingProvider` (defaults to
7
+ * the expo-router adapter). Used by UI components (e.g. ProgressBar) to perform
8
+ * back navigation without importing expo-router directly.
9
+ */
10
+ export const useOnboardingNavigation = (): OnboardingNavigationAdapter =>
11
+ useContext(OnboardingProgressContext).navigation;
@@ -1,6 +1,5 @@
1
1
  import { useCallback, useContext } from "react";
2
2
  import { useSuspenseQuery } from "@tanstack/react-query";
3
- import { useFocusEffect } from "expo-router";
4
3
  import { OnboardingProgressContext } from "../provider/OnboardingProvider";
5
4
  import { getOnboardingQuery } from "../queries/getOnboarding.query";
6
5
  import { BaseStepType, Onboarding, OnboardingMetadata } from "../../types";
@@ -27,6 +26,7 @@ export const useOnboardingStep = <
27
26
  setActiveStep,
28
27
  setTotalSteps,
29
28
  setOnboarding,
29
+ navigation,
30
30
  } = useContext(OnboardingProgressContext);
31
31
 
32
32
  // Build query with config from context
@@ -41,7 +41,7 @@ export const useOnboardingStep = <
41
41
  const steps = data.steps;
42
42
  const onboardingMetadata = data.metadata;
43
43
 
44
- useFocusEffect(
44
+ navigation.useFocusEffect(
45
45
  useCallback(() => {
46
46
  const currentStep = steps[stepNumber - 1];
47
47
  setActiveStep({
@@ -0,0 +1,38 @@
1
+ import { useEffect } from "react";
2
+ import type { OnboardingNavigationAdapter } from "./types";
3
+
4
+ // expo-router is an OPTIONAL peer dependency. Lazily require it so the SDK
5
+ // loads (and the no-op fallbacks below take over) when it is not installed.
6
+ // Precedent: Pages/ComposableScreen/elements/haptics.ts (try/require/catch).
7
+ let expoRouter: any;
8
+ try {
9
+ expoRouter = require("expo-router");
10
+ } catch {
11
+ /* expo-router not installed — fall back to no-op navigation */
12
+ }
13
+
14
+ /**
15
+ * Default navigation adapter. Binds to expo-router when available, otherwise
16
+ * degrades gracefully: focus effect runs as a mount/cb-change effect and the
17
+ * back button stays hidden (`canGoBack` returns false).
18
+ *
19
+ * Fields are bound once at module load, so the hook identities are stable —
20
+ * consumers may call `adapter.useFocusEffect(...)` / `adapter.useRouter()`
21
+ * directly without breaking the rules of hooks.
22
+ */
23
+ export const expoRouterAdapter: OnboardingNavigationAdapter = {
24
+ useFocusEffect:
25
+ expoRouter?.useFocusEffect ??
26
+ ((effect: () => void | (() => void)) => {
27
+ useEffect(effect, [effect]);
28
+ }),
29
+ useRouter: expoRouter
30
+ ? () => {
31
+ const router = expoRouter.useRouter();
32
+ return {
33
+ canGoBack: () => router.canGoBack(),
34
+ goBack: () => router.back(),
35
+ };
36
+ }
37
+ : () => ({ canGoBack: () => false, goBack: () => {} }),
38
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Navigation abstraction injected into the SDK so it does not hard-depend on
3
+ * any particular navigation library (expo-router, react-navigation, custom).
4
+ * The default implementation binds to expo-router when present
5
+ * (see `expoRouterAdapter`); hosts can override it via
6
+ * `OnboardingProvider`'s `navigation` prop.
7
+ */
8
+ export interface OnboardingNavigationAdapter {
9
+ /** Hook: re-run `effect` when the screen gains focus (expo-router `useFocusEffect` semantics). */
10
+ useFocusEffect: (effect: () => void | (() => void)) => void;
11
+ /** Hook: returns back-navigation controls. */
12
+ useRouter: () => { canGoBack: () => boolean; goBack: () => void };
13
+ }
@@ -8,6 +8,8 @@ import { ComposableVariableEntry } from "../../steps/ComposableScreen/types";
8
8
  import { FontLoaderGate } from "./FontLoader";
9
9
  import { extractAssetUrls } from "../preload/extractAssetUrls";
10
10
  import { preloadAssets } from "../preload/preloadAssets";
11
+ import { OnboardingNavigationAdapter } from "../navigation/types";
12
+ import { expoRouterAdapter } from "../navigation/expoRouterAdapter";
11
13
 
12
14
  const queryClient = new QueryClient({
13
15
  defaultOptions: {
@@ -41,6 +43,13 @@ interface OnboardingProviderProps {
41
43
  * Defaults to `null`.
42
44
  */
43
45
  fontsFallback?: React.ReactNode;
46
+ /**
47
+ * Navigation adapter used for back navigation (ProgressBar back button) and
48
+ * the per-step focus effect. Defaults to an expo-router-backed adapter that
49
+ * degrades to a no-op when expo-router is not installed. Inject your own to
50
+ * support a different navigation library. Must be a stable reference.
51
+ */
52
+ navigation?: OnboardingNavigationAdapter;
44
53
  }
45
54
 
46
55
  interface OnboardingDataGateProps {
@@ -93,6 +102,7 @@ export const OnboardingProvider = ({
93
102
  customAudienceParams = {},
94
103
  customActions = {},
95
104
  fontsFallback,
105
+ navigation = expoRouterAdapter,
96
106
  }: OnboardingProviderProps) => {
97
107
  const [activeStep, setActiveStep] = useState({
98
108
  number: 0,
@@ -125,6 +135,7 @@ export const OnboardingProvider = ({
125
135
  setVariable,
126
136
  getVariables,
127
137
  customActions,
138
+ navigation,
128
139
  }}
129
140
  >
130
141
  <OnboardingDataGate
@@ -155,6 +166,7 @@ export const OnboardingProgressContext = createContext<{
155
166
  setVariable: (name: string, value: any) => void;
156
167
  getVariables: () => Record<string, any>;
157
168
  customActions: CustomActions;
169
+ navigation: OnboardingNavigationAdapter;
158
170
  }>({
159
171
  activeStep: { number: 0, displayProgressHeader: false },
160
172
  setActiveStep: () => { },
@@ -169,4 +181,5 @@ export const OnboardingProgressContext = createContext<{
169
181
  setVariable: () => { },
170
182
  getVariables: () => ({}),
171
183
  customActions: {},
184
+ navigation: expoRouterAdapter,
172
185
  });
@@ -7,8 +7,25 @@ export const CarouselScreenSchema = z.object({
7
7
  subtitle: z.string().nullish(),
8
8
  });
9
9
 
10
+ export const CarouselPaginationSchema = z
11
+ .object({
12
+ show: z.boolean().optional().default(true),
13
+ dotColor: z.string().optional(),
14
+ activeDotColor: z.string().optional(),
15
+ dotWidth: z.number().nonnegative().optional().default(8),
16
+ dotHeight: z.number().nonnegative().optional().default(8),
17
+ activeDotWidth: z.number().nonnegative().optional().default(24),
18
+ activeDotHeight: z.number().nonnegative().optional().default(8),
19
+ gap: z.number().nonnegative().optional().default(8),
20
+ position: z.enum(["top", "bottom"]).optional().default("bottom"),
21
+ marginTop: z.number().optional().default(20),
22
+ marginBottom: z.number().optional().default(20),
23
+ })
24
+ .optional();
25
+
10
26
  export const CarouselStepPayloadSchema = z.object({
11
27
  screens: z.array(CarouselScreenSchema),
28
+ pagination: CarouselPaginationSchema,
12
29
  });
13
30
 
14
31
  export const CarouselStepTypeSchema = BaseStepTypeSchema.extend({
@@ -18,3 +35,4 @@ export const CarouselStepTypeSchema = BaseStepTypeSchema.extend({
18
35
 
19
36
  export type CarouselStepType = z.infer<typeof CarouselStepTypeSchema>;
20
37
  export type CarouselScreenType = z.infer<typeof CarouselScreenSchema>;
38
+ export type CarouselPaginationType = z.infer<typeof CarouselPaginationSchema>;