@builder.io/sdk-react-native 0.0.1-49 → 0.0.1-51

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 (142) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/package.json +1 -1
  3. package/src/blocks/button/button.js +31 -0
  4. package/src/blocks/{button.lite.tsx → button/button.lite.tsx} +3 -3
  5. package/src/blocks/button/component-info.js +42 -0
  6. package/src/blocks/columns/columns.js +59 -0
  7. package/src/blocks/{columns.lite.tsx → columns/columns.lite.tsx} +22 -21
  8. package/src/blocks/columns/component-info.js +218 -0
  9. package/src/blocks/custom-code/component-info.js +32 -0
  10. package/src/blocks/custom-code/custom-code.js +50 -0
  11. package/src/blocks/{custom-code.lite.tsx → custom-code/custom-code.lite.tsx} +11 -11
  12. package/src/blocks/embed/component-info.js +25 -0
  13. package/src/blocks/embed/embed.js +50 -0
  14. package/src/blocks/{embed.lite.tsx → embed/embed.lite.tsx} +11 -11
  15. package/src/blocks/form/component-info.js +263 -0
  16. package/src/blocks/form/form.js +221 -0
  17. package/src/blocks/{form.lite.tsx → form/form.lite.tsx} +51 -50
  18. package/src/blocks/fragment/component-info.js +12 -0
  19. package/src/blocks/fragment/fragment.js +8 -0
  20. package/src/blocks/{fragment.lite.tsx → fragment/fragment.lite.tsx} +2 -2
  21. package/src/blocks/image/component-info.js +105 -0
  22. package/src/blocks/image/image.js +41 -0
  23. package/src/blocks/{image.lite.tsx → image/image.lite.tsx} +11 -11
  24. package/src/blocks/img/component-info.js +21 -0
  25. package/src/blocks/img/img.js +36 -0
  26. package/src/blocks/img/img.lite.tsx +18 -0
  27. package/src/blocks/input/component-info.js +75 -0
  28. package/src/blocks/input/input.js +36 -0
  29. package/src/blocks/{input.lite.tsx → input/input.lite.tsx} +4 -4
  30. package/src/blocks/raw-text/component-info.js +17 -0
  31. package/src/blocks/raw-text/raw-text.js +10 -0
  32. package/src/blocks/raw-text/raw-text.lite.tsx +6 -0
  33. package/src/blocks/section/component-info.js +50 -0
  34. package/src/blocks/section/section.js +31 -0
  35. package/src/blocks/{section.lite.tsx → section/section.lite.tsx} +3 -3
  36. package/src/blocks/select/component-info.js +60 -0
  37. package/src/blocks/select/select.js +36 -0
  38. package/src/blocks/{select.lite.tsx → select/select.lite.tsx} +4 -4
  39. package/src/blocks/submit-button/component-info.js +29 -0
  40. package/src/blocks/submit-button/submit-button.js +29 -0
  41. package/src/blocks/{submit-button.lite.tsx → submit-button/submit-button.lite.tsx} +2 -2
  42. package/src/blocks/symbol/component-info.js +43 -0
  43. package/src/blocks/symbol/symbol.js +68 -0
  44. package/src/blocks/symbol/symbol.lite.tsx +60 -0
  45. package/src/blocks/text/component-info.js +25 -0
  46. package/src/blocks/text/text.js +65 -0
  47. package/src/blocks/text/text.lite.tsx +6 -0
  48. package/src/blocks/textarea/component-info.js +48 -0
  49. package/src/blocks/textarea/textarea.js +32 -0
  50. package/src/blocks/{textarea.lite.tsx → textarea/textarea.lite.tsx} +2 -2
  51. package/src/blocks/video/component-info.js +107 -0
  52. package/src/blocks/video/video.js +33 -0
  53. package/src/blocks/{video.lite.tsx → video/video.lite.tsx} +5 -5
  54. package/src/components/error-boundary.js +9 -11
  55. package/src/components/error-boundary.lite.tsx +2 -2
  56. package/src/components/render-block/block-styles.js +29 -0
  57. package/src/components/render-block/block-styles.lite.tsx +35 -0
  58. package/src/components/render-block/render-block.helpers.js +24 -0
  59. package/src/components/render-block/render-block.js +116 -0
  60. package/src/components/render-block/render-block.lite.tsx +139 -0
  61. package/src/components/render-blocks.js +35 -61
  62. package/src/components/render-blocks.lite.tsx +11 -11
  63. package/src/components/render-content/components/render-styles.js +58 -0
  64. package/src/components/render-content/components/render-styles.lite.tsx +70 -0
  65. package/src/components/render-content/index.js +5 -0
  66. package/src/components/render-content/render-content.js +254 -0
  67. package/src/components/render-content/render-content.lite.tsx +283 -0
  68. package/src/components/render-inlined-styles.js +18 -0
  69. package/src/components/render-inlined-styles.lite.tsx +31 -0
  70. package/src/constants/builder-registered-components.js +27 -0
  71. package/src/constants/device-sizes.js +11 -8
  72. package/src/constants/target.js +5 -0
  73. package/src/context/builder.context.js +11 -3
  74. package/src/functions/evaluate.js +20 -20
  75. package/src/functions/event-handler-name.js +3 -1
  76. package/src/functions/fast-clone.js +5 -0
  77. package/src/functions/get-block-actions.js +17 -16
  78. package/src/functions/get-block-component-options.js +9 -16
  79. package/src/functions/get-block-properties.js +14 -18
  80. package/src/functions/get-block-styles.js +17 -34
  81. package/src/functions/get-block-tag.js +4 -2
  82. package/src/functions/get-builder-search-params/fn.test.js +6 -10
  83. package/src/functions/get-builder-search-params/index.js +6 -3
  84. package/src/functions/get-content/fn.test.js +15 -17
  85. package/src/functions/get-content/index.js +25 -42
  86. package/src/functions/get-fetch.js +32 -8
  87. package/src/functions/get-global-this.js +7 -5
  88. package/src/functions/get-processed-block.js +13 -17
  89. package/src/functions/get-processed-block.test.js +16 -27
  90. package/src/functions/if-target.js +14 -3
  91. package/src/functions/is-browser.js +4 -2
  92. package/src/functions/is-editing.js +5 -5
  93. package/src/functions/is-iframe.js +4 -2
  94. package/src/functions/is-previewing.js +6 -4
  95. package/src/functions/is-react-native.js +3 -1
  96. package/src/functions/macro-eval.js +5 -2
  97. package/src/functions/on-change.js +7 -4
  98. package/src/functions/on-change.test.js +9 -10
  99. package/src/functions/previewing-model-name.js +5 -3
  100. package/src/functions/register-component.js +33 -44
  101. package/src/functions/register.js +10 -8
  102. package/src/functions/set-editor-settings.js +7 -5
  103. package/src/functions/set.js +5 -14
  104. package/src/functions/set.test.js +13 -14
  105. package/src/functions/track.js +13 -7
  106. package/src/functions/transform-block.js +13 -17
  107. package/src/index-helpers/blocks-exports.js +9 -9
  108. package/src/index-helpers/top-of-file.js +1 -1
  109. package/src/index.js +10 -12
  110. package/src/scripts/init-editing.js +74 -88
  111. package/src/types/components.js +1 -0
  112. package/src/types/element.js +1 -0
  113. package/src/types/targets.js +1 -0
  114. package/src/types/typescript.js +1 -0
  115. package/src/blocks/button.js +0 -86
  116. package/src/blocks/columns.js +0 -293
  117. package/src/blocks/custom-code.js +0 -83
  118. package/src/blocks/embed.js +0 -77
  119. package/src/blocks/form.js +0 -521
  120. package/src/blocks/fragment.js +0 -21
  121. package/src/blocks/image.js +0 -165
  122. package/src/blocks/img.js +0 -64
  123. package/src/blocks/img.lite.tsx +0 -18
  124. package/src/blocks/input.js +0 -113
  125. package/src/blocks/raw-text.js +0 -17
  126. package/src/blocks/raw-text.lite.tsx +0 -6
  127. package/src/blocks/section.js +0 -84
  128. package/src/blocks/select.js +0 -91
  129. package/src/blocks/submit-button.js +0 -60
  130. package/src/blocks/symbol.js +0 -20
  131. package/src/blocks/symbol.lite.tsx +0 -20
  132. package/src/blocks/text.js +0 -100
  133. package/src/blocks/text.lite.tsx +0 -6
  134. package/src/blocks/textarea.js +0 -73
  135. package/src/blocks/video.js +0 -100
  136. package/src/components/block-styles.js +0 -5
  137. package/src/components/block-styles.lite.tsx +0 -6
  138. package/src/components/render-block.js +0 -164
  139. package/src/components/render-block.lite.tsx +0 -132
  140. package/src/components/render-content.js +0 -220
  141. package/src/components/render-content.lite.tsx +0 -206
  142. package/src/functions/get-target.js +0 -5
