@builder.io/sdk-react-native 0.0.1-52 → 0.0.1-55

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,8 @@
1
+ ### 0.0.1-52
2
+
3
+ 🧨 Breaking change: the format of the `customComponents` prop has changed from `[{ component, info }]` to `[{ component, ...info }]`.
4
+ 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.
5
+
1
6
  ### 0.0.1-51
2
7
 
3
8
  ⚠️ Deprecation notice: Registering components via `registerComponent(component, info)` is now deprecated.
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-52",
4
+ "version": "0.0.1-55",
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"
@@ -11,7 +11,7 @@ export default function Image(props) {
11
11
  role={props.altText ? "presentation" : undefined}
12
12
  style={styles.view2}
13
13
  src={props.image}
14
- srcset={props.srcset}
14
+ srcSet={props.srcset}
15
15
  sizes={props.sizes}
16
16
  />
17
17
 
@@ -3,6 +3,7 @@ const componentInfo = {
3
3
  name: "Symbol",
4
4
  noWrap: true,
5
5
  static: true,
6
+ builtIn: true,
6
7
  inputs: [
7
8
  {
8
9
  name: "symbol",
@@ -17,6 +17,18 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
20
32
  import * as React from "react";
21
33
  import { useContext } from "react";
22
34
  import { TARGET } from "../../constants/target.js";
@@ -48,8 +60,12 @@ function RenderBlock(props) {
48
60
  }
49
61
  }
50
62
  function componentInfo() {
51
- var _a2;
52
- return (_a2 = component == null ? void 0 : component()) == null ? void 0 : _a2.info;
63
+ if (component()) {
64
+ const _a2 = component(), { component: _ } = _a2, info = __objRest(_a2, ["component"]);
65
+ return info;
66
+ } else {
67
+ return void 0;
68
+ }
53
69
  }
54
70
  function componentRef() {
55
71
  var _a2;
@@ -34,7 +34,12 @@ export default function RenderBlock(props) {
34
34
  }
35
35
 
36
36
  function componentInfo() {
37
- return component?.()?.info;
37
+ if (component()) {
38
+ const { component: _, ...info } = component();
39
+ return info;
40
+ } else {
41
+ return undefined;
42
+ }
38
43
  }
39
44
 
40
45
  function componentRef() {
@@ -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.info.name]: 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.info.name]: 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, info: columnsComponentInfo },
18
- { component: Image, info: imageComponentInfo },
19
- { component: Text, info: textComponentInfo },
20
- { component: Symbol, info: symbolComponentInfo },
21
- { component: Button, info: buttonComponentInfo },
22
- { component: Section, info: sectionComponentInfo },
23
- { component: Fragment, info: fragmentComponentInfo }
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
@@ -27,7 +27,7 @@ function validateReactNativeStyles(styles) {
27
27
  }
28
28
  delete styles[key];
29
29
  }
30
- if (typeof propertyValue === "string" && propertyValue.match(/^\-?\d/)) {
30
+ if (typeof propertyValue === "string" && propertyValue.match(/^-?\d/)) {
31
31
  const newValue = parseFloat(propertyValue);
32
32
  if (!isNaN(newValue)) {
33
33
  styles[key] = newValue;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- function macroEval(items, string) {
3
- }
4
- export {
5
- macroEval
6
- };