@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.
Files changed (39) hide show
  1. package/dist/blocks/button/component-info.js +0 -1
  2. package/dist/blocks/columns/columns.js +5 -1
  3. package/dist/blocks/columns/component-info.js +0 -1
  4. package/dist/blocks/custom-code/component-info.js +0 -1
  5. package/dist/blocks/embed/component-info.js +0 -1
  6. package/dist/blocks/form/component-info.js +0 -1
  7. package/dist/blocks/fragment/component-info.js +0 -1
  8. package/dist/blocks/image/component-info.js +0 -1
  9. package/dist/blocks/img/component-info.js +0 -1
  10. package/dist/blocks/input/component-info.js +0 -1
  11. package/dist/blocks/raw-text/component-info.js +0 -1
  12. package/dist/blocks/section/component-info.js +0 -1
  13. package/dist/blocks/select/component-info.js +0 -1
  14. package/dist/blocks/submit-button/component-info.js +0 -1
  15. package/dist/blocks/symbol/component-info.js +0 -1
  16. package/dist/blocks/text/component-info.js +0 -1
  17. package/dist/blocks/textarea/component-info.js +0 -1
  18. package/dist/blocks/video/component-info.js +0 -1
  19. package/dist/components/render-block/render-block.js +1 -2
  20. package/package.json +1 -1
  21. package/src/blocks/button/component-info.js +0 -1
  22. package/src/blocks/columns/columns.jsx +5 -1
  23. package/src/blocks/columns/component-info.js +0 -1
  24. package/src/blocks/custom-code/component-info.js +0 -1
  25. package/src/blocks/embed/component-info.js +0 -1
  26. package/src/blocks/form/component-info.js +0 -1
  27. package/src/blocks/fragment/component-info.js +0 -1
  28. package/src/blocks/image/component-info.js +0 -1
  29. package/src/blocks/img/component-info.js +0 -1
  30. package/src/blocks/input/component-info.js +0 -1
  31. package/src/blocks/raw-text/component-info.js +0 -1
  32. package/src/blocks/section/component-info.js +0 -1
  33. package/src/blocks/select/component-info.js +0 -1
  34. package/src/blocks/submit-button/component-info.js +0 -1
  35. package/src/blocks/symbol/component-info.js +0 -1
  36. package/src/blocks/text/component-info.js +0 -1
  37. package/src/blocks/textarea/component-info.js +0 -1
  38. package/src/blocks/video/component-info.js +0 -1
  39. 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
- const breakpointSizes = (0, device_sizes_1.getSizesForBreakpoints)(props.customBreakpoints || {});
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 :
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
4
4
  const util_js_1 = require("../util.js");
