@builder.io/sdk-react-native 0.0.1-44 → 0.0.1-50

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 (88) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +1 -1
  3. package/src/blocks/button.js +23 -73
  4. package/src/blocks/button.lite.tsx +3 -3
  5. package/src/blocks/columns.js +56 -288
  6. package/src/blocks/columns.lite.tsx +22 -22
  7. package/src/blocks/custom-code.js +46 -76
  8. package/src/blocks/custom-code.lite.tsx +11 -19
  9. package/src/blocks/embed.js +46 -69
  10. package/src/blocks/embed.lite.tsx +11 -15
  11. package/src/blocks/form.js +194 -491
  12. package/src/blocks/form.lite.tsx +51 -51
  13. package/src/blocks/fragment.js +8 -16
  14. package/src/blocks/fragment.lite.tsx +2 -2
  15. package/src/blocks/image.js +91 -113
  16. package/src/blocks/image.lite.tsx +12 -13
  17. package/src/blocks/img.js +28 -51
  18. package/src/blocks/img.lite.tsx +6 -6
  19. package/src/blocks/input.js +28 -100
  20. package/src/blocks/input.lite.tsx +4 -4
  21. package/src/blocks/raw-text.js +10 -16
  22. package/src/blocks/raw-text.lite.tsx +3 -8
  23. package/src/blocks/section.js +23 -71
  24. package/src/blocks/section.lite.tsx +3 -3
  25. package/src/blocks/select.js +28 -78
  26. package/src/blocks/select.lite.tsx +5 -5
  27. package/src/blocks/submit-button.js +21 -47
  28. package/src/blocks/submit-button.lite.tsx +2 -2
  29. package/src/blocks/symbol.js +71 -20
  30. package/src/blocks/symbol.lite.tsx +48 -8
  31. package/src/blocks/text.js +27 -40
  32. package/src/blocks/text.lite.tsx +3 -8
  33. package/src/blocks/textarea.js +24 -60
  34. package/src/blocks/textarea.lite.tsx +2 -2
  35. package/src/blocks/video.js +66 -71
  36. package/src/blocks/video.lite.tsx +5 -5
  37. package/src/components/block-styles.js +4 -2
  38. package/src/components/block-styles.lite.tsx +2 -2
  39. package/src/components/error-boundary.js +9 -11
  40. package/src/components/error-boundary.lite.tsx +2 -2
  41. package/src/components/render-block.js +44 -100
  42. package/src/components/render-block.lite.tsx +23 -28
  43. package/src/components/render-blocks.js +41 -60
  44. package/src/components/render-blocks.lite.tsx +20 -14
  45. package/src/components/render-content.js +189 -142
  46. package/src/components/render-content.lite.tsx +166 -60
  47. package/src/constants/device-sizes.js +11 -8
  48. package/src/context/builder.context.js +10 -3
  49. package/src/functions/evaluate.js +20 -20
  50. package/src/functions/event-handler-name.js +3 -1
  51. package/src/functions/get-block-actions.js +17 -16
  52. package/src/functions/get-block-component-options.js +9 -16
  53. package/src/functions/get-block-properties.js +14 -18
  54. package/src/functions/get-block-styles.js +17 -34
  55. package/src/functions/get-block-tag.js +4 -2
  56. package/src/functions/get-builder-search-params/fn.test.js +14 -0
  57. package/src/functions/get-builder-search-params/index.js +23 -0
  58. package/src/functions/get-content/fn.test.js +32 -0
  59. package/src/functions/get-content/index.js +138 -0
  60. package/src/functions/get-fetch.js +7 -5
  61. package/src/functions/get-global-this.js +7 -5
  62. package/src/functions/get-processed-block.js +13 -17
  63. package/src/functions/get-processed-block.test.js +17 -16
  64. package/src/functions/get-target.js +4 -2
  65. package/src/functions/if-target.js +3 -1
  66. package/src/functions/is-browser.js +4 -2
  67. package/src/functions/is-editing.js +5 -5
  68. package/src/functions/is-iframe.js +4 -2
  69. package/src/functions/is-previewing.js +6 -4
  70. package/src/functions/is-react-native.js +3 -1
  71. package/src/functions/macro-eval.js +5 -2
  72. package/src/functions/on-change.js +7 -4
  73. package/src/functions/on-change.test.js +9 -10
  74. package/src/functions/previewing-model-name.js +5 -3
  75. package/src/functions/register-component.js +27 -38
  76. package/src/functions/register.js +10 -8
  77. package/src/functions/set-editor-settings.js +7 -5
  78. package/src/functions/set.js +5 -14
  79. package/src/functions/set.test.js +13 -14
  80. package/src/functions/track.js +12 -6
  81. package/src/functions/transform-block.js +13 -17
  82. package/src/index-helpers/blocks-exports.js +19 -0
  83. package/src/index-helpers/top-of-file.js +2 -0
  84. package/src/index.js +11 -26
  85. package/src/scripts/init-editing.js +40 -64
  86. package/src/types/typescript.js +1 -0
  87. package/src/functions/get-content.js +0 -152
  88. package/src/functions/get-content.test.js +0 -58
