@osano/osano-cmp-react-native 0.1.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/LICENSE +20 -0
- package/README.dev.md +58 -0
- package/README.md +1 -0
- package/android/build.gradle +94 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +72 -0
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKPackage.kt +17 -0
- package/ios/OsanoCmpSDK.mm +43 -0
- package/ios/OsanoCmpSdk.h +12 -0
- package/lib/commonjs/ConsentManager.js +529 -0
- package/lib/commonjs/ConsentManager.js.map +1 -0
- package/lib/commonjs/ConsentUiBuilder.js +75 -0
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -0
- package/lib/commonjs/components/Button.js +222 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +75 -0
- package/lib/commonjs/components/Checkbox.js.map +1 -0
- package/lib/commonjs/components/Divider.js +22 -0
- package/lib/commonjs/components/Divider.js.map +1 -0
- package/lib/commonjs/components/ExpansionPanel.js +70 -0
- package/lib/commonjs/components/ExpansionPanel.js.map +1 -0
- package/lib/commonjs/components/Link.js +51 -0
- package/lib/commonjs/components/Link.js.map +1 -0
- package/lib/commonjs/components/List.js +36 -0
- package/lib/commonjs/components/List.js.map +1 -0
- package/lib/commonjs/components/Locale.js +28 -0
- package/lib/commonjs/components/Locale.js.map +1 -0
- package/lib/commonjs/components/StoragePolicyLink.js +32 -0
- package/lib/commonjs/components/StoragePolicyLink.js.map +1 -0
- package/lib/commonjs/components/Toggle.js +113 -0
- package/lib/commonjs/components/Toggle.js.map +1 -0
- package/lib/commonjs/constants.js +37 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/context.js +40 -0
- package/lib/commonjs/context.js.map +1 -0
- package/lib/commonjs/flavors/five.json +11 -0
- package/lib/commonjs/flavors/four.json +11 -0
- package/lib/commonjs/flavors/index.js +32 -0
- package/lib/commonjs/flavors/index.js.map +1 -0
- package/lib/commonjs/flavors/one.json +11 -0
- package/lib/commonjs/flavors/six.json +12 -0
- package/lib/commonjs/flavors/three.json +11 -0
- package/lib/commonjs/flavors/two.json +11 -0
- package/lib/commonjs/hooks/useBoundCallback.js +32 -0
- package/lib/commonjs/hooks/useBoundCallback.js.map +1 -0
- package/lib/commonjs/hooks/useDeviceOrientation.js +20 -0
- package/lib/commonjs/hooks/useDeviceOrientation.js.map +1 -0
- package/lib/commonjs/hooks/usePrevious.js +15 -0
- package/lib/commonjs/hooks/usePrevious.js.map +1 -0
- package/lib/commonjs/hooks/useThunkReducer.js +62 -0
- package/lib/commonjs/hooks/useThunkReducer.js.map +1 -0
- package/lib/commonjs/iab/constants.js +8 -0
- package/lib/commonjs/iab/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/api.js +226 -0
- package/lib/commonjs/iab/gpp/api.js.map +1 -0
- package/lib/commonjs/iab/gpp/consent.js +99 -0
- package/lib/commonjs/iab/gpp/consent.js.map +1 -0
- package/lib/commonjs/iab/gpp/constants.js +56 -0
- package/lib/commonjs/iab/gpp/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.js +139 -0
- package/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/BooleanEncoder.js +47 -0
- package/lib/commonjs/iab/gpp/encoders/BooleanEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.js +49 -0
- package/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.js +48 -0
- package/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.js +184 -0
- package/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.js +81 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js +104 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.js +56 -0
- package/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.js +27 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js +62 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.js +71 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.js +88 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.js +68 -0
- package/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js +46 -0
- package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/errors.js +42 -0
- package/lib/commonjs/iab/gpp/encoders/errors.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/index.js +105 -0
- package/lib/commonjs/iab/gpp/encoders/index.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/types.js +2 -0
- package/lib/commonjs/iab/gpp/encoders/types.js.map +1 -0
- package/lib/commonjs/iab/gpp/index.js +16 -0
- package/lib/commonjs/iab/gpp/index.js.map +1 -0
- package/lib/commonjs/iab/gpp/reducer.js +12 -0
- package/lib/commonjs/iab/gpp/reducer.js.map +1 -0
- package/lib/commonjs/iab/gpp/selectors.js +25 -0
- package/lib/commonjs/iab/gpp/selectors.js.map +1 -0
- package/lib/commonjs/iab/gpp/types.js +2 -0
- package/lib/commonjs/iab/gpp/types.js.map +1 -0
- package/lib/commonjs/iab/gpp/v1/constants.js +16 -0
- package/lib/commonjs/iab/gpp/v1/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/v1/index.js +73 -0
- package/lib/commonjs/iab/gpp/v1/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/actions.js +20 -0
- package/lib/commonjs/iab/tcf/actions.js.map +1 -0
- package/lib/commonjs/iab/tcf/consent.js +306 -0
- package/lib/commonjs/iab/tcf/consent.js.map +1 -0
- package/lib/commonjs/iab/tcf/constants.js +44 -0
- package/lib/commonjs/iab/tcf/constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +14 -0
- package/lib/commonjs/iab/tcf/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/reducer.js +57 -0
- package/lib/commonjs/iab/tcf/reducer.js.map +1 -0
- package/lib/commonjs/iab/tcf/selectors.js +158 -0
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -0
- package/lib/commonjs/iab/tcf/tcfcav1-api.js +41 -0
- package/lib/commonjs/iab/tcf/tcfcav1-api.js.map +1 -0
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js +256 -0
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js.map +1 -0
- package/lib/commonjs/iab/tcf/types.js +6 -0
- package/lib/commonjs/iab/tcf/types.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/encoders.js +39 -0
- package/lib/commonjs/iab/tcf/v2.0/encoders.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/formatters.js +21 -0
- package/lib/commonjs/iab/tcf/v2.0/formatters.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/helpers.js +25 -0
- package/lib/commonjs/iab/tcf/v2.0/helpers.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/index.js +39 -0
- package/lib/commonjs/iab/tcf/v2.0/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/middleware.js +80 -0
- package/lib/commonjs/iab/tcf/v2.0/middleware.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/reducer.js +318 -0
- package/lib/commonjs/iab/tcf/v2.0/reducer.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +22 -0
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js +63 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js +92 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -0
- package/lib/commonjs/iab/types.js +6 -0
- package/lib/commonjs/iab/types.js.map +1 -0
- package/lib/commonjs/iab/usp/api.js +59 -0
- package/lib/commonjs/iab/usp/api.js.map +1 -0
- package/lib/commonjs/iab/usp/consent.js +140 -0
- package/lib/commonjs/iab/usp/consent.js.map +1 -0
- package/lib/commonjs/iab/usp/constants.js +46 -0
- package/lib/commonjs/iab/usp/constants.js.map +1 -0
- package/lib/commonjs/iab/usp/index.js +16 -0
- package/lib/commonjs/iab/usp/index.js.map +1 -0
- package/lib/commonjs/iab/usp/reducer.js +121 -0
- package/lib/commonjs/iab/usp/reducer.js.map +1 -0
- package/lib/commonjs/iab/usp/selectors.js +35 -0
- package/lib/commonjs/iab/usp/selectors.js.map +1 -0
- package/lib/commonjs/iab/usp/types.js +2 -0
- package/lib/commonjs/iab/usp/types.js.map +1 -0
- package/lib/commonjs/iab/usp/v1/constants.js +16 -0
- package/lib/commonjs/iab/usp/v1/constants.js.map +1 -0
- package/lib/commonjs/iab/usp/v1/index.js +58 -0
- package/lib/commonjs/iab/usp/v1/index.js.map +1 -0
- package/lib/commonjs/iab/utilities.js +16 -0
- package/lib/commonjs/iab/utilities.js.map +1 -0
- package/lib/commonjs/index.js +129 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/locale/af.json +306 -0
- package/lib/commonjs/locale/ar.json +306 -0
- package/lib/commonjs/locale/bg.json +306 -0
- package/lib/commonjs/locale/ca.json +306 -0
- package/lib/commonjs/locale/cs.json +306 -0
- package/lib/commonjs/locale/da.json +306 -0
- package/lib/commonjs/locale/de-at.json +306 -0
- package/lib/commonjs/locale/de.json +306 -0
- package/lib/commonjs/locale/el.json +306 -0
- package/lib/commonjs/locale/en-au.json +306 -0
- package/lib/commonjs/locale/en-ca.json +306 -0
- package/lib/commonjs/locale/en-gb.json +306 -0
- package/lib/commonjs/locale/en.json +306 -0
- package/lib/commonjs/locale/es-mx.json +306 -0
- package/lib/commonjs/locale/es.json +306 -0
- package/lib/commonjs/locale/et.json +306 -0
- package/lib/commonjs/locale/fa.json +306 -0
- package/lib/commonjs/locale/fi.json +306 -0
- package/lib/commonjs/locale/fr-ca.json +306 -0
- package/lib/commonjs/locale/fr.json +306 -0
- package/lib/commonjs/locale/gd.json +306 -0
- package/lib/commonjs/locale/he.json +306 -0
- package/lib/commonjs/locale/hi.json +306 -0
- package/lib/commonjs/locale/hr.json +306 -0
- package/lib/commonjs/locale/hu.json +306 -0
- package/lib/commonjs/locale/hy.json +306 -0
- package/lib/commonjs/locale/id.json +306 -0
- package/lib/commonjs/locale/index.js +427 -0
- package/lib/commonjs/locale/index.js.map +1 -0
- package/lib/commonjs/locale/is.json +306 -0
- package/lib/commonjs/locale/it.json +306 -0
- package/lib/commonjs/locale/ja.json +306 -0
- package/lib/commonjs/locale/kk.json +306 -0
- package/lib/commonjs/locale/ko.json +306 -0
- package/lib/commonjs/locale/lt.json +306 -0
- package/lib/commonjs/locale/lv.json +306 -0
- package/lib/commonjs/locale/mi.json +306 -0
- package/lib/commonjs/locale/ms.json +306 -0
- package/lib/commonjs/locale/nb.json +306 -0
- package/lib/commonjs/locale/nl-be.json +306 -0
- package/lib/commonjs/locale/nl.json +306 -0
- package/lib/commonjs/locale/nn.json +306 -0
- package/lib/commonjs/locale/no.json +306 -0
- package/lib/commonjs/locale/pl.json +306 -0
- package/lib/commonjs/locale/pt-br.json +306 -0
- package/lib/commonjs/locale/pt.json +306 -0
- package/lib/commonjs/locale/ro.json +306 -0
- package/lib/commonjs/locale/ru.json +306 -0
- package/lib/commonjs/locale/sk.json +306 -0
- package/lib/commonjs/locale/sl.json +306 -0
- package/lib/commonjs/locale/sq.json +306 -0
- package/lib/commonjs/locale/sr.json +306 -0
- package/lib/commonjs/locale/sv.json +306 -0
- package/lib/commonjs/locale/th.json +306 -0
- package/lib/commonjs/locale/tl.json +306 -0
- package/lib/commonjs/locale/tr.json +306 -0
- package/lib/commonjs/locale/uk.json +306 -0
- package/lib/commonjs/locale/vi.json +306 -0
- package/lib/commonjs/locale/zh-hk.json +306 -0
- package/lib/commonjs/locale/zh-tw.json +306 -0
- package/lib/commonjs/locale/zh.json +306 -0
- package/lib/commonjs/locale/zu.json +306 -0
- package/lib/commonjs/native/OsanoCmp.js +33 -0
- package/lib/commonjs/native/OsanoCmp.js.map +1 -0
- package/lib/commonjs/services/consent.js +134 -0
- package/lib/commonjs/services/consent.js.map +1 -0
- package/lib/commonjs/services/disclosures.js +25 -0
- package/lib/commonjs/services/disclosures.js.map +1 -0
- package/lib/commonjs/services/locale.js +40 -0
- package/lib/commonjs/services/locale.js.map +1 -0
- package/lib/commonjs/store.js +558 -0
- package/lib/commonjs/store.js.map +1 -0
- package/lib/commonjs/styles.js +186 -0
- package/lib/commonjs/styles.js.map +1 -0
- package/lib/commonjs/types/consent-config.d.js +6 -0
- package/lib/commonjs/types/consent-config.d.js.map +1 -0
- package/lib/commonjs/types/env.d.js +2 -0
- package/lib/commonjs/types/env.d.js.map +1 -0
- package/lib/commonjs/types/index.d.js +6 -0
- package/lib/commonjs/types/index.d.js.map +1 -0
- package/lib/commonjs/types/store.d.js +6 -0
- package/lib/commonjs/types/store.d.js.map +1 -0
- package/lib/commonjs/utils/API.js +43 -0
- package/lib/commonjs/utils/API.js.map +1 -0
- package/lib/commonjs/utils/Color.js +99 -0
- package/lib/commonjs/utils/Color.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +53 -0
- package/lib/commonjs/utils/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/Translator.js +222 -0
- package/lib/commonjs/utils/Translator.js.map +1 -0
- package/lib/commonjs/utils/index.js +116 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/views/Dialog/Buttons.js +76 -0
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -0
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js +44 -0
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js.map +1 -0
- package/lib/commonjs/views/Dialog/Message.js +30 -0
- package/lib/commonjs/views/Dialog/Message.js.map +1 -0
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +46 -0
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -0
- package/lib/commonjs/views/Dialog/index.js +314 -0
- package/lib/commonjs/views/Dialog/index.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +627 -0
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Header.js +120 -0
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +311 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +458 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -0
- package/lib/commonjs/views/Drawer/index.js +208 -0
- package/lib/commonjs/views/Drawer/index.js.map +1 -0
- package/lib/module/ConsentManager.js +520 -0
- package/lib/module/ConsentManager.js.map +1 -0
- package/lib/module/ConsentUiBuilder.js +66 -0
- package/lib/module/ConsentUiBuilder.js.map +1 -0
- package/lib/module/components/Button.js +205 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Checkbox.js +65 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/Divider.js +14 -0
- package/lib/module/components/Divider.js.map +1 -0
- package/lib/module/components/ExpansionPanel.js +60 -0
- package/lib/module/components/ExpansionPanel.js.map +1 -0
- package/lib/module/components/Link.js +42 -0
- package/lib/module/components/Link.js.map +1 -0
- package/lib/module/components/List.js +28 -0
- package/lib/module/components/List.js.map +1 -0
- package/lib/module/components/Locale.js +21 -0
- package/lib/module/components/Locale.js.map +1 -0
- package/lib/module/components/StoragePolicyLink.js +24 -0
- package/lib/module/components/StoragePolicyLink.js.map +1 -0
- package/lib/module/components/Toggle.js +103 -0
- package/lib/module/components/Toggle.js.map +1 -0
- package/lib/module/constants.js +31 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/context.js +33 -0
- package/lib/module/context.js.map +1 -0
- package/lib/module/flavors/five.json +11 -0
- package/lib/module/flavors/four.json +11 -0
- package/lib/module/flavors/index.js +26 -0
- package/lib/module/flavors/index.js.map +1 -0
- package/lib/module/flavors/one.json +11 -0
- package/lib/module/flavors/six.json +12 -0
- package/lib/module/flavors/three.json +11 -0
- package/lib/module/flavors/two.json +11 -0
- package/lib/module/hooks/useBoundCallback.js +25 -0
- package/lib/module/hooks/useBoundCallback.js.map +1 -0
- package/lib/module/hooks/useDeviceOrientation.js +13 -0
- package/lib/module/hooks/useDeviceOrientation.js.map +1 -0
- package/lib/module/hooks/usePrevious.js +9 -0
- package/lib/module/hooks/usePrevious.js.map +1 -0
- package/lib/module/hooks/useThunkReducer.js +54 -0
- package/lib/module/hooks/useThunkReducer.js.map +1 -0
- package/lib/module/iab/constants.js +2 -0
- package/lib/module/iab/constants.js.map +1 -0
- package/lib/module/iab/gpp/api.js +220 -0
- package/lib/module/iab/gpp/api.js.map +1 -0
- package/lib/module/iab/gpp/consent.js +89 -0
- package/lib/module/iab/gpp/consent.js.map +1 -0
- package/lib/module/iab/gpp/constants.js +50 -0
- package/lib/module/iab/gpp/constants.js.map +1 -0
- package/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.js +132 -0
- package/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/BooleanEncoder.js +39 -0
- package/lib/module/iab/gpp/encoders/BooleanEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.js +38 -0
- package/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/DatetimeEncoder.js +40 -0
- package/lib/module/iab/gpp/encoders/DatetimeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.js +177 -0
- package/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.js +73 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js +96 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.js +48 -0
- package/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.js +21 -0
- package/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js +55 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.js +63 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.js +80 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedStringEncoder.js +60 -0
- package/lib/module/iab/gpp/encoders/FixedStringEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js +35 -0
- package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/errors.js +31 -0
- package/lib/module/iab/gpp/encoders/errors.js.map +1 -0
- package/lib/module/iab/gpp/encoders/index.js +15 -0
- package/lib/module/iab/gpp/encoders/index.js.map +1 -0
- package/lib/module/iab/gpp/encoders/types.js +2 -0
- package/lib/module/iab/gpp/encoders/types.js.map +1 -0
- package/lib/module/iab/gpp/index.js +9 -0
- package/lib/module/iab/gpp/index.js.map +1 -0
- package/lib/module/iab/gpp/reducer.js +6 -0
- package/lib/module/iab/gpp/reducer.js.map +1 -0
- package/lib/module/iab/gpp/selectors.js +14 -0
- package/lib/module/iab/gpp/selectors.js.map +1 -0
- package/lib/module/iab/gpp/types.js +2 -0
- package/lib/module/iab/gpp/types.js.map +1 -0
- package/lib/module/iab/gpp/v1/constants.js +10 -0
- package/lib/module/iab/gpp/v1/constants.js.map +1 -0
- package/lib/module/iab/gpp/v1/index.js +65 -0
- package/lib/module/iab/gpp/v1/index.js.map +1 -0
- package/lib/module/iab/tcf/actions.js +14 -0
- package/lib/module/iab/tcf/actions.js.map +1 -0
- package/lib/module/iab/tcf/consent.js +293 -0
- package/lib/module/iab/tcf/consent.js.map +1 -0
- package/lib/module/iab/tcf/constants.js +37 -0
- package/lib/module/iab/tcf/constants.js.map +1 -0
- package/lib/module/iab/tcf/index.js +7 -0
- package/lib/module/iab/tcf/index.js.map +1 -0
- package/lib/module/iab/tcf/reducer.js +51 -0
- package/lib/module/iab/tcf/reducer.js.map +1 -0
- package/lib/module/iab/tcf/selectors.js +124 -0
- package/lib/module/iab/tcf/selectors.js.map +1 -0
- package/lib/module/iab/tcf/tcfcav1-api.js +35 -0
- package/lib/module/iab/tcf/tcfcav1-api.js.map +1 -0
- package/lib/module/iab/tcf/tcfeuv2-api.js +251 -0
- package/lib/module/iab/tcf/tcfeuv2-api.js.map +1 -0
- package/lib/module/iab/tcf/types.js +2 -0
- package/lib/module/iab/tcf/types.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/encoders.js +28 -0
- package/lib/module/iab/tcf/v2.0/encoders.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/formatters.js +12 -0
- package/lib/module/iab/tcf/v2.0/formatters.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/helpers.js +18 -0
- package/lib/module/iab/tcf/v2.0/helpers.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/index.js +33 -0
- package/lib/module/iab/tcf/v2.0/index.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/middleware.js +74 -0
- package/lib/module/iab/tcf/v2.0/middleware.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/reducer.js +311 -0
- package/lib/module/iab/tcf/v2.0/reducer.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/shared-constants.js +16 -0
- package/lib/module/iab/tcf/v2.0/shared-constants.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js +57 -0
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js +85 -0
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -0
- package/lib/module/iab/types.js +2 -0
- package/lib/module/iab/types.js.map +1 -0
- package/lib/module/iab/usp/api.js +53 -0
- package/lib/module/iab/usp/api.js.map +1 -0
- package/lib/module/iab/usp/consent.js +129 -0
- package/lib/module/iab/usp/consent.js.map +1 -0
- package/lib/module/iab/usp/constants.js +38 -0
- package/lib/module/iab/usp/constants.js.map +1 -0
- package/lib/module/iab/usp/index.js +9 -0
- package/lib/module/iab/usp/index.js.map +1 -0
- package/lib/module/iab/usp/reducer.js +115 -0
- package/lib/module/iab/usp/reducer.js.map +1 -0
- package/lib/module/iab/usp/selectors.js +25 -0
- package/lib/module/iab/usp/selectors.js.map +1 -0
- package/lib/module/iab/usp/types.js +2 -0
- package/lib/module/iab/usp/types.js.map +1 -0
- package/lib/module/iab/usp/v1/constants.js +10 -0
- package/lib/module/iab/usp/v1/constants.js.map +1 -0
- package/lib/module/iab/usp/v1/index.js +51 -0
- package/lib/module/iab/usp/v1/index.js.map +1 -0
- package/lib/module/iab/utilities.js +9 -0
- package/lib/module/iab/utilities.js.map +1 -0
- package/lib/module/index.js +114 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/locale/af.json +306 -0
- package/lib/module/locale/ar.json +306 -0
- package/lib/module/locale/bg.json +306 -0
- package/lib/module/locale/ca.json +306 -0
- package/lib/module/locale/cs.json +306 -0
- package/lib/module/locale/da.json +306 -0
- package/lib/module/locale/de-at.json +306 -0
- package/lib/module/locale/de.json +306 -0
- package/lib/module/locale/el.json +306 -0
- package/lib/module/locale/en-au.json +306 -0
- package/lib/module/locale/en-ca.json +306 -0
- package/lib/module/locale/en-gb.json +306 -0
- package/lib/module/locale/en.json +306 -0
- package/lib/module/locale/es-mx.json +306 -0
- package/lib/module/locale/es.json +306 -0
- package/lib/module/locale/et.json +306 -0
- package/lib/module/locale/fa.json +306 -0
- package/lib/module/locale/fi.json +306 -0
- package/lib/module/locale/fr-ca.json +306 -0
- package/lib/module/locale/fr.json +306 -0
- package/lib/module/locale/gd.json +306 -0
- package/lib/module/locale/he.json +306 -0
- package/lib/module/locale/hi.json +306 -0
- package/lib/module/locale/hr.json +306 -0
- package/lib/module/locale/hu.json +306 -0
- package/lib/module/locale/hy.json +306 -0
- package/lib/module/locale/id.json +306 -0
- package/lib/module/locale/index.js +61 -0
- package/lib/module/locale/index.js.map +1 -0
- package/lib/module/locale/is.json +306 -0
- package/lib/module/locale/it.json +306 -0
- package/lib/module/locale/ja.json +306 -0
- package/lib/module/locale/kk.json +306 -0
- package/lib/module/locale/ko.json +306 -0
- package/lib/module/locale/lt.json +306 -0
- package/lib/module/locale/lv.json +306 -0
- package/lib/module/locale/mi.json +306 -0
- package/lib/module/locale/ms.json +306 -0
- package/lib/module/locale/nb.json +306 -0
- package/lib/module/locale/nl-be.json +306 -0
- package/lib/module/locale/nl.json +306 -0
- package/lib/module/locale/nn.json +306 -0
- package/lib/module/locale/no.json +306 -0
- package/lib/module/locale/pl.json +306 -0
- package/lib/module/locale/pt-br.json +306 -0
- package/lib/module/locale/pt.json +306 -0
- package/lib/module/locale/ro.json +306 -0
- package/lib/module/locale/ru.json +306 -0
- package/lib/module/locale/sk.json +306 -0
- package/lib/module/locale/sl.json +306 -0
- package/lib/module/locale/sq.json +306 -0
- package/lib/module/locale/sr.json +306 -0
- package/lib/module/locale/sv.json +306 -0
- package/lib/module/locale/th.json +306 -0
- package/lib/module/locale/tl.json +306 -0
- package/lib/module/locale/tr.json +306 -0
- package/lib/module/locale/uk.json +306 -0
- package/lib/module/locale/vi.json +306 -0
- package/lib/module/locale/zh-hk.json +306 -0
- package/lib/module/locale/zh-tw.json +306 -0
- package/lib/module/locale/zh.json +306 -0
- package/lib/module/locale/zu.json +306 -0
- package/lib/module/native/OsanoCmp.js +24 -0
- package/lib/module/native/OsanoCmp.js.map +1 -0
- package/lib/module/services/consent.js +123 -0
- package/lib/module/services/consent.js.map +1 -0
- package/lib/module/services/disclosures.js +18 -0
- package/lib/module/services/disclosures.js.map +1 -0
- package/lib/module/services/locale.js +32 -0
- package/lib/module/services/locale.js.map +1 -0
- package/lib/module/store.js +520 -0
- package/lib/module/store.js.map +1 -0
- package/lib/module/styles.js +178 -0
- package/lib/module/styles.js.map +1 -0
- package/lib/module/types/consent-config.d.js +2 -0
- package/lib/module/types/consent-config.d.js.map +1 -0
- package/lib/module/types/env.d.js +2 -0
- package/lib/module/types/env.d.js.map +1 -0
- package/lib/module/types/index.d.js +2 -0
- package/lib/module/types/index.d.js.map +1 -0
- package/lib/module/types/store.d.js +2 -0
- package/lib/module/types/store.d.js.map +1 -0
- package/lib/module/utils/API.js +37 -0
- package/lib/module/utils/API.js.map +1 -0
- package/lib/module/utils/Color.js +82 -0
- package/lib/module/utils/Color.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +45 -0
- package/lib/module/utils/EventEmitter.js.map +1 -0
- package/lib/module/utils/Translator.js +215 -0
- package/lib/module/utils/Translator.js.map +1 -0
- package/lib/module/utils/index.js +107 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/views/Dialog/Buttons.js +67 -0
- package/lib/module/views/Dialog/Buttons.js.map +1 -0
- package/lib/module/views/Dialog/FirstLayerUsage.js +34 -0
- package/lib/module/views/Dialog/FirstLayerUsage.js.map +1 -0
- package/lib/module/views/Dialog/Message.js +20 -0
- package/lib/module/views/Dialog/Message.js.map +1 -0
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js +36 -0
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -0
- package/lib/module/views/Dialog/index.js +304 -0
- package/lib/module/views/Dialog/index.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js +617 -0
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Header.js +110 -0
- package/lib/module/views/Drawer/Drawer.Header.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +301 -0
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js +448 -0
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js.map +1 -0
- package/lib/module/views/Drawer/index.js +198 -0
- package/lib/module/views/Drawer/index.js.map +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +123 -0
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -0
- package/lib/typescript/src/ConsentUiBuilder.d.ts +13 -0
- package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -0
- package/lib/typescript/src/components/Button.d.ts +22 -0
- package/lib/typescript/src/components/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Checkbox.d.ts +12 -0
- package/lib/typescript/src/components/Checkbox.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider.d.ts +9 -0
- package/lib/typescript/src/components/Divider.d.ts.map +1 -0
- package/lib/typescript/src/components/ExpansionPanel.d.ts +10 -0
- package/lib/typescript/src/components/ExpansionPanel.d.ts.map +1 -0
- package/lib/typescript/src/components/Link.d.ts +9 -0
- package/lib/typescript/src/components/Link.d.ts.map +1 -0
- package/lib/typescript/src/components/List.d.ts +10 -0
- package/lib/typescript/src/components/List.d.ts.map +1 -0
- package/lib/typescript/src/components/Locale.d.ts +10 -0
- package/lib/typescript/src/components/Locale.d.ts.map +1 -0
- package/lib/typescript/src/components/StoragePolicyLink.d.ts +4 -0
- package/lib/typescript/src/components/StoragePolicyLink.d.ts.map +1 -0
- package/lib/typescript/src/components/Toggle.d.ts +12 -0
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +17 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/context.d.ts +34 -0
- package/lib/typescript/src/context.d.ts.map +1 -0
- package/lib/typescript/src/flavors/index.d.ts +21 -0
- package/lib/typescript/src/flavors/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useBoundCallback.d.ts +17 -0
- package/lib/typescript/src/hooks/useBoundCallback.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useDeviceOrientation.d.ts +4 -0
- package/lib/typescript/src/hooks/useDeviceOrientation.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePrevious.d.ts +2 -0
- package/lib/typescript/src/hooks/usePrevious.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useThunkReducer.d.ts +23 -0
- package/lib/typescript/src/hooks/useThunkReducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/constants.d.ts +2 -0
- package/lib/typescript/src/iab/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts +34 -0
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +16 -0
- package/lib/typescript/src/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +6 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts +26 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +26 -0
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/errors.d.ts +19 -0
- package/lib/typescript/src/iab/gpp/encoders/errors.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/index.d.ts +16 -0
- package/lib/typescript/src/iab/gpp/encoders/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/types.d.ts +5 -0
- package/lib/typescript/src/iab/gpp/encoders/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/types.d.ts +3 -0
- package/lib/typescript/src/iab/gpp/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts +20 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/types.d.ts +12 -0
- package/lib/typescript/src/iab/tcf/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts +8 -0
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts +5 -0
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts.map +1 -0
- package/lib/typescript/src/iab/types.d.ts +63 -0
- package/lib/typescript/src/iab/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/types.d.ts +5 -0
- package/lib/typescript/src/iab/usp/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/utilities.d.ts +3 -0
- package/lib/typescript/src/iab/utilities.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts +5 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -0
- package/lib/typescript/src/services/consent.d.ts +17 -0
- package/lib/typescript/src/services/consent.d.ts.map +1 -0
- package/lib/typescript/src/services/disclosures.d.ts +2 -0
- package/lib/typescript/src/services/disclosures.d.ts.map +1 -0
- package/lib/typescript/src/services/locale.d.ts +4 -0
- package/lib/typescript/src/services/locale.d.ts.map +1 -0
- package/lib/typescript/src/store.d.ts +55 -0
- package/lib/typescript/src/store.d.ts.map +1 -0
- package/lib/typescript/src/styles.d.ts +141 -0
- package/lib/typescript/src/styles.d.ts.map +1 -0
- package/lib/typescript/src/utils/API.d.ts +6 -0
- package/lib/typescript/src/utils/API.d.ts.map +1 -0
- package/lib/typescript/src/utils/Color.d.ts +12 -0
- package/lib/typescript/src/utils/Color.d.ts.map +1 -0
- package/lib/typescript/src/utils/EventEmitter.d.ts +15 -0
- package/lib/typescript/src/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/src/utils/Translator.d.ts +61 -0
- package/lib/typescript/src/utils/Translator.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +5 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/Buttons.d.ts +5 -0
- package/lib/typescript/src/views/Dialog/Buttons.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/FirstLayerUsage.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/Message.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/Message.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/index.d.ts +5 -0
- package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts +10 -0
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/index.d.ts +5 -0
- package/lib/typescript/src/views/Drawer/index.d.ts.map +1 -0
- package/osano-cmp-sdk.podspec +41 -0
- package/package.json +158 -0
- package/src/ConsentManager.ts +622 -0
- package/src/ConsentUiBuilder.tsx +117 -0
- package/src/components/Button.tsx +204 -0
- package/src/components/Checkbox.tsx +86 -0
- package/src/components/Divider.tsx +20 -0
- package/src/components/ExpansionPanel.tsx +72 -0
- package/src/components/Link.tsx +49 -0
- package/src/components/List.tsx +39 -0
- package/src/components/Locale.tsx +38 -0
- package/src/components/StoragePolicyLink.tsx +24 -0
- package/src/components/Toggle.tsx +165 -0
- package/src/constants.ts +34 -0
- package/src/context.ts +79 -0
- package/src/flavors/five.json +11 -0
- package/src/flavors/four.json +11 -0
- package/src/flavors/index.ts +38 -0
- package/src/flavors/one.json +11 -0
- package/src/flavors/six.json +12 -0
- package/src/flavors/three.json +11 -0
- package/src/flavors/two.json +11 -0
- package/src/hooks/useBoundCallback.ts +32 -0
- package/src/hooks/useDeviceOrientation.ts +14 -0
- package/src/hooks/usePrevious.ts +9 -0
- package/src/hooks/useThunkReducer.ts +124 -0
- package/src/iab/constants.ts +1 -0
- package/src/iab/gpp/api.js +253 -0
- package/src/iab/gpp/consent.js +114 -0
- package/src/iab/gpp/constants.js +49 -0
- package/src/iab/gpp/encoders/AbstractBase64UrlEncoder.ts +89 -0
- package/src/iab/gpp/encoders/BooleanEncoder.ts +39 -0
- package/src/iab/gpp/encoders/CompressedBase64UrlEncoder.ts +41 -0
- package/src/iab/gpp/encoders/DatetimeEncoder.ts +46 -0
- package/src/iab/gpp/encoders/EncodableOptimizedFixedRange.ts +213 -0
- package/src/iab/gpp/encoders/FibonacciIntegerEncoder.ts +81 -0
- package/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.ts +122 -0
- package/src/iab/gpp/encoders/FixedBitfieldEncoder.ts +59 -0
- package/src/iab/gpp/encoders/FixedIdBitMapEncoder.ts +30 -0
- package/src/iab/gpp/encoders/FixedIntegerEncoder.ts +61 -0
- package/src/iab/gpp/encoders/FixedIntegerListEncoder.ts +87 -0
- package/src/iab/gpp/encoders/FixedIntegerRangeEncoder.ts +102 -0
- package/src/iab/gpp/encoders/FixedStringEncoder.ts +74 -0
- package/src/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.ts +39 -0
- package/src/iab/gpp/encoders/errors.ts +41 -0
- package/src/iab/gpp/encoders/index.ts +15 -0
- package/src/iab/gpp/encoders/types.ts +5 -0
- package/src/iab/gpp/index.js +9 -0
- package/src/iab/gpp/reducer.js +7 -0
- package/src/iab/gpp/selectors.js +21 -0
- package/src/iab/gpp/types.ts +3 -0
- package/src/iab/gpp/v1/constants.js +7 -0
- package/src/iab/gpp/v1/index.js +73 -0
- package/src/iab/tcf/actions.js +52 -0
- package/src/iab/tcf/consent.js +345 -0
- package/src/iab/tcf/constants.ts +51 -0
- package/src/iab/tcf/index.js +7 -0
- package/src/iab/tcf/reducer.js +59 -0
- package/src/iab/tcf/selectors.js +151 -0
- package/src/iab/tcf/tcfcav1-api.js +39 -0
- package/src/iab/tcf/tcfeuv2-api.js +264 -0
- package/src/iab/tcf/types.ts +13 -0
- package/src/iab/tcf/v2.0/encoders.ts +37 -0
- package/src/iab/tcf/v2.0/formatters.js +14 -0
- package/src/iab/tcf/v2.0/helpers.ts +23 -0
- package/src/iab/tcf/v2.0/index.js +36 -0
- package/src/iab/tcf/v2.0/middleware.js +72 -0
- package/src/iab/tcf/v2.0/reducer.js +327 -0
- package/src/iab/tcf/v2.0/shared-constants.js +17 -0
- package/src/iab/tcf/v2.0/tcfcav1-constants.js +115 -0
- package/src/iab/tcf/v2.0/tcfeuv2-constants.js +117 -0
- package/src/iab/types.ts +67 -0
- package/src/iab/usp/api.js +56 -0
- package/src/iab/usp/consent.js +150 -0
- package/src/iab/usp/constants.js +40 -0
- package/src/iab/usp/index.js +9 -0
- package/src/iab/usp/reducer.js +107 -0
- package/src/iab/usp/selectors.js +31 -0
- package/src/iab/usp/types.ts +4 -0
- package/src/iab/usp/v1/constants.js +10 -0
- package/src/iab/usp/v1/index.js +54 -0
- package/src/iab/utilities.ts +17 -0
- package/src/index.tsx +128 -0
- package/src/locale/af.json +306 -0
- package/src/locale/ar.json +306 -0
- package/src/locale/bg.json +306 -0
- package/src/locale/ca.json +306 -0
- package/src/locale/cs.json +306 -0
- package/src/locale/da.json +306 -0
- package/src/locale/de-at.json +306 -0
- package/src/locale/de.json +306 -0
- package/src/locale/el.json +306 -0
- package/src/locale/en-au.json +306 -0
- package/src/locale/en-ca.json +306 -0
- package/src/locale/en-gb.json +306 -0
- package/src/locale/en.json +306 -0
- package/src/locale/es-mx.json +306 -0
- package/src/locale/es.json +306 -0
- package/src/locale/et.json +306 -0
- package/src/locale/fa.json +306 -0
- package/src/locale/fi.json +306 -0
- package/src/locale/fr-ca.json +306 -0
- package/src/locale/fr.json +306 -0
- package/src/locale/gd.json +306 -0
- package/src/locale/he.json +306 -0
- package/src/locale/hi.json +306 -0
- package/src/locale/hr.json +306 -0
- package/src/locale/hu.json +306 -0
- package/src/locale/hy.json +306 -0
- package/src/locale/id.json +306 -0
- package/src/locale/index.js +60 -0
- package/src/locale/is.json +306 -0
- package/src/locale/it.json +306 -0
- package/src/locale/ja.json +306 -0
- package/src/locale/kk.json +306 -0
- package/src/locale/ko.json +306 -0
- package/src/locale/lt.json +306 -0
- package/src/locale/lv.json +306 -0
- package/src/locale/mi.json +306 -0
- package/src/locale/ms.json +306 -0
- package/src/locale/nb.json +306 -0
- package/src/locale/nl-be.json +306 -0
- package/src/locale/nl.json +306 -0
- package/src/locale/nn.json +306 -0
- package/src/locale/no.json +306 -0
- package/src/locale/pl.json +306 -0
- package/src/locale/pt-br.json +306 -0
- package/src/locale/pt.json +306 -0
- package/src/locale/ro.json +306 -0
- package/src/locale/ru.json +306 -0
- package/src/locale/sk.json +306 -0
- package/src/locale/sl.json +306 -0
- package/src/locale/sq.json +306 -0
- package/src/locale/sr.json +306 -0
- package/src/locale/sv.json +306 -0
- package/src/locale/th.json +306 -0
- package/src/locale/tl.json +306 -0
- package/src/locale/tr.json +306 -0
- package/src/locale/uk.json +306 -0
- package/src/locale/vi.json +306 -0
- package/src/locale/zh-hk.json +306 -0
- package/src/locale/zh-tw.json +306 -0
- package/src/locale/zh.json +306 -0
- package/src/locale/zu.json +306 -0
- package/src/native/OsanoCmp.ts +32 -0
- package/src/services/consent.ts +164 -0
- package/src/services/disclosures.ts +25 -0
- package/src/services/locale.ts +43 -0
- package/src/store.ts +602 -0
- package/src/styles.ts +203 -0
- package/src/types/consent-config.d.ts +72 -0
- package/src/types/env.d.ts +2 -0
- package/src/types/index.d.ts +18 -0
- package/src/types/store.d.ts +43 -0
- package/src/utils/API.ts +47 -0
- package/src/utils/Color.ts +127 -0
- package/src/utils/EventEmitter.ts +54 -0
- package/src/utils/Translator.ts +326 -0
- package/src/utils/index.ts +133 -0
- package/src/views/Dialog/Buttons.tsx +71 -0
- package/src/views/Dialog/FirstLayerUsage.tsx +33 -0
- package/src/views/Dialog/Message.tsx +37 -0
- package/src/views/Dialog/PreferenceManagementDeepLinks.tsx +33 -0
- package/src/views/Dialog/index.tsx +442 -0
- package/src/views/Drawer/Drawer.ConsentCategories.tsx +689 -0
- package/src/views/Drawer/Drawer.Header.tsx +138 -0
- package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +386 -0
- package/src/views/Drawer/Drawer.Iab.Vendors.tsx +552 -0
- package/src/views/Drawer/index.tsx +294 -0
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActivityIndicator,
|
|
3
|
+
FlatList,
|
|
4
|
+
type LayoutChangeEvent,
|
|
5
|
+
type ListRenderItemInfo,
|
|
6
|
+
Platform,
|
|
7
|
+
type StyleProp,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
Text,
|
|
10
|
+
type TextStyle,
|
|
11
|
+
View,
|
|
12
|
+
type ViewStyle,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import React, {
|
|
15
|
+
useCallback,
|
|
16
|
+
useContext,
|
|
17
|
+
useEffect,
|
|
18
|
+
useMemo,
|
|
19
|
+
useRef,
|
|
20
|
+
} from 'react';
|
|
21
|
+
import {
|
|
22
|
+
SHOW_DRAWER,
|
|
23
|
+
close,
|
|
24
|
+
getCategoryDisclosures,
|
|
25
|
+
getStack,
|
|
26
|
+
isCategoryAccepted,
|
|
27
|
+
isCategoryDisabled,
|
|
28
|
+
saveConsent,
|
|
29
|
+
showIabDisclosures,
|
|
30
|
+
showIabVendors,
|
|
31
|
+
toggleCategory,
|
|
32
|
+
toggleDisclosure,
|
|
33
|
+
toggleIabSpecialFeature,
|
|
34
|
+
} from '../../store';
|
|
35
|
+
import Translator, { type LocalizedStrings } from '../../utils/Translator';
|
|
36
|
+
|
|
37
|
+
import { Button } from '../../components/Button';
|
|
38
|
+
import { type Disclosure } from '../../types/store';
|
|
39
|
+
import { Divider } from '../../components/Divider';
|
|
40
|
+
import DrawerHeader from './Drawer.Header';
|
|
41
|
+
import { ExpansionPanel } from '../../components/ExpansionPanel';
|
|
42
|
+
import { Link } from '../../components/Link';
|
|
43
|
+
import Locale from '../../components/Locale';
|
|
44
|
+
import { OsanoPrivateContext } from '../../context';
|
|
45
|
+
import StoragePolicyLink from '../../components/StoragePolicyLink';
|
|
46
|
+
import Toggle from '../../components/Toggle';
|
|
47
|
+
import { purposeMap } from '../../iab/tcf/constants';
|
|
48
|
+
import useBoundCallback from '../../hooks/useBoundCallback';
|
|
49
|
+
import { usePrevious } from '../../hooks/usePrevious';
|
|
50
|
+
import {
|
|
51
|
+
type ConsentCategory as ConsentCategoryType,
|
|
52
|
+
ConsentCategory,
|
|
53
|
+
} from '../../constants';
|
|
54
|
+
|
|
55
|
+
type ConsentCategoryItem = {
|
|
56
|
+
type: 'info' | 'category' | 'specialFeature';
|
|
57
|
+
id: string;
|
|
58
|
+
headerHeight?: number;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type PurposeLinkItem = {
|
|
62
|
+
id: string | number;
|
|
63
|
+
style: StyleProp<TextStyle>;
|
|
64
|
+
onPress: () => void;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const Loading: React.FC = () => {
|
|
68
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
69
|
+
const { palette } = config || {};
|
|
70
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
71
|
+
return <ActivityIndicator size="small" color={infoDialogForegroundColor} />;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const TextDisclosure: React.FC<Disclosure> = props => {
|
|
75
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
76
|
+
const { palette } = config || {};
|
|
77
|
+
|
|
78
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
79
|
+
const drawerForeground = useMemo<StyleProp<TextStyle>>(() => {
|
|
80
|
+
return {
|
|
81
|
+
color: infoDialogForegroundColor,
|
|
82
|
+
fontSize: 12,
|
|
83
|
+
};
|
|
84
|
+
}, [infoDialogForegroundColor]);
|
|
85
|
+
|
|
86
|
+
const { name } = props;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<View style={styles.col}>
|
|
90
|
+
<View style={styles.row}>
|
|
91
|
+
<Text style={drawerForeground}>
|
|
92
|
+
<Locale path={name} />
|
|
93
|
+
</Text>
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const CookieDisclosure: React.FC<Disclosure & { last: boolean }> = props => {
|
|
100
|
+
const { config, locale } = useContext(OsanoPrivateContext);
|
|
101
|
+
const { palette } = config || {};
|
|
102
|
+
|
|
103
|
+
const isRTL = Translator.isRTL(locale);
|
|
104
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
105
|
+
const drawerForeground = useMemo<StyleProp<TextStyle>>(() => {
|
|
106
|
+
return {
|
|
107
|
+
color: infoDialogForegroundColor,
|
|
108
|
+
writingDirection:
|
|
109
|
+
Platform.OS !== 'web' ? (isRTL ? 'rtl' : 'ltr') : undefined,
|
|
110
|
+
fontSize: 12,
|
|
111
|
+
};
|
|
112
|
+
}, [infoDialogForegroundColor]);
|
|
113
|
+
|
|
114
|
+
const { name, expiry, provider, purpose, last } = props;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<View
|
|
118
|
+
style={[
|
|
119
|
+
styles.col,
|
|
120
|
+
styles.disclosure,
|
|
121
|
+
last ? styles.disclosureLast : undefined,
|
|
122
|
+
]}
|
|
123
|
+
>
|
|
124
|
+
<View
|
|
125
|
+
style={[
|
|
126
|
+
styles.row,
|
|
127
|
+
styles.spaceBetween,
|
|
128
|
+
isRTL ? styles.rtl : styles.ltr,
|
|
129
|
+
]}
|
|
130
|
+
>
|
|
131
|
+
<Text style={[drawerForeground, styles.disclosureLabel]}>
|
|
132
|
+
<Locale path="disclosure.cookie.name" />
|
|
133
|
+
</Text>
|
|
134
|
+
<Text style={[drawerForeground, styles.disclosureDescription]}>
|
|
135
|
+
{name}
|
|
136
|
+
</Text>
|
|
137
|
+
</View>
|
|
138
|
+
<View
|
|
139
|
+
style={[
|
|
140
|
+
styles.row,
|
|
141
|
+
styles.spaceBetween,
|
|
142
|
+
isRTL ? styles.rtl : styles.ltr,
|
|
143
|
+
]}
|
|
144
|
+
>
|
|
145
|
+
<Text style={[drawerForeground, styles.disclosureLabel]}>
|
|
146
|
+
<Locale path="disclosure.cookie.provider" />
|
|
147
|
+
</Text>
|
|
148
|
+
<Text style={[drawerForeground, styles.disclosureDescription]}>
|
|
149
|
+
{provider}
|
|
150
|
+
</Text>
|
|
151
|
+
</View>
|
|
152
|
+
<View
|
|
153
|
+
style={[
|
|
154
|
+
styles.row,
|
|
155
|
+
styles.spaceBetween,
|
|
156
|
+
isRTL ? styles.rtl : styles.ltr,
|
|
157
|
+
]}
|
|
158
|
+
>
|
|
159
|
+
<Text style={[drawerForeground, styles.disclosureLabel]}>
|
|
160
|
+
<Locale path="disclosure.cookie.expiry" />
|
|
161
|
+
</Text>
|
|
162
|
+
<Text style={[drawerForeground, styles.disclosureDescription]}>
|
|
163
|
+
{expiry}
|
|
164
|
+
</Text>
|
|
165
|
+
</View>
|
|
166
|
+
<View
|
|
167
|
+
style={[
|
|
168
|
+
styles.row,
|
|
169
|
+
styles.spaceBetween,
|
|
170
|
+
isRTL ? styles.rtl : styles.ltr,
|
|
171
|
+
]}
|
|
172
|
+
>
|
|
173
|
+
<Text style={[drawerForeground, styles.disclosureLabel]}>
|
|
174
|
+
<Locale path="disclosure.cookie.purpose" />
|
|
175
|
+
</Text>
|
|
176
|
+
<Text style={[drawerForeground, styles.disclosureDescription]}>
|
|
177
|
+
{purpose}
|
|
178
|
+
</Text>
|
|
179
|
+
</View>
|
|
180
|
+
</View>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const Disclosures: React.FC<{ category: ConsentCategoryType }> = props => {
|
|
185
|
+
const { getState, loadingDisclosures } = useContext(OsanoPrivateContext);
|
|
186
|
+
const { category } = props;
|
|
187
|
+
const state = getState();
|
|
188
|
+
// The following selector will return an empty array if the disclosures have not been fetched yet,
|
|
189
|
+
// otherwise it will return the disclosures for the given category, or a No Results disclosure
|
|
190
|
+
const categoryDisclosures = getCategoryDisclosures(state, category);
|
|
191
|
+
return (
|
|
192
|
+
<View style={styles.listItem}>
|
|
193
|
+
{!loadingDisclosures && categoryDisclosures.length > 0 ? (
|
|
194
|
+
categoryDisclosures.map((disclosure, i, list) => {
|
|
195
|
+
switch (disclosure.type) {
|
|
196
|
+
case 'cookie':
|
|
197
|
+
return (
|
|
198
|
+
<CookieDisclosure
|
|
199
|
+
key={i}
|
|
200
|
+
last={i === list.length - 1}
|
|
201
|
+
{...disclosure}
|
|
202
|
+
/>
|
|
203
|
+
);
|
|
204
|
+
default:
|
|
205
|
+
return <TextDisclosure key={i} {...disclosure} />;
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
) : (
|
|
209
|
+
<Loading />
|
|
210
|
+
)}
|
|
211
|
+
</View>
|
|
212
|
+
);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const PurposeLinkRenderer = ({ item }: ListRenderItemInfo<PurposeLinkItem>) => {
|
|
216
|
+
const { id, style, onPress } = item;
|
|
217
|
+
return (
|
|
218
|
+
<Link style={style} onPress={onPress}>
|
|
219
|
+
<Locale path={`iab.purposes.${id}.name`} />
|
|
220
|
+
</Link>
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const CategoryListItem: React.FC<{
|
|
225
|
+
category: ConsentCategoryType;
|
|
226
|
+
style: StyleProp<ViewStyle>;
|
|
227
|
+
}> = props => {
|
|
228
|
+
const { category } = props;
|
|
229
|
+
|
|
230
|
+
const { config, dispatch, getState, hideDisclosures, locale, translate } =
|
|
231
|
+
useContext(OsanoPrivateContext);
|
|
232
|
+
const { palette } = config || {};
|
|
233
|
+
|
|
234
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
235
|
+
const drawerForeground = useMemo<StyleProp<TextStyle>>(() => {
|
|
236
|
+
return {
|
|
237
|
+
color: infoDialogForegroundColor,
|
|
238
|
+
};
|
|
239
|
+
}, [infoDialogForegroundColor]);
|
|
240
|
+
const purposeLink = useMemo<StyleProp<TextStyle>>(() => {
|
|
241
|
+
return {
|
|
242
|
+
fontSize: 12,
|
|
243
|
+
lineHeight: 14,
|
|
244
|
+
marginBottom: 4,
|
|
245
|
+
textDecorationLine: 'none',
|
|
246
|
+
};
|
|
247
|
+
}, []);
|
|
248
|
+
const state = getState();
|
|
249
|
+
const useTcf = config?.tcfIsApplicable;
|
|
250
|
+
|
|
251
|
+
const descriptions = useMemo(() => {
|
|
252
|
+
const allDescriptions = (
|
|
253
|
+
`${translate(`categories.${category}.description`)}`.split('\n\n') || []
|
|
254
|
+
).map((d, i) => (
|
|
255
|
+
<Text key={i} style={[{ fontSize: 12 }, drawerForeground]}>
|
|
256
|
+
{d}
|
|
257
|
+
</Text>
|
|
258
|
+
));
|
|
259
|
+
return allDescriptions.length > 0 ? allDescriptions : null;
|
|
260
|
+
}, [drawerForeground]);
|
|
261
|
+
const purposes: PurposeLinkItem[] = useMemo(
|
|
262
|
+
() =>
|
|
263
|
+
((useTcf && purposeMap[`${category}`]) || []).map(purposeId => ({
|
|
264
|
+
id: purposeId,
|
|
265
|
+
style: purposeLink,
|
|
266
|
+
onPress: () =>
|
|
267
|
+
dispatch(showIabDisclosures({ id: purposeId, type: 'purpose' })),
|
|
268
|
+
})),
|
|
269
|
+
[dispatch, category, useTcf],
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
const ListHeaderComponent = useMemo(
|
|
273
|
+
() => (
|
|
274
|
+
<Text style={[drawerForeground, { fontSize: 14, marginBottom: 8 }]}>
|
|
275
|
+
<Locale path={`iab.basis.consent`} />
|
|
276
|
+
</Text>
|
|
277
|
+
),
|
|
278
|
+
[drawerForeground],
|
|
279
|
+
);
|
|
280
|
+
const checked = isCategoryAccepted(state, category);
|
|
281
|
+
const disabled = isCategoryDisabled(state, category);
|
|
282
|
+
const shouldHideDisclosures =
|
|
283
|
+
hideDisclosures || category === ConsentCategory.OPT_OUT;
|
|
284
|
+
const isRTL = Translator.isRTL(locale);
|
|
285
|
+
const toggleTextStyle = useMemo<StyleProp<TextStyle>>(() => {
|
|
286
|
+
return [drawerForeground, styles.toggleLabel];
|
|
287
|
+
}, [drawerForeground]);
|
|
288
|
+
const handleValueChange = useCallback((value: boolean) => {
|
|
289
|
+
dispatch(toggleCategory({ category, value }));
|
|
290
|
+
}, []);
|
|
291
|
+
const handleToggleDisclosure = useCallback(() => {
|
|
292
|
+
dispatch(
|
|
293
|
+
toggleDisclosure({
|
|
294
|
+
category,
|
|
295
|
+
configId: config?.configId,
|
|
296
|
+
customerId: config?.customerId,
|
|
297
|
+
}),
|
|
298
|
+
);
|
|
299
|
+
}, [config]);
|
|
300
|
+
return (
|
|
301
|
+
<View
|
|
302
|
+
style={{ flex: 1, alignItems: 'stretch', justifyContent: 'flex-start' }}
|
|
303
|
+
>
|
|
304
|
+
<View style={[styles.listItem, { flex: 1, paddingBottom: 24 }]}>
|
|
305
|
+
<View style={styles.row}>
|
|
306
|
+
<Toggle
|
|
307
|
+
align={isRTL ? 'left' : 'right'}
|
|
308
|
+
disabled={disabled}
|
|
309
|
+
onValueChange={handleValueChange}
|
|
310
|
+
style={styles.switch}
|
|
311
|
+
value={checked}
|
|
312
|
+
>
|
|
313
|
+
<Text style={toggleTextStyle}>
|
|
314
|
+
<Locale path={`categories.${category}.label`} />
|
|
315
|
+
</Text>
|
|
316
|
+
</Toggle>
|
|
317
|
+
</View>
|
|
318
|
+
{descriptions}
|
|
319
|
+
<FlatList
|
|
320
|
+
ListHeaderComponent={purposes.length ? ListHeaderComponent : null}
|
|
321
|
+
data={purposes}
|
|
322
|
+
renderItem={PurposeLinkRenderer}
|
|
323
|
+
style={{
|
|
324
|
+
marginTop: purposes.length ? 16 : 0,
|
|
325
|
+
}}
|
|
326
|
+
/>
|
|
327
|
+
</View>
|
|
328
|
+
{!shouldHideDisclosures ? (
|
|
329
|
+
<View style={{ marginTop: -24 }}>
|
|
330
|
+
<ExpansionPanel
|
|
331
|
+
title="messaging.viewCookies"
|
|
332
|
+
style={styles.listItem}
|
|
333
|
+
onOpen={handleToggleDisclosure}
|
|
334
|
+
>
|
|
335
|
+
<Disclosures category={category} />
|
|
336
|
+
</ExpansionPanel>
|
|
337
|
+
</View>
|
|
338
|
+
) : null}
|
|
339
|
+
</View>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const SpecialFeatureListItem: React.FC<{
|
|
344
|
+
specialFeatureId: string;
|
|
345
|
+
style: StyleProp<ViewStyle>;
|
|
346
|
+
}> = ({ specialFeatureId }) => {
|
|
347
|
+
const name = `iab.specialFeatures.${specialFeatureId}.name`;
|
|
348
|
+
const description = `iab.specialFeatures.${specialFeatureId}.description`;
|
|
349
|
+
const descriptionLegal = `iab.specialFeatures.${specialFeatureId}.descriptionLegal`;
|
|
350
|
+
const { config, dispatch, locale, translate } =
|
|
351
|
+
useContext(OsanoPrivateContext);
|
|
352
|
+
const { palette } = config || {};
|
|
353
|
+
|
|
354
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
355
|
+
const drawerForeground = useMemo(() => {
|
|
356
|
+
return {
|
|
357
|
+
color: infoDialogForegroundColor,
|
|
358
|
+
};
|
|
359
|
+
}, [infoDialogForegroundColor]);
|
|
360
|
+
const checked = config?.isIabSpecialFeatureAccepted(specialFeatureId);
|
|
361
|
+
const hasLegalDescription = useMemo(
|
|
362
|
+
() => translate(descriptionLegal) !== descriptionLegal,
|
|
363
|
+
[locale],
|
|
364
|
+
);
|
|
365
|
+
const isRTL = Translator.isRTL(locale);
|
|
366
|
+
const handleValueChange = useCallback((_value: boolean) => {
|
|
367
|
+
dispatch(toggleIabSpecialFeature(specialFeatureId));
|
|
368
|
+
}, []);
|
|
369
|
+
return (
|
|
370
|
+
<View>
|
|
371
|
+
<View style={[styles.row, styles.listItem]}>
|
|
372
|
+
<Toggle
|
|
373
|
+
align={isRTL ? 'left' : 'right'}
|
|
374
|
+
onValueChange={handleValueChange}
|
|
375
|
+
style={styles.switch}
|
|
376
|
+
value={checked}
|
|
377
|
+
>
|
|
378
|
+
<Text style={[drawerForeground, styles.toggleLabel]}>
|
|
379
|
+
<Locale path={name} />
|
|
380
|
+
</Text>
|
|
381
|
+
</Toggle>
|
|
382
|
+
</View>
|
|
383
|
+
<Text
|
|
384
|
+
style={[
|
|
385
|
+
styles.listItem,
|
|
386
|
+
drawerForeground,
|
|
387
|
+
hasLegalDescription ? {} : styles.paragraph,
|
|
388
|
+
]}
|
|
389
|
+
>
|
|
390
|
+
<Locale path={description} />
|
|
391
|
+
</Text>
|
|
392
|
+
{hasLegalDescription ? (
|
|
393
|
+
<ExpansionPanel style={styles.listItem} title="messaging.moreDetails">
|
|
394
|
+
<TextDisclosure type="text" name={descriptionLegal} />
|
|
395
|
+
</ExpansionPanel>
|
|
396
|
+
) : null}
|
|
397
|
+
</View>
|
|
398
|
+
);
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
const CategoryListHeader: React.FC<{ style: StyleProp<ViewStyle> }> = ({
|
|
402
|
+
style,
|
|
403
|
+
}) => {
|
|
404
|
+
const { config, dispatch } = useContext(OsanoPrivateContext);
|
|
405
|
+
const { palette } = config || {};
|
|
406
|
+
|
|
407
|
+
const { infoDialogForegroundColor } = palette || {};
|
|
408
|
+
const drawerForeground = useMemo<StyleProp<TextStyle>>(() => {
|
|
409
|
+
return {
|
|
410
|
+
color: infoDialogForegroundColor,
|
|
411
|
+
fontSize: 12,
|
|
412
|
+
lineHeight: 16,
|
|
413
|
+
};
|
|
414
|
+
}, [infoDialogForegroundColor]);
|
|
415
|
+
const handleGoIabVendors = useCallback(() => {
|
|
416
|
+
dispatch(showIabVendors());
|
|
417
|
+
}, []);
|
|
418
|
+
|
|
419
|
+
const handleGoIabDisclosures = useCallback(() => {
|
|
420
|
+
dispatch(showIabDisclosures());
|
|
421
|
+
}, []);
|
|
422
|
+
|
|
423
|
+
const useTcf = config?.tcfIsApplicable;
|
|
424
|
+
const policyLinkInDrawer = config?.policyLinkInDrawer;
|
|
425
|
+
|
|
426
|
+
const extraLinks = policyLinkInDrawer || useTcf;
|
|
427
|
+
return (
|
|
428
|
+
<View style={[styles.listItem, styles.listHeader, style]}>
|
|
429
|
+
<View style={extraLinks ? styles.paragraph : undefined}>
|
|
430
|
+
<Text style={drawerForeground}>
|
|
431
|
+
<Locale path="drawer.description" />
|
|
432
|
+
</Text>
|
|
433
|
+
</View>
|
|
434
|
+
{extraLinks ? (
|
|
435
|
+
<View>
|
|
436
|
+
{policyLinkInDrawer ? (
|
|
437
|
+
<Text>
|
|
438
|
+
<StoragePolicyLink />
|
|
439
|
+
</Text>
|
|
440
|
+
) : null}
|
|
441
|
+
{useTcf ? (
|
|
442
|
+
<Link onPress={handleGoIabVendors}>
|
|
443
|
+
<Locale path={'iab.vendor.title'} />
|
|
444
|
+
</Link>
|
|
445
|
+
) : null}
|
|
446
|
+
{useTcf ? (
|
|
447
|
+
<Link onPress={handleGoIabDisclosures}>
|
|
448
|
+
<Locale path={'iab.legal.title'} />
|
|
449
|
+
</Link>
|
|
450
|
+
) : null}
|
|
451
|
+
</View>
|
|
452
|
+
) : null}
|
|
453
|
+
</View>
|
|
454
|
+
);
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const CategoryListFooter: React.FC = () => {
|
|
458
|
+
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
459
|
+
|
|
460
|
+
const handleSave = useCallback(() => {
|
|
461
|
+
dispatch(saveConsent(cmp));
|
|
462
|
+
dispatch(close(cmp));
|
|
463
|
+
}, []);
|
|
464
|
+
|
|
465
|
+
return (
|
|
466
|
+
<View style={[styles.listItem, styles.listFooter]}>
|
|
467
|
+
<Button title="buttons.save" onPress={handleSave} />
|
|
468
|
+
<View style={styles.poweredBy}>
|
|
469
|
+
<Link href="https://www.osano.com/?utm_campaign=cmp&utm_source=cmp-dialog&utm_medium=drawer">
|
|
470
|
+
<Locale path="messaging.poweredBy" />
|
|
471
|
+
</Link>
|
|
472
|
+
</View>
|
|
473
|
+
</View>
|
|
474
|
+
);
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
const ListItemRenderer = ({
|
|
478
|
+
item,
|
|
479
|
+
index,
|
|
480
|
+
}: ListRenderItemInfo<ConsentCategoryItem>) => {
|
|
481
|
+
const { id, headerHeight, type } = item;
|
|
482
|
+
const style =
|
|
483
|
+
index === 0
|
|
484
|
+
? { paddingTop: Platform.OS === 'web' ? 0 : headerHeight }
|
|
485
|
+
: undefined;
|
|
486
|
+
|
|
487
|
+
switch (type) {
|
|
488
|
+
case 'info':
|
|
489
|
+
return <CategoryListHeader style={style} />;
|
|
490
|
+
case 'category':
|
|
491
|
+
return (
|
|
492
|
+
<CategoryListItem style={style} category={id as ConsentCategoryType} />
|
|
493
|
+
);
|
|
494
|
+
case 'specialFeature':
|
|
495
|
+
return <SpecialFeatureListItem style={style} specialFeatureId={id} />;
|
|
496
|
+
default:
|
|
497
|
+
return null;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export const ConsentCategoriesDrawer: React.FC = () => {
|
|
502
|
+
const { config, getState, locale, translate } =
|
|
503
|
+
useContext(OsanoPrivateContext);
|
|
504
|
+
const flatListRef: React.LegacyRef<FlatList<ConsentCategoryItem>> | null =
|
|
505
|
+
useRef(null);
|
|
506
|
+
|
|
507
|
+
const [headerHeight, setHeaderHeight] = React.useState(0);
|
|
508
|
+
const handleHeaderLayoutChange = useCallback((e: LayoutChangeEvent) => {
|
|
509
|
+
const height = e.nativeEvent.layout.height;
|
|
510
|
+
setHeaderHeight(height + (Platform.OS === 'web' ? 0 : 16));
|
|
511
|
+
}, []);
|
|
512
|
+
const scrollToTop = useBoundCallback((animated = false) => {
|
|
513
|
+
// use current
|
|
514
|
+
setTimeout(() => {
|
|
515
|
+
flatListRef.current?.scrollToOffset({ animated, offset: 0 });
|
|
516
|
+
}, 0);
|
|
517
|
+
}, []);
|
|
518
|
+
|
|
519
|
+
const ListHeaderComponent = useMemo(() => {
|
|
520
|
+
return (
|
|
521
|
+
<DrawerHeader
|
|
522
|
+
title="drawer.header"
|
|
523
|
+
canGoBack={false}
|
|
524
|
+
onHeaderLayoutChange={handleHeaderLayoutChange}
|
|
525
|
+
/>
|
|
526
|
+
);
|
|
527
|
+
}, [config, locale]);
|
|
528
|
+
|
|
529
|
+
const state = getState();
|
|
530
|
+
const stack = getStack(state);
|
|
531
|
+
const previousStack = usePrevious(stack);
|
|
532
|
+
const animateDirection = useMemo(() => {
|
|
533
|
+
if (previousStack) {
|
|
534
|
+
if (previousStack.length < stack.length) {
|
|
535
|
+
return 'in';
|
|
536
|
+
}
|
|
537
|
+
if (previousStack.length > stack.length) {
|
|
538
|
+
return 'out';
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return 'none';
|
|
542
|
+
}, [previousStack, stack]);
|
|
543
|
+
const useTcf = config?.tcfIsApplicable;
|
|
544
|
+
const needsOptOut = config?.shouldRenderOptOut;
|
|
545
|
+
const categories: ConsentCategoryItem[] = useMemo(() => {
|
|
546
|
+
const newCategories: ConsentCategoryItem[] = (
|
|
547
|
+
useTcf ? config.iabCategories : config?.categories || []
|
|
548
|
+
).map(category => {
|
|
549
|
+
return {
|
|
550
|
+
type: 'category',
|
|
551
|
+
id: category,
|
|
552
|
+
headerHeight,
|
|
553
|
+
};
|
|
554
|
+
});
|
|
555
|
+
if (needsOptOut) {
|
|
556
|
+
newCategories.push({
|
|
557
|
+
type: 'category',
|
|
558
|
+
id: ConsentCategory.OPT_OUT,
|
|
559
|
+
headerHeight,
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
if (useTcf) {
|
|
563
|
+
Object.keys(translate(`iab.specialFeatures`) as LocalizedStrings).map(
|
|
564
|
+
specialFeatureId =>
|
|
565
|
+
newCategories.push({
|
|
566
|
+
type: 'specialFeature',
|
|
567
|
+
id: specialFeatureId,
|
|
568
|
+
headerHeight,
|
|
569
|
+
}),
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
newCategories.unshift({
|
|
573
|
+
type: 'info',
|
|
574
|
+
id: 'info',
|
|
575
|
+
headerHeight,
|
|
576
|
+
});
|
|
577
|
+
return newCategories;
|
|
578
|
+
}, [config, useTcf, needsOptOut, headerHeight]);
|
|
579
|
+
|
|
580
|
+
const extraData = useMemo(() => {
|
|
581
|
+
return {};
|
|
582
|
+
}, [locale, state, headerHeight]);
|
|
583
|
+
|
|
584
|
+
useEffect(() => {
|
|
585
|
+
if (stack.indexOf(SHOW_DRAWER) === stack.length - 1) {
|
|
586
|
+
if (animateDirection !== 'out') {
|
|
587
|
+
scrollToTop();
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}, [stack, animateDirection]);
|
|
591
|
+
|
|
592
|
+
return (
|
|
593
|
+
<View style={styles.renderItem}>
|
|
594
|
+
{Platform.OS === 'web' ? null : ListHeaderComponent}
|
|
595
|
+
<FlatList
|
|
596
|
+
ref={flatListRef}
|
|
597
|
+
style={{ marginTop: Platform.OS === 'web' ? 0 : -headerHeight }}
|
|
598
|
+
data={categories}
|
|
599
|
+
stickyHeaderIndices={Platform.OS === 'web' ? [0] : undefined}
|
|
600
|
+
ListHeaderComponent={
|
|
601
|
+
Platform.OS === 'web' ? ListHeaderComponent : undefined
|
|
602
|
+
}
|
|
603
|
+
ListFooterComponent={CategoryListFooter}
|
|
604
|
+
renderItem={ListItemRenderer}
|
|
605
|
+
ItemSeparatorComponent={Divider}
|
|
606
|
+
removeClippedSubviews={false}
|
|
607
|
+
extraData={extraData}
|
|
608
|
+
/>
|
|
609
|
+
</View>
|
|
610
|
+
);
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
export default ConsentCategoriesDrawer;
|
|
614
|
+
|
|
615
|
+
const styles = StyleSheet.create({
|
|
616
|
+
poweredBy: {
|
|
617
|
+
alignItems: 'center',
|
|
618
|
+
justifyContent: 'center',
|
|
619
|
+
flexDirection: 'column',
|
|
620
|
+
fontWeight: '700',
|
|
621
|
+
marginVertical: 16,
|
|
622
|
+
},
|
|
623
|
+
switch: {
|
|
624
|
+
marginBottom: 8,
|
|
625
|
+
marginTop: 16,
|
|
626
|
+
width: '100%',
|
|
627
|
+
},
|
|
628
|
+
toggleLabel: {
|
|
629
|
+
flex: 1,
|
|
630
|
+
fontSize: 16,
|
|
631
|
+
flexWrap: 'wrap',
|
|
632
|
+
},
|
|
633
|
+
list: {},
|
|
634
|
+
renderItem: {
|
|
635
|
+
flex: 1,
|
|
636
|
+
flexDirection: 'column',
|
|
637
|
+
},
|
|
638
|
+
listHeader: {
|
|
639
|
+
paddingVertical: 32,
|
|
640
|
+
},
|
|
641
|
+
listFooter: {
|
|
642
|
+
paddingVertical: 32,
|
|
643
|
+
},
|
|
644
|
+
listItem: {
|
|
645
|
+
fontSize: 12,
|
|
646
|
+
paddingHorizontal: 24,
|
|
647
|
+
},
|
|
648
|
+
paragraph: {
|
|
649
|
+
marginBottom: 24,
|
|
650
|
+
},
|
|
651
|
+
row: {
|
|
652
|
+
flexDirection: 'row',
|
|
653
|
+
},
|
|
654
|
+
col: {
|
|
655
|
+
flexDirection: 'column',
|
|
656
|
+
},
|
|
657
|
+
disclosure: {
|
|
658
|
+
borderBottomColor: 'rgba(0,0,0,.1)',
|
|
659
|
+
borderBottomWidth: 1,
|
|
660
|
+
marginBottom: 16,
|
|
661
|
+
paddingBottom: 16,
|
|
662
|
+
},
|
|
663
|
+
disclosureLast: {
|
|
664
|
+
borderBottomWidth: 0,
|
|
665
|
+
marginBottom: 0,
|
|
666
|
+
paddingBottom: 0,
|
|
667
|
+
},
|
|
668
|
+
disclosureLabel: {
|
|
669
|
+
flexShrink: 0,
|
|
670
|
+
fontWeight: 'bold',
|
|
671
|
+
width: '30%',
|
|
672
|
+
},
|
|
673
|
+
disclosureDescription: {
|
|
674
|
+
flexWrap:'wrap',
|
|
675
|
+
width: '70%'
|
|
676
|
+
},
|
|
677
|
+
spaceBetween: {
|
|
678
|
+
gap: 8,
|
|
679
|
+
justifyContent: 'flex-start',
|
|
680
|
+
},
|
|
681
|
+
rtl: {
|
|
682
|
+
writingDirection: 'rtl',
|
|
683
|
+
flexDirection: 'row-reverse',
|
|
684
|
+
},
|
|
685
|
+
ltr: {
|
|
686
|
+
writingDirection: 'ltr',
|
|
687
|
+
flexDirection: 'row',
|
|
688
|
+
},
|
|
689
|
+
});
|