5
5
  const componentInfo = {
6
6
  name: "Columns",
7
- builtIn: true,
8
7
  inputs: [
9
8
  {
10
9
  name: "columns",
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
4
4
  const componentInfo = {
5
5
  name: "Custom Code",
6
6
  static: true,
7
- builtIn: true,
8
7
  requiredPermissions: ["editCode"],
9
8
  inputs: [
10
9
  {
@@ -5,7 +5,6 @@ const util_js_1 = require("../util.js");
5
5
  const componentInfo = {
6
6
  name: "Embed",
7
7
  static: true,
8
- builtIn: true,
9
8
  inputs: [
10
9
  {
11
10
  name: "url",
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.componentInfo = void 0;
4
4
  const componentInfo = {
5
5
  name: "Form:Form",
6
- builtIn: true,
7
6
  defaults: {
8
7
  responsiveStyles: {
9
8
  large: {
@@ -5,7 +5,6 @@ const componentInfo = {
5
5
  name: "Fragment",
6
6
  static: true,
7
7
  hidden: true,
8
- builtIn: true,
9
8
  canHaveChildren: true,
10
9
  noWrap: true
11
10
  };
@@ -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
  {
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
4
4
  const componentInfo = {
5
5
  name: "Builder:RawText",
6
6
  hideFromInsertMenu: true,
7
- builtIn: true,
8
7
  inputs: [
9
8
  {
10
9
  name: "text",
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
4
4
  const componentInfo = {
5
5
  name: "Core:Section",
6
6
  static: true,
7
- builtIn: true,
8
7
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
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: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",
@@ -5,7 +5,6 @@ const componentInfo = {
5
5
  name: "Symbol",
6
6
  noWrap: true,
7
7
  static: true,
8
- builtIn: true,
9
8
  inputs: [
10
9
  {
11
10
  name: "symbol",
@@ -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
  {
@@ -4,7 +4,6 @@ exports.componentInfo = void 0;
4
4
  const componentInfo = {
5
5
  name: "Video",
6
6
  canHaveChildren: true,
7
- builtIn: true,
8
7
  defaultStyles: {
9
8
  minHeight: "20px",
10
9
  minWidth: "20px"
@@ -100,7 +100,7 @@ function RenderBlock(props) {
100
100
  };
101
101
  }
102
102
  function renderComponentProps() {
103
- var _a, _b, _c, _d;
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,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.1.5",
4
+ "version": "0.1.7",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Core:Button",
3
- builtIn: true,
4
3
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
5
4
  defaultStyles: {
6
5
  appearance: "none",
@@ -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
- props.customBreakpoints || {}
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" ? (
@@ -1,7 +1,6 @@
1
1
  import { serializeFn } from "../util.js";
2
2
  const componentInfo = {
3
3
  name: "Columns",
4
- builtIn: true,
5
4
  inputs: [
6
5
  {
7
6
  name: "columns",
@@ -1,7 +1,6 @@
1
1
  const componentInfo = {
2
2
  name: "Custom Code",
3
3
  static: true,
4
- builtIn: true,
5
4
  requiredPermissions: ["editCode"],
6
5
  inputs: [
7
6
  {
@@ -2,7 +2,6 @@ import { serializeFn } from "../util.js";
2
2
  const componentInfo = {
3
3
  name: "Embed",
4
4
  static: true,
5
- builtIn: true,
6
5
  inputs: [
7
6
  {
8
7
  name: "url",
@@ -1,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Form:Form",
3
- builtIn: true,
4
3
  defaults: {
5
4
  responsiveStyles: {
6
5
  large: {
@@ -2,7 +2,6 @@ const componentInfo = {
2
2
  name: "Fragment",
3
3
  static: true,
4
4
  hidden: true,
5
- builtIn: true,
6
5
  canHaveChildren: true,
7
6
  noWrap: true
8
7
  };
@@ -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,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Form:Input",
3
- builtIn: true,
4
3
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
5
4
  inputs: [
6
5
  {
@@ -1,7 +1,6 @@
1
1
  const componentInfo = {
2
2
  name: "Builder:RawText",
3
3
  hideFromInsertMenu: true,
4
- builtIn: true,
5
4
  inputs: [
6
5
  {
7
6
  name: "text",
@@ -1,7 +1,6 @@
1
1
  const componentInfo = {
2
2
  name: "Core:Section",
3
3
  static: true,
4
- builtIn: true,
5
4
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
6
5
  inputs: [
7
6
  {
@@ -1,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Form:Select",
3
- builtIn: true,
4
3
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
5
4
  defaultStyles: {
6
5
  alignSelf: "flex-start"
@@ -1,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Form:SubmitButton",
3
- builtIn: true,
4
3
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
5
4
  defaultStyles: {
6
5
  appearance: "none",
@@ -2,7 +2,6 @@ const componentInfo = {
2
2
  name: "Symbol",
3
3
  noWrap: true,
4
4
  static: true,
5
- builtIn: true,
6
5
  inputs: [
7
6
  {
8
7
  name: "symbol",
@@ -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
  {
@@ -1,6 +1,5 @@
1
1
  const componentInfo = {
2
2
  name: "Form:TextArea",
3
- builtIn: true,
4
3
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
5
4
  inputs: [
6
5
  {
@@ -1,7 +1,6 @@
1
1
  const componentInfo = {
2
2
  name: "Video",
3
3
  canHaveChildren: true,
4
- builtIn: true,
5
4
  defaultStyles: {
6
5
  minHeight: "20px",
7
6
  minWidth: "20px"
@@ -103,7 +103,6 @@ export default function RenderBlock(props) {
103
103
  ...actions(),
104
104
  },
105
105
  }),
106
- customBreakpoints: childrenContext?.()?.content?.meta?.breakpoints,
107
106
  },
108
107
  context: childrenContext(),
109
108
  };