@builder.io/sdk-react 0.1.8 → 0.1.10
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/dist/react/blocks/BaseText.js +2 -1
- package/dist/react/blocks/button/button.js +2 -1
- package/dist/react/blocks/columns/columns.js +18 -17
- package/dist/react/blocks/custom-code/custom-code.js +2 -1
- package/dist/react/blocks/embed/embed.js +2 -1
- package/dist/react/blocks/form/form.js +3 -2
- package/dist/react/blocks/fragment/fragment.js +2 -1
- package/dist/react/blocks/image/component-info.js +1 -1
- package/dist/react/blocks/image/image.js +2 -1
- package/dist/react/blocks/img/img.js +2 -1
- package/dist/react/blocks/input/input.js +2 -1
- package/dist/react/blocks/raw-text/raw-text.js +2 -1
- package/dist/react/blocks/section/section.js +4 -5
- package/dist/react/blocks/select/select.js +2 -1
- package/dist/react/blocks/submit-button/submit-button.js +2 -1
- package/dist/react/blocks/symbol/symbol.js +2 -1
- package/dist/react/blocks/text/text.js +5 -2
- package/dist/react/blocks/textarea/textarea.js +2 -1
- package/dist/react/blocks/video/video.js +2 -1
- package/dist/react/components/render-block/block-styles.js +2 -1
- package/dist/react/components/render-block/render-block.js +2 -1
- package/dist/react/components/render-block/render-component.js +2 -1
- package/dist/react/components/render-block/render-repeated-block.js +2 -1
- package/dist/react/components/render-blocks.js +2 -1
- package/dist/react/components/render-content/builder-editing.js +2 -1
- package/dist/react/components/render-content/components/render-styles.js +15 -1
- package/dist/react/components/render-content/render-content.js +6 -8
- package/dist/react/components/render-inlined-styles.js +2 -1
- package/dist/react/functions/is-editing.js +2 -1
- package/dist/react/index.js +0 -1
- package/dist/rsc/blocks/BaseText.js +2 -1
- package/dist/rsc/blocks/button/button.js +2 -1
- package/dist/rsc/blocks/columns/columns.js +18 -17
- package/dist/rsc/blocks/custom-code/custom-code.js +2 -1
- package/dist/rsc/blocks/embed/embed.js +2 -1
- package/dist/rsc/blocks/form/form.js +3 -2
- package/dist/rsc/blocks/fragment/fragment.js +2 -1
- package/dist/rsc/blocks/image/component-info.js +1 -1
- package/dist/rsc/blocks/image/image.js +2 -1
- package/dist/rsc/blocks/img/img.js +2 -1
- package/dist/rsc/blocks/input/input.js +2 -1
- package/dist/rsc/blocks/raw-text/raw-text.js +2 -1
- package/dist/rsc/blocks/section/section.js +4 -5
- package/dist/rsc/blocks/select/select.js +2 -1
- package/dist/rsc/blocks/submit-button/submit-button.js +2 -1
- package/dist/rsc/blocks/symbol/symbol.js +2 -1
- package/dist/rsc/blocks/text/text.js +5 -2
- package/dist/rsc/blocks/textarea/textarea.js +2 -1
- package/dist/rsc/blocks/video/video.js +2 -1
- package/dist/rsc/components/render-block/block-styles.js +2 -1
- package/dist/rsc/components/render-block/render-block.js +2 -1
- package/dist/rsc/components/render-block/render-component.js +2 -1
- package/dist/rsc/components/render-block/render-repeated-block.js +2 -1
- package/dist/rsc/components/render-blocks.js +2 -1
- package/dist/rsc/components/render-content/components/render-styles.js +15 -1
- package/dist/rsc/components/render-content/render-content.js +5 -8
- package/dist/rsc/components/render-inlined-styles.js +2 -1
- package/dist/rsc/functions/is-editing.js +2 -1
- package/dist/rsc/index.js +0 -1
- package/package.json +1 -1
- package/packages/react/src/blocks/BaseText.jsx +3 -1
- package/packages/react/src/blocks/button/button.jsx +3 -1
- package/packages/react/src/blocks/columns/columns.jsx +19 -17
- package/packages/react/src/blocks/custom-code/custom-code.jsx +3 -1
- package/packages/react/src/blocks/embed/embed.jsx +3 -1
- package/packages/react/src/blocks/form/form.jsx +3 -2
- package/packages/react/src/blocks/fragment/fragment.jsx +3 -1
- package/packages/react/src/blocks/image/component-info.js +1 -1
- package/packages/react/src/blocks/image/image.jsx +3 -1
- package/packages/react/src/blocks/img/img.jsx +3 -1
- package/packages/react/src/blocks/input/input.jsx +3 -1
- package/packages/react/src/blocks/raw-text/raw-text.jsx +3 -1
- package/packages/react/src/blocks/section/section.jsx +5 -7
- package/packages/react/src/blocks/select/select.jsx +3 -1
- package/packages/react/src/blocks/submit-button/submit-button.jsx +3 -1
- package/packages/react/src/blocks/symbol/symbol.jsx +3 -1
- package/packages/react/src/blocks/text/text.jsx +6 -1
- package/packages/react/src/blocks/textarea/textarea.jsx +3 -1
- package/packages/react/src/blocks/video/video.jsx +3 -1
- package/packages/react/src/components/render-block/block-styles.jsx +3 -1
- package/packages/react/src/components/render-block/render-block.jsx +3 -1
- package/packages/react/src/components/render-block/render-component.jsx +3 -1
- package/packages/react/src/components/render-block/render-repeated-block.jsx +3 -1
- package/packages/react/src/components/render-blocks.jsx +3 -1
- package/packages/react/src/components/render-content/builder-editing.jsx +3 -1
- package/packages/react/src/components/render-content/components/render-styles.jsx +16 -1
- package/packages/react/src/components/render-content/render-content.jsx +13 -16
- package/packages/react/src/components/render-inlined-styles.jsx +3 -1
- package/packages/react/src/functions/is-editing.js +2 -1
- package/packages/react/src/index.js +0 -1
- package/packages/rsc/src/blocks/BaseText.jsx +3 -1
- package/packages/rsc/src/blocks/button/button.jsx +3 -1
- package/packages/rsc/src/blocks/columns/columns.jsx +19 -17
- package/packages/rsc/src/blocks/custom-code/custom-code.jsx +3 -1
- package/packages/rsc/src/blocks/embed/embed.jsx +3 -1
- package/packages/rsc/src/blocks/form/form.jsx +3 -2
- package/packages/rsc/src/blocks/fragment/fragment.jsx +3 -1
- package/packages/rsc/src/blocks/image/component-info.js +1 -1
- package/packages/rsc/src/blocks/image/image.jsx +3 -1
- package/packages/rsc/src/blocks/img/img.jsx +3 -1
- package/packages/rsc/src/blocks/input/input.jsx +3 -1
- package/packages/rsc/src/blocks/raw-text/raw-text.jsx +3 -1
- package/packages/rsc/src/blocks/section/section.jsx +5 -7
- package/packages/rsc/src/blocks/select/select.jsx +3 -1
- package/packages/rsc/src/blocks/submit-button/submit-button.jsx +3 -1
- package/packages/rsc/src/blocks/symbol/symbol.jsx +3 -1
- package/packages/rsc/src/blocks/text/text.jsx +6 -1
- package/packages/rsc/src/blocks/textarea/textarea.jsx +3 -1
- package/packages/rsc/src/blocks/video/video.jsx +3 -1
- package/packages/rsc/src/components/render-block/block-styles.jsx +3 -1
- package/packages/rsc/src/components/render-block/render-block.jsx +3 -1
- package/packages/rsc/src/components/render-block/render-component.jsx +3 -1
- package/packages/rsc/src/components/render-block/render-repeated-block.jsx +3 -1
- package/packages/rsc/src/components/render-blocks.jsx +3 -1
- package/packages/rsc/src/components/render-content/components/render-styles.jsx +16 -1
- package/packages/rsc/src/components/render-content/render-content.jsx +13 -16
- package/packages/rsc/src/components/render-inlined-styles.jsx +3 -1
- package/packages/rsc/src/functions/is-editing.js +2 -1
- package/packages/rsc/src/index.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function Video(props) {
|
|
4
4
|
function videoProps() {
|
|
5
5
|
return {
|
|
6
6
|
...(props.autoPlay === true
|
|
@@ -56,3 +56,5 @@ export default function Video(props) {
|
|
|
56
56
|
/>
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
export default Video;
|
|
@@ -9,7 +9,7 @@ import { createCssClass } from "../../helpers/css.js";
|
|
|
9
9
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
10
10
|
import RenderInlinedStyles from "../render-inlined-styles";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function BlockStyles(props) {
|
|
13
13
|
function useBlock() {
|
|
14
14
|
return getProcessedBlock({
|
|
15
15
|
block: props.block,
|
|
@@ -79,3 +79,5 @@ export default function BlockStyles(props) {
|
|
|
79
79
|
</>
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
export default BlockStyles;
|
|
@@ -18,7 +18,7 @@ import RenderComponent from "./render-component";
|
|
|
18
18
|
import { getReactNativeBlockStyles } from "../../functions/get-react-native-block-styles.js";
|
|
19
19
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function RenderBlock(props) {
|
|
22
22
|
const [component, setComponent] = useState(() =>
|
|
23
23
|
getComponent({
|
|
24
24
|
block: props.block,
|
|
@@ -217,3 +217,5 @@ export default function RenderBlock(props) {
|
|
|
217
217
|
</>
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
+
|
|
221
|
+
export default RenderBlock;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import BlockStyles from "./block-styles";
|
|
3
3
|
import RenderBlock from "./render-block";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function RenderComponent(props) {
|
|
6
6
|
const ComponentRefRef = props.componentRef;
|
|
7
7
|
|
|
8
8
|
return (
|
|
@@ -31,3 +31,5 @@ export default function RenderComponent(props) {
|
|
|
31
31
|
</>
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
export default RenderComponent;
|
|
@@ -3,7 +3,7 @@ import { useContext } from "react";
|
|
|
3
3
|
import BuilderContext from "../../context/builder.context.js";
|
|
4
4
|
import RenderBlock from "./render-block";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function RenderRepeatedBlock(props) {
|
|
7
7
|
return (
|
|
8
8
|
<BuilderContext.Provider
|
|
9
9
|
value={{
|
|
@@ -20,3 +20,5 @@ export default function RenderRepeatedBlock(props) {
|
|
|
20
20
|
</BuilderContext.Provider>
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
export default RenderRepeatedBlock;
|
|
@@ -5,7 +5,7 @@ import { isEditing } from "../functions/is-editing.js";
|
|
|
5
5
|
import BlockStyles from "./render-block/block-styles";
|
|
6
6
|
import RenderBlock from "./render-block/render-block";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function RenderBlocks(props) {
|
|
9
9
|
function className() {
|
|
10
10
|
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
11
11
|
}
|
|
@@ -87,3 +87,5 @@ align-items: stretch;
|
|
|
87
87
|
</>
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
export default RenderBlocks;
|
|
@@ -4,7 +4,7 @@ import RenderInlinedStyles from "../../render-inlined-styles";
|
|
|
4
4
|
import { getCss } from "./render-styles.helpers";
|
|
5
5
|
import { getFontCss } from "./render-styles.helpers";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function RenderContentStyles(props) {
|
|
8
8
|
const [injectedStyles, setInjectedStyles] = useState(
|
|
9
9
|
() => `
|
|
10
10
|
${getCss({
|
|
@@ -14,8 +14,23 @@ ${getCss({
|
|
|
14
14
|
${getFontCss({
|
|
15
15
|
customFonts: props.customFonts,
|
|
16
16
|
})}
|
|
17
|
+
|
|
18
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
22
|
+
color: inherit;
|
|
23
|
+
line-height: inherit;
|
|
24
|
+
letter-spacing: inherit;
|
|
25
|
+
font-weight: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
text-align: inherit;
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
}
|
|
17
30
|
`
|
|
18
31
|
);
|
|
19
32
|
|
|
20
33
|
return <RenderInlinedStyles styles={injectedStyles} />;
|
|
21
34
|
}
|
|
35
|
+
|
|
36
|
+
export default RenderContentStyles;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useState, useContext, useRef, useEffect } from "react";
|
|
3
3
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
4
|
-
import { TARGET } from "../../constants/target.js";
|
|
5
4
|
import { evaluate } from "../../functions/evaluate.js";
|
|
6
5
|
import { getContent } from "../../functions/get-content/index.js";
|
|
7
6
|
import { fetch } from "../../functions/get-fetch.js";
|
|
@@ -26,8 +25,9 @@ import {
|
|
|
26
25
|
getContentInitialValue,
|
|
27
26
|
getContextStateInitialValue,
|
|
28
27
|
} from "./render-content.helpers.js";
|
|
28
|
+
import { TARGET } from "../../constants/target.js";
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
function RenderContent(props) {
|
|
31
31
|
const elementRef = useRef(null);
|
|
32
32
|
const [forceReRenderCount, setForceReRenderCount] = useState(() => 0);
|
|
33
33
|
|
|
@@ -231,13 +231,6 @@ export default function RenderContent(props) {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
function shouldRenderContentStyles() {
|
|
235
|
-
return Boolean(
|
|
236
|
-
(useContent?.data?.cssCode || useContent?.data?.customFonts?.length) &&
|
|
237
|
-
TARGET !== "reactNative"
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
234
|
useEffect(() => {
|
|
242
235
|
if (!props.apiKey) {
|
|
243
236
|
console.error(
|
|
@@ -293,7 +286,7 @@ export default function RenderContent(props) {
|
|
|
293
286
|
|
|
294
287
|
/**
|
|
295
288
|
* Make sure that:
|
|
296
|
-
* - the preview model name is the same as the one we're rendering, since there can be multiple models rendered
|
|
289
|
+
* - the preview model name is the same as the one we're rendering, since there can be multiple models rendered * at the same time, e.g. header/page/footer. * - the API key is the same, since we don't want to preview content from other organizations.
|
|
297
290
|
*
|
|
298
291
|
* TO-DO: should we check that the preview item ID is the same as the initial one being rendered? Or would
|
|
299
292
|
* this break scenarios where the item is not published yet?
|
|
@@ -361,12 +354,14 @@ export default function RenderContent(props) {
|
|
|
361
354
|
builder-content-id={useContent?.id}
|
|
362
355
|
builder-model={props.model}
|
|
363
356
|
>
|
|
364
|
-
{
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
357
|
+
{TARGET !== "reactNative" ? (
|
|
358
|
+
<>
|
|
359
|
+
<RenderContentStyles
|
|
360
|
+
contentId={useContent?.id}
|
|
361
|
+
cssCode={useContent?.data?.cssCode}
|
|
362
|
+
customFonts={useContent?.data?.customFonts}
|
|
363
|
+
/>
|
|
364
|
+
</>
|
|
370
365
|
) : null}
|
|
371
366
|
|
|
372
367
|
<RenderBlocks
|
|
@@ -379,3 +374,5 @@ export default function RenderContent(props) {
|
|
|
379
374
|
</builderContext.Provider>
|
|
380
375
|
);
|
|
381
376
|
}
|
|
377
|
+
|
|
378
|
+
export default RenderContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TARGET } from "../constants/target.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function RenderInlinedStyles(props) {
|
|
5
5
|
function injectedStyleScript() {
|
|
6
6
|
return `<${tag()}>${props.styles}</${tag()}>`;
|
|
7
7
|
}
|
|
@@ -26,3 +26,5 @@ export default function RenderInlinedStyles(props) {
|
|
|
26
26
|
</>
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
export default RenderInlinedStyles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { TARGET } from "../constants/target.js";
|
|
1
2
|
import { isIframe } from "./is-iframe.js";
|
|
2
3
|
function isEditing() {
|
|
3
|
-
return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
4
|
+
return isIframe() && (TARGET === "reactNative" || window.location.search.indexOf("builder.frameEditing=") !== -1);
|
|
4
5
|
}
|
|
5
6
|
export {
|
|
6
7
|
isEditing
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import BuilderContext from "../context/builder.context.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function BaseText(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
const builderContext = _context["BuilderContext"];
|
|
8
8
|
|
|
9
9
|
return <span style={builderContext.inheritedStyles}>{props.text}</span>;
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export default BaseText;
|
|
@@ -6,7 +6,7 @@ import { TARGET } from "../../constants/target.js";
|
|
|
6
6
|
import { convertStyleMapToCSS } from "../../helpers/css";
|
|
7
7
|
import BuilderContext from "../../context/builder.context.js";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function Columns(props) {
|
|
10
10
|
const _context = { ...props["_context"] };
|
|
11
11
|
|
|
12
12
|
const state = {
|
|
@@ -85,26 +85,26 @@ export default function Columns(props) {
|
|
|
85
85
|
},
|
|
86
86
|
get columnsStyles() {
|
|
87
87
|
return `
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
@media (max-width: ${state.getWidthForBreakpointSize("medium")}px) {
|
|
89
|
+
.${props.builderBlock.id}-breakpoints {
|
|
90
|
+
${convertStyleMapToCSS(state.columnStyleObjects.columns.medium)}
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
93
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
94
|
+
${convertStyleMapToCSS(state.columnStyleObjects.column.medium)}
|
|
96
95
|
}
|
|
96
|
+
}
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
@media (max-width: ${state.getWidthForBreakpointSize("small")}px) {
|
|
99
|
+
.${props.builderBlock.id}-breakpoints {
|
|
100
|
+
${convertStyleMapToCSS(state.columnStyleObjects.columns.small)}
|
|
101
|
+
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
104
|
+
${convertStyleMapToCSS(state.columnStyleObjects.column.small)}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
`;
|
|
108
108
|
},
|
|
109
109
|
get reactNativeColumnsStyles() {
|
|
110
110
|
return this.columnStyleObjects.columns.small;
|
|
@@ -173,3 +173,5 @@ align-items: stretch;
|
|
|
173
173
|
</>
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
|
+
|
|
177
|
+
export default Columns;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function CustomCode(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
const state = {
|
|
@@ -53,3 +53,5 @@ export default function CustomCode(props) {
|
|
|
53
53
|
/>
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
export default CustomCode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isJsScript } from "./helpers.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function Embed(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
const state = {
|
|
@@ -41,3 +41,5 @@ export default function Embed(props) {
|
|
|
41
41
|
/>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
export default Embed;
|
|
@@ -3,7 +3,7 @@ import RenderBlock from "../../components/render-block/render-block";
|
|
|
3
3
|
import BuilderBlocks from "../../components/render-blocks";
|
|
4
4
|
import { isEditing } from "../../functions/is-editing.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function FormComponent(props) {
|
|
7
7
|
const _context = { ...props["_context"] };
|
|
8
8
|
|
|
9
9
|
const state = {
|
|
@@ -137,7 +137,7 @@ export default function FormComponent(props) {
|
|
|
137
137
|
get(body, props.errorMessagePath);
|
|
138
138
|
if (message) {
|
|
139
139
|
if (typeof message !== "string") {
|
|
140
|
-
/* TODO: ideally convert json to yaml so it woul dbe like
|
|
140
|
+
/* TODO: ideally convert json to yaml so it woul dbe like error: - email has been taken */ message =
|
|
141
141
|
JSON.stringify(message);
|
|
142
142
|
}
|
|
143
143
|
state.formErrorMessage = message;
|
|
@@ -257,3 +257,4 @@ export default function FormComponent(props) {
|
|
|
257
257
|
</>
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
|
+
export default FormComponent;
|
|
@@ -17,7 +17,7 @@ const componentInfo = {
|
|
|
17
17
|
bubble: true,
|
|
18
18
|
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
19
19
|
required: true,
|
|
20
|
-
defaultValue: "https://cdn.builder.io/api/v1/image/assets%
|
|
20
|
+
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
21
21
|
onChange: serializeFn((options) => {
|
|
22
22
|
const DEFAULT_ASPECT_RATIO = 0.7041;
|
|
23
23
|
options.delete("srcset");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { getSrcSet } from "./image.helpers.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function Image(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
const state = {
|
|
@@ -120,3 +120,5 @@ height: 100%;
|
|
|
120
120
|
</>
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
export default Image;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isEditing } from "../../functions/is-editing.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function ImgComponent(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
return (
|
|
@@ -17,3 +17,5 @@ export default function ImgComponent(props) {
|
|
|
17
17
|
/>
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
export default ImgComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isEditing } from "../../functions/is-editing.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function FormInputComponent(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
return (
|
|
@@ -19,3 +19,5 @@ export default function FormInputComponent(props) {
|
|
|
19
19
|
/>
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
export default FormInputComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function RawText(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
return (
|
|
@@ -10,3 +10,5 @@ export default function RawText(props) {
|
|
|
10
10
|
/>
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
export default RawText;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function SectionComponent(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
return (
|
|
@@ -9,13 +9,9 @@ export default function SectionComponent(props) {
|
|
|
9
9
|
style={{
|
|
10
10
|
width: "100%",
|
|
11
11
|
alignSelf: "stretch",
|
|
12
|
-
flexGrow:
|
|
12
|
+
flexGrow: 1,
|
|
13
13
|
boxSizing: "border-box",
|
|
14
|
-
maxWidth:
|
|
15
|
-
props.maxWidth && typeof props.maxWidth === "number"
|
|
16
|
-
? props.maxWidth
|
|
17
|
-
: 1200
|
|
18
|
-
}px`,
|
|
14
|
+
maxWidth: props.maxWidth || 1200,
|
|
19
15
|
display: "flex",
|
|
20
16
|
flexDirection: "column",
|
|
21
17
|
alignItems: "stretch",
|
|
@@ -27,3 +23,5 @@ export default function SectionComponent(props) {
|
|
|
27
23
|
</section>
|
|
28
24
|
);
|
|
29
25
|
}
|
|
26
|
+
|
|
27
|
+
export default SectionComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isEditing } from "../../functions/is-editing.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function SelectComponent(props) {
|
|
5
5
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
return (
|
|
@@ -20,3 +20,5 @@ export default function SelectComponent(props) {
|
|
|
20
20
|
</select>
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
export default SelectComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function SubmitButton(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
return (
|
|
@@ -9,3 +9,5 @@ export default function SubmitButton(props) {
|
|
|
9
9
|
</button>
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
export default SubmitButton;
|
|
@@ -4,7 +4,7 @@ import BuilderContext from "../../context/builder.context.js";
|
|
|
4
4
|
import { getContent } from "../../functions/get-content/index.js";
|
|
5
5
|
import { TARGET } from "../../constants/target";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function Symbol(props) {
|
|
8
8
|
const _context = { ...props["_context"] };
|
|
9
9
|
|
|
10
10
|
const state = {
|
|
@@ -54,3 +54,5 @@ export default function Symbol(props) {
|
|
|
54
54
|
</div>
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
export default Symbol;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function Text(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
return (
|
|
7
7
|
<span
|
|
8
8
|
className="builder-text"
|
|
9
9
|
dangerouslySetInnerHTML={{ __html: props.text }}
|
|
10
|
+
style={{
|
|
11
|
+
outline: "none",
|
|
12
|
+
}}
|
|
10
13
|
/>
|
|
11
14
|
);
|
|
12
15
|
}
|
|
16
|
+
|
|
17
|
+
export default Text;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function Textarea(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
return (
|
|
@@ -13,3 +13,5 @@ export default function Textarea(props) {
|
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
export default Textarea;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function Video(props) {
|
|
4
4
|
const _context = { ...props["_context"] };
|
|
5
5
|
|
|
6
6
|
const state = {
|
|
@@ -59,3 +59,5 @@ export default function Video(props) {
|
|
|
59
59
|
/>
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
export default Video;
|
|
@@ -9,7 +9,7 @@ import { createCssClass } from "../../helpers/css.js";
|
|
|
9
9
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
10
10
|
import RenderInlinedStyles from "../render-inlined-styles";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function BlockStyles(props) {
|
|
13
13
|
const _context = { ...props["_context"] };
|
|
14
14
|
|
|
15
15
|
const state = {
|
|
@@ -81,3 +81,5 @@ export default function BlockStyles(props) {
|
|
|
81
81
|
</>
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
export default BlockStyles;
|
|
@@ -17,7 +17,7 @@ import RenderComponent from "./render-component";
|
|
|
17
17
|
import { getReactNativeBlockStyles } from "../../functions/get-react-native-block-styles.js";
|
|
18
18
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
function RenderBlock(props) {
|
|
21
21
|
const _context = { ...props["_context"] };
|
|
22
22
|
|
|
23
23
|
const state = {
|
|
@@ -217,3 +217,5 @@ export default function RenderBlock(props) {
|
|
|
217
217
|
</>
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
+
|
|
221
|
+
export default RenderBlock;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import BlockStyles from "./block-styles";
|
|
3
3
|
import RenderBlock from "./render-block";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function RenderComponent(props) {
|
|
6
6
|
const _context = { ...props["_context"] };
|
|
7
7
|
|
|
8
8
|
const ComponentRefRef = props.componentRef;
|
|
@@ -35,3 +35,5 @@ export default function RenderComponent(props) {
|
|
|
35
35
|
</>
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
export default RenderComponent;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import BuilderContext from "../../context/builder.context.js";
|
|
3
3
|
import RenderBlock from "./render-block";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function RenderRepeatedBlock(props) {
|
|
6
6
|
const _context = { ...props["_context"] };
|
|
7
7
|
|
|
8
8
|
_context.BuilderContext = {
|
|
@@ -23,3 +23,5 @@ export default function RenderRepeatedBlock(props) {
|
|
|
23
23
|
/>
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
export default RenderRepeatedBlock;
|
|
@@ -4,7 +4,7 @@ import { isEditing } from "../functions/is-editing.js";
|
|
|
4
4
|
import BlockStyles from "./render-block/block-styles";
|
|
5
5
|
import RenderBlock from "./render-block/render-block";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function RenderBlocks(props) {
|
|
8
8
|
const _context = { ...props["_context"] };
|
|
9
9
|
|
|
10
10
|
const state = {
|
|
@@ -88,3 +88,5 @@ align-items: stretch;
|
|
|
88
88
|
</>
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
export default RenderBlocks;
|