@builder.io/sdk-react-native 0.0.1-51 → 0.0.1-54
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
### 0.0.1-51
|
|
2
|
+
|
|
3
|
+
⚠️ Deprecation notice: Registering components via `registerComponent(component, info)` is now deprecated.
|
|
4
|
+
To register your custom components in Builder, you must now provide a `customComponents` array to the `RenderContent` component containing `[{ component, info }]`.
|
|
5
|
+
See [builder-registered-components.ts](/packages/sdks/src/constants/builder-registered-components.ts) for examples of how to do so, or see the example provided for this SDK.
|
|
6
|
+
|
|
1
7
|
### 0.0.1-50
|
|
2
8
|
|
|
3
9
|
- feat: 🎸 export `isPreviewing()` (https://github.com/BuilderIO/builder/pull/951)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-native",
|
|
3
3
|
"description": "Builder.io SDK for React Native",
|
|
4
|
-
"version": "0.0.1-
|
|
4
|
+
"version": "0.0.1-54",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
@@ -86,7 +86,7 @@ function RenderContent(props) {
|
|
|
86
86
|
...components,
|
|
87
87
|
...props.customComponents || []
|
|
88
88
|
];
|
|
89
|
-
const allComponents = allComponentsArray.reduce((acc, curr) => __spreadProps(__spreadValues({}, acc), { [curr.
|
|
89
|
+
const allComponents = allComponentsArray.reduce((acc, curr) => __spreadProps(__spreadValues({}, acc), { [curr.name]: curr }), {});
|
|
90
90
|
return allComponents;
|
|
91
91
|
}
|
|
92
92
|
function processMessage(event) {
|
|
@@ -58,7 +58,7 @@ export default function RenderContent(props) {
|
|
|
58
58
|
...(props.customComponents || []),
|
|
59
59
|
];
|
|
60
60
|
const allComponents = allComponentsArray.reduce(
|
|
61
|
-
(acc, curr) => ({ ...acc, [curr.
|
|
61
|
+
(acc, curr) => ({ ...acc, [curr.name]: curr }),
|
|
62
62
|
{}
|
|
63
63
|
);
|
|
64
64
|
return allComponents;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
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) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
2
18
|
import { default as Button } from "../blocks/button/button.js";
|
|
3
19
|
import { componentInfo as buttonComponentInfo } from "../blocks/button/component-info";
|
|
4
20
|
import { default as Columns } from "../blocks/columns/columns.js";
|
|
@@ -14,13 +30,13 @@ import { default as Symbol } from "../blocks/symbol/symbol.js";
|
|
|
14
30
|
import { componentInfo as textComponentInfo } from "../blocks/text/component-info";
|
|
15
31
|
import { default as Text } from "../blocks/text/text.js";
|
|
16
32
|
const getDefaultRegisteredComponents = () => [
|
|
17
|
-
{ component: Columns,
|
|
18
|
-
{ component: Image,
|
|
19
|
-
{ component: Text,
|
|
20
|
-
{ component: Symbol,
|
|
21
|
-
{ component: Button,
|
|
22
|
-
{ component: Section,
|
|
23
|
-
{ component: Fragment,
|
|
33
|
+
__spreadValues({ component: Columns }, columnsComponentInfo),
|
|
34
|
+
__spreadValues({ component: Image }, imageComponentInfo),
|
|
35
|
+
__spreadValues({ component: Text }, textComponentInfo),
|
|
36
|
+
__spreadValues({ component: Symbol }, symbolComponentInfo),
|
|
37
|
+
__spreadValues({ component: Button }, buttonComponentInfo),
|
|
38
|
+
__spreadValues({ component: Section }, sectionComponentInfo),
|
|
39
|
+
__spreadValues({ component: Fragment }, fragmentComponentInfo)
|
|
24
40
|
];
|
|
25
41
|
export {
|
|
26
42
|
getDefaultRegisteredComponents
|
|
@@ -18,19 +18,36 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
21
33
|
import { fastClone } from "./fast-clone.js";
|
|
22
34
|
const components = [];
|
|
23
35
|
function registerComponent(component, info) {
|
|
24
|
-
components.push({ component, info
|
|
36
|
+
components.push(__spreadValues({ component }, info));
|
|
25
37
|
console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
|
|
26
38
|
return component;
|
|
27
39
|
}
|
|
28
|
-
const createRegisterComponentMessage = ({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
const createRegisterComponentMessage = (_a) => {
|
|
41
|
+
var _b = _a, {
|
|
42
|
+
component
|
|
43
|
+
} = _b, info = __objRest(_b, [
|
|
44
|
+
"component"
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
type: "builder.registerComponent",
|
|
48
|
+
data: prepareComponentInfoToSend(fastClone(info))
|
|
49
|
+
};
|
|
50
|
+
};
|
|
34
51
|
function prepareComponentInfoToSend(info) {
|
|
35
52
|
return __spreadValues(__spreadValues({}, info), info.inputs && {
|
|
36
53
|
inputs: info.inputs.map((input) => {
|