@developer_tribe/react-builder 1.2.43 → 1.2.44-test.2

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 (115) hide show
  1. package/dist/attributes-editor/Field.d.ts +3 -1
  2. package/dist/attributes-editor/attributesEditorModelTypes.d.ts +3 -0
  3. package/dist/attributes-editor/useAttributesEditorModel.d.ts +1 -1
  4. package/dist/build-components/Checkbox/Checkbox.d.ts +6 -0
  5. package/dist/build-components/Checkbox/CheckboxProps.generated.d.ts +67 -0
  6. package/dist/build-components/FormCheckbox/FormCheckbox.d.ts +3 -0
  7. package/dist/build-components/FormCheckbox/FormCheckboxProps.generated.d.ts +69 -0
  8. package/dist/build-components/FormErrorText/FormErrorText.d.ts +3 -0
  9. package/dist/build-components/FormErrorText/FormErrorTextProps.generated.d.ts +61 -0
  10. package/dist/build-components/FormProvider/FormProvider.d.ts +11 -0
  11. package/dist/build-components/FormProvider/FormProviderProps.generated.d.ts +55 -0
  12. package/dist/build-components/FormSubmitButton/FormSubmitButton.d.ts +2 -0
  13. package/dist/build-components/FormSubmitButton/FormSubmitButtonProps.generated.d.ts +78 -0
  14. package/dist/build-components/GlobalProvider/GlobalContext.d.ts +28 -0
  15. package/dist/build-components/GlobalProvider/GlobalProvider.d.ts +5 -0
  16. package/dist/build-components/GlobalProvider/GlobalProviderProps.generated.d.ts +60 -0
  17. package/dist/build-components/GlobalProvider/globalProviderUtils.d.ts +28 -0
  18. package/dist/build-components/GlobalProvider/useGlobalNavigation.d.ts +19 -0
  19. package/dist/build-components/GlobalProvider/useGlobalProviderLogic.d.ts +15 -0
  20. package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +22 -10
  21. package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +2 -0
  22. package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +2 -0
  23. package/dist/build-components/SystemButton/SystemButton.d.ts +7 -0
  24. package/dist/build-components/SystemButton/SystemButtonProps.generated.d.ts +76 -0
  25. package/dist/build-components/SystemButton/usePlacementButtonEvents.d.ts +35 -0
  26. package/dist/build-components/TermsProvider/TermsProvider.d.ts +5 -0
  27. package/dist/build-components/TermsProvider/TermsProviderProps.generated.d.ts +55 -0
  28. package/dist/build-components/WebView/WebView.d.ts +2 -0
  29. package/dist/build-components/WebView/WebViewProps.generated.d.ts +59 -0
  30. package/dist/build-components/index.d.ts +10 -1
  31. package/dist/build-components/patterns.generated.d.ts +5645 -1686
  32. package/dist/index.cjs.js +1 -1
  33. package/dist/index.cjs.js.map +1 -1
  34. package/dist/index.esm.js +1 -1
  35. package/dist/index.esm.js.map +1 -1
  36. package/dist/index.web.cjs.js +5 -5
  37. package/dist/index.web.cjs.js.map +1 -1
  38. package/dist/index.web.d.ts +1 -0
  39. package/dist/index.web.esm.js +4 -4
  40. package/dist/index.web.esm.js.map +1 -1
  41. package/dist/mockOS/context/MockOSContextBase.d.ts +3 -1
  42. package/dist/styles.css +1 -1
  43. package/dist/types/PreviewConfig.d.ts +1 -1
  44. package/dist/utils/nodeTree.d.ts +18 -0
  45. package/package.json +2 -1
  46. package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +68 -4
  47. package/src/assets/meta.json +1 -1
  48. package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
  49. package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
  50. package/src/assets/samples/getSamples.ts +7 -0
  51. package/src/assets/samples/global-onboard-flow.json +735 -0
  52. package/src/assets/samples/terms-and-privacy-no-form.json +108 -0
  53. package/src/assets/samples/terms-and-privacy.json +130 -0
  54. package/src/attributes-editor/AttributesEditorView.tsx +3 -0
  55. package/src/attributes-editor/Field.tsx +91 -2
  56. package/src/attributes-editor/attributesEditorModelTypes.ts +3 -0
  57. package/src/attributes-editor/useAttributesEditorModel.ts +8 -0
  58. package/src/build-components/Checkbox/Checkbox.tsx +165 -0
  59. package/src/build-components/Checkbox/CheckboxProps.generated.ts +84 -0
  60. package/src/build-components/Checkbox/pattern.json +83 -0
  61. package/src/build-components/FormCheckbox/FormCheckbox.tsx +108 -0
  62. package/src/build-components/FormCheckbox/FormCheckboxProps.generated.ts +86 -0
  63. package/src/build-components/FormCheckbox/pattern.json +39 -0
  64. package/src/build-components/FormErrorText/FormErrorText.tsx +34 -0
  65. package/src/build-components/FormErrorText/FormErrorTextProps.generated.ts +78 -0
  66. package/src/build-components/FormErrorText/pattern.json +21 -0
  67. package/src/build-components/FormProvider/FormProvider.tsx +131 -0
  68. package/src/build-components/FormProvider/FormProviderProps.generated.ts +72 -0
  69. package/src/build-components/FormProvider/pattern.json +33 -0
  70. package/src/build-components/FormSubmitButton/FormSubmitButton.tsx +52 -0
  71. package/src/build-components/FormSubmitButton/FormSubmitButtonProps.generated.ts +114 -0
  72. package/src/build-components/FormSubmitButton/pattern.json +33 -0
  73. package/src/build-components/GlobalProvider/GlobalContext.ts +48 -0
  74. package/src/build-components/GlobalProvider/GlobalProvider.tsx +51 -0
  75. package/src/build-components/GlobalProvider/GlobalProviderProps.generated.ts +78 -0
  76. package/src/build-components/GlobalProvider/globalProviderUtils.ts +204 -0
  77. package/src/build-components/GlobalProvider/pattern.json +55 -0
  78. package/src/build-components/GlobalProvider/useGlobalNavigation.ts +65 -0
  79. package/src/build-components/GlobalProvider/useGlobalProviderLogic.ts +172 -0
  80. package/src/build-components/OnboardButton/OnboardButton.tsx +44 -36
  81. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +40 -10
  82. package/src/build-components/OnboardButton/pattern.json +7 -4
  83. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +12 -0
  84. package/src/build-components/OnboardProvider/pattern.json +9 -1
  85. package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +12 -0
  86. package/src/build-components/PaywallProvider/pattern.json +9 -1
  87. package/src/build-components/RenderNode.generated.tsx +46 -1
  88. package/src/build-components/SystemButton/SystemButton.tsx +74 -0
  89. package/src/build-components/SystemButton/SystemButtonProps.generated.ts +112 -0
  90. package/src/build-components/SystemButton/pattern.json +63 -0
  91. package/src/build-components/SystemButton/usePlacementButtonEvents.ts +114 -0
  92. package/src/build-components/TermsProvider/TermsProvider.tsx +45 -0
  93. package/src/build-components/TermsProvider/TermsProviderProps.generated.ts +82 -0
  94. package/src/build-components/TermsProvider/pattern.json +35 -0
  95. package/src/build-components/WebView/WebView.tsx +149 -0
  96. package/src/build-components/WebView/WebViewProps.generated.ts +76 -0
  97. package/src/build-components/WebView/pattern.json +71 -0
  98. package/src/build-components/index.ts +45 -0
  99. package/src/build-components/patterns.generated.ts +5735 -1557
  100. package/src/components/AttributesEditorPanel.tsx +1 -0
  101. package/src/index.web.ts +3 -0
  102. package/src/mockOS/components/MockOSRouter.tsx +21 -0
  103. package/src/mockOS/context/MockOSContext.tsx +7 -0
  104. package/src/mockOS/context/MockOSContextBase.ts +4 -0
  105. package/src/patterns/event-constants.json +19 -0
  106. package/src/styles/components/_checkbox.scss +19 -0
  107. package/src/styles/components/_global-provider.scss +131 -0
  108. package/src/styles/components/_webview.scss +52 -0
  109. package/src/styles/index.scss +4 -0
  110. package/src/types/PreviewConfig.ts +19 -0
  111. package/src/utils/analyseNodeByPatterns.ts +5 -2
  112. package/src/utils/nodeTree.ts +115 -0
  113. package/src/utils/projectColors.ts +4 -0
  114. package/src/.DS_Store +0 -0
  115. package/src/assets/.DS_Store +0 -0
