flowboard-react 0.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.
Files changed (90) hide show
  1. package/FlowboardReact.podspec +20 -0
  2. package/LICENSE +20 -0
  3. package/README.md +122 -0
  4. package/android/build.gradle +67 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/flowboardreact/FlowboardReactModule.kt +15 -0
  7. package/android/src/main/java/com/flowboardreact/FlowboardReactPackage.kt +33 -0
  8. package/ios/FlowboardReact.h +5 -0
  9. package/ios/FlowboardReact.mm +21 -0
  10. package/lib/module/Flowboard.js +167 -0
  11. package/lib/module/Flowboard.js.map +1 -0
  12. package/lib/module/FlowboardProvider.js +52 -0
  13. package/lib/module/FlowboardProvider.js.map +1 -0
  14. package/lib/module/NativeFlowboardReact.js +5 -0
  15. package/lib/module/NativeFlowboardReact.js.map +1 -0
  16. package/lib/module/components/FlowboardFlow.js +389 -0
  17. package/lib/module/components/FlowboardFlow.js.map +1 -0
  18. package/lib/module/components/FlowboardRenderer.js +1684 -0
  19. package/lib/module/components/FlowboardRenderer.js.map +1 -0
  20. package/lib/module/components/widgets/sliderRegistry.js +48 -0
  21. package/lib/module/components/widgets/sliderRegistry.js.map +1 -0
  22. package/lib/module/core/analyticsManager.js +110 -0
  23. package/lib/module/core/analyticsManager.js.map +1 -0
  24. package/lib/module/core/assetPreloader.js +72 -0
  25. package/lib/module/core/assetPreloader.js.map +1 -0
  26. package/lib/module/core/clientContext.js +105 -0
  27. package/lib/module/core/clientContext.js.map +1 -0
  28. package/lib/module/core/fontAwesome.js +110 -0
  29. package/lib/module/core/fontAwesome.js.map +1 -0
  30. package/lib/module/core/onboardingRepository.js +62 -0
  31. package/lib/module/core/onboardingRepository.js.map +1 -0
  32. package/lib/module/core/resolverService.js +58 -0
  33. package/lib/module/core/resolverService.js.map +1 -0
  34. package/lib/module/index.js +5 -0
  35. package/lib/module/index.js.map +1 -0
  36. package/lib/module/package.json +1 -0
  37. package/lib/module/types/flowboard.js +4 -0
  38. package/lib/module/types/flowboard.js.map +1 -0
  39. package/lib/module/types/react-native-vector-icons.d.js +2 -0
  40. package/lib/module/types/react-native-vector-icons.d.js.map +1 -0
  41. package/lib/module/utils/flowboardUtils.js +379 -0
  42. package/lib/module/utils/flowboardUtils.js.map +1 -0
  43. package/lib/typescript/package.json +1 -0
  44. package/lib/typescript/src/Flowboard.d.ts +33 -0
  45. package/lib/typescript/src/Flowboard.d.ts.map +1 -0
  46. package/lib/typescript/src/FlowboardProvider.d.ts +5 -0
  47. package/lib/typescript/src/FlowboardProvider.d.ts.map +1 -0
  48. package/lib/typescript/src/NativeFlowboardReact.d.ts +7 -0
  49. package/lib/typescript/src/NativeFlowboardReact.d.ts.map +1 -0
  50. package/lib/typescript/src/components/FlowboardFlow.d.ts +14 -0
  51. package/lib/typescript/src/components/FlowboardFlow.d.ts.map +1 -0
  52. package/lib/typescript/src/components/FlowboardRenderer.d.ts +31 -0
  53. package/lib/typescript/src/components/FlowboardRenderer.d.ts.map +1 -0
  54. package/lib/typescript/src/components/widgets/sliderRegistry.d.ts +16 -0
  55. package/lib/typescript/src/components/widgets/sliderRegistry.d.ts.map +1 -0
  56. package/lib/typescript/src/core/analyticsManager.d.ts +42 -0
  57. package/lib/typescript/src/core/analyticsManager.d.ts.map +1 -0
  58. package/lib/typescript/src/core/assetPreloader.d.ts +8 -0
  59. package/lib/typescript/src/core/assetPreloader.d.ts.map +1 -0
  60. package/lib/typescript/src/core/clientContext.d.ts +27 -0
  61. package/lib/typescript/src/core/clientContext.d.ts.map +1 -0
  62. package/lib/typescript/src/core/fontAwesome.d.ts +8 -0
  63. package/lib/typescript/src/core/fontAwesome.d.ts.map +1 -0
  64. package/lib/typescript/src/core/onboardingRepository.d.ts +15 -0
  65. package/lib/typescript/src/core/onboardingRepository.d.ts.map +1 -0
  66. package/lib/typescript/src/core/resolverService.d.ts +11 -0
  67. package/lib/typescript/src/core/resolverService.d.ts.map +1 -0
  68. package/lib/typescript/src/index.d.ts +4 -0
  69. package/lib/typescript/src/index.d.ts.map +1 -0
  70. package/lib/typescript/src/types/flowboard.d.ts +34 -0
  71. package/lib/typescript/src/types/flowboard.d.ts.map +1 -0
  72. package/lib/typescript/src/utils/flowboardUtils.d.ts +31 -0
  73. package/lib/typescript/src/utils/flowboardUtils.d.ts.map +1 -0
  74. package/package.json +192 -0
  75. package/src/Flowboard.ts +223 -0
  76. package/src/FlowboardProvider.tsx +60 -0
  77. package/src/NativeFlowboardReact.ts +7 -0
  78. package/src/components/FlowboardFlow.tsx +513 -0
  79. package/src/components/FlowboardRenderer.tsx +1957 -0
  80. package/src/components/widgets/sliderRegistry.tsx +56 -0
  81. package/src/core/analyticsManager.ts +125 -0
  82. package/src/core/assetPreloader.ts +103 -0
  83. package/src/core/clientContext.ts +132 -0
  84. package/src/core/fontAwesome.ts +90 -0
  85. package/src/core/onboardingRepository.ts +79 -0
  86. package/src/core/resolverService.ts +69 -0
  87. package/src/index.tsx +11 -0
  88. package/src/types/flowboard.ts +50 -0
  89. package/src/types/react-native-vector-icons.d.ts +15 -0
  90. package/src/utils/flowboardUtils.ts +400 -0
