@builder.io/sdk-react-native 0.0.1-34 → 0.0.1-38

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.
Files changed (83) hide show
  1. package/package.json +1 -1
  2. package/src/blocks/button.js +86 -0
  3. package/src/blocks/button.lite.tsx +25 -0
  4. package/src/blocks/columns.js +265 -0
  5. package/src/blocks/columns.lite.tsx +40 -0
  6. package/src/blocks/custom-code.js +85 -0
  7. package/src/blocks/custom-code.lite.tsx +67 -0
  8. package/src/blocks/embed.js +78 -0
  9. package/src/blocks/embed.lite.tsx +65 -0
  10. package/src/blocks/form.js +522 -0
  11. package/src/blocks/form.lite.tsx +253 -0
  12. package/src/blocks/fragment.js +21 -0
  13. package/src/blocks/fragment.lite.tsx +10 -0
  14. package/src/blocks/image.js +129 -0
  15. package/src/blocks/image.lite.tsx +68 -0
  16. package/src/blocks/img.js +64 -0
  17. package/src/blocks/img.lite.tsx +18 -0
  18. package/src/blocks/input.js +113 -0
  19. package/src/blocks/input.lite.tsx +20 -0
  20. package/src/blocks/raw-text.js +21 -0
  21. package/src/blocks/raw-text.lite.tsx +11 -0
  22. package/src/blocks/section.js +84 -0
  23. package/src/blocks/section.lite.tsx +19 -0
  24. package/src/blocks/select.js +91 -0
  25. package/src/blocks/select.lite.tsx +23 -0
  26. package/src/blocks/submit-button.js +60 -0
  27. package/src/blocks/submit-button.lite.tsx +10 -0
  28. package/src/blocks/symbol.js +22 -0
  29. package/src/blocks/symbol.lite.tsx +20 -0
  30. package/src/blocks/text.js +100 -0
  31. package/src/blocks/text.lite.tsx +11 -0
  32. package/src/blocks/textarea.js +73 -0
  33. package/src/blocks/textarea.lite.tsx +14 -0
  34. package/src/blocks/video.js +100 -0
  35. package/src/blocks/video.lite.tsx +27 -0
  36. package/src/components/block-styles.js +5 -0
  37. package/src/components/block-styles.lite.tsx +6 -0
  38. package/src/components/error-boundary.js +27 -0
  39. package/src/components/error-boundary.lite.tsx +6 -0
  40. package/src/components/render-block.js +169 -0
  41. package/src/components/render-block.lite.tsx +129 -0
  42. package/src/components/render-blocks.js +73 -0
  43. package/src/components/render-blocks.lite.tsx +59 -0
  44. package/src/components/render-content.js +215 -0
  45. package/src/components/render-content.lite.tsx +207 -0
  46. package/src/constants/device-sizes.js +37 -0
  47. package/src/context/builder.context.js +3 -0
  48. package/src/functions/evaluate.js +29 -0
  49. package/src/functions/event-handler-name.js +6 -0
  50. package/src/functions/get-block-actions.js +23 -0
  51. package/src/functions/get-block-component-options.js +31 -0
  52. package/src/functions/get-block-properties.js +47 -0
  53. package/src/functions/get-block-styles.js +78 -0
  54. package/src/functions/get-block-tag.js +6 -0
  55. package/src/functions/get-content.js +150 -0
  56. package/src/functions/get-content.test.js +58 -0
  57. package/src/functions/get-fetch.js +11 -0
  58. package/src/functions/get-global-this.js +17 -0
  59. package/src/functions/get-processed-block.js +51 -0
  60. package/src/functions/get-processed-block.test.js +31 -0
  61. package/src/functions/get-target.js +5 -0
  62. package/src/functions/if-target.js +5 -0
  63. package/src/functions/is-browser.js +10 -0
  64. package/src/functions/is-editing.js +8 -0
  65. package/src/functions/is-iframe.js +6 -0
  66. package/src/functions/is-previewing.js +13 -0
  67. package/src/functions/is-react-native.js +5 -0
  68. package/src/functions/macro-eval.js +3 -0
  69. package/src/functions/on-change.js +25 -0
  70. package/src/functions/on-change.test.js +21 -0
  71. package/src/functions/previewing-model-name.js +10 -0
  72. package/src/functions/register-component.js +65 -0
  73. package/src/functions/register.js +28 -0
  74. package/src/functions/set-editor-settings.js +14 -0
  75. package/src/functions/set.js +21 -0
  76. package/src/functions/set.test.js +18 -0
  77. package/src/functions/track.js +17 -0
  78. package/src/functions/transform-block.js +40 -0
  79. package/src/index.js +30 -0
  80. package/src/scripts/init-editing.js +95 -0
  81. package/src/types/builder-block.js +1 -0
  82. package/src/types/builder-content.js +1 -0
  83. package/src/types/deep-partial.js +1 -0
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+ import { isEditing } from '../functions/is-editing';
4
+
5
+ export default function FormInputComponent(props) {
6
+ return (
7
+ <View
8
+ {...props.attributes}
9
+ key={
10
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key'
11
+ }
12
+ placeholder={props.placeholder}
13
+ type={props.type}
14
+ name={props.name}
15
+ value={props.value}
16
+ defaultValue={props.defaultValue}
17
+ required={props.required}
18
+ />
19
+ );
20
+ }
@@ -0,0 +1,21 @@
1
+ import { registerComponent } from '../functions/register-component';
2
+
3
+ import * as React from 'react';
4
+ import { View } from 'react-native';
5
+ function RawText(props) {
6
+ var _a, _b;
7
+ return /* @__PURE__ */ React.createElement(View, {
8
+ className:
9
+ ((_a = props.attributes) == null ? void 0 : _a.class) ||
10
+ ((_b = props.attributes) == null ? void 0 : _b.className),
11
+ dangerouslySetInnerHTML: { __html: "props.text || ''" },
12
+ });
13
+ }
14
+ export { RawText as default };
15
+
16
+ registerComponent(RawText, {
17
+ name: 'Builder:RawText',
18
+ hideFromInsertMenu: true,
19
+ builtIn: true,
20
+ inputs: [{ name: 'text', bubble: true, type: 'longText', required: true }],
21
+ });
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+
4
+ export default function RawText(props) {
5
+ return (
6
+ <View
7
+ className={props.attributes?.class || props.attributes?.className}
8
+ dangerouslySetInnerHTML={{ __html: "props.text || ''" }}
9
+ />
10
+ );
11
+ }
@@ -0,0 +1,84 @@
1
+ import { registerComponent } from '../functions/register-component';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) =>
10
+ key in obj
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
17
+ : (obj[key] = value);
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ import * as React from 'react';
29
+ import { View, Text } from 'react-native';
30
+ function SectionComponent(props) {
31
+ return /* @__PURE__ */ React.createElement(
32
+ View,
33
+ __spreadProps(__spreadValues({}, props.attributes), {
34
+ style:
35
+ props.maxWidth && typeof props.maxWidth === 'number'
36
+ ? {
37
+ maxWidth: props.maxWidth,
38
+ }
39
+ : void 0,
40
+ }),
41
+ /* @__PURE__ */ React.createElement(Text, null, props.children)
42
+ );
43
+ }
44
+ export { SectionComponent as default };
45
+
46
+ registerComponent(SectionComponent, {
47
+ name: 'Core:Section',
48
+ static: true,
49
+ builtIn: true,
50
+ image:
51
+ 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a',
52
+ inputs: [
53
+ { name: 'maxWidth', type: 'number', defaultValue: 1200 },
54
+ {
55
+ name: 'lazyLoad',
56
+ type: 'boolean',
57
+ defaultValue: false,
58
+ advanced: true,
59
+ description: 'Only render this section when in view',
60
+ },
61
+ ],
62
+ defaultStyles: {
63
+ paddingLeft: '20px',
64
+ paddingRight: '20px',
65
+ paddingTop: '50px',
66
+ paddingBottom: '50px',
67
+ marginTop: '0px',
68
+ width: '100vw',
69
+ marginLeft: 'calc(50% - 50vw)',
70
+ },
71
+ canHaveChildren: true,
72
+ defaultChildren: [
73
+ {
74
+ '@type': '@builder.io/sdk:Element',
75
+ responsiveStyles: { large: { textAlign: 'center' } },
76
+ component: {
77
+ name: 'Text',
78
+ options: {
79
+ 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>",
80
+ },
81
+ },
82
+ },
83
+ ],
84
+ });
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+
4
+ export default function SectionComponent(props) {
5
+ return (
6
+ <View
7
+ {...props.attributes}
8
+ style={
9
+ props.maxWidth && typeof props.maxWidth === 'number'
10
+ ? {
11
+ maxWidth: props.maxWidth,
12
+ }
13
+ : undefined
14
+ }
15
+ >
16
+ <Text>{props.children}</Text>
17
+ </View>
18
+ );
19
+ }
@@ -0,0 +1,91 @@
1
+ import { registerComponent } from '../functions/register-component';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) =>
10
+ key in obj
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
17
+ : (obj[key] = value);
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ import * as React from 'react';
29
+ import { View, Text } from 'react-native';
30
+ import { isEditing } from '../functions/is-editing';
31
+ function SelectComponent(props) {
32
+ var _a;
33
+ return /* @__PURE__ */ React.createElement(
34
+ View,
35
+ __spreadProps(__spreadValues({}, props.attributes), {
36
+ value: props.value,
37
+ key:
38
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
39
+ defaultValue: props.defaultValue,
40
+ name: props.name,
41
+ }),
42
+ (_a = props.options) == null
43
+ ? void 0
44
+ : _a.map((option) =>
45
+ /* @__PURE__ */ React.createElement(
46
+ View,
47
+ {
48
+ value: option.value,
49
+ },
50
+ /* @__PURE__ */ React.createElement(
51
+ Text,
52
+ null,
53
+ option.name || option.value
54
+ )
55
+ )
56
+ )
57
+ );
58
+ }
59
+ export { SelectComponent as default };
60
+
61
+ registerComponent(SelectComponent, {
62
+ name: 'Form:Select',
63
+ builtIn: true,
64
+ image:
65
+ 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045',
66
+ defaultStyles: { alignSelf: 'flex-start' },
67
+ inputs: [
68
+ {
69
+ name: 'options',
70
+ type: 'list',
71
+ required: true,
72
+ subFields: [
73
+ { name: 'value', type: 'text', required: true },
74
+ { name: 'name', type: 'text' },
75
+ ],
76
+ defaultValue: [{ value: 'option 1' }, { value: 'option 2' }],
77
+ },
78
+ {
79
+ name: 'name',
80
+ type: 'string',
81
+ required: true,
82
+ helperText:
83
+ 'Every select in a form needs a unique name describing what it gets, e.g. "email"',
84
+ },
85
+ { name: 'defaultValue', type: 'string' },
86
+ { name: 'value', type: 'string', advanced: true },
87
+ { name: 'required', type: 'boolean', defaultValue: false },
88
+ ],
89
+ static: true,
90
+ noWrap: true,
91
+ });
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+ import { isEditing } from '../functions/is-editing';
4
+
5
+ export default function SelectComponent(props) {
6
+ return (
7
+ <View
8
+ {...props.attributes}
9
+ value={props.value}
10
+ key={
11
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key'
12
+ }
13
+ defaultValue={props.defaultValue}
14
+ name={props.name}
15
+ >
16
+ {props.options?.map((option) => (
17
+ <View value={option.value}>
18
+ <Text>{option.name || option.value}</Text>
19
+ </View>
20
+ ))}
21
+ </View>
22
+ );
23
+ }
@@ -0,0 +1,60 @@
1
+ import { registerComponent } from '../functions/register-component';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) =>
10
+ key in obj
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
17
+ : (obj[key] = value);
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ import * as React from 'react';
29
+ import { View, Text } from 'react-native';
30
+ function SubmitButton(props) {
31
+ return /* @__PURE__ */ React.createElement(
32
+ View,
33
+ __spreadProps(__spreadValues({}, props.attributes), {
34
+ type: 'submit',
35
+ }),
36
+ /* @__PURE__ */ React.createElement(Text, null, props.text)
37
+ );
38
+ }
39
+ export { SubmitButton as default };
40
+
41
+ registerComponent(SubmitButton, {
42
+ name: 'Form:SubmitButton',
43
+ builtIn: true,
44
+ image:
45
+ 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98',
46
+ defaultStyles: {
47
+ appearance: 'none',
48
+ paddingTop: '15px',
49
+ paddingBottom: '15px',
50
+ paddingLeft: '25px',
51
+ paddingRight: '25px',
52
+ backgroundColor: '#3898EC',
53
+ color: 'white',
54
+ borderRadius: '4px',
55
+ cursor: 'pointer',
56
+ },
57
+ inputs: [{ name: 'text', type: 'text', defaultValue: 'Click me' }],
58
+ static: true,
59
+ noWrap: true,
60
+ });
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+
4
+ export default function SubmitButton(props) {
5
+ return (
6
+ <View {...props.attributes} type="submit">
7
+ <Text>{props.text}</Text>
8
+ </View>
9
+ );
10
+ }
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { View } from 'react-native';
3
+ import { useContext } from 'react';
4
+ import RenderContent from '../components/render-content';
5
+ import BuilderContext from '../context/builder.context';
6
+ function Symbol(props) {
7
+ var _a, _b, _c;
8
+ const builderContext = useContext(BuilderContext);
9
+ return /* @__PURE__ */ React.createElement(
10
+ View,
11
+ {
12
+ className: 'builder-symbol',
13
+ },
14
+ /* @__PURE__ */ React.createElement(RenderContent, {
15
+ context: builderContext.context,
16
+ data: (_a = props.symbol) == null ? void 0 : _a.data,
17
+ model: (_b = props.symbol) == null ? void 0 : _b.model,
18
+ content: (_c = props.symbol) == null ? void 0 : _c.content,
19
+ })
20
+ );
21
+ }
22
+ export { Symbol as default };
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+ import { useContext } from 'react';
4
+ import RenderContent from '../components/render-content.lite';
5
+ import BuilderContext from '../context/builder.context.lite';
6
+
7
+ export default function Symbol(props) {
8
+ const builderContext = useContext(BuilderContext);
9
+
10
+ return (
11
+ <View className="builder-symbol">
12
+ <RenderContent
13
+ context={builderContext.context}
14
+ data={props.symbol?.data}
15
+ model={props.symbol?.model}
16
+ content={props.symbol?.content}
17
+ />
18
+ </View>
19
+ );
20
+ }
@@ -0,0 +1,100 @@
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) =>
7
+ key in obj
8
+ ? __defProp(obj, key, {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value,
13
+ })
14
+ : (obj[key] = value);
15
+ var __spreadValues = (a, b) => {
16
+ for (var prop in b || (b = {}))
17
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ import HTML from 'react-native-render-html';
25
+ import { registerComponent } from '../functions/register-component';
26
+ function camelToKebabCase(string) {
27
+ return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
28
+ }
29
+ function pick(object, keys) {
30
+ return keys.reduce((obj, key) => {
31
+ if (object && object.hasOwnProperty(key)) {
32
+ obj[key] = object[key];
33
+ }
34
+ return obj;
35
+ }, {});
36
+ }
37
+ const PICK_STYLES = ['textAlign'];
38
+ function getBlockStyles(block) {
39
+ var _a, _b, _c;
40
+ const styles = __spreadValues(
41
+ __spreadValues(
42
+ {},
43
+ (_a = block.responsiveStyles) == null ? void 0 : _a.large
44
+ ),
45
+ block.styles
46
+ );
47
+ if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium) {
48
+ Object.assign(styles, block.responsiveStyles.medium);
49
+ }
50
+ if ((_c = block.responsiveStyles) == null ? void 0 : _c.small) {
51
+ Object.assign(styles, block.responsiveStyles.small);
52
+ }
53
+ return styles;
54
+ }
55
+ function getCss(block) {
56
+ const styleObject = pick(getBlockStyles(block), PICK_STYLES);
57
+ if (!styleObject) {
58
+ return '';
59
+ }
60
+ let str = ``;
61
+ for (const key in styleObject) {
62
+ const value = styleObject[key];
63
+ if (typeof value === 'string') {
64
+ str += `${camelToKebabCase(key)}: ${value};`;
65
+ }
66
+ }
67
+ return str;
68
+ }
69
+ function Text(props) {
70
+ return /* @__PURE__ */ React.createElement(HTML, {
71
+ source: {
72
+ html: `<div style="${getCss(props.builderBlock)}">${
73
+ props.text || ''
74
+ }</div>`,
75
+ },
76
+ });
77
+ }
78
+ registerComponent(Text, {
79
+ name: 'Text',
80
+ static: true,
81
+ builtIn: true,
82
+ image:
83
+ 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929',
84
+ inputs: [
85
+ {
86
+ name: 'text',
87
+ type: 'html',
88
+ required: true,
89
+ autoFocus: true,
90
+ bubble: true,
91
+ defaultValue: 'Enter some text...',
92
+ },
93
+ ],
94
+ defaultStyles: {
95
+ lineHeight: 'normal',
96
+ height: 'auto',
97
+ textAlign: 'center',
98
+ },
99
+ });
100
+ export { Text as default };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+
4
+ export default function Text(props) {
5
+ return (
6
+ <View
7
+ className="builder-text"
8
+ dangerouslySetInnerHTML={{ __html: 'props.text' }}
9
+ />
10
+ );
11
+ }
@@ -0,0 +1,73 @@
1
+ import { registerComponent } from '../functions/register-component';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) =>
10
+ key in obj
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
17
+ : (obj[key] = value);
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ import * as React from 'react';
29
+ import { View } from 'react-native';
30
+ function Textarea(props) {
31
+ return /* @__PURE__ */ React.createElement(
32
+ View,
33
+ __spreadProps(__spreadValues({}, props.attributes), {
34
+ placeholder: props.placeholder,
35
+ name: props.name,
36
+ value: props.value,
37
+ defaultValue: props.defaultValue,
38
+ })
39
+ );
40
+ }
41
+ export { Textarea as default };
42
+
43
+ registerComponent(Textarea, {
44
+ name: 'Form:TextArea',
45
+ builtIn: true,
46
+ image:
47
+ 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3',
48
+ inputs: [
49
+ { advanced: true, name: 'value', type: 'string' },
50
+ {
51
+ name: 'name',
52
+ type: 'string',
53
+ required: true,
54
+ helperText:
55
+ 'Every input in a form needs a unique name describing what it gets, e.g. "email"',
56
+ },
57
+ { name: 'defaultValue', type: 'string' },
58
+ { name: 'placeholder', type: 'string', defaultValue: 'Hello there' },
59
+ { name: 'required', type: 'boolean', defaultValue: false },
60
+ ],
61
+ defaultStyles: {
62
+ paddingTop: '10px',
63
+ paddingBottom: '10px',
64
+ paddingLeft: '10px',
65
+ paddingRight: '10px',
66
+ borderRadius: '3px',
67
+ borderWidth: '1px',
68
+ borderStyle: 'solid',
69
+ borderColor: '#ccc',
70
+ },
71
+ static: true,
72
+ noWrap: true,
73
+ });
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet, Image, Text } from 'react-native';
3
+
4
+ export default function Textarea(props) {
5
+ return (
6
+ <View
7
+ {...props.attributes}
8
+ placeholder={props.placeholder}
9
+ name={props.name}
10
+ value={props.value}
11
+ defaultValue={props.defaultValue}
12
+ />
13
+ );
14
+ }