@builder.io/sdk-react-native 0.0.1-25 → 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.
- package/package.json +3 -2
- package/src/blocks/button.js +66 -22
- package/src/blocks/button.lite.tsx +4 -4
- package/src/blocks/columns.js +247 -36
- package/src/blocks/columns.lite.tsx +7 -7
- package/src/blocks/custom-code.js +73 -47
- package/src/blocks/custom-code.lite.tsx +12 -16
- package/src/blocks/embed.js +66 -47
- package/src/blocks/embed.lite.tsx +11 -13
- package/src/blocks/form.js +436 -195
- package/src/blocks/form.lite.tsx +65 -72
- package/src/blocks/fragment.js +16 -8
- package/src/blocks/fragment.lite.tsx +3 -3
- package/src/blocks/image.js +88 -80
- package/src/blocks/image.lite.tsx +14 -15
- package/src/blocks/img.js +45 -28
- package/src/blocks/img.lite.tsx +7 -7
- package/src/blocks/input.js +93 -28
- package/src/blocks/input.lite.tsx +5 -7
- package/src/blocks/raw-text.js +16 -12
- package/src/blocks/raw-text.lite.tsx +3 -3
- package/src/blocks/section.js +66 -23
- package/src/blocks/section.lite.tsx +4 -4
- package/src/blocks/select.js +67 -28
- package/src/blocks/select.lite.tsx +6 -8
- package/src/blocks/submit-button.js +41 -21
- package/src/blocks/submit-button.lite.tsx +3 -3
- package/src/blocks/symbol.js +18 -16
- package/src/blocks/symbol.lite.tsx +5 -5
- package/src/blocks/text.js +29 -27
- package/src/blocks/text.lite.tsx +4 -9
- package/src/blocks/textarea.js +53 -24
- package/src/blocks/textarea.lite.tsx +3 -3
- package/src/blocks/video.js +112 -46
- package/src/blocks/video.lite.tsx +6 -6
- package/src/components/block-styles.js +2 -4
- package/src/components/block-styles.lite.tsx +3 -3
- package/src/components/error-boundary.js +11 -9
- package/src/components/error-boundary.lite.tsx +3 -3
- package/src/components/render-block.js +85 -40
- package/src/components/render-block.lite.tsx +17 -25
- package/src/components/render-blocks.js +56 -32
- package/src/components/render-blocks.lite.tsx +14 -14
- package/src/components/render-content.js +100 -52
- package/src/components/render-content.lite.tsx +32 -41
- package/src/constants/device-sizes.js +8 -11
- package/src/context/builder.context.js +2 -4
- package/src/functions/evaluate.js +17 -9
- package/src/functions/get-block-actions.js +9 -10
- package/src/functions/get-block-component-options.js +11 -10
- package/src/functions/get-block-properties.js +15 -17
- package/src/functions/get-block-styles.js +19 -16
- package/src/functions/get-block-tag.js +2 -4
- package/src/functions/get-content.js +40 -29
- package/src/functions/get-fetch.js +5 -7
- package/src/functions/get-global-this.js +5 -7
- package/src/functions/get-processed-block.js +11 -13
- package/src/functions/get-processed-block.test.js +14 -14
- package/src/functions/get-target.js +2 -4
- package/src/functions/if-target.js +1 -3
- package/src/functions/is-browser.js +3 -5
- package/src/functions/is-editing.js +3 -5
- package/src/functions/is-iframe.js +2 -4
- package/src/functions/is-previewing.js +4 -6
- package/src/functions/is-react-native.js +2 -4
- package/src/functions/macro-eval.js +2 -5
- package/src/functions/on-change.js +4 -7
- package/src/functions/on-change.test.js +10 -10
- package/src/functions/previewing-model-name.js +3 -5
- package/src/functions/register-component.js +33 -28
- package/src/functions/register.js +8 -10
- package/src/functions/set-editor-settings.js +5 -7
- package/src/functions/set.js +10 -4
- package/src/functions/set.test.js +14 -14
- package/src/functions/track.js +6 -8
- package/src/index.js +20 -18
- package/src/scripts/init-editing.js +64 -40
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { View, StyleSheet, Image, Text } from
|
|
3
|
-
import { useContext } from
|
|
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 ===
|
|
10
|
+
props.maxWidth && typeof props.maxWidth === 'number'
|
|
11
11
|
? {
|
|
12
12
|
maxWidth: props.maxWidth,
|
|
13
13
|
}
|
package/src/blocks/select.js
CHANGED
|
@@ -1,41 +1,80 @@
|
|
|
1
1
|
import { registerComponent } from '../functions/register-component';
|
|
2
2
|
|
|
3
|
-
|
|
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) =>
|
|
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 (
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
23
|
-
import { View, Text } from
|
|
24
|
-
import { isEditing } from
|
|
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(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
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
|
-
|
|
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,20 +1,18 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { View, StyleSheet, Image, Text } from
|
|
3
|
-
import { useContext } from
|
|
4
|
-
import { isEditing } from
|
|
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
|
-
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
13
|
-
}
|
|
11
|
+
key={isEditing() && props.defaultValue ? props.defaultValue : 'default-key'}
|
|
14
12
|
defaultValue={props.defaultValue}
|
|
15
13
|
name={props.name}
|
|
16
14
|
>
|
|
17
|
-
{props.options?.map(
|
|
15
|
+
{props.options?.map(option => (
|
|
18
16
|
<View value={option.value}>
|
|
19
17
|
<Text>{option.name || option.value}</Text>
|
|
20
18
|
</View>
|
|
@@ -1,34 +1,54 @@
|
|
|
1
1
|
import { registerComponent } from '../functions/register-component';
|
|
2
2
|
|
|
3
|
-
|
|
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) =>
|
|
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 (
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
23
|
-
import { View, Text } from
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import { View, Text } from 'react-native';
|
|
24
24
|
function SubmitButton(props) {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(
|
|
26
|
-
|
|
27
|
-
}
|
|
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
|
-
|
|
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
|
|
2
|
-
import { View, StyleSheet, Image, Text } from
|
|
3
|
-
import { useContext } from
|
|
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 (
|
package/src/blocks/symbol.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { View } from
|
|
3
|
-
import { useContext } from
|
|
4
|
-
import RenderContent from
|
|
5
|
-
import BuilderContext from
|
|
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(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
2
|
-
import { View, StyleSheet, Image, Text } from
|
|
3
|
-
import { useContext } from
|
|
4
|
-
import RenderContent from
|
|
5
|
-
import BuilderContext from
|
|
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);
|
package/src/blocks/text.js
CHANGED
|
@@ -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) =>
|
|
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
|
|
19
|
-
import { registerComponent } from
|
|
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,
|
|
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 = [
|
|
31
|
+
const PICK_STYLES = ['textAlign'];
|
|
32
32
|
function getBlockStyles(block) {
|
|
33
33
|
var _a, _b, _c;
|
|
34
|
-
const styles = __spreadValues(
|
|
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 ===
|
|
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 ||
|
|
62
|
+
source: { html: `<div style="${getCss(props.builderBlock)}">${props.text || ''}</div>` },
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
registerComponent(Text, {
|
|
63
|
-
name:
|
|
66
|
+
name: 'Text',
|
|
64
67
|
static: true,
|
|
65
68
|
builtIn: true,
|
|
66
|
-
image:
|
|
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:
|
|
70
|
-
type:
|
|
73
|
+
name: 'text',
|
|
74
|
+
type: 'html',
|
|
71
75
|
required: true,
|
|
72
76
|
autoFocus: true,
|
|
73
77
|
bubble: true,
|
|
74
|
-
defaultValue:
|
|
75
|
-
}
|
|
78
|
+
defaultValue: 'Enter some text...',
|
|
79
|
+
},
|
|
76
80
|
],
|
|
77
81
|
defaultStyles: {
|
|
78
|
-
lineHeight:
|
|
79
|
-
height:
|
|
80
|
-
textAlign:
|
|
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 };
|
package/src/blocks/text.lite.tsx
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { View, StyleSheet, Image, Text } from
|
|
3
|
-
import { useContext } from
|
|
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
|
}
|
package/src/blocks/textarea.js
CHANGED
|
@@ -1,37 +1,66 @@
|
|
|
1
1
|
import { registerComponent } from '../functions/register-component';
|
|
2
2
|
|
|
3
|
-
|
|
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) =>
|
|
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 (
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
23
|
-
import { View } from
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import { View } from 'react-native';
|
|
24
24
|
function Textarea(props) {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
+
});
|