@builder.io/sdk-react-native 0.4.5 → 0.5.1
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 +9 -3
- 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 +27 -40
- 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/context/components.context.js +6 -0
- 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 +61 -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 +148 -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/context/components.context.js +5 -0
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -30,23 +30,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const react_native_1 = require("react-native");
|
|
32
32
|
const react_1 = require("react");
|
|
33
|
-
const get_block_actions_js_1 = require("../../functions/get-block-actions.js");
|
|
34
33
|
const get_block_component_options_js_1 = require("../../functions/get-block-component-options.js");
|
|
35
34
|
const get_block_properties_js_1 = require("../../functions/get-block-properties.js");
|
|
36
35
|
const get_processed_block_js_1 = require("../../functions/get-processed-block.js");
|
|
37
36
|
const block_styles_1 = __importDefault(require("./components/block-styles"));
|
|
38
37
|
const block_helpers_js_1 = require("./block.helpers.js");
|
|
39
38
|
const repeated_block_1 = __importDefault(require("./components/repeated-block"));
|
|
40
|
-
const target_js_1 = require("../../constants/target.js");
|
|
41
39
|
const extract_text_styles_js_1 = require("../../functions/extract-text-styles.js");
|
|
42
|
-
const
|
|
43
|
-
const
|
|
40
|
+
const component_ref_1 = __importDefault(require("./components/component-ref/component-ref"));
|
|
41
|
+
const block_wrapper_1 = __importDefault(require("./components/block-wrapper"));
|
|
44
42
|
function Block(props) {
|
|
45
|
-
var _a, _b, _c;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
function blockComponent() {
|
|
45
|
+
return (0, block_helpers_js_1.getComponent)({
|
|
46
|
+
block: props.block,
|
|
47
|
+
context: props.context,
|
|
48
|
+
registeredComponents: props.registeredComponents,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
50
51
|
function repeatItem() {
|
|
51
52
|
return (0, block_helpers_js_1.getRepeatItemData)({
|
|
52
53
|
block: props.block,
|
|
@@ -65,7 +66,9 @@ function Block(props) {
|
|
|
65
66
|
shouldEvaluateBindings: true,
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
function Tag() {
|
|
70
|
+
return props.block.tagName || "div";
|
|
71
|
+
}
|
|
69
72
|
function canShowBlock() {
|
|
70
73
|
if ("hide" in processedBlock()) {
|
|
71
74
|
return !processedBlock().hide;
|
|
@@ -75,71 +78,39 @@ function Block(props) {
|
|
|
75
78
|
}
|
|
76
79
|
return true;
|
|
77
80
|
}
|
|
78
|
-
function actions() {
|
|
79
|
-
return (0, get_block_actions_js_1.getBlockActions)({
|
|
80
|
-
block: processedBlock(),
|
|
81
|
-
rootState: props.context.rootState,
|
|
82
|
-
rootSetState: props.context.rootSetState,
|
|
83
|
-
localState: props.context.localState,
|
|
84
|
-
context: props.context.context,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function attributes() {
|
|
88
|
-
const blockProperties = (0, get_block_properties_js_1.getBlockProperties)(processedBlock());
|
|
89
|
-
return {
|
|
90
|
-
...blockProperties,
|
|
91
|
-
...(target_js_1.TARGET === "reactNative"
|
|
92
|
-
? {
|
|
93
|
-
style: (0, get_react_native_block_styles_js_1.getReactNativeBlockStyles)({
|
|
94
|
-
block: processedBlock(),
|
|
95
|
-
context: props.context,
|
|
96
|
-
blockStyles: blockProperties.style,
|
|
97
|
-
}),
|
|
98
|
-
}
|
|
99
|
-
: {}),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
81
|
function childrenWithoutParentComponent() {
|
|
103
|
-
var _a;
|
|
82
|
+
var _a, _b;
|
|
104
83
|
/**
|
|
105
84
|
* When there is no `componentRef`, there might still be children that need to be rendered. In this case,
|
|
106
85
|
* we render them outside of `componentRef`.
|
|
107
86
|
* NOTE: We make sure not to render this if `repeatItemData` is non-null, because that means we are rendering an array of
|
|
108
87
|
* blocks, and the children will be repeated within those blocks.
|
|
109
88
|
*/
|
|
110
|
-
const shouldRenderChildrenOutsideRef = !(
|
|
89
|
+
const shouldRenderChildrenOutsideRef = !((_a = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _a === void 0 ? void 0 : _a.component) && !repeatItem();
|
|
111
90
|
return shouldRenderChildrenOutsideRef
|
|
112
|
-
? (
|
|
91
|
+
? (_b = processedBlock().children) !== null && _b !== void 0 ? _b : []
|
|
113
92
|
: [];
|
|
114
93
|
}
|
|
115
|
-
function
|
|
116
|
-
var _a;
|
|
94
|
+
function componentRefProps() {
|
|
95
|
+
var _a, _b, _c, _d, _e, _f;
|
|
117
96
|
return {
|
|
118
97
|
blockChildren: (_a = processedBlock().children) !== null && _a !== void 0 ? _a : [],
|
|
119
|
-
componentRef:
|
|
98
|
+
componentRef: (_b = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _b === void 0 ? void 0 : _b.component,
|
|
120
99
|
componentOptions: {
|
|
121
100
|
...(0, get_block_component_options_js_1.getBlockComponentOptions)(processedBlock()),
|
|
122
|
-
/**
|
|
123
|
-
* These attributes are passed to the wrapper element when there is one. If `noWrap` is set to true, then
|
|
124
|
-
* they are provided to the component itself directly.
|
|
125
|
-
*/
|
|
126
|
-
...(!(component === null || component === void 0 ? void 0 : component.noWrap)
|
|
127
|
-
? {}
|
|
128
|
-
: {
|
|
129
|
-
attributes: {
|
|
130
|
-
...attributes(),
|
|
131
|
-
...actions(),
|
|
132
|
-
},
|
|
133
|
-
}),
|
|
134
101
|
builderContext: props.context,
|
|
135
|
-
...((
|
|
102
|
+
...(((_c = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _c === void 0 ? void 0 : _c.name) === "Symbol" ||
|
|
103
|
+
((_d = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _d === void 0 ? void 0 : _d.name) === "Columns"
|
|
136
104
|
? {
|
|
137
|
-
builderComponents: props.
|
|
105
|
+
builderComponents: props.registeredComponents,
|
|
138
106
|
}
|
|
139
107
|
: {}),
|
|
140
108
|
},
|
|
141
109
|
context: childrenContext,
|
|
142
|
-
|
|
110
|
+
registeredComponents: props.registeredComponents,
|
|
111
|
+
builderBlock: processedBlock(),
|
|
112
|
+
includeBlockProps: ((_e = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _e === void 0 ? void 0 : _e.noWrap) === true,
|
|
113
|
+
isInteractive: !((_f = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _f === void 0 ? void 0 : _f.isRSC),
|
|
143
114
|
};
|
|
144
115
|
}
|
|
145
116
|
const [childrenContext, setChildrenContext] = (0, react_1.useState)(() => ({
|
|
@@ -150,22 +121,21 @@ function Block(props) {
|
|
|
150
121
|
rootSetState: props.context.rootSetState,
|
|
151
122
|
content: props.context.content,
|
|
152
123
|
context: props.context.context,
|
|
153
|
-
|
|
154
|
-
inheritedStyles: (0, extract_text_styles_js_1.extractTextStyles)((0,
|
|
124
|
+
componentInfos: props.context.componentInfos,
|
|
125
|
+
inheritedStyles: (0, extract_text_styles_js_1.extractTextStyles)((0, get_block_properties_js_1.getBlockProperties)({
|
|
155
126
|
block: processedBlock(),
|
|
156
127
|
context: props.context,
|
|
157
|
-
|
|
158
|
-
})),
|
|
128
|
+
}).style || {}),
|
|
159
129
|
}));
|
|
160
|
-
return (React.createElement(React.Fragment, null, canShowBlock() ? (React.createElement(React.Fragment, null, !(
|
|
161
|
-
(0, block_helpers_js_1.isEmptyHtmlElement)(Tag) ? (React.createElement(React.Fragment, null,
|
|
162
|
-
React.createElement(
|
|
163
|
-
!(0, block_helpers_js_1.isEmptyHtmlElement)(Tag) && repeatItem() ? (React.createElement(React.Fragment, null, (
|
|
164
|
-
!(0, block_helpers_js_1.isEmptyHtmlElement)(Tag) && !repeatItem() ? (React.createElement(React.Fragment, null,
|
|
165
|
-
React.createElement(
|
|
166
|
-
React.createElement(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
React.createElement(
|
|
130
|
+
return (React.createElement(React.Fragment, null, canShowBlock() ? (React.createElement(React.Fragment, null, !((_a = blockComponent === null || blockComponent === void 0 ? void 0 : blockComponent()) === null || _a === void 0 ? void 0 : _a.noWrap) ? (React.createElement(React.Fragment, null,
|
|
131
|
+
(0, block_helpers_js_1.isEmptyHtmlElement)(Tag()) ? (React.createElement(React.Fragment, null,
|
|
132
|
+
React.createElement(block_wrapper_1.default, { Wrapper: Tag(), block: processedBlock(), context: props.context, hasChildren: false }))) : null,
|
|
133
|
+
!(0, block_helpers_js_1.isEmptyHtmlElement)(Tag()) && repeatItem() ? (React.createElement(React.Fragment, null, (_b = repeatItem()) === null || _b === void 0 ? void 0 : _b.map((data, index) => (React.createElement(repeated_block_1.default, { key: index, repeatContext: data.context, block: data.block, registeredComponents: props.registeredComponents }))))) : null,
|
|
134
|
+
!(0, block_helpers_js_1.isEmptyHtmlElement)(Tag()) && !repeatItem() ? (React.createElement(React.Fragment, null,
|
|
135
|
+
React.createElement(block_wrapper_1.default, { Wrapper: Tag(), block: processedBlock(), context: props.context, hasChildren: true },
|
|
136
|
+
React.createElement(component_ref_1.default, { ...componentRefProps() }), (_c = childrenWithoutParentComponent()) === null || _c === void 0 ? void 0 :
|
|
137
|
+
_c.map((child) => (React.createElement(Block, { key: "block-" + child.id, block: child, context: childrenContext, registeredComponents: props.registeredComponents }))), (_d = childrenWithoutParentComponent()) === null || _d === void 0 ? void 0 :
|
|
138
|
+
_d.map((child) => (React.createElement(block_styles_1.default, { key: "block-style-" + child.id, block: child, context: childrenContext })))))) : null)) : (React.createElement(React.Fragment, null,
|
|
139
|
+
React.createElement(component_ref_1.default, { ...componentRefProps() }))))) : null));
|
|
170
140
|
}
|
|
171
141
|
exports.default = Block;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const interactive_element_helpers_js_1 = require("../interactive-element/interactive-element.helpers.js");
|
|
30
|
+
function BlockWrapper(props) {
|
|
31
|
+
return (React.createElement(React.Fragment, null, props.hasChildren ? (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(props.Wrapper, { ...(0, interactive_element_helpers_js_1.getBlockProps)({
|
|
33
|
+
block: props.block,
|
|
34
|
+
contextValue: props.context,
|
|
35
|
+
}) }, props.children))) : (React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement(props.Wrapper, { ...(0, interactive_element_helpers_js_1.getBlockProps)({
|
|
37
|
+
block: props.block,
|
|
38
|
+
contextValue: props.context,
|
|
39
|
+
}) })))));
|
|
40
|
+
}
|
|
41
|
+
exports.default = BlockWrapper;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const get_block_actions_js_1 = require("../../../functions/get-block-actions.js");
|
|
30
|
+
const get_block_properties_js_1 = require("../../../functions/get-block-properties.js");
|
|
31
|
+
function BlockWrapper(props) {
|
|
32
|
+
return (React.createElement(React.Fragment, null, props.hasChildren ? (React.createElement(React.Fragment, null,
|
|
33
|
+
React.createElement(props.Wrapper, { ...(0, get_block_properties_js_1.getBlockProperties)({
|
|
34
|
+
block: props.block,
|
|
35
|
+
context: props.context,
|
|
36
|
+
}), ...(0, get_block_actions_js_1.getBlockActions)({
|
|
37
|
+
block: props.block,
|
|
38
|
+
rootState: props.context.rootState,
|
|
39
|
+
rootSetState: props.context.rootSetState,
|
|
40
|
+
localState: props.context.localState,
|
|
41
|
+
context: props.context.context,
|
|
42
|
+
stripPrefix: true,
|
|
43
|
+
}) }, props.children))) : (React.createElement(React.Fragment, null,
|
|
44
|
+
React.createElement(props.Wrapper, { ...(0, get_block_properties_js_1.getBlockProperties)({
|
|
45
|
+
block: props.block,
|
|
46
|
+
context: props.context,
|
|
47
|
+
}), ...(0, get_block_actions_js_1.getBlockActions)({
|
|
48
|
+
block: props.block,
|
|
49
|
+
rootState: props.context.rootState,
|
|
50
|
+
rootSetState: props.context.rootSetState,
|
|
51
|
+
localState: props.context.localState,
|
|
52
|
+
context: props.context.context,
|
|
53
|
+
stripPrefix: true,
|
|
54
|
+
}) })))));
|
|
55
|
+
}
|
|
56
|
+
exports.default = BlockWrapper;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWrapperProps = void 0;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value
|
|
13
|
+
}) : obj[key] = value;
|
|
14
|
+
var __spreadValues = (a, b) => {
|
|
15
|
+
for (var prop in b || (b = {}))
|
|
16
|
+
if (__hasOwnProp.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
if (__getOwnPropSymbols)
|
|
19
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
+
if (__propIsEnum.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
};
|
|
25
|
+
const get_block_properties_js_1 = require("../../../../functions/get-block-properties.js");
|
|
26
|
+
const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
27
|
+
const interactiveElementProps = {
|
|
28
|
+
Wrapper: componentRef,
|
|
29
|
+
block: builderBlock,
|
|
30
|
+
context,
|
|
31
|
+
wrapperProps: componentOptions
|
|
32
|
+
};
|
|
33
|
+
return isInteractive ? interactiveElementProps : __spreadValues(__spreadValues({}, componentOptions), includeBlockProps ? {
|
|
34
|
+
attributes: (0, get_block_properties_js_1.getBlockProperties)({
|
|
35
|
+
block: builderBlock,
|
|
36
|
+
context: contextValue
|
|
37
|
+
})
|
|
38
|
+
} : {});
|
|
39
|
+
};
|
|
40
|
+
exports.getWrapperProps = getWrapperProps;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const react_native_1 = require("react-native");
|
|
32
|
+
const react_1 = require("react");
|
|
33
|
+
const block_styles_1 = __importDefault(require("../block-styles"));
|
|
34
|
+
const block_1 = __importDefault(require("../../block"));
|
|
35
|
+
const interactive_element_1 = __importDefault(require("../interactive-element"));
|
|
36
|
+
const component_ref_helpers_js_1 = require("./component-ref.helpers.js");
|
|
37
|
+
const builder_context_1 = __importDefault(require("../../../../context/builder.context"));
|
|
38
|
+
function ComponentRef(props) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const [Wrapper, setWrapper] = (0, react_1.useState)(() => props.isInteractive ? interactive_element_1.default : props.componentRef);
|
|
41
|
+
return (React.createElement(builder_context_1.default.Provider, { value: {
|
|
42
|
+
content: props.context.content,
|
|
43
|
+
rootState: props.context.rootState,
|
|
44
|
+
localState: props.context.localState,
|
|
45
|
+
context: props.context.context,
|
|
46
|
+
apiKey: props.context.apiKey,
|
|
47
|
+
componentInfos: props.context.componentInfos,
|
|
48
|
+
inheritedStyles: props.context.inheritedStyles,
|
|
49
|
+
apiVersion: props.context.apiVersion,
|
|
50
|
+
} }, props.componentRef ? (React.createElement(React.Fragment, null,
|
|
51
|
+
React.createElement(Wrapper, { ...(0, component_ref_helpers_js_1.getWrapperProps)({
|
|
52
|
+
componentOptions: props.componentOptions,
|
|
53
|
+
builderBlock: props.builderBlock,
|
|
54
|
+
context: props.context,
|
|
55
|
+
componentRef: props.componentRef,
|
|
56
|
+
includeBlockProps: props.includeBlockProps,
|
|
57
|
+
isInteractive: props.isInteractive,
|
|
58
|
+
contextValue: props.context,
|
|
59
|
+
}) }, (_a = props.blockChildren) === null || _a === void 0 ? void 0 :
|
|
60
|
+
_a.map((child) => (React.createElement(block_1.default, { key: "block-" + child.id, block: child, context: props.context, registeredComponents: props.registeredComponents }))), (_b = props.blockChildren) === null || _b === void 0 ? void 0 :
|
|
61
|
+
_b.map((child) => (React.createElement(block_styles_1.default, { key: "block-style-" + child.id, block: child, context: props.context })))))) : null));
|
|
62
|
+
}
|
|
63
|
+
exports.default = ComponentRef;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const react_native_1 = require("react-native");
|
|
32
|
+
const react_1 = require("react");
|
|
33
|
+
const block_styles_1 = __importDefault(require("./block-styles"));
|
|
34
|
+
const block_1 = __importDefault(require("../block"));
|
|
35
|
+
const get_block_properties_js_1 = require("../../../functions/get-block-properties.js");
|
|
36
|
+
const block_wrapper_1 = __importDefault(require("./block-wrapper"));
|
|
37
|
+
const builder_context_js_1 = __importDefault(require("../../../context/builder.context.js"));
|
|
38
|
+
function ComponentRef(props) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const [Wrapper, setWrapper] = (0, react_1.useState)(() => props.isRSC ? props.componentRef : block_wrapper_1.default);
|
|
41
|
+
function wrapperProps() {
|
|
42
|
+
const blockWrapperProps = {
|
|
43
|
+
Wrapper: props.componentRef,
|
|
44
|
+
block: props.builderBlock,
|
|
45
|
+
context: props.context,
|
|
46
|
+
wrapperProps: props.componentOptions,
|
|
47
|
+
shouldNestAttributes: true,
|
|
48
|
+
};
|
|
49
|
+
return props.isRSC
|
|
50
|
+
? {
|
|
51
|
+
...props.componentOptions,
|
|
52
|
+
/**
|
|
53
|
+
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the * component itself directly. Otherwise, they are provided to the wrapper element. */ ...(props.includeBlockProps
|
|
54
|
+
? {
|
|
55
|
+
attributes: (0, get_block_properties_js_1.getBlockProperties)({
|
|
56
|
+
block: props.builderBlock,
|
|
57
|
+
context: props.context,
|
|
58
|
+
}),
|
|
59
|
+
}
|
|
60
|
+
: {}),
|
|
61
|
+
}
|
|
62
|
+
: blockWrapperProps;
|
|
63
|
+
}
|
|
64
|
+
return (React.createElement(builder_context_js_1.default.Provider, { value: {
|
|
65
|
+
content: props.context.content,
|
|
66
|
+
rootState: props.context.rootState,
|
|
67
|
+
localState: props.context.localState,
|
|
68
|
+
context: props.context.context,
|
|
69
|
+
apiKey: props.context.apiKey,
|
|
70
|
+
componentInfos: props.context.componentInfos,
|
|
71
|
+
inheritedStyles: props.context.inheritedStyles,
|
|
72
|
+
apiVersion: props.context.apiVersion,
|
|
73
|
+
} },
|
|
74
|
+
React.createElement(Wrapper, { ...wrapperProps() },
|
|
75
|
+
" ", (_a = props.blockChildren) === null || _a === void 0 ? void 0 :
|
|
76
|
+
_a.map((child) => (React.createElement(block_1.default, { key: "block-" + child.id, block: child, context: props.context, registeredComponents: props.registeredComponents }))),
|
|
77
|
+
" ", (_b = props.blockChildren) === null || _b === void 0 ? void 0 :
|
|
78
|
+
_b.map((child) => (React.createElement(block_styles_1.default, { key: "block-style-" + child.id, block: child, context: props.context }))),
|
|
79
|
+
" ")));
|
|
80
|
+
}
|
|
81
|
+
exports.default = ComponentRef;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBlockProps = void 0;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
const get_block_actions_1 = require("../../../../functions/get-block-actions");
|
|
21
|
+
const get_block_properties_1 = require("../../../../functions/get-block-properties");
|
|
22
|
+
const getBlockProps = ({ block, contextValue }) => {
|
|
23
|
+
const blockProps = __spreadValues(__spreadValues({}, (0, get_block_properties_1.getBlockProperties)({
|
|
24
|
+
block,
|
|
25
|
+
context: contextValue
|
|
26
|
+
})), (0, get_block_actions_1.getBlockActions)({
|
|
27
|
+
block,
|
|
28
|
+
rootState: contextValue.rootState,
|
|
29
|
+
rootSetState: contextValue.rootSetState,
|
|
30
|
+
localState: contextValue.localState,
|
|
31
|
+
context: contextValue.context
|
|
32
|
+
}));
|
|
33
|
+
return blockProps;
|
|
34
|
+
};
|
|
35
|
+
exports.getBlockProps = getBlockProps;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const interactive_element_helpers_js_1 = require("./interactive-element.helpers.js");
|
|
30
|
+
function InteractiveElement(props) {
|
|
31
|
+
return (React.createElement(props.Wrapper, { ...props.wrapperProps, attributes: (0, interactive_element_helpers_js_1.getBlockProps)({
|
|
32
|
+
block: props.block,
|
|
33
|
+
contextValue: props.context,
|
|
34
|
+
}) }, props.children));
|
|
35
|
+
}
|
|
36
|
+
exports.default = InteractiveElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const get_block_actions_js_1 = require("../../../functions/get-block-actions.js");
|
|
30
|
+
const get_block_properties_js_1 = require("../../../functions/get-block-properties.js");
|
|
31
|
+
function InteractiveElement(props) {
|
|
32
|
+
return (React.createElement(props.Wrapper, { ...props.wrapperProps, attributes: {
|
|
33
|
+
...(0, get_block_properties_js_1.getBlockProperties)({
|
|
34
|
+
block: props.block,
|
|
35
|
+
context: props.context,
|
|
36
|
+
}),
|
|
37
|
+
...(0, get_block_actions_js_1.getBlockActions)({
|
|
38
|
+
block: props.block,
|
|
39
|
+
rootState: props.context.rootState,
|
|
40
|
+
rootSetState: props.context.rootSetState,
|
|
41
|
+
localState: props.context.localState,
|
|
42
|
+
context: props.context.context,
|
|
43
|
+
}),
|
|
44
|
+
} }, props.children));
|
|
45
|
+
}
|
|
46
|
+
exports.default = InteractiveElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -30,11 +30,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const react_native_1 = require("react-native");
|
|
32
32
|
const react_1 = require("react");
|
|
33
|
-
const
|
|
33
|
+
const builder_context_1 = __importDefault(require("../../../context/builder.context"));
|
|
34
34
|
const block_1 = __importDefault(require("../block"));
|
|
35
35
|
function RepeatedBlock(props) {
|
|
36
36
|
const [store, setStore] = (0, react_1.useState)(() => props.repeatContext);
|
|
37
|
-
return (React.createElement(
|
|
38
|
-
React.createElement(block_1.default, { block: props.block, context: store,
|
|
37
|
+
return (React.createElement(builder_context_1.default.Provider, { value: store },
|
|
38
|
+
React.createElement(block_1.default, { block: props.block, context: store, registeredComponents: props.registeredComponents })));
|
|
39
39
|
}
|
|
40
40
|
exports.default = RepeatedBlock;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -58,7 +58,10 @@ function BlocksWrapper(props) {
|
|
|
58
58
|
}
|
|
59
59
|
return (React.createElement(react_native_1.View, { "builder-path": props.path, "builder-parent-id": props.parent, dataSet: {
|
|
60
60
|
class: className(),
|
|
61
|
-
}, style:
|
|
61
|
+
}, style: {
|
|
62
|
+
...styles.view1,
|
|
63
|
+
...props.styleProp,
|
|
64
|
+
}, onClick: (event) => onClick(), onMouseEnter: (event) => onMouseEnter(), onKeyPress: (event) => onClick() }, props.children));
|
|
62
65
|
}
|
|
63
66
|
const styles = react_native_1.StyleSheet.create({
|
|
64
67
|
view1: { display: "flex", flexDirection: "column", alignItems: "stretch" },
|