@@ -0,0 +1,31 @@
1
+ type FlowboardRendererProps = {
2
+ screenData: Record<string, any>;
3
+ onAction: (action: string, data?: Record<string, any>) => void;
4
+ formData?: Record<string, any>;
5
+ onInputChange?: (id: string, value: any) => void;
6
+ enableFontAwesomeIcons?: boolean;
7
+ currentIndex?: number;
8
+ totalScreens?: number;
9
+ };
10
+ export default function FlowboardRenderer(props: FlowboardRendererProps): import("react/jsx-runtime").JSX.Element;
11
+ export type RadarAxis = {
12
+ label: string;
13
+ maxValue: number;
14
+ };
15
+ export type RadarDataset = {
16
+ label: string;
17
+ values: number[];
18
+ borderColor: string;
19
+ borderWidth: number;
20
+ borderStyle: string;
21
+ dashArray?: number[];
22
+ showPoints: boolean;
23
+ pointRadius: number;
24
+ pointColor: string;
25
+ fillColor?: string;
26
+ };
27
+ export declare function parseRadarAxes(rawAxes: any): RadarAxis[];
28
+ export declare function parseRadarDatasets(raw: any, axisLength: number, formData: Record<string, any>): RadarDataset[];
29
+ export declare function normalizeAxisMaximums(axes: RadarAxis[], datasets: RadarDataset[]): RadarAxis[];
30
+ export {};
31
+ //# sourceMappingURL=FlowboardRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowboardRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/FlowboardRenderer.tsx"],"names":[],"mappings":"AAsDA,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACjD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA2GtE;AAkoDD,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,SAAS,EAAE,CAWxD;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC5B,YAAY,EAAE,CAiDhB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EAAE,EACjB,QAAQ,EAAE,YAAY,EAAE,GACvB,SAAS,EAAE,CASb"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export declare class SliderRegistry {
3
+ private current;
4
+ private counts;
5
+ private listeners;
6
+ getNotifier(id: string, callback: (value: number) => void): () => void;
7
+ update(id: string, page: number, count: number): void;
8
+ getPageCount(id: string): number;
9
+ getCurrent(id: string): number;
10
+ }
11
+ export declare function SliderRegistryProvider({ registry, children, }: {
12
+ registry: SliderRegistry;
13
+ children: React.ReactNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ export declare function useSliderRegistry(): SliderRegistry | null;
16
+ //# sourceMappingURL=sliderRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliderRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/components/widgets/sliderRegistry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,SAAS,CAAmD;IAEpE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI;IAYtE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IASrD,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAIhC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;CAG/B;AAID,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAMA;AAED,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAEzD"}
@@ -0,0 +1,42 @@
1
+ import 'react-native-get-random-values';
2
+ import type { ClientContext } from './clientContext';
3
+ export declare enum OnboardingOutcome {
4
+ completed = "completed",
5
+ dismissed = "dismissed",
6
+ purchased = "purchased",
7
+ failed = "failed"
8
+ }
9
+ export declare class AnalyticsManager {
10
+ private static _instance;
11
+ static get instance(): AnalyticsManager;
12
+ private enabled;
13
+ private clientContext;
14
+ private flowContext;
15
+ get clientContextSnapshot(): ClientContext | null;
16
+ configure(params: {
17
+ enabled?: boolean;
18
+ context: ClientContext;
19
+ }): void;
20
+ startSession(params: {
21
+ flowData: Record<string, any>;
22
+ }): void;
23
+ endSession(): void;
24
+ track(eventName: string, properties: Record<string, any>): void;
25
+ private transmit;
26
+ trackOnboardLoaded(params: {
27
+ durationMs: number;
28
+ cached: boolean;
29
+ }): void;
30
+ trackOnboardStarted(): void;
31
+ trackScreenView(params: {
32
+ stepId: string;
33
+ stepIndex: number;
34
+ stepName?: string | null;
35
+ }): void;
36
+ trackOnboardEnded(params: {
37
+ outcome: OnboardingOutcome;
38
+ totalDurationMs: number;
39
+ finalStepId: string;
40
+ }): void;
41
+ }
42
+ //# sourceMappingURL=analyticsManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyticsManager.d.ts","sourceRoot":"","sources":["../../../../src/core/analyticsManager.ts"],"names":[],"mappings":"AAEA,OAAO,g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IAAI;CAOT"}
@@ -0,0 +1,8 @@
1
+ export declare class AssetPreloader {
2
+ private preloadedUrls;
3
+ preloadScreenAssets(screenData: Record<string, any>): Promise<void>;
4
+ clear(): void;
5
+ private extractAssets;
6
+ private scanWidget;
7
+ }
8
+ //# sourceMappingURL=assetPreloader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetPreloader.d.ts","sourceRoot":"","sources":["../../../../src/core/assetPreloader.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IACzB,OAAO,CAAC,aAAa,CAAqB;IAEpC,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCzE,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,UAAU;CAiDnB"}
@@ -0,0 +1,27 @@
1
+ import 'react-native-get-random-values';
2
+ export type ClientContextData = {
3
+ appVersion: string;
4
+ buildNumber: string;
5
+ locale: string;
6
+ country: string;
7
+ os: string;
8
+ osVersion: string;
9
+ deviceType: string;
10
+ installId: string;
11
+ bundleId: string;
12
+ };
13
+ export declare class ClientContext {
14
+ appVersion: string;
15
+ buildNumber: string;
16
+ locale: string;
17
+ country: string;
18
+ os: string;
19
+ osVersion: string;
20
+ deviceType: string;
21
+ installId: string;
22
+ bundleId: string;
23
+ private constructor();
24
+ static create(): Promise<ClientContext>;
25
+ toJson(): Record<string, any>;
26
+ }
27
+ //# sourceMappingURL=clientContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientContext.d.ts","sourceRoot":"","sources":["../../../../src/core/clientContext.ts"],"names":[],"mappings":"AAIA,OAAO,gCAAgC,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,qBAAa,aAAa;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,OAAO;WAYM,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;IA2B7C,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAgB9B"}
@@ -0,0 +1,8 @@
1
+ import FontAwesome6 from 'react-native-vector-icons/FontAwesome6';
2
+ export type FontAwesomeStyle = 'brands' | 'regular' | 'solid' | 'light' | 'thin' | 'duotone' | 'sharpthin' | 'sharplight' | 'sharpregular' | 'sharpsolid';
3
+ export declare function resolveFontAwesomeIcon(name?: string, style?: string): {
4
+ name: string | null;
5
+ props: Record<string, any>;
6
+ };
7
+ export { FontAwesome6 };
8
+ //# sourceMappingURL=fontAwesome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fontAwesome.d.ts","sourceRoot":"","sources":["../../../../src/core/fontAwesome.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAIlE,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,MAAM,GACN,SAAS,GACT,WAAW,GACX,YAAY,GACZ,cAAc,GACd,YAAY,CAAC;AAEjB,wBAAgB,sBAAsB,CACpC,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,GAAE,MAAgB,GACtB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,CA8BrD;AAwCD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { FlowboardData } from '../types/flowboard';
2
+ export declare class OnboardingRepository {
3
+ saveOnboardingJson(json: FlowboardData): Promise<void>;
4
+ getOnboardingJson(): Promise<FlowboardData | null>;
5
+ clearOnboardingJson(): Promise<void>;
6
+ saveProgress(params: {
7
+ flowId: string;
8
+ stepIndex: number;
9
+ formData: Record<string, any>;
10
+ }): Promise<void>;
11
+ getProgressStepForFlow(flowId: string): Promise<number | null>;
12
+ getProgressFormDataForFlow(flowId: string): Promise<Record<string, any> | null>;
13
+ clearProgress(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=onboardingRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboardingRepository.d.ts","sourceRoot":"","sources":["../../../../src/core/onboardingRepository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,qBAAa,oBAAoB;IACzB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,iBAAiB,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAWlD,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,YAAY,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;IASX,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS9D,0BAA0B,CAC9B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAiBhC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAOrC"}
@@ -0,0 +1,11 @@
1
+ import type { ClientContext } from './clientContext';
2
+ import type { FlowboardData } from '../types/flowboard';
3
+ export declare class ResolverService {
4
+ private endpoint;
5
+ constructor(endpoint?: string);
6
+ fetchOnboardingJson(params: {
7
+ context: ClientContext;
8
+ appId: string;
9
+ }): Promise<FlowboardData>;
10
+ }
11
+ //# sourceMappingURL=resolverService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolverService.d.ts","sourceRoot":"","sources":["../../../../src/core/resolverService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,CAAC,EAAE,MAAM;IAIvB,mBAAmB,CAAC,MAAM,EAAE;QAChC,OAAO,EAAE,aAAa,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,aAAa,CAAC;CAqD3B"}
@@ -0,0 +1,4 @@
1
+ export { Flowboard } from './Flowboard';
2
+ export { default as FlowboardProvider } from './FlowboardProvider';
3
+ export type { FlowboardContext, CustomScreenBuilder, CustomActionBuilder, OnboardingEndCallback, OnStepChangeCallback, FlowboardLaunchOptions, FlowboardData, } from './types/flowboard';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type React from 'react';
2
+ export type JsonMap = Record<string, any>;
3
+ export type FlowboardScreen = JsonMap;
4
+ export type FlowboardData = {
5
+ screens: FlowboardScreen[];
6
+ flow_id?: string;
7
+ variant_id?: string;
8
+ audience_id?: string;
9
+ bucket?: string;
10
+ experiment_id?: string;
11
+ } & JsonMap;
12
+ export type FlowboardContext = {
13
+ context?: any;
14
+ currentIndex: number;
15
+ totalScreens: number;
16
+ formData: JsonMap;
17
+ screenData: FlowboardScreen;
18
+ onNext: () => void;
19
+ onPrevious: () => void;
20
+ onFinish: () => void;
21
+ };
22
+ export type CustomScreenBuilder = (ctx: FlowboardContext) => React.ReactNode;
23
+ export type CustomActionBuilder = (action: string, ctx: FlowboardContext, data?: JsonMap) => void;
24
+ export type OnboardingEndCallback = (formData: JsonMap) => void;
25
+ export type OnStepChangeCallback = (pageId: string | null | undefined, pageStep: number, formData: JsonMap) => void;
26
+ export type FlowboardLaunchOptions = {
27
+ customScreenBuilder?: CustomScreenBuilder;
28
+ customActionBuilder?: CustomActionBuilder;
29
+ onOnboardEnd?: OnboardingEndCallback;
30
+ onStepChange?: OnStepChangeCallback;
31
+ enableAnalytics?: boolean;
32
+ alwaysRestart?: boolean;
33
+ };
34
+ //# sourceMappingURL=flowboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowboard.d.ts","sourceRoot":"","sources":["../../../../src/types/flowboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,eAAe,E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AO,CAAC;CACzB,CAAC"}
@@ -0,0 +1,31 @@
1
+ export type Insets = {
2
+ top: number;
3
+ right: number;
4
+ bottom: number;
5
+ left: number;
6
+ };
7
+ export declare const EMPTY_INSETS: Insets;
8
+ export declare function parseColor(hex?: string | number | null): string;
9
+ export declare function parseDimension(value: any, zeroIsNull?: boolean): number | undefined;
10
+ export declare function parseInsets(value: any): Insets;
11
+ export declare function insetsToStyle(insets: Insets): {
12
+ paddingTop: number;
13
+ paddingRight: number;
14
+ paddingBottom: number;
15
+ paddingLeft: number;
16
+ };
17
+ export declare function formatDate(pattern: string, date?: Date): string;
18
+ export declare function resolveText(text: string, formData: Record<string, any>): string;
19
+ export declare function evaluateExpression(content: string, formData: Record<string, any>): any;
20
+ export declare function resolveNumericValue(value: any, formData: Record<string, any>): number | null;
21
+ export declare function parseFontWeight(value?: string | number): any;
22
+ export declare function parseTextDecoration(value?: string): any;
23
+ export declare function parseTextAlign(value?: string): any;
24
+ export declare function parseFlexAlignment(value?: string): any;
25
+ export declare function parseCrossAlignment(value?: string): any;
26
+ export declare function parseResizeMode(value?: string): any;
27
+ export declare function parseAlignment(value?: string): {
28
+ justifyContent: any;
29
+ alignItems: any;
30
+ };
31
+ //# sourceMappingURL=flowboardUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowboardUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/flowboardUtils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAK1B,CAAC;AAIF,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CA6C/D;AAgBD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,GAAG,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AAG;IAC9C,cAAc,EAAE,GAAG,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC;CACjB,CAsBA"}
package/package.json ADDED
@@ -0,0 +1,192 @@
1
+ {
2
+ "name": "flowboard-react",
3
+ "version": "0.1.0",
4
+ "description": "Onboard your users with one click",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "dependencies": {
35
+ "@react-native-async-storage/async-storage": "^1.24.0",
36
+ "@react-native-masked-view/masked-view": "^0.3.2",
37
+ "expr-eval": "^2.0.2",
38
+ "lottie-react-native": "^7.1.0",
39
+ "react-native-device-info": "^13.2.0",
40
+ "react-native-get-random-values": "^1.11.0",
41
+ "react-native-in-app-review": "^4.3.0",
42
+ "react-native-linear-gradient": "^2.8.3",
43
+ "react-native-mask-input": "^1.2.3",
44
+ "react-native-pager-view": "^6.2.4",
45
+ "react-native-permissions": "^4.1.5",
46
+ "react-native-safe-area-context": "^4.11.0",
47
+ "react-native-svg": "^15.10.1",
48
+ "react-native-vector-icons": "^10.2.0",
49
+ "uuid": "^11.1.0"
50
+ },
51
+ "scripts": {
52
+ "example": "yarn workspace flowboard-react-example",
53
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
54
+ "prepare": "bob build",
55
+ "typecheck": "tsc",
56
+ "test": "jest",
57
+ "release": "release-it --only-version",
58
+ "lint": "eslint \"**/*.{js,ts,tsx}\""
59
+ },
60
+ "keywords": [
61
+ "react-native",
62
+ "ios",
63
+ "android"
64
+ ],
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "git+https://github.com/gregoirecambon/flowboard-pckg-react.git"
68
+ },
69
+ "author": "Flowboard <gregoire@teech-golf.com> (https://flow-board.coflow-board.co)",
70
+ "license": "MIT",
71
+ "bugs": {
72
+ "url": "https://github.com/gregoirecambon/flowboard-pckg-react/issues"
73
+ },
74
+ "homepage": "https://github.com/gregoirecambon/flowboard-pckg-react#readme",
75
+ "publishConfig": {
76
+ "registry": "https://registry.npmjs.org/",
77
+ "access": "public"
78
+ },
79
+ "devDependencies": {
80
+ "@commitlint/config-conventional": "^19.8.1",
81
+ "@eslint/compat": "^1.3.2",
82
+ "@eslint/eslintrc": "^3.3.1",
83
+ "@eslint/js": "^9.35.0",
84
+ "@react-native/babel-preset": "0.83.0",
85
+ "@react-native/eslint-config": "0.83.0",
86
+ "@release-it/conventional-changelog": "^10.0.1",
87
+ "@types/jest": "^29.5.14",
88
+ "@types/react": "^19.2.0",
89
+ "@types/react-test-renderer": "^19.1.0",
90
+ "commitlint": "^19.8.1",
91
+ "del-cli": "^6.0.0",
92
+ "eslint": "^9.35.0",
93
+ "eslint-config-prettier": "^10.1.8",
94
+ "eslint-plugin-prettier": "^5.5.4",
95
+ "jest": "^29.7.0",
96
+ "lefthook": "^2.0.3",
97
+ "prettier": "^2.8.8",
98
+ "react": "19.2.0",
99
+ "react-native": "0.83.0",
100
+ "react-native-builder-bob": "^0.40.17",
101
+ "react-test-renderer": "19.2.0",
102
+ "release-it": "^19.0.4",
103
+ "turbo": "^2.5.6",
104
+ "typescript": "^5.9.2"
105
+ },
106
+ "peerDependencies": {
107
+ "react": "*",
108
+ "react-native": "*"
109
+ },
110
+ "workspaces": [
111
+ "example"
112
+ ],
113
+ "packageManager": "yarn@4.11.0",
114
+ "react-native-builder-bob": {
115
+ "source": "src",
116
+ "output": "lib",
117
+ "targets": [
118
+ [
119
+ "module",
120
+ {
121
+ "esm": true
122
+ }
123
+ ],
124
+ [
125
+ "typescript",
126
+ {
127
+ "project": "tsconfig.build.json"
128
+ }
129
+ ]
130
+ ]
131
+ },
132
+ "codegenConfig": {
133
+ "name": "FlowboardReactSpec",
134
+ "type": "modules",
135
+ "jsSrcsDir": "src",
136
+ "android": {
137
+ "javaPackageName": "com.flowboardreact"
138
+ }
139
+ },
140
+ "jest": {
141
+ "preset": "react-native",
142
+ "setupFiles": [
143
+ "<rootDir>/jest.setup.js"
144
+ ],
145
+ "modulePathIgnorePatterns": [
146
+ "<rootDir>/example/node_modules",
147
+ "<rootDir>/lib/"
148
+ ]
149
+ },
150
+ "commitlint": {
151
+ "extends": [
152
+ "@commitlint/config-conventional"
153
+ ]
154
+ },
155
+ "release-it": {
156
+ "git": {
157
+ "commitMessage": "chore: release ${version}",
158
+ "tagName": "v${version}"
159
+ },
160
+ "npm": {
161
+ "publish": true
162
+ },
163
+ "github": {
164
+ "release": true
165
+ },
166
+ "plugins": {
167
+ "@release-it/conventional-changelog": {
168
+ "preset": {
169
+ "name": "angular"
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "prettier": {
175
+ "quoteProps": "consistent",
176
+ "singleQuote": true,
177
+ "tabWidth": 2,
178
+ "trailingComma": "es5",
179
+ "useTabs": false
180
+ },
181
+ "create-react-native-library": {
182
+ "type": "turbo-module",
183
+ "languages": "kotlin-objc",
184
+ "tools": [
185
+ "jest",
186
+ "lefthook",
187
+ "release-it",
188
+ "eslint"
189
+ ],
190
+ "version": "0.57.0"
191
+ }
192
+ }