@@ -3,6 +3,7 @@ import type { ViewPropsGenerated } from '../build-components/View/ViewProps.gene
3
3
  import type { ProjectColors } from '../types/Project';
4
4
  import { type PreferredScale } from './SizeField';
5
5
  import { LayoutContext } from './types';
6
+ import type { ProjectOptions } from '../utils/nodeTree';
6
7
  type FieldProps = {
7
8
  name: string;
8
9
  type: string | string[];
@@ -14,6 +15,7 @@ type FieldProps = {
14
15
  viewAttributes?: Partial<ViewPropsGenerated['attributes']>;
15
16
  label?: React.ReactNode;
16
17
  preferredScale?: PreferredScale;
18
+ projectOptions?: ProjectOptions;
17
19
  };
18
- export declare function Field({ name, type, value, onChange, componentType, projectColors, layoutContext, viewAttributes, label, preferredScale, }: FieldProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function Field({ name, type, value, onChange, componentType, projectColors, layoutContext, viewAttributes, label, preferredScale, projectOptions, }: FieldProps): import("react/jsx-runtime").JSX.Element;
19
21
  export {};
@@ -3,11 +3,13 @@ import type { ProjectColors } from '../types/Project';
3
3
  import type { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
4
4
  import type { Fonts } from '../types/Fonts';
5
5
  import type { LayoutContext, SchemaEntry } from './types';
6
+ import type { ProjectOptions } from '../utils/nodeTree';
6
7
  export type TabId = 'style' | 'container' | 'other';
7
8
  export type AttributesEditorProps = {
8
9
  node: Node;
9
10
  onChange: (next: Node) => void;
10
11
  projectColors?: ProjectColors;
12
+ projectRoot?: Node;
11
13
  };
12
14
  export type AttributesEditorTabConfig = {
13
15
  id: TabId;
@@ -47,6 +49,7 @@ export type AttributesEditorModel = {
47
49
  projectColorsForPicker?: ProjectColors;
48
50
  viewAttributes?: Partial<ViewPropsGenerated['attributes']>;
49
51
  layoutContext: LayoutContext;
52
+ projectOptions: ProjectOptions;
50
53
  getAttributeValue: (name: string) => unknown;
51
54
  handleAttributeChange: (name: string, val: unknown) => void;
52
55
  handleChildrenChange: (val: string) => void;
@@ -1,2 +1,2 @@
1
1
  import type { AttributesEditorModel, AttributesEditorProps } from './attributesEditorModelTypes';
2
- export declare function useAttributesEditorModel({ node, onChange, projectColors, }: AttributesEditorProps): AttributesEditorModel;
2
+ export declare function useAttributesEditorModel({ node, onChange, projectColors, projectRoot, }: AttributesEditorProps): AttributesEditorModel;
@@ -0,0 +1,6 @@
1
+ import { CheckboxComponentProps } from './CheckboxProps.generated';
2
+ export interface CheckboxProps extends CheckboxComponentProps {
3
+ checked?: boolean;
4
+ onCheckedChange?: (value: boolean) => void;
5
+ }
6
+ export declare function Checkbox({ node, checked: controlledChecked, onCheckedChange, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type FlexDirectionOptionType = 'row' | 'column';
3
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
4
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
5
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
6
+ export type PositionOptionType = 'relative' | 'absolute';
7
+ export interface CheckboxStyleGenerated {
8
+ color?: string;
9
+ fontSize?: string;
10
+ fontFamily?: string;
11
+ fontWeight?: string;
12
+ textAlign?: string;
13
+ flexDirection?: FlexDirectionOptionType;
14
+ flexWrap?: FlexWrapOptionType;
15
+ alignItems?: AlignItemsOptionType;
16
+ justifyContent?: JustifyContentOptionType;
17
+ gap?: string;
18
+ padding?: string;
19
+ paddingHorizontal?: string;
20
+ paddingVertical?: string;
21
+ paddingTop?: string;
22
+ paddingBottom?: string;
23
+ paddingLeft?: string;
24
+ paddingRight?: string;
25
+ margin?: string;
26
+ marginHorizontal?: string;
27
+ marginVertical?: string;
28
+ marginTop?: string;
29
+ marginBottom?: string;
30
+ marginLeft?: string;
31
+ marginRight?: string;
32
+ backgroundColor?: string;
33
+ borderRadius?: number;
34
+ width?: string;
35
+ minWidth?: string;
36
+ maxWidth?: string;
37
+ height?: string;
38
+ minHeight?: string;
39
+ maxHeight?: string;
40
+ flex?: number;
41
+ position?: PositionOptionType;
42
+ top?: string;
43
+ bottom?: string;
44
+ left?: string;
45
+ right?: string;
46
+ zIndex?: number;
47
+ checkIconSize?: number;
48
+ checkIconStrokeWidth?: number;
49
+ }
50
+ export interface CheckboxPropsGenerated {
51
+ child: string;
52
+ attributes: {
53
+ styles?: CheckboxStyleGenerated;
54
+ adjustsFontSizeToFit?: boolean;
55
+ numberOfLines?: number;
56
+ translateCounter?: number;
57
+ scrollable?: boolean;
58
+ testID?: string;
59
+ checked?: boolean;
60
+ label?: string;
61
+ checkedColor?: string;
62
+ syncTermsAccepted?: boolean;
63
+ };
64
+ }
65
+ export interface CheckboxComponentProps {
66
+ node: NodeData<CheckboxPropsGenerated['attributes']>;
67
+ }
@@ -0,0 +1,3 @@
1
+ import type { FormCheckboxComponentProps } from './FormCheckboxProps.generated';
2
+ /** FormCheckbox wraps Checkbox with RHF; UI and styling come from Checkbox. */
3
+ export declare function FormCheckbox({ node }: FormCheckboxComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type FlexDirectionOptionType = 'row' | 'column';
3
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
4
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
5
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
6
+ export type PositionOptionType = 'relative' | 'absolute';
7
+ export interface FormCheckboxStyleGenerated {
8
+ borderRadius?: string;
9
+ checkIconSize?: number;
10
+ checkIconStrokeWidth?: number;
11
+ color?: string;
12
+ fontSize?: string;
13
+ fontFamily?: string;
14
+ fontWeight?: string;
15
+ textAlign?: string;
16
+ flexDirection?: FlexDirectionOptionType;
17
+ flexWrap?: FlexWrapOptionType;
18
+ alignItems?: AlignItemsOptionType;
19
+ justifyContent?: JustifyContentOptionType;
20
+ gap?: string;
21
+ padding?: string;
22
+ paddingHorizontal?: string;
23
+ paddingVertical?: string;
24
+ paddingTop?: string;
25
+ paddingBottom?: string;
26
+ paddingLeft?: string;
27
+ paddingRight?: string;
28
+ margin?: string;
29
+ marginHorizontal?: string;
30
+ marginVertical?: string;
31
+ marginTop?: string;
32
+ marginBottom?: string;
33
+ marginLeft?: string;
34
+ marginRight?: string;
35
+ backgroundColor?: string;
36
+ width?: string;
37
+ minWidth?: string;
38
+ maxWidth?: string;
39
+ height?: string;
40
+ minHeight?: string;
41
+ maxHeight?: string;
42
+ flex?: number;
43
+ position?: PositionOptionType;
44
+ top?: string;
45
+ bottom?: string;
46
+ left?: string;
47
+ right?: string;
48
+ zIndex?: number;
49
+ }
50
+ export interface FormCheckboxPropsGenerated {
51
+ child: string;
52
+ attributes: {
53
+ styles?: FormCheckboxStyleGenerated;
54
+ checked?: boolean;
55
+ label?: string;
56
+ checkedColor?: string;
57
+ syncTermsAccepted?: boolean;
58
+ adjustsFontSizeToFit?: boolean;
59
+ numberOfLines?: number;
60
+ translateCounter?: number;
61
+ scrollable?: boolean;
62
+ testID?: string;
63
+ name?: string;
64
+ validation?: string[];
65
+ };
66
+ }
67
+ export interface FormCheckboxComponentProps {
68
+ node: NodeData<FormCheckboxPropsGenerated['attributes']>;
69
+ }
@@ -0,0 +1,3 @@
1
+ import type { FormErrorTextComponentProps } from './FormErrorTextProps.generated';
2
+ /** Renders FormProvider globalError as Text when present; only valid inside FormProvider. */
3
+ export declare function FormErrorText({ node }: FormErrorTextComponentProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,61 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type FlexDirectionOptionType = 'row' | 'column';
3
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
4
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
5
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
6
+ export type PositionOptionType = 'relative' | 'absolute';
7
+ export interface FormErrorTextStyleGenerated {
8
+ color?: string;
9
+ fontSize?: string;
10
+ fontFamily?: string;
11
+ fontWeight?: string;
12
+ textAlign?: string;
13
+ flexDirection?: FlexDirectionOptionType;
14
+ flexWrap?: FlexWrapOptionType;
15
+ alignItems?: AlignItemsOptionType;
16
+ justifyContent?: JustifyContentOptionType;
17
+ gap?: string;
18
+ padding?: string;
19
+ paddingHorizontal?: string;
20
+ paddingVertical?: string;
21
+ paddingTop?: string;
22
+ paddingBottom?: string;
23
+ paddingLeft?: string;
24
+ paddingRight?: string;
25
+ margin?: string;
26
+ marginHorizontal?: string;
27
+ marginVertical?: string;
28
+ marginTop?: string;
29
+ marginBottom?: string;
30
+ marginLeft?: string;
31
+ marginRight?: string;
32
+ backgroundColor?: string;
33
+ borderRadius?: string;
34
+ width?: string;
35
+ minWidth?: string;
36
+ maxWidth?: string;
37
+ height?: string;
38
+ minHeight?: string;
39
+ maxHeight?: string;
40
+ flex?: number;
41
+ position?: PositionOptionType;
42
+ top?: string;
43
+ bottom?: string;
44
+ left?: string;
45
+ right?: string;
46
+ zIndex?: number;
47
+ }
48
+ export interface FormErrorTextPropsGenerated {
49
+ child: string;
50
+ attributes: {
51
+ styles?: FormErrorTextStyleGenerated;
52
+ adjustsFontSizeToFit?: boolean;
53
+ numberOfLines?: number;
54
+ translateCounter?: number;
55
+ scrollable?: boolean;
56
+ testID?: string;
57
+ };
58
+ }
59
+ export interface FormErrorTextComponentProps {
60
+ node: NodeData<FormErrorTextPropsGenerated['attributes']>;
61
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { UseFormReturn } from 'react-hook-form';
3
+ import type { FormProviderComponentProps } from './FormProviderProps.generated';
4
+ export type FormContextValue = {
5
+ handleSubmit: (callback: (data: Record<string, unknown>) => void | Promise<unknown>) => (e?: React.BaseSyntheticEvent) => void;
6
+ isValid: boolean;
7
+ globalError: string | null;
8
+ control: UseFormReturn<Record<string, unknown>>['control'];
9
+ };
10
+ export declare const formContext: React.Context<FormContextValue | null>;
11
+ export declare function FormProvider(props: FormProviderComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type FlexDirectionOptionType = 'row' | 'column';
3
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
4
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
5
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
6
+ export type PositionOptionType = 'relative' | 'absolute';
7
+ export interface FormProviderStyleGenerated {
8
+ flexDirection?: FlexDirectionOptionType;
9
+ flexWrap?: FlexWrapOptionType;
10
+ alignItems?: AlignItemsOptionType;
11
+ justifyContent?: JustifyContentOptionType;
12
+ gap?: string;
13
+ padding?: string;
14
+ paddingHorizontal?: string;
15
+ paddingVertical?: string;
16
+ paddingTop?: string;
17
+ paddingBottom?: string;
18
+ paddingLeft?: string;
19
+ paddingRight?: string;
20
+ margin?: string;
21
+ marginHorizontal?: string;
22
+ marginVertical?: string;
23
+ marginTop?: string;
24
+ marginBottom?: string;
25
+ marginLeft?: string;
26
+ marginRight?: string;
27
+ backgroundColor?: string;
28
+ borderRadius?: string;
29
+ width?: string;
30
+ minWidth?: string;
31
+ maxWidth?: string;
32
+ height?: string;
33
+ minHeight?: string;
34
+ maxHeight?: string;
35
+ flex?: number;
36
+ position?: PositionOptionType;
37
+ top?: string;
38
+ bottom?: string;
39
+ left?: string;
40
+ right?: string;
41
+ zIndex?: number;
42
+ }
43
+ export interface FormProviderPropsGenerated {
44
+ child: string;
45
+ attributes: {
46
+ styles?: FormProviderStyleGenerated;
47
+ scrollable?: boolean;
48
+ testID?: string;
49
+ defaultValues?: string;
50
+ validationErrorMessageKey?: string;
51
+ };
52
+ }
53
+ export interface FormProviderComponentProps {
54
+ node: NodeData<FormProviderPropsGenerated['attributes']>;
55
+ }
@@ -0,0 +1,2 @@
1
+ import type { FormSubmitButtonComponentProps } from './FormSubmitButtonProps.generated';
2
+ export declare function FormSubmitButton({ node }: FormSubmitButtonComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,78 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type TypeOptionType = 'Permission' | 'Navigate' | 'Placement' | 'SetCondition';
3
+ export type PermissionOptionType = 'notification' | 'camera' | 'microphone' | 'location' | 'photos' | 'contacts' | 'att' | 'rating' | 'GDPR';
4
+ export type PlacementKeyOptionType = 'terms' | 'onboard' | 'paywall' | 'subscription' | 'home';
5
+ export type ConditionKeyOptionType = 'termsAccepted';
6
+ export type FlexDirectionOptionType = 'row' | 'column';
7
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
8
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
9
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
10
+ export type PositionOptionType = 'relative' | 'absolute';
11
+ export interface EventObjectGenerated {
12
+ type?: TypeOptionType;
13
+ permission?: PermissionOptionType;
14
+ navigate_to?: string;
15
+ targetIndex?: number;
16
+ placementKey?: PlacementKeyOptionType;
17
+ conditionKey?: ConditionKeyOptionType;
18
+ value?: boolean;
19
+ }
20
+ export interface FormSubmitButtonStyleGenerated {
21
+ color?: string;
22
+ backgroundColor?: string;
23
+ height?: string;
24
+ borderRadius?: string;
25
+ fontSize?: string;
26
+ fontWeight?: string;
27
+ fontFamily?: string;
28
+ textAlign?: string;
29
+ flexDirection?: FlexDirectionOptionType;
30
+ flexWrap?: FlexWrapOptionType;
31
+ alignItems?: AlignItemsOptionType;
32
+ justifyContent?: JustifyContentOptionType;
33
+ gap?: string;
34
+ padding?: string;
35
+ paddingHorizontal?: string;
36
+ paddingVertical?: string;
37
+ paddingTop?: string;
38
+ paddingBottom?: string;
39
+ paddingLeft?: string;
40
+ paddingRight?: string;
41
+ margin?: string;
42
+ marginHorizontal?: string;
43
+ marginVertical?: string;
44
+ marginTop?: string;
45
+ marginBottom?: string;
46
+ marginLeft?: string;
47
+ marginRight?: string;
48
+ width?: string;
49
+ minWidth?: string;
50
+ maxWidth?: string;
51
+ minHeight?: string;
52
+ maxHeight?: string;
53
+ flex?: number;
54
+ position?: PositionOptionType;
55
+ top?: string;
56
+ bottom?: string;
57
+ left?: string;
58
+ right?: string;
59
+ zIndex?: number;
60
+ }
61
+ export interface FormSubmitButtonPropsGenerated {
62
+ child: string;
63
+ attributes: {
64
+ styles?: FormSubmitButtonStyleGenerated;
65
+ labelKey?: string;
66
+ events?: EventObjectGenerated[];
67
+ testID?: string;
68
+ adjustsFontSizeToFit?: boolean;
69
+ numberOfLines?: number;
70
+ translateCounter?: number;
71
+ scrollable?: boolean;
72
+ disableIfUnvalidated?: boolean;
73
+ validationRequired?: boolean;
74
+ };
75
+ }
76
+ export interface FormSubmitButtonComponentProps {
77
+ node: NodeData<FormSubmitButtonPropsGenerated['attributes']>;
78
+ }
@@ -0,0 +1,28 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ /** Supported transition animations when navigating to this page (platform-style names).
3
+ * rn stack transition animations
4
+ */
5
+ export declare const GLOBAL_PAGE_ANIMATIONS: readonly ["default", "fade", "fade_from_bottom", "fade_from_right", "reveal_from_bottom", "scale_from_center", "slide_from_right", "slide_from_left", "slide_from_bottom", "none"];
6
+ export type GlobalPageAnimationType = (typeof GLOBAL_PAGE_ANIMATIONS)[number];
7
+ export interface GlobalPage {
8
+ key: string;
9
+ node: NodeData;
10
+ /** Condition key: this page is skipped when conditions[skipIf] === true */
11
+ skipIf?: string;
12
+ /** Optional transition animation when this page is shown (push/enter). */
13
+ animation?: string;
14
+ index: number;
15
+ }
16
+ export interface GlobalContextValue {
17
+ currentPageKey: string;
18
+ pages: GlobalPage[];
19
+ pageStack: string[];
20
+ navigate: (key: string) => void;
21
+ goNext: () => void;
22
+ goBack: () => boolean;
23
+ /** Runtime boolean conditions (e.g. termsAccepted) */
24
+ conditions: Record<string, boolean>;
25
+ setCondition: (key: string, value: boolean) => void;
26
+ }
27
+ export declare const GlobalContext: import("react").Context<GlobalContextValue | null>;
28
+ export declare function useGlobalContext(): GlobalContextValue | null;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { GlobalProviderComponentProps } from './GlobalProviderProps.generated';
3
+ declare function GlobalProvider({ node }: GlobalProviderComponentProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof GlobalProvider>;
5
+ export default _default;
@@ -0,0 +1,60 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ export type FlexDirectionOptionType = 'row' | 'column';
3
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
4
+ export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
5
+ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
6
+ export type PositionOptionType = 'relative' | 'absolute';
7
+ export interface SkipConditionEntryGenerated {
8
+ pageKey?: string;
9
+ conditionKey?: string;
10
+ }
11
+ export interface GlobalProviderStyleGenerated {
12
+ flexDirection?: FlexDirectionOptionType;
13
+ flexWrap?: FlexWrapOptionType;
14
+ alignItems?: AlignItemsOptionType;
15
+ justifyContent?: JustifyContentOptionType;
16
+ gap?: string;
17
+ padding?: string;
18
+ paddingHorizontal?: string;
19
+ paddingVertical?: string;
20
+ paddingTop?: string;
21
+ paddingBottom?: string;
22
+ paddingLeft?: string;
23
+ paddingRight?: string;
24
+ margin?: string;
25
+ marginHorizontal?: string;
26
+ marginVertical?: string;
27
+ marginTop?: string;
28
+ marginBottom?: string;
29
+ marginLeft?: string;
30
+ marginRight?: string;
31
+ backgroundColor?: string;
32
+ borderRadius?: string;
33
+ width?: string;
34
+ minWidth?: string;
35
+ maxWidth?: string;
36
+ height?: string;
37
+ minHeight?: string;
38
+ maxHeight?: string;
39
+ flex?: number;
40
+ position?: PositionOptionType;
41
+ top?: string;
42
+ bottom?: string;
43
+ left?: string;
44
+ right?: string;
45
+ zIndex?: number;
46
+ }
47
+ export interface GlobalProviderPropsGenerated {
48
+ child: string;
49
+ attributes: {
50
+ styles?: GlobalProviderStyleGenerated;
51
+ scrollable?: boolean;
52
+ testID?: string;
53
+ initialPage?: string;
54
+ persistProgress?: boolean;
55
+ skipConditions?: SkipConditionEntryGenerated[];
56
+ };
57
+ }
58
+ export interface GlobalProviderComponentProps {
59
+ node: NodeData<GlobalProviderPropsGenerated['attributes']>;
60
+ }
@@ -0,0 +1,28 @@
1
+ import type { NodeData } from '../../types/Node';
2
+ import type { GlobalPage } from './GlobalContext';
3
+ /**
4
+ * Derives a stable and unique page key for a child node.
5
+ * Priority: node.key → TYPE_KEY_MAP → "${type}-${index}"
6
+ */
7
+ export declare function derivePageKey(node: NodeData, index: number, existingKeys: Set<string>): string;
8
+ /** Runtime shape of a SkipConditionEntry (mirrors the types block in pattern.json). */
9
+ export interface SkipConditionEntry {
10
+ pageKey: string;
11
+ conditionKey: string;
12
+ }
13
+ /**
14
+ * Converts SkipConditionEntry[] (from pattern schema) to a lookup map for fast access.
15
+ */
16
+ export declare function normalizeSkipConditions(raw: unknown): Record<string, string>;
17
+ /**
18
+ * Builds the page list for GlobalProvider.
19
+ */
20
+ export declare function buildPages(children: NodeData[], skipConditions?: Record<string, string>): GlobalPage[];
21
+ /** Returns the first non-skipped page key, starting from the requested key. */
22
+ export declare function resolveEffectivePage(targetKey: string, pages: GlobalPage[], conditions: Record<string, boolean>): string | null;
23
+ export declare function persistProgress(storageKey: string, currentPageKey: string, conditions: Record<string, boolean>): void;
24
+ export declare function loadProgress(storageKey: string): {
25
+ currentPageKey: string;
26
+ conditions: Record<string, boolean>;
27
+ } | null;
28
+ export declare function clearProgress(storageKey: string): void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Maps route/placement aliases to their canonical GlobalProvider page keys.
3
+ *
4
+ * Add entries here when a new alias should resolve to an existing page key.
5
+ * Keys are the incoming target strings (from JSON events / usePlacementButtonEvents).
6
+ * Values are the canonical page key that GlobalContext.navigate() will receive.
7
+ *
8
+ * Exported so other modules (e.g. a navigation-flow visualiser) can inspect
9
+ * which aliases exist without duplicating this logic.
10
+ */
11
+ export declare const GLOBAL_ROUTE_ALIASES: Record<string, string>;
12
+ /**
13
+ * Returns a navigate function that first attempts to route within GlobalContext
14
+ * (when a GlobalProvider is active), then falls back to MockOSContext navigation.
15
+ *
16
+ * Used by SystemButton and OnboardButton so that events defined in JSON work
17
+ * transparently whether rendered inside a GlobalProvider or standalone.
18
+ */
19
+ export declare function useGlobalNavigation(): (target: string) => boolean;
@@ -0,0 +1,15 @@
1
+ import type { GlobalContextValue } from './GlobalContext';
2
+ import type { NodeData } from '../../types/Node';
3
+ export interface UseGlobalProviderLogicOptions {
4
+ node: NodeData;
5
+ }
6
+ export declare function useGlobalProviderLogic({ node: rawNode, }: UseGlobalProviderLogicOptions): {
7
+ node: NodeData<Record<string, unknown>>;
8
+ attributeName: string;
9
+ attributeKey: string;
10
+ attrs: Record<string, unknown> | undefined;
11
+ pages: import("./GlobalContext").GlobalPage[];
12
+ currentPageKey: string;
13
+ activePage: import("./GlobalContext").GlobalPage | undefined;
14
+ contextValue: GlobalContextValue;
15
+ };
@@ -1,6 +1,8 @@
1
1
  import type { NodeData } from '../../types/Node';
2
- export type TypeOptionType = 'Permission' | 'Navigate';
3
- export type PermissionOptionType = 'att' | 'notification' | 'rating' | 'GDPR';
2
+ export type TypeOptionType = 'Permission' | 'Navigate' | 'Placement' | 'SetCondition';
3
+ export type PermissionOptionType = 'notification' | 'camera' | 'microphone' | 'location' | 'photos' | 'contacts' | 'att' | 'rating' | 'GDPR';
4
+ export type PlacementKeyOptionType = 'terms' | 'onboard' | 'paywall' | 'subscription' | 'home';
5
+ export type ConditionKeyOptionType = 'termsAccepted';
4
6
  export type TestIDOptionType = 'onboardSkip' | 'onboardNext';
5
7
  export type AnimationOptionType = 'simple-animation' | 'line-animation' | 'blur' | 'blur-animation' | 'blur-line-animation';
6
8
  export type FlexDirectionOptionType = 'row' | 'column';
@@ -10,11 +12,22 @@ export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 's
10
12
  export type PositionOptionType = 'relative' | 'absolute';
11
13
  export interface EventObjectGenerated {
12
14
  type?: TypeOptionType;
13
- permission?: PermissionOptionType | null;
15
+ permission?: PermissionOptionType;
14
16
  navigate_to?: string;
15
17
  targetIndex?: number;
18
+ placementKey?: PlacementKeyOptionType;
19
+ conditionKey?: ConditionKeyOptionType;
20
+ value?: boolean;
16
21
  }
17
22
  export interface OnboardButtonStyleGenerated {
23
+ color?: string;
24
+ backgroundColor?: string;
25
+ height?: string;
26
+ borderRadius?: string;
27
+ fontSize?: string;
28
+ fontWeight?: string;
29
+ fontFamily?: string;
30
+ textAlign?: string;
18
31
  flexDirection?: FlexDirectionOptionType;
19
32
  flexWrap?: FlexWrapOptionType;
20
33
  alignItems?: AlignItemsOptionType;
@@ -34,12 +47,9 @@ export interface OnboardButtonStyleGenerated {
34
47
  marginBottom?: string;
35
48
  marginLeft?: string;
36
49
  marginRight?: string;
37
- backgroundColor?: string;
38
- borderRadius?: string;
39
50
  width?: string;
40
51
  minWidth?: string;
41
52
  maxWidth?: string;
42
- height?: string;
43
53
  minHeight?: string;
44
54
  maxHeight?: string;
45
55
  flex?: number;
@@ -49,18 +59,20 @@ export interface OnboardButtonStyleGenerated {
49
59
  left?: string;
50
60
  right?: string;
51
61
  zIndex?: number;
52
- color?: string;
53
62
  }
54
63
  export interface OnboardButtonPropsGenerated {
55
64
  child: string;
56
65
  attributes: {
57
66
  styles?: OnboardButtonStyleGenerated;
58
- scrollable?: boolean;
59
- testID?: TestIDOptionType;
60
67
  labelKey?: string;
68
+ events?: EventObjectGenerated[];
69
+ testID?: TestIDOptionType;
70
+ adjustsFontSizeToFit?: boolean;
71
+ numberOfLines?: number;
72
+ translateCounter?: number;
73
+ scrollable?: boolean;
61
74
  animation?: AnimationOptionType;
62
75
  animation_color?: string;
63
- events?: EventObjectGenerated[];
64
76
  };
65
77
  }
66
78
  export interface OnboardButtonComponentProps {
@@ -1,5 +1,6 @@
1
1
  import type { NodeData } from '../../types/Node';
2
2
  export type ThemeOptionType = 'light' | 'dark' | 'all';
3
+ export type AnimationOptionType = 'default' | 'fade' | 'fade_from_bottom' | 'fade_from_right' | 'reveal_from_bottom' | 'scale_from_center' | 'slide_from_right' | 'slide_from_left' | 'slide_from_bottom' | 'none';
3
4
  export type FlexDirectionOptionType = 'row' | 'column';
4
5
  export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
5
6
  export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
@@ -49,6 +50,7 @@ export interface OnboardProviderPropsGenerated {
49
50
  testID?: string;
50
51
  theme?: ThemeOptionType;
51
52
  borderRadius?: never;
53
+ animation?: AnimationOptionType;
52
54
  };
53
55
  }
54
56
  export interface OnboardProviderComponentProps {