@builder.io/sdk-react-native 3.0.0 → 3.0.2
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 +2 -1
- package/lib/browser/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/browser/commonjs/blocks/img/component-info.js +2 -1
- package/lib/browser/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/browser/commonjs/blocks/text/text.js +3 -17
- package/lib/browser/commonjs/blocks/text/text.js.map +1 -1
- package/lib/browser/commonjs/blocks/video/component-info.js +3 -2
- package/lib/browser/commonjs/blocks/video/component-info.js.map +1 -1
- package/lib/browser/commonjs/components/block/block.helpers.js +17 -6
- package/lib/browser/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/browser/commonjs/components/block/block.js +5 -5
- package/lib/browser/commonjs/components/block/block.js.map +1 -1
- package/lib/browser/commonjs/components/content/components/enable-editor.helpers.js +24 -0
- package/lib/browser/commonjs/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/browser/commonjs/components/content/components/enable-editor.js +35 -13
- package/lib/browser/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/commonjs/components/content/content.js +37 -54
- package/lib/browser/commonjs/components/content/content.js.map +1 -1
- package/lib/browser/commonjs/constants/file-types.js +9 -0
- package/lib/browser/commonjs/constants/file-types.js.map +1 -0
- package/lib/browser/commonjs/constants/sdk-version.js +1 -1
- package/lib/browser/commonjs/context/builder.context.js +2 -1
- package/lib/browser/commonjs/context/builder.context.js.map +1 -1
- package/lib/browser/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/browser/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/browser/commonjs/functions/extract-localized-values.js +45 -0
- package/lib/browser/commonjs/functions/extract-localized-values.js.map +1 -0
- package/lib/browser/commonjs/functions/get-block-component-options.js +19 -2
- package/lib/browser/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/browser/commonjs/functions/get-content/generate-content-url.js +29 -2
- package/lib/browser/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/browser/commonjs/functions/get-processed-block.js +10 -13
- package/lib/browser/commonjs/functions/get-processed-block.js.map +1 -1
- package/lib/browser/commonjs/functions/register-component.js +4 -1
- package/lib/browser/commonjs/functions/register-component.js.map +1 -1
- package/lib/browser/commonjs/functions/traverse.js +69 -0
- package/lib/browser/commonjs/functions/traverse.js.map +1 -0
- package/lib/browser/commonjs/helpers/flatten.js +24 -0
- package/lib/browser/commonjs/helpers/flatten.js.map +1 -1
- package/lib/browser/module/blocks/image/component-info.js +2 -1
- package/lib/browser/module/blocks/image/component-info.js.map +1 -1
- package/lib/browser/module/blocks/img/component-info.js +2 -1
- package/lib/browser/module/blocks/img/component-info.js.map +1 -1
- package/lib/browser/module/blocks/text/text.js +3 -17
- package/lib/browser/module/blocks/text/text.js.map +1 -1
- package/lib/browser/module/blocks/video/component-info.js +3 -2
- package/lib/browser/module/blocks/video/component-info.js.map +1 -1
- package/lib/browser/module/components/block/block.helpers.js +17 -6
- package/lib/browser/module/components/block/block.helpers.js.map +1 -1
- package/lib/browser/module/components/block/block.js +5 -5
- package/lib/browser/module/components/block/block.js.map +1 -1
- package/lib/browser/module/components/content/components/enable-editor.helpers.js +17 -0
- package/lib/browser/module/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/browser/module/components/content/components/enable-editor.js +35 -13
- package/lib/browser/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/module/components/content/content.js +37 -54
- package/lib/browser/module/components/content/content.js.map +1 -1
- package/lib/browser/module/constants/file-types.js +3 -0
- package/lib/browser/module/constants/file-types.js.map +1 -0
- package/lib/browser/module/constants/sdk-version.js +1 -1
- package/lib/browser/module/context/builder.context.js +2 -1
- package/lib/browser/module/context/builder.context.js.map +1 -1
- package/lib/browser/module/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/browser/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/browser/module/functions/extract-localized-values.js +39 -0
- package/lib/browser/module/functions/extract-localized-values.js.map +1 -0
- package/lib/browser/module/functions/get-block-component-options.js +19 -2
- package/lib/browser/module/functions/get-block-component-options.js.map +1 -1
- package/lib/browser/module/functions/get-content/generate-content-url.js +30 -3
- package/lib/browser/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/browser/module/functions/get-processed-block.js +10 -13
- package/lib/browser/module/functions/get-processed-block.js.map +1 -1
- package/lib/browser/module/functions/register-component.js +4 -1
- package/lib/browser/module/functions/register-component.js.map +1 -1
- package/lib/browser/module/functions/traverse.js +63 -0
- package/lib/browser/module/functions/traverse.js.map +1 -0
- package/lib/browser/module/helpers/flatten.js +23 -0
- package/lib/browser/module/helpers/flatten.js.map +1 -1
- package/lib/browser/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/browser/typescript/blocks/text/text.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 +6 -3
- package/lib/browser/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/browser/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/browser/typescript/components/content/components/enable-editor.helpers.d.ts +12 -0
- package/lib/browser/typescript/components/content/components/enable-editor.helpers.d.ts.map +1 -0
- package/lib/browser/typescript/components/content/content.d.ts.map +1 -1
- package/lib/browser/typescript/constants/file-types.d.ts +3 -0
- package/lib/browser/typescript/constants/file-types.d.ts.map +1 -0
- package/lib/browser/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/browser/typescript/context/builder.context.d.ts.map +1 -1
- package/lib/browser/typescript/context/types.d.ts +1 -0
- package/lib/browser/typescript/context/types.d.ts.map +1 -1
- package/lib/browser/typescript/functions/extract-localized-values.d.ts +3 -0
- package/lib/browser/typescript/functions/extract-localized-values.d.ts.map +1 -0
- package/lib/browser/typescript/functions/get-block-component-options.d.ts +2 -1
- package/lib/browser/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/browser/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/browser/typescript/functions/get-processed-block.d.ts +1 -6
- package/lib/browser/typescript/functions/get-processed-block.d.ts.map +1 -1
- package/lib/browser/typescript/functions/register-component.d.ts.map +1 -1
- package/lib/browser/typescript/functions/traverse.d.ts +35 -0
- package/lib/browser/typescript/functions/traverse.d.ts.map +1 -0
- package/lib/browser/typescript/helpers/flatten.d.ts +6 -0
- package/lib/browser/typescript/helpers/flatten.d.ts.map +1 -1
- package/lib/browser/typescript/server-index.d.ts +1 -1
- package/lib/browser/typescript/server-index.d.ts.map +1 -1
- package/lib/browser/typescript/types/components.d.ts +3 -0
- package/lib/browser/typescript/types/components.d.ts.map +1 -1
- package/lib/edge/commonjs/blocks/image/component-info.js +2 -1
- package/lib/edge/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/edge/commonjs/blocks/img/component-info.js +2 -1
- package/lib/edge/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/edge/commonjs/blocks/text/text.js +3 -17
- package/lib/edge/commonjs/blocks/text/text.js.map +1 -1
- package/lib/edge/commonjs/blocks/video/component-info.js +3 -2
- package/lib/edge/commonjs/blocks/video/component-info.js.map +1 -1
- package/lib/edge/commonjs/components/block/block.helpers.js +17 -6
- package/lib/edge/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/edge/commonjs/components/block/block.js +5 -5
- package/lib/edge/commonjs/components/block/block.js.map +1 -1
- package/lib/edge/commonjs/components/content/components/enable-editor.helpers.js +24 -0
- package/lib/edge/commonjs/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/edge/commonjs/components/content/components/enable-editor.js +35 -13
- package/lib/edge/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/commonjs/components/content/content.js +37 -54
- package/lib/edge/commonjs/components/content/content.js.map +1 -1
- package/lib/edge/commonjs/constants/file-types.js +9 -0
- package/lib/edge/commonjs/constants/file-types.js.map +1 -0
- package/lib/edge/commonjs/constants/sdk-version.js +1 -1
- package/lib/edge/commonjs/context/builder.context.js +2 -1
- package/lib/edge/commonjs/context/builder.context.js.map +1 -1
- package/lib/edge/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/edge/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/edge/commonjs/functions/extract-localized-values.js +45 -0
- package/lib/edge/commonjs/functions/extract-localized-values.js.map +1 -0
- package/lib/edge/commonjs/functions/get-block-component-options.js +19 -2
- package/lib/edge/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/edge/commonjs/functions/get-content/generate-content-url.js +29 -2
- package/lib/edge/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/edge/commonjs/functions/get-processed-block.js +10 -13
- package/lib/edge/commonjs/functions/get-processed-block.js.map +1 -1
- package/lib/edge/commonjs/functions/register-component.js +4 -1
- package/lib/edge/commonjs/functions/register-component.js.map +1 -1
- package/lib/edge/commonjs/functions/traverse.js +69 -0
- package/lib/edge/commonjs/functions/traverse.js.map +1 -0
- package/lib/edge/commonjs/helpers/flatten.js +24 -0
- package/lib/edge/commonjs/helpers/flatten.js.map +1 -1
- package/lib/edge/module/blocks/image/component-info.js +2 -1
- package/lib/edge/module/blocks/image/component-info.js.map +1 -1
- package/lib/edge/module/blocks/img/component-info.js +2 -1
- package/lib/edge/module/blocks/img/component-info.js.map +1 -1
- package/lib/edge/module/blocks/text/text.js +3 -17
- package/lib/edge/module/blocks/text/text.js.map +1 -1
- package/lib/edge/module/blocks/video/component-info.js +3 -2
- package/lib/edge/module/blocks/video/component-info.js.map +1 -1
- package/lib/edge/module/components/block/block.helpers.js +17 -6
- package/lib/edge/module/components/block/block.helpers.js.map +1 -1
- package/lib/edge/module/components/block/block.js +5 -5
- package/lib/edge/module/components/block/block.js.map +1 -1
- package/lib/edge/module/components/content/components/enable-editor.helpers.js +17 -0
- package/lib/edge/module/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/edge/module/components/content/components/enable-editor.js +35 -13
- package/lib/edge/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/module/components/content/content.js +37 -54
- package/lib/edge/module/components/content/content.js.map +1 -1
- package/lib/edge/module/constants/file-types.js +3 -0
- package/lib/edge/module/constants/file-types.js.map +1 -0
- package/lib/edge/module/constants/sdk-version.js +1 -1
- package/lib/edge/module/context/builder.context.js +2 -1
- package/lib/edge/module/context/builder.context.js.map +1 -1
- package/lib/edge/module/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/edge/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/edge/module/functions/extract-localized-values.js +39 -0
- package/lib/edge/module/functions/extract-localized-values.js.map +1 -0
- package/lib/edge/module/functions/get-block-component-options.js +19 -2
- package/lib/edge/module/functions/get-block-component-options.js.map +1 -1
- package/lib/edge/module/functions/get-content/generate-content-url.js +30 -3
- package/lib/edge/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/edge/module/functions/get-processed-block.js +10 -13
- package/lib/edge/module/functions/get-processed-block.js.map +1 -1
- package/lib/edge/module/functions/register-component.js +4 -1
- package/lib/edge/module/functions/register-component.js.map +1 -1
- package/lib/edge/module/functions/traverse.js +63 -0
- package/lib/edge/module/functions/traverse.js.map +1 -0
- package/lib/edge/module/helpers/flatten.js +23 -0
- package/lib/edge/module/helpers/flatten.js.map +1 -1
- package/lib/edge/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/edge/typescript/blocks/text/text.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 +6 -3
- package/lib/edge/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/edge/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/edge/typescript/components/content/components/enable-editor.helpers.d.ts +12 -0
- package/lib/edge/typescript/components/content/components/enable-editor.helpers.d.ts.map +1 -0
- package/lib/edge/typescript/components/content/content.d.ts.map +1 -1
- package/lib/edge/typescript/constants/file-types.d.ts +3 -0
- package/lib/edge/typescript/constants/file-types.d.ts.map +1 -0
- package/lib/edge/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/edge/typescript/context/builder.context.d.ts.map +1 -1
- package/lib/edge/typescript/context/types.d.ts +1 -0
- package/lib/edge/typescript/context/types.d.ts.map +1 -1
- package/lib/edge/typescript/functions/extract-localized-values.d.ts +3 -0
- package/lib/edge/typescript/functions/extract-localized-values.d.ts.map +1 -0
- package/lib/edge/typescript/functions/get-block-component-options.d.ts +2 -1
- package/lib/edge/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/edge/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/edge/typescript/functions/get-processed-block.d.ts +1 -6
- package/lib/edge/typescript/functions/get-processed-block.d.ts.map +1 -1
- package/lib/edge/typescript/functions/register-component.d.ts.map +1 -1
- package/lib/edge/typescript/functions/traverse.d.ts +35 -0
- package/lib/edge/typescript/functions/traverse.d.ts.map +1 -0
- package/lib/edge/typescript/helpers/flatten.d.ts +6 -0
- package/lib/edge/typescript/helpers/flatten.d.ts.map +1 -1
- package/lib/edge/typescript/server-index.d.ts +1 -1
- package/lib/edge/typescript/server-index.d.ts.map +1 -1
- package/lib/edge/typescript/types/components.d.ts +3 -0
- package/lib/edge/typescript/types/components.d.ts.map +1 -1
- package/lib/node/commonjs/blocks/image/component-info.js +2 -1
- package/lib/node/commonjs/blocks/image/component-info.js.map +1 -1
- package/lib/node/commonjs/blocks/img/component-info.js +2 -1
- package/lib/node/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/node/commonjs/blocks/text/text.js +3 -17
- package/lib/node/commonjs/blocks/text/text.js.map +1 -1
- package/lib/node/commonjs/blocks/video/component-info.js +3 -2
- package/lib/node/commonjs/blocks/video/component-info.js.map +1 -1
- package/lib/node/commonjs/components/block/block.helpers.js +17 -6
- package/lib/node/commonjs/components/block/block.helpers.js.map +1 -1
- package/lib/node/commonjs/components/block/block.js +5 -5
- package/lib/node/commonjs/components/block/block.js.map +1 -1
- package/lib/node/commonjs/components/content/components/enable-editor.helpers.js +24 -0
- package/lib/node/commonjs/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/node/commonjs/components/content/components/enable-editor.js +35 -13
- package/lib/node/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/commonjs/components/content/content.js +37 -54
- package/lib/node/commonjs/components/content/content.js.map +1 -1
- package/lib/node/commonjs/constants/file-types.js +9 -0
- package/lib/node/commonjs/constants/file-types.js.map +1 -0
- package/lib/node/commonjs/constants/sdk-version.js +1 -1
- package/lib/node/commonjs/context/builder.context.js +2 -1
- package/lib/node/commonjs/context/builder.context.js.map +1 -1
- package/lib/node/commonjs/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/node/commonjs/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/node/commonjs/functions/extract-localized-values.js +45 -0
- package/lib/node/commonjs/functions/extract-localized-values.js.map +1 -0
- package/lib/node/commonjs/functions/get-block-component-options.js +19 -2
- package/lib/node/commonjs/functions/get-block-component-options.js.map +1 -1
- package/lib/node/commonjs/functions/get-content/generate-content-url.js +29 -2
- package/lib/node/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/node/commonjs/functions/get-processed-block.js +10 -13
- package/lib/node/commonjs/functions/get-processed-block.js.map +1 -1
- package/lib/node/commonjs/functions/register-component.js +4 -1
- package/lib/node/commonjs/functions/register-component.js.map +1 -1
- package/lib/node/commonjs/functions/traverse.js +69 -0
- package/lib/node/commonjs/functions/traverse.js.map +1 -0
- package/lib/node/commonjs/helpers/flatten.js +24 -0
- package/lib/node/commonjs/helpers/flatten.js.map +1 -1
- package/lib/node/module/blocks/image/component-info.js +2 -1
- package/lib/node/module/blocks/image/component-info.js.map +1 -1
- package/lib/node/module/blocks/img/component-info.js +2 -1
- package/lib/node/module/blocks/img/component-info.js.map +1 -1
- package/lib/node/module/blocks/text/text.js +3 -17
- package/lib/node/module/blocks/text/text.js.map +1 -1
- package/lib/node/module/blocks/video/component-info.js +3 -2
- package/lib/node/module/blocks/video/component-info.js.map +1 -1
- package/lib/node/module/components/block/block.helpers.js +17 -6
- package/lib/node/module/components/block/block.helpers.js.map +1 -1
- package/lib/node/module/components/block/block.js +5 -5
- package/lib/node/module/components/block/block.js.map +1 -1
- package/lib/node/module/components/content/components/enable-editor.helpers.js +17 -0
- package/lib/node/module/components/content/components/enable-editor.helpers.js.map +1 -0
- package/lib/node/module/components/content/components/enable-editor.js +35 -13
- package/lib/node/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/module/components/content/content.js +37 -54
- package/lib/node/module/components/content/content.js.map +1 -1
- package/lib/node/module/constants/file-types.js +3 -0
- package/lib/node/module/constants/file-types.js.map +1 -0
- package/lib/node/module/constants/sdk-version.js +1 -1
- package/lib/node/module/context/builder.context.js +2 -1
- package/lib/node/module/context/builder.context.js.map +1 -1
- package/lib/node/module/functions/evaluate/edge-runtime/edge-runtime.js +1 -5
- package/lib/node/module/functions/evaluate/edge-runtime/edge-runtime.js.map +1 -1
- package/lib/node/module/functions/extract-localized-values.js +39 -0
- package/lib/node/module/functions/extract-localized-values.js.map +1 -0
- package/lib/node/module/functions/get-block-component-options.js +19 -2
- package/lib/node/module/functions/get-block-component-options.js.map +1 -1
- package/lib/node/module/functions/get-content/generate-content-url.js +30 -3
- package/lib/node/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/node/module/functions/get-processed-block.js +10 -13
- package/lib/node/module/functions/get-processed-block.js.map +1 -1
- package/lib/node/module/functions/register-component.js +4 -1
- package/lib/node/module/functions/register-component.js.map +1 -1
- package/lib/node/module/functions/traverse.js +63 -0
- package/lib/node/module/functions/traverse.js.map +1 -0
- package/lib/node/module/helpers/flatten.js +23 -0
- package/lib/node/module/helpers/flatten.js.map +1 -1
- package/lib/node/typescript/blocks/image/component-info.d.ts.map +1 -1
- package/lib/node/typescript/blocks/text/text.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 +6 -3
- package/lib/node/typescript/components/block/block.helpers.d.ts.map +1 -1
- package/lib/node/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/node/typescript/components/content/components/enable-editor.helpers.d.ts +12 -0
- package/lib/node/typescript/components/content/components/enable-editor.helpers.d.ts.map +1 -0
- package/lib/node/typescript/components/content/content.d.ts.map +1 -1
- package/lib/node/typescript/constants/file-types.d.ts +3 -0
- package/lib/node/typescript/constants/file-types.d.ts.map +1 -0
- package/lib/node/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/node/typescript/context/builder.context.d.ts.map +1 -1
- package/lib/node/typescript/context/types.d.ts +1 -0
- package/lib/node/typescript/context/types.d.ts.map +1 -1
- package/lib/node/typescript/functions/extract-localized-values.d.ts +3 -0
- package/lib/node/typescript/functions/extract-localized-values.d.ts.map +1 -0
- package/lib/node/typescript/functions/get-block-component-options.d.ts +2 -1
- package/lib/node/typescript/functions/get-block-component-options.d.ts.map +1 -1
- package/lib/node/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/node/typescript/functions/get-processed-block.d.ts +1 -6
- package/lib/node/typescript/functions/get-processed-block.d.ts.map +1 -1
- package/lib/node/typescript/functions/register-component.d.ts.map +1 -1
- package/lib/node/typescript/functions/traverse.d.ts +35 -0
- package/lib/node/typescript/functions/traverse.d.ts.map +1 -0
- package/lib/node/typescript/helpers/flatten.d.ts +6 -0
- package/lib/node/typescript/helpers/flatten.d.ts.map +1 -1
- package/lib/node/typescript/server-index.d.ts +1 -1
- package/lib/node/typescript/server-index.d.ts.map +1 -1
- package/lib/node/typescript/types/components.d.ts +3 -0
- package/lib/node/typescript/types/components.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/image/component-info.ts +2 -1
- package/src/blocks/img/component-info.ts +2 -1
- package/src/blocks/text/text.tsx +3 -25
- package/src/blocks/video/component-info.ts +3 -2
- package/src/components/block/block.helpers.ts +18 -6
- package/src/components/block/block.tsx +4 -3
- package/src/components/content/components/enable-editor.helpers.ts +18 -0
- package/src/components/content/components/enable-editor.tsx +51 -13
- package/src/components/content/content.tsx +3 -10
- package/src/constants/file-types.ts +2 -0
- package/src/constants/sdk-version.ts +1 -1
- package/src/context/builder.context.ts +1 -0
- package/src/context/types.ts +1 -0
- package/src/functions/evaluate/edge-runtime/edge-runtime.ts +1 -5
- package/src/functions/extract-localized-values.ts +38 -0
- package/src/functions/get-block-component-options.ts +19 -2
- package/src/functions/get-content/generate-content-url.ts +30 -3
- package/src/functions/get-processed-block.ts +10 -18
- package/src/functions/register-component.ts +4 -1
- package/src/functions/traverse.ts +64 -0
- package/src/helpers/flatten.ts +23 -0
- package/src/server-index.ts +1 -1
- package/src/types/components.ts +3 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { BuilderContextInterface, RegisteredComponent, RegisteredComponents } from '../../context/types';
|
|
2
2
|
import type { BuilderBlock } from '../../types/builder-block';
|
|
3
3
|
import type { RepeatData } from './types';
|
|
4
|
-
export declare const getComponent: ({ block, registeredComponents }: {
|
|
4
|
+
export declare const getComponent: ({ block, registeredComponents, model }: {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
registeredComponents: RegisteredComponents;
|
|
7
|
+
model: string;
|
|
7
8
|
}) => RegisteredComponent;
|
|
8
9
|
export declare const getRepeatItemData: ({ block, context }: {
|
|
9
10
|
block: BuilderBlock;
|
|
@@ -18,8 +19,10 @@ export declare const provideLinkComponent: (block: RegisteredComponent | null |
|
|
|
18
19
|
} | {
|
|
19
20
|
builderLinkComponent?: undefined;
|
|
20
21
|
};
|
|
21
|
-
export declare const provideRegisteredComponents: (block: RegisteredComponent | null | undefined, registeredComponents: RegisteredComponents) => {
|
|
22
|
-
builderComponents:
|
|
22
|
+
export declare const provideRegisteredComponents: (block: RegisteredComponent | null | undefined, registeredComponents: RegisteredComponents, model: string) => {
|
|
23
|
+
builderComponents: {
|
|
24
|
+
[k: string]: RegisteredComponent;
|
|
25
|
+
};
|
|
23
26
|
} | {
|
|
24
27
|
builderComponents?: undefined;
|
|
25
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAI9G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"block.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAI9G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,eAAO,MAAM,YAAY;WAKhB,YAAY;0BACG,oBAAoB;WACnC,MAAM;yBAgBd,CAAC;AACF,eAAO,MAAM,iBAAiB;WAIrB,YAAY;aACV,uBAAuB;MAC9B,UAAU,EAAE,GAAG,SAsClB,CAAC;AACF,eAAO,MAAM,kBAAkB;WAItB,YAAY;aACV,uBAAuB;kCAUjC,CAAC;AACF,eAAO,MAAM,oBAAoB,UAAW,mBAAmB,GAAG,IAAI,GAAG,SAAS,iBAAiB,GAAG;;;;CAKrG,CAAC;AACF,eAAO,MAAM,2BAA2B,UAAW,mBAAmB,GAAG,IAAI,GAAG,SAAS,wBAAwB,oBAAoB,SAAS,MAAM;;;;;;CAUnJ,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,mBAAmB,GAAG,IAAI,GAAG,SAAS,gBAAgB,YAAY;;;;CAK5G,CAAC;AACF,eAAO,MAAM,qBAAqB,UAAW,mBAAmB,GAAG,IAAI,GAAG,SAAS,WAAW,uBAAuB;;;;CAKpH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/content/components/enable-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,KAAK,kBAAkB,GAAG,IAAI,CAC5B,YAAY,EACV,kBAAkB,GAClB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,oBAAoB,EAAE,uBAAuB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/C,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAuBtE,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"enable-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/content/components/enable-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,KAAK,kBAAkB,GAAG,IAAI,CAC5B,YAAY,EACV,kBAAkB,GAClB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,oBAAoB,EAAE,uBAAuB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/C,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAuBtE,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAI1B,iBAAS,YAAY,CAAC,KAAK,EAAE,kBAAkB,qBAua9C;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Target } from '../../../types/targets';
|
|
2
|
+
/**
|
|
3
|
+
* SDKS that use the elementRef approach to enable visual editing.
|
|
4
|
+
* We don't need to render the div for other SDKs as they attach event listeners to the window.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SDKS_USING_ELEMENT_REF_APPROACH: Target[];
|
|
7
|
+
/**
|
|
8
|
+
* We need to attach this div only when content exists or isPreviewing/isEditing even when content is null,
|
|
9
|
+
* as we need to set the elementRef and allow previewing and visual editing
|
|
10
|
+
*/
|
|
11
|
+
export declare const needsElementRefDivForEditing: () => boolean;
|
|
12
|
+
//# sourceMappingURL=enable-editor.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-editor.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/components/content/components/enable-editor.helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,UAA0C,CAAC;AAEvF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,eAExC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../src/components/content/content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../src/components/content/content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,YAAY,qBAwJ5C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-types.d.ts","sourceRoot":"","sources":["../../../../src/constants/file-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAA2L,CAAC;AACzN,eAAO,MAAM,gBAAgB,UAAsR,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.0.
|
|
1
|
+
export declare const SDK_VERSION = "3.0.2";
|
|
2
2
|
//# sourceMappingURL=sdk-version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.context.d.ts","sourceRoot":"","sources":["../../../../src/context/builder.context.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"builder.context.d.ts","sourceRoot":"","sources":["../../../../src/context/builder.context.ts"],"names":[],"mappings":";;AAEA,wBAcG"}
|
|
@@ -36,6 +36,7 @@ export interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'Block
|
|
|
36
36
|
componentInfos: Dictionary<ComponentInfo>;
|
|
37
37
|
inheritedStyles: Record<string, unknown>;
|
|
38
38
|
nonce: string;
|
|
39
|
+
model: string;
|
|
39
40
|
canTrack?: boolean;
|
|
40
41
|
}
|
|
41
42
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/context/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO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G,SAAS,CAAC;IACnC,cAAc,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAE1C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-localized-values.d.ts","sourceRoot":"","sources":["../../../../src/functions/extract-localized-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA6B3D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,gBAQrF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types';
|
|
1
2
|
import type { BuilderBlock } from '../types/builder-block';
|
|
2
|
-
export declare function getBlockComponentOptions(block: BuilderBlock): any;
|
|
3
|
+
export declare function getBlockComponentOptions(block: BuilderBlock, context: Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
|
|
3
4
|
//# sourceMappingURL=get-block-component-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-block-component-options.d.ts","sourceRoot":"","sources":["../../../../src/functions/get-block-component-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-block-component-options.d.ts","sourceRoot":"","sources":["../../../../src/functions/get-block-component-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC,OAM5J"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-content-url.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/generate-content-url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-content-url.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/generate-content-url.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,kBAAkB,YAAa,iBAAiB,KAAG,GA+F/D,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block';
|
|
3
3
|
export declare function deepCloneWithConditions<T = any>(obj: T): T;
|
|
4
|
-
export declare function getProcessedBlock({ block, context,
|
|
4
|
+
export declare function getProcessedBlock({ block, context, localState, rootState, rootSetState }: {
|
|
5
5
|
block: BuilderBlock;
|
|
6
|
-
/**
|
|
7
|
-
* In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
|
|
8
|
-
* also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
|
|
9
|
-
*/
|
|
10
|
-
shouldEvaluateBindings: boolean;
|
|
11
6
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
|
|
12
7
|
//# sourceMappingURL=get-processed-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-processed-block.d.ts","sourceRoot":"","sources":["../../../../src/functions/get-processed-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-processed-block.d.ts","sourceRoot":"","sources":["../../../../src/functions/get-processed-block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQ3D,wBAAgB,uBAAuB,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAiB1D;AAwDD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,UAAU,EACV,SAAS,EACT,YAAY,EACb,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,IAAI,CAAC,uBAAuB,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC,GAAG,YAAY,CAUxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-component.d.ts","sourceRoot":"","sources":["../../../../src/functions/register-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,eAAO,MAAM,8BAA8B,SAAU,aAAa;;;CAGhE,CAAC;
|
|
1
|
+
{"version":3,"file":"register-component.d.ts","sourceRoot":"","sources":["../../../../src/functions/register-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,eAAO,MAAM,8BAA8B,SAAU,aAAa;;;CAGhE,CAAC;AAkBH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,aAAa,OAO9D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type TraverseCallback = (value: any, update: (newValue: any) => void) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Recursively traverses an object or array, invoking a callback on each value.
|
|
4
|
+
*
|
|
5
|
+
* @param {any} obj - The object or array to traverse. Can also handle primitives, null, or undefined.
|
|
6
|
+
* @param {TraverseCallback} callback - The function to invoke on each value. Receives the current value
|
|
7
|
+
* and an `update` function to modify the value in its parent container.
|
|
8
|
+
* @param {any} [parent=null] - The parent object or array of the current value. Used internally.
|
|
9
|
+
* @param {any} [key=null] - The key or index of the current value in its parent. Used internally.
|
|
10
|
+
* @param {WeakSet} [visited=new WeakSet()] - Tracks visited objects to handle circular references. Used internally.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Example: Doubling all numbers in an object
|
|
14
|
+
* const obj = { a: 1, b: [2, 3, { c: 4 }] };
|
|
15
|
+
* traverse(obj, (value, update) => {
|
|
16
|
+
* if (typeof value === 'number') {
|
|
17
|
+
* update(value * 2);
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
* console.log(obj); // { a: 2, b: [4, 6, { c: 8 }] }
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Example: Handling circular references
|
|
24
|
+
* const obj = { a: 1 };
|
|
25
|
+
* obj.self = obj;
|
|
26
|
+
* traverse(obj, (value, update) => {
|
|
27
|
+
* if (typeof value === 'number') {
|
|
28
|
+
* update(value * 2);
|
|
29
|
+
* }
|
|
30
|
+
* });
|
|
31
|
+
* console.log(obj.a); // 2
|
|
32
|
+
*/
|
|
33
|
+
export declare function traverse(obj: any, callback: TraverseCallback, parent?: any, key?: any, visited?: WeakSet<object>): void;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=traverse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../../../src/functions/traverse.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,GAAE,GAAU,EAAE,GAAG,GAAE,GAAU,EAAE,OAAO,kBAAgB,GAAG,IAAI,CA8BjI"}
|
|
@@ -14,4 +14,10 @@ export declare function flatten<T extends Record<string, any>>(object: T, path?:
|
|
|
14
14
|
export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Unflatten a flat object with dot-separated keys back into a nested object.
|
|
19
|
+
*
|
|
20
|
+
* { 'foo.bar': 'baz' } -> { foo: { bar: 'baz' }}
|
|
21
|
+
*/
|
|
22
|
+
export declare function unflatten(obj: any): any;
|
|
17
23
|
//# sourceMappingURL=flatten.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../../src/helpers/flatten.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,GAAE,MAAM,GAAG,IAAW,EAAE,SAAS,SAAM,GAAG,CAAC,CAahH;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG;IAC3E,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAWA"}
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../../src/helpers/flatten.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,GAAE,MAAM,GAAG,IAAW,EAAE,SAAS,SAAM,GAAG,CAAC,CAahH;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG;IAC3E,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAWA;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAgBvC"}
|
|
@@ -15,7 +15,7 @@ export type { ContentVariantsPrps as ContentProps } from './components/content-v
|
|
|
15
15
|
/**
|
|
16
16
|
* General Builder types
|
|
17
17
|
*/
|
|
18
|
-
export type { RegisteredComponent } from './context/types';
|
|
18
|
+
export type { BuilderContextInterface, RegisteredComponent, RegisteredComponents } from './context/types';
|
|
19
19
|
export type { BuilderBlock } from './types/builder-block';
|
|
20
20
|
export type { BuilderContent } from './types/builder-content';
|
|
21
21
|
export type { ComponentInfo } from './types/components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-index.d.ts","sourceRoot":"","sources":["../../../src/server-index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAE5C;;GAEG;AACH,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,mBAAmB,IAAI,YAAY,EAAE,MAAM,sDAAsD,CAAC;AAEhH;;GAEG;AACH,YAAY,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|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.componentInfo = void 0;
|
|
7
|
+
var _fileTypes = require("../../constants/file-types");
|
|
7
8
|
const componentInfo = exports.componentInfo = {
|
|
8
9
|
name: 'Image',
|
|
9
10
|
static: true,
|
|
@@ -19,7 +20,7 @@ const componentInfo = exports.componentInfo = {
|
|
|
19
20
|
name: 'image',
|
|
20
21
|
type: 'file',
|
|
21
22
|
bubble: true,
|
|
22
|
-
allowedFileTypes:
|
|
23
|
+
allowedFileTypes: _fileTypes.IMAGE_FILE_TYPES,
|
|
23
24
|
required: true,
|
|
24
25
|
defaultValue: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a',
|
|
25
26
|
onChange: options => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["componentInfo","exports","name","static","image","defaultStyles","position","minHeight","minWidth","overflow","canHaveChildren","inputs","type","bubble","allowedFileTypes","required","defaultValue","onChange","options","DEFAULT_ASPECT_RATIO","delete","loadImage","url","timeout","Promise","resolve","reject","img","document","createElement","loaded","onload","addEventListener","event","console","warn","error","src","setTimeout","Error","round","num","Math","value","get","aspectRatio","fetch","then","res","blob","includes","set","possiblyUpdatedAspectRatio","width","height","enum","label","helperText","hideFromUI","advanced","shouldReceiveBuilderProps","builderBlock"],"sourceRoot":"../../../../../src","sources":["blocks/image/component-info.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_fileTypes","require","componentInfo","exports","name","static","image","defaultStyles","position","minHeight","minWidth","overflow","canHaveChildren","inputs","type","bubble","allowedFileTypes","IMAGE_FILE_TYPES","required","defaultValue","onChange","options","DEFAULT_ASPECT_RATIO","delete","loadImage","url","timeout","Promise","resolve","reject","img","document","createElement","loaded","onload","addEventListener","event","console","warn","error","src","setTimeout","Error","round","num","Math","value","get","aspectRatio","fetch","then","res","blob","includes","set","possiblyUpdatedAspectRatio","width","height","enum","label","helperText","hideFromUI","advanced","shouldReceiveBuilderProps","builderBlock"],"sourceRoot":"../../../../../src","sources":["blocks/image/component-info.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC1CE,IAAI,EAAE,OAAO;EACbC,MAAM,EAAE,IAAI;EACZC,KAAK,EAAE,sKAAsK;EAC7KC,aAAa,EAAE;IACbC,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,MAAM;IACjBC,QAAQ,EAAE,MAAM;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDC,eAAe,EAAE,IAAI;EACrBC,MAAM,EAAE,CAAC;IACPT,IAAI,EAAE,OAAO;IACbU,IAAI,EAAE,MAAM;IACZC,MAAM,EAAE,IAAI;IACZC,gBAAgB,EAAEC,2BAAgB;IAClCC,QAAQ,EAAE,IAAI;IACdC,YAAY,EAAE,sGAAsG;IACpHC,QAAQ,EAAGC,OAAyB,IAA2B;MAC7D,MAAMC,oBAAoB,GAAG,MAAM;MACnCD,OAAO,CAACE,MAAM,CAAC,QAAQ,CAAC;MACxBF,OAAO,CAACE,MAAM,CAAC,QAAQ,CAAC;MACxB,SAASC,SAASA,CAACC,GAAW,EAAEC,OAAO,GAAG,KAAK,EAA6B;QAC1E,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;UACtC,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;UACzC,IAAIC,MAAM,GAAG,KAAK;UAClBH,GAAG,CAACI,MAAM,GAAG,MAAM;YACjBD,MAAM,GAAG,IAAI;YACbL,OAAO,CAACE,GAAG,CAAC;UACd,CAAC;UACDA,GAAG,CAACK,gBAAgB,CAAC,OAAO,EAAEC,KAAK,IAAI;YACrCC,OAAO,CAACC,IAAI,CAAC,mBAAmB,EAAEF,KAAK,CAACG,KAAK,CAAC;YAC9CV,MAAM,CAACO,KAAK,CAAC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,CAAC,EAAE;IACDzD,IAAI,EAAE,MAAM;IACZU,IAAI,EAAE,SAAS;IACfK,YAAY,EAAE,IAAI;IAClB0C,UAAU,EAAE;EACd,CAAC,EAAE;IACDzD,IAAI,EAAE,YAAY;IAClBU,IAAI,EAAE,SAAS;IACf8C,UAAU,EAAE,uFAAuF;IACnGzC,YAAY,EAAE;EAChB,CAAC,EAAE;IACDf,IAAI,EAAE,cAAc;IACpBU,IAAI,EAAE,SAAS;IACfgD,QAAQ,EAAE,IAAI;IACdF,UAAU,EAAE;EACd,CAAC,EAAE;IACDxD,IAAI,EAAE,aAAa;IACnBU,IAAI,EAAE,QAAQ;IACd8C,UAAU,EAAE,yJAAyJ;IACrKE,QAAQ,EAAE,IAAI;IACd3C,YAAY,EAAE;EAChB,CAAC,CAAC;EACF4C,yBAAyB,EAAE;IACzBC,YAAY,EAAE;EAChB;AACF,CAAC"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.componentInfo = void 0;
|
|
7
|
+
var _fileTypes = require("../../constants/file-types");
|
|
7
8
|
const componentInfo = exports.componentInfo = {
|
|
8
9
|
// friendlyName?
|
|
9
10
|
name: 'Raw:Img',
|
|
@@ -13,7 +14,7 @@ const componentInfo = exports.componentInfo = {
|
|
|
13
14
|
name: 'image',
|
|
14
15
|
bubble: true,
|
|
15
16
|
type: 'file',
|
|
16
|
-
allowedFileTypes:
|
|
17
|
+
allowedFileTypes: _fileTypes.IMAGE_FILE_TYPES,
|
|
17
18
|
required: true
|
|
18
19
|
}],
|
|
19
20
|
noWrap: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["componentInfo","exports","name","hideFromInsertMenu","image","inputs","bubble","type","allowedFileTypes","required","noWrap","static"],"sourceRoot":"../../../../../src","sources":["blocks/img/component-info.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_fileTypes","require","componentInfo","exports","name","hideFromInsertMenu","image","inputs","bubble","type","allowedFileTypes","IMAGE_FILE_TYPES","required","noWrap","static"],"sourceRoot":"../../../../../src","sources":["blocks/img/component-info.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC1C;EACAE,IAAI,EAAE,SAAS;EACfC,kBAAkB,EAAE,IAAI;EACxBC,KAAK,EAAE,sKAAsK;EAC7KC,MAAM,EAAE,CAAC;IACPH,IAAI,EAAE,OAAO;IACbI,MAAM,EAAE,IAAI;IACZC,IAAI,EAAE,MAAM;IACZC,gBAAgB,EAAEC,2BAAgB;IAClCC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE;AACV,CAAC"}
|
|
@@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Text;
|
|
7
|
+
var _reactNativeRenderHtml = require("@builder.io/react-native-render-html");
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _reactNative = require("react-native");
|
|
9
|
-
var _reactNativeRenderHtml = require("@builder.io/react-native-render-html");
|
|
10
10
|
var _builder = _interopRequireDefault(require("../../context/builder.context"));
|
|
11
|
-
var _index = require("../../functions/evaluate/index");
|
|
12
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -93,7 +92,7 @@ function getCss(block, inheritedStyles) {
|
|
|
93
92
|
/**
|
|
94
93
|
*
|
|
95
94
|
* @param {{ text: string; builderBlock: BuilderBlock, builderContext: BuilderContext}} props
|
|
96
|
-
* @returns
|
|
95
|
+
* @returns
|
|
97
96
|
*/
|
|
98
97
|
function Text(props) {
|
|
99
98
|
var _props$text;
|
|
@@ -101,23 +100,10 @@ function Text(props) {
|
|
|
101
100
|
width
|
|
102
101
|
} = (0, _reactNative.useWindowDimensions)();
|
|
103
102
|
const context = React.useContext(_builder.default);
|
|
104
|
-
const {
|
|
105
|
-
context: contextContext,
|
|
106
|
-
localState,
|
|
107
|
-
rootState,
|
|
108
|
-
rootSetState
|
|
109
|
-
} = context;
|
|
110
|
-
const processedText = String(((_props$text = props.text) === null || _props$text === void 0 ? void 0 : _props$text.toString()) || '').replace(/{{([^}]+)}}/g, (match, group) => (0, _index.evaluate)({
|
|
111
|
-
code: group,
|
|
112
|
-
context: contextContext,
|
|
113
|
-
localState,
|
|
114
|
-
rootState,
|
|
115
|
-
rootSetState
|
|
116
|
-
}).toString());
|
|
117
103
|
return /*#__PURE__*/React.createElement(_reactNativeRenderHtml.RenderHTML, {
|
|
118
104
|
contentWidth: width,
|
|
119
105
|
source: {
|
|
120
|
-
html: `<div style="${getCss(props.builderBlock, context.inheritedStyles)}">${
|
|
106
|
+
html: `<div style="${getCss(props.builderBlock, context.inheritedStyles)}">${((_props$text = props.text) === null || _props$text === void 0 ? void 0 : _props$text.toString()) || ''}</div>`
|
|
121
107
|
}
|
|
122
108
|
});
|
|
123
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNativeRenderHtml","require","React","_interopRequireWildcard","_reactNative","_builder","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","camelToKebabCase","string","replace","toLowerCase","pick","object","keys","reduce","key","PICK_STYLES","getBlockStyles","block","_block$responsiveStyl","_block$responsiveStyl2","_block$responsiveStyl3","styles","responsiveStyles","large","medium","assign","small","getCss","inheritedStyles","styleObject","str","value","Text","props","_props$text","width","useWindowDimensions","context","useContext","BuilderContext","createElement","RenderHTML","contentWidth","source","html","builderBlock","text","toString"],"sourceRoot":"../../../../../src","sources":["blocks/text/text.tsx"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA2D,SAAAK,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAA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AAAC,WAAA;EAClC,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,gCAAmB,EAAC,CAAC;EACvC,MAAMC,OAAO,GAAG1D,KAAK,CAAC2D,UAAU,CAACC,gBAAc,CAAC;EAEhD,oBACE5D,KAAA,CAAA6D,aAAA,CAAC/D,sBAAA,CAAAgE,UAAU;IACTC,YAAY,EAAEP,KAAM;IACpBQ,MAAM,EAAE;MACNC,IAAI,EAAG,eAAcjB,MAAM,CAACM,KAAK,CAACY,YAAY,EAAER,OAAO,CAACT,eAAe,CAAE,KAAI,EAAAM,WAAA,GAAAD,KAAK,CAACa,IAAI,cAAAZ,WAAA,uBAAVA,WAAA,CAAYa,QAAQ,CAAC,CAAC,KAAI,EAAG;IAC5G;EAAE,CACH,CAAC;AAEN"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.componentInfo = void 0;
|
|
7
|
+
var _fileTypes = require("../../constants/file-types");
|
|
7
8
|
const componentInfo = exports.componentInfo = {
|
|
8
9
|
name: 'Video',
|
|
9
10
|
canHaveChildren: true,
|
|
@@ -15,14 +16,14 @@ const componentInfo = exports.componentInfo = {
|
|
|
15
16
|
inputs: [{
|
|
16
17
|
name: 'video',
|
|
17
18
|
type: 'file',
|
|
18
|
-
allowedFileTypes:
|
|
19
|
+
allowedFileTypes: _fileTypes.VIDEO_FILE_TYPES,
|
|
19
20
|
bubble: true,
|
|
20
21
|
defaultValue: 'https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true',
|
|
21
22
|
required: true
|
|
22
23
|
}, {
|
|
23
24
|
name: 'posterImage',
|
|
24
25
|
type: 'file',
|
|
25
|
-
allowedFileTypes:
|
|
26
|
+
allowedFileTypes: _fileTypes.IMAGE_FILE_TYPES,
|
|
26
27
|
helperText: 'Image to show before the video plays'
|
|
27
28
|
}, {
|
|
28
29
|
name: 'autoPlay',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["componentInfo","exports","name","canHaveChildren","defaultStyles","minHeight","minWidth","image","inputs","type","allowedFileTypes","bubble","defaultValue","required","helperText","enum","advanced","shouldReceiveBuilderProps","builderBlock"],"sourceRoot":"../../../../../src","sources":["blocks/video/component-info.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_fileTypes","require","componentInfo","exports","name","canHaveChildren","defaultStyles","minHeight","minWidth","image","inputs","type","allowedFileTypes","VIDEO_FILE_TYPES","bubble","defaultValue","required","IMAGE_FILE_TYPES","helperText","enum","advanced","shouldReceiveBuilderProps","builderBlock"],"sourceRoot":"../../../../../src","sources":["blocks/video/component-info.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC1CE,IAAI,EAAE,OAAO;EACbC,eAAe,EAAE,IAAI;EACrBC,aAAa,EAAE;IACbC,SAAS,EAAE,MAAM;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDC,KAAK,EAAE,wKAAwK;EAC/KC,MAAM,EAAE,CAAC;IACPN,IAAI,EAAE,OAAO;IACbO,IAAI,EAAE,MAAM;IACZC,gBAAgB,EAAEC,2BAAgB;IAClCC,MAAM,EAAE,IAAI;IACZC,YAAY,EAAE,oMAAoM;IAClNC,QAAQ,EAAE;EACZ,CAAC,EAAE;IACDZ,IAAI,EAAE,aAAa;IACnBO,IAAI,EAAE,MAAM;IACZC,gBAAgB,EAAEK,2BAAgB;IAClCC,UAAU,EAAE;EACd,CAAC,EAAE;IACDd,IAAI,EAAE,UAAU;IAChBO,IAAI,EAAE,SAAS;IACfI,YAAY,EAAE;EAChB,CAAC,EAAE;IACDX,IAAI,EAAE,UAAU;IAChBO,IAAI,EAAE,SAAS;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AChB,CAAC,EAAE;IACDX,IAAI,EAAE,UAAU;IAChBO,IAAI,EAAE,SAAS;IACfO,UAAU,EAAE,0IAA0I;IACtJH,YAAY,EAAE,IAAI;IAClBK,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFC,yBAAyB,EAAE;IACzBC,YAAY,EAAE;EAChB;AACF,CAAC"}
|
|
@@ -7,9 +7,15 @@ exports.provideRegisteredComponents = exports.provideLinkComponent = exports.pro
|
|
|
7
7
|
var _index = require("../../functions/evaluate/index");
|
|
8
8
|
var _extractTextStyles = require("../../functions/extract-text-styles");
|
|
9
9
|
var _getStyle = require("../../functions/get-style");
|
|
10
|
+
const checkIsComponentRestricted = (component, model) => {
|
|
11
|
+
if (!component) return true;
|
|
12
|
+
if (!model) return false;
|
|
13
|
+
return component.models && component.models.length > 0 && !component.models.includes(model);
|
|
14
|
+
};
|
|
10
15
|
const getComponent = ({
|
|
11
16
|
block,
|
|
12
|
-
registeredComponents
|
|
17
|
+
registeredComponents,
|
|
18
|
+
model
|
|
13
19
|
}) => {
|
|
14
20
|
var _block$component;
|
|
15
21
|
const componentName = (_block$component = block.component) === null || _block$component === void 0 ? void 0 : _block$component.name;
|
|
@@ -17,7 +23,7 @@ const getComponent = ({
|
|
|
17
23
|
return null;
|
|
18
24
|
}
|
|
19
25
|
const ref = registeredComponents[componentName];
|
|
20
|
-
if (!ref) {
|
|
26
|
+
if (!ref || checkIsComponentRestricted(ref, model)) {
|
|
21
27
|
// TODO: Public doc page with more info about this message
|
|
22
28
|
console.warn(`
|
|
23
29
|
Could not find a registered component named "${componentName}".
|
|
@@ -93,11 +99,16 @@ const provideLinkComponent = (block, linkComponent) => {
|
|
|
93
99
|
return {};
|
|
94
100
|
};
|
|
95
101
|
exports.provideLinkComponent = provideLinkComponent;
|
|
96
|
-
const provideRegisteredComponents = (block, registeredComponents) => {
|
|
102
|
+
const provideRegisteredComponents = (block, registeredComponents, model) => {
|
|
97
103
|
var _block$shouldReceiveB2;
|
|
98
|
-
if (block !== null && block !== void 0 && (_block$shouldReceiveB2 = block.shouldReceiveBuilderProps) !== null && _block$shouldReceiveB2 !== void 0 && _block$shouldReceiveB2.builderComponents)
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
if (block !== null && block !== void 0 && (_block$shouldReceiveB2 = block.shouldReceiveBuilderProps) !== null && _block$shouldReceiveB2 !== void 0 && _block$shouldReceiveB2.builderComponents) {
|
|
105
|
+
const filteredRegisteredComponents = Object.fromEntries(Object.entries(registeredComponents).filter(([_, component]) => {
|
|
106
|
+
return !checkIsComponentRestricted(component, model);
|
|
107
|
+
}));
|
|
108
|
+
return {
|
|
109
|
+
builderComponents: filteredRegisteredComponents
|
|
110
|
+
};
|
|
111
|
+
}
|
|
101
112
|
return {};
|
|
102
113
|
};
|
|
103
114
|
exports.provideRegisteredComponents = provideRegisteredComponents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_extractTextStyles","_getStyle","getComponent","block","registeredComponents","_block$component","componentName","
|
|
1
|
+
{"version":3,"names":["_index","require","_extractTextStyles","_getStyle","checkIsComponentRestricted","component","model","models","length","includes","getComponent","block","registeredComponents","_block$component","componentName","name","ref","console","warn","undefined","exports","getRepeatItemData","context","repeat","blockWithoutRepeat","collection","itemsArray","evaluate","code","localState","rootState","rootSetState","Array","isArray","collectionName","split","pop","itemNameToUse","itemName","repeatArray","map","item","index","$index","$item","getInheritedStyles","style","getStyle","extractTextStyles","provideLinkComponent","linkComponent","_block$shouldReceiveB","shouldReceiveBuilderProps","builderLinkComponent","provideRegisteredComponents","_block$shouldReceiveB2","builderComponents","filteredRegisteredComponents","Object","fromEntries","entries","filter","_","provideBuilderBlock","builderBlock","_block$shouldReceiveB3","provideBuilderContext","_block$shouldReceiveB4","builderContext"],"sourceRoot":"../../../../../src","sources":["components/block/block.helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,SA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qB,GAAGA,CAACvD,KAA6C,EAAEW,OAAgC,KAAK;EAAA,IAAA6C,sBAAA;EACxH,IAAIxD,KAAK,aAALA,KAAK,gBAAAwD,sBAAA,GAALxD,KAAK,CAAEyC,yBAAyB,cAAAe,sBAAA,eAAhCA,sBAAA,CAAkCC,cAAc,EAAE,OAAO;IAC3DA,cAAc,EAAE9C;EAClB,CAAC;EACD,OAAO,CAAC,CAAC;AACX,CAAC;AAAAF,OAAA,CAAA8C,qBAAA,GAAAA,qBAAA"}
|
|
@@ -42,8 +42,7 @@ function Block(props) {
|
|
|
42
42
|
localState: props.context.localState,
|
|
43
43
|
rootState: props.context.rootState,
|
|
44
44
|
rootSetState: props.context.rootSetState,
|
|
45
|
-
context: props.context.context
|
|
46
|
-
shouldEvaluateBindings: true
|
|
45
|
+
context: props.context.context
|
|
47
46
|
});
|
|
48
47
|
_processedBlock.value = blockToUse;
|
|
49
48
|
_processedBlock.update = false;
|
|
@@ -52,7 +51,8 @@ function Block(props) {
|
|
|
52
51
|
function blockComponent() {
|
|
53
52
|
return (0, _block.getComponent)({
|
|
54
53
|
block: processedBlock(),
|
|
55
|
-
registeredComponents: props.registeredComponents
|
|
54
|
+
registeredComponents: props.registeredComponents,
|
|
55
|
+
model: props.context.model
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function Tag() {
|
|
@@ -91,11 +91,11 @@ function Block(props) {
|
|
|
91
91
|
blockChildren: processedBlock().children ?? [],
|
|
92
92
|
componentRef: blockComponent === null || blockComponent === void 0 || (_blockComponent2 = blockComponent()) === null || _blockComponent2 === void 0 ? void 0 : _blockComponent2.component,
|
|
93
93
|
componentOptions: {
|
|
94
|
-
...(0, _getBlockComponentOptions.getBlockComponentOptions)(processedBlock()),
|
|
94
|
+
...(0, _getBlockComponentOptions.getBlockComponentOptions)(processedBlock(), props.context),
|
|
95
95
|
...(0, _block.provideBuilderBlock)(blockComponent(), processedBlock()),
|
|
96
96
|
...(0, _block.provideBuilderContext)(blockComponent(), props.context),
|
|
97
97
|
...(0, _block.provideLinkComponent)(blockComponent(), props.linkComponent),
|
|
98
|
-
...(0, _block.provideRegisteredComponents)(blockComponent(), props.registeredComponents)
|
|
98
|
+
...(0, _block.provideRegisteredComponents)(blockComponent(), props.registeredComponents, props.context.model)
|
|
99
99
|
},
|
|
100
100
|
context: {
|
|
101
101
|
...props.context,
|