@@ -1,60 +1,34 @@
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) =>
10
- key in obj
11
- ? __defProp(obj, key, {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value,
16
- })
17
- : (obj[key] = value);
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
10
  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;
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;
26
20
  };
27
21
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
- import * as React from 'react';
29
- import { View, Text } from 'react-native';
22
+ import * as React from "react";
23
+ import { View, Text } from "react-native";
30
24
  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
- );
25
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
26
+ type: "submit"
27
+ }), /* @__PURE__ */ React.createElement(Text, null, props.text));
38
28
  }
39
- export { SubmitButton as default };
29
+ export {
30
+ SubmitButton as default
31
+ };
32
+
40
33
 
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
- });
34
+ registerComponent(SubmitButton, {name:'Form:SubmitButton',builtIn:true,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});
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { View, StyleSheet, Image, Text } from 'react-native';
1
+ import * as React from "react";
2
+ import { View, StyleSheet, Image, Text } from "react-native";
3
3
 
4
4
  export default function SubmitButton(props) {
5
5
  return (
@@ -1,22 +1,73 @@
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 { 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) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ 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;
20
+ };
21
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ import * as React from "react";
23
+ import { View } from "react-native";
24
+ import { useState, useContext, useEffect } from "react";
25
+ import RenderContent from "../components/render-content";
26
+ import BuilderContext from "../context/builder.context";
27
+ import { getContent } from "../functions/get-content";
6
28
  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
- );
29
+ var _a, _b, _c, _d, _e, _f, _g, _h;
30
+ const [className, setClassName] = useState(() => "builder-symbol");
31
+ const [content, setContent] = useState(() => null);
32
+ const builderContext = useContext(BuilderContext);
33
+ useEffect(() => {
34
+ var _a2;
35
+ setContent((_a2 = props.symbol) == null ? void 0 : _a2.content);
36
+ }, []);
37
+ useEffect(() => {
38
+ const symbol = props.symbol;
39
+ if (symbol && !symbol.content && !content && symbol.model) {
40
+ getContent({
41
+ model: symbol.model,
42
+ apiKey: builderContext.apiKey,
43
+ options: {
44
+ entry: symbol.entry
45
+ }
46
+ }).then((response) => {
47
+ setContent(response);
48
+ });
49
+ }
50
+ }, [
51
+ (_a = props.symbol) == null ? void 0 : _a.content,
52
+ (_b = props.symbol) == null ? void 0 : _b.model,
53
+ (_c = props.symbol) == null ? void 0 : _c.entry,
54
+ content
55
+ ]);
56
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
57
+ dataSet: {
58
+ class: className
59
+ }
60
+ }), /* @__PURE__ */ React.createElement(RenderContent, {
61
+ apiKey: builderContext.apiKey,
62
+ context: builderContext.context,
63
+ data: __spreadValues(__spreadValues(__spreadValues({}, (_d = props.symbol) == null ? void 0 : _d.data), builderContext.state), (_g = (_f = (_e = props.symbol) == null ? void 0 : _e.content) == null ? void 0 : _f.data) == null ? void 0 : _g.state),
64
+ model: (_h = props.symbol) == null ? void 0 : _h.model,
65
+ content
66
+ }));
21
67
  }
