@builder.io/sdk-react-native 0.0.1-5 → 0.0.1-52
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/CHANGELOG.md +28 -0
- package/README.md +15 -0
- package/package.json +6 -4
- package/src/blocks/button/button.js +31 -0
- package/src/blocks/{button.lite.tsx → button/button.lite.tsx} +7 -11
- package/src/blocks/button/component-info.js +42 -0
- package/src/blocks/columns/columns.js +59 -0
- package/src/blocks/columns/columns.lite.tsx +70 -0
- package/src/blocks/columns/component-info.js +218 -0
- package/src/blocks/custom-code/component-info.js +32 -0
- package/src/blocks/custom-code/custom-code.js +50 -0
- package/src/blocks/{custom-code.lite.tsx → custom-code/custom-code.lite.tsx} +2 -10
- package/src/blocks/embed/component-info.js +25 -0
- package/src/blocks/embed/embed.js +50 -0
- package/src/blocks/{embed.lite.tsx → embed/embed.lite.tsx} +2 -6
- package/src/blocks/form/component-info.js +263 -0
- package/src/blocks/form/form.js +221 -0
- package/src/blocks/{form.lite.tsx → form/form.lite.tsx} +24 -27
- package/src/blocks/fragment/component-info.js +12 -0
- package/src/blocks/fragment/fragment.js +8 -0
- package/src/blocks/fragment/fragment.lite.tsx +10 -0
- package/src/blocks/{image.js → image/component-info.js} +5 -23
- package/src/blocks/image/image.js +41 -0
- package/src/blocks/image/image.lite.tsx +67 -0
- package/src/blocks/img/component-info.js +21 -0
- package/src/blocks/img/img.js +36 -0
- package/src/blocks/{img.lite.tsx → img/img.lite.tsx} +2 -3
- package/src/blocks/input/component-info.js +75 -0
- package/src/blocks/input/input.js +36 -0
- package/src/blocks/{input.lite.tsx → input/input.lite.tsx} +2 -5
- package/src/blocks/raw-text/component-info.js +17 -0
- package/src/blocks/raw-text/raw-text.js +10 -0
- package/src/blocks/raw-text/raw-text.lite.tsx +6 -0
- package/src/blocks/section/component-info.js +50 -0
- package/src/blocks/section/section.js +31 -0
- package/src/blocks/{section.lite.tsx → section/section.lite.tsx} +1 -2
- package/src/blocks/select/component-info.js +60 -0
- package/src/blocks/select/select.js +36 -0
- package/src/blocks/{select.lite.tsx → select/select.lite.tsx} +6 -7
- package/src/blocks/submit-button/component-info.js +29 -0
- package/src/blocks/submit-button/submit-button.js +29 -0
- package/src/blocks/{submit-button.lite.tsx → submit-button/submit-button.lite.tsx} +1 -2
- package/src/blocks/symbol/component-info.js +43 -0
- package/src/blocks/symbol/symbol.js +68 -0
- package/src/blocks/symbol/symbol.lite.tsx +60 -0
- package/src/blocks/{text.js → text/component-info.js} +4 -10
- package/src/blocks/text/text.js +65 -0
- package/src/blocks/text/text.lite.tsx +6 -0
- package/src/blocks/textarea/component-info.js +48 -0
- package/src/blocks/textarea/textarea.js +32 -0
- package/src/blocks/{textarea.lite.tsx → textarea/textarea.lite.tsx} +0 -1
- package/src/blocks/video/component-info.js +107 -0
- package/src/blocks/video/video.js +33 -0
- package/src/blocks/{video.lite.tsx → video/video.lite.tsx} +0 -1
- package/src/components/error-boundary.js +25 -0
- package/src/components/error-boundary.lite.tsx +6 -0
- package/src/components/render-block/block-styles.js +29 -0
- package/src/components/render-block/block-styles.lite.tsx +35 -0
- package/src/components/render-block/render-block.helpers.js +24 -0
- package/src/components/render-block/render-block.js +116 -0
- package/src/components/render-block/render-block.lite.tsx +139 -0
- package/src/components/render-blocks.js +14 -7
- package/src/components/render-blocks.lite.tsx +18 -9
- package/src/components/render-content/components/render-styles.js +58 -0
- package/src/components/render-content/components/render-styles.lite.tsx +70 -0
- package/src/components/render-content/index.js +5 -0
- package/src/components/render-content/render-content.js +254 -0
- package/src/components/render-content/render-content.lite.tsx +283 -0
- package/src/components/render-inlined-styles.js +18 -0
- package/src/components/render-inlined-styles.lite.tsx +31 -0
- package/src/constants/builder-registered-components.js +27 -0
- package/src/constants/target.js +5 -0
- package/src/context/builder.context.js +7 -1
- package/src/functions/evaluate.js +17 -8
- package/src/functions/event-handler-name.js +8 -0
- package/src/functions/fast-clone.js +5 -0
- package/src/functions/get-block-actions.js +14 -13
- package/src/functions/get-block-component-options.js +17 -1
- package/src/functions/get-block-properties.js +7 -4
- package/src/functions/get-block-styles.js +31 -1
- package/src/functions/get-builder-search-params/fn.test.js +14 -0
- package/src/functions/get-builder-search-params/index.js +23 -0
- package/src/functions/get-content/fn.test.js +32 -0
- package/src/functions/get-content/index.js +139 -0
- package/src/functions/get-fetch.js +35 -0
- package/src/functions/get-global-this.js +19 -0
- package/src/functions/get-processed-block.js +5 -3
- package/src/functions/get-processed-block.test.js +13 -8
- package/src/functions/if-target.js +11 -2
- package/src/functions/is-browser.js +1 -2
- package/src/functions/is-editing.js +1 -1
- package/src/functions/is-iframe.js +1 -1
- package/src/functions/is-previewing.js +15 -0
- package/src/functions/is-react-native.js +1 -1
- package/src/functions/on-change.test.js +1 -2
- package/src/functions/previewing-model-name.js +12 -0
- package/src/functions/register-component.js +31 -13
- package/src/functions/register.js +30 -0
- package/src/functions/set-editor-settings.js +16 -0
- package/src/functions/set.test.js +1 -2
- package/src/functions/track.js +7 -3
- package/src/functions/transform-block.js +38 -0
- package/src/index-helpers/blocks-exports.js +19 -0
- package/src/index-helpers/top-of-file.js +2 -0
- package/src/index.js +10 -23
- package/src/scripts/init-editing.js +73 -47
- package/src/types/components.js +1 -0
- package/src/types/deep-partial.js +1 -0
- package/src/types/element.js +1 -0
- package/src/types/targets.js +1 -0
- package/src/types/typescript.js +1 -0
- package/index.js +0 -11
- package/src/blocks/button.js +0 -37
- package/src/blocks/columns.js +0 -47
- package/src/blocks/columns.lite.tsx +0 -46
- package/src/blocks/custom-code.js +0 -56
- package/src/blocks/embed.js +0 -56
- package/src/blocks/form.js +0 -229
- package/src/blocks/image.lite.tsx +0 -35
- package/src/blocks/img.js +0 -41
- package/src/blocks/input.js +0 -41
- package/src/blocks/raw-text.js +0 -17
- package/src/blocks/raw-text.lite.tsx +0 -12
- package/src/blocks/section.js +0 -36
- package/src/blocks/select.js +0 -40
- package/src/blocks/submit-button.js +0 -34
- package/src/blocks/symbol.js +0 -20
- package/src/blocks/symbol.lite.tsx +0 -20
- package/src/blocks/text.lite.tsx +0 -12
- package/src/blocks/textarea.js +0 -37
- package/src/blocks/video.js +0 -49
- package/src/components/render-block.js +0 -84
- package/src/components/render-block.lite.tsx +0 -92
- package/src/components/render-content.js +0 -66
- package/src/components/render-content.lite.tsx +0 -95
- package/src/functions/get-content.js +0 -103
- package/src/functions/get-target.js +0 -7
- package/src/package.json +0 -18
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text } from "react-native";
|
|
3
|
+
function FragmentComponent(props) {
|
|
4
|
+
return /* @__PURE__ */ React.createElement(View, null, /* @__PURE__ */ React.createElement(Text, null, props.children));
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
FragmentComponent as default
|
|
8
|
+
};
|
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { registerComponent } from "../functions/register-component";
|
|
4
|
-
function Image(props) {
|
|
5
|
-
return /* @__PURE__ */ React.createElement(View, {
|
|
6
|
-
style: { position: "relative" }
|
|
7
|
-
}, /* @__PURE__ */ React.createElement(ReactImage, {
|
|
8
|
-
resizeMode: props.backgroundSize || "contain",
|
|
9
|
-
style: { position: "absolute", top: 0, bottom: 0, left: 0, right: 0 },
|
|
10
|
-
source: { uri: props.image }
|
|
11
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
12
|
-
className: "builder-image-sizer",
|
|
13
|
-
style: {
|
|
14
|
-
width: "100%",
|
|
15
|
-
paddingTop: props.aspectRatio * 100 + "%",
|
|
16
|
-
pointerEvents: "none",
|
|
17
|
-
fontSize: 0
|
|
18
|
-
}
|
|
19
|
-
}, " "));
|
|
20
|
-
}
|
|
21
|
-
registerComponent(Image, {
|
|
2
|
+
const componentInfo = {
|
|
22
3
|
name: "Image",
|
|
23
4
|
static: true,
|
|
5
|
+
builtIn: true,
|
|
24
6
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
25
7
|
defaultStyles: {
|
|
26
8
|
position: "relative",
|
|
@@ -52,7 +34,7 @@ registerComponent(Image, {
|
|
|
52
34
|
{
|
|
53
35
|
label: "cover",
|
|
54
36
|
value: "cover",
|
|
55
|
-
helperText:
|
|
37
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
56
38
|
}
|
|
57
39
|
]
|
|
58
40
|
},
|
|
@@ -117,7 +99,7 @@ registerComponent(Image, {
|
|
|
117
99
|
defaultValue: 0.7041
|
|
118
100
|
}
|
|
119
101
|
]
|
|
120
|
-
}
|
|
102
|
+
};
|
|
121
103
|
export {
|
|
122
|
-
|
|
104
|
+
componentInfo
|
|
123
105
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
18
|
+
import { Image as ReactImage, View } from "react-native";
|
|
19
|
+
function Image(props) {
|
|
20
|
+
return props.aspectRatio ? /* @__PURE__ */ React.createElement(View, {
|
|
21
|
+
style: { position: "relative" }
|
|
22
|
+
}, /* @__PURE__ */ React.createElement(ReactImage, {
|
|
23
|
+
resizeMode: props.backgroundSize || "contain",
|
|
24
|
+
style: { position: "absolute", top: 0, bottom: 0, left: 0, right: 0 },
|
|
25
|
+
source: { uri: props.image }
|
|
26
|
+
}), /* @__PURE__ */ React.createElement(View, {
|
|
27
|
+
style: {
|
|
28
|
+
width: "100%",
|
|
29
|
+
paddingTop: props.aspectRatio * 100 + "%"
|
|
30
|
+
}
|
|
31
|
+
})) : /* @__PURE__ */ React.createElement(ReactImage, {
|
|
32
|
+
resizeMode: props.backgroundSize || "contain",
|
|
33
|
+
style: __spreadValues(__spreadValues({
|
|
34
|
+
position: "relative"
|
|
35
|
+
}, props.width ? { width: props.width } : {}), props.height ? { height: props.height } : {}),
|
|
36
|
+
source: { uri: props.image }
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
Image as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
+
|
|
4
|
+
export default function Image(props) {
|
|
5
|
+
return (
|
|
6
|
+
<View style={styles.view1}>
|
|
7
|
+
<View>
|
|
8
|
+
<View
|
|
9
|
+
loading="lazy"
|
|
10
|
+
alt={props.altText}
|
|
11
|
+
role={props.altText ? "presentation" : undefined}
|
|
12
|
+
style={styles.view2}
|
|
13
|
+
src={props.image}
|
|
14
|
+
srcset={props.srcset}
|
|
15
|
+
sizes={props.sizes}
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<View srcSet={props.srcset} />
|
|
19
|
+
</View>
|
|
20
|
+
|
|
21
|
+
{props.aspectRatio &&
|
|
22
|
+
!(props.fitContent && props.builderBlock?.children?.length) ? (
|
|
23
|
+
<View style={styles.view3}>
|
|
24
|
+
<Text> </Text>
|
|
25
|
+
</View>
|
|
26
|
+
) : null}
|
|
27
|
+
|
|
28
|
+
{props.builderBlock?.children?.length && props.fitContent ? (
|
|
29
|
+
<>
|
|
30
|
+
<Text>{props.children}</Text>
|
|
31
|
+
</>
|
|
32
|
+
) : null}
|
|
33
|
+
|
|
34
|
+
{!props.fitContent ? (
|
|
35
|
+
<>
|
|
36
|
+
<View style={styles.view4}>
|
|
37
|
+
<Text>{props.children}</Text>
|
|
38
|
+
</View>
|
|
39
|
+
</>
|
|
40
|
+
) : null}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
view1: { position: "relative" },
|
|
47
|
+
view2: {
|
|
48
|
+
opacity: 1,
|
|
49
|
+
transition: "opacity 0.2s ease-in-out",
|
|
50
|
+
position: "absolute",
|
|
51
|
+
height: 100,
|
|
52
|
+
width: 100,
|
|
53
|
+
top: 0,
|
|
54
|
+
left: 0,
|
|
55
|
+
},
|
|
56
|
+
view3: { width: 100, pointerEvents: "none", fontSize: 0 },
|
|
57
|
+
view4: {
|
|
58
|
+
display: "flex",
|
|
59
|
+
flexDirection: "column",
|
|
60
|
+
alignItems: "stretch",
|
|
61
|
+
position: "absolute",
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
width: 100,
|
|
65
|
+
height: 100,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Raw:Img",
|
|
4
|
+
hideFromInsertMenu: true,
|
|
5
|
+
builtIn: true,
|
|
6
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
name: "image",
|
|
10
|
+
bubble: true,
|
|
11
|
+
type: "file",
|
|
12
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
noWrap: true,
|
|
17
|
+
static: true
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
componentInfo
|
|
21
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { View } from "react-native";
|
|
22
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
23
|
+
function ImgComponent(props) {
|
|
24
|
+
return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
|
|
25
|
+
style: {
|
|
26
|
+
objectFit: props.backgroundSize || "cover",
|
|
27
|
+
objectPosition: props.backgroundPosition || "center"
|
|
28
|
+
},
|
|
29
|
+
key: isEditing() && props.imgSrc || "default-key",
|
|
30
|
+
alt: props.altText,
|
|
31
|
+
src: props.imgSrc
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
ImgComponent as default
|
|
36
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { Builder } from "@builder.io/sdk";
|
|
3
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
5
4
|
|
|
6
5
|
export default function ImgComponent(props) {
|
|
7
6
|
return (
|
|
@@ -11,7 +10,7 @@ export default function ImgComponent(props) {
|
|
|
11
10
|
objectFit: props.backgroundSize || "cover",
|
|
12
11
|
objectPosition: props.backgroundPosition || "center",
|
|
13
12
|
}}
|
|
14
|
-
key={(
|
|
13
|
+
key={(isEditing() && props.imgSrc) || "default-key"}
|
|
15
14
|
alt={props.altText}
|
|
16
15
|
src={props.imgSrc}
|
|
17
16
|
/>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Form:Input",
|
|
4
|
+
builtIn: true,
|
|
5
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "type",
|
|
9
|
+
type: "text",
|
|
10
|
+
enum: [
|
|
11
|
+
"text",
|
|
12
|
+
"number",
|
|
13
|
+
"email",
|
|
14
|
+
"url",
|
|
15
|
+
"checkbox",
|
|
16
|
+
"radio",
|
|
17
|
+
"range",
|
|
18
|
+
"date",
|
|
19
|
+
"datetime-local",
|
|
20
|
+
"search",
|
|
21
|
+
"tel",
|
|
22
|
+
"time",
|
|
23
|
+
"file",
|
|
24
|
+
"month",
|
|
25
|
+
"week",
|
|
26
|
+
"password",
|
|
27
|
+
"color",
|
|
28
|
+
"hidden"
|
|
29
|
+
],
|
|
30
|
+
defaultValue: "text"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "name",
|
|
34
|
+
type: "string",
|
|
35
|
+
required: true,
|
|
36
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "placeholder",
|
|
40
|
+
type: "string",
|
|
41
|
+
defaultValue: "Hello there",
|
|
42
|
+
helperText: "Text to display when there is no value"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "defaultValue",
|
|
46
|
+
type: "string"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "value",
|
|
50
|
+
type: "string",
|
|
51
|
+
advanced: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "required",
|
|
55
|
+
type: "boolean",
|
|
56
|
+
helperText: "Is this input required to be filled out to submit a form",
|
|
57
|
+
defaultValue: false
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
noWrap: true,
|
|
61
|
+
static: true,
|
|
62
|
+
defaultStyles: {
|
|
63
|
+
paddingTop: "10px",
|
|
64
|
+
paddingBottom: "10px",
|
|
65
|
+
paddingLeft: "10px",
|
|
66
|
+
paddingRight: "10px",
|
|
67
|
+
borderRadius: "3px",
|
|
68
|
+
borderWidth: "1px",
|
|
69
|
+
borderStyle: "solid",
|
|
70
|
+
borderColor: "#ccc"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
componentInfo
|
|
75
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { View } from "react-native";
|
|
22
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
23
|
+
function FormInputComponent(props) {
|
|
24
|
+
return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
|
|
25
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
26
|
+
placeholder: props.placeholder,
|
|
27
|
+
type: props.type,
|
|
28
|
+
name: props.name,
|
|
29
|
+
value: props.value,
|
|
30
|
+
defaultValue: props.defaultValue,
|
|
31
|
+
required: props.required
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
FormInputComponent as default
|
|
36
|
+
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { Builder } from "@builder.io/sdk";
|
|
3
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
5
4
|
|
|
6
5
|
export default function FormInputComponent(props) {
|
|
7
6
|
return (
|
|
8
7
|
<View
|
|
9
8
|
{...props.attributes}
|
|
10
9
|
key={
|
|
11
|
-
|
|
12
|
-
? props.defaultValue
|
|
13
|
-
: "default-key"
|
|
10
|
+
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
14
11
|
}
|
|
15
12
|
placeholder={props.placeholder}
|
|
16
13
|
type={props.type}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Builder:RawText",
|
|
4
|
+
hideFromInsertMenu: true,
|
|
5
|
+
builtIn: true,
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "text",
|
|
9
|
+
bubble: true,
|
|
10
|
+
type: "longText",
|
|
11
|
+
required: true
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
componentInfo
|
|
17
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Core:Section",
|
|
4
|
+
static: true,
|
|
5
|
+
builtIn: true,
|
|
6
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
name: "maxWidth",
|
|
10
|
+
type: "number",
|
|
11
|
+
defaultValue: 1200
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "lazyLoad",
|
|
15
|
+
type: "boolean",
|
|
16
|
+
defaultValue: false,
|
|
17
|
+
advanced: true,
|
|
18
|
+
description: "Only render this section when in view"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
defaultStyles: {
|
|
22
|
+
paddingLeft: "20px",
|
|
23
|
+
paddingRight: "20px",
|
|
24
|
+
paddingTop: "50px",
|
|
25
|
+
paddingBottom: "50px",
|
|
26
|
+
marginTop: "0px",
|
|
27
|
+
width: "100vw",
|
|
28
|
+
marginLeft: "calc(50% - 50vw)"
|
|
29
|
+
},
|
|
30
|
+
canHaveChildren: true,
|
|
31
|
+
defaultChildren: [
|
|
32
|
+
{
|
|
33
|
+
"@type": "@builder.io/sdk:Element",
|
|
34
|
+
responsiveStyles: {
|
|
35
|
+
large: {
|
|
36
|
+
textAlign: "center"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
component: {
|
|
40
|
+
name: "Text",
|
|
41
|
+
options: {
|
|
42
|
+
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
componentInfo
|
|
50
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { View, Text } from "react-native";
|
|
22
|
+
function SectionComponent(props) {
|
|
23
|
+
return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
|
|
24
|
+
style: props.maxWidth && typeof props.maxWidth === "number" ? {
|
|
25
|
+
maxWidth: props.maxWidth
|
|
26
|
+
} : void 0
|
|
27
|
+
}), /* @__PURE__ */ React.createElement(Text, null, props.children));
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
SectionComponent as default
|
|
31
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
-
import { useContext } from "react";
|
|
4
3
|
|
|
5
4
|
export default function SectionComponent(props) {
|
|
6
5
|
return (
|
|
@@ -14,7 +13,7 @@ export default function SectionComponent(props) {
|
|
|
14
13
|
: undefined
|
|
15
14
|
}
|
|
16
15
|
>
|
|
17
|
-
{props.children}
|
|
16
|
+
<Text>{props.children}</Text>
|
|
18
17
|
</View>
|
|
19
18
|
);
|
|
20
19
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const componentInfo = {
|
|
3
|
+
name: "Form:Select",
|
|
4
|
+
builtIn: true,
|
|
5
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6
|
+
defaultStyles: {
|
|
7
|
+
alignSelf: "flex-start"
|
|
8
|
+
},
|
|
9
|
+
inputs: [
|
|
10
|
+
{
|
|
11
|
+
name: "options",
|
|
12
|
+
type: "list",
|
|
13
|
+
required: true,
|
|
14
|
+
subFields: [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
type: "text",
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "name",
|
|
22
|
+
type: "text"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
defaultValue: [
|
|
26
|
+
{
|
|
27
|
+
value: "option 1"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "option 2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "name",
|
|
36
|
+
type: "string",
|
|
37
|
+
required: true,
|
|
38
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "defaultValue",
|
|
42
|
+
type: "string"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "value",
|
|
46
|
+
type: "string",
|
|
47
|
+
advanced: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "required",
|
|
51
|
+
type: "boolean",
|
|
52
|
+
defaultValue: false
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
static: true,
|
|
56
|
+
noWrap: true
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
componentInfo
|
|
60
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { View, Text } from "react-native";
|
|
22
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
23
|
+
function SelectComponent(props) {
|
|
24
|
+
var _a;
|
|
25
|
+
return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
|
|
26
|
+
value: props.value,
|
|
27
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
28
|
+
defaultValue: props.defaultValue,
|
|
29
|
+
name: props.name
|
|
30
|
+
}), (_a = props.options) == null ? void 0 : _a.map((option) => /* @__PURE__ */ React.createElement(View, {
|
|
31
|
+
value: option.value
|
|
32
|
+
}, /* @__PURE__ */ React.createElement(Text, null, option.name || option.value))));
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
SelectComponent as default
|
|
36
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { Builder } from "@builder.io/sdk";
|
|
3
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
5
4
|
|
|
6
5
|
export default function SelectComponent(props) {
|
|
7
6
|
return (
|
|
@@ -9,15 +8,15 @@ export default function SelectComponent(props) {
|
|
|
9
8
|
{...props.attributes}
|
|
10
9
|
value={props.value}
|
|
11
10
|
key={
|
|
12
|
-
|
|
13
|
-
? props.defaultValue
|
|
14
|
-
: "default-key"
|
|
11
|
+
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
15
12
|
}
|
|
16
13
|
defaultValue={props.defaultValue}
|
|
17
14
|
name={props.name}
|
|
18
15
|
>
|
|
19
|
-
{props.options
|
|
20
|
-
<View value={option.value}>
|
|
16
|
+
{props.options?.map((option) => (
|
|
17
|
+
<View value={option.value}>
|
|
18
|
+
<Text>{option.name || option.value}</Text>
|
|
19
|
+
</View>
|
|
21
20
|
))}
|
|
22
21
|
</View>
|
|
23
22
|
);
|