@builder.io/sdk-react-native 0.1.8 → 0.1.10-0

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.
@@ -33,11 +33,9 @@ function SectionComponent(props) {
33
33
  return (React.createElement(react_native_1.View, { ...props.attributes, style: {
34
34
  width: "100%",
35
35
  alignSelf: "stretch",
36
- flexGrow: "1",
36
+ flexGrow: 1,
37
37
  boxSizing: "border-box",
38
- maxWidth: `${props.maxWidth && typeof props.maxWidth === "number"
39
- ? props.maxWidth
40
- : 1200}px`,
38
+ maxWidth: props.maxWidth || 1200,
41
39
  display: "flex",
42
40
  flexDirection: "column",
43
41
  alignItems: "stretch",
@@ -64,13 +64,17 @@ function RenderBlocks(props) {
64
64
  }
65
65
  }
66
66
  const builderContext = (0, react_1.useContext)(builder_context_js_1.default);
67
- return (React.createElement(react_native_1.View, { "builder-path": props.path, "builder-parent-id": props.parent, dataSet: {
67
+ return (React.createElement(react_native_1.ScrollView, { "builder-path": props.path, "builder-parent-id": props.parent, dataSet: {
68
68
  class: className(),
69
- }, style: styles.view1, onClick: (event) => onClick(), onMouseEnter: (event) => onMouseEnter() },
69
+ }, style: styles.scrollView1, onClick: (event) => onClick(), onMouseEnter: (event) => onMouseEnter() },
70
70
  props.blocks ? (React.createElement(React.Fragment, null, (_a = props.blocks) === null || _a === void 0 ? void 0 : _a.map((block) => (React.createElement(render_block_1.default, { key: "render-block-" + block.id, block: block, context: builderContext }))))) : null,
71
71
  props.blocks ? (React.createElement(React.Fragment, null, (_b = props.blocks) === null || _b === void 0 ? void 0 : _b.map((block) => (React.createElement(block_styles_1.default, { key: "block-style-" + block.id, block: block, context: builderContext }))))) : null));
72
72
  }
73
73
  exports.default = RenderBlocks;
74
74
  const styles = react_native_1.StyleSheet.create({
75
- view1: { display: "flex", flexDirection: "column", alignItems: "stretch" },
75
+ scrollView1: {
76
+ display: "flex",
77
+ flexDirection: "column",
78
+ alignItems: "stretch",
79
+ },
76
80
  });
@@ -317,7 +317,7 @@ function RenderContent(props) {
317
317
  apiKey: props.apiKey,
318
318
  registeredComponents: allRegisteredComponents,
319
319
  } }, useContent ? (React.createElement(React.Fragment, null,
320
- React.createElement(react_native_1.View, { ref: elementRef, onClick: (event) => onClick(event), "builder-content-id": useContent === null || useContent === void 0 ? void 0 : useContent.id, "builder-model": props.model },
320
+ React.createElement(react_native_1.ScrollView, { ref: elementRef, onClick: (event) => onClick(event), "builder-content-id": useContent === null || useContent === void 0 ? void 0 : useContent.id, "builder-model": props.model },
321
321
  shouldRenderContentStyles() ? (React.createElement(render_styles_1.default, { contentId: useContent === null || useContent === void 0 ? void 0 : useContent.id, cssCode: (_c = useContent === null || useContent === void 0 ? void 0 : useContent.data) === null || _c === void 0 ? void 0 : _c.cssCode, customFonts: (_d = useContent === null || useContent === void 0 ? void 0 : useContent.data) === null || _d === void 0 ? void 0 : _d.customFonts })) : null,
322
322
  React.createElement(render_blocks_1.default, { blocks: (_e = useContent === null || useContent === void 0 ? void 0 : useContent.data) === null || _e === void 0 ? void 0 : _e.blocks, key: forceReRenderCount })))) : null));
323
323
  }
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.8",
4
+ "version": "0.1.10-0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
 
5
12
  export default function Button(props) {
6
13
  return (
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useContext } from "react";
4
11
  import RenderBlocks from "../../components/render-blocks";
5
12
  import { getSizesForBreakpoints } from "../../constants/device-sizes";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState, useRef, useEffect } from "react";
4
11
 
5
12
  export default function CustomCode(props) {
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState, useRef, useEffect } from "react";
4
11
  import { isJsScript } from "./helpers.js";
5
12
 
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
  import { useState, useContext, useRef } from "react";
5
12
  import RenderBlock from "../../components/render-block/render-block";
6
13
  import BuilderBlocks from "../../components/render-blocks";
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
 
5
12
  export default function FragmentComponent(props) {
6
13
  return (
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { isEditing } from "../../functions/is-editing.js";
4
11
 
5
12
  export default function ImgComponent(props) {
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { isEditing } from "../../functions/is-editing.js";
4
11
 
5
12
  export default function FormInputComponent(props) {
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
 
4
11
  export default function RawText(props) {
5
12
  return <View dangerouslySetInnerHTML={{ __html: props.text || "" }} />;
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
 
5
12
  export default function SectionComponent(props) {
6
13
  return (
@@ -9,13 +16,9 @@ export default function SectionComponent(props) {
9
16
  style={{
10
17
  width: "100%",
11
18
  alignSelf: "stretch",
12
- flexGrow: "1",
19
+ flexGrow: 1,
13
20
  boxSizing: "border-box",
14
- maxWidth: `${
15
- props.maxWidth && typeof props.maxWidth === "number"
16
- ? props.maxWidth
17
- : 1200
18
- }px`,
21
+ maxWidth: props.maxWidth || 1200,
19
22
  display: "flex",
20
23
  flexDirection: "column",
21
24
  alignItems: "stretch",
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
  import { isEditing } from "../../functions/is-editing.js";
5
12
 
6
13
  export default function SelectComponent(props) {
@@ -1,6 +1,13 @@
1
1
  import BaseText from "../BaseText";
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Image, Text } from "react-native";
3
+ import {
4
+ FlatList,
5
+ ScrollView,
6
+ View,
7
+ StyleSheet,
8
+ Image,
9
+ Text,
10
+ } from "react-native";
4
11
 
5
12
  export default function SubmitButton(props) {
6
13
  return (
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState, useContext, useEffect } from "react";
4
11
  import RenderContent from "../../components/render-content/render-content";
5
12
  import BuilderContext from "../../context/builder.context.js";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
 
4
11
  export default function Textarea(props) {
5
12
  return (
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import {
4
11
  getMaxWidthQueryForSize,
5
12
  getSizesForBreakpoints,
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState } from "react";
4
11
  import { getBlockActions } from "../../functions/get-block-actions.js";
5
12
  import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useContext } from "react";
4
11
  import BlockStyles from "./block-styles";
5
12
  import RenderBlock from "./render-block";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useContext } from "react";
4
11
  import BuilderContext from "../../context/builder.context.js";
5
12
  import RenderBlock from "./render-block";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useContext } from "react";
4
11
  import BuilderContext from "../context/builder.context.js";
5
12
  import { isEditing } from "../functions/is-editing.js";
@@ -44,13 +51,13 @@ export default function RenderBlocks(props) {
44
51
  const builderContext = useContext(BuilderContext);
45
52
 
46
53
  return (
47
- <View
54
+ <ScrollView
48
55
  builder-path={props.path}
49
56
  builder-parent-id={props.parent}
50
57
  dataSet={{
51
58
  class: className(),
52
59
  }}
53
- style={styles.view1}
60
+ style={styles.scrollView1}
54
61
  onClick={(event) => onClick()}
55
62
  onMouseEnter={(event) => onMouseEnter()}
56
63
  >
@@ -77,10 +84,14 @@ export default function RenderBlocks(props) {
77
84
  ))}
78
85
  </>
79
86
  ) : null}
80
- </View>
87
+ </ScrollView>
81
88
  );
82
89
  }
83
90
 
84
91
  const styles = StyleSheet.create({
85
- view1: { display: "flex", flexDirection: "column", alignItems: "stretch" },
92
+ scrollView1: {
93
+ display: "flex",
94
+ flexDirection: "column",
95
+ alignItems: "stretch",
96
+ },
86
97
  });
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
 
4
11
  export default function BuilderEditing(props) {
5
12
  return <View />;
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState } from "react";
4
11
  import RenderInlinedStyles from "../../render-inlined-styles";
5
12
  import { getCss } from "./render-styles.helpers";
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { useState, useContext, useRef, useEffect } from "react";
4
11
  import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
5
12
  import { TARGET } from "../../constants/target.js";
@@ -356,7 +363,7 @@ export default function RenderContent(props) {
356
363
  >
357
364
  {useContent ? (
358
365
  <>
359
- <View
366
+ <ScrollView
360
367
  ref={elementRef}
361
368
  onClick={(event) => onClick(event)}
362
369
  builder-content-id={useContent?.id}
@@ -374,7 +381,7 @@ export default function RenderContent(props) {
374
381
  blocks={useContent?.data?.blocks}
375
382
  key={forceReRenderCount}
376
383
  />
377
- </View>
384
+ </ScrollView>
378
385
  </>
379
386
  ) : null}
380
387
  </builderContext.Provider>
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Image, Text } from "react-native";
2
+ import {
3
+ FlatList,
4
+ ScrollView,
5
+ View,
6
+ StyleSheet,
7
+ Image,
8
+ Text,
9
+ } from "react-native";
3
10
  import { TARGET } from "../constants/target.js";
4
11
 
5
12
  export default function RenderInlinedStyles(props) {