22
- export { Symbol as default };
68
+ export {
69
+ Symbol as default
70
+ };
71
+
72
+
73
+ registerComponent(Symbol, {name:'Symbol',noWrap:true,static:true,inputs:[{name:'symbol',type:'uiSymbol'},{name:'dataOnly',helperText:"Make this a data symbol that doesn't display any UI",type:'boolean',defaultValue:false,advanced:true,hideFromUI:true},{name:'inheritState',helperText:'Inherit the parent component state and data',type:'boolean',defaultValue:false,advanced:true},{name:'renderToLiquid',helperText:'Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting',type:'boolean',defaultValue:false,advanced:true,hideFromUI:true},{name:'useChildren',hideFromUI:true,type:'boolean'}]});
@@ -1,19 +1,59 @@
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 { useState, useContext, useEffect } from "react";
4
+ import RenderContent from "../components/render-content.lite";
5
+ import BuilderContext from "../context/builder.context.lite";
6
+ import { getContent } from "../functions/get-content";
6
7
 
7
8
  export default function Symbol(props) {
9
+ const [className, setClassName] = useState(() => "builder-symbol");
10
+
11
+ const [content, setContent] = useState(() => null);
12
+
8
13
  const builderContext = useContext(BuilderContext);
9
14
 
15
+ useEffect(() => {
16
+ setContent(props.symbol?.content);
17
+ }, []);
18
+
19
+ useEffect(() => {
20
+ const symbol = props.symbol;
21
+
22
+ if (symbol && !symbol.content && !content && symbol.model) {
23
+ getContent({
24
+ model: symbol.model,
25
+ apiKey: builderContext.apiKey,
26
+ options: {
27
+ entry: symbol.entry,
28
+ },
29
+ }).then((response) => {
30
+ setContent(response);
31
+ });
32
+ }
33
+ }, [
34
+ props.symbol?.content,
35
+ props.symbol?.model,
36
+ props.symbol?.entry,
37
+ content,
38
+ ]);
39
+
10
40
  return (
11
- <View className="builder-symbol">
41
+ <View
42
+ {...props.attributes}
43
+ dataSet={{
44
+ class: className,
45
+ }}
46
+ >
12
47
  <RenderContent
48
+ apiKey={builderContext.apiKey}
13
49
  context={builderContext.context}
14
- data={props.symbol?.data}
50
+ data={{
51
+ ...props.symbol?.data,
52
+ ...builderContext.state,
53
+ ...props.symbol?.content?.data?.state,
54
+ }}
15
55
  model={props.symbol?.model}
16
- content={props.symbol?.content}
56
+ content={content}
17
57
  />
18
58
  </View>
19
59
  );
@@ -3,28 +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) =>
7
- key in obj
8
- ? __defProp(obj, key, {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value,
13
- })
14
- : (obj[key] = value);
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15
7
  var __spreadValues = (a, b) => {
16
8
  for (var prop in b || (b = {}))
17
- if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
9
+ if (__hasOwnProp.call(b, prop))
10
+ __defNormalProp(a, prop, b[prop]);
18
11
  if (__getOwnPropSymbols)
19
12
  for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
13
+ if (__propIsEnum.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
21
15
  }
22
16
  return a;
23
17
  };
24
- import HTML from 'react-native-render-html';
25
- import { registerComponent } from '../functions/register-component';
18
+ import HTML from "react-native-render-html";
19
+ import { registerComponent } from "../functions/register-component";
26
20
  function camelToKebabCase(string) {
27
- 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();
28
22
  }
29
23
  function pick(object, keys) {
30
24
  return keys.reduce((obj, key) => {
@@ -34,16 +28,10 @@ function pick(object, keys) {
34
28
  return obj;
35
29
  }, {});
36
30
  }
37
- const PICK_STYLES = ['textAlign'];
31
+ const PICK_STYLES = ["textAlign"];
38
32
  function getBlockStyles(block) {
39
33
  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
- );
34
+ const styles = __spreadValues(__spreadValues({}, (_a = block.responsiveStyles) == null ? void 0 : _a.large), block.styles);
47
35
  if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium) {
48
36
  Object.assign(styles, block.responsiveStyles.medium);
49
37
  }
