@builder.io/sdk-react-native 0.0.1-33 → 0.0.1-37

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 (54) hide show
  1. package/package.json +1 -1
  2. package/src/blocks/button.js +10 -3
  3. package/src/blocks/button.lite.tsx +1 -1
  4. package/src/blocks/columns.js +17 -6
  5. package/src/blocks/columns.lite.tsx +1 -2
  6. package/src/blocks/custom-code.js +7 -4
  7. package/src/blocks/custom-code.lite.tsx +9 -5
  8. package/src/blocks/embed.js +7 -4
  9. package/src/blocks/embed.lite.tsx +6 -4
  10. package/src/blocks/form.js +88 -33
  11. package/src/blocks/form.lite.tsx +25 -18
  12. package/src/blocks/fragment.lite.tsx +0 -1
  13. package/src/blocks/image.lite.tsx +5 -3
  14. package/src/blocks/img.js +8 -2
  15. package/src/blocks/img.lite.tsx +0 -1
  16. package/src/blocks/input.js +10 -3
  17. package/src/blocks/input.lite.tsx +3 -2
  18. package/src/blocks/raw-text.lite.tsx +0 -1
  19. package/src/blocks/section.js +9 -4
  20. package/src/blocks/section.lite.tsx +0 -1
  21. package/src/blocks/select.js +16 -5
  22. package/src/blocks/select.lite.tsx +4 -3
  23. package/src/blocks/submit-button.js +8 -2
  24. package/src/blocks/submit-button.lite.tsx +0 -1
  25. package/src/blocks/text.js +17 -4
  26. package/src/blocks/text.lite.tsx +6 -2
  27. package/src/blocks/textarea.js +10 -3
  28. package/src/blocks/textarea.lite.tsx +0 -1
  29. package/src/blocks/video.js +8 -1
  30. package/src/blocks/video.lite.tsx +0 -1
  31. package/src/components/block-styles.lite.tsx +0 -1
  32. package/src/components/error-boundary.lite.tsx +0 -1
  33. package/src/components/render-block.js +30 -11
  34. package/src/components/render-block.lite.tsx +19 -7
  35. package/src/components/render-blocks.js +6 -4
  36. package/src/components/render-blocks.lite.tsx +3 -4
  37. package/src/components/render-content.js +41 -17
  38. package/src/components/render-content.lite.tsx +16 -7
  39. package/src/functions/evaluate.js +9 -8
  40. package/src/functions/get-block-actions.js +4 -1
  41. package/src/functions/get-block-component-options.js +8 -2
  42. package/src/functions/get-block-properties.js +9 -3
  43. package/src/functions/get-block-styles.js +20 -6
  44. package/src/functions/get-content.js +24 -11
  45. package/src/functions/get-content.test.js +6 -4
  46. package/src/functions/get-processed-block.js +8 -2
  47. package/src/functions/get-processed-block.test.js +5 -1
  48. package/src/functions/is-browser.js +5 -1
  49. package/src/functions/is-editing.js +3 -1
  50. package/src/functions/register-component.js +9 -3
  51. package/src/functions/set.js +5 -2
  52. package/src/index.js +9 -10
  53. package/src/scripts/init-editing.js +1 -1
  54. package/src/package.json +0 -18
package/src/blocks/img.js CHANGED
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -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
  import { isEditing } from '../functions/is-editing';
5
4
 
