@builder.io/sdk-react 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{sdk/blocks → blocks}/BaseText.d.ts +0 -1
- package/dist/{sdk/blocks → blocks}/BaseText.js +2 -2
- package/dist/{sdk/blocks → blocks}/button/button.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/button/button.js +3 -5
- package/dist/blocks/button/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/button/component-info.js +9 -13
- package/dist/blocks/columns/columns.d.ts +16 -0
- package/dist/{sdk/blocks → blocks}/columns/columns.js +15 -21
- package/dist/blocks/columns/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/columns/component-info.js +62 -83
- package/dist/blocks/custom-code/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/custom-code/component-info.js +7 -11
- package/dist/{sdk/blocks → blocks}/custom-code/custom-code.d.ts +0 -1
- package/dist/{sdk/blocks → blocks}/custom-code/custom-code.js +1 -1
- package/dist/blocks/embed/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/embed/component-info.js +8 -15
- package/dist/{sdk/blocks → blocks}/embed/embed.d.ts +0 -1
- package/dist/{sdk/blocks → blocks}/embed/embed.js +1 -1
- package/dist/blocks/embed/helpers.js +2 -0
- package/dist/blocks/form/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/form/component-info.js +94 -129
- package/dist/blocks/form/form.d.ts +2 -0
- package/dist/blocks/form/form.js +6 -0
- package/dist/blocks/fragment/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/fragment/component-info.js +1 -1
- package/dist/{sdk/blocks → blocks}/fragment/fragment.d.ts +0 -1
- package/dist/{sdk/blocks → blocks}/fragment/fragment.js +1 -1
- package/dist/blocks/helpers.d.ts +13 -0
- package/dist/blocks/helpers.js +40 -0
- package/dist/blocks/image/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/image/component-info.js +33 -63
- package/dist/{sdk/blocks → blocks}/image/image.d.ts +0 -1
- package/dist/{sdk/blocks → blocks}/image/image.helpers.js +2 -11
- package/dist/{sdk/blocks → blocks}/image/image.js +7 -7
- package/dist/blocks/img/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/img/component-info.js +4 -6
- package/dist/{sdk/blocks → blocks}/img/img.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/img/img.js +1 -1
- package/dist/blocks/input/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/input/component-info.js +15 -40
- package/dist/{sdk/blocks → blocks}/input/input.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/input/input.js +1 -1
- package/dist/blocks/raw-text/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/raw-text/component-info.js +3 -5
- package/dist/{sdk/blocks → blocks}/raw-text/raw-text.d.ts +0 -1
- package/dist/blocks/raw-text/raw-text.js +6 -0
- package/dist/blocks/section/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/section/component-info.js +13 -18
- package/dist/{sdk/blocks → blocks}/section/section.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/section/section.js +1 -1
- package/dist/blocks/select/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/select/component-info.js +22 -34
- package/dist/{sdk/blocks → blocks}/select/select.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/select/select.js +1 -1
- package/dist/blocks/submit-button/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/submit-button/component-info.js +5 -7
- package/dist/{sdk/blocks → blocks}/submit-button/submit-button.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/submit-button/submit-button.js +1 -1
- package/dist/blocks/symbol/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/symbol/component-info.js +12 -17
- package/dist/blocks/symbol/symbol.d.ts +23 -0
- package/dist/blocks/symbol/symbol.helpers.d.ts +14 -0
- package/dist/blocks/symbol/symbol.helpers.js +31 -0
- package/dist/blocks/symbol/symbol.js +45 -0
- package/dist/blocks/text/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/text/component-info.js +6 -7
- package/dist/{sdk/blocks → blocks}/text/text.d.ts +1 -2
- package/dist/{sdk/blocks → blocks}/text/text.js +2 -2
- package/dist/blocks/textarea/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/textarea/component-info.js +13 -19
- package/dist/{sdk/blocks → blocks}/textarea/textarea.d.ts +3 -2
- package/dist/{sdk/blocks → blocks}/textarea/textarea.js +1 -1
- package/dist/blocks/video/component-info.d.ts +2 -0
- package/dist/{sdk/blocks → blocks}/video/component-info.js +35 -55
- package/dist/{sdk/blocks → blocks}/video/video.d.ts +1 -1
- package/dist/{sdk/blocks → blocks}/video/video.js +2 -2
- package/dist/components/block/block.d.ts +9 -0
- package/dist/components/block/block.helpers.d.ts +13 -0
- package/dist/{sdk/components/render-block/render-block.helpers.js → components/block/block.helpers.js} +12 -29
- package/dist/components/block/block.js +94 -0
- package/dist/{sdk/components/render-block → components/block/components}/block-styles.d.ts +2 -3
- package/dist/{sdk/components/render-block → components/block/components}/block-styles.js +23 -24
- package/dist/components/block/components/block-wrapper.d.ts +16 -0
- package/dist/components/block/components/block-wrapper.js +36 -0
- package/dist/components/block/components/component-ref/component-ref.d.ts +3 -0
- package/dist/components/block/components/component-ref/component-ref.helpers.d.ts +28 -0
- package/dist/components/block/components/component-ref/component-ref.helpers.js +22 -0
- package/dist/components/block/components/component-ref/component-ref.js +23 -0
- package/dist/components/block/components/interactive-element.d.ts +11 -0
- package/dist/components/block/components/interactive-element.js +20 -0
- package/dist/components/block/components/repeated-block.d.ts +9 -0
- package/dist/components/block/components/repeated-block.js +11 -0
- package/dist/components/blocks/blocks-wrapper.d.ts +10 -0
- package/dist/{sdk/components/render-blocks.js → components/blocks/blocks-wrapper.js} +6 -13
- package/dist/components/blocks/blocks.d.ts +8 -0
- package/dist/components/blocks/blocks.js +11 -0
- package/dist/components/content/components/enable-editor.d.ts +9 -0
- package/dist/{sdk/components/render-content/render-content.js → components/content/components/enable-editor.js} +69 -140
- package/dist/components/content/components/styles.d.ts +8 -0
- package/dist/{sdk/components/render-content/components/render-styles.helpers.d.ts → components/content/components/styles.helpers.d.ts} +1 -1
- package/dist/{sdk/components/render-content/components/render-styles.helpers.js → components/content/components/styles.helpers.js} +3 -4
- package/dist/{sdk/components/render-content/components/render-styles.js → components/content/components/styles.js} +7 -7
- package/dist/components/content/content.d.ts +3 -0
- package/dist/components/content/content.helpers.d.ts +7 -0
- package/dist/components/content/content.helpers.js +30 -0
- package/dist/components/content/content.js +79 -0
- package/dist/components/content/content.types.d.ts +24 -0
- package/dist/components/content/index.d.ts +1 -0
- package/dist/components/content/index.js +1 -0
- package/dist/components/content-variants/content-variants.d.ts +9 -0
- package/dist/components/content-variants/content-variants.js +46 -0
- package/dist/components/content-variants/content-variants.types.d.ts +20 -0
- package/dist/components/content-variants/helpers.d.ts +41 -0
- package/dist/{sdk/components/render-content-variants → components/content-variants}/helpers.js +46 -41
- package/dist/components/inlined-script.d.ts +6 -0
- package/dist/components/inlined-script.js +6 -0
- package/dist/components/inlined-styles.d.ts +6 -0
- package/dist/{sdk/components/render-inlined-styles.js → components/inlined-styles.js} +3 -3
- package/dist/{sdk/constants → constants}/builder-registered-components.js +34 -13
- package/dist/{sdk/constants → constants}/device-sizes.js +9 -8
- package/dist/constants/sdk-version.d.ts +1 -0
- package/dist/constants/sdk-version.js +1 -0
- package/dist/{sdk/context → context}/builder.context.js +1 -1
- package/dist/{sdk/context → context}/types.d.ts +1 -1
- package/dist/functions/acorn_interpreter.d.ts +1 -0
- package/dist/functions/acorn_interpreter.js +3027 -0
- package/dist/functions/apply-patch-with-mutation.d.ts +10 -0
- package/dist/functions/apply-patch-with-mutation.js +54 -0
- package/dist/functions/apply-patch-with-mutation.test.js +53 -0
- package/dist/functions/evaluate/acorn.d.ts +0 -0
- package/dist/functions/evaluate/acorn.js +2432 -0
- package/dist/{sdk/functions → functions/evaluate}/evaluate.d.ts +5 -2
- package/dist/functions/evaluate/evaluate.js +70 -0
- package/dist/functions/evaluate/evaluate.test.js +23 -0
- package/dist/functions/evaluate/index.d.ts +1 -0
- package/dist/functions/evaluate/index.js +1 -0
- package/dist/functions/evaluate/interpreter.d.ts +2 -0
- package/dist/functions/evaluate/interpreter.js +3853 -0
- package/dist/functions/evaluate/non-node-runtime.d.ts +2 -0
- package/dist/functions/evaluate/non-node-runtime.js +84 -0
- package/dist/functions/evaluate/types.d.ts +10 -0
- package/dist/functions/evaluate.d.ts +23 -0
- package/dist/{sdk/functions → functions}/evaluate.js +28 -9
- package/dist/{sdk/functions → functions}/evaluate.test.js +11 -5
- package/dist/{sdk/functions → functions}/extract-text-styles.js +2 -14
- package/dist/{sdk/functions → functions}/get-block-actions-handler.js +3 -3
- package/dist/{sdk/functions → functions}/get-block-actions.d.ts +1 -0
- package/dist/functions/get-block-actions.js +28 -0
- package/dist/{sdk/functions → functions}/get-block-component-options.js +1 -1
- package/dist/functions/get-block-properties.d.ts +6 -0
- package/dist/{sdk/functions → functions}/get-block-properties.js +15 -9
- package/dist/{sdk/functions → functions}/get-builder-search-params/fn.test.js +1 -1
- package/dist/{sdk/functions → functions}/get-builder-search-params/index.js +3 -7
- package/dist/{sdk/functions → functions}/get-content/generate-content-url.js +7 -5
- package/dist/{sdk/functions → functions}/get-content/generate-content-url.test.js +31 -17
- package/dist/{sdk/functions → functions}/get-content/index.d.ts +2 -6
- package/dist/{sdk/functions → functions}/get-content/index.js +26 -6
- package/dist/functions/get-content/processCookies.d.ts +2 -0
- package/dist/functions/get-content/processCookies.js +3 -0
- package/dist/{sdk/functions → functions}/get-processed-block.d.ts +1 -1
- package/dist/{sdk/functions → functions}/get-processed-block.js +11 -7
- package/dist/{sdk/functions → functions}/get-processed-block.test.js +8 -6
- package/dist/{sdk/functions → functions}/get-react-native-block-styles.d.ts +1 -1
- package/dist/{sdk/functions → functions}/get-react-native-block-styles.js +2 -2
- package/dist/{sdk/functions → functions}/if-target.d.ts +1 -1
- package/dist/{sdk/functions → functions}/if-target.js +1 -1
- package/dist/functions/is-editing.js +5 -0
- package/dist/functions/is-non-node-server.d.ts +4 -0
- package/dist/functions/is-non-node-server.js +8 -0
- package/dist/{sdk/functions → functions}/on-change.js +1 -1
- package/dist/{sdk/functions → functions}/on-change.test.js +13 -3
- package/dist/{sdk/functions → functions}/register-component.d.ts +2 -1
- package/dist/functions/register-component.js +38 -0
- package/dist/{sdk/functions → functions}/register.js +2 -2
- package/dist/{sdk/functions → functions}/sanitize-react-native-block-styles.js +13 -5
- package/dist/{sdk/functions → functions}/set-editor-settings.js +1 -1
- package/dist/functions/set.js +14 -0
- package/dist/{sdk/functions → functions}/set.test.js +9 -3
- package/dist/{sdk/functions → functions}/track/helpers.js +6 -11
- package/dist/{sdk/functions → functions}/track/index.js +26 -14
- package/dist/{sdk/functions → functions}/track/interaction.js +15 -16
- package/dist/functions/transform-block-properties.d.ts +1 -0
- package/dist/{sdk/functions → functions}/transform-block-properties.js +2 -0
- package/dist/{sdk/helpers → helpers}/ab-tests.d.ts +2 -2
- package/dist/{sdk/helpers → helpers}/ab-tests.js +48 -30
- package/dist/{sdk/helpers → helpers}/canTrack.js +1 -1
- package/dist/{sdk/helpers → helpers}/cookie.d.ts +2 -2
- package/dist/{sdk/helpers → helpers}/cookie.js +13 -26
- package/dist/{sdk/helpers → helpers}/css.d.ts +1 -1
- package/dist/{sdk/helpers → helpers}/css.js +1 -1
- package/dist/{sdk/helpers → helpers}/flatten.js +8 -8
- package/dist/{sdk/helpers → helpers}/localStorage.d.ts +2 -2
- package/dist/{sdk/helpers → helpers}/localStorage.js +2 -2
- package/dist/{sdk/helpers → helpers}/logger.js +1 -1
- package/dist/helpers/preview-lru-cache/get.d.ts +1 -0
- package/dist/helpers/preview-lru-cache/get.js +7 -0
- package/dist/helpers/preview-lru-cache/helpers.d.ts +1 -0
- package/dist/helpers/preview-lru-cache/helpers.js +9 -0
- package/dist/helpers/preview-lru-cache/init.d.ts +6 -0
- package/dist/helpers/preview-lru-cache/init.js +15 -0
- package/dist/helpers/preview-lru-cache/set.d.ts +7 -0
- package/dist/helpers/preview-lru-cache/set.js +9 -0
- package/dist/helpers/preview-lru-cache/types.d.ts +12 -0
- package/dist/helpers/preview-lru-cache/types.js +6 -0
- package/dist/{sdk/helpers → helpers}/sessionId.d.ts +2 -2
- package/dist/{sdk/helpers → helpers}/sessionId.js +11 -4
- package/dist/{sdk/helpers → helpers}/uuid.js +1 -1
- package/dist/{sdk/helpers → helpers}/visitorId.d.ts +1 -1
- package/dist/{sdk/helpers → helpers}/visitorId.js +7 -4
- package/dist/{sdk/index-helpers → index-helpers}/blocks-exports.d.ts +2 -2
- package/dist/{sdk/index-helpers → index-helpers}/blocks-exports.js +2 -2
- package/dist/{sdk/index.d.ts → index.d.ts} +2 -2
- package/dist/{sdk/index.js → index.js} +1 -1
- package/dist/scripts/init-editing.js +110 -0
- package/dist/types/builder-props.d.ts +9 -0
- package/dist/{sdk/types → types}/components.d.ts +8 -2
- package/dist/types/enforced-partials.d.ts +21 -0
- package/dist/types/targets.d.ts +1 -0
- package/dist/{server/types → types}/typescript.d.ts +6 -0
- package/package.json +6 -13
- package/dist/sdk/blocks/button/component-info.d.ts +0 -2
- package/dist/sdk/blocks/columns/columns.d.ts +0 -16
- package/dist/sdk/blocks/columns/component-info.d.ts +0 -2
- package/dist/sdk/blocks/custom-code/component-info.d.ts +0 -2
- package/dist/sdk/blocks/embed/component-info.d.ts +0 -2
- package/dist/sdk/blocks/embed/helpers.js +0 -6
- package/dist/sdk/blocks/form/component-info.d.ts +0 -2
- package/dist/sdk/blocks/form/form.d.ts +0 -40
- package/dist/sdk/blocks/form/form.js +0 -203
- package/dist/sdk/blocks/fragment/component-info.d.ts +0 -2
- package/dist/sdk/blocks/image/component-info.d.ts +0 -2
- package/dist/sdk/blocks/img/component-info.d.ts +0 -2
- package/dist/sdk/blocks/input/component-info.d.ts +0 -2
- package/dist/sdk/blocks/raw-text/component-info.d.ts +0 -2
- package/dist/sdk/blocks/raw-text/raw-text.js +0 -6
- package/dist/sdk/blocks/section/component-info.d.ts +0 -2
- package/dist/sdk/blocks/select/component-info.d.ts +0 -2
- package/dist/sdk/blocks/submit-button/component-info.d.ts +0 -2
- package/dist/sdk/blocks/symbol/component-info.d.ts +0 -2
- package/dist/sdk/blocks/symbol/symbol.d.ts +0 -21
- package/dist/sdk/blocks/symbol/symbol.js +0 -69
- package/dist/sdk/blocks/text/component-info.d.ts +0 -2
- package/dist/sdk/blocks/textarea/component-info.d.ts +0 -2
- package/dist/sdk/blocks/util.d.ts +0 -4
- package/dist/sdk/blocks/util.js +0 -13
- package/dist/sdk/blocks/video/component-info.d.ts +0 -2
- package/dist/sdk/components/render-block/render-block.d.ts +0 -9
- package/dist/sdk/components/render-block/render-block.helpers.d.ts +0 -12
- package/dist/sdk/components/render-block/render-block.js +0 -115
- package/dist/sdk/components/render-block/render-component.d.ts +0 -17
- package/dist/sdk/components/render-block/render-component.js +0 -11
- package/dist/sdk/components/render-block/render-repeated-block.d.ts +0 -9
- package/dist/sdk/components/render-block/render-repeated-block.js +0 -11
- package/dist/sdk/components/render-blocks.d.ts +0 -10
- package/dist/sdk/components/render-content/builder-editing.d.ts +0 -3
- package/dist/sdk/components/render-content/builder-editing.js +0 -6
- package/dist/sdk/components/render-content/components/render-styles.d.ts +0 -9
- package/dist/sdk/components/render-content/index.d.ts +0 -1
- package/dist/sdk/components/render-content/index.js +0 -1
- package/dist/sdk/components/render-content/render-content.d.ts +0 -4
- package/dist/sdk/components/render-content/render-content.helpers.d.ts +0 -7
- package/dist/sdk/components/render-content/render-content.helpers.js +0 -30
- package/dist/sdk/components/render-content/render-content.types.d.ts +0 -38
- package/dist/sdk/components/render-content-variants/helpers.d.ts +0 -17
- package/dist/sdk/components/render-content-variants/render-content-variants.d.ts +0 -5
- package/dist/sdk/components/render-content-variants/render-content-variants.js +0 -37
- package/dist/sdk/components/render-inlined-styles.d.ts +0 -7
- package/dist/sdk/constants/sdk-version.d.ts +0 -1
- package/dist/sdk/constants/sdk-version.js +0 -1
- package/dist/sdk/functions/get-block-actions.js +0 -15
- package/dist/sdk/functions/get-block-properties.d.ts +0 -7
- package/dist/sdk/functions/get-content/ab-testing.d.ts +0 -5
- package/dist/sdk/functions/get-content/ab-testing.js +0 -78
- package/dist/sdk/functions/is-editing.js +0 -7
- package/dist/sdk/functions/register-component.js +0 -26
- package/dist/sdk/functions/set.js +0 -21
- package/dist/sdk/functions/transform-block-properties.d.ts +0 -1
- package/dist/sdk/scripts/init-editing.js +0 -102
- package/dist/sdk/types/targets.d.ts +0 -3
- package/dist/sdk/types/typescript.d.ts +0 -5
- package/dist/server/functions/get-builder-search-params/index.d.ts +0 -6
- package/dist/server/functions/get-builder-search-params/index.js +0 -36
- package/dist/server/functions/get-content/ab-testing.d.ts +0 -5
- package/dist/server/functions/get-content/ab-testing.js +0 -78
- package/dist/server/functions/get-content/generate-content-url.d.ts +0 -2
- package/dist/server/functions/get-content/generate-content-url.js +0 -31
- package/dist/server/functions/get-content/generate-content-url.test.js +0 -82
- package/dist/server/functions/get-content/index.d.ts +0 -11
- package/dist/server/functions/get-content/index.js +0 -40
- package/dist/server/functions/get-content/types.d.ts +0 -45
- package/dist/server/functions/get-fetch.d.ts +0 -1
- package/dist/server/functions/get-fetch.js +0 -11
- package/dist/server/functions/get-global-this.d.ts +0 -4
- package/dist/server/functions/get-global-this.js +0 -15
- package/dist/server/functions/is-browser.d.ts +0 -1
- package/dist/server/functions/is-browser.js +0 -3
- package/dist/server/helpers/ab-tests.d.ts +0 -8
- package/dist/server/helpers/ab-tests.js +0 -5
- package/dist/server/helpers/cookie.d.ts +0 -15
- package/dist/server/helpers/cookie.js +0 -65
- package/dist/server/helpers/flatten.d.ts +0 -6
- package/dist/server/helpers/flatten.js +0 -19
- package/dist/server/helpers/logger.d.ts +0 -5
- package/dist/server/helpers/logger.js +0 -6
- package/dist/server/helpers/nullable.d.ts +0 -2
- package/dist/server/helpers/nullable.js +0 -1
- package/dist/server/helpers/url.d.ts +0 -6
- package/dist/server/helpers/url.js +0 -15
- package/dist/server/types/api-version.d.ts +0 -2
- package/dist/server/types/api-version.js +0 -1
- package/dist/server/types/builder-block.d.ts +0 -66
- package/dist/server/types/builder-content.d.ts +0 -46
- package/dist/server/types/can-track.d.ts +0 -3
- package/dist/server/types/input.d.ts +0 -121
- package/dist/server/types/typescript.js +0 -1
- /package/dist/{sdk/blocks → blocks}/embed/helpers.d.ts +0 -0
- /package/dist/{sdk/blocks → blocks}/image/image.helpers.d.ts +0 -0
- /package/dist/{sdk/components/render-block → components/block}/types.d.ts +0 -0
- /package/dist/{sdk/components/render-block → components/block}/types.js +0 -0
- /package/dist/{sdk/context/types.js → components/content/content.types.js} +0 -0
- /package/dist/{sdk/components/render-content → components/content}/wrap-component-ref.d.ts +0 -0
- /package/dist/{sdk/components/render-content → components/content}/wrap-component-ref.js +0 -0
- /package/dist/{sdk/components/render-content/render-content.types.js → components/content-variants/content-variants.types.js} +0 -0
- /package/dist/{sdk/constants → constants}/builder-registered-components.d.ts +0 -0
- /package/dist/{sdk/constants → constants}/device-sizes.d.ts +0 -0
- /package/dist/{sdk/constants → constants}/target.d.ts +0 -0
- /package/dist/{sdk/constants → constants}/target.js +0 -0
- /package/dist/{sdk/context → context}/builder.context.d.ts +0 -0
- /package/dist/{sdk/functions/get-content → context}/types.js +0 -0
- /package/dist/{sdk/functions/evaluate.test.d.ts → functions/apply-patch-with-mutation.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/camel-to-kebab-case.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/camel-to-kebab-case.js +0 -0
- /package/dist/{sdk/functions/get-content/generate-content-url.test.d.ts → functions/evaluate/evaluate.test.d.ts} +0 -0
- /package/dist/{server/functions/get-content → functions/evaluate}/types.js +0 -0
- /package/dist/{sdk/functions/get-builder-search-params/fn.test.d.ts → functions/evaluate.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/event-handler-name.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/event-handler-name.js +0 -0
- /package/dist/{sdk/functions → functions}/extract-text-styles.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/fast-clone.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/fast-clone.js +0 -0
- /package/dist/{sdk/functions → functions}/get-block-actions-handler.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/get-block-component-options.d.ts +0 -0
- /package/dist/{sdk/functions/get-processed-block.test.d.ts → functions/get-builder-search-params/fn.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/get-builder-search-params/index.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/get-content/generate-content-url.d.ts +0 -0
- /package/dist/{server/functions → functions}/get-content/generate-content-url.test.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/get-content/types.d.ts +0 -0
- /package/dist/{sdk/functions/on-change.test.d.ts → functions/get-content/types.js} +0 -0
- /package/dist/{sdk/functions → functions}/get-fetch.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/get-fetch.js +0 -0
- /package/dist/{sdk/functions → functions}/get-global-this.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/get-global-this.js +0 -0
- /package/dist/{sdk/functions/set.test.d.ts → functions/get-processed-block.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/is-browser.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/is-browser.js +0 -0
- /package/dist/{sdk/functions → functions}/is-editing.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/is-iframe.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/is-iframe.js +0 -0
- /package/dist/{sdk/functions → functions}/is-previewing.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/is-previewing.js +0 -0
- /package/dist/{sdk/functions → functions}/on-change.d.ts +0 -0
- /package/dist/{sdk/helpers/url.test.d.ts → functions/on-change.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/register.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/sanitize-react-native-block-styles.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/set-editor-settings.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/set.d.ts +0 -0
- /package/dist/{sdk/types/builder-block.js → functions/set.test.d.ts} +0 -0
- /package/dist/{sdk/functions → functions}/track/helpers.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/track/index.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/track/interaction.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/transform-block.d.ts +0 -0
- /package/dist/{sdk/functions → functions}/transform-block.js +0 -0
- /package/dist/{sdk/helpers → helpers}/canTrack.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/flatten.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/logger.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/nullable.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/nullable.js +0 -0
- /package/dist/{sdk/helpers → helpers}/time.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/time.js +0 -0
- /package/dist/{sdk/helpers → helpers}/url.d.ts +0 -0
- /package/dist/{sdk/helpers → helpers}/url.js +0 -0
- /package/dist/{sdk/types/builder-content.js → helpers/url.test.d.ts} +0 -0
- /package/dist/{sdk/helpers → helpers}/url.test.js +0 -0
- /package/dist/{sdk/helpers → helpers}/uuid.d.ts +0 -0
- /package/dist/{sdk/index-helpers → index-helpers}/top-of-file.d.ts +0 -0
- /package/dist/{sdk/index-helpers → index-helpers}/top-of-file.js +0 -0
- /package/dist/{sdk/scripts → scripts}/init-editing.d.ts +0 -0
- /package/dist/{sdk/types → types}/api-version.d.ts +0 -0
- /package/dist/{sdk/types → types}/api-version.js +0 -0
- /package/dist/{sdk/types → types}/builder-block.d.ts +0 -0
- /package/dist/{server/types → types}/builder-block.js +0 -0
- /package/dist/{sdk/types → types}/builder-content.d.ts +0 -0
- /package/dist/{server/types → types}/builder-content.js +0 -0
- /package/dist/{sdk/types/can-track.js → types/builder-props.js} +0 -0
- /package/dist/{sdk/types → types}/can-track.d.ts +0 -0
- /package/dist/{server/types → types}/can-track.js +0 -0
- /package/dist/{sdk/types → types}/components.js +0 -0
- /package/dist/{sdk/types → types}/deep-partial.d.ts +0 -0
- /package/dist/{sdk/types → types}/deep-partial.js +0 -0
- /package/dist/{sdk/types → types}/element.d.ts +0 -0
- /package/dist/{sdk/types → types}/element.js +0 -0
- /package/dist/{sdk/types/input.js → types/enforced-partials.js} +0 -0
- /package/dist/{sdk/types → types}/input.d.ts +0 -0
- /package/dist/{server/types → types}/input.js +0 -0
- /package/dist/{sdk/types → types}/targets.js +0 -0
- /package/dist/{sdk/types → types}/typescript.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { getSrcSet } from "./image.helpers.js";
|
|
4
4
|
function Image(props) {
|
|
@@ -52,23 +52,23 @@ function Image(props) {
|
|
|
52
52
|
...aspectRatioCss(),
|
|
53
53
|
}, className: "builder-image" +
|
|
54
54
|
(props.className ? " " + props.className : "") +
|
|
55
|
-
" img-
|
|
55
|
+
" img-7c5f6b46", src: props.image, srcSet: srcSetToUse(), sizes: props.sizes })),
|
|
56
56
|
props.aspectRatio &&
|
|
57
57
|
!(props.builderBlock?.children?.length && props.fitContent) ? (React.createElement(React.Fragment, null,
|
|
58
|
-
React.createElement("div", { className: "builder-image-sizer div-
|
|
58
|
+
React.createElement("div", { className: "builder-image-sizer div-7c5f6b46", style: {
|
|
59
59
|
paddingTop: props.aspectRatio * 100 + "%",
|
|
60
60
|
} }))) : null,
|
|
61
61
|
props.builderBlock?.children?.length && props.fitContent ? (React.createElement(React.Fragment, null, props.children)) : null,
|
|
62
62
|
!props.fitContent && props.children ? (React.createElement(React.Fragment, null,
|
|
63
|
-
React.createElement("div", { className: "div-
|
|
64
|
-
React.createElement("style", null, `.img-
|
|
63
|
+
React.createElement("div", { className: "div-7c5f6b46-2" }, props.children))) : null),
|
|
64
|
+
React.createElement("style", null, `.img-7c5f6b46 {
|
|
65
65
|
opacity: 1;
|
|
66
66
|
transition: opacity 0.2s ease-in-out;
|
|
67
|
-
}.div-
|
|
67
|
+
}.div-7c5f6b46 {
|
|
68
68
|
width: 100%;
|
|
69
69
|
pointer-events: none;
|
|
70
70
|
font-size: 0;
|
|
71
|
-
}.div-
|
|
71
|
+
}.div-7c5f6b46-2 {
|
|
72
72
|
display: flex;
|
|
73
73
|
flex-direction: column;
|
|
74
74
|
align-items: stretch;
|
|
@@ -3,15 +3,13 @@ export const componentInfo = {
|
|
|
3
3
|
name: 'Raw:Img',
|
|
4
4
|
hideFromInsertMenu: true,
|
|
5
5
|
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4',
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
6
|
+
inputs: [{
|
|
8
7
|
name: 'image',
|
|
9
8
|
bubble: true,
|
|
10
9
|
type: 'file',
|
|
11
10
|
allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg', 'gif', 'webp'],
|
|
12
|
-
required: true
|
|
13
|
-
},
|
|
14
|
-
],
|
|
11
|
+
required: true
|
|
12
|
+
}],
|
|
15
13
|
noWrap: true,
|
|
16
|
-
static: true
|
|
14
|
+
static: true
|
|
17
15
|
};
|
|
@@ -1,61 +1,36 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
2
|
name: 'Form:Input',
|
|
3
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
|
|
4
|
-
inputs: [
|
|
5
|
-
{
|
|
4
|
+
inputs: [{
|
|
6
5
|
name: 'type',
|
|
7
6
|
type: 'text',
|
|
8
|
-
enum: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'email',
|
|
12
|
-
'url',
|
|
13
|
-
'checkbox',
|
|
14
|
-
'radio',
|
|
15
|
-
'range',
|
|
16
|
-
'date',
|
|
17
|
-
'datetime-local',
|
|
18
|
-
'search',
|
|
19
|
-
'tel',
|
|
20
|
-
'time',
|
|
21
|
-
'file',
|
|
22
|
-
'month',
|
|
23
|
-
'week',
|
|
24
|
-
'password',
|
|
25
|
-
'color',
|
|
26
|
-
'hidden',
|
|
27
|
-
],
|
|
28
|
-
defaultValue: 'text',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
7
|
+
enum: ['text', 'number', 'email', 'url', 'checkbox', 'radio', 'range', 'date', 'datetime-local', 'search', 'tel', 'time', 'file', 'month', 'week', 'password', 'color', 'hidden'],
|
|
8
|
+
defaultValue: 'text'
|
|
9
|
+
}, {
|
|
31
10
|
name: 'name',
|
|
32
11
|
type: 'string',
|
|
33
12
|
required: true,
|
|
34
|
-
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
35
|
-
},
|
|
36
|
-
{
|
|
13
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
14
|
+
}, {
|
|
37
15
|
name: 'placeholder',
|
|
38
16
|
type: 'string',
|
|
39
17
|
defaultValue: 'Hello there',
|
|
40
|
-
helperText: 'Text to display when there is no value'
|
|
18
|
+
helperText: 'Text to display when there is no value'
|
|
41
19
|
},
|
|
42
20
|
// TODO: handle value vs default value automatically like ng-model
|
|
43
21
|
{
|
|
44
22
|
name: 'defaultValue',
|
|
45
|
-
type: 'string'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
23
|
+
type: 'string'
|
|
24
|
+
}, {
|
|
48
25
|
name: 'value',
|
|
49
26
|
type: 'string',
|
|
50
|
-
advanced: true
|
|
51
|
-
},
|
|
52
|
-
{
|
|
27
|
+
advanced: true
|
|
28
|
+
}, {
|
|
53
29
|
name: 'required',
|
|
54
30
|
type: 'boolean',
|
|
55
31
|
helperText: 'Is this input required to be filled out to submit a form',
|
|
56
|
-
defaultValue: false
|
|
57
|
-
},
|
|
58
|
-
],
|
|
32
|
+
defaultValue: false
|
|
33
|
+
}],
|
|
59
34
|
noWrap: true,
|
|
60
35
|
static: true,
|
|
61
36
|
defaultStyles: {
|
|
@@ -66,6 +41,6 @@ export const componentInfo = {
|
|
|
66
41
|
borderRadius: '3px',
|
|
67
42
|
borderWidth: '1px',
|
|
68
43
|
borderStyle: 'solid',
|
|
69
|
-
borderColor: '#ccc'
|
|
70
|
-
}
|
|
44
|
+
borderColor: '#ccc'
|
|
45
|
+
}
|
|
71
46
|
};
|
|
@@ -2,20 +2,17 @@ export const componentInfo = {
|
|
|
2
2
|
name: 'Core:Section',
|
|
3
3
|
static: true,
|
|
4
4
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a',
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
5
|
+
inputs: [{
|
|
7
6
|
name: 'maxWidth',
|
|
8
7
|
type: 'number',
|
|
9
|
-
defaultValue: 1200
|
|
10
|
-
},
|
|
11
|
-
{
|
|
8
|
+
defaultValue: 1200
|
|
9
|
+
}, {
|
|
12
10
|
name: 'lazyLoad',
|
|
13
11
|
type: 'boolean',
|
|
14
12
|
defaultValue: false,
|
|
15
13
|
advanced: true,
|
|
16
|
-
description: 'Only render this section when in view'
|
|
17
|
-
},
|
|
18
|
-
],
|
|
14
|
+
description: 'Only render this section when in view'
|
|
15
|
+
}],
|
|
19
16
|
defaultStyles: {
|
|
20
17
|
paddingLeft: '20px',
|
|
21
18
|
paddingRight: '20px',
|
|
@@ -23,23 +20,21 @@ export const componentInfo = {
|
|
|
23
20
|
paddingBottom: '50px',
|
|
24
21
|
marginTop: '0px',
|
|
25
22
|
width: '100vw',
|
|
26
|
-
marginLeft: 'calc(50% - 50vw)'
|
|
23
|
+
marginLeft: 'calc(50% - 50vw)'
|
|
27
24
|
},
|
|
28
25
|
canHaveChildren: true,
|
|
29
|
-
defaultChildren: [
|
|
30
|
-
{
|
|
26
|
+
defaultChildren: [{
|
|
31
27
|
'@type': '@builder.io/sdk:Element',
|
|
32
28
|
responsiveStyles: {
|
|
33
29
|
large: {
|
|
34
|
-
textAlign: 'center'
|
|
35
|
-
}
|
|
30
|
+
textAlign: 'center'
|
|
31
|
+
}
|
|
36
32
|
},
|
|
37
33
|
component: {
|
|
38
34
|
name: 'Text',
|
|
39
35
|
options: {
|
|
40
|
-
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
],
|
|
36
|
+
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}]
|
|
45
40
|
};
|
|
@@ -2,54 +2,42 @@ export const componentInfo = {
|
|
|
2
2
|
name: 'Form:Select',
|
|
3
3
|
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045',
|
|
4
4
|
defaultStyles: {
|
|
5
|
-
alignSelf: 'flex-start'
|
|
5
|
+
alignSelf: 'flex-start'
|
|
6
6
|
},
|
|
7
|
-
inputs: [
|
|
8
|
-
{
|
|
7
|
+
inputs: [{
|
|
9
8
|
name: 'options',
|
|
10
9
|
type: 'list',
|
|
11
10
|
required: true,
|
|
12
|
-
subFields: [
|
|
13
|
-
{
|
|
11
|
+
subFields: [{
|
|
14
12
|
name: 'value',
|
|
15
13
|
type: 'text',
|
|
16
|
-
required: true
|
|
17
|
-
},
|
|
18
|
-
{
|
|
14
|
+
required: true
|
|
15
|
+
}, {
|
|
19
16
|
name: 'name',
|
|
20
|
-
type: 'text'
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
value: 'option
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
value: 'option 2',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
17
|
+
type: 'text'
|
|
18
|
+
}],
|
|
19
|
+
defaultValue: [{
|
|
20
|
+
value: 'option 1'
|
|
21
|
+
}, {
|
|
22
|
+
value: 'option 2'
|
|
23
|
+
}]
|
|
24
|
+
}, {
|
|
33
25
|
name: 'name',
|
|
34
26
|
type: 'string',
|
|
35
27
|
required: true,
|
|
36
|
-
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
28
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
29
|
+
}, {
|
|
39
30
|
name: 'defaultValue',
|
|
40
|
-
type: 'string'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
31
|
+
type: 'string'
|
|
32
|
+
}, {
|
|
43
33
|
name: 'value',
|
|
44
34
|
type: 'string',
|
|
45
|
-
advanced: true
|
|
46
|
-
},
|
|
47
|
-
{
|
|
35
|
+
advanced: true
|
|
36
|
+
}, {
|
|
48
37
|
name: 'required',
|
|
49
38
|
type: 'boolean',
|
|
50
|
-
defaultValue: false
|
|
51
|
-
},
|
|
52
|
-
],
|
|
39
|
+
defaultValue: false
|
|
40
|
+
}],
|
|
53
41
|
static: true,
|
|
54
|
-
noWrap: true
|
|
42
|
+
noWrap: true
|
|
55
43
|
};
|
|
@@ -10,17 +10,15 @@ export const componentInfo = {
|
|
|
10
10
|
backgroundColor: '#3898EC',
|
|
11
11
|
color: 'white',
|
|
12
12
|
borderRadius: '4px',
|
|
13
|
-
cursor: 'pointer'
|
|
13
|
+
cursor: 'pointer'
|
|
14
14
|
},
|
|
15
|
-
inputs: [
|
|
16
|
-
{
|
|
15
|
+
inputs: [{
|
|
17
16
|
name: 'text',
|
|
18
17
|
type: 'text',
|
|
19
|
-
defaultValue: 'Click me'
|
|
20
|
-
},
|
|
21
|
-
],
|
|
18
|
+
defaultValue: 'Click me'
|
|
19
|
+
}],
|
|
22
20
|
static: true,
|
|
23
|
-
noWrap: true
|
|
21
|
+
noWrap: true
|
|
24
22
|
// TODO: optional children? maybe as optional form input
|
|
25
23
|
// that only shows if advanced setting is flipped
|
|
26
24
|
// TODO: defaultChildren
|
|
@@ -2,38 +2,33 @@ export const componentInfo = {
|
|
|
2
2
|
name: 'Symbol',
|
|
3
3
|
noWrap: true,
|
|
4
4
|
static: true,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
isRSC: true,
|
|
6
|
+
inputs: [{
|
|
7
7
|
name: 'symbol',
|
|
8
|
-
type: 'uiSymbol'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
8
|
+
type: 'uiSymbol'
|
|
9
|
+
}, {
|
|
11
10
|
name: 'dataOnly',
|
|
12
11
|
helperText: "Make this a data symbol that doesn't display any UI",
|
|
13
12
|
type: 'boolean',
|
|
14
13
|
defaultValue: false,
|
|
15
14
|
advanced: true,
|
|
16
|
-
hideFromUI: true
|
|
17
|
-
},
|
|
18
|
-
{
|
|
15
|
+
hideFromUI: true
|
|
16
|
+
}, {
|
|
19
17
|
name: 'inheritState',
|
|
20
18
|
helperText: 'Inherit the parent component state and data',
|
|
21
19
|
type: 'boolean',
|
|
22
20
|
defaultValue: false,
|
|
23
|
-
advanced: true
|
|
24
|
-
},
|
|
25
|
-
{
|
|
21
|
+
advanced: true
|
|
22
|
+
}, {
|
|
26
23
|
name: 'renderToLiquid',
|
|
27
24
|
helperText: 'Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting',
|
|
28
25
|
type: 'boolean',
|
|
29
26
|
defaultValue: false,
|
|
30
27
|
advanced: true,
|
|
31
|
-
hideFromUI: true
|
|
32
|
-
},
|
|
33
|
-
{
|
|
28
|
+
hideFromUI: true
|
|
29
|
+
}, {
|
|
34
30
|
name: 'useChildren',
|
|
35
31
|
hideFromUI: true,
|
|
36
|
-
type: 'boolean'
|
|
37
|
-
}
|
|
38
|
-
],
|
|
32
|
+
type: 'boolean'
|
|
33
|
+
}]
|
|
39
34
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/ export interface SymbolInfo {
|
|
4
|
+
model?: string;
|
|
5
|
+
entry?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
content?: BuilderContent;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
dynamic?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
13
|
+
*/ export interface SymbolProps extends BuilderComponentsProp {
|
|
14
|
+
symbol?: SymbolInfo;
|
|
15
|
+
dataOnly?: boolean;
|
|
16
|
+
dynamic?: boolean;
|
|
17
|
+
attributes?: any;
|
|
18
|
+
inheritState?: boolean;
|
|
19
|
+
}
|
|
20
|
+
import type { BuilderContent } from "../../types/builder-content.js";
|
|
21
|
+
import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
|
|
22
|
+
declare function Symbol(props: PropsWithBuilderData<SymbolProps>): JSX.Element;
|
|
23
|
+
export default Symbol;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../../context/types.js';
|
|
2
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
3
|
+
export interface SymbolInfo {
|
|
4
|
+
model?: string;
|
|
5
|
+
entry?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
content?: BuilderContent;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
dynamic?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const fetchContent: ({ builderContextValue, symbol }: {
|
|
12
|
+
symbol: SymbolInfo | undefined;
|
|
13
|
+
builderContextValue: BuilderContextInterface;
|
|
14
|
+
}) => Promise<any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getContent } from '../../functions/get-content/index.js';
|
|
2
|
+
import { logger } from '../../helpers/logger.js';
|
|
3
|
+
export const fetchContent = async ({ builderContextValue, symbol }) => {
|
|
4
|
+
/**
|
|
5
|
+
* If:
|
|
6
|
+
* - we have a symbol prop
|
|
7
|
+
* - yet it does not have any content
|
|
8
|
+
* - and we have not already stored content from before
|
|
9
|
+
* - and it has a model name
|
|
10
|
+
*
|
|
11
|
+
* then we want to re-fetch the symbol content.
|
|
12
|
+
*/
|
|
13
|
+
if (symbol?.model &&
|
|
14
|
+
// This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
15
|
+
builderContextValue?.apiKey) {
|
|
16
|
+
return getContent({
|
|
17
|
+
model: symbol.model,
|
|
18
|
+
apiKey: builderContextValue.apiKey,
|
|
19
|
+
apiVersion: builderContextValue.apiVersion,
|
|
20
|
+
...(symbol?.entry && {
|
|
21
|
+
query: {
|
|
22
|
+
id: symbol.entry
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}).catch(err => {
|
|
26
|
+
logger.error('Could not fetch symbol content: ', err);
|
|
27
|
+
return undefined;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import ContentVariants from "../../components/content-variants/content-variants";
|
|
5
|
+
import { fetchContent } from "./symbol.helpers.js";
|
|
6
|
+
function Symbol(props) {
|
|
7
|
+
function className() {
|
|
8
|
+
return [
|
|
9
|
+
...[props.attributes.className],
|
|
10
|
+
"builder-symbol",
|
|
11
|
+
props.symbol?.inline ? "builder-inline-symbol" : undefined,
|
|
12
|
+
props.symbol?.dynamic || props.dynamic
|
|
13
|
+
? "builder-dynamic-symbol"
|
|
14
|
+
: undefined,
|
|
15
|
+
]
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(" ");
|
|
18
|
+
}
|
|
19
|
+
const [contentToUse, setContentToUse] = useState(() => props.symbol?.content);
|
|
20
|
+
function setContent() {
|
|
21
|
+
if (contentToUse)
|
|
22
|
+
return;
|
|
23
|
+
fetchContent({
|
|
24
|
+
symbol: props.symbol,
|
|
25
|
+
builderContextValue: props.builderContext,
|
|
26
|
+
}).then((newContent) => {
|
|
27
|
+
if (newContent) {
|
|
28
|
+
setContentToUse(newContent);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
setContent();
|
|
34
|
+
}, []);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setContent();
|
|
37
|
+
}, [props.symbol]);
|
|
38
|
+
return (React.createElement("div", { ...props.attributes, className: className() },
|
|
39
|
+
React.createElement(ContentVariants, { __isNestedRender: true, apiVersion: props.builderContext.apiVersion, apiKey: props.builderContext.apiKey, context: props.builderContext.context, customComponents: Object.values(props.builderComponents), data: {
|
|
40
|
+
...props.symbol?.data,
|
|
41
|
+
...props.builderContext.localState,
|
|
42
|
+
...contentToUse?.data?.state,
|
|
43
|
+
}, model: props.symbol?.model, content: contentToUse })));
|
|
44
|
+
}
|
|
45
|
+
export default Symbol;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
export const componentInfo = {
|
|
2
2
|
name: 'Text',
|
|
3
3
|
static: true,
|
|
4
|
+
isRSC: true,
|
|
4
5
|
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929',
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
6
|
+
inputs: [{
|
|
7
7
|
name: 'text',
|
|
8
8
|
type: 'html',
|
|
9
9
|
required: true,
|
|
10
10
|
autoFocus: true,
|
|
11
11
|
bubble: true,
|
|
12
|
-
defaultValue: 'Enter some text...'
|
|
13
|
-
},
|
|
14
|
-
],
|
|
12
|
+
defaultValue: 'Enter some text...'
|
|
13
|
+
}],
|
|
15
14
|
defaultStyles: {
|
|
16
15
|
lineHeight: 'normal',
|
|
17
16
|
height: 'auto',
|
|
18
|
-
textAlign: 'center'
|
|
19
|
-
}
|
|
17
|
+
textAlign: 'center'
|
|
18
|
+
}
|
|
20
19
|
};
|