@@ -55,12 +43,12 @@ function getBlockStyles(block) {
55
43
  function getCss(block) {
56
44
  const styleObject = pick(getBlockStyles(block), PICK_STYLES);
57
45
  if (!styleObject) {
58
- return '';
46
+ return "";
59
47
  }
60
48
  let str = ``;
61
49
  for (const key in styleObject) {
62
50
  const value = styleObject[key];
63
- if (typeof value === 'string') {
51
+ if (typeof value === "string") {
64
52
  str += `${camelToKebabCase(key)}: ${value};`;
65
53
  }
66
54
  }
@@ -69,32 +57,31 @@ function getCss(block) {
69
57
  function Text(props) {
70
58
  return /* @__PURE__ */ React.createElement(HTML, {
71
59
  source: {
72
- html: `<div style="${getCss(props.builderBlock)}">${
73
- props.text || ''
74
- }</div>`,
75
- },
60
+ html: `<div style="${getCss(props.builderBlock)}">${props.text || ""}</div>`
61
+ }
76
62
  });
77
63
  }
78
64
  registerComponent(Text, {
79
- name: 'Text',
65
+ name: "Text",
80
66
  static: true,
81
67
  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',
68
+ 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",
84
69
  inputs: [
85
70
  {
86
- name: 'text',
87
- type: 'html',
71
+ name: "text",
72
+ type: "html",
88
73
  required: true,
89
74
  autoFocus: true,
90
75
  bubble: true,
91
- defaultValue: 'Enter some text...',
92
- },
76
+ defaultValue: "Enter some text..."
77
+ }
93
78
  ],
94
79
  defaultStyles: {
95
- lineHeight: 'normal',
96
- height: 'auto',
97
- textAlign: 'center',
98
- },
80
+ lineHeight: "normal",
81
+ height: "auto",
82
+ textAlign: "center"
83
+ }
99
84
  });
100
- export { Text as default };
85
+ export {
86
+ Text as default
87
+ };
@@ -1,11 +1,6 @@
1
- import * as React from 'react';
2
- import { View, StyleSheet, Image, Text } from 'react-native';
1
+ import * as React from "react";
2
+ import { View, StyleSheet, Image, Text } from "react-native";
3
3
 
4
4
  export default function Text(props) {
5
- return (
6
- <View
7
- className="builder-text"
8
- dangerouslySetInnerHTML={{ __html: 'props.text' }}
9
- />
10
- );
5
+ return <View dangerouslySetInnerHTML={{ __html: "props.text" }} />;
11
6
  }
@@ -1,73 +1,37 @@
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) =>
10
- key in obj
11
- ? __defProp(obj, key, {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value,
16
- })
17
- : (obj[key] = value);
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
10
  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;
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;
26
20
  };
27
21
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
- import * as React from 'react';
29
- import { View } from 'react-native';
22
+ import * as React from "react";
23
+ import { View } from "react-native";
30
24
  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
- );
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
+ }));
40
31
  }
41
- export { Textarea as default };
32
+ export {
33
+ Textarea as default
34
+ };
35
+
42
36
 
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
- });
37
+ registerComponent(Textarea, {name:'Form:TextArea',builtIn:true,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});
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { View, StyleSheet, Image, Text } from 'react-native';
1
+ import * as React from "react";
2
+ import { View, StyleSheet, Image, Text } from "react-native";
3
3
 
