@builder.io/sdk-react-native 0.4.5 → 0.5.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.
- package/dist/blocks/button/button.js +6 -2
- package/dist/blocks/button/component-info.js +4 -8
- package/dist/blocks/columns/columns.js +17 -21
- package/dist/blocks/columns/component-info.js +27 -48
- package/dist/blocks/custom-code/component-info.js +4 -8
- package/dist/blocks/custom-code/custom-code.js +1 -1
- package/dist/blocks/embed/component-info.js +7 -11
- package/dist/blocks/embed/embed.js +1 -1
- package/dist/blocks/embed/helpers.js +2 -6
- package/dist/blocks/form/component-info.js +33 -69
- package/dist/blocks/form/form.js +2 -203
- package/dist/blocks/fragment/fragment.js +1 -1
- package/dist/blocks/helpers.js +33 -0
- package/dist/blocks/image/component-info.js +21 -47
- package/dist/blocks/image/image.helpers.js +2 -2
- package/dist/blocks/img/component-info.js +2 -4
- package/dist/blocks/img/img.js +2 -1
- package/dist/blocks/input/component-info.js +8 -34
- package/dist/blocks/input/input.js +2 -1
- package/dist/blocks/raw-text/component-info.js +2 -4
- package/dist/blocks/raw-text/raw-text.js +3 -2
- package/dist/blocks/section/component-info.js +5 -10
- package/dist/blocks/section/section.js +2 -1
- package/dist/blocks/select/component-info.js +12 -24
- package/dist/blocks/select/select.js +2 -1
- package/dist/blocks/submit-button/component-info.js +2 -4
- package/dist/blocks/submit-button/submit-button.js +2 -1
- package/dist/blocks/symbol/component-info.js +7 -12
- package/dist/blocks/symbol/symbol.helpers.js +66 -0
- package/dist/blocks/symbol/symbol.js +23 -52
- package/dist/blocks/text/component-info.js +3 -4
- package/dist/blocks/textarea/component-info.js +6 -12
- package/dist/blocks/textarea/textarea.js +2 -1
- package/dist/blocks/video/component-info.js +21 -41
- package/dist/components/block/block.helpers.js +12 -23
- package/dist/components/block/block.js +40 -70
- package/dist/components/block/components/block-styles.js +1 -1
- package/dist/components/block/components/block-wrapper/block-wrapper.js +41 -0
- package/dist/components/block/components/block-wrapper.js +56 -0
- package/dist/components/block/components/component-ref/component-ref.helpers.js +40 -0
- package/dist/components/block/components/component-ref/component-ref.js +63 -0
- package/dist/components/block/components/component-ref.js +81 -0
- package/dist/components/block/components/interactive-element/interactive-element.helpers.js +35 -0
- package/dist/components/block/components/interactive-element/interactive-element.js +36 -0
- package/dist/components/block/components/interactive-element.js +46 -0
- package/dist/components/block/components/repeated-block.js +4 -4
- package/dist/components/blocks/blocks-wrapper.js +5 -2
- package/dist/components/blocks/blocks.js +2 -2
- package/dist/components/content/builder-editing.js +32 -0
- package/dist/components/content/components/enable-editor.js +30 -33
- package/dist/components/content/components/styles.helpers.js +55 -0
- package/dist/components/content/components/styles.js +61 -0
- package/dist/components/content/content.helpers.js +10 -3
- package/dist/components/content/content.js +25 -42
- package/dist/components/content/wrap-component-ref.js +1 -1
- package/dist/components/content-variants/content-variants.js +38 -34
- package/dist/components/content-variants/content-variants.types.js +1 -0
- package/dist/components/content-variants/helpers.js +61 -25
- package/dist/components/inlined-script.js +1 -1
- package/dist/components/inlined-styles.js +1 -1
- package/dist/constants/device-sizes.js +2 -2
- package/dist/constants/sdk-version.js +1 -1
- package/dist/context/builder.context.js +1 -1
- package/dist/functions/apply-patch-with-mutation.js +75 -0
- package/dist/functions/apply-patch-with-mutation.test.js +55 -0
- package/dist/functions/camel-to-kebab-case.js +1 -1
- package/dist/functions/evaluate/acorn.js +1691 -0
- package/dist/functions/evaluate/evaluate.js +72 -0
- package/dist/functions/evaluate/index.js +5 -0
- package/dist/functions/evaluate/interpreter.js +2903 -0
- package/dist/functions/evaluate/non-node-runtime.js +97 -0
- package/dist/functions/evaluate/types.js +1 -0
- package/dist/functions/evaluate.test.js +12 -6
- package/dist/functions/event-handler-name.js +1 -1
- package/dist/functions/extract-text-styles.js +3 -9
- package/dist/functions/fast-clone.js +1 -1
- package/dist/functions/get-block-actions-handler.js +2 -2
- package/dist/functions/get-block-actions.js +14 -1
- package/dist/functions/get-block-component-options.js +6 -1
- package/dist/functions/get-block-properties.js +21 -8
- package/dist/functions/get-builder-search-params/fn.test.js +3 -3
- package/dist/functions/get-builder-search-params/index.js +4 -4
- package/dist/functions/get-content/generate-content-url.js +12 -5
- package/dist/functions/get-content/generate-content-url.test.js +31 -17
- package/dist/functions/get-content/index.js +36 -12
- package/dist/functions/get-content/processCookies.js +7 -0
- package/dist/functions/get-processed-block.js +8 -3
- package/dist/functions/get-processed-block.test.js +3 -1
- package/dist/functions/get-react-native-block-styles.js +6 -1
- package/dist/functions/is-non-node-server.js +12 -0
- package/dist/functions/on-change.test.js +13 -3
- package/dist/functions/register-component.js +24 -19
- package/dist/functions/sanitize-react-native-block-styles.js +17 -6
- package/dist/functions/set.test.js +9 -3
- package/dist/functions/track/helpers.js +5 -5
- package/dist/functions/track/index.js +29 -18
- package/dist/functions/track/interaction.js +10 -4
- package/dist/functions/transform-block-properties.js +2 -0
- package/dist/helpers/ab-tests.js +35 -14
- package/dist/helpers/canTrack.js +2 -2
- package/dist/helpers/css.js +2 -2
- package/dist/helpers/flatten.js +10 -7
- package/dist/helpers/nullable.js +1 -1
- package/dist/helpers/preview-lru-cache/get.js +11 -0
- package/dist/helpers/preview-lru-cache/helpers.js +13 -0
- package/dist/helpers/preview-lru-cache/init.js +13 -0
- package/dist/helpers/preview-lru-cache/set.js +37 -0
- package/dist/helpers/preview-lru-cache/types.js +1 -0
- package/dist/helpers/sessionId.js +13 -6
- package/dist/helpers/url.js +1 -1
- package/dist/helpers/visitorId.js +4 -1
- package/dist/index-helpers/blocks-exports.js +2 -2
- package/dist/scripts/init-editing.js +61 -46
- package/package.json +2 -2
- package/src/blocks/button/button.jsx +11 -2
- package/src/blocks/button/component-info.js +16 -22
- package/src/blocks/columns/columns.jsx +27 -26
- package/src/blocks/columns/component-info.js +203 -226
- package/src/blocks/custom-code/component-info.js +19 -25
- package/src/blocks/custom-code/custom-code.jsx +1 -1
- package/src/blocks/embed/component-info.js +31 -37
- package/src/blocks/embed/embed.jsx +1 -1
- package/src/blocks/embed/helpers.js +3 -9
- package/src/blocks/form/component-info.js +174 -212
- package/src/blocks/form/form.jsx +3 -247
- package/src/blocks/fragment/component-info.js +1 -3
- package/src/blocks/fragment/fragment.jsx +1 -1
- package/src/blocks/helpers.js +27 -0
- package/src/blocks/image/component-info.js +105 -133
- package/src/blocks/image/image.helpers.js +3 -5
- package/src/blocks/img/component-info.js +8 -12
- package/src/blocks/img/img.jsx +3 -1
- package/src/blocks/input/component-info.js +29 -57
- package/src/blocks/input/input.jsx +3 -1
- package/src/blocks/raw-text/component-info.js +7 -11
- package/src/blocks/raw-text/raw-text.jsx +4 -2
- package/src/blocks/section/component-info.js +24 -31
- package/src/blocks/section/section.jsx +3 -1
- package/src/blocks/select/component-info.js +34 -48
- package/src/blocks/select/select.jsx +3 -1
- package/src/blocks/submit-button/component-info.js +6 -10
- package/src/blocks/submit-button/submit-button.jsx +3 -2
- package/src/blocks/symbol/component-info.js +30 -37
- package/src/blocks/symbol/symbol.helpers.js +60 -0
- package/src/blocks/symbol/symbol.jsx +33 -61
- package/src/blocks/text/component-info.js +10 -13
- package/src/blocks/textarea/component-info.js +22 -30
- package/src/blocks/textarea/textarea.jsx +3 -1
- package/src/blocks/video/component-info.js +74 -96
- package/src/components/{render-block/render-block.helpers.js → block/block.helpers.js} +26 -44
- package/src/components/{render-block/render-block.jsx → block/block.jsx} +68 -81
- package/src/components/{render-block → block/components}/block-styles.jsx +18 -17
- package/src/components/block/components/block-wrapper.jsx +58 -0
- package/src/components/block/components/component-ref/component-ref.helpers.js +41 -0
- package/src/components/block/components/component-ref/component-ref.jsx +72 -0
- package/src/components/block/components/interactive-element.jsx +37 -0
- package/src/components/{render-block/render-repeated-block.jsx → block/components/repeated-block.jsx} +10 -6
- package/src/components/blocks/blocks-wrapper.jsx +74 -0
- package/src/components/blocks/blocks.jsx +51 -0
- package/src/components/{render-content/render-content.jsx → content/components/enable-editor.jsx} +77 -163
- package/src/components/{render-content/components/render-styles.helpers.js → content/components/styles.helpers.js} +6 -7
- package/src/components/{render-content/components/render-styles.jsx → content/components/styles.jsx} +5 -5
- package/src/components/{render-content/render-content.helpers.js → content/content.helpers.js} +15 -15
- package/src/components/content/content.jsx +141 -0
- package/src/components/content/index.js +2 -0
- package/src/components/content/wrap-component-ref.js +2 -0
- package/src/components/{render-content-variants/render-content-variants.jsx → content-variants/content-variants.jsx} +20 -23
- package/src/components/{render-content-variants → content-variants}/helpers.js +28 -40
- package/src/components/inlined-script.jsx +1 -1
- package/src/components/inlined-styles.jsx +1 -1
- package/src/constants/device-sizes.js +6 -6
- package/src/constants/sdk-version.js +1 -1
- package/src/context/builder.context.js +1 -1
- package/src/functions/apply-patch-with-mutation.js +66 -0
- package/src/functions/camel-to-kebab-case.js +2 -4
- package/src/functions/evaluate/acorn.js +1595 -0
- package/src/functions/{evaluate.js → evaluate/evaluate.js} +36 -10
- package/src/functions/evaluate/index.js +2 -0
- package/src/functions/evaluate/interpreter.js +2801 -0
- package/src/functions/evaluate/non-node-runtime.js +92 -0
- package/src/functions/evaluate/types.js +0 -0
- package/src/functions/event-handler-name.js +2 -4
- package/src/functions/extract-text-styles.js +4 -12
- package/src/functions/fast-clone.js +2 -4
- package/src/functions/get-block-actions-handler.js +3 -5
- package/src/functions/get-block-actions.js +15 -4
- package/src/functions/get-block-component-options.js +11 -12
- package/src/functions/get-block-properties.js +29 -19
- package/src/functions/get-builder-search-params/index.js +5 -10
- package/src/functions/get-content/generate-content-url.js +17 -19
- package/src/functions/get-content/index.js +43 -29
- package/src/functions/get-fetch.js +1 -3
- package/src/functions/get-global-this.js +1 -3
- package/src/functions/get-processed-block.js +12 -13
- package/src/functions/get-react-native-block-styles.js +11 -12
- package/src/functions/if-target.js +1 -3
- package/src/functions/is-browser.js +1 -3
- package/src/functions/is-editing.js +1 -3
- package/src/functions/is-iframe.js +1 -3
- package/src/functions/is-non-node-server.js +9 -0
- package/src/functions/is-previewing.js +1 -3
- package/src/functions/on-change.js +1 -4
- package/src/functions/register-component.js +34 -42
- package/src/functions/register.js +1 -3
- package/src/functions/sanitize-react-native-block-styles.js +22 -17
- package/src/functions/set-editor-settings.js +1 -3
- package/src/functions/set.js +1 -3
- package/src/functions/track/helpers.js +3 -5
- package/src/functions/track/index.js +45 -43
- package/src/functions/track/interaction.js +11 -7
- package/src/functions/transform-block-properties.js +2 -0
- package/src/helpers/ab-tests.js +45 -28
- package/src/helpers/canTrack.js +3 -5
- package/src/helpers/css.js +3 -7
- package/src/helpers/flatten.js +15 -18
- package/src/helpers/localStorage.js +1 -4
- package/src/helpers/logger.js +1 -3
- package/src/helpers/nullable.js +2 -4
- package/src/helpers/preview-lru-cache/get.js +8 -0
- package/src/helpers/preview-lru-cache/helpers.js +10 -0
- package/src/helpers/preview-lru-cache/init.js +10 -0
- package/src/helpers/preview-lru-cache/set.js +35 -0
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +14 -11
- package/src/helpers/time.js +1 -3
- package/src/helpers/url.js +2 -4
- package/src/helpers/uuid.js +4 -6
- package/src/helpers/visitorId.js +8 -7
- package/src/index-helpers/blocks-exports.js +1 -1
- package/src/index.js +2 -17
- package/src/scripts/init-editing.js +62 -48
- package/src/types/api-version.js +1 -3
- package/src/types/builder-props.js +0 -0
- package/src/blocks/util.js +0 -8
- package/src/components/render-block/render-component.jsx +0 -55
- package/src/components/render-blocks.jsx +0 -101
- package/src/components/render-content/builder-editing.jsx +0 -16
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/wrap-component-ref.js +0 -4
- package/src/functions/evaluate.test.js +0 -17
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-content/generate-content-url.test.js +0 -97
- package/src/functions/get-processed-block.test.js +0 -34
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/set.test.js +0 -16
- package/src/helpers/url.test.js +0 -21
- /package/src/components/{render-block → block}/types.js +0 -0
- /package/src/components/{render-content/render-content.types.js → content/content.types.js} +0 -0
- /package/src/components/{render-content-variants/render-content-variants.types.js → content-variants/content-variants.types.js} +0 -0
package/src/components/{render-content/render-content.jsx → content/components/enable-editor.jsx}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import {
|
|
4
4
|
FlatList,
|
|
@@ -9,81 +9,57 @@ import {
|
|
|
9
9
|
Text,
|
|
10
10
|
} from "react-native";
|
|
11
11
|
import { useState, useContext, useRef, useEffect } from "react";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
components,
|
|
21
|
-
createRegisterComponentMessage,
|
|
22
|
-
} from "../../functions/register-component.js";
|
|
23
|
-
import { _track } from "../../functions/track/index.js";
|
|
24
|
-
import RenderBlocks from "../render-blocks";
|
|
25
|
-
import RenderContentStyles from "./components/render-styles";
|
|
26
|
-
import builderContext from "../../context/builder.context.js";
|
|
12
|
+
import { evaluate } from "../../../functions/evaluate";
|
|
13
|
+
import { fetch } from "../../../functions/get-fetch.js";
|
|
14
|
+
import { isBrowser } from "../../../functions/is-browser.js";
|
|
15
|
+
import { isEditing } from "../../../functions/is-editing.js";
|
|
16
|
+
import { createRegisterComponentMessage } from "../../../functions/register-component.js";
|
|
17
|
+
import { _track } from "../../../functions/track/index.js";
|
|
18
|
+
import builderContext from "../../../context/builder.context";
|
|
27
19
|
import {
|
|
28
20
|
registerInsertMenu,
|
|
29
21
|
setupBrowserForEditing,
|
|
30
|
-
} from "
|
|
31
|
-
import { checkIsDefined } from "
|
|
32
|
-
import { getInteractionPropertiesForEvent } from "
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "
|
|
37
|
-
import { TARGET } from "../../constants/target.js";
|
|
38
|
-
import { logger } from "../../helpers/logger.js";
|
|
39
|
-
import { getRenderContentScriptString } from "../render-content-variants/helpers.js";
|
|
40
|
-
import { wrapComponentRef } from "./wrap-component-ref.js";
|
|
41
|
-
import InlinedScript from "../inlined-script";
|
|
22
|
+
} from "../../../scripts/init-editing.js";
|
|
23
|
+
import { checkIsDefined } from "../../../helpers/nullable.js";
|
|
24
|
+
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.js";
|
|
25
|
+
import { logger } from "../../../helpers/logger.js";
|
|
26
|
+
import { getContent } from "../../../functions/get-content/index.js";
|
|
27
|
+
import { isPreviewing } from "../../../functions/is-previewing.js";
|
|
28
|
+
import { postPreviewContent } from "../../../helpers/preview-lru-cache/set.js";
|
|
42
29
|
|
|
43
|
-
function
|
|
30
|
+
function EnableEditor(props) {
|
|
44
31
|
const elementRef = useRef(null);
|
|
45
|
-
const [
|
|
32
|
+
const [canTrackToUse, setCanTrackToUse] = useState(() =>
|
|
33
|
+
checkIsDefined(props.canTrack) ? props.canTrack : true
|
|
34
|
+
);
|
|
46
35
|
|
|
47
|
-
const [
|
|
36
|
+
const [forceReRenderCount, setForceReRenderCount] = useState(() => 0);
|
|
48
37
|
|
|
49
38
|
function mergeNewContent(newContent) {
|
|
50
|
-
|
|
51
|
-
...builderContextSignal.content,
|
|
39
|
+
const newContentValue = {
|
|
40
|
+
...props.builderContextSignal.content,
|
|
52
41
|
...newContent,
|
|
53
42
|
data: {
|
|
54
|
-
...builderContextSignal.content?.data,
|
|
43
|
+
...props.builderContextSignal.content?.data,
|
|
55
44
|
...newContent?.data,
|
|
56
45
|
},
|
|
57
46
|
meta: {
|
|
58
|
-
...builderContextSignal.content?.meta,
|
|
47
|
+
...props.builderContextSignal.content?.meta,
|
|
59
48
|
...newContent?.meta,
|
|
60
49
|
breakpoints:
|
|
61
50
|
newContent?.meta?.breakpoints ||
|
|
62
|
-
builderContextSignal.content?.meta?.breakpoints,
|
|
51
|
+
props.builderContextSignal.content?.meta?.breakpoints,
|
|
63
52
|
},
|
|
64
53
|
};
|
|
54
|
+
props.builderContextSignal.content = newContentValue;
|
|
65
55
|
}
|
|
66
56
|
|
|
67
|
-
|
|
68
|
-
builderContextSignal.content = {
|
|
69
|
-
...builderContextSignal.content,
|
|
70
|
-
meta: {
|
|
71
|
-
...builderContextSignal.content?.meta,
|
|
72
|
-
breakpoints,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const [update, setUpdate] = useState(() => 0);
|
|
57
|
+
const [lastUpdated, setLastUpdated] = useState(() => 0);
|
|
78
58
|
|
|
79
|
-
const [
|
|
80
|
-
|
|
59
|
+
const [shouldSendResetCookie, setShouldSendResetCookie] = useState(
|
|
60
|
+
() => false
|
|
81
61
|
);
|
|
82
62
|
|
|
83
|
-
function contentSetState(newRootState) {
|
|
84
|
-
builderContextSignal.rootState = newRootState;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
63
|
function processMessage(event) {
|
|
88
64
|
const { data } = event;
|
|
89
65
|
if (data) {
|
|
@@ -91,11 +67,18 @@ function RenderContent(props) {
|
|
|
91
67
|
case "builder.configureSdk": {
|
|
92
68
|
const messageContent = data.data;
|
|
93
69
|
const { breakpoints, contentId } = messageContent;
|
|
94
|
-
if (
|
|
70
|
+
if (
|
|
71
|
+
!contentId ||
|
|
72
|
+
contentId !== props.builderContextSignal.content?.id
|
|
73
|
+
) {
|
|
95
74
|
return;
|
|
96
75
|
}
|
|
97
76
|
if (breakpoints) {
|
|
98
|
-
|
|
77
|
+
mergeNewContent({
|
|
78
|
+
meta: {
|
|
79
|
+
breakpoints,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
99
82
|
}
|
|
100
83
|
setForceReRenderCount(forceReRenderCount + 1); // This is a hack to force Qwik to re-render.
|
|
101
84
|
break;
|
|
@@ -115,24 +98,20 @@ function RenderContent(props) {
|
|
|
115
98
|
|
|
116
99
|
break;
|
|
117
100
|
}
|
|
118
|
-
case "builder.patchUpdates": {
|
|
119
|
-
// TODO
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
101
|
}
|
|
123
102
|
}
|
|
124
103
|
}
|
|
125
104
|
|
|
126
105
|
function evaluateJsCode() {
|
|
127
106
|
// run any dynamic JS code attached to content
|
|
128
|
-
const jsCode = builderContextSignal.content?.data?.jsCode;
|
|
107
|
+
const jsCode = props.builderContextSignal.content?.data?.jsCode;
|
|
129
108
|
if (jsCode) {
|
|
130
109
|
evaluate({
|
|
131
110
|
code: jsCode,
|
|
132
111
|
context: props.context || {},
|
|
133
112
|
localState: undefined,
|
|
134
|
-
rootState: builderContextSignal.rootState,
|
|
135
|
-
rootSetState:
|
|
113
|
+
rootState: props.builderContextSignal.rootState,
|
|
114
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
136
115
|
});
|
|
137
116
|
}
|
|
138
117
|
}
|
|
@@ -142,9 +121,9 @@ function RenderContent(props) {
|
|
|
142
121
|
const [clicked, setClicked] = useState(() => false);
|
|
143
122
|
|
|
144
123
|
function onClick(event) {
|
|
145
|
-
if (builderContextSignal.content) {
|
|
146
|
-
const variationId = builderContextSignal.content?.testVariationId;
|
|
147
|
-
const contentId = builderContextSignal.content?.id;
|
|
124
|
+
if (props.builderContextSignal.content) {
|
|
125
|
+
const variationId = props.builderContextSignal.content?.testVariationId;
|
|
126
|
+
const contentId = props.builderContextSignal.content?.id;
|
|
148
127
|
_track({
|
|
149
128
|
type: "click",
|
|
150
129
|
canTrack: canTrackToUse,
|
|
@@ -166,8 +145,8 @@ function RenderContent(props) {
|
|
|
166
145
|
code: group,
|
|
167
146
|
context: props.context || {},
|
|
168
147
|
localState: undefined,
|
|
169
|
-
rootState: builderContextSignal.rootState,
|
|
170
|
-
rootSetState:
|
|
148
|
+
rootState: props.builderContextSignal.rootState,
|
|
149
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
171
150
|
})
|
|
172
151
|
);
|
|
173
152
|
}
|
|
@@ -177,10 +156,11 @@ function RenderContent(props) {
|
|
|
177
156
|
.then((response) => response.json())
|
|
178
157
|
.then((json) => {
|
|
179
158
|
const newState = {
|
|
180
|
-
...builderContextSignal.rootState,
|
|
159
|
+
...props.builderContextSignal.rootState,
|
|
181
160
|
[key]: json,
|
|
182
161
|
};
|
|
183
|
-
|
|
162
|
+
props.builderContextSignal.rootSetState?.(newState);
|
|
163
|
+
httpReqsData[key] = true;
|
|
184
164
|
})
|
|
185
165
|
.catch((err) => {
|
|
186
166
|
console.error("error fetching dynamic data", url, err);
|
|
@@ -188,7 +168,8 @@ function RenderContent(props) {
|
|
|
188
168
|
}
|
|
189
169
|
|
|
190
170
|
function runHttpRequests() {
|
|
191
|
-
const requests =
|
|
171
|
+
const requests =
|
|
172
|
+
props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
192
173
|
Object.entries(requests).forEach(([key, url]) => {
|
|
193
174
|
if (url && (!httpReqsData[key] || isEditing())) {
|
|
194
175
|
const evaluatedUrl = evalExpression(url);
|
|
@@ -205,7 +186,7 @@ function RenderContent(props) {
|
|
|
205
186
|
window.dispatchEvent(
|
|
206
187
|
new CustomEvent("builder:component:stateChange", {
|
|
207
188
|
detail: {
|
|
208
|
-
state: builderContextSignal.rootState,
|
|
189
|
+
state: props.builderContextSignal.rootState,
|
|
209
190
|
ref: {
|
|
210
191
|
name: props.model,
|
|
211
192
|
},
|
|
@@ -215,53 +196,6 @@ function RenderContent(props) {
|
|
|
215
196
|
}
|
|
216
197
|
}
|
|
217
198
|
|
|
218
|
-
const [scriptStr, setScriptStr] = useState(() =>
|
|
219
|
-
getRenderContentScriptString({
|
|
220
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
221
|
-
variationId: props.content?.testVariationId,
|
|
222
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
223
|
-
contentId: props.content?.id,
|
|
224
|
-
})
|
|
225
|
-
);
|
|
226
|
-
|
|
227
|
-
const [builderContextSignal, setBuilderContextSignal] = useState(() => ({
|
|
228
|
-
content: getContentInitialValue({
|
|
229
|
-
content: props.content,
|
|
230
|
-
data: props.data,
|
|
231
|
-
}),
|
|
232
|
-
localState: undefined,
|
|
233
|
-
rootState: getContextStateInitialValue({
|
|
234
|
-
content: props.content,
|
|
235
|
-
data: props.data,
|
|
236
|
-
locale: props.locale,
|
|
237
|
-
}),
|
|
238
|
-
rootSetState: contentSetState,
|
|
239
|
-
context: props.context || {},
|
|
240
|
-
apiKey: props.apiKey,
|
|
241
|
-
apiVersion: props.apiVersion,
|
|
242
|
-
registeredComponents: [
|
|
243
|
-
...getDefaultRegisteredComponents(),
|
|
244
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
245
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
246
|
-
// existing usage.
|
|
247
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
248
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
249
|
-
...components,
|
|
250
|
-
...(props.customComponents || []),
|
|
251
|
-
].reduce(
|
|
252
|
-
(acc, { component, ...curr }) => ({
|
|
253
|
-
...acc,
|
|
254
|
-
[curr.name]: {
|
|
255
|
-
component:
|
|
256
|
-
TARGET === "vue3" ? wrapComponentRef(component) : component,
|
|
257
|
-
...curr,
|
|
258
|
-
},
|
|
259
|
-
}),
|
|
260
|
-
{}
|
|
261
|
-
),
|
|
262
|
-
inheritedStyles: {},
|
|
263
|
-
}));
|
|
264
|
-
|
|
265
199
|
useEffect(() => {
|
|
266
200
|
if (!props.apiKey) {
|
|
267
201
|
logger.error(
|
|
@@ -271,6 +205,7 @@ function RenderContent(props) {
|
|
|
271
205
|
if (isBrowser()) {
|
|
272
206
|
if (isEditing()) {
|
|
273
207
|
setForceReRenderCount(forceReRenderCount + 1);
|
|
208
|
+
window.addEventListener("message", processMessage);
|
|
274
209
|
registerInsertMenu();
|
|
275
210
|
setupBrowserForEditing({
|
|
276
211
|
...(props.locale
|
|
@@ -289,21 +224,20 @@ function RenderContent(props) {
|
|
|
289
224
|
}
|
|
290
225
|
: {}),
|
|
291
226
|
});
|
|
292
|
-
Object.values(builderContextSignal.
|
|
227
|
+
Object.values(props.builderContextSignal.componentInfos).forEach(
|
|
293
228
|
(registeredComponent) => {
|
|
294
229
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
295
230
|
window.parent?.postMessage(message, "*");
|
|
296
231
|
}
|
|
297
232
|
);
|
|
298
|
-
window.addEventListener("message", processMessage);
|
|
299
233
|
window.addEventListener(
|
|
300
234
|
"builder:component:stateChangeListenerActivated",
|
|
301
235
|
emitStateUpdate
|
|
302
236
|
);
|
|
303
237
|
}
|
|
304
|
-
if (builderContextSignal.content) {
|
|
305
|
-
const variationId = builderContextSignal.content?.testVariationId;
|
|
306
|
-
const contentId = builderContextSignal.content?.id;
|
|
238
|
+
if (props.builderContextSignal.content) {
|
|
239
|
+
const variationId = props.builderContextSignal.content?.testVariationId;
|
|
240
|
+
const contentId = props.builderContextSignal.content?.id;
|
|
307
241
|
_track({
|
|
308
242
|
type: "impression",
|
|
309
243
|
canTrack: canTrackToUse,
|
|
@@ -312,7 +246,6 @@ function RenderContent(props) {
|
|
|
312
246
|
variationId: variationId !== contentId ? variationId : undefined,
|
|
313
247
|
});
|
|
314
248
|
}
|
|
315
|
-
|
|
316
249
|
// override normal content in preview mode
|
|
317
250
|
if (isPreviewing()) {
|
|
318
251
|
const searchParams = new URL(location.href).searchParams;
|
|
@@ -338,7 +271,7 @@ function RenderContent(props) {
|
|
|
338
271
|
getContent({
|
|
339
272
|
model: props.model,
|
|
340
273
|
apiKey: props.apiKey,
|
|
341
|
-
apiVersion: props.apiVersion,
|
|
274
|
+
apiVersion: props.builderContextSignal.apiVersion,
|
|
342
275
|
}).then((content) => {
|
|
343
276
|
if (content) {
|
|
344
277
|
mergeNewContent(content);
|
|
@@ -357,18 +290,19 @@ function RenderContent(props) {
|
|
|
357
290
|
mergeNewContent(props.content);
|
|
358
291
|
}
|
|
359
292
|
}, [props.content]);
|
|
293
|
+
useEffect(() => {}, [shouldSendResetCookie]);
|
|
360
294
|
useEffect(() => {
|
|
361
295
|
evaluateJsCode();
|
|
362
296
|
}, [
|
|
363
|
-
builderContextSignal.content?.data?.jsCode,
|
|
364
|
-
builderContextSignal.rootState,
|
|
297
|
+
props.builderContextSignal.content?.data?.jsCode,
|
|
298
|
+
props.builderContextSignal.rootState,
|
|
365
299
|
]);
|
|
366
300
|
useEffect(() => {
|
|
367
301
|
runHttpRequests();
|
|
368
|
-
}, [builderContextSignal.content?.data?.httpRequests]);
|
|
302
|
+
}, [props.builderContextSignal.content?.data?.httpRequests]);
|
|
369
303
|
useEffect(() => {
|
|
370
304
|
emitStateUpdate();
|
|
371
|
-
}, [builderContextSignal.rootState]);
|
|
305
|
+
}, [props.builderContextSignal.rootState]);
|
|
372
306
|
|
|
373
307
|
useEffect(() => {
|
|
374
308
|
return () => {
|
|
@@ -383,22 +317,21 @@ function RenderContent(props) {
|
|
|
383
317
|
}, []);
|
|
384
318
|
|
|
385
319
|
return (
|
|
386
|
-
<builderContext.Provider value={builderContextSignal}>
|
|
387
|
-
{builderContextSignal.content ? (
|
|
320
|
+
<builderContext.Provider value={props.builderContextSignal}>
|
|
321
|
+
{props.builderContextSignal.content ? (
|
|
388
322
|
<>
|
|
389
|
-
<
|
|
323
|
+
<View
|
|
324
|
+
key={forceReRenderCount}
|
|
390
325
|
ref={elementRef}
|
|
391
326
|
onClick={(event) => onClick(event)}
|
|
392
|
-
builder-content-id={builderContextSignal.content?.id}
|
|
327
|
+
builder-content-id={props.builderContextSignal.content?.id}
|
|
393
328
|
builder-model={props.model}
|
|
394
|
-
{...
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
: {})}
|
|
329
|
+
{...{
|
|
330
|
+
// currently, we can't set the actual ID here. // we don't need it right now, we just need to identify content divs for testing.
|
|
331
|
+
dataSet: {
|
|
332
|
+
"builder-content-id": "",
|
|
333
|
+
},
|
|
334
|
+
}}
|
|
402
335
|
{...(props.showContent
|
|
403
336
|
? {}
|
|
404
337
|
: {
|
|
@@ -406,31 +339,12 @@ function RenderContent(props) {
|
|
|
406
339
|
"aria-hidden": true,
|
|
407
340
|
})}
|
|
408
341
|
>
|
|
409
|
-
{props.
|
|
410
|
-
|
|
411
|
-
<InlinedScript scriptStr={scriptStr} />
|
|
412
|
-
</>
|
|
413
|
-
) : null}
|
|
414
|
-
|
|
415
|
-
{TARGET !== "reactNative" ? (
|
|
416
|
-
<>
|
|
417
|
-
<RenderContentStyles
|
|
418
|
-
contentId={builderContextSignal.content?.id}
|
|
419
|
-
cssCode={builderContextSignal.content?.data?.cssCode}
|
|
420
|
-
customFonts={builderContextSignal.content?.data?.customFonts}
|
|
421
|
-
/>
|
|
422
|
-
</>
|
|
423
|
-
) : null}
|
|
424
|
-
|
|
425
|
-
<RenderBlocks
|
|
426
|
-
blocks={builderContextSignal.content?.data?.blocks}
|
|
427
|
-
key={forceReRenderCount}
|
|
428
|
-
/>
|
|
429
|
-
</ScrollView>
|
|
342
|
+
{props.children}
|
|
343
|
+
</View>
|
|
430
344
|
</>
|
|
431
345
|
) : null}
|
|
432
346
|
</builderContext.Provider>
|
|
433
347
|
);
|
|
434
348
|
}
|
|
435
349
|
|
|
436
|
-
export default
|
|
350
|
+
export default EnableEditor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const getCssFromFont =
|
|
1
|
+
const getCssFromFont = font => {
|
|
2
2
|
var _a, _b;
|
|
3
3
|
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4
4
|
const name = family.split(",")[0];
|
|
@@ -35,9 +35,11 @@ font-weight: ${weight};
|
|
|
35
35
|
}
|
|
36
36
|
return str;
|
|
37
37
|
};
|
|
38
|
-
const getFontCss = ({
|
|
38
|
+
const getFontCss = ({
|
|
39
|
+
customFonts
|
|
40
|
+
}) => {
|
|
39
41
|
var _a;
|
|
40
|
-
return ((_a = customFonts == null ? void 0 : customFonts.map(
|
|
42
|
+
return ((_a = customFonts == null ? void 0 : customFonts.map(font => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
41
43
|
};
|
|
42
44
|
const getCss = ({
|
|
43
45
|
cssCode,
|
|
@@ -51,7 +53,4 @@ const getCss = ({
|
|
|
51
53
|
}
|
|
52
54
|
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
53
55
|
};
|
|
54
|
-
export {
|
|
55
|
-
getCss,
|
|
56
|
-
getFontCss
|
|
57
|
-
};
|
|
56
|
+
export { getCss, getFontCss }
|
package/src/components/{render-content/components/render-styles.jsx → content/components/styles.jsx}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import {
|
|
4
4
|
FlatList,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
} from "react-native";
|
|
11
11
|
import { useState } from "react";
|
|
12
12
|
import InlinedStyles from "../../inlined-styles";
|
|
13
|
-
import { getCss } from "./
|
|
14
|
-
import { getFontCss } from "./
|
|
13
|
+
import { getCss } from "./styles.helpers.js";
|
|
14
|
+
import { getFontCss } from "./styles.helpers.js";
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function ContentStyles(props) {
|
|
17
17
|
const [injectedStyles, setInjectedStyles] = useState(() =>
|
|
18
18
|
`
|
|
19
19
|
${getCss({
|
|
@@ -42,4 +42,4 @@ ${getFontCss({
|
|
|
42
42
|
return <InlinedStyles styles={injectedStyles} />;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export default
|
|
45
|
+
export default ContentStyles;
|
package/src/components/{render-content/render-content.helpers.js → content/content.helpers.js}
RENAMED
|
@@ -4,16 +4,17 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value
|
|
12
|
+
}) : obj[key] = value;
|
|
8
13
|
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
14
|
+
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
17
18
|
return a;
|
|
18
19
|
};
|
|
19
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
@@ -24,13 +25,15 @@ const getContextStateInitialValue = ({
|
|
|
24
25
|
}) => {
|
|
25
26
|
var _a, _b, _c;
|
|
26
27
|
const defaultValues = {};
|
|
27
|
-
(_b = (_a = content == null ? void 0 : content.data) == null ? void 0 : _a.inputs) == null ? void 0 : _b.forEach(
|
|
28
|
+
(_b = (_a = content == null ? void 0 : content.data) == null ? void 0 : _a.inputs) == null ? void 0 : _b.forEach(input => {
|
|
28
29
|
var _a2;
|
|
29
30
|
if (input.name && input.defaultValue !== void 0 && ((_a2 = content == null ? void 0 : content.data) == null ? void 0 : _a2.state) && content.data.state[input.name] === void 0) {
|
|
30
31
|
defaultValues[input.name] = input.defaultValue;
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
|
-
const stateToUse = __spreadValues(__spreadValues(__spreadValues({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
|
|
34
|
+
const stateToUse = __spreadValues(__spreadValues(__spreadValues({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
|
|
35
|
+
locale
|
|
36
|
+
} : {});
|
|
34
37
|
return __spreadValues(__spreadValues({}, defaultValues), stateToUse);
|
|
35
38
|
};
|
|
36
39
|
const getContentInitialValue = ({
|
|
@@ -42,7 +45,4 @@ const getContentInitialValue = ({
|
|
|
42
45
|
meta: content == null ? void 0 : content.meta
|
|
43
46
|
});
|
|
44
47
|
};
|
|
45
|
-
export {
|
|
46
|
-
getContentInitialValue,
|
|
47
|
-
getContextStateInitialValue
|
|
48
|
-
};
|
|
48
|
+
export { getContentInitialValue, getContextStateInitialValue }
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {
|
|
4
|
+
FlatList,
|
|
5
|
+
ScrollView,
|
|
6
|
+
View,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Image,
|
|
9
|
+
Text,
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
13
|
+
import {
|
|
14
|
+
components,
|
|
15
|
+
serializeComponentInfo,
|
|
16
|
+
} from "../../functions/register-component.js";
|
|
17
|
+
import Blocks from "../blocks/blocks";
|
|
18
|
+
import ContentStyles from "./components/styles";
|
|
19
|
+
import {
|
|
20
|
+
getContentInitialValue,
|
|
21
|
+
getContextStateInitialValue,
|
|
22
|
+
} from "./content.helpers.js";
|
|
23
|
+
import { TARGET } from "../../constants/target.js";
|
|
24
|
+
import { getRenderContentScriptString } from "../content-variants/helpers.js";
|
|
25
|
+
import EnableEditor from "./components/enable-editor";
|
|
26
|
+
import InlinedScript from "../inlined-script";
|
|
27
|
+
import { wrapComponentRef } from "./wrap-component-ref.js";
|
|
28
|
+
|
|
29
|
+
function ContentComponent(props) {
|
|
30
|
+
const [scriptStr, setScriptStr] = useState(() =>
|
|
31
|
+
getRenderContentScriptString({
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
33
|
+
variationId: props.content?.testVariationId,
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
35
|
+
contentId: props.content?.id,
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
function contentSetState(newRootState) {
|
|
40
|
+
builderContextSignal.rootState = newRootState;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const [registeredComponents, setRegisteredComponents] = useState(() =>
|
|
44
|
+
[
|
|
45
|
+
...getDefaultRegisteredComponents(),
|
|
46
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
47
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
48
|
+
// existing usage.
|
|
49
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
50
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
51
|
+
...components,
|
|
52
|
+
...(props.customComponents || []),
|
|
53
|
+
].reduce(
|
|
54
|
+
(acc, { component, ...info }) => ({
|
|
55
|
+
...acc,
|
|
56
|
+
[info.name]: {
|
|
57
|
+
component: component,
|
|
58
|
+
...serializeComponentInfo(info),
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
{}
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const [builderContextSignal, setBuilderContextSignal] = useState(() => ({
|
|
66
|
+
content: getContentInitialValue({
|
|
67
|
+
content: props.content,
|
|
68
|
+
data: props.data,
|
|
69
|
+
}),
|
|
70
|
+
localState: undefined,
|
|
71
|
+
rootState: getContextStateInitialValue({
|
|
72
|
+
content: props.content,
|
|
73
|
+
data: props.data,
|
|
74
|
+
locale: props.locale,
|
|
75
|
+
}),
|
|
76
|
+
rootSetState: contentSetState,
|
|
77
|
+
context: props.context || {},
|
|
78
|
+
apiKey: props.apiKey,
|
|
79
|
+
apiVersion: props.apiVersion,
|
|
80
|
+
componentInfos: [
|
|
81
|
+
...getDefaultRegisteredComponents(),
|
|
82
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
83
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
84
|
+
// existing usage.
|
|
85
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
86
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
87
|
+
...components,
|
|
88
|
+
...(props.customComponents || []),
|
|
89
|
+
].reduce(
|
|
90
|
+
(acc, { component: _, ...info }) => ({
|
|
91
|
+
...acc,
|
|
92
|
+
[info.name]: serializeComponentInfo(info),
|
|
93
|
+
}),
|
|
94
|
+
{}
|
|
95
|
+
),
|
|
96
|
+
inheritedStyles: {},
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<EnableEditor
|
|
101
|
+
content={props.content}
|
|
102
|
+
model={props.model}
|
|
103
|
+
context={props.context}
|
|
104
|
+
apiKey={props.apiKey}
|
|
105
|
+
canTrack={props.canTrack}
|
|
106
|
+
locale={props.locale}
|
|
107
|
+
includeRefs={props.includeRefs}
|
|
108
|
+
enrich={props.enrich}
|
|
109
|
+
classNameProp={props.classNameProp}
|
|
110
|
+
showContent={props.showContent}
|
|
111
|
+
builderContextSignal={builderContextSignal}
|
|
112
|
+
{...{
|
|
113
|
+
setBuilderContextSignal: setBuilderContextSignal,
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
{props.isSsrAbTest ? (
|
|
117
|
+
<>
|
|
118
|
+
<InlinedScript scriptStr={scriptStr} />
|
|
119
|
+
</>
|
|
120
|
+
) : null}
|
|
121
|
+
|
|
122
|
+
{TARGET !== "reactNative" ? (
|
|
123
|
+
<>
|
|
124
|
+
<ContentStyles
|
|
125
|
+
contentId={builderContextSignal.content?.id}
|
|
126
|
+
cssCode={builderContextSignal.content?.data?.cssCode}
|
|
127
|
+
customFonts={builderContextSignal.content?.data?.customFonts}
|
|
128
|
+
/>
|
|
129
|
+
</>
|
|
130
|
+
) : null}
|
|
131
|
+
|
|
132
|
+
<Blocks
|
|
133
|
+
blocks={builderContextSignal.content?.data?.blocks}
|
|
134
|
+
context={builderContextSignal}
|
|
135
|
+
registeredComponents={registeredComponents}
|
|
136
|
+
/>
|
|
137
|
+
</EnableEditor>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default ContentComponent;
|