6
5
  export default function ImgComponent(props) {
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -26,7 +32,8 @@ function FormInputComponent(props) {
26
32
  return /* @__PURE__ */ React.createElement(
27
33
  View,
28
34
  __spreadProps(__spreadValues({}, props.attributes), {
29
- key: isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
35
+ key:
36
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
30
37
  placeholder: props.placeholder,
31
38
  type: props.type,
32
39
  name: props.name,
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { View, StyleSheet, Image, Text } from 'react-native';
3
- import { useContext } from 'react';
4
3
  import { isEditing } from '../functions/is-editing';
5
4
 
6
5
  export default function FormInputComponent(props) {
7
6
  return (
8
7
  <View
9
8
  {...props.attributes}
10
- key={isEditing() && props.defaultValue ? props.defaultValue : 'default-key'}
9
+ key={
10
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key'
11
+ }
11
12
  placeholder={props.placeholder}
12
13
  type={props.type}
13
14
  name={props.name}
@@ -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 RawText(props) {
6
5
  return (
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -70,8 +76,7 @@ registerComponent(SectionComponent, {
70
76
  component: {
71
77
  name: 'Text',
72
78
  options: {
73
- text:
74
- "<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>",
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>",
75
80
  },
76
81
  },
77
82
  },
@@ -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 (
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -28,19 +34,24 @@ function SelectComponent(props) {
28
34
  View,
29
35
  __spreadProps(__spreadValues({}, props.attributes), {
30
36
  value: props.value,
31
- key: isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
37
+ key:
38
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
32
39
  defaultValue: props.defaultValue,
33
40
  name: props.name,
34
41
  }),
35
42
  (_a = props.options) == null
36
43
  ? void 0
37
- : _a.map(option =>
44
+ : _a.map((option) =>
38
45
  /* @__PURE__ */ React.createElement(
39
46
  View,
40
47
  {
41
48
  value: option.value,
42
49
  },
43
- /* @__PURE__ */ React.createElement(Text, null, option.name || option.value)
50
+ /* @__PURE__ */ React.createElement(
51
+ Text,
52
+ null,
53
+ option.name || option.value
54
+ )
44
55
  )
45
56
  )
46
57
  );
@@ -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
  import { isEditing } from '../functions/is-editing';
5
4
 
6
5
  export default function SelectComponent(props) {
@@ -8,11 +7,13 @@ export default function SelectComponent(props) {
8
7
  <View
9
8
  {...props.attributes}
10
9
  value={props.value}
11
- key={isEditing() && props.defaultValue ? props.defaultValue : 'default-key'}
10
+ key={
11
+ isEditing() && props.defaultValue ? props.defaultValue : 'default-key'
12
+ }
12
13
  defaultValue={props.defaultValue}
13
14
  name={props.name}
14
15
  >
15
- {props.options?.map(option => (
16
+ {props.options?.map((option) => (
16
17
  <View value={option.value}>
17
18
  <Text>{option.name || option.value}</Text>
18
19
  </View>
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -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 SubmitButton(props) {
6
5
  return (
@@ -5,10 +5,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
6
  var __defNormalProp = (obj, key, value) =>
7
7
  key in obj
8
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
8
+ ? __defProp(obj, key, {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value,
13
+ })
9
14
  : (obj[key] = value);
10
15
  var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
16
+ for (var prop in b || (b = {}))
17
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
12
18
  if (__getOwnPropSymbols)
13
19
  for (var prop of __getOwnPropSymbols(b)) {
14
20
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -32,7 +38,10 @@ const PICK_STYLES = ['textAlign'];
32
38
  function getBlockStyles(block) {
33
39
  var _a, _b, _c;
34
40
  const styles = __spreadValues(
35
- __spreadValues({}, (_a = block.responsiveStyles) == null ? void 0 : _a.large),
41
+ __spreadValues(
42
+ {},
43
+ (_a = block.responsiveStyles) == null ? void 0 : _a.large
44
+ ),
36
45
  block.styles
37
46
  );
38
47
  if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium) {
@@ -59,7 +68,11 @@ function getCss(block) {
59
68
  }
60
69
  function Text(props) {
61
70
  return /* @__PURE__ */ React.createElement(HTML, {
62
- source: { html: `<div style="${getCss(props.builderBlock)}">${props.text || ''}</div>` },
71
+ source: {
72
+ html: `<div style="${getCss(props.builderBlock)}">${
73
+ props.text || ''
74
+ }</div>`,
75
+ },
63
76
  });
64
77
  }
65
78
  registerComponent(Text, {
@@ -1,7 +1,11 @@
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 Text(props) {
6
- return <View className="builder-text" dangerouslySetInnerHTML={{ __html: 'props.text' }} />;
5
+ return (
6
+ <View
7
+ className="builder-text"
8
+ dangerouslySetInnerHTML={{ __html: 'props.text' }}
9
+ />
10
+ );
7
11
  }
@@ -8,10 +8,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
9
  var __defNormalProp = (obj, key, value) =>
10
10
  key in obj
11
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
11
+ ? __defProp(obj, key, {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value,
16
+ })
12
17
  : (obj[key] = value);
13
18
  var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
15
21
  if (__getOwnPropSymbols)
16
22
  for (var prop of __getOwnPropSymbols(b)) {
17
23
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -45,7 +51,8 @@ registerComponent(Textarea, {
45
51
  name: 'name',
46
52
  type: 'string',
47
53
  required: true,
48
- helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"',
54
+ helperText:
55
+ 'Every input in a form needs a unique name describing what it gets, e.g. "email"',
49
56
  },
50
57
  { name: 'defaultValue', type: 'string' },
51
58
  { name: 'placeholder', type: 'string', defaultValue: 'Hello there' },
@@ -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 Textarea(props) {
6
5
  return (
@@ -16,7 +16,14 @@ function Video(props) {
16
16
  poster: props.posterImage,
17
17
  posterResizeMode: props.fit || 'contain',
18
18
  resizeMode: props.fit || 'contain',
19
- style: { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, zIndex: 1 },
19
+ style: {
20
+ position: 'absolute',
21
+ top: 0,
22
+ bottom: 0,
23
+ left: 0,
24
+ right: 0,
25
+ zIndex: 1,
26
+ },
20
27
  source: { uri: props.video },
21
28
  }),
22
29
  /* @__PURE__ */ React.createElement(View, {
@@ -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 Video(props) {
6
5
  return (
@@ -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 BlockStyles(props) {
6
5
  return <></>;
@@ -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 ErrorBoundary(props) {
6
5
  return <></>;
@@ -6,10 +6,16 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
7
  var __defNormalProp = (obj, key, value) =>
8
8
  key in obj
9
- ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
9
+ ? __defProp(obj, key, {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value,
14
+ })
10
15
  : (obj[key] = value);
11
16
  var __spreadValues = (a, b) => {
12
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
17
+ for (var prop in b || (b = {}))
18
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
13
19
  if (__getOwnPropSymbols)
14
20
  for (var prop of __getOwnPropSymbols(b)) {
15
21
  if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
@@ -33,11 +39,13 @@ function RenderBlock(props) {
33
39
  var _a, _b, _c;
34
40
  function component() {
35
41
  var _a2, _b2;
36
- const componentName = (_a2 = useBlock().component) == null ? void 0 : _a2.name;
42
+ const componentName =
43
+ (_a2 = useBlock().component) == null ? void 0 : _a2.name;
37
44
  if (!componentName) {
38
45
  return null;
39
46
  }
40
- const ref = components[(_b2 = useBlock().component) == null ? void 0 : _b2.name];
47
+ const ref =
48
+ components[(_b2 = useBlock().component) == null ? void 0 : _b2.name];
41
49
  if (componentName && !ref) {
42
50
  console.warn(`
43
51
  Could not find a registered component named "${componentName}".
@@ -47,11 +55,15 @@ function RenderBlock(props) {
47
55
  }
48
56
  function componentInfo() {
49
57
  var _a2;
50
- return (_a2 = component == null ? void 0 : component()) == null ? void 0 : _a2.info;
58
+ return (_a2 = component == null ? void 0 : component()) == null
59
+ ? void 0
60
+ : _a2.info;
51
61
  }
52
62
  function componentRef() {
53
63
  var _a2;
54
- return (_a2 = component == null ? void 0 : component()) == null ? void 0 : _a2.component;
64
+ return (_a2 = component == null ? void 0 : component()) == null
65
+ ? void 0
66
+ : _a2.component;
55
67
  }
56
68
  function tagName() {
57
69
  return getBlockTag(useBlock());
@@ -66,6 +78,9 @@ function RenderBlock(props) {
66
78
  context: builderContext.context,
67
79
  });
68
80
  }
81
+ function propertiesAndActions() {
82
+ return __spreadValues(__spreadValues({}, properties()), actions());
83
+ }
69
84
  function actions() {
70
85
  return getBlockActions({
71
86
  block: useBlock(),
@@ -85,13 +100,15 @@ function RenderBlock(props) {
85
100
  return /* @__PURE__ */ React.createElement(
86
101
  React.Fragment,
87
102
  null,
88
- !((_a = componentInfo == null ? void 0 : componentInfo()) == null ? void 0 : _a.noWrap)
103
+ !((_a = componentInfo == null ? void 0 : componentInfo()) == null
104
+ ? void 0
105
+ : _a.noWrap)
89
106
  ? /* @__PURE__ */ React.createElement(
90
107
  React.Fragment,
91
108
  null,
92
109
  /* @__PURE__ */ React.createElement(
93
110
  TagNameRef,
94
- __spreadProps(__spreadValues({}, properties()), {
111
+ __spreadProps(__spreadValues({}, propertiesAndActions()), {
95
112
  style: css(),
96
113
  }),
97
114
  /* @__PURE__ */ React.createElement(BlockStyles, {
@@ -121,7 +138,7 @@ function RenderBlock(props) {
121
138
  null,
122
139
  (_b = useBlock().children) == null
123
140
  ? void 0
124
- : _b.map(child =>
141
+ : _b.map((child) =>
125
142
  /* @__PURE__ */ React.createElement(RenderBlock, {
126
143
  block: child,
127
144
  })
@@ -135,10 +152,12 @@ function RenderBlock(props) {
135
152
  __spreadProps(
136
153
  __spreadValues(
137
154
  {},
138
- (_c = componentInfo == null ? void 0 : componentInfo()) == null ? void 0 : _c.options
155
+ (_c = componentInfo == null ? void 0 : componentInfo()) == null
156
+ ? void 0
157
+ : _c.options
139
158
  ),
140
159
  {
141
- attributes: properties(),
160
+ attributes: propertiesAndActions(),
142
161
  builderBlock: useBlock(),
143
162
  style: css(),
144
163
  children: useBlock().children,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { View, StyleSheet, Image, Text } from 'react-native';
3
- import { useState, useContext } from 'react';
3
+ import { useContext } from 'react';
4
4
  import { getBlockComponentOptions } from '../functions/get-block-component-options';
5
5
  import { getBlockProperties } from '../functions/get-block-properties';
6
6
  import { getBlockStyles } from '../functions/get-block-styles';
@@ -56,6 +56,10 @@ export default function RenderBlock(props) {
56
56
  });
57
57
  }
58
58
 
59
+ function propertiesAndActions() {
60
+ return { ...properties(), ...actions() };
61
+ }
62
+
59
63
  function actions() {
60
64
  return getBlockActions({
61
65
  block: useBlock(),
@@ -81,22 +85,30 @@ export default function RenderBlock(props) {
81
85
  <>
82
86
  {!componentInfo?.()?.noWrap ? (
83
87
  <>
84
- <TagNameRef {...properties()} style={css()}>
88
+ <TagNameRef {...propertiesAndActions()} style={css()}>
85
89
  <BlockStyles block={useBlock()} />
86
90
 
87
91
  {componentRef() ? (
88
- <ComponentRefRef {...componentOptions()} builderBlock={useBlock()}>
92
+ <ComponentRefRef
93
+ {...componentOptions()}
94
+ builderBlock={useBlock()}
95
+ >
89
96
  {useBlock().children ? (
90
97
  <>
91
- <RenderBlocks path="children" blocks={useBlock().children} />
98
+ <RenderBlocks
99
+ path="children"
100
+ blocks={useBlock().children}
101
+ />
92
102
  </>
93
103
  ) : null}
94
104
  </ComponentRefRef>
95
105
  ) : null}
96
106
 
97
- {!componentRef() && useBlock().children && useBlock().children.length ? (
107
+ {!componentRef() &&
108
+ useBlock().children &&
109
+ useBlock().children.length ? (
98
110
  <>
99
- {useBlock().children?.map(child => (
111
+ {useBlock().children?.map((child) => (
100
112
  <RenderBlock block={child} />
101
113
  ))}
102
114
  </>
@@ -106,7 +118,7 @@ export default function RenderBlock(props) {
106
118
  ) : (
107
119
  <ComponentRefRef
108
120
  {...componentInfo?.()?.options}
109
- attributes={properties()}
121
+ attributes={propertiesAndActions()}
110
122
  builderBlock={useBlock()}
111
123
  style={css()}
112
124
  children={useBlock().children}
@@ -43,11 +43,13 @@ function RenderBlocks(props) {
43
43
  {
44
44
  'builder-path': props.path,
45
45
  'builder-parent-id': props.parent,
46
- onClick: event => onClick,
47
- onMouseEnter: event => onMouseEnter,
46
+ onClick: (event) => onClick,
47
+ onMouseEnter: (event) => onMouseEnter,
48
48
  className:
49
49
  'builder-blocks' +
50
- (!((_a = props.blocks) == null ? void 0 : _a.length) ? ' no-blocks' : ''),
50
+ (!((_a = props.blocks) == null ? void 0 : _a.length)
51
+ ? ' no-blocks'
52
+ : ''),
51
53
  style: styles.view1,
52
54
  },
53
55
  props.blocks
@@ -56,7 +58,7 @@ function RenderBlocks(props) {
56
58
  null,
57
59
  (_b = props.blocks) == null
58
60
  ? void 0
59
- : _b.map(block =>
61
+ : _b.map((block) =>
60
62
  /* @__PURE__ */ React.createElement(RenderBlock, {
61
63
  block,
62
64
  })
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { View, StyleSheet, Image, Text } from 'react-native';
3
- import { useState, useContext } from 'react';
4
3
  import { isEditing } from '../functions/is-editing';
5
4
  import RenderBlock from './render-block.lite';
6
5
 
@@ -39,14 +38,14 @@ export default function RenderBlocks(props) {
39
38
  <View
40
39
  builder-path={props.path}
41
40
  builder-parent-id={props.parent}
42
- onClick={event => onClick}
43
- onMouseEnter={event => onMouseEnter}
41
+ onClick={(event) => onClick}
42
+ onMouseEnter={(event) => onMouseEnter}
44
43
  className={'builder-blocks' + (!props.blocks?.length ? ' no-blocks' : '')}
45
44
  style={styles.view1}
46
45
  >
47
46
  {props.blocks ? (
48
47
  <>
49
- {props.blocks?.map(block => (
48
+ {props.blocks?.map((block) => (
50
49
  <RenderBlock block={block} />
51
50
  ))}
52
51
  </>