@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,345 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CMPEventStatus,
|
|
3
|
+
CMPStatusCodes,
|
|
4
|
+
DisplayStatusCodes,
|
|
5
|
+
consentToPurpose,
|
|
6
|
+
} from './constants';
|
|
7
|
+
import { Locale, ScreenIds } from '../../constants';
|
|
8
|
+
import {
|
|
9
|
+
doesGDPRApply,
|
|
10
|
+
getConsentString,
|
|
11
|
+
getCurrentScreen,
|
|
12
|
+
getPublisherCountryCode,
|
|
13
|
+
getPurposeConsents,
|
|
14
|
+
getPurposeOptOuts,
|
|
15
|
+
getPurposesLITransparency,
|
|
16
|
+
getSpecialFeatureOptIns,
|
|
17
|
+
getStore,
|
|
18
|
+
getVendorListVersion,
|
|
19
|
+
getVendorOptOuts,
|
|
20
|
+
getVendors,
|
|
21
|
+
hasActed,
|
|
22
|
+
} from './selectors';
|
|
23
|
+
import { get, merge, set } from '../../utils';
|
|
24
|
+
import {
|
|
25
|
+
getConsent,
|
|
26
|
+
getSavedConsent,
|
|
27
|
+
isConsentReady,
|
|
28
|
+
isSaved,
|
|
29
|
+
} from '../../redux/selectors';
|
|
30
|
+
|
|
31
|
+
export const commonConsent = {
|
|
32
|
+
consentLanguage: 'en',
|
|
33
|
+
cmpLoaded: true,
|
|
34
|
+
cmpStatus: CMPStatusCodes.LOADED, // TODO: async CMP load
|
|
35
|
+
eventStatus: CMPEventStatus.TC_LOADED, // TODO: async CMP load
|
|
36
|
+
isServiceSpecific: true,
|
|
37
|
+
useNonStandardStacks: true,
|
|
38
|
+
purposeOneTreatment: false,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const getVendorConsents = (state, apiVersion) => {
|
|
42
|
+
const vendors = getVendors(state, apiVersion);
|
|
43
|
+
/*
|
|
44
|
+
* Unless a user has specifically opted out of a vendor, the consent
|
|
45
|
+
* is determined by purposes and specialFeatures.
|
|
46
|
+
*/
|
|
47
|
+
const optOutVendors = getVendorOptOuts(state, apiVersion);
|
|
48
|
+
/*
|
|
49
|
+
* Vendors may process your information based on purpose consent.
|
|
50
|
+
* If the user has consented to any vendor's purposes the consent
|
|
51
|
+
* is marked as true.
|
|
52
|
+
*/
|
|
53
|
+
const purposeConsent = consentToPurpose(
|
|
54
|
+
getSavedConsent(state) || getConsent(state),
|
|
55
|
+
apiVersion,
|
|
56
|
+
);
|
|
57
|
+
const consents = Object.entries(vendors).reduce(
|
|
58
|
+
(vendorConsents, [vendorId, { purposes = [], deletedDate } = {}]) => {
|
|
59
|
+
// We also need to apply IAB rules found here:
|
|
60
|
+
// https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
|
|
61
|
+
// These may need to be updated from time to time.
|
|
62
|
+
|
|
63
|
+
// Note that flexiblePurposes only matter if we support publisher
|
|
64
|
+
// restrictions, which we currently do not. They must have a vendor
|
|
65
|
+
// default (the purpose must be in either consents or
|
|
66
|
+
// legitimateInterests as well as flexiblePurposes) so we will
|
|
67
|
+
// respect that default.
|
|
68
|
+
|
|
69
|
+
// If the vendor has been deleted or the user has opted out of the
|
|
70
|
+
// vendor then the vendor should not be included in consents.
|
|
71
|
+
if (!deletedDate && !optOutVendors[`${vendorId}`]) {
|
|
72
|
+
const vendorHasConsent =
|
|
73
|
+
// If all indicated purposes have been consented to
|
|
74
|
+
purposes.length > 0 &&
|
|
75
|
+
purposes.every(purposeId => purposeConsent[`${purposeId}`]);
|
|
76
|
+
if (vendorHasConsent) {
|
|
77
|
+
vendorConsents[`${vendorId}`] = !optOutVendors[`${vendorId}`];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return vendorConsents;
|
|
81
|
+
},
|
|
82
|
+
{},
|
|
83
|
+
);
|
|
84
|
+
return consents;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const getVendorLegitimateInterests = (state, apiVersion) => {
|
|
88
|
+
/*
|
|
89
|
+
* Unless a use has specifically opted out of a vendor, the consent
|
|
90
|
+
* is determined by LI.
|
|
91
|
+
*/
|
|
92
|
+
const optOutVendors = getVendorOptOuts(state, apiVersion);
|
|
93
|
+
/*
|
|
94
|
+
* Vendors may have specific legitimate interest purposes.
|
|
95
|
+
* If the user has not objected to the LI purpose, it is
|
|
96
|
+
* marked as true.
|
|
97
|
+
*/
|
|
98
|
+
const optOutPurposes = getPurposeOptOuts(state, apiVersion);
|
|
99
|
+
const vendors = getVendors(state, apiVersion);
|
|
100
|
+
const vendorLegitimateInterests = {};
|
|
101
|
+
Object.entries(vendors).forEach(
|
|
102
|
+
([
|
|
103
|
+
vendorId,
|
|
104
|
+
{
|
|
105
|
+
legIntPurposes = [],
|
|
106
|
+
purposes = [],
|
|
107
|
+
specialPurposes = [],
|
|
108
|
+
deletedDate,
|
|
109
|
+
} = {},
|
|
110
|
+
]) => {
|
|
111
|
+
// We also need to apply IAB rules found here:
|
|
112
|
+
// https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
|
|
113
|
+
// These may need to be updated from time to time.
|
|
114
|
+
|
|
115
|
+
// Note that flexiblePurposes only matter if we support publisher
|
|
116
|
+
// restrictions, which we currently do not. They must have a vendor
|
|
117
|
+
// default (the purpose must be in either consents or
|
|
118
|
+
// legitimateInterests as well as flexiblePurposes) so we will
|
|
119
|
+
// respect that default.
|
|
120
|
+
|
|
121
|
+
// If the vendor has been deleted or the user has opted out of the
|
|
122
|
+
// vendor then the vendor should not be included in LI.
|
|
123
|
+
if (!deletedDate && !optOutVendors[`${vendorId}`]) {
|
|
124
|
+
const vendorHasLegitimateInterest =
|
|
125
|
+
// If any legIntPurposes is not opted out
|
|
126
|
+
(legIntPurposes &&
|
|
127
|
+
legIntPurposes.some(
|
|
128
|
+
purposeId => !optOutPurposes[`${purposeId}`],
|
|
129
|
+
)) ||
|
|
130
|
+
/**
|
|
131
|
+
* Per June 2021 Policy change, Vendors declaring only
|
|
132
|
+
* Special Purposes must have their legitimate interest
|
|
133
|
+
* Vendor bit set if they have been disclosed.
|
|
134
|
+
*/
|
|
135
|
+
(purposes.length === 0 &&
|
|
136
|
+
legIntPurposes.length === 0 &&
|
|
137
|
+
specialPurposes.length > 0);
|
|
138
|
+
if (vendorHasLegitimateInterest) {
|
|
139
|
+
vendorLegitimateInterests[`${vendorId}`] = true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
);
|
|
144
|
+
return vendorLegitimateInterests;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const makeParseConsentString = initOptions => tcString => {
|
|
148
|
+
const {
|
|
149
|
+
encoder: { decode },
|
|
150
|
+
coreFieldSequence,
|
|
151
|
+
version,
|
|
152
|
+
cmpId,
|
|
153
|
+
cmpVersion,
|
|
154
|
+
specFieldMode = false,
|
|
155
|
+
} = initOptions;
|
|
156
|
+
const segments = tcString.split('.');
|
|
157
|
+
const coreSegment = decode(segments[0]);
|
|
158
|
+
const tcData = specFieldMode
|
|
159
|
+
? {}
|
|
160
|
+
: {
|
|
161
|
+
...commonConsent,
|
|
162
|
+
cmpId,
|
|
163
|
+
cmpVersion,
|
|
164
|
+
consentLanguage: Locale.locale.slice(0, 2).toUpperCase(),
|
|
165
|
+
tcfPolicyVersion: parseInt(version, 10),
|
|
166
|
+
};
|
|
167
|
+
coreFieldSequence.reduce(
|
|
168
|
+
(startBit, [field, numBits, { decode: decodeField }, dataField]) => {
|
|
169
|
+
const value = isFinite(numBits)
|
|
170
|
+
? coreSegment.slice(startBit, startBit + numBits)
|
|
171
|
+
: // It's a non-fixed vector, so we need to use rest of the segment
|
|
172
|
+
coreSegment.slice(startBit);
|
|
173
|
+
|
|
174
|
+
const { bitLength, value: decodedValue } = decodeField(value, numBits);
|
|
175
|
+
|
|
176
|
+
// The TCF string spec uses PascalCase names for fields, but the TCData object uses camelCase
|
|
177
|
+
// Reference: https://github.com/IABTechLab/iabgpp-es/blob/42060d7ac2b6d0ee70fc1b5bcd33fc447bf5123c/modules/cmpapi/src/encoder/field/TcfEuV2Field.ts
|
|
178
|
+
const fieldName = specFieldMode
|
|
179
|
+
? field[0].toUpperCase() + field.substring(1) // Capitalize first letter
|
|
180
|
+
: dataField || field;
|
|
181
|
+
set(tcData, fieldName, decodedValue);
|
|
182
|
+
return startBit + bitLength;
|
|
183
|
+
},
|
|
184
|
+
0,
|
|
185
|
+
);
|
|
186
|
+
return tcData;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const makeGetField = initOptions => {
|
|
190
|
+
const parseConsentString = makeParseConsentString({
|
|
191
|
+
...initOptions,
|
|
192
|
+
specFieldMode: true,
|
|
193
|
+
});
|
|
194
|
+
return (tcString, requestedField) =>
|
|
195
|
+
get(tcString ? parseConsentString(tcString) : {}, requestedField);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* TCFAPI consentFromOptions implementation
|
|
200
|
+
* @function
|
|
201
|
+
* @param {import('./constants').IABInitOptions} initOptions
|
|
202
|
+
* @returns {import('./constants').TCDataDeterminateField} Properly formatted TCData object
|
|
203
|
+
*/
|
|
204
|
+
export const makeConsentFromOptions =
|
|
205
|
+
({
|
|
206
|
+
version = '2.0',
|
|
207
|
+
cmpId,
|
|
208
|
+
cmpVersion,
|
|
209
|
+
fallbackGvlVersion,
|
|
210
|
+
gppSection,
|
|
211
|
+
staticFields,
|
|
212
|
+
dynamicFields = {},
|
|
213
|
+
}) =>
|
|
214
|
+
(data = {}, state) => {
|
|
215
|
+
const { gdprApplies } = merge(getStore(state), data);
|
|
216
|
+
const publisherCC = getPublisherCountryCode(state);
|
|
217
|
+
const currentScreen = getCurrentScreen(state);
|
|
218
|
+
const isShowingUi = currentScreen !== ScreenIds.None;
|
|
219
|
+
const willShowUi = !isSaved(state) || isShowingUi;
|
|
220
|
+
const cmpStatus = isConsentReady(state)
|
|
221
|
+
? CMPStatusCodes.LOADED
|
|
222
|
+
: CMPStatusCodes.STUB;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The vendor list version should be in the customer's config because
|
|
226
|
+
* it's tied to their selected vendors. If it's not there, we don't have
|
|
227
|
+
* a way to know what it should be. The TCF spec doesn't cover this case
|
|
228
|
+
* and we can't encode 'undefined', so we'll use a fallback version.
|
|
229
|
+
*/
|
|
230
|
+
const gvlVersion =
|
|
231
|
+
getVendorListVersion(state, version) || fallbackGvlVersion;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Since `consentFromOptions` is used for multiple callbacks, all TCDataDeterminateField
|
|
235
|
+
* values should be set here.
|
|
236
|
+
*/
|
|
237
|
+
const dynamicConsent = Object.entries(dynamicFields).reduce(
|
|
238
|
+
(acc, [field, getter]) => {
|
|
239
|
+
acc[`${field}`] = getter(data, state);
|
|
240
|
+
return acc;
|
|
241
|
+
},
|
|
242
|
+
{},
|
|
243
|
+
);
|
|
244
|
+
return {
|
|
245
|
+
version: staticFields.version,
|
|
246
|
+
...commonConsent,
|
|
247
|
+
...dynamicConsent,
|
|
248
|
+
cmpLoaded: cmpStatus === CMPStatusCodes.LOADED,
|
|
249
|
+
cmpStatus,
|
|
250
|
+
eventStatus: willShowUi
|
|
251
|
+
? CMPEventStatus.CMP_UI_SHOWN
|
|
252
|
+
: hasActed(state, gppSection)
|
|
253
|
+
? CMPEventStatus.USER_ACTION_COMPLETE
|
|
254
|
+
: CMPEventStatus.TC_LOADED,
|
|
255
|
+
currentScreen,
|
|
256
|
+
displayStatus: isShowingUi
|
|
257
|
+
? DisplayStatusCodes.VISIBLE
|
|
258
|
+
: DisplayStatusCodes.HIDDEN,
|
|
259
|
+
cmpId,
|
|
260
|
+
cmpVersion,
|
|
261
|
+
gvlVersion,
|
|
262
|
+
consentLanguage: Locale.locale.slice(0, 2).toUpperCase(),
|
|
263
|
+
publisherCC,
|
|
264
|
+
tcfPolicyVersion: staticFields.tcfPolicyVersion,
|
|
265
|
+
gdprApplies:
|
|
266
|
+
gdprApplies !== undefined ? gdprApplies : doesGDPRApply(state),
|
|
267
|
+
vendor: {
|
|
268
|
+
consents: getVendorConsents(state, version),
|
|
269
|
+
legitimateInterests: getVendorLegitimateInterests(state, version),
|
|
270
|
+
},
|
|
271
|
+
specialFeatureOptins: getSpecialFeatureOptIns(state, version),
|
|
272
|
+
purpose: {
|
|
273
|
+
consents: getPurposeConsents(state, version),
|
|
274
|
+
legitimateInterests: getPurposesLITransparency(state, version),
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* TCFAPI formatConsentString implementation
|
|
281
|
+
* @function
|
|
282
|
+
* @param {Object} data
|
|
283
|
+
* @returns {string} Properly formatted TCFData string
|
|
284
|
+
*/
|
|
285
|
+
export const makeFormatConsentString = initOptions => (data, state) => {
|
|
286
|
+
const {
|
|
287
|
+
encoder: { encode },
|
|
288
|
+
coreFieldSequence,
|
|
289
|
+
staticFields,
|
|
290
|
+
} = initOptions;
|
|
291
|
+
const tcData = makeConsentFromOptions(initOptions)(data, state);
|
|
292
|
+
const segments = getConsentString(state, initOptions).split('.');
|
|
293
|
+
// Only update the CORE string
|
|
294
|
+
segments.shift();
|
|
295
|
+
const [bitFields] = coreFieldSequence.reduce(
|
|
296
|
+
(
|
|
297
|
+
[bitString, startBit],
|
|
298
|
+
[key, numBits, { encode: encodeField }, dataField = key],
|
|
299
|
+
) => {
|
|
300
|
+
let value;
|
|
301
|
+
if (Object.hasOwnProperty.call(staticFields, dataField)) {
|
|
302
|
+
// We should skip this field
|
|
303
|
+
const staticValue = staticFields[`${dataField}`];
|
|
304
|
+
value = staticValue;
|
|
305
|
+
} else {
|
|
306
|
+
value = get(tcData, dataField);
|
|
307
|
+
}
|
|
308
|
+
const encodedValue = encodeField(value, numBits);
|
|
309
|
+
return [bitString + encodedValue, startBit + encodedValue.length];
|
|
310
|
+
},
|
|
311
|
+
['', 0],
|
|
312
|
+
);
|
|
313
|
+
const newCoreString = encode(bitFields);
|
|
314
|
+
segments.unshift(newCoreString);
|
|
315
|
+
return segments.join('.');
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* TCFAPI getConsentDataObject implementation
|
|
320
|
+
* @function
|
|
321
|
+
* @param {number} version
|
|
322
|
+
* @returns {import('./constants').TCData} Properly formatted TCData object
|
|
323
|
+
*/
|
|
324
|
+
export const makeGetConsentDataObject = initOptions => state => {
|
|
325
|
+
const { defaultTimestamp, version } = initOptions;
|
|
326
|
+
switch (parseInt(version, 10)) {
|
|
327
|
+
// Supported versions
|
|
328
|
+
case 2: {
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
default: {
|
|
333
|
+
throw new Error('Unsupported version');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// `defaultTimestamp` will be used for the created and lastUpdated fields if
|
|
338
|
+
// a consent timestamp is not available yet.
|
|
339
|
+
const data = { defaultTimestamp };
|
|
340
|
+
|
|
341
|
+
return {
|
|
342
|
+
...makeConsentFromOptions(initOptions)(data, state),
|
|
343
|
+
tcString: makeFormatConsentString(initOptions)(data, state),
|
|
344
|
+
};
|
|
345
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ConsentCategory as ConsentCategoryType,
|
|
3
|
+
ConsentCategory,
|
|
4
|
+
} from '../../constants';
|
|
5
|
+
|
|
6
|
+
export const CMPEventStatus = {
|
|
7
|
+
TC_LOADED: 'tcloaded',
|
|
8
|
+
CMP_UI_SHOWN: 'cmpuishown',
|
|
9
|
+
USER_ACTION_COMPLETE: 'useractioncomplete',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const CMPStatusCodes = {
|
|
13
|
+
STUB: 'stub',
|
|
14
|
+
LOADED: 'loaded',
|
|
15
|
+
ERROR: 'error',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DisplayStatusCodes = {
|
|
19
|
+
VISIBLE: 'visible',
|
|
20
|
+
HIDDEN: 'hidden',
|
|
21
|
+
DISABLED: 'disabled',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const purposeIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
25
|
+
export const purposeMap: Record<ConsentCategoryType, number[]> = {
|
|
26
|
+
[ConsentCategory.ESSENTIAL]: [],
|
|
27
|
+
[ConsentCategory.ANALYTICS]: [8, 10],
|
|
28
|
+
[ConsentCategory.STORAGE]: [1],
|
|
29
|
+
[ConsentCategory.MARKETING]: [2, 7, 9],
|
|
30
|
+
[ConsentCategory.PERSONALIZATION]: [3, 4, 5, 6],
|
|
31
|
+
[ConsentCategory.OPT_OUT]: [],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const consentToPurpose = (
|
|
35
|
+
consent: Partial<Record<ConsentCategoryType, boolean>> = {},
|
|
36
|
+
apiVersion = '2',
|
|
37
|
+
) => {
|
|
38
|
+
if (parseInt(apiVersion, 10) <= 2) {
|
|
39
|
+
return Object.entries(purposeMap).reduce(
|
|
40
|
+
(consents, [category, purposes]) => {
|
|
41
|
+
purposes.forEach(purpose => {
|
|
42
|
+
consents[`${purpose}`] =
|
|
43
|
+
!!consent[`${category as ConsentCategoryType}`];
|
|
44
|
+
});
|
|
45
|
+
return consents;
|
|
46
|
+
},
|
|
47
|
+
{} as Record<number, boolean>,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {};
|
|
51
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { types as ActionTypes } from '../../redux/actions';
|
|
2
|
+
import { genericReducer } from '../../redux/helpers';
|
|
3
|
+
import { merge } from '../../utils';
|
|
4
|
+
import { setGdprApplies } from './actions';
|
|
5
|
+
import { initialState as v2_initialState } from './v2.0/reducer';
|
|
6
|
+
|
|
7
|
+
export const initialState = merge({}, v2_initialState);
|
|
8
|
+
|
|
9
|
+
const updateOptions = (state, options) => {
|
|
10
|
+
const { config } = options || {};
|
|
11
|
+
const {
|
|
12
|
+
config: {
|
|
13
|
+
gdprApplies: providedGdprApplies,
|
|
14
|
+
iabEnabled: providedIABEnabled,
|
|
15
|
+
} = {},
|
|
16
|
+
} = state;
|
|
17
|
+
const { gdprApplies = providedGdprApplies, iabEnabled = providedIABEnabled } =
|
|
18
|
+
config || {};
|
|
19
|
+
const newState = merge(
|
|
20
|
+
{ ...state },
|
|
21
|
+
{
|
|
22
|
+
iab: {
|
|
23
|
+
tcf: {
|
|
24
|
+
enabled:
|
|
25
|
+
typeof iabEnabled === 'string'
|
|
26
|
+
? iabEnabled === 'true'
|
|
27
|
+
: !!iabEnabled,
|
|
28
|
+
gdprApplies:
|
|
29
|
+
typeof gdprApplies === 'string'
|
|
30
|
+
? gdprApplies === 'true'
|
|
31
|
+
: !!gdprApplies,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
return newState;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default genericReducer(initialState, {
|
|
40
|
+
[ActionTypes.init]: updateOptions,
|
|
41
|
+
[ActionTypes.updateConfig]: (state, config) =>
|
|
42
|
+
updateOptions(state, { config }),
|
|
43
|
+
[setGdprApplies.type]: (state, gdprApplies) => {
|
|
44
|
+
const newState = merge(
|
|
45
|
+
{ ...state },
|
|
46
|
+
{
|
|
47
|
+
iab: {
|
|
48
|
+
tcf: {
|
|
49
|
+
gdprApplies:
|
|
50
|
+
typeof gdprApplies === 'string'
|
|
51
|
+
? gdprApplies === 'true'
|
|
52
|
+
: !!gdprApplies,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
return newState;
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { consentToPurpose, purposeIds } from './constants';
|
|
2
|
+
import {
|
|
3
|
+
getConsent,
|
|
4
|
+
getCountryCode,
|
|
5
|
+
getSavedConsent,
|
|
6
|
+
} from '../../redux/selectors';
|
|
7
|
+
|
|
8
|
+
import { GDPR_COUNTRIES } from '@osano-cmp';
|
|
9
|
+
import { ScreenIds } from '../../constants';
|
|
10
|
+
import { get } from '../../utils';
|
|
11
|
+
import { isBrowsingFrom } from '../gpp/selectors';
|
|
12
|
+
|
|
13
|
+
export const DOMAIN = 'iab.tcf';
|
|
14
|
+
|
|
15
|
+
export const isIABEnabled = state => !!get(state, 'config.iabEnabled');
|
|
16
|
+
|
|
17
|
+
export const getStore = state => get(state, DOMAIN, {});
|
|
18
|
+
export const getApiData = (state, apiVersion = 2) =>
|
|
19
|
+
get(getStore(state), [`v${parseInt(apiVersion, 10)}`], {});
|
|
20
|
+
|
|
21
|
+
export const getCurrentScreen = state =>
|
|
22
|
+
get(state, 'ui.currentScreen', ScreenIds.None);
|
|
23
|
+
|
|
24
|
+
// Expects that `iab.tcf.gdprApplies` will always be a boolean under real usage.
|
|
25
|
+
// The fallback (`GDPR_COUNTRIES.includes`) is meant ONLY for preview (webapp).
|
|
26
|
+
export const doesGDPRApply = state =>
|
|
27
|
+
!!get(
|
|
28
|
+
getStore(state),
|
|
29
|
+
'gdprApplies',
|
|
30
|
+
GDPR_COUNTRIES.includes(getCountryCode(state)),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export const getConsentLanguage = state => {
|
|
34
|
+
return get(state, 'config.lang', 'en').slice(0, 2).toUpperCase();
|
|
35
|
+
};
|
|
36
|
+
export const getConsentString = (state, { gppSection, tcString }) => {
|
|
37
|
+
return get(state, ['iab', 'consentStrings', gppSection], tcString);
|
|
38
|
+
};
|
|
39
|
+
export const getPublisherCountryCode = state =>
|
|
40
|
+
// This must be a Two-Letter code
|
|
41
|
+
(
|
|
42
|
+
get(getStore(state), 'publisherCC') ||
|
|
43
|
+
getCountryCode(state) ||
|
|
44
|
+
'US'
|
|
45
|
+
).toUpperCase();
|
|
46
|
+
|
|
47
|
+
// API Specific Data
|
|
48
|
+
export const getPublisherLegitimateInterests = (/* state, apiVersion */) => {
|
|
49
|
+
// Placeholder
|
|
50
|
+
return {};
|
|
51
|
+
};
|
|
52
|
+
export const getPurposeIds = () => [...purposeIds];
|
|
53
|
+
export const getPurposeOptOuts = (state, apiVersion) =>
|
|
54
|
+
get(getApiData(state, apiVersion), 'purposeOptouts') || {};
|
|
55
|
+
export const getPurposeConsents = (state, apiVersion) => {
|
|
56
|
+
const consent = getSavedConsent(state) || getConsent(state);
|
|
57
|
+
const optOutPurposes = getPurposeOptOuts(state, apiVersion);
|
|
58
|
+
return Object.entries(consentToPurpose(consent, apiVersion)).reduce(
|
|
59
|
+
(purposeConsents, [purposeId, hasConsented]) => {
|
|
60
|
+
purposeConsents[`${purposeId}`] =
|
|
61
|
+
hasConsented && !optOutPurposes[`${purposeId}`];
|
|
62
|
+
return purposeConsents;
|
|
63
|
+
},
|
|
64
|
+
{},
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
// Established legitimate interest per purpose
|
|
68
|
+
export const getPurposesLITransparency = (state, apiVersion) => {
|
|
69
|
+
/*
|
|
70
|
+
* PurposesLITransparency
|
|
71
|
+
* For the purposes of a TCString, this indicates that the end user
|
|
72
|
+
* has been given notification of the consent purposes and the
|
|
73
|
+
* opportunity to accept or deny them, or object individually.
|
|
74
|
+
*/
|
|
75
|
+
const purposeConsents = getPurposeConsents(state, apiVersion);
|
|
76
|
+
const purposeLITransparency = {};
|
|
77
|
+
const optOutPurposes = getPurposeOptOuts(state, apiVersion);
|
|
78
|
+
Object.entries(purposeConsents).forEach(([purposeId]) => {
|
|
79
|
+
// We are only indicating that the user has been given transparency
|
|
80
|
+
if (!optOutPurposes[`${purposeId}`]) {
|
|
81
|
+
// If a user has not specifically objected, we mark the purpose true
|
|
82
|
+
purposeLITransparency[`${purposeId}`] = true;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Purpose 1 is never allowed to be true for legitimate interest transparency
|
|
87
|
+
*/
|
|
88
|
+
delete purposeLITransparency[`${1}`];
|
|
89
|
+
return purposeLITransparency;
|
|
90
|
+
};
|
|
91
|
+
export const getSpecialFeatureOptIns = (state, apiVersion) =>
|
|
92
|
+
get(getApiData(state, apiVersion), 'specialFeatureOptins') || {};
|
|
93
|
+
export const getVendors = (state, apiVersion) =>
|
|
94
|
+
get(getApiData(state, apiVersion), 'vendors') || {};
|
|
95
|
+
export const getVendorData = (state, { apiVersion, vendorId }) =>
|
|
96
|
+
get(getVendors(state, apiVersion), `${vendorId}`) || {};
|
|
97
|
+
export const getVendorIds = (state, apiVersion) =>
|
|
98
|
+
Object.keys(getVendors(state, apiVersion)).map(vendorId =>
|
|
99
|
+
parseInt(vendorId, 10),
|
|
100
|
+
) || [];
|
|
101
|
+
export const getVendorOptOuts = (state, apiVersion) =>
|
|
102
|
+
get(getApiData(state, apiVersion), 'vendorOptouts') || {};
|
|
103
|
+
export const getVendorListError = (state, apiVersion) =>
|
|
104
|
+
get(getApiData(state, apiVersion), 'vendorListError', 0);
|
|
105
|
+
export const getVendorListVersion = (state, apiVersion) =>
|
|
106
|
+
get(getApiData(state, apiVersion), 'vendorListVersion');
|
|
107
|
+
|
|
108
|
+
// This is the same value as v2.0/constants.js/gppSection but duplicating it
|
|
109
|
+
// prevents having to import that file which keeps the bundle size a lot
|
|
110
|
+
// smaller.
|
|
111
|
+
const TCF_GPP_SECTION = 'tcfeuv2';
|
|
112
|
+
export const getStorageConsent = state => {
|
|
113
|
+
return {
|
|
114
|
+
iab: {
|
|
115
|
+
v2: {
|
|
116
|
+
p: getPurposeOptOuts(state, '2.0'),
|
|
117
|
+
v: getVendorOptOuts(state, '2.0'),
|
|
118
|
+
},
|
|
119
|
+
// If we rename this property, we need to update the reducer
|
|
120
|
+
// (src/iab/tcf/v2.0/reducer.js) for `setConsent` which extracts it
|
|
121
|
+
// so that we honor previously-saved values.
|
|
122
|
+
euconsent: getConsentString(state, { gppSection: TCF_GPP_SECTION }),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Indicates if any action has been taken by the user in regards to consent
|
|
129
|
+
*
|
|
130
|
+
* @param {import('../../redux/selectors.js').ReduxState} state
|
|
131
|
+
* @param {string} gppSection The gppSection location in Redux that we store the TCString in.
|
|
132
|
+
* @returns {boolean} TRUE if a consent action has been taken, FALSE if it has not
|
|
133
|
+
*/
|
|
134
|
+
export const hasActed = (state, gppSection) =>
|
|
135
|
+
!!get(state, ['iab', 'hasActed', gppSection]);
|
|
136
|
+
export const hasConsentedToSpecialFeature = (
|
|
137
|
+
state,
|
|
138
|
+
{ apiVersion, specialFeatureId },
|
|
139
|
+
) => !!getSpecialFeatureOptIns(state, apiVersion)[`${specialFeatureId}`];
|
|
140
|
+
export const hasOptedOutOfVendor = (state, { apiVersion, vendorId }) =>
|
|
141
|
+
!!getVendorOptOuts(state, apiVersion)[`${vendorId}`];
|
|
142
|
+
export const hasOptedOutOfPurpose = (state, { apiVersion, purposeId }) =>
|
|
143
|
+
!!getPurposeOptOuts(state, apiVersion)[`${purposeId}`];
|
|
144
|
+
|
|
145
|
+
export const isTcfApplicable = state =>
|
|
146
|
+
(doesGDPRApply(state) || isBrowsingFrom(state, 'ca')) &&
|
|
147
|
+
!!get(getStore(state), 'enabled', isIABEnabled(state));
|
|
148
|
+
export const isVendorListLoaded = (state, apiVersion) =>
|
|
149
|
+
!!get(getApiData(state, apiVersion), 'vendorListLoaded');
|
|
150
|
+
export const isVendorListLoading = (state, apiVersion) =>
|
|
151
|
+
!!get(getApiData(state, apiVersion), 'vendorListLoading');
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { get } from '../../utils';
|
|
2
|
+
import { makeGetConsentDataObject } from './consent';
|
|
3
|
+
|
|
4
|
+
export default function makeApi(initOptions) {
|
|
5
|
+
const getConsentDataObject = makeGetConsentDataObject(initOptions);
|
|
6
|
+
const buildTcData = state => {
|
|
7
|
+
const consentDataObj = getConsentDataObject(state);
|
|
8
|
+
return initOptions.coreFieldSequence.reduce(
|
|
9
|
+
(tcData, [tcDataField, length, , consentDataField, formatter]) => {
|
|
10
|
+
const value = get(consentDataObj, consentDataField);
|
|
11
|
+
tcData[`${tcDataField}`] = formatter ? formatter(value, length) : value;
|
|
12
|
+
return tcData;
|
|
13
|
+
},
|
|
14
|
+
{},
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function bind(store) {
|
|
19
|
+
return function tcfApi(command, callback, parameter) {
|
|
20
|
+
const state = store.getState();
|
|
21
|
+
switch (command) {
|
|
22
|
+
case 'getField': {
|
|
23
|
+
const field = parameter;
|
|
24
|
+
const tcData = buildTcData(state);
|
|
25
|
+
return tcData[`${field}`];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
case 'getSection': {
|
|
29
|
+
const tcData = buildTcData(state);
|
|
30
|
+
return tcData;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
bind,
|
|
38
|
+
};
|
|
39
|
+
}
|