@builder.io/sdk-react-native 1.0.31-2 → 1.0.32
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/lib/browser/commonjs/blocks/image/component-info.js +5 -0
- package/lib/browser/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/browser/commonjs/components/block/block.helpers.js +27 -7
- package/lib/browser/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/browser/commonjs/components/block/block.js +9 -13
- package/lib/browser/commonjs/components/block/block.js.map +1 -1
- package/lib/browser/commonjs/components/block/components/block-wrapper.js.map +1 -1
- package/lib/browser/commonjs/components/content/components/enable-editor.js +9 -9
- package/lib/browser/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/commonjs/components/content/components/styles.helpers.js +2 -2
- package/lib/browser/commonjs/components/content/components/styles.helpers.js.map +1 -1
- package/lib/browser/commonjs/components/content/content.js +0 -1
- package/lib/browser/commonjs/components/content/content.js.map +1 -1
- package/lib/browser/commonjs/constants/sdk-version.js +1 -1
- package/lib/browser/commonjs/constants/sdk-version.js.map +1 -1
- package/lib/browser/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/browser/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/browser/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -4
- package/lib/browser/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/browser/commonjs/functions/get-block-actions.js +1 -2
- package/lib/browser/commonjs/functions/get-block-actions.js.map +1 -1
- package/lib/browser/commonjs/functions/get-block-component-options.js +1 -5
- package/lib/browser/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/browser/commonjs/functions/get-content/index.js +1 -2
- package/lib/browser/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/browser/commonjs/helpers/cookie.js +2 -12
- package/lib/browser/commonjs/helpers/cookie.js.map +1 -1
- package/lib/browser/module/blocks/image/component-info.js +5 -0
- package/lib/browser/module/blocks/image/component-info.js.map +1 -1
- package/lib/browser/module/components/block/block.helpers.js +22 -4
- package/lib/browser/module/components/block/block.helpers.js.map +1 -1
- package/lib/browser/module/components/block/block.js +10 -14
- package/lib/browser/module/components/block/block.js.map +1 -1
- package/lib/browser/module/components/block/components/block-wrapper.js.map +1 -1
- package/lib/browser/module/components/content/components/enable-editor.js +9 -9
- package/lib/browser/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/module/components/content/components/styles.helpers.js +2 -2
- package/lib/browser/module/components/content/components/styles.helpers.js.map +1 -1
- package/lib/browser/module/components/content/content.js +0 -1
- package/lib/browser/module/components/content/content.js.map +1 -1
- package/lib/browser/module/constants/sdk-version.js +1 -1
- package/lib/browser/module/constants/sdk-version.js.map +1 -1
- package/lib/browser/module/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/browser/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/browser/module/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -5
- package/lib/browser/module/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/browser/module/functions/get-block-actions.js +1 -2
- package/lib/browser/module/functions/get-block-actions.js.map +1 -1
- package/lib/browser/module/functions/get-block-component-options.js +1 -5
- package/lib/browser/module/functions/get-block-component-options.js.map +1 -1
- package/lib/browser/module/functions/get-content/index.js +1 -2
- package/lib/browser/module/functions/get-content/index.js.map +1 -1
- package/lib/browser/module/helpers/cookie.js +2 -11
- package/lib/browser/module/helpers/cookie.js.map +1 -1
- package/lib/browser/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/browser/typescript/blocks/image/image.types.d.ts +1 -0
- package/lib/browser/typescript/blocks/image/image.types.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/block.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/block.helpers.d.ts +20 -2
- package/lib/browser/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/components/block-wrapper.d.ts +0 -1
- package/lib/browser/typescript/components/block/components/block-wrapper.d.ts.map +1 -1
- package/lib/browser/typescript/components/content/components/enable-editor.d.ts +1 -1
- package/lib/browser/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/browser/typescript/components/content/content.d.ts.map +1 -1
- package/lib/browser/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/browser/typescript/constants/sdk-version.d.ts.map +1 -1
- package/lib/browser/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/browser/typescript/helpers/cookie.d.ts +0 -1
- package/lib/browser/typescript/helpers/cookie.d.ts.map +1 -1
- package/lib/edge/commonjs/blocks/image/component-info.js +5 -0
- package/lib/edge/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/edge/commonjs/components/block/block.helpers.js +27 -7
- package/lib/edge/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/edge/commonjs/components/block/block.js +9 -13
- package/lib/edge/commonjs/components/block/block.js.map +1 -1
- package/lib/edge/commonjs/components/block/components/block-wrapper.js.map +1 -1
- package/lib/edge/commonjs/components/content/components/enable-editor.js +9 -9
- package/lib/edge/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/commonjs/components/content/components/styles.helpers.js +2 -2
- package/lib/edge/commonjs/components/content/components/styles.helpers.js.map +1 -1
- package/lib/edge/commonjs/components/content/content.js +0 -1
- package/lib/edge/commonjs/components/content/content.js.map +1 -1
- package/lib/edge/commonjs/constants/sdk-version.js +1 -1
- package/lib/edge/commonjs/constants/sdk-version.js.map +1 -1
- package/lib/edge/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/edge/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/edge/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -4
- package/lib/edge/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/edge/commonjs/functions/get-block-actions.js +1 -2
- package/lib/edge/commonjs/functions/get-block-actions.js.map +1 -1
- package/lib/edge/commonjs/functions/get-block-component-options.js +1 -5
- package/lib/edge/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/edge/commonjs/functions/get-content/index.js +1 -2
- package/lib/edge/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/edge/commonjs/helpers/cookie.js +2 -12
- package/lib/edge/commonjs/helpers/cookie.js.map +1 -1
- package/lib/edge/module/blocks/image/component-info.js +5 -0
- package/lib/edge/module/blocks/image/component-info.js.map +1 -1
- package/lib/edge/module/components/block/block.helpers.js +22 -4
- package/lib/edge/module/components/block/block.helpers.js.map +1 -1
- package/lib/edge/module/components/block/block.js +10 -14
- package/lib/edge/module/components/block/block.js.map +1 -1
- package/lib/edge/module/components/block/components/block-wrapper.js.map +1 -1
- package/lib/edge/module/components/content/components/enable-editor.js +9 -9
- package/lib/edge/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/module/components/content/components/styles.helpers.js +2 -2
- package/lib/edge/module/components/content/components/styles.helpers.js.map +1 -1
- package/lib/edge/module/components/content/content.js +0 -1
- package/lib/edge/module/components/content/content.js.map +1 -1
- package/lib/edge/module/constants/sdk-version.js +1 -1
- package/lib/edge/module/constants/sdk-version.js.map +1 -1
- package/lib/edge/module/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/edge/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/edge/module/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -5
- package/lib/edge/module/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/edge/module/functions/get-block-actions.js +1 -2
- package/lib/edge/module/functions/get-block-actions.js.map +1 -1
- package/lib/edge/module/functions/get-block-component-options.js +1 -5
- package/lib/edge/module/functions/get-block-component-options.js.map +1 -1
- package/lib/edge/module/functions/get-content/index.js +1 -2
- package/lib/edge/module/functions/get-content/index.js.map +1 -1
- package/lib/edge/module/helpers/cookie.js +2 -11
- package/lib/edge/module/helpers/cookie.js.map +1 -1
- package/lib/edge/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/edge/typescript/blocks/image/image.types.d.ts +1 -0
- package/lib/edge/typescript/blocks/image/image.types.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/block.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/block.helpers.d.ts +20 -2
- package/lib/edge/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/components/block-wrapper.d.ts +0 -1
- package/lib/edge/typescript/components/block/components/block-wrapper.d.ts.map +1 -1
- package/lib/edge/typescript/components/content/components/enable-editor.d.ts +1 -1
- package/lib/edge/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/edge/typescript/components/content/content.d.ts.map +1 -1
- package/lib/edge/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/edge/typescript/constants/sdk-version.d.ts.map +1 -1
- package/lib/edge/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/edge/typescript/helpers/cookie.d.ts +0 -1
- package/lib/edge/typescript/helpers/cookie.d.ts.map +1 -1
- package/lib/node/commonjs/blocks/image/component-info.js +5 -0
- package/lib/node/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/node/commonjs/components/block/block.helpers.js +27 -7
- package/lib/node/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/node/commonjs/components/block/block.js +9 -13
- package/lib/node/commonjs/components/block/block.js.map +1 -1
- package/lib/node/commonjs/components/block/components/block-wrapper.js.map +1 -1
- package/lib/node/commonjs/components/content/components/enable-editor.js +9 -9
- package/lib/node/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/commonjs/components/content/components/styles.helpers.js +2 -2
- package/lib/node/commonjs/components/content/components/styles.helpers.js.map +1 -1
- package/lib/node/commonjs/components/content/content.js +0 -1
- package/lib/node/commonjs/components/content/content.js.map +1 -1
- package/lib/node/commonjs/constants/sdk-version.js +1 -1
- package/lib/node/commonjs/constants/sdk-version.js.map +1 -1
- package/lib/node/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/node/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/node/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -4
- package/lib/node/commonjs/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/node/commonjs/functions/get-block-actions.js +1 -2
- package/lib/node/commonjs/functions/get-block-actions.js.map +1 -1
- package/lib/node/commonjs/functions/get-block-component-options.js +1 -5
- package/lib/node/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/node/commonjs/functions/get-content/index.js +1 -2
- package/lib/node/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/node/commonjs/helpers/cookie.js +2 -12
- package/lib/node/commonjs/helpers/cookie.js.map +1 -1
- package/lib/node/module/blocks/image/component-info.js +5 -0
- package/lib/node/module/blocks/image/component-info.js.map +1 -1
- package/lib/node/module/components/block/block.helpers.js +22 -4
- package/lib/node/module/components/block/block.helpers.js.map +1 -1
- package/lib/node/module/components/block/block.js +10 -14
- package/lib/node/module/components/block/block.js.map +1 -1
- package/lib/node/module/components/block/components/block-wrapper.js.map +1 -1
- package/lib/node/module/components/content/components/enable-editor.js +9 -9
- package/lib/node/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/module/components/content/components/styles.helpers.js +2 -2
- package/lib/node/module/components/content/components/styles.helpers.js.map +1 -1
- package/lib/node/module/components/content/content.js +0 -1
- package/lib/node/module/components/content/content.js.map +1 -1
- package/lib/node/module/constants/sdk-version.js +1 -1
- package/lib/node/module/constants/sdk-version.js.map +1 -1
- package/lib/node/module/functions/evaluate/edge-runtime/edge-runtime.js +4 -11
- package/lib/node/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/node/module/functions/evaluate/node-runtime/safeDynamicRequire.js +18 -5
- package/lib/node/module/functions/evaluate/node-runtime/safeDynamicRequire.js.map +1 -1
- package/lib/node/module/functions/get-block-actions.js +1 -2
- package/lib/node/module/functions/get-block-actions.js.map +1 -1
- package/lib/node/module/functions/get-block-component-options.js +1 -5
- package/lib/node/module/functions/get-block-component-options.js.map +1 -1
- package/lib/node/module/functions/get-content/index.js +1 -2
- package/lib/node/module/functions/get-content/index.js.map +1 -1
- package/lib/node/module/helpers/cookie.js +2 -11
- package/lib/node/module/helpers/cookie.js.map +1 -1
- package/lib/node/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/node/typescript/blocks/image/image.types.d.ts +1 -0
- package/lib/node/typescript/blocks/image/image.types.d.ts.map +1 -1
- package/lib/node/typescript/components/block/block.d.ts.map +1 -1
- package/lib/node/typescript/components/block/block.helpers.d.ts +20 -2
- package/lib/node/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/node/typescript/components/block/components/block-wrapper.d.ts +0 -1
- package/lib/node/typescript/components/block/components/block-wrapper.d.ts.map +1 -1
- package/lib/node/typescript/components/content/components/enable-editor.d.ts +1 -1
- package/lib/node/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/node/typescript/components/content/content.d.ts.map +1 -1
- package/lib/node/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/node/typescript/constants/sdk-version.d.ts.map +1 -1
- package/lib/node/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/node/typescript/helpers/cookie.d.ts +0 -1
- package/lib/node/typescript/helpers/cookie.d.ts.map +1 -1
- package/package.json +5 -8
- package/lib/node/index.cjs +0 -6910
- package/lib/node/index.mjs +0 -7477
- package/src/blocks/BaseText.tsx +0 -17
- package/src/blocks/accordion/accordion.tsx +0 -181
- package/src/blocks/accordion/accordion.types.ts +0 -12
- package/src/blocks/accordion/component-info.ts +0 -124
- package/src/blocks/accordion/helpers.ts +0 -3
- package/src/blocks/accordion/index.ts +0 -1
- package/src/blocks/button/button.tsx +0 -56
- package/src/blocks/button/button.types.ts +0 -7
- package/src/blocks/button/component-info.ts +0 -35
- package/src/blocks/button/index.ts +0 -1
- package/src/blocks/columns/columns.tsx +0 -199
- package/src/blocks/columns/columns.types.ts +0 -14
- package/src/blocks/columns/component-info.ts +0 -219
- package/src/blocks/columns/helpers.ts +0 -3
- package/src/blocks/columns/index.ts +0 -1
- package/src/blocks/custom-code/component-info.ts +0 -24
- package/src/blocks/custom-code/custom-code.tsx +0 -71
- package/src/blocks/custom-code/index.ts +0 -1
- package/src/blocks/embed/component-info.ts +0 -38
- package/src/blocks/embed/embed.tsx +0 -62
- package/src/blocks/embed/helpers.ts +0 -2
- package/src/blocks/embed/index.ts +0 -1
- package/src/blocks/form/form/component-info.ts +0 -233
- package/src/blocks/form/form/form.tsx +0 -324
- package/src/blocks/form/form/index.ts +0 -1
- package/src/blocks/form/input/component-info.ts +0 -47
- package/src/blocks/form/input/index.ts +0 -1
- package/src/blocks/form/input/input.tsx +0 -49
- package/src/blocks/form/select/component-info.ts +0 -44
- package/src/blocks/form/select/index.ts +0 -1
- package/src/blocks/form/select/select.tsx +0 -54
- package/src/blocks/form/submit-button/component-info.ts +0 -27
- package/src/blocks/form/submit-button/index.ts +0 -1
- package/src/blocks/form/submit-button/submit-button.tsx +0 -34
- package/src/blocks/fragment/component-info.ts +0 -8
- package/src/blocks/fragment/fragment.tsx +0 -18
- package/src/blocks/fragment/fragment.types.ts +0 -5
- package/src/blocks/fragment/index.ts +0 -1
- package/src/blocks/helpers.ts +0 -43
- package/src/blocks/image/component-info.ts +0 -124
- package/src/blocks/image/image.helpers.ts +0 -47
- package/src/blocks/image/image.tsx +0 -65
- package/src/blocks/image/image.types.ts +0 -19
- package/src/blocks/image/index.ts +0 -1
- package/src/blocks/img/component-info.ts +0 -16
- package/src/blocks/img/img.tsx +0 -55
- package/src/blocks/img/index.ts +0 -1
- package/src/blocks/raw-text/component-info.ts +0 -11
- package/src/blocks/raw-text/index.ts +0 -1
- package/src/blocks/raw-text/raw-text.tsx +0 -1
- package/src/blocks/section/component-info.ts +0 -41
- package/src/blocks/section/index.ts +0 -1
- package/src/blocks/section/section.tsx +0 -39
- package/src/blocks/section/section.types.ts +0 -6
- package/src/blocks/slot/component-info.ts +0 -15
- package/src/blocks/slot/index.ts +0 -1
- package/src/blocks/slot/slot.tsx +0 -42
- package/src/blocks/symbol/component-info.ts +0 -35
- package/src/blocks/symbol/index.ts +0 -1
- package/src/blocks/symbol/symbol.helpers.ts +0 -47
- package/src/blocks/symbol/symbol.tsx +0 -100
- package/src/blocks/symbol/symbol.types.ts +0 -17
- package/src/blocks/tabs/component-info.ts +0 -139
- package/src/blocks/tabs/index.ts +0 -1
- package/src/blocks/tabs/tabs.tsx +0 -79
- package/src/blocks/tabs/tabs.types.ts +0 -13
- package/src/blocks/text/component-info.ts +0 -20
- package/src/blocks/text/index.ts +0 -1
- package/src/blocks/text/text.tsx +0 -105
- package/src/blocks/text/text.types.ts +0 -4
- package/src/blocks/textarea/component-info.ts +0 -38
- package/src/blocks/textarea/index.ts +0 -1
- package/src/blocks/textarea/textarea.tsx +0 -41
- package/src/blocks/video/component-info.ts +0 -83
- package/src/blocks/video/index.ts +0 -1
- package/src/blocks/video/video.tsx +0 -70
- package/src/blocks/video/video.types.ts +0 -21
- package/src/components/block/animator.ts +0 -220
- package/src/components/block/block.helpers.ts +0 -106
- package/src/components/block/block.tsx +0 -235
- package/src/components/block/components/block-styles.tsx +0 -136
- package/src/components/block/components/block-wrapper.tsx +0 -53
- package/src/components/block/components/component-ref/component-ref.helpers.ts +0 -55
- package/src/components/block/components/component-ref/component-ref.tsx +0 -66
- package/src/components/block/components/interactive-element.tsx +0 -53
- package/src/components/block/components/repeated-block.tsx +0 -37
- package/src/components/block/types.ts +0 -6
- package/src/components/blocks/blocks-wrapper.tsx +0 -93
- package/src/components/blocks/blocks.tsx +0 -57
- package/src/components/blocks/blocks.types.ts +0 -7
- package/src/components/blocks/index.ts +0 -1
- package/src/components/content/components/enable-editor.tsx +0 -471
- package/src/components/content/components/styles.helpers.ts +0 -101
- package/src/components/content/components/styles.tsx +0 -42
- package/src/components/content/content.helpers.ts +0 -40
- package/src/components/content/content.tsx +0 -151
- package/src/components/content/content.types.ts +0 -13
- package/src/components/content/contentProps.types.ts +0 -17
- package/src/components/content/index.ts +0 -1
- package/src/components/content/wrap-component-ref.ts +0 -6
- package/src/components/content-variants/content-variants.tsx +0 -146
- package/src/components/content-variants/content-variants.types.ts +0 -84
- package/src/components/content-variants/helpers.ts +0 -72
- package/src/components/content-variants/index.ts +0 -1
- package/src/components/content-variants/inlined-fns.ts +0 -22
- package/src/components/dynamic-div.tsx +0 -30
- package/src/components/dynamic-renderer/dynamic-renderer.helpers.ts +0 -7
- package/src/components/dynamic-renderer/dynamic-renderer.tsx +0 -47
- package/src/components/error-boundary.tsx +0 -38
- package/src/components/inlined-script.tsx +0 -10
- package/src/components/inlined-styles.tsx +0 -10
- package/src/constants/builder-registered-components.ts +0 -59
- package/src/constants/device-sizes.ts +0 -59
- package/src/constants/extra-components.ts +0 -1
- package/src/constants/sdk-version.ts +0 -1
- package/src/constants/target.ts +0 -3
- package/src/context/builder.context.ts +0 -15
- package/src/context/components.context.ts +0 -3
- package/src/context/index.ts +0 -1
- package/src/context/types.ts +0 -38
- package/src/functions/apply-patch-with-mutation.ts +0 -61
- package/src/functions/camel-to-kebab-case.ts +0 -1
- package/src/functions/deopt.ts +0 -6
- package/src/functions/evaluate/browser-runtime/browser.ts +0 -61
- package/src/functions/evaluate/browser-runtime/index.ts +0 -1
- package/src/functions/evaluate/choose-eval.ts +0 -23
- package/src/functions/evaluate/edge-runtime/acorn-interpreter.ts +0 -2891
- package/src/functions/evaluate/edge-runtime/edge-runtime.ts +0 -96
- package/src/functions/evaluate/edge-runtime/index.ts +0 -1
- package/src/functions/evaluate/evaluate.ts +0 -76
- package/src/functions/evaluate/helpers.ts +0 -56
- package/src/functions/evaluate/index.ts +0 -1
- package/src/functions/evaluate/node-runtime/index.ts +0 -1
- package/src/functions/evaluate/node-runtime/init.ts +0 -33
- package/src/functions/evaluate/node-runtime/node-runtime.ts +0 -176
- package/src/functions/evaluate/node-runtime/safeDynamicRequire.ts +0 -14
- package/src/functions/evaluate/placeholder-runtime.ts +0 -4
- package/src/functions/evaluate/should-force-browser-runtime-in-node.ts +0 -16
- package/src/functions/event-handler-name.ts +0 -4
- package/src/functions/extract-text-styles.ts +0 -24
- package/src/functions/fast-clone.ts +0 -4
- package/src/functions/fetch-builder-props.ts +0 -75
- package/src/functions/get-block-actions-handler.ts +0 -17
- package/src/functions/get-block-actions.ts +0 -35
- package/src/functions/get-block-component-options.ts +0 -11
- package/src/functions/get-block-properties.ts +0 -62
- package/src/functions/get-builder-search-params/index.ts +0 -33
- package/src/functions/get-class-prop-name.ts +0 -15
- package/src/functions/get-content/generate-content-url.ts +0 -88
- package/src/functions/get-content/index.ts +0 -99
- package/src/functions/get-content/types.ts +0 -157
- package/src/functions/get-env.ts +0 -5
- package/src/functions/get-fetch.ts +0 -11
- package/src/functions/get-global-this.ts +0 -16
- package/src/functions/get-processed-block.ts +0 -70
- package/src/functions/get-style.ts +0 -38
- package/src/functions/get.ts +0 -4
- package/src/functions/is-browser.ts +0 -3
- package/src/functions/is-edge-runtime.ts +0 -9
- package/src/functions/is-editing.ts +0 -8
- package/src/functions/is-from-trusted-host.ts +0 -8
- package/src/functions/is-iframe.ts +0 -4
- package/src/functions/is-node-runtime.ts +0 -8
- package/src/functions/is-previewing.ts +0 -16
- package/src/functions/on-change.ts +0 -29
- package/src/functions/register-component.ts +0 -30
- package/src/functions/register.ts +0 -44
- package/src/functions/set-editor-settings.ts +0 -15
- package/src/functions/set.ts +0 -14
- package/src/functions/track/helpers.ts +0 -51
- package/src/functions/track/index.ts +0 -131
- package/src/functions/track/interaction.ts +0 -63
- package/src/functions/transform-block-properties.ts +0 -33
- package/src/functions/transform-block.ts +0 -30
- package/src/functions/transform-style-property.ts +0 -296
- package/src/helpers/ab-tests.ts +0 -166
- package/src/helpers/canTrack.ts +0 -2
- package/src/helpers/cookie.ts +0 -109
- package/src/helpers/css.ts +0 -33
- package/src/helpers/flatten.ts +0 -41
- package/src/helpers/localStorage.ts +0 -36
- package/src/helpers/logger.ts +0 -7
- package/src/helpers/nullable.ts +0 -2
- package/src/helpers/omit.ts +0 -7
- package/src/helpers/preview-lru-cache/get.ts +0 -4
- package/src/helpers/preview-lru-cache/helpers.ts +0 -1
- package/src/helpers/preview-lru-cache/init.ts +0 -7
- package/src/helpers/preview-lru-cache/set.ts +0 -12
- package/src/helpers/preview-lru-cache/types.ts +0 -1
- package/src/helpers/search/search.ts +0 -18
- package/src/helpers/sessionId.ts +0 -37
- package/src/helpers/subscribe-to-editor.ts +0 -95
- package/src/helpers/time.ts +0 -2
- package/src/helpers/url.ts +0 -15
- package/src/helpers/uuid.ts +0 -17
- package/src/helpers/visitorId.ts +0 -37
- package/src/index-helpers/blocks-exports.ts +0 -16
- package/src/index-helpers/top-of-file.ts +0 -2
- package/src/index.ts +0 -15
- package/src/scripts/init-editing.ts +0 -119
- package/src/server-index.ts +0 -43
- package/src/types/api-version.ts +0 -2
- package/src/types/builder-block.ts +0 -89
- package/src/types/builder-content.ts +0 -47
- package/src/types/builder-props.ts +0 -12
- package/src/types/can-track.ts +0 -3
- package/src/types/components.ts +0 -119
- package/src/types/deep-partial.ts +0 -1
- package/src/types/element.ts +0 -57
- package/src/types/enforced-partials.ts +0 -19
- package/src/types/input.ts +0 -123
- package/src/types/targets.ts +0 -1
- package/src/types/typescript.ts +0 -9
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
|
|
13
|
-
export type BlockStylesProps = {
|
|
14
|
-
block: BuilderBlock;
|
|
15
|
-
context: BuilderContextInterface;
|
|
16
|
-
};
|
|
17
|
-
import {
|
|
18
|
-
getMaxWidthQueryForSize,
|
|
19
|
-
getSizesForBreakpoints,
|
|
20
|
-
} from "../../../constants/device-sizes";
|
|
21
|
-
import { TARGET } from "../../../constants/target";
|
|
22
|
-
import type { BuilderContextInterface } from "../../../context/types";
|
|
23
|
-
import { camelToKebabCase } from "../../../functions/camel-to-kebab-case";
|
|
24
|
-
import { getProcessedBlock } from "../../../functions/get-processed-block";
|
|
25
|
-
import { createCssClass } from "../../../helpers/css";
|
|
26
|
-
import { checkIsDefined } from "../../../helpers/nullable";
|
|
27
|
-
import type { BuilderBlock } from "../../../types/builder-block";
|
|
28
|
-
import InlinedStyles from "../../inlined-styles";
|
|
29
|
-
|
|
30
|
-
function BlockStyles(props: BlockStylesProps) {
|
|
31
|
-
function canShowBlock() {
|
|
32
|
-
const processedBlock = getProcessedBlock({
|
|
33
|
-
block: props.block,
|
|
34
|
-
localState: props.context.localState,
|
|
35
|
-
rootState: props.context.rootState,
|
|
36
|
-
rootSetState: props.context.rootSetState,
|
|
37
|
-
context: props.context.context,
|
|
38
|
-
shouldEvaluateBindings: true,
|
|
39
|
-
});
|
|
40
|
-
// only render styles for blocks that are visible
|
|
41
|
-
if (checkIsDefined(processedBlock.hide)) {
|
|
42
|
-
return !processedBlock.hide;
|
|
43
|
-
}
|
|
44
|
-
if (checkIsDefined(processedBlock.show)) {
|
|
45
|
-
return processedBlock.show;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function css() {
|
|
51
|
-
const processedBlock = getProcessedBlock({
|
|
52
|
-
block: props.block,
|
|
53
|
-
localState: props.context.localState,
|
|
54
|
-
rootState: props.context.rootState,
|
|
55
|
-
rootSetState: props.context.rootSetState,
|
|
56
|
-
context: props.context.context,
|
|
57
|
-
shouldEvaluateBindings: true,
|
|
58
|
-
});
|
|
59
|
-
const styles = processedBlock.responsiveStyles;
|
|
60
|
-
const content = props.context.content;
|
|
61
|
-
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
62
|
-
content?.meta?.breakpoints || {}
|
|
63
|
-
);
|
|
64
|
-
const largeStyles = styles?.large;
|
|
65
|
-
const mediumStyles = styles?.medium;
|
|
66
|
-
const smallStyles = styles?.small;
|
|
67
|
-
const className = processedBlock.id;
|
|
68
|
-
if (!className) {
|
|
69
|
-
return "";
|
|
70
|
-
}
|
|
71
|
-
const largeStylesClass = largeStyles
|
|
72
|
-
? createCssClass({
|
|
73
|
-
className,
|
|
74
|
-
styles: largeStyles,
|
|
75
|
-
})
|
|
76
|
-
: "";
|
|
77
|
-
const mediumStylesClass = mediumStyles
|
|
78
|
-
? createCssClass({
|
|
79
|
-
className,
|
|
80
|
-
styles: mediumStyles,
|
|
81
|
-
mediaQuery: getMaxWidthQueryForSize(
|
|
82
|
-
"medium",
|
|
83
|
-
sizesWithUpdatedBreakpoints
|
|
84
|
-
),
|
|
85
|
-
})
|
|
86
|
-
: "";
|
|
87
|
-
const smallStylesClass = smallStyles
|
|
88
|
-
? createCssClass({
|
|
89
|
-
className,
|
|
90
|
-
styles: smallStyles,
|
|
91
|
-
mediaQuery: getMaxWidthQueryForSize(
|
|
92
|
-
"small",
|
|
93
|
-
sizesWithUpdatedBreakpoints
|
|
94
|
-
),
|
|
95
|
-
})
|
|
96
|
-
: "";
|
|
97
|
-
const hoverAnimation =
|
|
98
|
-
processedBlock.animations &&
|
|
99
|
-
processedBlock.animations.find((item) => item.trigger === "hover");
|
|
100
|
-
let hoverStylesClass = "";
|
|
101
|
-
if (hoverAnimation) {
|
|
102
|
-
const hoverStyles = hoverAnimation.steps?.[1]?.styles || {};
|
|
103
|
-
hoverStylesClass =
|
|
104
|
-
createCssClass({
|
|
105
|
-
className: `${className}:hover`,
|
|
106
|
-
styles: {
|
|
107
|
-
...hoverStyles,
|
|
108
|
-
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
109
|
-
hoverAnimation.easing
|
|
110
|
-
)}`,
|
|
111
|
-
transitionDelay: hoverAnimation.delay
|
|
112
|
-
? `${hoverAnimation.delay}s`
|
|
113
|
-
: "0s",
|
|
114
|
-
},
|
|
115
|
-
}) || "";
|
|
116
|
-
}
|
|
117
|
-
return [
|
|
118
|
-
largeStylesClass,
|
|
119
|
-
mediumStylesClass,
|
|
120
|
-
smallStylesClass,
|
|
121
|
-
hoverStylesClass,
|
|
122
|
-
].join(" ");
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<>
|
|
127
|
-
{TARGET !== "reactNative" && css() && canShowBlock() ? (
|
|
128
|
-
<>
|
|
129
|
-
<InlinedStyles id="builderio-block" styles={css()} />
|
|
130
|
-
</>
|
|
131
|
-
) : null}
|
|
132
|
-
</>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export default BlockStyles;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
|
|
13
|
-
type BlockWrapperProps = {
|
|
14
|
-
Wrapper: string;
|
|
15
|
-
block: BuilderBlock;
|
|
16
|
-
context: BuilderContextInterface;
|
|
17
|
-
linkComponent: any;
|
|
18
|
-
children?: any;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* This component renders a block's wrapper HTML element (from the block's `tagName` property).
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import type { BuilderContextInterface } from "../../../context/types";
|
|
26
|
-
import { getBlockActions } from "../../../functions/get-block-actions";
|
|
27
|
-
import { getBlockProperties } from "../../../functions/get-block-properties";
|
|
28
|
-
import type { BuilderBlock } from "../../../types/builder-block";
|
|
29
|
-
import DynamicRenderer from "../../dynamic-renderer/dynamic-renderer";
|
|
30
|
-
|
|
31
|
-
function BlockWrapper(props: BlockWrapperProps) {
|
|
32
|
-
return (
|
|
33
|
-
<DynamicRenderer
|
|
34
|
-
TagName={props.Wrapper}
|
|
35
|
-
attributes={getBlockProperties({
|
|
36
|
-
block: props.block,
|
|
37
|
-
context: props.context,
|
|
38
|
-
})}
|
|
39
|
-
actionAttributes={getBlockActions({
|
|
40
|
-
block: props.block,
|
|
41
|
-
rootState: props.context.rootState,
|
|
42
|
-
rootSetState: props.context.rootSetState,
|
|
43
|
-
localState: props.context.localState,
|
|
44
|
-
context: props.context.context,
|
|
45
|
-
stripPrefix: true,
|
|
46
|
-
})}
|
|
47
|
-
>
|
|
48
|
-
{props.children}
|
|
49
|
-
</DynamicRenderer>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default BlockWrapper;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types';
|
|
2
|
-
import { getBlockProperties } from '../../../../functions/get-block-properties';
|
|
3
|
-
import type { BuilderBlock } from '../../../../types/builder-block';
|
|
4
|
-
import type { BuilderDataProps } from '../../../../types/builder-props';
|
|
5
|
-
import type { InteractiveElementProps } from '../interactive-element';
|
|
6
|
-
type ComponentOptions = BuilderDataProps & {
|
|
7
|
-
[index: string]: any;
|
|
8
|
-
attributes?: {
|
|
9
|
-
[index: string]: any;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export interface ComponentProps {
|
|
13
|
-
componentRef: any;
|
|
14
|
-
componentOptions: ComponentOptions;
|
|
15
|
-
blockChildren: BuilderBlock[];
|
|
16
|
-
context: BuilderContextInterface;
|
|
17
|
-
registeredComponents: RegisteredComponents;
|
|
18
|
-
linkComponent: any;
|
|
19
|
-
builderBlock: BuilderBlock;
|
|
20
|
-
includeBlockProps: boolean;
|
|
21
|
-
isInteractive: boolean | undefined;
|
|
22
|
-
}
|
|
23
|
-
export const getWrapperProps = ({
|
|
24
|
-
componentOptions,
|
|
25
|
-
builderBlock,
|
|
26
|
-
context,
|
|
27
|
-
componentRef,
|
|
28
|
-
includeBlockProps,
|
|
29
|
-
isInteractive,
|
|
30
|
-
contextValue
|
|
31
|
-
}: Omit<ComponentProps, 'blockChildren' | 'registeredComponents'> & {
|
|
32
|
-
contextValue: BuilderContextInterface;
|
|
33
|
-
}) => {
|
|
34
|
-
const wrapperPropsWithAttributes = {
|
|
35
|
-
...componentOptions,
|
|
36
|
-
/**
|
|
37
|
-
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
38
|
-
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
39
|
-
*/
|
|
40
|
-
...(includeBlockProps ? {
|
|
41
|
-
attributes: getBlockProperties({
|
|
42
|
-
block: builderBlock,
|
|
43
|
-
context: contextValue
|
|
44
|
-
})
|
|
45
|
-
} : {})
|
|
46
|
-
};
|
|
47
|
-
const interactiveElementProps: InteractiveElementProps = {
|
|
48
|
-
Wrapper: componentRef,
|
|
49
|
-
block: builderBlock,
|
|
50
|
-
context,
|
|
51
|
-
wrapperProps: componentOptions,
|
|
52
|
-
includeBlockProps
|
|
53
|
-
};
|
|
54
|
-
return isInteractive ? interactiveElementProps : wrapperPropsWithAttributes;
|
|
55
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import { useState, useContext } from "react";
|
|
13
|
-
import { wrapComponentRef } from "../../../content/wrap-component-ref";
|
|
14
|
-
import Block from "../../block";
|
|
15
|
-
import InteractiveElement from "../interactive-element";
|
|
16
|
-
import type { ComponentProps } from "./component-ref.helpers";
|
|
17
|
-
import { getWrapperProps } from "./component-ref.helpers";
|
|
18
|
-
import BuilderContext from "../../../../context/builder.context";
|
|
19
|
-
|
|
20
|
-
function ComponentRef(props: ComponentProps) {
|
|
21
|
-
const [Wrapper, setWrapper] = useState(() =>
|
|
22
|
-
props.isInteractive ? InteractiveElement : props.componentRef
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<BuilderContext.Provider
|
|
27
|
-
value={{
|
|
28
|
-
content: props.context.content,
|
|
29
|
-
rootState: props.context.rootState,
|
|
30
|
-
localState: props.context.localState,
|
|
31
|
-
context: props.context.context,
|
|
32
|
-
apiKey: props.context.apiKey,
|
|
33
|
-
componentInfos: props.context.componentInfos,
|
|
34
|
-
inheritedStyles: props.context.inheritedStyles,
|
|
35
|
-
apiVersion: props.context.apiVersion,
|
|
36
|
-
}}
|
|
37
|
-
>
|
|
38
|
-
{props.componentRef ? (
|
|
39
|
-
<Wrapper
|
|
40
|
-
{...getWrapperProps({
|
|
41
|
-
componentOptions: props.componentOptions,
|
|
42
|
-
builderBlock: props.builderBlock,
|
|
43
|
-
context: props.context,
|
|
44
|
-
componentRef: props.componentRef,
|
|
45
|
-
linkComponent: props.linkComponent,
|
|
46
|
-
includeBlockProps: props.includeBlockProps,
|
|
47
|
-
isInteractive: props.isInteractive,
|
|
48
|
-
contextValue: props.context,
|
|
49
|
-
})}
|
|
50
|
-
>
|
|
51
|
-
{props.blockChildren?.map((child) => (
|
|
52
|
-
<Block
|
|
53
|
-
key={child.id}
|
|
54
|
-
block={child}
|
|
55
|
-
context={props.context}
|
|
56
|
-
registeredComponents={props.registeredComponents}
|
|
57
|
-
linkComponent={props.linkComponent}
|
|
58
|
-
/>
|
|
59
|
-
))}
|
|
60
|
-
</Wrapper>
|
|
61
|
-
) : null}
|
|
62
|
-
</BuilderContext.Provider>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default ComponentRef;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
|
|
13
|
-
export type InteractiveElementProps = {
|
|
14
|
-
Wrapper: any;
|
|
15
|
-
block: BuilderBlock;
|
|
16
|
-
context: BuilderContextInterface;
|
|
17
|
-
wrapperProps: Dictionary<any>;
|
|
18
|
-
includeBlockProps: boolean;
|
|
19
|
-
children?: any;
|
|
20
|
-
};
|
|
21
|
-
import type { BuilderContextInterface } from "../../../context/types";
|
|
22
|
-
import { getBlockActions } from "../../../functions/get-block-actions";
|
|
23
|
-
import { getBlockProperties } from "../../../functions/get-block-properties";
|
|
24
|
-
import type { BuilderBlock } from "../../../types/builder-block";
|
|
25
|
-
import type { Dictionary } from "../../../types/typescript";
|
|
26
|
-
|
|
27
|
-
function InteractiveElement(props: InteractiveElementProps) {
|
|
28
|
-
function attributes() {
|
|
29
|
-
return props.includeBlockProps
|
|
30
|
-
? {
|
|
31
|
-
...getBlockProperties({
|
|
32
|
-
block: props.block,
|
|
33
|
-
context: props.context,
|
|
34
|
-
}),
|
|
35
|
-
...getBlockActions({
|
|
36
|
-
block: props.block,
|
|
37
|
-
rootState: props.context.rootState,
|
|
38
|
-
rootSetState: props.context.rootSetState,
|
|
39
|
-
localState: props.context.localState,
|
|
40
|
-
context: props.context.context,
|
|
41
|
-
}),
|
|
42
|
-
}
|
|
43
|
-
: {};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<props.Wrapper {...props.wrapperProps} attributes={attributes()}>
|
|
48
|
-
{props.children}
|
|
49
|
-
</props.Wrapper>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default InteractiveElement;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import { useState, useContext } from "react";
|
|
13
|
-
|
|
14
|
-
type Props = Omit<BlockProps, "context"> & {
|
|
15
|
-
repeatContext: BuilderContextInterface;
|
|
16
|
-
};
|
|
17
|
-
import BuilderContext from "../../../context/builder.context";
|
|
18
|
-
import type { BuilderContextInterface } from "../../../context/types";
|
|
19
|
-
import type { BlockProps } from "../block";
|
|
20
|
-
import Block from "../block";
|
|
21
|
-
|
|
22
|
-
function RepeatedBlock(props: Props) {
|
|
23
|
-
const [store, setStore] = useState(() => props.repeatContext);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<BuilderContext.Provider value={store}>
|
|
27
|
-
<Block
|
|
28
|
-
block={props.block}
|
|
29
|
-
context={store}
|
|
30
|
-
registeredComponents={props.registeredComponents}
|
|
31
|
-
linkComponent={props.linkComponent}
|
|
32
|
-
/>
|
|
33
|
-
</BuilderContext.Provider>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default RepeatedBlock;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
|
|
13
|
-
export type BlocksWrapperProps = {
|
|
14
|
-
blocks: BuilderBlock[] | undefined;
|
|
15
|
-
parent: string | undefined;
|
|
16
|
-
path: string | undefined;
|
|
17
|
-
styleProp: Record<string, any> | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* The element that wraps each list of blocks. Defaults to a `div` element ('ScrollView' in React Native).
|
|
20
|
-
*/
|
|
21
|
-
BlocksWrapper: any;
|
|
22
|
-
/**
|
|
23
|
-
* Additonal props to pass to `blocksWrapper`. Defaults to `{}`.
|
|
24
|
-
*/
|
|
25
|
-
BlocksWrapperProps: any;
|
|
26
|
-
children?: any;
|
|
27
|
-
};
|
|
28
|
-
import { isEditing } from "../../functions/is-editing";
|
|
29
|
-
import type { BuilderBlock } from "../../types/builder-block";
|
|
30
|
-
|
|
31
|
-
function BlocksWrapper(props: BlocksWrapperProps) {
|
|
32
|
-
function className() {
|
|
33
|
-
return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function onClick() {
|
|
37
|
-
if (isEditing() && !props.blocks?.length) {
|
|
38
|
-
window.parent?.postMessage(
|
|
39
|
-
{
|
|
40
|
-
type: "builder.clickEmptyBlocks",
|
|
41
|
-
data: {
|
|
42
|
-
parentElementId: props.parent,
|
|
43
|
-
dataPath: props.path,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
"*"
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function onMouseEnter() {
|
|
52
|
-
if (isEditing() && !props.blocks?.length) {
|
|
53
|
-
window.parent?.postMessage(
|
|
54
|
-
{
|
|
55
|
-
type: "builder.hoverEmptyBlocks",
|
|
56
|
-
data: {
|
|
57
|
-
parentElementId: props.parent,
|
|
58
|
-
dataPath: props.path,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
"*"
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<props.BlocksWrapper
|
|
68
|
-
builder-path={props.path}
|
|
69
|
-
builder-parent-id={props.parent}
|
|
70
|
-
{...{
|
|
71
|
-
dataSet: {
|
|
72
|
-
class: className(),
|
|
73
|
-
},
|
|
74
|
-
}}
|
|
75
|
-
style={{
|
|
76
|
-
...styles.propsBlocksWrapper1,
|
|
77
|
-
...props.styleProp,
|
|
78
|
-
}}
|
|
79
|
-
onPress={(event) => onClick()}
|
|
80
|
-
onMouseEnter={(event) => onMouseEnter()}
|
|
81
|
-
onKeyPress={(event) => onClick()}
|
|
82
|
-
{...props.BlocksWrapperProps}
|
|
83
|
-
>
|
|
84
|
-
{props.children}
|
|
85
|
-
</props.BlocksWrapper>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const styles = StyleSheet.create({
|
|
90
|
-
propsBlocksWrapper1: { display: "flex", flexDirection: "column" },
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export default BlocksWrapper;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FlatList,
|
|
4
|
-
ScrollView,
|
|
5
|
-
View,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Image,
|
|
8
|
-
Text,
|
|
9
|
-
Pressable,
|
|
10
|
-
TextInput,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import { useContext } from "react";
|
|
13
|
-
import BuilderContext from "../../context/builder.context";
|
|
14
|
-
import ComponentsContext from "../../context/components.context";
|
|
15
|
-
import Block from "../block/block";
|
|
16
|
-
import BlocksWrapper from "./blocks-wrapper";
|
|
17
|
-
import type { BlocksProps } from "./blocks.types";
|
|
18
|
-
|
|
19
|
-
function Blocks(props: BlocksProps) {
|
|
20
|
-
const builderContext = useContext(BuilderContext);
|
|
21
|
-
|
|
22
|
-
const componentsContext = useContext(ComponentsContext);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<BlocksWrapper
|
|
26
|
-
blocks={props.blocks}
|
|
27
|
-
parent={props.parent}
|
|
28
|
-
path={props.path}
|
|
29
|
-
styleProp={props.styleProp}
|
|
30
|
-
BlocksWrapper={
|
|
31
|
-
props.context?.BlocksWrapper || builderContext.BlocksWrapper
|
|
32
|
-
}
|
|
33
|
-
BlocksWrapperProps={
|
|
34
|
-
props.context?.BlocksWrapperProps || builderContext.BlocksWrapperProps
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
{props.blocks ? (
|
|
38
|
-
<>
|
|
39
|
-
{props.blocks?.map((block) => (
|
|
40
|
-
<Block
|
|
41
|
-
key={block.id}
|
|
42
|
-
block={block}
|
|
43
|
-
linkComponent={props.linkComponent}
|
|
44
|
-
context={props.context || builderContext}
|
|
45
|
-
registeredComponents={
|
|
46
|
-
props.registeredComponents ||
|
|
47
|
-
componentsContext.registeredComponents
|
|
48
|
-
}
|
|
49
|
-
/>
|
|
50
|
-
))}
|
|
51
|
-
</>
|
|
52
|
-
) : null}
|
|
53
|
-
</BlocksWrapper>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default Blocks;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types';
|
|
2
|
-
import type { BlocksWrapperProps } from './blocks-wrapper';
|
|
3
|
-
export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
|
|
4
|
-
context?: BuilderContextInterface;
|
|
5
|
-
registeredComponents?: RegisteredComponents;
|
|
6
|
-
linkComponent?: any;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './blocks'
|