@developer_tribe/react-builder 1.2.44-test.2 → 1.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attributes-editor/Field.d.ts +1 -3
- package/dist/attributes-editor/attributesEditorModelTypes.d.ts +0 -3
- package/dist/attributes-editor/useAttributesEditorModel.d.ts +1 -1
- package/dist/build-components/FormSubmitButton/FormSubmitButtonProps.generated.d.ts +3 -8
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +3 -8
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +0 -2
- package/dist/build-components/SystemButton/SystemButtonProps.generated.d.ts +3 -8
- package/dist/build-components/SystemButton/usePlacementButtonEvents.d.ts +2 -15
- package/dist/build-components/index.d.ts +1 -3
- package/dist/build-components/patterns.generated.d.ts +1334 -2129
- package/dist/components/DeviceButton.d.ts +2 -1
- package/dist/index.cjs.js +28 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +28 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.web.cjs.js +4 -4
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.esm.js +3 -3
- package/dist/index.web.esm.js.map +1 -1
- package/dist/modals/CreateDeviceModal.d.ts +8 -0
- package/dist/product-base/periodLocalizationKeys.d.ts +16 -0
- package/dist/store/customDeviceStore.d.ts +21 -0
- package/dist/store.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/nodeTree.d.ts +0 -18
- package/package.json +1 -1
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +4 -68
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
- package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
- package/src/assets/samples/getSamples.ts +0 -2
- package/src/assets/samples/terms-and-privacy-no-form.json +1 -1
- package/src/assets/samples/terms-and-privacy.json +1 -1
- package/src/attributes-editor/AttributesEditorView.tsx +0 -3
- package/src/attributes-editor/Field.tsx +2 -91
- package/src/attributes-editor/attributesEditorModelTypes.ts +0 -3
- package/src/attributes-editor/useAttributesEditorModel.ts +0 -8
- package/src/build-components/FormCheckbox/FormCheckbox.tsx +3 -3
- package/src/build-components/FormSubmitButton/FormSubmitButton.tsx +0 -6
- package/src/build-components/FormSubmitButton/FormSubmitButtonProps.generated.ts +3 -26
- package/src/build-components/OnboardButton/OnboardButton.tsx +1 -8
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +3 -26
- package/src/build-components/OnboardButton/pattern.json +3 -5
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +0 -12
- package/src/build-components/OnboardProvider/pattern.json +1 -9
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +0 -12
- package/src/build-components/PaywallProvider/pattern.json +1 -9
- package/src/build-components/RenderNode.generated.tsx +0 -10
- package/src/build-components/SystemButton/SystemButton.tsx +0 -6
- package/src/build-components/SystemButton/SystemButtonProps.generated.ts +3 -26
- package/src/build-components/SystemButton/pattern.json +3 -5
- package/src/build-components/SystemButton/usePlacementButtonEvents.ts +27 -51
- package/src/build-components/Text/Text.tsx +2 -3
- package/src/build-components/index.ts +0 -10
- package/src/build-components/patterns.generated.ts +1379 -2270
- package/src/components/AttributesEditorPanel.tsx +0 -1
- package/src/components/DeviceButton.tsx +34 -1
- package/src/components/EditorHeader.tsx +22 -4
- package/src/modals/CreateDeviceModal.tsx +264 -0
- package/src/modals/DeviceSelectorModal.tsx +44 -7
- package/src/product-base/extractIOSParams.ts +10 -4
- package/src/product-base/periodLocalizationKeys.ts +46 -0
- package/src/store/customDeviceStore.ts +38 -0
- package/src/styles/components/_editor-shell.scss +12 -2
- package/src/styles/index.scss +1 -1
- package/src/styles/modals/_create-device.scss +113 -0
- package/src/utils/__special_exceptions.ts +8 -0
- package/src/utils/analyseNodeByPatterns.ts +10 -6
- package/src/utils/nodeTree.ts +0 -115
- package/dist/build-components/GlobalProvider/GlobalContext.d.ts +0 -28
- package/dist/build-components/GlobalProvider/GlobalProvider.d.ts +0 -5
- package/dist/build-components/GlobalProvider/GlobalProviderProps.generated.d.ts +0 -60
- package/dist/build-components/GlobalProvider/globalProviderUtils.d.ts +0 -28
- package/dist/build-components/GlobalProvider/useGlobalNavigation.d.ts +0 -19
- package/dist/build-components/GlobalProvider/useGlobalProviderLogic.d.ts +0 -15
- package/dist/build-components/TermsProvider/TermsProvider.d.ts +0 -5
- package/dist/build-components/TermsProvider/TermsProviderProps.generated.d.ts +0 -55
- package/src/assets/samples/global-onboard-flow.json +0 -735
- package/src/build-components/GlobalProvider/GlobalContext.ts +0 -48
- package/src/build-components/GlobalProvider/GlobalProvider.tsx +0 -51
- package/src/build-components/GlobalProvider/GlobalProviderProps.generated.ts +0 -78
- package/src/build-components/GlobalProvider/globalProviderUtils.ts +0 -204
- package/src/build-components/GlobalProvider/pattern.json +0 -55
- package/src/build-components/GlobalProvider/useGlobalNavigation.ts +0 -65
- package/src/build-components/GlobalProvider/useGlobalProviderLogic.ts +0 -172
- package/src/build-components/TermsProvider/TermsProvider.tsx +0 -45
- package/src/build-components/TermsProvider/TermsProviderProps.generated.ts +0 -82
- package/src/build-components/TermsProvider/pattern.json +0 -35
- package/src/patterns/event-constants.json +0 -19
- package/src/styles/components/_global-provider.scss +0 -131
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
@use '../foundation/colors' as colors;
|
|
2
|
+
@use '../foundation/sizes' as sizes;
|
|
3
|
+
@use '../foundation/typography' as typography;
|
|
4
|
+
|
|
5
|
+
.create-device-modal {
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 480px;
|
|
8
|
+
|
|
9
|
+
.modal__body {
|
|
10
|
+
padding: sizes.$spaceComfy;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: sizes.$spaceCozy;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.create-device-form {
|
|
18
|
+
&__group {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: sizes.$spaceTight;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__row {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: sizes.$spaceCozy;
|
|
27
|
+
|
|
28
|
+
> * {
|
|
29
|
+
flex: 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__label {
|
|
34
|
+
font-size: sizes.$fontSizeSm;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
color: colors.$mutedTextColor;
|
|
37
|
+
text-transform: uppercase;
|
|
38
|
+
letter-spacing: sizes.$letterSpacingTight;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__error {
|
|
42
|
+
color: colors.$dangerColor;
|
|
43
|
+
font-size: sizes.$fontSizeXs;
|
|
44
|
+
margin-top: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__footer {
|
|
48
|
+
margin-top: sizes.$spaceCozy;
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Global-ish classes but styled for this context if not already defined
|
|
55
|
+
.editor-input {
|
|
56
|
+
height: sizes.$controlHeightMd;
|
|
57
|
+
padding: 0 sizes.$spaceInset;
|
|
58
|
+
border-radius: sizes.$radiusMid;
|
|
59
|
+
border: 1px solid colors.$borderColor;
|
|
60
|
+
background: colors.$surfaceColor;
|
|
61
|
+
color: colors.$textColor;
|
|
62
|
+
font-family: inherit;
|
|
63
|
+
font-size: sizes.$fontSizeBase;
|
|
64
|
+
width: 100%;
|
|
65
|
+
transition:
|
|
66
|
+
border-color 0.2s ease,
|
|
67
|
+
box-shadow 0.2s ease;
|
|
68
|
+
|
|
69
|
+
&:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
border-color: colors.$accentColor;
|
|
72
|
+
box-shadow: 0 0 0 3px hsl(var(--rb-primary) / 0.15);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&::placeholder {
|
|
76
|
+
color: colors.$mutedTextColor;
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
select.editor-input {
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
appearance: none;
|
|
84
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 3 3 3-3'/%3E%3C/svg%3E");
|
|
85
|
+
background-repeat: no-repeat;
|
|
86
|
+
background-position: right sizes.$spaceInset center;
|
|
87
|
+
padding-right: sizes.$spaceRoomy;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.editor-button--primary {
|
|
91
|
+
background: colors.$textColor;
|
|
92
|
+
color: colors.$surfaceColor;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
border-color: colors.$textColor;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background: colors.$accentColor;
|
|
98
|
+
border-color: colors.$accentColor;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.device-selector-modal__search-container {
|
|
103
|
+
padding: 0 sizes.$spaceComfy;
|
|
104
|
+
margin-top: sizes.$spaceComfy;
|
|
105
|
+
margin-bottom: sizes.$spaceCompact;
|
|
106
|
+
display: flex;
|
|
107
|
+
gap: sizes.$spaceCozy;
|
|
108
|
+
align-items: center;
|
|
109
|
+
|
|
110
|
+
.editor-input {
|
|
111
|
+
flex: 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -79,6 +79,14 @@ export function normalizeNodeForValidation(
|
|
|
79
79
|
? normalizeUnknownValue(attributes)
|
|
80
80
|
: attributes;
|
|
81
81
|
|
|
82
|
+
if (
|
|
83
|
+
isPlainObject(attributes) &&
|
|
84
|
+
Array.isArray(attributes.styles) &&
|
|
85
|
+
attributes.styles.length === 0
|
|
86
|
+
) {
|
|
87
|
+
attributes.styles = {};
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
const children =
|
|
83
91
|
recordData.children !== undefined
|
|
84
92
|
? (normalizeNodeForValidation(
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
isNodeNullOrUndefined,
|
|
15
15
|
isNodeString,
|
|
16
16
|
} from './nodeGuards';
|
|
17
|
+
import { logger } from './logger';
|
|
17
18
|
|
|
18
19
|
export type AnalyseResultWithPath = {
|
|
19
20
|
valid: boolean;
|
|
@@ -407,7 +408,13 @@ function validateAttributesByPattern(
|
|
|
407
408
|
// Validate nested `attributes.styles` (canonical store for AttributesEditor).
|
|
408
409
|
if (maybeStyles != null) {
|
|
409
410
|
if (!isPlainObject(maybeStyles)) {
|
|
410
|
-
|
|
411
|
+
const msg = `styles must be an object`;
|
|
412
|
+
logger.error('analyseNodeByPatterns', msg, {
|
|
413
|
+
path: joinPath(path, 'styles'),
|
|
414
|
+
actualValue: maybeStyles,
|
|
415
|
+
actualType: Array.isArray(maybeStyles) ? 'array' : typeof maybeStyles,
|
|
416
|
+
});
|
|
417
|
+
return fail(msg, joinPath(path, 'styles'));
|
|
411
418
|
}
|
|
412
419
|
const stylesRecord = maybeStyles as Record<string, unknown>;
|
|
413
420
|
for (const [styleKey, styleValue] of Object.entries(stylesRecord)) {
|
|
@@ -432,15 +439,12 @@ function validateAttributesByPattern(
|
|
|
432
439
|
if (
|
|
433
440
|
attrName === 'title' ||
|
|
434
441
|
attrName === 'description' ||
|
|
435
|
-
attrName === 'testID'
|
|
436
|
-
attrName === 'animation'
|
|
442
|
+
attrName === 'testID'
|
|
437
443
|
) {
|
|
438
444
|
const res = validateAttributeValue(
|
|
439
445
|
pattern.pattern.type,
|
|
440
446
|
attrValue,
|
|
441
|
-
attrName === 'testID'
|
|
442
|
-
? 'string'
|
|
443
|
-
: attrName,
|
|
447
|
+
attrName === 'testID' ? 'string' : attrName,
|
|
444
448
|
joinPath(path, attrName),
|
|
445
449
|
);
|
|
446
450
|
if (!res.valid) return res;
|
package/src/utils/nodeTree.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Node, NodeData } from '../types/Node';
|
|
2
|
-
import eventConstants from '../patterns/event-constants.json';
|
|
3
2
|
|
|
4
3
|
export function deleteNodeFromTree(root: Node, target: Node): Node {
|
|
5
4
|
if (root === null || root === undefined) return root;
|
|
@@ -98,117 +97,3 @@ export function findNodeByKey(root: Node, key?: string): Node | null {
|
|
|
98
97
|
|
|
99
98
|
return null;
|
|
100
99
|
}
|
|
101
|
-
|
|
102
|
-
export type ProjectOptions = {
|
|
103
|
-
pageKeys: string[];
|
|
104
|
-
conditionKeys: string[];
|
|
105
|
-
placementKeys: string[];
|
|
106
|
-
formFieldNames: string[];
|
|
107
|
-
eventTypes: string[];
|
|
108
|
-
validationTypes: string[];
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Traverses the entire node tree to dynamically discover project-level metadata
|
|
113
|
-
* (page keys, condition keys, form field names, etc.) and merges them with
|
|
114
|
-
* central constants from event-constants.json.
|
|
115
|
-
*
|
|
116
|
-
* This enables the Attributes Editor to provide a complete list of valid options
|
|
117
|
-
* for dropdown fields, combining predefined standards with actually used keys
|
|
118
|
-
* in the current design.
|
|
119
|
-
*/
|
|
120
|
-
export function collectProjectMetadata(root: Node): ProjectOptions {
|
|
121
|
-
const pageKeys = new Set<string>();
|
|
122
|
-
const conditionKeys = new Set<string>();
|
|
123
|
-
const placementKeys = new Set<string>();
|
|
124
|
-
const formFieldNames = new Set<string>();
|
|
125
|
-
const eventTypes = new Set<string>();
|
|
126
|
-
|
|
127
|
-
function traverse(node: Node) {
|
|
128
|
-
if (!node || typeof node === 'string') return;
|
|
129
|
-
|
|
130
|
-
if (Array.isArray(node)) {
|
|
131
|
-
node.forEach(traverse);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const data = node as NodeData;
|
|
136
|
-
const type = data.type;
|
|
137
|
-
const attrs = (data.attributes ?? {}) as Record<string, any>;
|
|
138
|
-
|
|
139
|
-
// Collect Page Keys
|
|
140
|
-
if (type === 'GlobalProvider' && Array.isArray(data.children)) {
|
|
141
|
-
data.children.forEach((child) => {
|
|
142
|
-
if (typeof child === 'object' && child !== null && 'key' in child) {
|
|
143
|
-
if (typeof child.key === 'string') pageKeys.add(child.key);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (attrs.pageKey && typeof attrs.pageKey === 'string') {
|
|
148
|
-
pageKeys.add(attrs.pageKey);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Collect Condition Keys
|
|
152
|
-
if (attrs.conditionKey && typeof attrs.conditionKey === 'string') {
|
|
153
|
-
conditionKeys.add(attrs.conditionKey);
|
|
154
|
-
}
|
|
155
|
-
if (Array.isArray(attrs.skipConditions)) {
|
|
156
|
-
attrs.skipConditions.forEach((entry: any) => {
|
|
157
|
-
if (entry?.conditionKey) conditionKeys.add(entry.conditionKey);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Collect Placement Keys
|
|
162
|
-
if (attrs.placementKey && typeof attrs.placementKey === 'string') {
|
|
163
|
-
placementKeys.add(attrs.placementKey);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Collect Form Field Names
|
|
167
|
-
if (type.startsWith('Form') && type !== 'FormProvider' && attrs.name) {
|
|
168
|
-
if (typeof attrs.name === 'string') formFieldNames.add(attrs.name);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Collect from events
|
|
172
|
-
if (Array.isArray(attrs.events)) {
|
|
173
|
-
attrs.events.forEach((evt: any) => {
|
|
174
|
-
if (evt.type && typeof evt.type === 'string') eventTypes.add(evt.type);
|
|
175
|
-
if (evt.navigate_to) pageKeys.add(evt.navigate_to);
|
|
176
|
-
if (evt.placementKey) placementKeys.add(evt.placementKey);
|
|
177
|
-
if (evt.conditionKey) conditionKeys.add(evt.conditionKey);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (data.children) {
|
|
182
|
-
traverse(data.children as Node);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
traverse(root);
|
|
187
|
-
|
|
188
|
-
// Merge with central constants for a complete set of options
|
|
189
|
-
const result: ProjectOptions = {
|
|
190
|
-
pageKeys: Array.from(
|
|
191
|
-
new Set([...pageKeys, ...eventConstants.placementKeys]),
|
|
192
|
-
).sort(),
|
|
193
|
-
conditionKeys: Array.from(
|
|
194
|
-
new Set([...conditionKeys, ...eventConstants.conditionKeys]),
|
|
195
|
-
).sort(),
|
|
196
|
-
placementKeys: Array.from(
|
|
197
|
-
new Set([...placementKeys, ...eventConstants.placementKeys]),
|
|
198
|
-
).sort(),
|
|
199
|
-
formFieldNames: Array.from(
|
|
200
|
-
new Set([
|
|
201
|
-
...formFieldNames,
|
|
202
|
-
...((eventConstants as any).formFieldNames as string[]),
|
|
203
|
-
]),
|
|
204
|
-
).sort(),
|
|
205
|
-
eventTypes: Array.from(
|
|
206
|
-
new Set([...eventTypes, ...eventConstants.eventTypes]),
|
|
207
|
-
).sort(),
|
|
208
|
-
validationTypes: Array.from(
|
|
209
|
-
new Set((eventConstants as any).validationTypes as string[]),
|
|
210
|
-
).sort(),
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
return result;
|
|
214
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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;
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
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;
|
|
@@ -1,15 +0,0 @@
|
|
|
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,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { TermsProviderComponentProps } from './TermsProviderProps.generated';
|
|
3
|
-
declare function TermsProvider({ node }: TermsProviderComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare const _default: React.MemoExoticComponent<typeof TermsProvider>;
|
|
5
|
-
export default _default;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { NodeData } from '../../types/Node';
|
|
2
|
-
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
|
-
export type FlexDirectionOptionType = 'row' | 'column';
|
|
4
|
-
export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
5
|
-
export type AlignItemsOptionType = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
|
|
6
|
-
export type JustifyContentOptionType = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
7
|
-
export type PositionOptionType = 'relative' | 'absolute';
|
|
8
|
-
export interface TermsProviderStyleGenerated {
|
|
9
|
-
flexDirection?: FlexDirectionOptionType;
|
|
10
|
-
flexWrap?: FlexWrapOptionType;
|
|
11
|
-
alignItems?: AlignItemsOptionType;
|
|
12
|
-
justifyContent?: JustifyContentOptionType;
|
|
13
|
-
gap?: string;
|
|
14
|
-
padding?: string;
|
|
15
|
-
paddingHorizontal?: string;
|
|
16
|
-
paddingVertical?: string;
|
|
17
|
-
paddingTop?: string;
|
|
18
|
-
paddingBottom?: string;
|
|
19
|
-
paddingLeft?: string;
|
|
20
|
-
paddingRight?: string;
|
|
21
|
-
margin?: string;
|
|
22
|
-
marginHorizontal?: string;
|
|
23
|
-
marginVertical?: string;
|
|
24
|
-
marginTop?: string;
|
|
25
|
-
marginBottom?: string;
|
|
26
|
-
marginLeft?: string;
|
|
27
|
-
marginRight?: string;
|
|
28
|
-
backgroundColor?: string;
|
|
29
|
-
borderRadius?: string;
|
|
30
|
-
width?: string;
|
|
31
|
-
minWidth?: string;
|
|
32
|
-
maxWidth?: string;
|
|
33
|
-
height?: string;
|
|
34
|
-
minHeight?: string;
|
|
35
|
-
maxHeight?: string;
|
|
36
|
-
flex?: number;
|
|
37
|
-
position?: PositionOptionType;
|
|
38
|
-
top?: string;
|
|
39
|
-
bottom?: string;
|
|
40
|
-
left?: string;
|
|
41
|
-
right?: string;
|
|
42
|
-
zIndex?: number;
|
|
43
|
-
}
|
|
44
|
-
export interface TermsProviderPropsGenerated {
|
|
45
|
-
child: string;
|
|
46
|
-
attributes: {
|
|
47
|
-
styles?: TermsProviderStyleGenerated;
|
|
48
|
-
scrollable?: boolean;
|
|
49
|
-
testID?: string;
|
|
50
|
-
animation?: AnimationOptionType;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
export interface TermsProviderComponentProps {
|
|
54
|
-
node: NodeData<TermsProviderPropsGenerated['attributes']>;
|
|
55
|
-
}
|