@rocapine/react-native-onboarding-ui 1.24.0 → 1.25.1
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/UI/Pages/ComposableScreen/Renderer.js +3 -3
- package/dist/UI/Pages/ComposableScreen/Renderer.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts +2 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts +4 -0
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js +5 -14
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/CarouselElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/CarouselElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/CheckboxGroupElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/CheckboxGroupElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/DatePickerElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/DatePickerElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js +17 -24
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.d.ts +99 -0
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.js +51 -0
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js +13 -2
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.d.ts +121 -0
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.js +67 -0
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/collectDefaults.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/collectDefaults.js +2 -0
- package/dist/UI/Pages/ComposableScreen/elements/collectDefaults.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +8 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts +9 -0
- package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/shared.js +13 -1
- package/dist/UI/Pages/ComposableScreen/elements/shared.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/types.d.ts +18 -0
- package/dist/UI/Pages/ComposableScreen/types.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/types.js +51 -1
- package/dist/UI/Pages/ComposableScreen/types.js.map +1 -1
- package/package.json +1 -1
- package/src/UI/Pages/ComposableScreen/Renderer.tsx +10 -10
- package/src/UI/Pages/ComposableScreen/elements/BaseBoxProps.ts +2 -0
- package/src/UI/Pages/ComposableScreen/elements/ButtonElement.tsx +5 -15
- package/src/UI/Pages/ComposableScreen/elements/ImageElement.tsx +49 -35
- package/src/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.tsx +81 -0
- package/src/UI/Pages/ComposableScreen/elements/RiveElement.tsx +13 -1
- package/src/UI/Pages/ComposableScreen/elements/ScrollViewElement.tsx +115 -0
- package/src/UI/Pages/ComposableScreen/elements/collectDefaults.ts +2 -0
- package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +10 -0
- package/src/UI/Pages/ComposableScreen/elements/shared.ts +20 -0
- package/src/UI/Pages/ComposableScreen/types.ts +83 -3
|
@@ -21,6 +21,11 @@ import { type DatePickerElementProps, DatePickerElementPropsSchema } from "./ele
|
|
|
21
21
|
import { type CarouselElementProps, CarouselElementPropsSchema } from "./elements/CarouselElement";
|
|
22
22
|
import { type ZStackElementProps, ZStackElementPropsSchema } from "./elements/ZStackElement";
|
|
23
23
|
import { type SafeAreaViewElementProps, SafeAreaViewElementPropsSchema } from "./elements/SafeAreaViewElement";
|
|
24
|
+
import { type ScrollViewElementProps, ScrollViewElementPropsSchema } from "./elements/ScrollViewElement";
|
|
25
|
+
import {
|
|
26
|
+
type KeyboardAvoidingViewElementProps,
|
|
27
|
+
KeyboardAvoidingViewElementPropsSchema,
|
|
28
|
+
} from "./elements/KeyboardAvoidingViewElement";
|
|
24
29
|
|
|
25
30
|
export type { BaseBoxProps } from "./elements/BaseBoxProps";
|
|
26
31
|
export { BaseBoxPropsSchema } from "./elements/BaseBoxProps";
|
|
@@ -39,6 +44,11 @@ export type { DatePickerElementProps } from "./elements/DatePickerElement";
|
|
|
39
44
|
export type { CarouselElementProps } from "./elements/CarouselElement";
|
|
40
45
|
export type { ZStackElementProps } from "./elements/ZStackElement";
|
|
41
46
|
export type { SafeAreaViewElementProps, SafeAreaEdge, SafeAreaEdgeMode } from "./elements/SafeAreaViewElement";
|
|
47
|
+
export type { ScrollViewElementProps, ScrollViewContentInset } from "./elements/ScrollViewElement";
|
|
48
|
+
export type {
|
|
49
|
+
KeyboardAvoidingViewElementProps,
|
|
50
|
+
KeyboardAvoidingBehavior,
|
|
51
|
+
} from "./elements/KeyboardAvoidingViewElement";
|
|
42
52
|
|
|
43
53
|
// UIElement union — must live here (not in elements/) to avoid circular deps
|
|
44
54
|
// because the Stack variant's children: UIElement[] references itself.
|
|
@@ -151,6 +161,22 @@ export type UIElement =
|
|
|
151
161
|
type: "SafeAreaView";
|
|
152
162
|
props: SafeAreaViewElementProps;
|
|
153
163
|
children: UIElement[];
|
|
164
|
+
}
|
|
165
|
+
| {
|
|
166
|
+
id: string;
|
|
167
|
+
name?: string;
|
|
168
|
+
renderWhen?: LeafCondition | ConditionGroup;
|
|
169
|
+
type: "ScrollView";
|
|
170
|
+
props: ScrollViewElementProps;
|
|
171
|
+
children: UIElement[];
|
|
172
|
+
}
|
|
173
|
+
| {
|
|
174
|
+
id: string;
|
|
175
|
+
name?: string;
|
|
176
|
+
renderWhen?: LeafCondition | ConditionGroup;
|
|
177
|
+
type: "KeyboardAvoidingView";
|
|
178
|
+
props: KeyboardAvoidingViewElementProps;
|
|
179
|
+
children: UIElement[];
|
|
154
180
|
};
|
|
155
181
|
|
|
156
182
|
export const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
|
|
@@ -264,12 +290,66 @@ export const UIElementSchema: z.ZodType<UIElement> = z.lazy(() =>
|
|
|
264
290
|
props: SafeAreaViewElementPropsSchema,
|
|
265
291
|
children: z.array(UIElementSchema),
|
|
266
292
|
}),
|
|
293
|
+
z.object({
|
|
294
|
+
id: z.string(),
|
|
295
|
+
name: z.string().optional(),
|
|
296
|
+
renderWhen: z.union([LeafConditionSchema, ConditionGroupSchema]).optional(),
|
|
297
|
+
type: z.literal("ScrollView"),
|
|
298
|
+
props: ScrollViewElementPropsSchema,
|
|
299
|
+
children: z.array(UIElementSchema),
|
|
300
|
+
}),
|
|
301
|
+
z.object({
|
|
302
|
+
id: z.string(),
|
|
303
|
+
name: z.string().optional(),
|
|
304
|
+
renderWhen: z.union([LeafConditionSchema, ConditionGroupSchema]).optional(),
|
|
305
|
+
type: z.literal("KeyboardAvoidingView"),
|
|
306
|
+
props: KeyboardAvoidingViewElementPropsSchema,
|
|
307
|
+
children: z.array(UIElementSchema),
|
|
308
|
+
}),
|
|
267
309
|
])
|
|
268
310
|
);
|
|
269
311
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
312
|
+
// See packages/onboarding for the canonical comment; mirror nesting guard here because
|
|
313
|
+
// the UI re-parses the step with `ComposableScreenStepTypeSchema.parse(step)` in Renderer.tsx.
|
|
314
|
+
const collectNestedKeyboardAvoidingViews = (
|
|
315
|
+
nodes: UIElement[],
|
|
316
|
+
insideKav: boolean,
|
|
317
|
+
out: string[]
|
|
318
|
+
): void => {
|
|
319
|
+
for (const node of nodes) {
|
|
320
|
+
if (node.type === "KeyboardAvoidingView") {
|
|
321
|
+
if (insideKav) out.push(node.id);
|
|
322
|
+
collectNestedKeyboardAvoidingViews(node.children, true, out);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (
|
|
326
|
+
node.type === "YStack" ||
|
|
327
|
+
node.type === "XStack" ||
|
|
328
|
+
node.type === "ZStack" ||
|
|
329
|
+
node.type === "SafeAreaView" ||
|
|
330
|
+
node.type === "ScrollView" ||
|
|
331
|
+
node.type === "Carousel"
|
|
332
|
+
) {
|
|
333
|
+
collectNestedKeyboardAvoidingViews(node.children, insideKav, out);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export const ComposableScreenStepPayloadSchema = z
|
|
339
|
+
.object({
|
|
340
|
+
elements: z.array(UIElementSchema),
|
|
341
|
+
})
|
|
342
|
+
.superRefine((payload, ctx) => {
|
|
343
|
+
const offenders: string[] = [];
|
|
344
|
+
collectNestedKeyboardAvoidingViews(payload.elements, false, offenders);
|
|
345
|
+
for (const id of offenders) {
|
|
346
|
+
ctx.addIssue({
|
|
347
|
+
code: z.ZodIssueCode.custom,
|
|
348
|
+
path: ["elements"],
|
|
349
|
+
message: `KeyboardAvoidingView (id="${id}") cannot be nested inside another KeyboardAvoidingView.`,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
273
353
|
|
|
274
354
|
export const ComposableScreenStepTypeSchema = z.object({
|
|
275
355
|
id: z.string(),
|