4
4
  export default function Textarea(props) {
5
5
  return (
@@ -1,100 +1,95 @@
1
1
  import * as React from 'react';
2
- import { View } from 'react-native';
3
- import ReactVideo from 'react-native-video';
4
- import { registerComponent } from '../functions/register-component';
2
+ import { View } from "react-native";
3
+ import ReactVideo from "react-native-video";
4
+ import { registerComponent } from "../functions/register-component";
5
5
  function Video(props) {
6
- return /* @__PURE__ */ React.createElement(
7
- View,
8
- {
9
- style: { position: 'relative' },
6
+ return /* @__PURE__ */ React.createElement(View, {
7
+ style: { position: "relative" }
8
+ }, /* @__PURE__ */ React.createElement(ReactVideo, {
9
+ paused: !props.autoPlay,
10
+ controls: props.controls,
11
+ muted: props.muted,
12
+ repeat: props.loop,
13
+ poster: props.posterImage,
14
+ posterResizeMode: props.fit || "contain",
15
+ resizeMode: props.fit || "contain",
16
+ style: {
17
+ position: "absolute",
18
+ top: 0,
19
+ bottom: 0,
20
+ left: 0,
21
+ right: 0,
22
+ zIndex: 1
10
23
  },
11
- /* @__PURE__ */ React.createElement(ReactVideo, {
12
- paused: !props.autoPlay,
13
- controls: props.controls,
14
- muted: props.muted,
15
- repeat: props.loop,
16
- poster: props.posterImage,
17
- posterResizeMode: props.fit || 'contain',
18
- resizeMode: props.fit || 'contain',
19
- style: {
20
- position: 'absolute',
21
- top: 0,
22
- bottom: 0,
23
- left: 0,
24
- right: 0,
25
- zIndex: 1,
26
- },
27
- source: { uri: props.video },
28
- }),
29
- /* @__PURE__ */ React.createElement(View, {
30
- style: {
31
- width: '100%',
32
- paddingTop: `${props.aspectRatio * 100}%`,
33
- },
34
- })
35
- );
24
+ source: { uri: props.video }
25
+ }), /* @__PURE__ */ React.createElement(View, {
26
+ style: {
27
+ width: "100%",
28
+ paddingTop: `${props.aspectRatio * 100}%`
29
+ }
30
+ }));
36
31
  }
37
32
  registerComponent(Video, {
38
- name: 'Video',
33
+ name: "Video",
39
34
  static: true,
40
35
  builtIn: true,
41
- image:
42
- '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',
36
+ 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",
43
37
  defaultStyles: {
44
- position: 'relative',
45
- minHeight: '20px',
46
- minWidth: '20px',
47
- overflow: 'hidden',
38
+ position: "relative",
39
+ minHeight: "20px",
40
+ minWidth: "20px",
41
+ overflow: "hidden"
48
42
  },
49
43
  canHaveChildren: true,
50
44
  inputs: [
51
45
  {
52
- name: 'video',
53
- type: 'file',
54
- allowedFileTypes: ['mp4'],
46
+ name: "video",
47
+ type: "file",
48
+ allowedFileTypes: ["mp4"],
55
49
  bubble: true,
56
- defaultValue:
57
- 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f',
58
- required: true,
50
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
51
+ required: true
59
52
  },
60
53
  {
61
- name: 'posterImage',
62
- type: 'file',
63
- allowedFileTypes: ['jpeg', 'png'],
64
- helperText: 'Image to show before the video plays',
54
+ name: "posterImage",
55
+ type: "file",
56
+ allowedFileTypes: ["jpeg", "png"],
57
+ helperText: "Image to show before the video plays"
65
58
  },
66
59
  {
67
- name: 'autoPlay',
68
- type: 'boolean',
69
- defaultValue: true,
60
+ name: "autoPlay",
61
+ type: "boolean",
62
+ defaultValue: true
70
63
  },
71
64
  {
72
- name: 'controls',
73
- type: 'boolean',
74
- defaultValue: false,
65
+ name: "controls",
66
+ type: "boolean",
67
+ defaultValue: false
75
68
  },
76
69
  {
77
- name: 'muted',
78
- type: 'boolean',
79
- defaultValue: true,
70
+ name: "muted",
71
+ type: "boolean",
72
+ defaultValue: true
80
73
  },
81
74
  {
82
- name: 'loop',
83
- type: 'boolean',
84
- defaultValue: true,
75
+ name: "loop",
76
+ type: "boolean",
77
+ defaultValue: true
85
78
  },
86
79
  {
87
- name: 'fit',
88
- type: 'text',
89
- defaultValue: 'cover',
90
- enum: ['contain', 'cover', 'stretch'],
80
+ name: "fit",
81
+ type: "text",
82
+ defaultValue: "cover",
83
+ enum: ["contain", "cover", "stretch"]
91
84
  },
92
85
  {
93
- name: 'aspectRatio',
94
- type: 'number',
86
+ name: "aspectRatio",
87
+ type: "number",
95
88
  advanced: true,
96
- defaultValue: 0.7004048582995948,
97
- },
98
- ],
89
+ defaultValue: 0.7004048582995948
90
+ }
91
+ ]
99
92
  });
100
- export { Video as default };
93
+ export {
94
+ Video as default
95
+ };