package/src/blocks/img.js DELETED
@@ -1,64 +0,0 @@
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
- import { isEditing } from '../functions/is-editing';
31
- function ImgComponent(props) {
32
- return /* @__PURE__ */ React.createElement(
33
- View,
34
- __spreadProps(__spreadValues({}, props.attributes), {
35
- style: {
36
- objectFit: props.backgroundSize || 'cover',
37
- objectPosition: props.backgroundPosition || 'center',
38
- },
39
- key: (isEditing() && props.imgSrc) || 'default-key',
40
- alt: props.altText,
41
- src: props.imgSrc,
42
- })
43
- );
44
- }
45
- export { ImgComponent as default };
46
-
47
- registerComponent(ImgComponent, {
48
- name: 'Raw:Img',
49
- hideFromInsertMenu: true,
50
- builtIn: true,
51
- image:
52
- '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',
53
- inputs: [
54
- {
55
- name: 'image',
56
- bubble: true,
57
- type: 'file',
58
- allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg'],
59
- required: true,
60
- },
61
- ],
62
- noWrap: true,
63
- static: true,
64
- });
@@ -1,18 +0,0 @@
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 ImgComponent(props) {
6
- return (
7
- <View
8
- {...props.attributes}
9
- style={{
10
- objectFit: props.backgroundSize || 'cover',
11
- objectPosition: props.backgroundPosition || 'center',
12
- }}
13
- key={(isEditing() && props.imgSrc) || 'default-key'}
14
- alt={props.altText}
15
- src={props.imgSrc}
16
- />
17
- );
18
- }
@@ -1,113 +0,0 @@
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
- import { isEditing } from '../functions/is-editing';
31
- function FormInputComponent(props) {
32
- return /* @__PURE__ */ React.createElement(
33
- View,
34
- __spreadProps(__spreadValues({}, props.attributes), {
35
- key:
36
- isEditing() && props.defaultValue ? props.defaultValue : 'default-key',
37
- placeholder: props.placeholder,
38
- type: props.type,
39
- name: props.name,
40
- value: props.value,
41
- defaultValue: props.defaultValue,
42
- required: props.required,
43
- })
44
- );
45
- }
46
- export { FormInputComponent as default };
47
-
48
- registerComponent(FormInputComponent, {
49
- name: 'Form:Input',
50
- builtIn: true,
51
- image:
52
- 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
53
- inputs: [
54
- {
55
- name: 'type',
56
- type: 'text',
57
- enum: [
58
- 'text',
59
- 'number',
60
- 'email',
61
- 'url',
62
- 'checkbox',
63
- 'radio',
64
- 'range',
65
- 'date',
66
- 'datetime-local',
67
- 'search',
68
- 'tel',
69
- 'time',
70
- 'file',
71
- 'month',
72
- 'week',
73
- 'password',
74
- 'color',
75
- 'hidden',
76
- ],
77
- defaultValue: 'text',
78
- },
79
- {
80
- name: 'name',
81
- type: 'string',
82
- required: true,
83
- helperText:
84
- 'Every input in a form needs a unique name describing what it takes, e.g. "email"',
85
- },
86
- {
87
- name: 'placeholder',
88
- type: 'string',
89
- defaultValue: 'Hello there',
90
- helperText: 'Text to display when there is no value',
91
- },
92
- { name: 'defaultValue', type: 'string' },
93
- { name: 'value', type: 'string', advanced: true },
94
- {
95
- name: 'required',
96
- type: 'boolean',
97
- helperText: 'Is this input required to be filled out to submit a form',
98
- defaultValue: false,
99
- },
100
- ],
101
- noWrap: true,
102
- static: true,
103
- defaultStyles: {
104
- paddingTop: '10px',
105
- paddingBottom: '10px',
106
- paddingLeft: '10px',
107
- paddingRight: '10px',
108
- borderRadius: '3px',
109
- borderWidth: '1px',
110
- borderStyle: 'solid',
111
- borderColor: '#ccc',
112
- },
113
- });
@@ -1,17 +0,0 @@
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
- return /* @__PURE__ */ React.createElement(View, {
7
- dangerouslySetInnerHTML: { __html: "props.text || ''" },
8
- });
9
- }
10
- export { RawText as default };
11
-
12
- registerComponent(RawText, {
13
- name: 'Builder:RawText',
14
- hideFromInsertMenu: true,
15
- builtIn: true,
16
- inputs: [{ name: 'text', bubble: true, type: 'longText', required: true }],
17
- });
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { View, StyleSheet, Image, Text } from 'react-native';
3
-
4
- export default function RawText(props) {
5
- return <View dangerouslySetInnerHTML={{ __html: "props.text || ''" }} />;
6
- }
@@ -1,84 +0,0 @@
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
- });
@@ -1,91 +0,0 @@
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
- });
@@ -1,60 +0,0 @@
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
- });
@@ -1,20 +0,0 @@
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
- null,
12
- /* @__PURE__ */ React.createElement(RenderContent, {
13
- context: builderContext.context,
14
- data: (_a = props.symbol) == null ? void 0 : _a.data,
15
- model: (_b = props.symbol) == null ? void 0 : _b.model,
16
- content: (_c = props.symbol) == null ? void 0 : _c.content,
17
- })
18
- );
19
- }
20
- export { Symbol as default };
@@ -1,20 +0,0 @@
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>
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
- }
@@ -1,100 +0,0 @@
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 };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { View, StyleSheet, Image, Text } from 'react-native';
3
-
4
- export default function Text(props) {
5
- return <View dangerouslySetInnerHTML={{ __html: 'props.text' }} />;
6
- }
@@ -1,73 +0,0 @@
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
- });