@builder.io/sdk-react-native 0.0.1-6 → 0.0.1-62

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 (138) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +19 -0
  3. package/package.json +6 -4
  4. package/src/blocks/button/button.js +31 -0
  5. package/src/blocks/button/component-info.js +42 -0
  6. package/src/blocks/columns/columns.js +59 -0
  7. package/src/blocks/columns/component-info.js +242 -0
  8. package/src/blocks/custom-code/component-info.js +32 -0
  9. package/src/blocks/{custom-code.lite.tsx → custom-code/custom-code.js} +16 -33
  10. package/src/blocks/embed/component-info.js +44 -0
  11. package/src/blocks/embed/embed.js +43 -0
  12. package/src/blocks/embed/helpers.js +10 -0
  13. package/src/blocks/form/component-info.js +263 -0
  14. package/src/blocks/form/form.js +221 -0
  15. package/src/blocks/fragment/component-info.js +12 -0
  16. package/src/blocks/fragment/fragment.js +8 -0
  17. package/src/blocks/image/component-info.js +151 -0
  18. package/src/blocks/image/image.helpers.js +49 -0
  19. package/src/blocks/image/image.js +41 -0
  20. package/src/blocks/img/component-info.js +21 -0
  21. package/src/blocks/img/img.js +36 -0
  22. package/src/blocks/input/component-info.js +75 -0
  23. package/src/blocks/input/input.js +36 -0
  24. package/src/blocks/raw-text/component-info.js +17 -0
  25. package/src/blocks/raw-text/raw-text.js +10 -0
  26. package/src/blocks/section/component-info.js +50 -0
  27. package/src/blocks/section/section.js +31 -0
  28. package/src/blocks/select/component-info.js +60 -0
  29. package/src/blocks/select/select.js +36 -0
  30. package/src/blocks/submit-button/component-info.js +29 -0
  31. package/src/blocks/submit-button/submit-button.js +29 -0
  32. package/src/blocks/symbol/component-info.js +44 -0
  33. package/src/blocks/symbol/symbol.js +69 -0
  34. package/src/blocks/{text.js → text/component-info.js} +4 -10
  35. package/src/blocks/text/text.js +65 -0
  36. package/src/blocks/textarea/component-info.js +48 -0
  37. package/src/blocks/textarea/textarea.js +32 -0
  38. package/src/blocks/video/component-info.js +107 -0
  39. package/src/blocks/video/video.js +33 -0
  40. package/src/components/render-block/block-styles.js +40 -0
  41. package/src/components/render-block/render-block.helpers.js +24 -0
  42. package/src/components/render-block/render-block.js +169 -0
  43. package/src/components/render-block/render-component.js +33 -0
  44. package/src/components/render-block/render-repeated-block.js +29 -0
  45. package/src/components/render-blocks.js +23 -12
  46. package/src/components/render-content/components/render-styles.js +58 -0
  47. package/src/components/render-content/index.js +5 -0
  48. package/src/components/render-content/render-content.js +254 -0
  49. package/src/components/render-inlined-styles.js +18 -0
  50. package/src/constants/builder-registered-components.js +43 -0
  51. package/src/constants/device-sizes.js +3 -21
  52. package/src/constants/target.js +5 -0
  53. package/src/context/builder.context.js +7 -1
  54. package/src/functions/camel-to-kebab-case.js +5 -0
  55. package/src/functions/convert-style-object.js +7 -0
  56. package/src/functions/evaluate.js +17 -8
  57. package/src/functions/event-handler-name.js +8 -0
  58. package/src/functions/get-block-actions.js +14 -13
  59. package/src/functions/get-block-component-options.js +22 -1
  60. package/src/functions/get-block-properties.js +2 -3
  61. package/src/functions/get-block-styles.js +9 -19
  62. package/src/functions/get-block-tag.js +1 -1
  63. package/src/functions/get-builder-search-params/fn.test.js +14 -0
  64. package/src/functions/get-builder-search-params/index.js +23 -0
  65. package/src/functions/get-content/ab-testing.js +39 -0
  66. package/src/functions/get-content/fn.test.js +32 -0
  67. package/src/functions/get-content/index.js +94 -0
  68. package/src/functions/get-content/types.js +1 -0
  69. package/src/functions/get-fetch.js +35 -0
  70. package/src/functions/get-global-this.js +19 -0
  71. package/src/functions/get-processed-block.js +18 -9
  72. package/src/functions/get-processed-block.test.js +14 -8
  73. package/src/functions/if-target.js +11 -2
  74. package/src/functions/is-browser.js +1 -2
  75. package/src/functions/is-editing.js +1 -1
  76. package/src/functions/is-iframe.js +1 -1
  77. package/src/functions/is-previewing.js +15 -0
  78. package/src/functions/is-react-native.js +1 -1
  79. package/src/functions/on-change.test.js +1 -2
  80. package/src/functions/previewing-model-name.js +12 -0
  81. package/src/functions/register-component.js +46 -26
  82. package/src/functions/register.js +30 -0
  83. package/src/functions/sanitize-styles.js +33 -0
  84. package/src/functions/set-editor-settings.js +16 -0
  85. package/src/functions/set.test.js +1 -2
  86. package/src/functions/track.js +7 -3
  87. package/src/functions/transform-block.js +38 -0
  88. package/src/helpers/css.js +13 -0
  89. package/src/helpers/flatten.js +35 -0
  90. package/src/index-helpers/blocks-exports.js +19 -0
  91. package/src/index-helpers/top-of-file.js +2 -0
  92. package/src/index.js +10 -23
  93. package/src/scripts/init-editing.js +73 -49
  94. package/src/types/components.js +1 -0
  95. package/src/types/deep-partial.js +1 -0
  96. package/src/types/element.js +1 -0
  97. package/src/types/targets.js +1 -0
  98. package/src/types/typescript.js +1 -0
  99. package/index.js +0 -11
  100. package/src/blocks/button.js +0 -37
  101. package/src/blocks/button.lite.tsx +0 -29
  102. package/src/blocks/columns.js +0 -42
  103. package/src/blocks/columns.lite.tsx +0 -41
  104. package/src/blocks/custom-code.js +0 -56
  105. package/src/blocks/embed.js +0 -56
  106. package/src/blocks/embed.lite.tsx +0 -65
  107. package/src/blocks/form.js +0 -229
  108. package/src/blocks/form.lite.tsx +0 -257
  109. package/src/blocks/image.js +0 -123
  110. package/src/blocks/image.lite.tsx +0 -35
  111. package/src/blocks/img.js +0 -41
  112. package/src/blocks/img.lite.tsx +0 -19
  113. package/src/blocks/input.js +0 -41
  114. package/src/blocks/input.lite.tsx +0 -23
  115. package/src/blocks/raw-text.js +0 -17
  116. package/src/blocks/raw-text.lite.tsx +0 -12
  117. package/src/blocks/section.js +0 -36
  118. package/src/blocks/section.lite.tsx +0 -20
  119. package/src/blocks/select.js +0 -40
  120. package/src/blocks/select.lite.tsx +0 -24
  121. package/src/blocks/submit-button.js +0 -34
  122. package/src/blocks/submit-button.lite.tsx +0 -11
  123. package/src/blocks/symbol.js +0 -20
  124. package/src/blocks/symbol.lite.tsx +0 -20
  125. package/src/blocks/text.lite.tsx +0 -12
  126. package/src/blocks/textarea.js +0 -37
  127. package/src/blocks/textarea.lite.tsx +0 -15
  128. package/src/blocks/video.js +0 -49
  129. package/src/blocks/video.lite.tsx +0 -28
  130. package/src/components/render-block.js +0 -84
  131. package/src/components/render-block.lite.tsx +0 -92
  132. package/src/components/render-blocks.lite.tsx +0 -56
  133. package/src/components/render-content.js +0 -66
  134. package/src/components/render-content.lite.tsx +0 -95
  135. package/src/functions/get-content.js +0 -103
  136. package/src/functions/get-target.js +0 -7
  137. package/src/functions/macro-eval.js +0 -6
  138. package/src/package.json +0 -18
