@builder.io/sdk-react-native 0.1.5 → 0.1.7
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/dist/blocks/button/component-info.js +0 -1
- package/dist/blocks/columns/columns.js +5 -1
- package/dist/blocks/columns/component-info.js +0 -1
- package/dist/blocks/custom-code/component-info.js +0 -1
- package/dist/blocks/embed/component-info.js +0 -1
- package/dist/blocks/form/component-info.js +0 -1
- package/dist/blocks/fragment/component-info.js +0 -1
- package/dist/blocks/image/component-info.js +0 -1
- package/dist/blocks/img/component-info.js +0 -1
- package/dist/blocks/input/component-info.js +0 -1
- package/dist/blocks/raw-text/component-info.js +0 -1
- package/dist/blocks/section/component-info.js +0 -1
- package/dist/blocks/select/component-info.js +0 -1
- package/dist/blocks/submit-button/component-info.js +0 -1
- package/dist/blocks/symbol/component-info.js +0 -1
- package/dist/blocks/text/component-info.js +0 -1
- package/dist/blocks/textarea/component-info.js +0 -1
- package/dist/blocks/video/component-info.js +0 -1
- package/dist/components/render-block/render-block.js +1 -2
- package/package.json +1 -1
- package/src/blocks/button/component-info.js +0 -1
- package/src/blocks/columns/columns.jsx +5 -1
- package/src/blocks/columns/component-info.js +0 -1
- package/src/blocks/custom-code/component-info.js +0 -1
- package/src/blocks/embed/component-info.js +0 -1
- package/src/blocks/form/component-info.js +0 -1
- package/src/blocks/fragment/component-info.js +0 -1
- package/src/blocks/image/component-info.js +0 -1
- package/src/blocks/img/component-info.js +0 -1
- package/src/blocks/input/component-info.js +0 -1
- package/src/blocks/raw-text/component-info.js +0 -1
- package/src/blocks/section/component-info.js +0 -1
- package/src/blocks/select/component-info.js +0 -1
- package/src/blocks/submit-button/component-info.js +0 -1
- package/src/blocks/symbol/component-info.js +0 -1
- package/src/blocks/text/component-info.js +0 -1
- package/src/blocks/textarea/component-info.js +0 -1
- package/src/blocks/video/component-info.js +0 -1
- package/src/components/render-block/render-block.jsx +0 -1
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentInfo = void 0;
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Core:Button",
|
|
6
|
-
builtIn: true,
|
|
7
6
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
8
7
|
defaultStyles: {
|
|
9
8
|
appearance: "none",
|
|
@@ -28,11 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const React = __importStar(require("react"));
|
|
30
30
|
const react_native_1 = require("react-native");
|
|
31
|
+
const react_1 = require("react");
|
|
31
32
|
const render_blocks_1 = __importDefault(require("../../components/render-blocks"));
|
|
32
33
|
const device_sizes_1 = require("../../constants/device-sizes");
|
|
33
34
|
const render_inlined_styles_1 = __importDefault(require("../../components/render-inlined-styles"));
|
|
34
35
|
const target_js_1 = require("../../constants/target.js");
|
|
35
36
|
const css_1 = require("../../helpers/css");
|
|
37
|
+
const builder_context_js_1 = __importDefault(require("../../context/builder.context.js"));
|
|
36
38
|
function Columns(props) {
|
|
37
39
|
var _a;
|
|
38
40
|
function getGutterSize() {
|
|
@@ -78,7 +80,8 @@ function Columns(props) {
|
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
function getWidthForBreakpointSize(size) {
|
|
81
|
-
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const breakpointSizes = (0, device_sizes_1.getSizesForBreakpoints)(((_b = (_a = builderContext.content) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.breakpoints) || {});
|
|
82
85
|
return breakpointSizes[size].max;
|
|
83
86
|
}
|
|
84
87
|
function columnStyleObjects() {
|
|
@@ -134,6 +137,7 @@ function Columns(props) {
|
|
|
134
137
|
function reactNativeColumnStyles() {
|
|
135
138
|
return columnStyleObjects.column.small;
|
|
136
139
|
}
|
|
140
|
+
const builderContext = (0, react_1.useContext)(builder_context_js_1.default);
|
|
137
141
|
return (React.createElement(react_native_1.View, { style: styles.view1 },
|
|
138
142
|
target_js_1.TARGET !== "reactNative" ? (React.createElement(React.Fragment, null,
|
|
139
143
|
React.createElement(render_inlined_styles_1.default, { styles: columnsStyles() }))) : null, (_a = props.columns) === null || _a === void 0 ? void 0 :
|
|
@@ -5,7 +5,6 @@ const util_js_1 = require("../util.js");
|
|
|
5
5
|
const componentInfo = {
|
|
6
6
|
name: "Image",
|
|
7
7
|
static: true,
|
|
8
|
-
builtIn: true,
|
|
9
8
|
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",
|
|
10
9
|
defaultStyles: {
|
|
11
10
|
position: "relative",
|
|
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
|
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Raw:Img",
|
|
6
6
|
hideFromInsertMenu: true,
|
|
7
|
-
builtIn: true,
|
|
8
7
|
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",
|
|
9
8
|
inputs: [
|
|
10
9
|
{
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentInfo = void 0;
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Form:Input",
|
|
6
|
-
builtIn: true,
|
|
7
6
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
8
7
|
inputs: [
|
|
9
8
|
{
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentInfo = void 0;
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Form:Select",
|
|
6
|
-
builtIn: true,
|
|
7
6
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
8
7
|
defaultStyles: {
|
|
9
8
|
alignSelf: "flex-start"
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentInfo = void 0;
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Form:SubmitButton",
|
|
6
|
-
builtIn: true,
|
|
7
6
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
8
7
|
defaultStyles: {
|
|
9
8
|
appearance: "none",
|
|
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
|
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Text",
|
|
6
6
|
static: true,
|
|
7
|
-
builtIn: true,
|
|
8
7
|
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",
|
|
9
8
|
inputs: [
|
|
10
9
|
{
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentInfo = void 0;
|
|
4
4
|
const componentInfo = {
|
|
5
5
|
name: "Form:TextArea",
|
|
6
|
-
builtIn: true,
|
|
7
6
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
8
7
|
inputs: [
|
|
9
8
|
{
|
|
@@ -100,7 +100,7 @@ function RenderBlock(props) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function renderComponentProps() {
|
|
103
|
-
var _a
|
|
103
|
+
var _a;
|
|
104
104
|
return {
|
|
105
105
|
blockChildren: (_a = useBlock().children) !== null && _a !== void 0 ? _a : [],
|
|
106
106
|
componentRef: component === null || component === void 0 ? void 0 : component.component,
|
|
@@ -118,7 +118,6 @@ function RenderBlock(props) {
|
|
|
118
118
|
...actions(),
|
|
119
119
|
},
|
|
120
120
|
}),
|
|
121
|
-
customBreakpoints: (_d = (_c = (_b = childrenContext === null || childrenContext === void 0 ? void 0 : childrenContext()) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.meta) === null || _d === void 0 ? void 0 : _d.breakpoints,
|
|
122
121
|
},
|
|
123
122
|
context: childrenContext(),
|
|
124
123
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
+
import { useContext } from "react";
|
|
3
4
|
import RenderBlocks from "../../components/render-blocks";
|
|
4
5
|
import { getSizesForBreakpoints } from "../../constants/device-sizes";
|
|
5
6
|
import RenderInlinedStyles from "../../components/render-inlined-styles";
|
|
6
7
|
import { TARGET } from "../../constants/target.js";
|
|
7
8
|
import { convertStyleMapToCSS } from "../../helpers/css";
|
|
9
|
+
import BuilderContext from "../../context/builder.context.js";
|
|
8
10
|
|
|
9
11
|
export default function Columns(props) {
|
|
10
12
|
function getGutterSize() {
|
|
@@ -58,7 +60,7 @@ export default function Columns(props) {
|
|
|
58
60
|
|
|
59
61
|
function getWidthForBreakpointSize(size) {
|
|
60
62
|
const breakpointSizes = getSizesForBreakpoints(
|
|
61
|
-
|
|
63
|
+
builderContext.content?.meta?.breakpoints || {}
|
|
62
64
|
);
|
|
63
65
|
return breakpointSizes[size].max;
|
|
64
66
|
}
|
|
@@ -120,6 +122,8 @@ export default function Columns(props) {
|
|
|
120
122
|
return columnStyleObjects.column.small;
|
|
121
123
|
}
|
|
122
124
|
|
|
125
|
+
const builderContext = useContext(BuilderContext);
|
|
126
|
+
|
|
123
127
|
return (
|
|
124
128
|
<View style={styles.view1}>
|
|
125
129
|
{TARGET !== "reactNative" ? (
|
|
@@ -2,7 +2,6 @@ import { serializeFn } from "../util.js";
|
|
|
2
2
|
const componentInfo = {
|
|
3
3
|
name: "Image",
|
|
4
4
|
static: true,
|
|
5
|
-
builtIn: true,
|
|
6
5
|
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",
|
|
7
6
|
defaultStyles: {
|
|
8
7
|
position: "relative",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const componentInfo = {
|
|
2
2
|
name: "Raw:Img",
|
|
3
3
|
hideFromInsertMenu: true,
|
|
4
|
-
builtIn: true,
|
|
5
4
|
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",
|
|
6
5
|
inputs: [
|
|
7
6
|
{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const componentInfo = {
|
|
2
2
|
name: "Text",
|
|
3
3
|
static: true,
|
|
4
|
-
builtIn: true,
|
|
5
4
|
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",
|
|
6
5
|
inputs: [
|
|
7
6
|
{
|