@rocapine/react-native-onboarding-ui 1.36.2 → 1.37.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/Pages/ComposableScreen/elements/BaseBoxProps.d.ts +26 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js +2 -0
- package/dist/UI/Pages/ComposableScreen/elements/BaseBoxProps.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts +106 -67
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js +11 -59
- package/dist/UI/Pages/ComposableScreen/elements/ButtonElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/CarouselElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/CarouselElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/CheckboxGroupElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/CheckboxGroupElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/DatePickerElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/DatePickerElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/IconElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/ImageElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/InputElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/KeyboardAvoidingViewElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/LottieElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ProgressiveBlurImageElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/ProgressiveBlurImageElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/RadioGroupElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RichTextElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/RichTextElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/RiveElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/SafeAreaViewElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/ScrollViewElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/StackElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts +25 -1
- package/dist/UI/Pages/ComposableScreen/elements/TextElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/VideoElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/ZStackElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/actions.d.ts +72 -0
- package/dist/UI/Pages/ComposableScreen/elements/actions.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/actions.js +24 -0
- package/dist/UI/Pages/ComposableScreen/elements/actions.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +47 -4
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/runActions.d.ts +4 -0
- package/dist/UI/Pages/ComposableScreen/elements/runActions.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/runActions.js +98 -0
- package/dist/UI/Pages/ComposableScreen/elements/runActions.js.map +1 -0
- package/package.json +1 -1
- package/src/UI/Pages/ComposableScreen/elements/BaseBoxProps.ts +3 -0
- package/src/UI/Pages/ComposableScreen/elements/ButtonElement.tsx +15 -91
- package/src/UI/Pages/ComposableScreen/elements/actions.ts +53 -0
- package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +59 -4
- package/src/UI/Pages/ComposableScreen/elements/runActions.ts +109 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/VideoElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAO,MAAM,UAAU,CAAC;AAI9C,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CA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OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAoC5D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,cAAc,CAAC;IACxB,GAAG,EAAE,aAAa,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAAkB,KAAK,KAAG,KAAK,CAAC,YA6CpE,CAAC"}
|
|
@@ -233,6 +233,30 @@ export declare const ZStackElementPropsSchema: import("zod").ZodObject<{
|
|
|
233
233
|
degrees: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
234
234
|
}, import("zod/v4/core").$strip>>;
|
|
235
235
|
}, import("zod/v4/core").$strip>>;
|
|
236
|
+
onPress: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"continue">, import("zod").ZodObject<{
|
|
237
|
+
type: import("zod").ZodLiteral<"custom">;
|
|
238
|
+
function: import("zod").ZodString;
|
|
239
|
+
variables: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
240
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
241
|
+
type: import("zod").ZodLiteral<"setVariable">;
|
|
242
|
+
name: import("zod").ZodString;
|
|
243
|
+
value: import("zod").ZodString;
|
|
244
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
245
|
+
valueMode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
246
|
+
literal: "literal";
|
|
247
|
+
expression: "expression";
|
|
248
|
+
}>>;
|
|
249
|
+
kind: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
250
|
+
string: "string";
|
|
251
|
+
int: "int";
|
|
252
|
+
float: "float";
|
|
253
|
+
}>>;
|
|
254
|
+
arrayOp: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
255
|
+
append: "append";
|
|
256
|
+
remove: "remove";
|
|
257
|
+
toggle: "toggle";
|
|
258
|
+
}>>;
|
|
259
|
+
}, import("zod/v4/core").$strip>]>>>;
|
|
236
260
|
}, import("zod/v4/core").$strip>;
|
|
237
261
|
type ZStackUIElement = Extract<UIElement, {
|
|
238
262
|
type: "ZStack";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZStackElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/ZStackElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAO,MAAM,UAAU,CAAC;AAG9C,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC9C,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"ZStackElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/ZStackElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAO,MAAM,UAAU,CAAC;AAG9C,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC9C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAqB,CAAC;AAE3D,KAAK,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAE9D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,eAAe,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,kBAAkB,KAAK,KAAG,KAAK,CAAC,YA0CtE,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type CustomButtonAction = {
|
|
3
|
+
type: "custom";
|
|
4
|
+
function: string;
|
|
5
|
+
variables?: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const CustomButtonActionSchema: z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"custom">;
|
|
9
|
+
function: z.ZodString;
|
|
10
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type SetVariableButtonAction = {
|
|
13
|
+
type: "setVariable";
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
valueMode?: "literal" | "expression";
|
|
18
|
+
kind?: "int" | "float" | "string";
|
|
19
|
+
/**
|
|
20
|
+
* Treat the target variable as the JSON-encoded `string[]` multi-select
|
|
21
|
+
* collection used by `CheckboxGroup` and apply `value` as a set operation
|
|
22
|
+
* (`"append"` / `"remove"` / `"toggle"`) instead of overwriting. `kind` is
|
|
23
|
+
* ignored in this mode. Omit for the default overwrite behavior.
|
|
24
|
+
*/
|
|
25
|
+
arrayOp?: "append" | "remove" | "toggle";
|
|
26
|
+
};
|
|
27
|
+
export declare const SetVariableButtonActionSchema: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"setVariable">;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
value: z.ZodString;
|
|
31
|
+
label: z.ZodOptional<z.ZodString>;
|
|
32
|
+
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
literal: "literal";
|
|
34
|
+
expression: "expression";
|
|
35
|
+
}>>;
|
|
36
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
string: "string";
|
|
38
|
+
int: "int";
|
|
39
|
+
float: "float";
|
|
40
|
+
}>>;
|
|
41
|
+
arrayOp: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
append: "append";
|
|
43
|
+
remove: "remove";
|
|
44
|
+
toggle: "toggle";
|
|
45
|
+
}>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type ButtonAction = "continue" | CustomButtonAction | SetVariableButtonAction;
|
|
48
|
+
export declare const ButtonActionSchema: z.ZodUnion<readonly [z.ZodLiteral<"continue">, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"custom">;
|
|
50
|
+
function: z.ZodString;
|
|
51
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"setVariable">;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
value: z.ZodString;
|
|
56
|
+
label: z.ZodOptional<z.ZodString>;
|
|
57
|
+
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
literal: "literal";
|
|
59
|
+
expression: "expression";
|
|
60
|
+
}>>;
|
|
61
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
string: "string";
|
|
63
|
+
int: "int";
|
|
64
|
+
float: "float";
|
|
65
|
+
}>>;
|
|
66
|
+
arrayOp: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
append: "append";
|
|
68
|
+
remove: "remove";
|
|
69
|
+
toggle: "toggle";
|
|
70
|
+
}>>;
|
|
71
|
+
}, z.core.$strip>]>;
|
|
72
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IACrC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;iBAQxC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AAErF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;mBAI7B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonActionSchema = exports.SetVariableButtonActionSchema = exports.CustomButtonActionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CustomButtonActionSchema = zod_1.z.object({
|
|
6
|
+
type: zod_1.z.literal("custom"),
|
|
7
|
+
function: zod_1.z.string().min(1, "function must not be empty"),
|
|
8
|
+
variables: zod_1.z.array(zod_1.z.string()).optional(),
|
|
9
|
+
});
|
|
10
|
+
exports.SetVariableButtonActionSchema = zod_1.z.object({
|
|
11
|
+
type: zod_1.z.literal("setVariable"),
|
|
12
|
+
name: zod_1.z.string().min(1, "name must not be empty"),
|
|
13
|
+
value: zod_1.z.string(),
|
|
14
|
+
label: zod_1.z.string().optional(),
|
|
15
|
+
valueMode: zod_1.z.enum(["literal", "expression"]).optional(),
|
|
16
|
+
kind: zod_1.z.enum(["int", "float", "string"]).optional(),
|
|
17
|
+
arrayOp: zod_1.z.enum(["append", "remove", "toggle"]).optional(),
|
|
18
|
+
});
|
|
19
|
+
exports.ButtonActionSchema = zod_1.z.union([
|
|
20
|
+
zod_1.z.literal("continue"),
|
|
21
|
+
exports.CustomButtonActionSchema,
|
|
22
|
+
exports.SetVariableButtonActionSchema,
|
|
23
|
+
]);
|
|
24
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/actions.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAcX,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;IACzD,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAkBU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;IACjD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvD,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnD,OAAO,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,OAAC,CAAC,KAAK,CAAC;IACxC,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACrB,gCAAwB;IACxB,qCAA6B;CAC9B,CAAC,CAAC"}
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"renderElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/renderElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAsCzC,eAAO,MAAM,aAAa,GACxB,SAAS,SAAS,EAClB,KAAK,aAAa,EAClB,aAAa,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,KACnE,KAAK,CAAC,SA8JR,CAAC"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderElement = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
5
6
|
const react_native_onboarding_1 = require("@rocapine/react-native-onboarding");
|
|
7
|
+
const runActions_1 = require("./runActions");
|
|
6
8
|
const StackElement_1 = require("./StackElement");
|
|
7
9
|
const TextElement_1 = require("./TextElement");
|
|
8
10
|
const RichTextElement_1 = require("./RichTextElement");
|
|
@@ -25,7 +27,20 @@ const ScrollViewElement_1 = require("./ScrollViewElement");
|
|
|
25
27
|
const KeyboardAvoidingViewElement_1 = require("./KeyboardAvoidingViewElement");
|
|
26
28
|
const ProgressIndicatorElement_1 = require("./ProgressIndicatorElement");
|
|
27
29
|
const AnimatedBox_1 = require("./AnimatedBox");
|
|
30
|
+
// Element types that own their own press / focus / scroll handling. The generic
|
|
31
|
+
// `onPress` (BaseBoxProps) is NOT wired for these — Button/RadioGroup/Checkbox/
|
|
32
|
+
// DatePicker already dispatch actions or selections; Input/WheelPicker would have
|
|
33
|
+
// their focus / scroll-selection intercepted by an outer Pressable.
|
|
34
|
+
const PRESS_HANDLED_TYPES = new Set([
|
|
35
|
+
"Button",
|
|
36
|
+
"RadioGroup",
|
|
37
|
+
"CheckboxGroup",
|
|
38
|
+
"DatePicker",
|
|
39
|
+
"Input",
|
|
40
|
+
"WheelPicker",
|
|
41
|
+
]);
|
|
28
42
|
const renderElement = (element, ctx, parentType) => {
|
|
43
|
+
var _a;
|
|
29
44
|
if (element.renderWhen) {
|
|
30
45
|
const flatVars = Object.fromEntries(Object.entries(ctx.variables).map(([k, v]) => [k, v === null || v === void 0 ? void 0 : v.value]));
|
|
31
46
|
if (!(0, react_native_onboarding_1.evaluateCondition)(element.renderWhen, flatVars))
|
|
@@ -99,15 +114,43 @@ const renderElement = (element, ctx, parentType) => {
|
|
|
99
114
|
}
|
|
100
115
|
return null;
|
|
101
116
|
})();
|
|
117
|
+
// Cast to BaseBoxProps: not every element's props type extends it (e.g.
|
|
118
|
+
// WheelPicker), but the onPress/animation/transform/flex/alignSelf fields are
|
|
119
|
+
// all optional BaseBoxProps members and simply read as undefined when absent.
|
|
120
|
+
const p = element.props;
|
|
121
|
+
// Generic onPress: make any non-pressable element tappable, dispatching the
|
|
122
|
+
// same action list as Button via runActions. Skipped for PRESS_HANDLED_TYPES.
|
|
123
|
+
// A Pressable around a scroll/carousel keeps inner scrolling working — RN's
|
|
124
|
+
// gesture responder gives the scroll the touch when it pans.
|
|
125
|
+
let content = node;
|
|
126
|
+
if (content !== null &&
|
|
127
|
+
p.onPress &&
|
|
128
|
+
p.onPress.length > 0 &&
|
|
129
|
+
!PRESS_HANDLED_TYPES.has(element.type)) {
|
|
130
|
+
const onPress = p.onPress;
|
|
131
|
+
// The Pressable must be layout-transparent (like AnimatedBox): forward the
|
|
132
|
+
// element's flex sizing so the wrapper participates in its parent's flex
|
|
133
|
+
// context exactly as the element would. Without this, the style-less
|
|
134
|
+
// Pressable sizes to content while the element's `flex`/`flexShrink` sit on
|
|
135
|
+
// the inner node — breaking row splits (cards overflow) and column flow.
|
|
136
|
+
// Mirror StackElement's `parentType === "XStack"` flexShrink:1 default.
|
|
137
|
+
content = ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onPress: () => {
|
|
138
|
+
void (0, runActions_1.runActions)(onPress, ctx);
|
|
139
|
+
}, style: {
|
|
140
|
+
flex: p.flex,
|
|
141
|
+
flexGrow: p.flexGrow,
|
|
142
|
+
flexShrink: (_a = p.flexShrink) !== null && _a !== void 0 ? _a : (parentType === "XStack" ? 1 : undefined),
|
|
143
|
+
alignSelf: p.alignSelf,
|
|
144
|
+
}, children: content }, element.id));
|
|
145
|
+
}
|
|
102
146
|
// Wrap only when motion is requested — zero overhead (no extra view) otherwise.
|
|
103
147
|
// Cast to BaseBoxProps: not every element's props type extends it (e.g.
|
|
104
148
|
// WheelPicker), but the animation/transform/flex/alignSelf fields are all
|
|
105
149
|
// optional BaseBoxProps members and simply read as undefined when absent.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return ((0, jsx_runtime_1.jsx)(AnimatedBox_1.AnimatedBox, { animation: p.animation, transform: p.transform, flex: p.flex, alignSelf: p.alignSelf, children: node }, element.id));
|
|
150
|
+
if (content !== null && (p.animation || p.transform)) {
|
|
151
|
+
return ((0, jsx_runtime_1.jsx)(AnimatedBox_1.AnimatedBox, { animation: p.animation, transform: p.transform, flex: p.flex, alignSelf: p.alignSelf, children: content }, element.id));
|
|
109
152
|
}
|
|
110
|
-
return
|
|
153
|
+
return content;
|
|
111
154
|
};
|
|
112
155
|
exports.renderElement = renderElement;
|
|
113
156
|
//# sourceMappingURL=renderElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderElement.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/renderElement.tsx"],"names":[],"mappings":";;;;AACA,+EAAsE;AAItE,iDAAuD;AACvD,+CAAqD;AACrD,uDAA6D;AAC7D,iDAAuD;AACvD,+EAAqF;AACrF,mDAAyD;AACzD,+CAAoD;AACpD,+CAAqD;AACrD,iDAAsD;AACtD,iDAAuD;AACvD,2DAA0D;AAC1D,iEAAgE;AAChE,mDAAyD;AACzD,2DAAiE;AACjE,6DAAmE;AACnE,uDAA6D;AAC7D,mDAAyD;AACzD,+DAAqE;AACrE,2DAAiE;AACjE,+EAAqF;AACrF,yEAA+E;AAC/E,+CAA4C;
|
|
1
|
+
{"version":3,"file":"renderElement.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/renderElement.tsx"],"names":[],"mappings":";;;;AACA,+CAAyC;AACzC,+EAAsE;AAItE,6CAA0C;AAC1C,iDAAuD;AACvD,+CAAqD;AACrD,uDAA6D;AAC7D,iDAAuD;AACvD,+EAAqF;AACrF,mDAAyD;AACzD,+CAAoD;AACpD,+CAAqD;AACrD,iDAAsD;AACtD,iDAAuD;AACvD,2DAA0D;AAC1D,iEAAgE;AAChE,mDAAyD;AACzD,2DAAiE;AACjE,6DAAmE;AACnE,uDAA6D;AAC7D,mDAAyD;AACzD,+DAAqE;AACrE,2DAAiE;AACjE,+EAAqF;AACrF,yEAA+E;AAC/E,+C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,CAAC;AAlKW,QAAA,aAAa,iBAkKxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runActions.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/runActions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAuB9C,wBAAsB,UAAU,CAC9B,OAAO,EAAE,YAAY,EAAE,EACvB,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CA6Ef"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runActions = runActions;
|
|
4
|
+
const expression_1 = require("./expression");
|
|
5
|
+
// Decode a multi-select variable's stored value (JSON-encoded string[], as
|
|
6
|
+
// written by CheckboxGroup) into a string array. Tolerates undefined / non-array
|
|
7
|
+
// / unparseable input by returning [].
|
|
8
|
+
function decodeArrayValue(raw) {
|
|
9
|
+
if (!raw)
|
|
10
|
+
return [];
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(raw);
|
|
13
|
+
return Array.isArray(parsed) ? parsed.map(String) : [];
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// Sequentially runs a list of press actions against the render context. Shared
|
|
20
|
+
// by `Button` (its `actions`) and the generic `onPress` on every UIElement
|
|
21
|
+
// (wired centrally in renderElement.tsx). Semantics:
|
|
22
|
+
// - "continue" → advance the onboarding; terminal (stops the loop).
|
|
23
|
+
// - {setVariable} → write a variable (expression-evaluated when valueMode === "expression").
|
|
24
|
+
// - {custom} → invoke the host-registered customAction with the requested
|
|
25
|
+
// variables; warns if unregistered, aborts the loop on throw.
|
|
26
|
+
async function runActions(actions, ctx) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const { onContinue, setVariable, customActions, variables } = ctx;
|
|
29
|
+
for (const act of actions) {
|
|
30
|
+
if (act === "continue") {
|
|
31
|
+
onContinue();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (act.type === "setVariable") {
|
|
35
|
+
let value;
|
|
36
|
+
let kind;
|
|
37
|
+
if (act.valueMode === "expression") {
|
|
38
|
+
const computed = (0, expression_1.evaluateSetVariableExpression)(act.value, variables);
|
|
39
|
+
value = computed.value;
|
|
40
|
+
kind = computed.kind;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
value = act.value;
|
|
44
|
+
kind = act.kind;
|
|
45
|
+
}
|
|
46
|
+
if (act.arrayOp) {
|
|
47
|
+
// Multi-select set operation on the JSON-encoded string[] used by
|
|
48
|
+
// CheckboxGroup. value/label are the single member being added/removed.
|
|
49
|
+
const entry = variables[act.name];
|
|
50
|
+
const curValues = decodeArrayValue(entry === null || entry === void 0 ? void 0 : entry.value);
|
|
51
|
+
const curLabels = (entry === null || entry === void 0 ? void 0 : entry.label) ? entry.label.split(", ") : [];
|
|
52
|
+
const memberLabel = (_a = act.label) !== null && _a !== void 0 ? _a : value;
|
|
53
|
+
const idx = curValues.indexOf(value);
|
|
54
|
+
const present = idx !== -1;
|
|
55
|
+
const add = act.arrayOp === "append" || (act.arrayOp === "toggle" && !present);
|
|
56
|
+
let nextValues;
|
|
57
|
+
let nextLabels;
|
|
58
|
+
if (add) {
|
|
59
|
+
// Dedup: appending an already-present member is a no-op.
|
|
60
|
+
nextValues = present ? curValues : [...curValues, value];
|
|
61
|
+
nextLabels = present ? curLabels : [...curLabels, memberLabel];
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// remove, or toggle-when-present
|
|
65
|
+
nextValues = curValues.filter((_, i) => i !== idx);
|
|
66
|
+
nextLabels =
|
|
67
|
+
present && idx < curLabels.length
|
|
68
|
+
? curLabels.filter((_, i) => i !== idx)
|
|
69
|
+
: curLabels.filter((l) => l !== memberLabel);
|
|
70
|
+
}
|
|
71
|
+
setVariable(act.name, {
|
|
72
|
+
value: JSON.stringify(nextValues),
|
|
73
|
+
label: nextLabels.join(", "),
|
|
74
|
+
});
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
setVariable(act.name, { value, label: act.label, kind });
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const handler = customActions[act.function];
|
|
81
|
+
if (!handler) {
|
|
82
|
+
console.warn(`[ComposableScreen] No customAction registered for "${act.function}"`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const requested = (_b = act.variables) !== null && _b !== void 0 ? _b : [];
|
|
86
|
+
const vars = {};
|
|
87
|
+
for (const name of requested)
|
|
88
|
+
vars[name] = variables[name];
|
|
89
|
+
try {
|
|
90
|
+
await handler({ variables: vars });
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
console.error(`[ComposableScreen] customAction "${act.function}" threw:`, err);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=runActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runActions.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/runActions.ts"],"names":[],"mappings":";;AA4BA,gCAgFC;AAtGD,6CAA6D;AAE7D,2EAA2E;AAC3E,iFAAiF;AACjF,uCAAuC;AACvC,SAAS,gBAAgB,CAAC,GAAuB;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,CA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CAAC,SAAS,CAAC,UAAU,CAAC;oBACjC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7B,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YAED,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACzD,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CACV,sDAAsD,GAAG,CAAC,QAAQ,GAAG,CACtE,CAAC;YACF,SAAS;QACX,CAAC;QACD,MAAM,SAAS,GAAG,MAAA,GAAG,CAAC,SAAS,mCAAI,EAAE,CAAC;QACtC,MAAM,IAAI,GAAwD,EAAE,CAAC;QACrE,KAAK,MAAM,IAAI,IAAI,SAAS;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CACX,oCAAoC,GAAG,CAAC,QAAQ,UAAU,EAC1D,GAAG,CACJ,CAAC;YACF,OAAO;QACT,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocapine/react-native-onboarding-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "UI components and renderers for Rocapine Onboarding Studio - Built on top of the headless SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type ButtonAction, ButtonActionSchema } from "./actions";
|
|
2
3
|
|
|
3
4
|
export type GradientStop = {
|
|
4
5
|
color: string;
|
|
@@ -289,6 +290,7 @@ export type BaseBoxProps = {
|
|
|
289
290
|
elevation?: number;
|
|
290
291
|
transform?: ElementTransform;
|
|
291
292
|
animation?: ElementAnimation;
|
|
293
|
+
onPress?: ButtonAction[];
|
|
292
294
|
};
|
|
293
295
|
|
|
294
296
|
export const BaseBoxPropsSchema = z.object({
|
|
@@ -323,4 +325,5 @@ export const BaseBoxPropsSchema = z.object({
|
|
|
323
325
|
elevation: z.number().min(0).optional(),
|
|
324
326
|
transform: TransformSchema.optional(),
|
|
325
327
|
animation: ElementAnimationSchema.optional(),
|
|
328
|
+
onPress: z.array(ButtonActionSchema).optional(),
|
|
326
329
|
});
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
evaluateCondition,
|
|
7
7
|
type LeafCondition,
|
|
8
8
|
type ConditionGroup,
|
|
9
|
-
type ComposableVariableKind,
|
|
10
9
|
LeafConditionSchema,
|
|
11
10
|
ConditionGroupSchema,
|
|
12
11
|
} from "@rocapine/react-native-onboarding";
|
|
@@ -14,59 +13,23 @@ import { BaseBoxProps, BaseBoxPropsSchema } from "./BaseBoxProps";
|
|
|
14
13
|
import { UIElement } from "../types";
|
|
15
14
|
import { RenderContext, buildShadowStyle, dim, resolveInheritedFontFamily } from "./shared";
|
|
16
15
|
import { GradientBox } from "./GradientBox";
|
|
17
|
-
import { ComposableVariableEntry } from "../../../Provider/OnboardingProgressProvider";
|
|
18
|
-
import { evaluateSetVariableExpression } from "./expression";
|
|
19
16
|
import { triggerHaptic, type HapticStyle } from "./haptics";
|
|
17
|
+
import {
|
|
18
|
+
type ButtonAction,
|
|
19
|
+
ButtonActionSchema,
|
|
20
|
+
} from "./actions";
|
|
21
|
+
import { runActions } from "./runActions";
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const CustomButtonActionSchema = z.object({
|
|
28
|
-
type: z.literal("custom"),
|
|
29
|
-
function: z.string().min(1, "function must not be empty"),
|
|
30
|
-
variables: z.array(z.string()).optional(),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export type SetVariableButtonAction = {
|
|
34
|
-
type: "setVariable";
|
|
35
|
-
name: string;
|
|
36
|
-
value: string;
|
|
37
|
-
label?: string;
|
|
38
|
-
/**
|
|
39
|
-
* When `"expression"`, `value` is parsed as an arithmetic expression with
|
|
40
|
-
* `{{var}}` references, numeric literals, and `+ - * /` (parens supported).
|
|
41
|
-
* On parse failure, falls back to plain interpolation (string).
|
|
42
|
-
* Defaults to `"literal"` — `value` stored verbatim.
|
|
43
|
-
*/
|
|
44
|
-
valueMode?: "literal" | "expression";
|
|
45
|
-
/**
|
|
46
|
-
* Tags the stored variable's underlying type. In `"literal"` mode this is
|
|
47
|
-
* used as-is. In `"expression"` mode the inferred result kind is used
|
|
48
|
-
* unless `kind` is explicitly set (ignored — expression mode derives kind
|
|
49
|
-
* from evaluation).
|
|
50
|
-
*/
|
|
51
|
-
kind?: ComposableVariableKind;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const SetVariableButtonActionSchema = z.object({
|
|
55
|
-
type: z.literal("setVariable"),
|
|
56
|
-
name: z.string().min(1, "name must not be empty"),
|
|
57
|
-
value: z.string(),
|
|
58
|
-
label: z.string().optional(),
|
|
59
|
-
valueMode: z.enum(["literal", "expression"]).optional(),
|
|
60
|
-
kind: z.enum(["int", "float", "string"]).optional(),
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
export type ButtonAction = "continue" | CustomButtonAction | SetVariableButtonAction;
|
|
64
|
-
|
|
65
|
-
export const ButtonActionSchema = z.union([
|
|
66
|
-
z.literal("continue"),
|
|
23
|
+
// `ButtonAction` and its variants live in `./actions` (shared with the generic
|
|
24
|
+
// `onPress` on BaseBoxProps). Re-exported for back-compat.
|
|
25
|
+
export {
|
|
26
|
+
type CustomButtonAction,
|
|
67
27
|
CustomButtonActionSchema,
|
|
28
|
+
type SetVariableButtonAction,
|
|
68
29
|
SetVariableButtonActionSchema,
|
|
69
|
-
|
|
30
|
+
} from "./actions";
|
|
31
|
+
export type { ButtonAction };
|
|
32
|
+
export { ButtonActionSchema };
|
|
70
33
|
|
|
71
34
|
type ButtonOverridableProps = BaseBoxProps & {
|
|
72
35
|
variant?: "filled" | "outlined" | "ghost";
|
|
@@ -145,7 +108,7 @@ type Props = {
|
|
|
145
108
|
};
|
|
146
109
|
|
|
147
110
|
export const ButtonElementComponent = ({ element, ctx }: Props): React.ReactElement => {
|
|
148
|
-
const { theme,
|
|
111
|
+
const { theme, variables } = ctx;
|
|
149
112
|
const flatVariables = useMemo(
|
|
150
113
|
() =>
|
|
151
114
|
Object.fromEntries(
|
|
@@ -164,46 +127,7 @@ export const ButtonElementComponent = ({ element, ctx }: Props): React.ReactElem
|
|
|
164
127
|
const { actions, action } = element.props;
|
|
165
128
|
const effective: ButtonAction[] =
|
|
166
129
|
actions ?? (action === "continue" ? ["continue"] : []);
|
|
167
|
-
|
|
168
|
-
for (const act of effective) {
|
|
169
|
-
if (act === "continue") {
|
|
170
|
-
onContinue();
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
if (act.type === "setVariable") {
|
|
174
|
-
let value: string;
|
|
175
|
-
let kind: ComposableVariableKind | undefined;
|
|
176
|
-
if (act.valueMode === "expression") {
|
|
177
|
-
const computed = evaluateSetVariableExpression(act.value, variables);
|
|
178
|
-
value = computed.value;
|
|
179
|
-
kind = computed.kind;
|
|
180
|
-
} else {
|
|
181
|
-
value = act.value;
|
|
182
|
-
kind = act.kind;
|
|
183
|
-
}
|
|
184
|
-
setVariable(act.name, { value, label: act.label, kind });
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
const handler = customActions[act.function];
|
|
188
|
-
if (!handler) {
|
|
189
|
-
console.warn(
|
|
190
|
-
`[ComposableScreen] No customAction registered for "${act.function}"`
|
|
191
|
-
);
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
const requested = act.variables ?? [];
|
|
195
|
-
const vars: Record<string, ComposableVariableEntry | undefined> = {};
|
|
196
|
-
for (const name of requested) vars[name] = variables[name];
|
|
197
|
-
try {
|
|
198
|
-
await handler({ variables: vars });
|
|
199
|
-
} catch (err) {
|
|
200
|
-
console.error(
|
|
201
|
-
`[ComposableScreen] customAction "${act.function}" threw:`,
|
|
202
|
-
err
|
|
203
|
-
);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
130
|
+
await runActions(effective, ctx);
|
|
207
131
|
};
|
|
208
132
|
|
|
209
133
|
// State overrides are merged over base props. disabledStyle wins over the
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
// Self-contained UI mirror of the headless `ButtonAction` (packages/onboarding
|
|
4
|
+
// src/steps/common.types.ts). Kept here as a leaf module (imports only zod) so
|
|
5
|
+
// both BaseBoxProps.ts (schema) and shared.ts (runActions dispatch) can depend
|
|
6
|
+
// on it without an import cycle. Shared by `Button.actions` and the generic
|
|
7
|
+
// `onPress` on every UIElement.
|
|
8
|
+
|
|
9
|
+
export type CustomButtonAction = {
|
|
10
|
+
type: "custom";
|
|
11
|
+
function: string;
|
|
12
|
+
variables?: string[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const CustomButtonActionSchema = z.object({
|
|
16
|
+
type: z.literal("custom"),
|
|
17
|
+
function: z.string().min(1, "function must not be empty"),
|
|
18
|
+
variables: z.array(z.string()).optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type SetVariableButtonAction = {
|
|
22
|
+
type: "setVariable";
|
|
23
|
+
name: string;
|
|
24
|
+
value: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
valueMode?: "literal" | "expression";
|
|
27
|
+
kind?: "int" | "float" | "string";
|
|
28
|
+
/**
|
|
29
|
+
* Treat the target variable as the JSON-encoded `string[]` multi-select
|
|
30
|
+
* collection used by `CheckboxGroup` and apply `value` as a set operation
|
|
31
|
+
* (`"append"` / `"remove"` / `"toggle"`) instead of overwriting. `kind` is
|
|
32
|
+
* ignored in this mode. Omit for the default overwrite behavior.
|
|
33
|
+
*/
|
|
34
|
+
arrayOp?: "append" | "remove" | "toggle";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const SetVariableButtonActionSchema = z.object({
|
|
38
|
+
type: z.literal("setVariable"),
|
|
39
|
+
name: z.string().min(1, "name must not be empty"),
|
|
40
|
+
value: z.string(),
|
|
41
|
+
label: z.string().optional(),
|
|
42
|
+
valueMode: z.enum(["literal", "expression"]).optional(),
|
|
43
|
+
kind: z.enum(["int", "float", "string"]).optional(),
|
|
44
|
+
arrayOp: z.enum(["append", "remove", "toggle"]).optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type ButtonAction = "continue" | CustomButtonAction | SetVariableButtonAction;
|
|
48
|
+
|
|
49
|
+
export const ButtonActionSchema = z.union([
|
|
50
|
+
z.literal("continue"),
|
|
51
|
+
CustomButtonActionSchema,
|
|
52
|
+
SetVariableButtonActionSchema,
|
|
53
|
+
]);
|