@@ -0,0 +1,41 @@
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
+ };
18
+ import { Image as ReactImage, View } from "react-native";
19
+ function Image(props) {
20
+ return props.aspectRatio ? /* @__PURE__ */ React.createElement(View, {
21
+ style: { position: "relative" }
22
+ }, /* @__PURE__ */ React.createElement(ReactImage, {
23
+ resizeMode: props.backgroundSize || "contain",
24
+ style: { position: "absolute", top: 0, bottom: 0, left: 0, right: 0 },
25
+ source: { uri: props.image }
26
+ }), /* @__PURE__ */ React.createElement(View, {
27
+ style: {
28
+ width: "100%",
29
+ paddingTop: props.aspectRatio * 100 + "%"
30
+ }
31
+ })) : /* @__PURE__ */ React.createElement(ReactImage, {
32
+ resizeMode: props.backgroundSize || "contain",
33
+ style: __spreadValues(__spreadValues({
34
+ position: "relative"
35
+ }, props.width ? { width: props.width } : {}), props.height ? { height: props.height } : {}),
36
+ source: { uri: props.image }
37
+ });
38
+ }
39
+ export {
40
+ Image as default
41
+ };
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Raw:Img",
4
+ hideFromInsertMenu: true,
5
+ builtIn: true,
6
+ 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
+ inputs: [
8
+ {
9
+ name: "image",
10
+ bubble: true,
11
+ type: "file",
12
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
13
+ required: true
14
+ }
15
+ ],
16
+ noWrap: true,
17
+ static: true
18
+ };
19
+ export {
20
+ componentInfo
21
+ };
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View } from "react-native";
22
+ import { isEditing } from "../../functions/is-editing.js";
23
+ function ImgComponent(props) {
24
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
25
+ style: {
26
+ objectFit: props.backgroundSize || "cover",
27
+ objectPosition: props.backgroundPosition || "center"
28
+ },
29
+ key: isEditing() && props.imgSrc || "default-key",
30
+ alt: props.altText,
31
+ src: props.imgSrc
32
+ }));
33
+ }
34
+ export {
35
+ ImgComponent as default
36
+ };
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Form:Input",
4
+ builtIn: true,
5
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6
+ inputs: [
7
+ {
8
+ name: "type",
9
+ type: "text",
10
+ enum: [
11
+ "text",
12
+ "number",
13
+ "email",
14
+ "url",
15
+ "checkbox",
16
+ "radio",
17
+ "range",
18
+ "date",
19
+ "datetime-local",
20
+ "search",
21
+ "tel",
22
+ "time",
23
+ "file",
24
+ "month",
25
+ "week",
26
+ "password",
27
+ "color",
28
+ "hidden"
29
+ ],
30
+ defaultValue: "text"
31
+ },
32
+ {
33
+ name: "name",
34
+ type: "string",
35
+ required: true,
36
+ helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
37
+ },
38
+ {
39
+ name: "placeholder",
40
+ type: "string",
41
+ defaultValue: "Hello there",
42
+ helperText: "Text to display when there is no value"
43
+ },
44
+ {
45
+ name: "defaultValue",
46
+ type: "string"
47
+ },
48
+ {
49
+ name: "value",
50
+ type: "string",
51
+ advanced: true
52
+ },
53
+ {
54
+ name: "required",
55
+ type: "boolean",
56
+ helperText: "Is this input required to be filled out to submit a form",
57
+ defaultValue: false
58
+ }
59
+ ],
60
+ noWrap: true,
61
+ static: true,
62
+ defaultStyles: {
63
+ paddingTop: "10px",
64
+ paddingBottom: "10px",
65
+ paddingLeft: "10px",
66
+ paddingRight: "10px",
67
+ borderRadius: "3px",
68
+ borderWidth: "1px",
69
+ borderStyle: "solid",
70
+ borderColor: "#ccc"
71
+ }
72
+ };
73
+ export {
74
+ componentInfo
75
+ };
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View } from "react-native";
22
+ import { isEditing } from "../../functions/is-editing.js";
23
+ function FormInputComponent(props) {
24
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
25
+ key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
26
+ placeholder: props.placeholder,
27
+ type: props.type,
28
+ name: props.name,
29
+ value: props.value,
30
+ defaultValue: props.defaultValue,
31
+ required: props.required
32
+ }));
33
+ }
34
+ export {
35
+ FormInputComponent as default
36
+ };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Builder:RawText",
4
+ hideFromInsertMenu: true,
5
+ builtIn: true,
6
+ inputs: [
7
+ {
8
+ name: "text",
9
+ bubble: true,
10
+ type: "longText",
11
+ required: true
12
+ }
13
+ ]
14
+ };
15
+ export {
16
+ componentInfo
17
+ };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { View } from "react-native";
3
+ function RawText(props) {
4
+ return /* @__PURE__ */ React.createElement(View, {
5
+ dangerouslySetInnerHTML: { __html: props.text || "" }
6
+ });
7
+ }
8
+ export {
9
+ RawText as default
10
+ };
@@ -0,0 +1,50 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Core:Section",
4
+ static: true,
5
+ builtIn: true,
6
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
7
+ inputs: [
8
+ {
9
+ name: "maxWidth",
10
+ type: "number",
11
+ defaultValue: 1200
12
+ },
13
+ {
14
+ name: "lazyLoad",
15
+ type: "boolean",
16
+ defaultValue: false,
17
+ advanced: true,
18
+ description: "Only render this section when in view"
19
+ }
20
+ ],
21
+ defaultStyles: {
22
+ paddingLeft: "20px",
23
+ paddingRight: "20px",
24
+ paddingTop: "50px",
25
+ paddingBottom: "50px",
26
+ marginTop: "0px",
27
+ width: "100vw",
28
+ marginLeft: "calc(50% - 50vw)"
29
+ },
30
+ canHaveChildren: true,
31
+ defaultChildren: [
32
+ {
33
+ "@type": "@builder.io/sdk:Element",
34
+ responsiveStyles: {
35
+ large: {
36
+ textAlign: "center"
37
+ }
38
+ },
39
+ component: {
40
+ name: "Text",
41
+ options: {
42
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
43
+ }
44
+ }
45
+ }
46
+ ]
47
+ };
48
+ export {
49
+ componentInfo
50
+ };
@@ -0,0 +1,31 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View, Text } from "react-native";
22
+ function SectionComponent(props) {
23
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
24
+ style: props.maxWidth && typeof props.maxWidth === "number" ? {
25
+ maxWidth: props.maxWidth
26
+ } : void 0
27
+ }), /* @__PURE__ */ React.createElement(Text, null, props.children));
28
+ }
29
+ export {
30
+ SectionComponent as default
31
+ };
@@ -0,0 +1,60 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Form:Select",
4
+ builtIn: true,
5
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6
+ defaultStyles: {
7
+ alignSelf: "flex-start"
8
+ },
9
+ inputs: [
10
+ {
11
+ name: "options",
12
+ type: "list",
13
+ required: true,
14
+ subFields: [
15
+ {
16
+ name: "value",
17
+ type: "text",
18
+ required: true
19
+ },
20
+ {
21
+ name: "name",
22
+ type: "text"
23
+ }
24
+ ],
25
+ defaultValue: [
26
+ {
27
+ value: "option 1"
28
+ },
29
+ {
30
+ value: "option 2"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ name: "name",
36
+ type: "string",
37
+ required: true,
38
+ helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
39
+ },
40
+ {
41
+ name: "defaultValue",
42
+ type: "string"
43
+ },
44
+ {
45
+ name: "value",
46
+ type: "string",
47
+ advanced: true
48
+ },
49
+ {
50
+ name: "required",
51
+ type: "boolean",
52
+ defaultValue: false
53
+ }
54
+ ],
55
+ static: true,
56
+ noWrap: true
57
+ };
58
+ export {
59
+ componentInfo
60
+ };
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View, Text } from "react-native";
22
+ import { isEditing } from "../../functions/is-editing.js";
23
+ function SelectComponent(props) {
24
+ var _a;
25
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
26
+ value: props.value,
27
+ key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
28
+ defaultValue: props.defaultValue,
29
+ name: props.name
30
+ }), (_a = props.options) == null ? void 0 : _a.map((option) => /* @__PURE__ */ React.createElement(View, {
31
+ value: option.value
32
+ }, /* @__PURE__ */ React.createElement(Text, null, option.name || option.value))));
33
+ }
34
+ export {
35
+ SelectComponent as default
36
+ };
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Form:SubmitButton",
4
+ builtIn: true,
5
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6
+ defaultStyles: {
7
+ appearance: "none",
8
+ paddingTop: "15px",
9
+ paddingBottom: "15px",
10
+ paddingLeft: "25px",
11
+ paddingRight: "25px",
12
+ backgroundColor: "#3898EC",
13
+ color: "white",
14
+ borderRadius: "4px",
15
+ cursor: "pointer"
16
+ },
17
+ inputs: [
18
+ {
19
+ name: "text",
20
+ type: "text",
21
+ defaultValue: "Click me"
22
+ }
23
+ ],
24
+ static: true,
25
+ noWrap: true
26
+ };
27
+ export {
28
+ componentInfo
29
+ };
@@ -0,0 +1,29 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View, Text } from "react-native";
22
+ function SubmitButton(props) {
23
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
24
+ type: "submit"
25
+ }), /* @__PURE__ */ React.createElement(Text, null, props.text));
26
+ }
27
+ export {
28
+ SubmitButton as default
29
+ };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ const componentInfo = {
3
+ name: "Symbol",
4
+ noWrap: true,
5
+ static: true,
6
+ builtIn: true,
7
+ inputs: [
8
+ {
9
+ name: "symbol",
10
+ type: "uiSymbol"
11
+ },
12
+ {
13
+ name: "dataOnly",
14
+ helperText: "Make this a data symbol that doesn't display any UI",
15
+ type: "boolean",
16
+ defaultValue: false,
17
+ advanced: true,
18
+ hideFromUI: true
19
+ },
20
+ {
21
+ name: "inheritState",
22
+ helperText: "Inherit the parent component state and data",
23
+ type: "boolean",
24
+ defaultValue: false,
25
+ advanced: true
26
+ },
27
+ {
28
+ name: "renderToLiquid",
29
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
30
+ type: "boolean",
31
+ defaultValue: false,
32
+ advanced: true,
33
+ hideFromUI: true
34
+ },
35
+ {
36
+ name: "useChildren",
37
+ hideFromUI: true,
38
+ type: "boolean"
39
+ }
40
+ ]
41
+ };
42
+ export {
43
+ componentInfo
44
+ };
@@ -0,0 +1,69 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { View } from "react-native";
22
+ import { useState, useContext, useEffect } from "react";
23
+ import RenderContent from "../../components/render-content/render-content.js";
24
+ import BuilderContext from "../../context/builder.context";
25
+ import { getContent } from "../../functions/get-content/index.js";
26
+ function Symbol(props) {
27
+ var _a, _b, _c, _d, _e, _f, _g, _h;
28
+ const [className, setClassName] = useState(() => "builder-symbol");
29
+ const [content, setContent] = useState(() => null);
30
+ const builderContext = useContext(BuilderContext);
31
+ useEffect(() => {
32
+ var _a2;
33
+ setContent((_a2 = props.symbol) == null ? void 0 : _a2.content);
34
+ }, []);
35
+ useEffect(() => {
36
+ const symbolToUse = props.symbol;
37
+ if (symbolToUse && !symbolToUse.content && !content && symbolToUse.model) {
38
+ getContent({
39
+ model: symbolToUse.model,
40
+ apiKey: builderContext.apiKey,
41
+ query: {
42
+ id: symbolToUse.entry
43
+ }
44
+ }).then((response) => {
45
+ setContent(response);
46
+ });
47
+ }
48
+ }, [
49
+ (_a = props.symbol) == null ? void 0 : _a.content,
50
+ (_b = props.symbol) == null ? void 0 : _b.model,
51
+ (_c = props.symbol) == null ? void 0 : _c.entry,
52
+ content
53
+ ]);
54
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, props.attributes), {
55
+ dataSet: {
56
+ class: className
57
+ }
58
+ }), /* @__PURE__ */ React.createElement(RenderContent, {
59
+ apiKey: builderContext.apiKey,
60
+ context: builderContext.context,
61
+ customComponents: Object.values(builderContext.registeredComponents),
62
+ data: __spreadValues(__spreadValues(__spreadValues({}, (_d = props.symbol) == null ? void 0 : _d.data), builderContext.state), (_g = (_f = (_e = props.symbol) == null ? void 0 : _e.content) == null ? void 0 : _f.data) == null ? void 0 : _g.state),
63
+ model: (_h = props.symbol) == null ? void 0 : _h.model,
64
+ content
65
+ }));
66
+ }
67
+ export {
68
+ Symbol as default
69
+ };
@@ -1,14 +1,8 @@
1
1
  import * as React from 'react';
2
- import HTML from "react-native-render-html";
3
- import { registerComponent } from "../functions/register-component";
4
- function Text(props) {
5
- return /* @__PURE__ */ React.createElement(HTML, {
6
- source: { html: props.text }
7
- });
8
- }
9
- registerComponent(Text, {
2
+ const componentInfo = {
10
3
  name: "Text",
11
4
  static: true,
5
+ builtIn: true,
12
6
  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",
13
7
  inputs: [
14
8
  {
@@ -25,7 +19,7 @@ registerComponent(Text, {
25
19
  height: "auto",
26
20
  textAlign: "center"
27
21
  }
28
- });
22
+ };
29
23
  export {
30
- Text as default
24
+ componentInfo
31
25
  };