@rocapine/react-native-onboarding-ui 1.6.0 → 1.8.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.
- package/dist/UI/OnboardingPage.js +1 -1
- package/dist/UI/OnboardingPage.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/Renderer.d.ts +0 -2
- package/dist/UI/Pages/ComposableScreen/Renderer.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/Renderer.js +13 -273
- package/dist/UI/Pages/ComposableScreen/Renderer.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts +30 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js +19 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts +67 -0
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js +65 -0
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts +41 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.js +37 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts +42 -0
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js +34 -0
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts +102 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.js +68 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts +39 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.js +60 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts +78 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.js +119 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts +62 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js +68 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts +85 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.js +64 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts +66 -0
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.js +59 -0
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts +41 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js +84 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts +5 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +49 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts +13 -0
- package/dist/UI/Pages/ComposableScreen/elements/shared.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/shared.js +6 -0
- package/dist/UI/Pages/ComposableScreen/elements/shared.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/types.d.ts +40 -113
- package/dist/UI/Pages/ComposableScreen/types.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/types.js +33 -121
- package/dist/UI/Pages/ComposableScreen/types.js.map +1 -1
- package/dist/UI/Provider/OnboardingProgressProvider.d.ts +6 -2
- package/dist/UI/Provider/OnboardingProgressProvider.d.ts.map +1 -1
- package/dist/UI/Provider/OnboardingProgressProvider.js +4 -3
- package/dist/UI/Provider/OnboardingProgressProvider.js.map +1 -1
- package/package.json +2 -2
- package/src/UI/OnboardingPage.tsx +1 -1
- package/src/UI/Pages/ComposableScreen/Renderer.tsx +22 -430
- package/src/UI/Pages/ComposableScreen/elements/BaseBoxProps.ts +31 -0
- package/src/UI/Pages/ComposableScreen/elements/ButtonElement.tsx +96 -0
- package/src/UI/Pages/ComposableScreen/elements/IconElement.tsx +67 -0
- package/src/UI/Pages/ComposableScreen/elements/ImageElement.tsx +52 -0
- package/src/UI/Pages/ComposableScreen/elements/InputElement.tsx +115 -0
- package/src/UI/Pages/ComposableScreen/elements/LottieElement.tsx +97 -0
- package/src/UI/Pages/ComposableScreen/elements/RadioGroupElement.tsx +181 -0
- package/src/UI/Pages/ComposableScreen/elements/RiveElement.tsx +105 -0
- package/src/UI/Pages/ComposableScreen/elements/StackElement.tsx +103 -0
- package/src/UI/Pages/ComposableScreen/elements/TextElement.tsx +95 -0
- package/src/UI/Pages/ComposableScreen/elements/VideoElement.tsx +113 -0
- package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +61 -0
- package/src/UI/Pages/ComposableScreen/elements/shared.ts +15 -0
- package/src/UI/Pages/ComposableScreen/types.ts +56 -233
- package/src/UI/Provider/OnboardingProgressProvider.tsx +8 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoElementRenderer = exports.VideoElementPropsSchema = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const BaseBoxProps_1 = require("./BaseBoxProps");
|
|
9
|
+
const helpers_1 = require("../../../Theme/helpers");
|
|
10
|
+
exports.VideoElementPropsSchema = BaseBoxProps_1.BaseBoxPropsSchema.extend({
|
|
11
|
+
url: zod_1.z.string().min(1, "url must not be empty"),
|
|
12
|
+
autoPlay: zod_1.z.boolean().optional(),
|
|
13
|
+
loop: zod_1.z.boolean().optional(),
|
|
14
|
+
muted: zod_1.z.boolean().optional(),
|
|
15
|
+
controls: zod_1.z.boolean().optional(),
|
|
16
|
+
});
|
|
17
|
+
let VideoElementComponent = null;
|
|
18
|
+
try {
|
|
19
|
+
const { VideoView, useVideoPlayer } = require("expo-video");
|
|
20
|
+
VideoElementComponent = ({ element, style }) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const player = useVideoPlayer(element.props.url, (p) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
p.loop = (_a = element.props.loop) !== null && _a !== void 0 ? _a : false;
|
|
25
|
+
p.muted = (_b = element.props.muted) !== null && _b !== void 0 ? _b : true;
|
|
26
|
+
if (element.props.autoPlay)
|
|
27
|
+
p.play();
|
|
28
|
+
});
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
player.loop = (_a = element.props.loop) !== null && _a !== void 0 ? _a : false;
|
|
32
|
+
player.muted = (_b = element.props.muted) !== null && _b !== void 0 ? _b : true;
|
|
33
|
+
if (element.props.autoPlay) {
|
|
34
|
+
player.play();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
player.pause();
|
|
38
|
+
}
|
|
39
|
+
}, [element.props.loop, element.props.muted, element.props.autoPlay]);
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(VideoView, { player: player, style: style, allowsFullscreen: false, nativeControls: (_a = element.props.controls) !== null && _a !== void 0 ? _a : false }));
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (_a) {
|
|
44
|
+
// expo-video not installed
|
|
45
|
+
}
|
|
46
|
+
const VideoElementRenderer = ({ element, ctx }) => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const { theme } = ctx;
|
|
49
|
+
const wrapperStyle = {
|
|
50
|
+
width: (_a = element.props.width) !== null && _a !== void 0 ? _a : "100%",
|
|
51
|
+
height: (_b = element.props.height) !== null && _b !== void 0 ? _b : 200,
|
|
52
|
+
opacity: element.props.opacity,
|
|
53
|
+
margin: element.props.margin,
|
|
54
|
+
marginHorizontal: element.props.marginHorizontal,
|
|
55
|
+
marginVertical: element.props.marginVertical,
|
|
56
|
+
padding: element.props.padding,
|
|
57
|
+
paddingHorizontal: element.props.paddingHorizontal,
|
|
58
|
+
paddingVertical: element.props.paddingVertical,
|
|
59
|
+
borderWidth: element.props.borderWidth,
|
|
60
|
+
borderRadius: element.props.borderRadius,
|
|
61
|
+
borderColor: element.props.borderColor,
|
|
62
|
+
overflow: "hidden",
|
|
63
|
+
};
|
|
64
|
+
if (!VideoElementComponent) {
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [wrapperStyle, styles.mediaFallback, { backgroundColor: theme.colors.neutral.lowest }], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.mediaFallbackText, (0, helpers_1.getTextStyle)(theme, "caption"), { color: theme.colors.text.tertiary }], children: "Install expo-video to render videos." }) }));
|
|
66
|
+
}
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: wrapperStyle, children: (0, jsx_runtime_1.jsx)(VideoElementComponent, { element: element, style: styles.fill }) }));
|
|
68
|
+
};
|
|
69
|
+
exports.VideoElementRenderer = VideoElementRenderer;
|
|
70
|
+
const styles = react_native_1.StyleSheet.create({
|
|
71
|
+
fill: {
|
|
72
|
+
width: "100%",
|
|
73
|
+
height: "100%",
|
|
74
|
+
},
|
|
75
|
+
mediaFallback: {
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
},
|
|
79
|
+
mediaFallbackText: {
|
|
80
|
+
textAlign: "center",
|
|
81
|
+
paddingHorizontal: 16,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=VideoElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoElement.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/VideoElement.tsx"],"names":[],"mappings":";;;;AAAA,iCAAyC;AACzC,6BAAwB;AACxB,+CAAsD;AACtD,iDAAkE;AAGlE,oDAAsD;AAUzC,QAAA,uBAAuB,GAAG,iCAAkB,CAAC,MAAM,CAAC;IAC/D,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;IAC/C,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAIH,IAAI,qBAAqB,GAA2E,I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E,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,qDAEvG,GACF,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,uBAAC,mBAAI,IAAC,KAAK,EAAE,YAAY,YACvB,uBAAC,qBAAqB,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,GAAI,GAC1D,CACR,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,oBAAoB,wBAiC/B;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf;IACD,aAAa,EAAE;QACb,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,iBAAiB,EAAE;QACjB,SAAS,EAAE,QAAQ;QACnB,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { UIElement } from "../types";
|
|
3
|
+
import { RenderContext } from "./shared";
|
|
4
|
+
export declare const renderElement: (element: UIElement, ctx: RenderContext, parentType?: "XStack" | "YStack") => React.ReactNode;
|
|
5
|
+
//# sourceMappingURL=renderElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/renderElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAYzC,eAAO,MAAM,aAAa,GACxB,SAAS,SAAS,EAClB,KAAK,aAAa,EAClB,aAAa,QAAQ,GAAG,QAAQ,KAC/B,KAAK,CAAC,SA0CR,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderElement = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const StackElement_1 = require("./StackElement");
|
|
6
|
+
const TextElement_1 = require("./TextElement");
|
|
7
|
+
const ImageElement_1 = require("./ImageElement");
|
|
8
|
+
const LottieElement_1 = require("./LottieElement");
|
|
9
|
+
const RiveElement_1 = require("./RiveElement");
|
|
10
|
+
const IconElement_1 = require("./IconElement");
|
|
11
|
+
const VideoElement_1 = require("./VideoElement");
|
|
12
|
+
const InputElement_1 = require("./InputElement");
|
|
13
|
+
const RadioGroupElement_1 = require("./RadioGroupElement");
|
|
14
|
+
const ButtonElement_1 = require("./ButtonElement");
|
|
15
|
+
const renderElement = (element, ctx, parentType) => {
|
|
16
|
+
if (element.type === "YStack" || element.type === "XStack") {
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(StackElement_1.StackElementComponent, { element: element, ctx: ctx, parentType: parentType }, element.id);
|
|
18
|
+
}
|
|
19
|
+
if (element.type === "Text") {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(TextElement_1.TextElementComponent, { element: element, ctx: ctx, parentType: parentType }, element.id);
|
|
21
|
+
}
|
|
22
|
+
if (element.type === "Image") {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(ImageElement_1.ImageElementComponent, { element: element, ctx: ctx }, element.id);
|
|
24
|
+
}
|
|
25
|
+
if (element.type === "Lottie") {
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(LottieElement_1.LottieElementComponent, { element: element, ctx: ctx }, element.id);
|
|
27
|
+
}
|
|
28
|
+
if (element.type === "Rive") {
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(RiveElement_1.RiveElementRenderer, { element: element, ctx: ctx }, element.id);
|
|
30
|
+
}
|
|
31
|
+
if (element.type === "Icon") {
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(IconElement_1.IconElementComponent, { element: element, ctx: ctx }, element.id);
|
|
33
|
+
}
|
|
34
|
+
if (element.type === "Video") {
|
|
35
|
+
return (0, jsx_runtime_1.jsx)(VideoElement_1.VideoElementRenderer, { element: element, ctx: ctx }, element.id);
|
|
36
|
+
}
|
|
37
|
+
if (element.type === "Input") {
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(InputElement_1.InputElementComponent, { element: element, ctx: ctx }, element.id);
|
|
39
|
+
}
|
|
40
|
+
if (element.type === "RadioGroup") {
|
|
41
|
+
return (0, jsx_runtime_1.jsx)(RadioGroupElement_1.RadioGroupComponent, { element: element, ctx: ctx }, element.id);
|
|
42
|
+
}
|
|
43
|
+
if (element.type === "Button") {
|
|
44
|
+
return (0, jsx_runtime_1.jsx)(ButtonElement_1.ButtonElementComponent, { element: element, ctx: ctx }, element.id);
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
exports.renderElement = renderElement;
|
|
49
|
+
//# sourceMappingURL=renderElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderElement.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/renderElement.tsx"],"names":[],"mappings":";;;;AAGA,iDAAuD;AACvD,+CAAqD;AACrD,iDAAuD;AACvD,mDAAyD;AACzD,+CAAoD;AACpD,+CAAqD;AACrD,iDAAsD;AACtD,iDAAuD;AACvD,2DAA0D;AAC1D,mDAAyD;AAElD,MAAM,aAAa,GAAG,CAC3B,OAAkB,EAClB,GAAkB,EAClB,UAAgC,EACf,EAAE;IACnB,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3D,OAAO,uBAAC,oCAAqB,IAAkB,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,IAA9D,OAAO,CAAC,EAAE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B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAtC,OAAO,CAAC,EAAE,CAAgC,CAAC;IAChF,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAClC,OAAO,uBAAC,uCAAmB,IAAkB,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAtC,OAAO,CAAC,EAAE,CAAgC,CAAC;IAC9E,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,uBAAC,sCAAsB,IAAkB,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAtC,OAAO,CAAC,EAAE,CAAgC,CAAC;IACjF,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA9CW,QAAA,aAAa,iBA8CxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { UIElement } from "../types";
|
|
3
|
+
import { Theme } from "../../../Theme/types";
|
|
4
|
+
import { ComposableVariableEntry } from "../../../Provider/OnboardingProgressProvider";
|
|
5
|
+
export type RenderContext = {
|
|
6
|
+
theme: Theme;
|
|
7
|
+
variables: Record<string, ComposableVariableEntry>;
|
|
8
|
+
setVariable: (key: string, entry: ComposableVariableEntry) => void;
|
|
9
|
+
onContinue: () => void;
|
|
10
|
+
renderChildren: (elements: UIElement[], parentType: "XStack" | "YStack") => React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const interpolate: (template: string, variables: Record<string, ComposableVariableEntry>) => string;
|
|
13
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACnD,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACnE,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,KAAK,KAAK,CAAC,SAAS,CAAC;CAC7F,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,WAAW,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAG,MACM,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interpolate = void 0;
|
|
4
|
+
const interpolate = (template, variables) => template.replace(/\{\{([^}]+?)\}\}/g, (_, key) => { var _a, _b, _c, _d; return (_d = (_b = (_a = variables[key]) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = variables[key]) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : ""; });
|
|
5
|
+
exports.interpolate = interpolate;
|
|
6
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/shared.ts"],"names":[],"mappings":";;;AAaO,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,SAAkD,EAAU,EAAE,CAC1G,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,uBAAC,OAAA,MAAA,MAAA,MAAA,SAAS,CAAC,GAAG,CAAC,0CAAE,KAAK,mCAAI,MAAA,SAAS,CAAC,GAAG,CAAC,0CAAE,KAAK,mCAAI,EAAE,CAAA,EAAA,CAAC,CAAC;AAD7F,QAAA,WAAW,eACkF"}
|
|
@@ -1,149 +1,77 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
2
|
+
import { type StackElementProps } from "./elements/StackElement";
|
|
3
|
+
import { type TextElementProps } from "./elements/TextElement";
|
|
4
|
+
import { type ImageElementProps } from "./elements/ImageElement";
|
|
5
|
+
import { type LottieElementProps } from "./elements/LottieElement";
|
|
6
|
+
import { type RiveElementProps } from "./elements/RiveElement";
|
|
7
|
+
import { type IconElementProps } from "./elements/IconElement";
|
|
8
|
+
import { type VideoElementProps } from "./elements/VideoElement";
|
|
9
|
+
import { type InputElementProps } from "./elements/InputElement";
|
|
10
|
+
import { type ButtonElementProps } from "./elements/ButtonElement";
|
|
11
|
+
import { type RadioGroupElementProps } from "./elements/RadioGroupElement";
|
|
12
|
+
export type { BaseBoxProps } from "./elements/BaseBoxProps";
|
|
13
|
+
export { BaseBoxPropsSchema } from "./elements/BaseBoxProps";
|
|
14
|
+
export type { StackElementProps } from "./elements/StackElement";
|
|
15
|
+
export type { TextElementProps } from "./elements/TextElement";
|
|
16
|
+
export type { ImageElementProps } from "./elements/ImageElement";
|
|
17
|
+
export type { LottieElementProps } from "./elements/LottieElement";
|
|
18
|
+
export type { RiveElementProps } from "./elements/RiveElement";
|
|
19
|
+
export type { IconElementProps } from "./elements/IconElement";
|
|
20
|
+
export type { VideoElementProps } from "./elements/VideoElement";
|
|
21
|
+
export type { InputElementProps } from "./elements/InputElement";
|
|
22
|
+
export type { ButtonElementProps } from "./elements/ButtonElement";
|
|
23
|
+
export type { RadioGroupElementProps } from "./elements/RadioGroupElement";
|
|
16
24
|
export type UIElement = {
|
|
17
25
|
id: string;
|
|
18
26
|
name?: string;
|
|
19
27
|
type: "YStack" | "XStack";
|
|
20
|
-
props:
|
|
21
|
-
gap?: number;
|
|
22
|
-
padding?: number;
|
|
23
|
-
paddingHorizontal?: number;
|
|
24
|
-
paddingVertical?: number;
|
|
25
|
-
margin?: number;
|
|
26
|
-
marginHorizontal?: number;
|
|
27
|
-
marginVertical?: number;
|
|
28
|
-
flex?: number;
|
|
29
|
-
width?: number;
|
|
30
|
-
height?: number;
|
|
31
|
-
minWidth?: number;
|
|
32
|
-
maxWidth?: number;
|
|
33
|
-
minHeight?: number;
|
|
34
|
-
maxHeight?: number;
|
|
35
|
-
alignItems?: "flex-start" | "center" | "flex-end" | "stretch";
|
|
36
|
-
justifyContent?: "flex-start" | "center" | "flex-end" | "space-between" | "space-around";
|
|
37
|
-
backgroundColor?: string;
|
|
38
|
-
flexWrap?: "wrap" | "nowrap";
|
|
39
|
-
flexShrink?: number;
|
|
40
|
-
borderWidth?: number;
|
|
41
|
-
borderRadius?: number;
|
|
42
|
-
borderColor?: string;
|
|
43
|
-
overflow?: "hidden" | "visible" | "scroll";
|
|
44
|
-
opacity?: number;
|
|
45
|
-
};
|
|
28
|
+
props: StackElementProps;
|
|
46
29
|
children: UIElement[];
|
|
47
30
|
} | {
|
|
48
31
|
id: string;
|
|
49
32
|
name?: string;
|
|
50
33
|
type: "Text";
|
|
51
|
-
props:
|
|
52
|
-
content: string;
|
|
53
|
-
mode?: "plain" | "expression";
|
|
54
|
-
fontSize?: number;
|
|
55
|
-
fontWeight?: string;
|
|
56
|
-
color?: string;
|
|
57
|
-
textAlign?: "left" | "center" | "right";
|
|
58
|
-
letterSpacing?: number;
|
|
59
|
-
lineHeight?: number;
|
|
60
|
-
backgroundColor?: string;
|
|
61
|
-
padding?: number;
|
|
62
|
-
paddingHorizontal?: number;
|
|
63
|
-
paddingVertical?: number;
|
|
64
|
-
margin?: number;
|
|
65
|
-
marginHorizontal?: number;
|
|
66
|
-
marginVertical?: number;
|
|
67
|
-
borderWidth?: number;
|
|
68
|
-
borderRadius?: number;
|
|
69
|
-
borderColor?: string;
|
|
70
|
-
opacity?: number;
|
|
71
|
-
};
|
|
34
|
+
props: TextElementProps;
|
|
72
35
|
} | {
|
|
73
36
|
id: string;
|
|
74
37
|
name?: string;
|
|
75
38
|
type: "Image";
|
|
76
|
-
props:
|
|
77
|
-
url: string;
|
|
78
|
-
aspectRatio?: number;
|
|
79
|
-
resizeMode?: "cover" | "contain" | "stretch" | "center";
|
|
80
|
-
};
|
|
39
|
+
props: ImageElementProps;
|
|
81
40
|
} | {
|
|
82
41
|
id: string;
|
|
83
42
|
name?: string;
|
|
84
43
|
type: "Lottie";
|
|
85
|
-
props:
|
|
86
|
-
source: string;
|
|
87
|
-
autoPlay?: boolean;
|
|
88
|
-
loop?: boolean;
|
|
89
|
-
speed?: number;
|
|
90
|
-
};
|
|
44
|
+
props: LottieElementProps;
|
|
91
45
|
} | {
|
|
92
46
|
id: string;
|
|
93
47
|
name?: string;
|
|
94
48
|
type: "Rive";
|
|
95
|
-
props:
|
|
96
|
-
url: string;
|
|
97
|
-
autoplay?: boolean;
|
|
98
|
-
fit?: "Contain" | "Cover" | "Fill" | "FitWidth" | "FitHeight" | "None" | "ScaleDown" | "Layout";
|
|
99
|
-
alignment?: "TopLeft" | "TopCenter" | "TopRight" | "CenterLeft" | "Center" | "CenterRight" | "BottomLeft" | "BottomCenter" | "BottomRight";
|
|
100
|
-
artboardName?: string;
|
|
101
|
-
stateMachineName?: string;
|
|
102
|
-
};
|
|
49
|
+
props: RiveElementProps;
|
|
103
50
|
} | {
|
|
104
51
|
id: string;
|
|
105
52
|
name?: string;
|
|
106
53
|
type: "Icon";
|
|
107
|
-
props:
|
|
108
|
-
name: string;
|
|
109
|
-
size?: number;
|
|
110
|
-
color?: string;
|
|
111
|
-
strokeWidth?: number;
|
|
112
|
-
};
|
|
54
|
+
props: IconElementProps;
|
|
113
55
|
} | {
|
|
114
56
|
id: string;
|
|
115
57
|
name?: string;
|
|
116
58
|
type: "Video";
|
|
117
|
-
props:
|
|
118
|
-
url: string;
|
|
119
|
-
autoPlay?: boolean;
|
|
120
|
-
loop?: boolean;
|
|
121
|
-
muted?: boolean;
|
|
122
|
-
controls?: boolean;
|
|
123
|
-
};
|
|
59
|
+
props: VideoElementProps;
|
|
124
60
|
} | {
|
|
125
61
|
id: string;
|
|
126
62
|
name?: string;
|
|
127
63
|
type: "Input";
|
|
128
|
-
props:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
editable?: boolean;
|
|
140
|
-
color?: string;
|
|
141
|
-
backgroundColor?: string;
|
|
142
|
-
fontSize?: number;
|
|
143
|
-
fontWeight?: string;
|
|
144
|
-
textAlign?: "left" | "center" | "right";
|
|
145
|
-
placeholderColor?: string;
|
|
146
|
-
};
|
|
64
|
+
props: InputElementProps;
|
|
65
|
+
} | {
|
|
66
|
+
id: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
type: "Button";
|
|
69
|
+
props: ButtonElementProps;
|
|
70
|
+
} | {
|
|
71
|
+
id: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
type: "RadioGroup";
|
|
74
|
+
props: RadioGroupElementProps;
|
|
147
75
|
};
|
|
148
76
|
export declare const UIElementSchema: z.ZodType<UIElement>;
|
|
149
77
|
export declare const ComposableScreenStepPayloadSchema: z.ZodObject<{
|
|
@@ -162,5 +90,4 @@ export declare const ComposableScreenStepTypeSchema: z.ZodObject<{
|
|
|
162
90
|
figmaUrl: z.ZodNullable<z.ZodString>;
|
|
163
91
|
}, z.core.$strip>;
|
|
164
92
|
export type ComposableScreenStepType = z.infer<typeof ComposableScreenStepTypeSchema>;
|
|
165
|
-
export {};
|
|
166
93
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/UI/Pages/ComposableScreen/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/UI/Pages/ComposableScreen/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,KAAK,sBAAsB,EAAgC,MAAM,8BAA8B,CAAC;AAEzG,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE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AC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;CACzB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,kBAAkB,CAAC;CAC3B,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;CAC/B,CAAC;AAEN,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAgEhD,CAAC;AAEF,eAAO,MAAM,iCAAiC;;iBAE5C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBASzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,169 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComposableScreenStepTypeSchema = exports.ComposableScreenStepPayloadSchema = exports.UIElementSchema = void 0;
|
|
3
|
+
exports.ComposableScreenStepTypeSchema = exports.ComposableScreenStepPayloadSchema = exports.UIElementSchema = exports.BaseBoxPropsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
borderColor: zod_1.z.string().optional(),
|
|
19
|
-
});
|
|
20
|
-
const StackElementPropsSchema = zod_1.z.object({
|
|
21
|
-
gap: zod_1.z.number().optional(),
|
|
22
|
-
padding: zod_1.z.number().optional(),
|
|
23
|
-
paddingHorizontal: zod_1.z.number().optional(),
|
|
24
|
-
paddingVertical: zod_1.z.number().optional(),
|
|
25
|
-
margin: zod_1.z.number().optional(),
|
|
26
|
-
marginHorizontal: zod_1.z.number().optional(),
|
|
27
|
-
marginVertical: zod_1.z.number().optional(),
|
|
28
|
-
flex: zod_1.z.number().optional(),
|
|
29
|
-
width: zod_1.z.number().optional(),
|
|
30
|
-
height: zod_1.z.number().optional(),
|
|
31
|
-
minWidth: zod_1.z.number().optional(),
|
|
32
|
-
maxWidth: zod_1.z.number().optional(),
|
|
33
|
-
minHeight: zod_1.z.number().optional(),
|
|
34
|
-
maxHeight: zod_1.z.number().optional(),
|
|
35
|
-
alignItems: zod_1.z.enum(["flex-start", "center", "flex-end", "stretch"]).optional(),
|
|
36
|
-
justifyContent: zod_1.z.enum(["flex-start", "center", "flex-end", "space-between", "space-around"]).optional(),
|
|
37
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
38
|
-
flexWrap: zod_1.z.enum(["wrap", "nowrap"]).optional(),
|
|
39
|
-
flexShrink: zod_1.z.number().optional(),
|
|
40
|
-
borderWidth: zod_1.z.number().optional(),
|
|
41
|
-
borderRadius: zod_1.z.number().optional(),
|
|
42
|
-
borderColor: zod_1.z.string().optional(),
|
|
43
|
-
overflow: zod_1.z.enum(["hidden", "visible", "scroll"]).optional(),
|
|
44
|
-
opacity: zod_1.z.number().min(0).max(1).optional(),
|
|
45
|
-
});
|
|
46
|
-
const TextElementPropsSchema = zod_1.z.object({
|
|
47
|
-
content: zod_1.z.string(),
|
|
48
|
-
mode: zod_1.z.enum(["plain", "expression"]).optional(),
|
|
49
|
-
fontSize: zod_1.z.number().optional(),
|
|
50
|
-
fontWeight: zod_1.z.string().optional(),
|
|
51
|
-
color: zod_1.z.string().optional(),
|
|
52
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
53
|
-
letterSpacing: zod_1.z.number().optional(),
|
|
54
|
-
lineHeight: zod_1.z.number().optional(),
|
|
55
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
56
|
-
padding: zod_1.z.number().optional(),
|
|
57
|
-
paddingHorizontal: zod_1.z.number().optional(),
|
|
58
|
-
paddingVertical: zod_1.z.number().optional(),
|
|
59
|
-
margin: zod_1.z.number().optional(),
|
|
60
|
-
marginHorizontal: zod_1.z.number().optional(),
|
|
61
|
-
marginVertical: zod_1.z.number().optional(),
|
|
62
|
-
borderWidth: zod_1.z.number().optional(),
|
|
63
|
-
borderRadius: zod_1.z.number().optional(),
|
|
64
|
-
borderColor: zod_1.z.string().optional(),
|
|
65
|
-
opacity: zod_1.z.number().min(0).max(1).optional(),
|
|
66
|
-
});
|
|
67
|
-
const ImageElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
68
|
-
url: zod_1.z.string(),
|
|
69
|
-
aspectRatio: zod_1.z.number().optional(),
|
|
70
|
-
resizeMode: zod_1.z.enum(["cover", "contain", "stretch", "center"]).optional(),
|
|
71
|
-
});
|
|
72
|
-
const LottieElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
73
|
-
source: zod_1.z.string(),
|
|
74
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
75
|
-
loop: zod_1.z.boolean().optional(),
|
|
76
|
-
speed: zod_1.z.number().optional(),
|
|
77
|
-
});
|
|
78
|
-
const RiveElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
79
|
-
url: zod_1.z.string(),
|
|
80
|
-
autoplay: zod_1.z.boolean().optional(),
|
|
81
|
-
fit: zod_1.z.enum(["Contain", "Cover", "Fill", "FitWidth", "FitHeight", "None", "ScaleDown", "Layout"]).optional(),
|
|
82
|
-
alignment: zod_1.z.enum(["TopLeft", "TopCenter", "TopRight", "CenterLeft", "Center", "CenterRight", "BottomLeft", "BottomCenter", "BottomRight"]).optional(),
|
|
83
|
-
artboardName: zod_1.z.string().optional(),
|
|
84
|
-
stateMachineName: zod_1.z.string().optional(),
|
|
85
|
-
});
|
|
86
|
-
const IconElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
87
|
-
name: zod_1.z.string(),
|
|
88
|
-
size: zod_1.z.number().optional(),
|
|
89
|
-
color: zod_1.z.string().optional(),
|
|
90
|
-
strokeWidth: zod_1.z.number().optional(),
|
|
91
|
-
});
|
|
92
|
-
const VideoElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
93
|
-
url: zod_1.z.string(),
|
|
94
|
-
autoPlay: zod_1.z.boolean().optional(),
|
|
95
|
-
loop: zod_1.z.boolean().optional(),
|
|
96
|
-
muted: zod_1.z.boolean().optional(),
|
|
97
|
-
controls: zod_1.z.boolean().optional(),
|
|
98
|
-
});
|
|
99
|
-
const InputElementPropsSchema = BaseBoxPropsSchema.extend({
|
|
100
|
-
variableName: zod_1.z.string().optional(),
|
|
101
|
-
placeholder: zod_1.z.string().optional(),
|
|
102
|
-
defaultValue: zod_1.z.string().optional(),
|
|
103
|
-
keyboardType: zod_1.z.enum(["default", "email-address", "numeric", "phone-pad", "decimal-pad", "url", "number-pad", "ascii-capable", "numbers-and-punctuation", "name-phone-pad", "twitter", "web-search", "visible-password"]).optional(),
|
|
104
|
-
returnKeyType: zod_1.z.enum(["done", "next", "go", "search", "send", "default", "emergency-call", "google", "join", "route", "yahoo", "none", "previous"]).optional(),
|
|
105
|
-
autoCapitalize: zod_1.z.enum(["none", "sentences", "words", "characters"]).optional(),
|
|
106
|
-
secureTextEntry: zod_1.z.boolean().optional(),
|
|
107
|
-
maxLength: zod_1.z.number().int().nonnegative().optional(),
|
|
108
|
-
multiline: zod_1.z.boolean().optional(),
|
|
109
|
-
numberOfLines: zod_1.z.number().int().nonnegative().optional(),
|
|
110
|
-
editable: zod_1.z.boolean().optional(),
|
|
111
|
-
color: zod_1.z.string().optional(),
|
|
112
|
-
backgroundColor: zod_1.z.string().optional(),
|
|
113
|
-
fontSize: zod_1.z.number().optional(),
|
|
114
|
-
fontWeight: zod_1.z.string().optional(),
|
|
115
|
-
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
116
|
-
placeholderColor: zod_1.z.string().optional(),
|
|
117
|
-
});
|
|
6
|
+
const StackElement_1 = require("./elements/StackElement");
|
|
7
|
+
const TextElement_1 = require("./elements/TextElement");
|
|
8
|
+
const ImageElement_1 = require("./elements/ImageElement");
|
|
9
|
+
const LottieElement_1 = require("./elements/LottieElement");
|
|
10
|
+
const RiveElement_1 = require("./elements/RiveElement");
|
|
11
|
+
const IconElement_1 = require("./elements/IconElement");
|
|
12
|
+
const VideoElement_1 = require("./elements/VideoElement");
|
|
13
|
+
const InputElement_1 = require("./elements/InputElement");
|
|
14
|
+
const ButtonElement_1 = require("./elements/ButtonElement");
|
|
15
|
+
const RadioGroupElement_1 = require("./elements/RadioGroupElement");
|
|
16
|
+
var BaseBoxProps_1 = require("./elements/BaseBoxProps");
|
|
17
|
+
Object.defineProperty(exports, "BaseBoxPropsSchema", { enumerable: true, get: function () { return BaseBoxProps_1.BaseBoxPropsSchema; } });
|
|
118
18
|
exports.UIElementSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
119
19
|
zod_1.z.object({
|
|
120
20
|
id: zod_1.z.string(),
|
|
121
21
|
name: zod_1.z.string().optional(),
|
|
122
22
|
type: zod_1.z.union([zod_1.z.literal("YStack"), zod_1.z.literal("XStack")]),
|
|
123
|
-
props: StackElementPropsSchema,
|
|
23
|
+
props: StackElement_1.StackElementPropsSchema,
|
|
124
24
|
children: zod_1.z.array(exports.UIElementSchema),
|
|
125
25
|
}),
|
|
126
26
|
zod_1.z.object({
|
|
127
27
|
id: zod_1.z.string(),
|
|
128
28
|
name: zod_1.z.string().optional(),
|
|
129
29
|
type: zod_1.z.literal("Text"),
|
|
130
|
-
props: TextElementPropsSchema,
|
|
30
|
+
props: TextElement_1.TextElementPropsSchema,
|
|
131
31
|
}),
|
|
132
32
|
zod_1.z.object({
|
|
133
33
|
id: zod_1.z.string(),
|
|
134
34
|
name: zod_1.z.string().optional(),
|
|
135
35
|
type: zod_1.z.literal("Image"),
|
|
136
|
-
props: ImageElementPropsSchema,
|
|
36
|
+
props: ImageElement_1.ImageElementPropsSchema,
|
|
137
37
|
}),
|
|
138
38
|
zod_1.z.object({
|
|
139
39
|
id: zod_1.z.string(),
|
|
140
40
|
name: zod_1.z.string().optional(),
|
|
141
41
|
type: zod_1.z.literal("Lottie"),
|
|
142
|
-
props: LottieElementPropsSchema,
|
|
42
|
+
props: LottieElement_1.LottieElementPropsSchema,
|
|
143
43
|
}),
|
|
144
44
|
zod_1.z.object({
|
|
145
45
|
id: zod_1.z.string(),
|
|
146
46
|
name: zod_1.z.string().optional(),
|
|
147
47
|
type: zod_1.z.literal("Rive"),
|
|
148
|
-
props: RiveElementPropsSchema,
|
|
48
|
+
props: RiveElement_1.RiveElementPropsSchema,
|
|
149
49
|
}),
|
|
150
50
|
zod_1.z.object({
|
|
151
51
|
id: zod_1.z.string(),
|
|
152
52
|
name: zod_1.z.string().optional(),
|
|
153
53
|
type: zod_1.z.literal("Icon"),
|
|
154
|
-
props: IconElementPropsSchema,
|
|
54
|
+
props: IconElement_1.IconElementPropsSchema,
|
|
155
55
|
}),
|
|
156
56
|
zod_1.z.object({
|
|
157
57
|
id: zod_1.z.string(),
|
|
158
58
|
name: zod_1.z.string().optional(),
|
|
159
59
|
type: zod_1.z.literal("Video"),
|
|
160
|
-
props: VideoElementPropsSchema,
|
|
60
|
+
props: VideoElement_1.VideoElementPropsSchema,
|
|
161
61
|
}),
|
|
162
62
|
zod_1.z.object({
|
|
163
63
|
id: zod_1.z.string(),
|
|
164
64
|
name: zod_1.z.string().optional(),
|
|
165
65
|
type: zod_1.z.literal("Input"),
|
|
166
|
-
props: InputElementPropsSchema,
|
|
66
|
+
props: InputElement_1.InputElementPropsSchema,
|
|
67
|
+
}),
|
|
68
|
+
zod_1.z.object({
|
|
69
|
+
id: zod_1.z.string(),
|
|
70
|
+
name: zod_1.z.string().optional(),
|
|
71
|
+
type: zod_1.z.literal("Button"),
|
|
72
|
+
props: ButtonElement_1.ButtonElementPropsSchema,
|
|
73
|
+
}),
|
|
74
|
+
zod_1.z.object({
|
|
75
|
+
id: zod_1.z.string(),
|
|
76
|
+
name: zod_1.z.string().optional(),
|
|
77
|
+
type: zod_1.z.literal("RadioGroup"),
|
|
78
|
+
props: RadioGroupElement_1.RadioGroupElementPropsSchema,
|
|
167
79
|
}),
|
|
168
80
|
]));
|
|
169
81
|
exports.ComposableScreenStepPayloadSchema = zod_1.z.object({
|