@builder.io/sdk-react-native 3.0.5 → 4.0.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/lib/browser/commonjs/blocks/personalization-container/component-info.js +43 -0
- package/lib/browser/commonjs/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/browser/commonjs/blocks/personalization-container/helpers/inlined-fns.js +94 -0
- package/lib/browser/commonjs/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/browser/commonjs/blocks/personalization-container/helpers.js +76 -0
- package/lib/browser/commonjs/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/browser/commonjs/blocks/personalization-container/index.js +14 -0
- package/lib/browser/commonjs/blocks/personalization-container/index.js.map +1 -0
- package/lib/browser/commonjs/blocks/personalization-container/personalization-container.js +130 -0
- package/lib/browser/commonjs/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/browser/commonjs/blocks/personalization-container/personalization-container.types.js +6 -0
- package/lib/browser/commonjs/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/browser/commonjs/blocks/symbol/symbol.js +1 -1
- package/lib/browser/commonjs/blocks/symbol/symbol.js.map +1 -1
- package/lib/browser/commonjs/components/block/components/block-styles.js +9 -2
- package/lib/browser/commonjs/components/block/components/block-styles.js.map +1 -1
- package/lib/browser/commonjs/components/blocks/blocks-wrapper.js +2 -1
- package/lib/browser/commonjs/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/browser/commonjs/components/content/components/enable-editor.js +10 -6
- package/lib/browser/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/commonjs/components/content/content.js +1 -1
- package/lib/browser/commonjs/components/content/content.js.map +1 -1
- package/lib/browser/commonjs/constants/builder-registered-components.js +21 -16
- package/lib/browser/commonjs/constants/builder-registered-components.js.map +1 -1
- package/lib/browser/commonjs/constants/device-sizes.js +24 -6
- package/lib/browser/commonjs/constants/device-sizes.js.map +1 -1
- package/lib/browser/commonjs/constants/sdk-version.js +1 -1
- package/lib/browser/commonjs/helpers/canTrack.js +6 -1
- package/lib/browser/commonjs/helpers/canTrack.js.map +1 -1
- package/lib/browser/commonjs/helpers/subscribe-to-editor.js +11 -3
- package/lib/browser/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/browser/commonjs/helpers/user-attributes.js +56 -0
- package/lib/browser/commonjs/helpers/user-attributes.js.map +1 -0
- package/lib/browser/commonjs/scripts/init-editing.js +6 -2
- package/lib/browser/commonjs/scripts/init-editing.js.map +1 -1
- package/lib/browser/module/blocks/personalization-container/component-info.js +37 -0
- package/lib/browser/module/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/browser/module/blocks/personalization-container/helpers/inlined-fns.js +87 -0
- package/lib/browser/module/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/browser/module/blocks/personalization-container/helpers.js +62 -0
- package/lib/browser/module/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/browser/module/blocks/personalization-container/index.js +2 -0
- package/lib/browser/module/blocks/personalization-container/index.js.map +1 -0
- package/lib/browser/module/blocks/personalization-container/personalization-container.js +121 -0
- package/lib/browser/module/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/browser/module/blocks/personalization-container/personalization-container.types.js +2 -0
- package/lib/browser/module/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/browser/module/blocks/symbol/symbol.js +1 -1
- package/lib/browser/module/blocks/symbol/symbol.js.map +1 -1
- package/lib/browser/module/components/block/components/block-styles.js +9 -2
- package/lib/browser/module/components/block/components/block-styles.js.map +1 -1
- package/lib/browser/module/components/blocks/blocks-wrapper.js +2 -1
- package/lib/browser/module/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/browser/module/components/content/components/enable-editor.js +10 -6
- package/lib/browser/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/module/components/content/content.js +1 -1
- package/lib/browser/module/components/content/content.js.map +1 -1
- package/lib/browser/module/constants/builder-registered-components.js +6 -1
- package/lib/browser/module/constants/builder-registered-components.js.map +1 -1
- package/lib/browser/module/constants/device-sizes.js +24 -6
- package/lib/browser/module/constants/device-sizes.js.map +1 -1
- package/lib/browser/module/constants/sdk-version.js +1 -1
- package/lib/browser/module/helpers/canTrack.js +6 -1
- package/lib/browser/module/helpers/canTrack.js.map +1 -1
- package/lib/browser/module/helpers/subscribe-to-editor.js +11 -3
- package/lib/browser/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/browser/module/helpers/user-attributes.js +47 -0
- package/lib/browser/module/helpers/user-attributes.js.map +1 -0
- package/lib/browser/module/scripts/init-editing.js +6 -2
- package/lib/browser/module/scripts/init-editing.js.map +1 -1
- package/lib/browser/typescript/blocks/personalization-container/component-info.d.ts +3 -0
- package/lib/browser/typescript/blocks/personalization-container/component-info.d.ts.map +1 -0
- package/lib/browser/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts +9 -0
- package/lib/browser/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts.map +1 -0
- package/lib/browser/typescript/blocks/personalization-container/helpers.d.ts +28 -0
- package/lib/browser/typescript/blocks/personalization-container/helpers.d.ts.map +1 -0
- package/lib/browser/typescript/blocks/personalization-container/index.d.ts +2 -0
- package/lib/browser/typescript/blocks/personalization-container/index.d.ts.map +1 -0
- package/lib/browser/typescript/blocks/personalization-container/personalization-container.d.ts +5 -0
- package/lib/browser/typescript/blocks/personalization-container/personalization-container.d.ts.map +1 -0
- package/lib/browser/typescript/blocks/personalization-container/personalization-container.types.d.ts +15 -0
- package/lib/browser/typescript/blocks/personalization-container/personalization-container.types.d.ts.map +1 -0
- package/lib/browser/typescript/components/block/components/block-styles.d.ts.map +1 -1
- package/lib/browser/typescript/components/blocks/blocks-wrapper.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-variants/content-variants.types.d.ts +2 -2
- package/lib/browser/typescript/components/content-variants/content-variants.types.d.ts.map +1 -1
- package/lib/browser/typescript/constants/builder-registered-components.d.ts.map +1 -1
- package/lib/browser/typescript/constants/device-sizes.d.ts +3 -2
- package/lib/browser/typescript/constants/device-sizes.d.ts.map +1 -1
- package/lib/browser/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/browser/typescript/helpers/canTrack.d.ts.map +1 -1
- package/lib/browser/typescript/helpers/subscribe-to-editor.d.ts +13 -13
- package/lib/browser/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/lib/browser/typescript/helpers/user-attributes.d.ts +18 -0
- package/lib/browser/typescript/helpers/user-attributes.d.ts.map +1 -0
- package/lib/browser/typescript/scripts/init-editing.d.ts +3 -1
- package/lib/browser/typescript/scripts/init-editing.d.ts.map +1 -1
- package/lib/browser/typescript/types/builder-block.d.ts +0 -1
- package/lib/browser/typescript/types/builder-block.d.ts.map +1 -1
- package/lib/browser/typescript/types/builder-content.d.ts +1 -0
- package/lib/browser/typescript/types/builder-content.d.ts.map +1 -1
- package/lib/browser/typescript/types/input.d.ts +1 -0
- package/lib/browser/typescript/types/input.d.ts.map +1 -1
- package/lib/edge/commonjs/blocks/personalization-container/component-info.js +43 -0
- package/lib/edge/commonjs/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/edge/commonjs/blocks/personalization-container/helpers/inlined-fns.js +94 -0
- package/lib/edge/commonjs/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/edge/commonjs/blocks/personalization-container/helpers.js +76 -0
- package/lib/edge/commonjs/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/edge/commonjs/blocks/personalization-container/index.js +14 -0
- package/lib/edge/commonjs/blocks/personalization-container/index.js.map +1 -0
- package/lib/edge/commonjs/blocks/personalization-container/personalization-container.js +130 -0
- package/lib/edge/commonjs/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/edge/commonjs/blocks/personalization-container/personalization-container.types.js +6 -0
- package/lib/edge/commonjs/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/edge/commonjs/blocks/symbol/symbol.js +1 -1
- package/lib/edge/commonjs/blocks/symbol/symbol.js.map +1 -1
- package/lib/edge/commonjs/components/block/components/block-styles.js +9 -2
- package/lib/edge/commonjs/components/block/components/block-styles.js.map +1 -1
- package/lib/edge/commonjs/components/blocks/blocks-wrapper.js +2 -1
- package/lib/edge/commonjs/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/edge/commonjs/components/content/components/enable-editor.js +10 -6
- package/lib/edge/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/commonjs/components/content/content.js +1 -1
- package/lib/edge/commonjs/components/content/content.js.map +1 -1
- package/lib/edge/commonjs/constants/builder-registered-components.js +21 -16
- package/lib/edge/commonjs/constants/builder-registered-components.js.map +1 -1
- package/lib/edge/commonjs/constants/device-sizes.js +24 -6
- package/lib/edge/commonjs/constants/device-sizes.js.map +1 -1
- package/lib/edge/commonjs/constants/sdk-version.js +1 -1
- package/lib/edge/commonjs/helpers/canTrack.js +6 -1
- package/lib/edge/commonjs/helpers/canTrack.js.map +1 -1
- package/lib/edge/commonjs/helpers/subscribe-to-editor.js +11 -3
- package/lib/edge/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/edge/commonjs/helpers/user-attributes.js +56 -0
- package/lib/edge/commonjs/helpers/user-attributes.js.map +1 -0
- package/lib/edge/commonjs/scripts/init-editing.js +6 -2
- package/lib/edge/commonjs/scripts/init-editing.js.map +1 -1
- package/lib/edge/module/blocks/personalization-container/component-info.js +37 -0
- package/lib/edge/module/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/edge/module/blocks/personalization-container/helpers/inlined-fns.js +87 -0
- package/lib/edge/module/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/edge/module/blocks/personalization-container/helpers.js +62 -0
- package/lib/edge/module/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/edge/module/blocks/personalization-container/index.js +2 -0
- package/lib/edge/module/blocks/personalization-container/index.js.map +1 -0
- package/lib/edge/module/blocks/personalization-container/personalization-container.js +121 -0
- package/lib/edge/module/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/edge/module/blocks/personalization-container/personalization-container.types.js +2 -0
- package/lib/edge/module/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/edge/module/blocks/symbol/symbol.js +1 -1
- package/lib/edge/module/blocks/symbol/symbol.js.map +1 -1
- package/lib/edge/module/components/block/components/block-styles.js +9 -2
- package/lib/edge/module/components/block/components/block-styles.js.map +1 -1
- package/lib/edge/module/components/blocks/blocks-wrapper.js +2 -1
- package/lib/edge/module/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/edge/module/components/content/components/enable-editor.js +10 -6
- package/lib/edge/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/module/components/content/content.js +1 -1
- package/lib/edge/module/components/content/content.js.map +1 -1
- package/lib/edge/module/constants/builder-registered-components.js +6 -1
- package/lib/edge/module/constants/builder-registered-components.js.map +1 -1
- package/lib/edge/module/constants/device-sizes.js +24 -6
- package/lib/edge/module/constants/device-sizes.js.map +1 -1
- package/lib/edge/module/constants/sdk-version.js +1 -1
- package/lib/edge/module/helpers/canTrack.js +6 -1
- package/lib/edge/module/helpers/canTrack.js.map +1 -1
- package/lib/edge/module/helpers/subscribe-to-editor.js +11 -3
- package/lib/edge/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/edge/module/helpers/user-attributes.js +47 -0
- package/lib/edge/module/helpers/user-attributes.js.map +1 -0
- package/lib/edge/module/scripts/init-editing.js +6 -2
- package/lib/edge/module/scripts/init-editing.js.map +1 -1
- package/lib/edge/typescript/blocks/personalization-container/component-info.d.ts +3 -0
- package/lib/edge/typescript/blocks/personalization-container/component-info.d.ts.map +1 -0
- package/lib/edge/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts +9 -0
- package/lib/edge/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts.map +1 -0
- package/lib/edge/typescript/blocks/personalization-container/helpers.d.ts +28 -0
- package/lib/edge/typescript/blocks/personalization-container/helpers.d.ts.map +1 -0
- package/lib/edge/typescript/blocks/personalization-container/index.d.ts +2 -0
- package/lib/edge/typescript/blocks/personalization-container/index.d.ts.map +1 -0
- package/lib/edge/typescript/blocks/personalization-container/personalization-container.d.ts +5 -0
- package/lib/edge/typescript/blocks/personalization-container/personalization-container.d.ts.map +1 -0
- package/lib/edge/typescript/blocks/personalization-container/personalization-container.types.d.ts +15 -0
- package/lib/edge/typescript/blocks/personalization-container/personalization-container.types.d.ts.map +1 -0
- package/lib/edge/typescript/components/block/components/block-styles.d.ts.map +1 -1
- package/lib/edge/typescript/components/blocks/blocks-wrapper.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-variants/content-variants.types.d.ts +2 -2
- package/lib/edge/typescript/components/content-variants/content-variants.types.d.ts.map +1 -1
- package/lib/edge/typescript/constants/builder-registered-components.d.ts.map +1 -1
- package/lib/edge/typescript/constants/device-sizes.d.ts +3 -2
- package/lib/edge/typescript/constants/device-sizes.d.ts.map +1 -1
- package/lib/edge/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/edge/typescript/helpers/canTrack.d.ts.map +1 -1
- package/lib/edge/typescript/helpers/subscribe-to-editor.d.ts +13 -13
- package/lib/edge/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/lib/edge/typescript/helpers/user-attributes.d.ts +18 -0
- package/lib/edge/typescript/helpers/user-attributes.d.ts.map +1 -0
- package/lib/edge/typescript/scripts/init-editing.d.ts +3 -1
- package/lib/edge/typescript/scripts/init-editing.d.ts.map +1 -1
- package/lib/edge/typescript/types/builder-block.d.ts +0 -1
- package/lib/edge/typescript/types/builder-block.d.ts.map +1 -1
- package/lib/edge/typescript/types/builder-content.d.ts +1 -0
- package/lib/edge/typescript/types/builder-content.d.ts.map +1 -1
- package/lib/edge/typescript/types/input.d.ts +1 -0
- package/lib/edge/typescript/types/input.d.ts.map +1 -1
- package/lib/node/commonjs/blocks/personalization-container/component-info.js +43 -0
- package/lib/node/commonjs/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/node/commonjs/blocks/personalization-container/helpers/inlined-fns.js +94 -0
- package/lib/node/commonjs/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/node/commonjs/blocks/personalization-container/helpers.js +76 -0
- package/lib/node/commonjs/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/node/commonjs/blocks/personalization-container/index.js +14 -0
- package/lib/node/commonjs/blocks/personalization-container/index.js.map +1 -0
- package/lib/node/commonjs/blocks/personalization-container/personalization-container.js +130 -0
- package/lib/node/commonjs/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/node/commonjs/blocks/personalization-container/personalization-container.types.js +6 -0
- package/lib/node/commonjs/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/node/commonjs/blocks/symbol/symbol.js +1 -1
- package/lib/node/commonjs/blocks/symbol/symbol.js.map +1 -1
- package/lib/node/commonjs/components/block/components/block-styles.js +9 -2
- package/lib/node/commonjs/components/block/components/block-styles.js.map +1 -1
- package/lib/node/commonjs/components/blocks/blocks-wrapper.js +2 -1
- package/lib/node/commonjs/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/node/commonjs/components/content/components/enable-editor.js +10 -6
- package/lib/node/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/commonjs/components/content/content.js +1 -1
- package/lib/node/commonjs/components/content/content.js.map +1 -1
- package/lib/node/commonjs/constants/builder-registered-components.js +21 -16
- package/lib/node/commonjs/constants/builder-registered-components.js.map +1 -1
- package/lib/node/commonjs/constants/device-sizes.js +24 -6
- package/lib/node/commonjs/constants/device-sizes.js.map +1 -1
- package/lib/node/commonjs/constants/sdk-version.js +1 -1
- package/lib/node/commonjs/helpers/canTrack.js +6 -1
- package/lib/node/commonjs/helpers/canTrack.js.map +1 -1
- package/lib/node/commonjs/helpers/subscribe-to-editor.js +11 -3
- package/lib/node/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/node/commonjs/helpers/user-attributes.js +56 -0
- package/lib/node/commonjs/helpers/user-attributes.js.map +1 -0
- package/lib/node/commonjs/scripts/init-editing.js +6 -2
- package/lib/node/commonjs/scripts/init-editing.js.map +1 -1
- package/lib/node/module/blocks/personalization-container/component-info.js +37 -0
- package/lib/node/module/blocks/personalization-container/component-info.js.map +1 -0
- package/lib/node/module/blocks/personalization-container/helpers/inlined-fns.js +87 -0
- package/lib/node/module/blocks/personalization-container/helpers/inlined-fns.js.map +1 -0
- package/lib/node/module/blocks/personalization-container/helpers.js +62 -0
- package/lib/node/module/blocks/personalization-container/helpers.js.map +1 -0
- package/lib/node/module/blocks/personalization-container/index.js +2 -0
- package/lib/node/module/blocks/personalization-container/index.js.map +1 -0
- package/lib/node/module/blocks/personalization-container/personalization-container.js +121 -0
- package/lib/node/module/blocks/personalization-container/personalization-container.js.map +1 -0
- package/lib/node/module/blocks/personalization-container/personalization-container.types.js +2 -0
- package/lib/node/module/blocks/personalization-container/personalization-container.types.js.map +1 -0
- package/lib/node/module/blocks/symbol/symbol.js +1 -1
- package/lib/node/module/blocks/symbol/symbol.js.map +1 -1
- package/lib/node/module/components/block/components/block-styles.js +9 -2
- package/lib/node/module/components/block/components/block-styles.js.map +1 -1
- package/lib/node/module/components/blocks/blocks-wrapper.js +2 -1
- package/lib/node/module/components/blocks/blocks-wrapper.js.map +1 -1
- package/lib/node/module/components/content/components/enable-editor.js +10 -6
- package/lib/node/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/module/components/content/content.js +1 -1
- package/lib/node/module/components/content/content.js.map +1 -1
- package/lib/node/module/constants/builder-registered-components.js +6 -1
- package/lib/node/module/constants/builder-registered-components.js.map +1 -1
- package/lib/node/module/constants/device-sizes.js +24 -6
- package/lib/node/module/constants/device-sizes.js.map +1 -1
- package/lib/node/module/constants/sdk-version.js +1 -1
- package/lib/node/module/helpers/canTrack.js +6 -1
- package/lib/node/module/helpers/canTrack.js.map +1 -1
- package/lib/node/module/helpers/subscribe-to-editor.js +11 -3
- package/lib/node/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/node/module/helpers/user-attributes.js +47 -0
- package/lib/node/module/helpers/user-attributes.js.map +1 -0
- package/lib/node/module/scripts/init-editing.js +6 -2
- package/lib/node/module/scripts/init-editing.js.map +1 -1
- package/lib/node/typescript/blocks/personalization-container/component-info.d.ts +3 -0
- package/lib/node/typescript/blocks/personalization-container/component-info.d.ts.map +1 -0
- package/lib/node/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts +9 -0
- package/lib/node/typescript/blocks/personalization-container/helpers/inlined-fns.d.ts.map +1 -0
- package/lib/node/typescript/blocks/personalization-container/helpers.d.ts +28 -0
- package/lib/node/typescript/blocks/personalization-container/helpers.d.ts.map +1 -0
- package/lib/node/typescript/blocks/personalization-container/index.d.ts +2 -0
- package/lib/node/typescript/blocks/personalization-container/index.d.ts.map +1 -0
- package/lib/node/typescript/blocks/personalization-container/personalization-container.d.ts +5 -0
- package/lib/node/typescript/blocks/personalization-container/personalization-container.d.ts.map +1 -0
- package/lib/node/typescript/blocks/personalization-container/personalization-container.types.d.ts +15 -0
- package/lib/node/typescript/blocks/personalization-container/personalization-container.types.d.ts.map +1 -0
- package/lib/node/typescript/components/block/components/block-styles.d.ts.map +1 -1
- package/lib/node/typescript/components/blocks/blocks-wrapper.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-variants/content-variants.types.d.ts +2 -2
- package/lib/node/typescript/components/content-variants/content-variants.types.d.ts.map +1 -1
- package/lib/node/typescript/constants/builder-registered-components.d.ts.map +1 -1
- package/lib/node/typescript/constants/device-sizes.d.ts +3 -2
- package/lib/node/typescript/constants/device-sizes.d.ts.map +1 -1
- package/lib/node/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/node/typescript/helpers/canTrack.d.ts.map +1 -1
- package/lib/node/typescript/helpers/subscribe-to-editor.d.ts +13 -13
- package/lib/node/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/lib/node/typescript/helpers/user-attributes.d.ts +18 -0
- package/lib/node/typescript/helpers/user-attributes.d.ts.map +1 -0
- package/lib/node/typescript/scripts/init-editing.d.ts +3 -1
- package/lib/node/typescript/scripts/init-editing.d.ts.map +1 -1
- package/lib/node/typescript/types/builder-block.d.ts +0 -1
- package/lib/node/typescript/types/builder-block.d.ts.map +1 -1
- package/lib/node/typescript/types/builder-content.d.ts +1 -0
- package/lib/node/typescript/types/builder-content.d.ts.map +1 -1
- package/lib/node/typescript/types/input.d.ts +1 -0
- package/lib/node/typescript/types/input.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/personalization-container/component-info.ts +37 -0
- package/src/blocks/personalization-container/helpers/inlined-fns.ts +88 -0
- package/src/blocks/personalization-container/helpers.ts +84 -0
- package/src/blocks/personalization-container/index.ts +1 -0
- package/src/blocks/personalization-container/personalization-container.tsx +176 -0
- package/src/blocks/personalization-container/personalization-container.types.ts +14 -0
- package/src/blocks/symbol/symbol.tsx +1 -1
- package/src/components/block/components/block-styles.tsx +16 -0
- package/src/components/blocks/blocks-wrapper.tsx +4 -1
- package/src/components/content/components/enable-editor.tsx +6 -4
- package/src/components/content/content.tsx +1 -1
- package/src/components/content-variants/content-variants.types.ts +2 -2
- package/src/constants/builder-registered-components.ts +6 -1
- package/src/constants/device-sizes.ts +26 -7
- package/src/constants/sdk-version.ts +1 -1
- package/src/helpers/canTrack.ts +6 -1
- package/src/helpers/subscribe-to-editor.ts +29 -16
- package/src/helpers/user-attributes.ts +49 -0
- package/src/scripts/init-editing.ts +8 -2
- package/src/types/builder-block.ts +0 -1
- package/src/types/builder-content.ts +1 -0
- package/src/types/input.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-block.d.ts","sourceRoot":"","sources":["../../../../src/types/builder-block.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OA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M,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,CAAC,EAAE,EAAE,MAAM,GAAG,uBAAuB,CAAC;KACvC,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
1
|
+
{"version":3,"file":"builder-content.d.ts","sourceRoot":"","sources":["../../../../src/types/builder-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;QACxB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;SACpB,CAAC;QACF,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE;YACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;SACvB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CA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C;IACF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IAEd,cAAc;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IACd,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,MAAM,CAAC;IAC3D,cAAc;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;IAC9G,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-native",
|
|
3
3
|
"description": "Builder.io SDK for React Native",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react-native",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
|
+
export const componentInfo: ComponentInfo = {
|
|
3
|
+
name: 'PersonalizationContainer',
|
|
4
|
+
shouldReceiveBuilderProps: {
|
|
5
|
+
builderBlock: true,
|
|
6
|
+
builderContext: true
|
|
7
|
+
},
|
|
8
|
+
noWrap: true,
|
|
9
|
+
image: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a',
|
|
10
|
+
canHaveChildren: true,
|
|
11
|
+
inputs: [{
|
|
12
|
+
name: 'variants',
|
|
13
|
+
defaultValue: [],
|
|
14
|
+
behavior: 'personalizationVariantList',
|
|
15
|
+
type: 'list',
|
|
16
|
+
subFields: [{
|
|
17
|
+
name: 'name',
|
|
18
|
+
type: 'text'
|
|
19
|
+
}, {
|
|
20
|
+
name: 'query',
|
|
21
|
+
friendlyName: 'Targeting rules',
|
|
22
|
+
type: 'BuilderQuery',
|
|
23
|
+
defaultValue: []
|
|
24
|
+
}, {
|
|
25
|
+
name: 'startDate',
|
|
26
|
+
type: 'date'
|
|
27
|
+
}, {
|
|
28
|
+
name: 'endDate',
|
|
29
|
+
type: 'date'
|
|
30
|
+
}, {
|
|
31
|
+
name: 'blocks',
|
|
32
|
+
type: 'uiBlocks',
|
|
33
|
+
hideFromUI: true,
|
|
34
|
+
defaultValue: []
|
|
35
|
+
}]
|
|
36
|
+
}]
|
|
37
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: This file contains functions that get stringified and inlined into the HTML at build-time.
|
|
3
|
+
* They cannot import anything.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Query, UserAttributes } from '../helpers';
|
|
7
|
+
import { type PersonalizationContainerProps } from '../personalization-container.types';
|
|
8
|
+
export function filterWithCustomTargeting(userAttributes: UserAttributes, query: Query[], startDate?: string, endDate?: string) {
|
|
9
|
+
function isString(val: unknown): val is string {
|
|
10
|
+
return typeof val === 'string';
|
|
11
|
+
}
|
|
12
|
+
function isNumber(val: unknown): val is number {
|
|
13
|
+
return typeof val === 'number';
|
|
14
|
+
}
|
|
15
|
+
function objectMatchesQuery(userattr: UserAttributes, query: Query): boolean {
|
|
16
|
+
const result = (() => {
|
|
17
|
+
const property = query.property;
|
|
18
|
+
const operator = query.operator;
|
|
19
|
+
let testValue = query.value;
|
|
20
|
+
if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
|
|
21
|
+
testValue = query.value.slice(0, -1);
|
|
22
|
+
}
|
|
23
|
+
if (!(property && operator)) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(testValue)) {
|
|
27
|
+
if (operator === 'isNot') {
|
|
28
|
+
return testValue.every(val => objectMatchesQuery(userattr, {
|
|
29
|
+
property,
|
|
30
|
+
operator,
|
|
31
|
+
value: val
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
return !!testValue.find(val => objectMatchesQuery(userattr, {
|
|
35
|
+
property,
|
|
36
|
+
operator,
|
|
37
|
+
value: val
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
const value = userattr[property];
|
|
41
|
+
if (Array.isArray(value)) {
|
|
42
|
+
return value.includes(testValue);
|
|
43
|
+
}
|
|
44
|
+
switch (operator) {
|
|
45
|
+
case 'is':
|
|
46
|
+
return value === testValue;
|
|
47
|
+
case 'isNot':
|
|
48
|
+
return value !== testValue;
|
|
49
|
+
case 'contains':
|
|
50
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
51
|
+
case 'startsWith':
|
|
52
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
53
|
+
case 'endsWith':
|
|
54
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
55
|
+
case 'greaterThan':
|
|
56
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
57
|
+
case 'lessThan':
|
|
58
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
59
|
+
case 'greaterThanOrEqualTo':
|
|
60
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
61
|
+
case 'lessThanOrEqualTo':
|
|
62
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
63
|
+
default:
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
})();
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
const item = {
|
|
70
|
+
query,
|
|
71
|
+
startDate,
|
|
72
|
+
endDate
|
|
73
|
+
};
|
|
74
|
+
const now = userAttributes.date && new Date(userAttributes.date) || new Date();
|
|
75
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
76
|
+
return false;
|
|
77
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (!item.query || !item.query.length) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return item.query.every((filter: Query) => {
|
|
84
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n function removeVariants() {\n variants?.forEach(function (_, index) {\n document.querySelector('template[data-variant-id=\"' + blockId + '-' + index + '\"]')?.remove();\n });\n document.querySelector('script[data-id=\"variants-script-' + blockId + '\"]')?.remove();\n document.querySelector('style[data-id=\"variants-styles-' + blockId + '\"]')?.remove();\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const isDebug = location.href.includes('builder.debug=true');\n if (isDebug) {\n console.debug('PersonalizationContainer', {\n attributes,\n variants,\n winningVariantIndex\n });\n }\n if (winningVariantIndex !== -1) {\n const winningVariant = document.querySelector('template[data-variant-id=\"' + blockId + '-' + winningVariantIndex + '\"]');\n if (winningVariant) {\n const parentNode = winningVariant.parentNode;\n if (parentNode) {\n const newParent = parentNode.cloneNode(false);\n newParent.appendChild(winningVariant.content.firstChild);\n newParent.appendChild(winningVariant.content.lastChild);\n parentNode.parentNode?.replaceChild(newParent, parentNode);\n }\n if (isDebug) {\n console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);\n }\n }\n } else if (variants && variants.length > 0) {\n removeVariants();\n }\n}";
|
|
88
|
+
export const FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TARGET } from '../../constants/target';
|
|
2
|
+
import { isBrowser } from '../../functions/is-browser';
|
|
3
|
+
import { isEditing } from '../../functions/is-editing';
|
|
4
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
5
|
+
import { FILTER_WITH_CUSTOM_TARGETING_SCRIPT, PERSONALIZATION_SCRIPT } from './helpers/inlined-fns';
|
|
6
|
+
import type { PersonalizationContainerProps } from './personalization-container.types';
|
|
7
|
+
export type UserAttributes = {
|
|
8
|
+
date?: string | Date;
|
|
9
|
+
urlPath?: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
type QueryOperator = 'is' | 'isNot' | 'contains' | 'startsWith' | 'endsWith' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqualTo' | 'lessThanOrEqualTo';
|
|
13
|
+
type QueryValue = string | number | boolean | Array<string | number | boolean>;
|
|
14
|
+
export type Query = {
|
|
15
|
+
property: string;
|
|
16
|
+
operator: QueryOperator;
|
|
17
|
+
value: QueryValue;
|
|
18
|
+
};
|
|
19
|
+
export function checkShouldRenderVariants(variants: PersonalizationContainerProps['variants'], canTrack: boolean) {
|
|
20
|
+
const hasVariants = variants && variants.length > 0;
|
|
21
|
+
if (TARGET === 'reactNative') return false;
|
|
22
|
+
if (!hasVariants) return false;
|
|
23
|
+
if (!canTrack) return false;
|
|
24
|
+
if (TARGET === 'vue' || TARGET === 'svelte') return true;
|
|
25
|
+
if (isBrowser()) return false;
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
export function getBlocksToRender({
|
|
29
|
+
variants,
|
|
30
|
+
previewingIndex,
|
|
31
|
+
isHydrated,
|
|
32
|
+
filteredVariants,
|
|
33
|
+
fallbackBlocks
|
|
34
|
+
}: {
|
|
35
|
+
variants: PersonalizationContainerProps['variants'];
|
|
36
|
+
previewingIndex?: number | null;
|
|
37
|
+
isHydrated: boolean;
|
|
38
|
+
filteredVariants: PersonalizationContainerProps['variants'];
|
|
39
|
+
fallbackBlocks?: BuilderBlock[];
|
|
40
|
+
}): {
|
|
41
|
+
blocks: BuilderBlock[];
|
|
42
|
+
path: string | undefined;
|
|
43
|
+
} {
|
|
44
|
+
const fallback = {
|
|
45
|
+
blocks: fallbackBlocks ?? [],
|
|
46
|
+
path: 'this.children'
|
|
47
|
+
};
|
|
48
|
+
if (isHydrated && isEditing()) {
|
|
49
|
+
// If editing a specific variant
|
|
50
|
+
if (typeof previewingIndex === 'number' && previewingIndex < (variants?.length ?? 0)) {
|
|
51
|
+
const variant = variants![previewingIndex];
|
|
52
|
+
return {
|
|
53
|
+
blocks: variant.blocks,
|
|
54
|
+
path: `component.options.variants.${previewingIndex}.blocks`
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// Otherwise we're editing the default variant
|
|
58
|
+
return fallback;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// If we're on the browser, check if there's a winning variant
|
|
62
|
+
if (isBrowser()) {
|
|
63
|
+
const winningVariant = filteredVariants?.[0];
|
|
64
|
+
if (winningVariant) {
|
|
65
|
+
return {
|
|
66
|
+
blocks: winningVariant.blocks,
|
|
67
|
+
path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// If no winning variant or we are on the server, return the default variant
|
|
73
|
+
return fallback;
|
|
74
|
+
}
|
|
75
|
+
export const getPersonalizationScript = (variants: PersonalizationContainerProps['variants'], blockId: string, locale?: string) => {
|
|
76
|
+
return `
|
|
77
|
+
(function() {
|
|
78
|
+
${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
|
|
79
|
+
${PERSONALIZATION_SCRIPT}
|
|
80
|
+
getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ''})
|
|
81
|
+
})();
|
|
82
|
+
`;
|
|
83
|
+
};
|
|
84
|
+
export { filterWithCustomTargeting } from './helpers/inlined-fns'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './personalization-container'
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
FlatList,
|
|
4
|
+
ScrollView,
|
|
5
|
+
View,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Image,
|
|
8
|
+
Text,
|
|
9
|
+
Pressable,
|
|
10
|
+
TextInput,
|
|
11
|
+
TouchableOpacity,
|
|
12
|
+
Button,
|
|
13
|
+
Linking,
|
|
14
|
+
} from "react-native";
|
|
15
|
+
import { useState, useRef, useEffect } from "react";
|
|
16
|
+
import Blocks from "../../components/blocks/blocks";
|
|
17
|
+
import InlinedScript from "../../components/inlined-script";
|
|
18
|
+
import InlinedStyles from "../../components/inlined-styles";
|
|
19
|
+
import { isEditing } from "../../functions/is-editing";
|
|
20
|
+
import { isPreviewing } from "../../functions/is-previewing";
|
|
21
|
+
import { getDefaultCanTrack } from "../../helpers/canTrack";
|
|
22
|
+
import { userAttributesService } from "../../helpers/user-attributes";
|
|
23
|
+
import {
|
|
24
|
+
checkShouldRenderVariants,
|
|
25
|
+
filterWithCustomTargeting,
|
|
26
|
+
getBlocksToRender,
|
|
27
|
+
getPersonalizationScript,
|
|
28
|
+
} from "./helpers";
|
|
29
|
+
import type { PersonalizationContainerProps } from "./personalization-container.types";
|
|
30
|
+
|
|
31
|
+
function PersonalizationContainer(props: PersonalizationContainerProps) {
|
|
32
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
33
|
+
const [userAttributes, setUserAttributes] = useState(() =>
|
|
34
|
+
userAttributesService.getUserAttributes()
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const [scriptStr, setScriptStr] = useState(() =>
|
|
38
|
+
getPersonalizationScript(
|
|
39
|
+
props.variants,
|
|
40
|
+
props.builderBlock?.id || "none",
|
|
41
|
+
props.builderContext?.rootState?.locale as string | undefined
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const [unsubscribers, setUnsubscribers] = useState(() => []);
|
|
46
|
+
|
|
47
|
+
const [shouldRenderVariants, setShouldRenderVariants] = useState(() =>
|
|
48
|
+
checkShouldRenderVariants(
|
|
49
|
+
props.variants,
|
|
50
|
+
getDefaultCanTrack(props.builderContext?.canTrack)
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const [isHydrated, setIsHydrated] = useState(() => false);
|
|
55
|
+
|
|
56
|
+
function filteredVariants() {
|
|
57
|
+
return (props.variants || []).filter((variant) => {
|
|
58
|
+
return filterWithCustomTargeting(
|
|
59
|
+
{
|
|
60
|
+
...(props.builderContext?.rootState?.locale
|
|
61
|
+
? {
|
|
62
|
+
locale: props.builderContext?.rootState?.locale,
|
|
63
|
+
}
|
|
64
|
+
: {}),
|
|
65
|
+
...(userAttributes as any),
|
|
66
|
+
},
|
|
67
|
+
variant.query,
|
|
68
|
+
variant.startDate,
|
|
69
|
+
variant.endDate
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function blocksToRender() {
|
|
75
|
+
return getBlocksToRender({
|
|
76
|
+
variants: props.variants,
|
|
77
|
+
fallbackBlocks: props.builderBlock?.children,
|
|
78
|
+
isHydrated: isHydrated,
|
|
79
|
+
filteredVariants: filteredVariants(),
|
|
80
|
+
previewingIndex: props.previewingIndex,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function hideVariantsStyleString() {
|
|
85
|
+
return (props.variants || [])
|
|
86
|
+
.map(
|
|
87
|
+
(_, index) =>
|
|
88
|
+
`[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
|
|
89
|
+
)
|
|
90
|
+
.join("");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
setIsHydrated(true);
|
|
95
|
+
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
96
|
+
(attrs) => {
|
|
97
|
+
setUserAttributes(attrs);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
if (!(isEditing() || isPreviewing())) {
|
|
101
|
+
const variant = filteredVariants()[0];
|
|
102
|
+
if (rootRef.current) {
|
|
103
|
+
rootRef.current.dispatchEvent(
|
|
104
|
+
new CustomEvent("builder.variantLoaded", {
|
|
105
|
+
detail: {
|
|
106
|
+
variant: variant || "default",
|
|
107
|
+
content: props.builderContext?.content,
|
|
108
|
+
},
|
|
109
|
+
bubbles: true,
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
const observer = new IntersectionObserver((entries) => {
|
|
113
|
+
entries.forEach((entry) => {
|
|
114
|
+
if (entry.isIntersecting && rootRef.current) {
|
|
115
|
+
rootRef.current.dispatchEvent(
|
|
116
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
117
|
+
detail: {
|
|
118
|
+
variant: variant || "default",
|
|
119
|
+
content: props.builderContext?.content,
|
|
120
|
+
},
|
|
121
|
+
bubbles: true,
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
observer.observe(rootRef.current);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
unsubscribers.push(unsub);
|
|
131
|
+
}, []);
|
|
132
|
+
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
return () => {
|
|
135
|
+
unsubscribers.forEach((unsub) => unsub());
|
|
136
|
+
};
|
|
137
|
+
}, []);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<View ref={rootRef} {...props.attributes}>
|
|
141
|
+
{shouldRenderVariants ? (
|
|
142
|
+
<>
|
|
143
|
+
{props.variants?.map((variant, index) => (
|
|
144
|
+
<View
|
|
145
|
+
key={index}
|
|
146
|
+
data-variant-id={`${props.builderBlock?.id}-${index}`}
|
|
147
|
+
>
|
|
148
|
+
<Blocks
|
|
149
|
+
blocks={variant.blocks}
|
|
150
|
+
parent={props.builderBlock?.id}
|
|
151
|
+
path={`component.options.variants.${index}.blocks`}
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
154
|
+
))}
|
|
155
|
+
<InlinedStyles
|
|
156
|
+
nonce={props.builderContext?.nonce || ""}
|
|
157
|
+
styles={hideVariantsStyleString()}
|
|
158
|
+
id={`variants-styles-${props.builderBlock?.id}`}
|
|
159
|
+
/>
|
|
160
|
+
<InlinedScript
|
|
161
|
+
nonce={props.builderContext?.nonce || ""}
|
|
162
|
+
scriptStr={scriptStr}
|
|
163
|
+
id={`variants-script-${props.builderBlock?.id}`}
|
|
164
|
+
/>
|
|
165
|
+
</>
|
|
166
|
+
) : null}
|
|
167
|
+
<Blocks
|
|
168
|
+
blocks={blocksToRender().blocks}
|
|
169
|
+
parent={props.builderBlock?.id}
|
|
170
|
+
path={blocksToRender().path}
|
|
171
|
+
/>
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export default PersonalizationContainer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
2
|
+
import type { BuilderDataProps } from '../../types/builder-props';
|
|
3
|
+
import type { Query } from './helpers';
|
|
4
|
+
export type PersonalizationContainerProps = {
|
|
5
|
+
children?: any;
|
|
6
|
+
attributes?: any;
|
|
7
|
+
previewingIndex?: number | null;
|
|
8
|
+
variants?: Array<{
|
|
9
|
+
blocks: BuilderBlock[];
|
|
10
|
+
query: Query[];
|
|
11
|
+
startDate?: string;
|
|
12
|
+
endDate?: string;
|
|
13
|
+
}>;
|
|
14
|
+
} & BuilderDataProps
|
|
@@ -91,7 +91,7 @@ function Symbol(props: SymbolProps) {
|
|
|
91
91
|
...contentToUse?.data?.state,
|
|
92
92
|
}}
|
|
93
93
|
canTrack={props.builderContext.canTrack}
|
|
94
|
-
model={props.symbol?.model}
|
|
94
|
+
model={props.symbol?.model ?? ""}
|
|
95
95
|
content={contentToUse}
|
|
96
96
|
linkComponent={props.builderLinkComponent}
|
|
97
97
|
blocksWrapper={blocksWrapper()}
|
|
@@ -49,9 +49,13 @@ function BlockStyles(props: BlockStylesProps) {
|
|
|
49
49
|
const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
|
|
50
50
|
content?.meta?.breakpoints || {}
|
|
51
51
|
);
|
|
52
|
+
const contentHasXSmallBreakpoint = Boolean(
|
|
53
|
+
content?.meta?.breakpoints?.xsmall
|
|
54
|
+
);
|
|
52
55
|
const largeStyles = styles?.large;
|
|
53
56
|
const mediumStyles = styles?.medium;
|
|
54
57
|
const smallStyles = styles?.small;
|
|
58
|
+
const xsmallStyles = styles?.xsmall;
|
|
55
59
|
const className = processedBlock.id;
|
|
56
60
|
if (!className) {
|
|
57
61
|
return "";
|
|
@@ -82,6 +86,17 @@ function BlockStyles(props: BlockStylesProps) {
|
|
|
82
86
|
),
|
|
83
87
|
})
|
|
84
88
|
: "";
|
|
89
|
+
const xsmallStylesClass =
|
|
90
|
+
xsmallStyles && contentHasXSmallBreakpoint
|
|
91
|
+
? createCssClass({
|
|
92
|
+
className,
|
|
93
|
+
styles: xsmallStyles,
|
|
94
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
95
|
+
"xsmall",
|
|
96
|
+
sizesWithUpdatedBreakpoints
|
|
97
|
+
),
|
|
98
|
+
})
|
|
99
|
+
: "";
|
|
85
100
|
const hoverAnimation =
|
|
86
101
|
processedBlock.animations &&
|
|
87
102
|
processedBlock.animations.find((item) => item.trigger === "hover");
|
|
@@ -106,6 +121,7 @@ function BlockStyles(props: BlockStylesProps) {
|
|
|
106
121
|
largeStylesClass,
|
|
107
122
|
mediumStylesClass,
|
|
108
123
|
smallStylesClass,
|
|
124
|
+
xsmallStylesClass,
|
|
109
125
|
hoverStylesClass,
|
|
110
126
|
].join(" ");
|
|
111
127
|
}
|
|
@@ -49,8 +49,11 @@ function BlocksWrapper(props: BlocksWrapperProps) {
|
|
|
49
49
|
if (!props.path) {
|
|
50
50
|
return undefined;
|
|
51
51
|
}
|
|
52
|
+
const thisPrefix = "this.";
|
|
52
53
|
const pathPrefix = "component.options.";
|
|
53
|
-
return props.path.startsWith(
|
|
54
|
+
return props.path.startsWith(thisPrefix)
|
|
55
|
+
? props.path.replace(thisPrefix, "")
|
|
56
|
+
: props.path.startsWith(pathPrefix)
|
|
54
57
|
? props.path
|
|
55
58
|
: `${pathPrefix}${props.path || ""}`;
|
|
56
59
|
}
|
|
@@ -246,12 +246,13 @@ function EnableEditor(props: BuilderEditorProps) {
|
|
|
246
246
|
trustedHosts: props.trustedHosts,
|
|
247
247
|
}
|
|
248
248
|
: {}),
|
|
249
|
+
modelName: props.model ?? "",
|
|
250
|
+
apiKey: props.apiKey,
|
|
249
251
|
});
|
|
250
252
|
Object.values<ComponentInfo>(
|
|
251
253
|
props.builderContextSignal.componentInfos
|
|
252
254
|
).forEach((registeredComponent) => {
|
|
253
255
|
if (
|
|
254
|
-
!props.model ||
|
|
255
256
|
!registeredComponent.models?.length ||
|
|
256
257
|
registeredComponent.models.includes(props.model)
|
|
257
258
|
) {
|
|
@@ -288,7 +289,7 @@ function EnableEditor(props: BuilderEditorProps) {
|
|
|
288
289
|
(!props.content || searchParamPreviewId === props.content.id))
|
|
289
290
|
) {
|
|
290
291
|
fetchOneEntry({
|
|
291
|
-
model: props.model
|
|
292
|
+
model: props.model,
|
|
292
293
|
apiKey: props.apiKey,
|
|
293
294
|
apiVersion: props.builderContextSignal.apiVersion,
|
|
294
295
|
...(searchParamPreviewModel === "BUILDER_STUDIO" &&
|
|
@@ -335,12 +336,13 @@ function EnableEditor(props: BuilderEditorProps) {
|
|
|
335
336
|
trustedHosts: props.trustedHosts,
|
|
336
337
|
}
|
|
337
338
|
: {}),
|
|
339
|
+
modelName: props.model ?? "",
|
|
340
|
+
apiKey: props.apiKey,
|
|
338
341
|
});
|
|
339
342
|
Object.values<ComponentInfo>(
|
|
340
343
|
props.builderContextSignal.componentInfos
|
|
341
344
|
).forEach((registeredComponent) => {
|
|
342
345
|
if (
|
|
343
|
-
!props.model ||
|
|
344
346
|
!registeredComponent.models?.length ||
|
|
345
347
|
registeredComponent.models.includes(props.model)
|
|
346
348
|
) {
|
|
@@ -397,7 +399,7 @@ function EnableEditor(props: BuilderEditorProps) {
|
|
|
397
399
|
(!props.content || searchParamPreviewId === props.content.id))
|
|
398
400
|
) {
|
|
399
401
|
fetchOneEntry({
|
|
400
|
-
model: props.model
|
|
402
|
+
model: props.model,
|
|
401
403
|
apiKey: props.apiKey,
|
|
402
404
|
apiVersion: props.builderContextSignal.apiVersion,
|
|
403
405
|
...(searchParamPreviewModel === "BUILDER_STUDIO" &&
|
|
@@ -104,7 +104,7 @@ function ContentComponent(props: ContentProps) {
|
|
|
104
104
|
BlocksWrapper: props.blocksWrapper || ScrollView,
|
|
105
105
|
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
106
106
|
nonce: props.nonce || "",
|
|
107
|
-
model: props.model
|
|
107
|
+
model: props.model,
|
|
108
108
|
}));
|
|
109
109
|
|
|
110
110
|
const hasInitialized = useRef(false);
|
|
@@ -7,12 +7,12 @@ export interface ContentVariantsPrps extends ExtraFrameworkProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* The Builder content JSON to render (required).
|
|
9
9
|
*/
|
|
10
|
-
content
|
|
10
|
+
content: Nullable<BuilderContent>;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The Builder content `model` to render (required).
|
|
14
14
|
*/
|
|
15
|
-
model
|
|
15
|
+
model: string;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Additional data to inject into your Builder content (optional).
|
|
@@ -8,6 +8,8 @@ import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/compo
|
|
|
8
8
|
import { default as Fragment } from '../blocks/fragment/index';
|
|
9
9
|
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info';
|
|
10
10
|
import { default as Image } from '../blocks/image/index';
|
|
11
|
+
import { componentInfo as personalizationContainerComponentInfo } from '../blocks/personalization-container/component-info';
|
|
12
|
+
import { default as PersonalizationContainer } from '../blocks/personalization-container/index';
|
|
11
13
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info';
|
|
12
14
|
import { default as Section } from '../blocks/section/index';
|
|
13
15
|
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info';
|
|
@@ -50,7 +52,10 @@ export const getDefaultRegisteredComponents: () => RegisteredComponent[] = () =>
|
|
|
50
52
|
}, {
|
|
51
53
|
component: Text,
|
|
52
54
|
...textComponentInfo
|
|
53
|
-
}, ...(TARGET === '
|
|
55
|
+
}, ...(TARGET === 'react' ? [{
|
|
56
|
+
component: PersonalizationContainer,
|
|
57
|
+
...personalizationContainerComponentInfo
|
|
58
|
+
}] : []), ...(TARGET === 'rsc' ? [] : [{
|
|
54
59
|
component: Tabs,
|
|
55
60
|
...tabsComponentInfo
|
|
56
61
|
}, {
|