@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
|
@@ -3,7 +3,7 @@ import RenderInlinedStyles from "../../render-inlined-styles";
|
|
|
3
3
|
import { getCss } from "./render-styles.helpers";
|
|
4
4
|
import { getFontCss } from "./render-styles.helpers";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function RenderContentStyles(props) {
|
|
7
7
|
const _context = { ...props["_context"] };
|
|
8
8
|
|
|
9
9
|
const state = {
|
|
@@ -15,6 +15,19 @@ ${getCss({
|
|
|
15
15
|
${getFontCss({
|
|
16
16
|
customFonts: props.customFonts,
|
|
17
17
|
})}
|
|
18
|
+
|
|
19
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
23
|
+
color: inherit;
|
|
24
|
+
line-height: inherit;
|
|
25
|
+
letter-spacing: inherit;
|
|
26
|
+
font-weight: inherit;
|
|
27
|
+
font-size: inherit;
|
|
28
|
+
text-align: inherit;
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
}
|
|
18
31
|
`,
|
|
19
32
|
};
|
|
20
33
|
|
|
@@ -22,3 +35,5 @@ ${getFontCss({
|
|
|
22
35
|
<RenderInlinedStyles styles={state.injectedStyles} _context={_context} />
|
|
23
36
|
);
|
|
24
37
|
}
|
|
38
|
+
|
|
39
|
+
export default RenderContentStyles;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
3
|
-
import { TARGET } from "../../constants/target.js";
|
|
4
3
|
import { evaluate } from "../../functions/evaluate.js";
|
|
5
4
|
import { getContent } from "../../functions/get-content/index.js";
|
|
6
5
|
import { fetch } from "../../functions/get-fetch.js";
|
|
@@ -25,8 +24,9 @@ import {
|
|
|
25
24
|
getContentInitialValue,
|
|
26
25
|
getContextStateInitialValue,
|
|
27
26
|
} from "./render-content.helpers.js";
|
|
27
|
+
import { TARGET } from "../../constants/target.js";
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
function RenderContent(props) {
|
|
30
30
|
const _context = { ...props["_context"] };
|
|
31
31
|
|
|
32
32
|
const state = {
|
|
@@ -206,13 +206,6 @@ export default function RenderContent(props) {
|
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
-
get shouldRenderContentStyles() {
|
|
210
|
-
return Boolean(
|
|
211
|
-
(state.useContent?.data?.cssCode ||
|
|
212
|
-
state.useContent?.data?.customFonts?.length) &&
|
|
213
|
-
TARGET !== "reactNative"
|
|
214
|
-
);
|
|
215
|
-
},
|
|
216
209
|
};
|
|
217
210
|
|
|
218
211
|
_context.builderContext = {
|
|
@@ -232,13 +225,15 @@ export default function RenderContent(props) {
|
|
|
232
225
|
builder-content-id={state.useContent?.id}
|
|
233
226
|
builder-model={props.model}
|
|
234
227
|
>
|
|
235
|
-
{
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
{TARGET !== "reactNative" ? (
|
|
229
|
+
<>
|
|
230
|
+
<RenderContentStyles
|
|
231
|
+
contentId={state.useContent?.id}
|
|
232
|
+
cssCode={state.useContent?.data?.cssCode}
|
|
233
|
+
customFonts={state.useContent?.data?.customFonts}
|
|
234
|
+
_context={_context}
|
|
235
|
+
/>
|
|
236
|
+
</>
|
|
242
237
|
) : null}
|
|
243
238
|
|
|
244
239
|
<RenderBlocks
|
|
@@ -252,3 +247,5 @@ export default function RenderContent(props) {
|
|
|
252
247
|
</>
|
|
253
248
|
);
|
|
254
249
|
}
|
|
250
|
+
|
|
251
|
+
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
|
const _context = { ...props["_context"] };
|
|
6
6
|
|
|
7
7
|
const state = {
|
|
@@ -29,3 +29,5 @@ export default function RenderInlinedStyles(props) {
|
|
|
29
29
|
</>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
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
|