@builder.io/sdk-react-native 0.0.1-22 → 0.0.1-26

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