@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
package/src/styles.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
contrastRgb,
|
|
4
|
+
darken,
|
|
5
|
+
lighten,
|
|
6
|
+
luminosityGrayscale,
|
|
7
|
+
parseColor,
|
|
8
|
+
} from './utils/Color';
|
|
9
|
+
|
|
10
|
+
import type { Config } from './types/consent-config';
|
|
11
|
+
import { DEFAULT_CONFIG } from './ConsentManager';
|
|
12
|
+
|
|
13
|
+
type ColorLookupTableType = [
|
|
14
|
+
color: [r: number, g: number, b: number, a?: number],
|
|
15
|
+
contrast?: number,
|
|
16
|
+
disabledColor?: number,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const colorLookupTable: Record<string, ColorLookupTableType> = {};
|
|
20
|
+
const ARIA_CONTRAST_AMOUNT = 0.08;
|
|
21
|
+
/**
|
|
22
|
+
* @param {String} color
|
|
23
|
+
* @returns {[parsedColor: [red: Number, green: Number, blue: Number], contrast: Number, disabledColor: Number]}
|
|
24
|
+
*/
|
|
25
|
+
const lookupColor = (color: string) => {
|
|
26
|
+
const lookup = colorLookupTable[`${color}`] || [parseColor(color)];
|
|
27
|
+
lookup[1] = lookup[1] ?? contrastRgb(...lookup[0]);
|
|
28
|
+
lookup[2] = lookup[2] ?? luminosityGrayscale(...lookup[0]);
|
|
29
|
+
colorLookupTable[`${color}`] = lookup;
|
|
30
|
+
return lookup;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const createContrastColor = (
|
|
34
|
+
color: string,
|
|
35
|
+
amount = ARIA_CONTRAST_AMOUNT,
|
|
36
|
+
) => {
|
|
37
|
+
const [, contrast] = lookupColor(color);
|
|
38
|
+
return (amount < 0 ? !contrast : contrast)
|
|
39
|
+
? lighten(color, Math.abs(amount))
|
|
40
|
+
: darken(color, Math.abs(amount));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const createSharedStyles = (config?: Config) => {
|
|
44
|
+
const {
|
|
45
|
+
buttonBackgroundColor,
|
|
46
|
+
buttonForegroundColor,
|
|
47
|
+
buttonDenyBackgroundColor,
|
|
48
|
+
buttonDenyForegroundColor,
|
|
49
|
+
dialogBackgroundColor,
|
|
50
|
+
dialogForegroundColor,
|
|
51
|
+
infoDialogBackgroundColor,
|
|
52
|
+
infoDialogForegroundColor,
|
|
53
|
+
infoDialogOverlayColor,
|
|
54
|
+
linkColor,
|
|
55
|
+
toggleOffBackgroundColor,
|
|
56
|
+
toggleButtonOffColor,
|
|
57
|
+
toggleOnBackgroundColor,
|
|
58
|
+
toggleButtonOnColor,
|
|
59
|
+
} = config?.palette || DEFAULT_CONFIG.palette;
|
|
60
|
+
|
|
61
|
+
const clearDialogBackground = `rgba(${parseColor(infoDialogBackgroundColor)
|
|
62
|
+
.slice(0, 3)
|
|
63
|
+
.join(',')},0)`;
|
|
64
|
+
|
|
65
|
+
return StyleSheet.create({
|
|
66
|
+
grow: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
},
|
|
69
|
+
row: {
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
},
|
|
72
|
+
rowReverse: {
|
|
73
|
+
flexDirection: 'row-reverse',
|
|
74
|
+
},
|
|
75
|
+
col: {
|
|
76
|
+
flexDirection: 'column',
|
|
77
|
+
},
|
|
78
|
+
colReverse: {
|
|
79
|
+
flexDirection: 'column-reverse',
|
|
80
|
+
},
|
|
81
|
+
ltr: {
|
|
82
|
+
textAlign: 'left',
|
|
83
|
+
writingDirection: Platform.OS !== 'web' ? 'ltr' : undefined,
|
|
84
|
+
},
|
|
85
|
+
rtl: {
|
|
86
|
+
textAlign: 'right',
|
|
87
|
+
writingDirection: Platform.OS !== 'web' ? 'rtl' : undefined,
|
|
88
|
+
},
|
|
89
|
+
alignStart: {
|
|
90
|
+
alignItems: 'flex-start',
|
|
91
|
+
},
|
|
92
|
+
alignCenter: {
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
},
|
|
95
|
+
alignEnd: {
|
|
96
|
+
alignItems: 'flex-end',
|
|
97
|
+
},
|
|
98
|
+
justifyStart: {
|
|
99
|
+
justifyContent: 'flex-start',
|
|
100
|
+
},
|
|
101
|
+
justifyCenter: {
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
},
|
|
104
|
+
justifyEnd: {
|
|
105
|
+
justifyContent: 'flex-end',
|
|
106
|
+
},
|
|
107
|
+
dialog: {
|
|
108
|
+
backgroundColor: dialogBackgroundColor,
|
|
109
|
+
},
|
|
110
|
+
dialogText: {
|
|
111
|
+
color: dialogForegroundColor,
|
|
112
|
+
},
|
|
113
|
+
dialogClose: {
|
|
114
|
+
color: dialogForegroundColor,
|
|
115
|
+
},
|
|
116
|
+
dialogCloseFocus: {
|
|
117
|
+
backgroundColor: dialogForegroundColor,
|
|
118
|
+
borderColor: dialogForegroundColor,
|
|
119
|
+
},
|
|
120
|
+
dialogCloseHover: {
|
|
121
|
+
color: createContrastColor(dialogForegroundColor),
|
|
122
|
+
},
|
|
123
|
+
dialogOverlay: {
|
|
124
|
+
backgroundColor: infoDialogOverlayColor,
|
|
125
|
+
},
|
|
126
|
+
drawer: {
|
|
127
|
+
backgroundColor: infoDialogBackgroundColor,
|
|
128
|
+
borderColor: infoDialogForegroundColor,
|
|
129
|
+
flex: 1,
|
|
130
|
+
padding: 0,
|
|
131
|
+
},
|
|
132
|
+
drawerText: {
|
|
133
|
+
color: infoDialogForegroundColor,
|
|
134
|
+
},
|
|
135
|
+
drawerHeader: {
|
|
136
|
+
backgroundColor: `linear-gradient(180deg, ${infoDialogBackgroundColor} 2.5em, ${clearDialogBackground} 100%)`,
|
|
137
|
+
},
|
|
138
|
+
drawerClose: {
|
|
139
|
+
color: infoDialogForegroundColor,
|
|
140
|
+
},
|
|
141
|
+
drawerCloseFocus: {
|
|
142
|
+
backgroundColor: infoDialogForegroundColor,
|
|
143
|
+
borderColor: infoDialogForegroundColor,
|
|
144
|
+
color: infoDialogBackgroundColor,
|
|
145
|
+
},
|
|
146
|
+
drawerCloseHover: {
|
|
147
|
+
color: createContrastColor(infoDialogForegroundColor),
|
|
148
|
+
},
|
|
149
|
+
toggleOff: {
|
|
150
|
+
backgroundColor: toggleOffBackgroundColor,
|
|
151
|
+
color: toggleButtonOffColor,
|
|
152
|
+
},
|
|
153
|
+
toggleOn: {
|
|
154
|
+
backgroundColor: toggleOnBackgroundColor,
|
|
155
|
+
color: toggleButtonOnColor,
|
|
156
|
+
},
|
|
157
|
+
toggleOffDisabled: {
|
|
158
|
+
backgroundColor: createContrastColor(toggleOffBackgroundColor, 0.25),
|
|
159
|
+
color: createContrastColor(toggleButtonOffColor, 0.25),
|
|
160
|
+
},
|
|
161
|
+
toggleOnDisabled: {
|
|
162
|
+
backgroundColor: createContrastColor(toggleOnBackgroundColor, 0.25),
|
|
163
|
+
color: createContrastColor(toggleButtonOnColor, 0.25),
|
|
164
|
+
},
|
|
165
|
+
link: {
|
|
166
|
+
color: linkColor,
|
|
167
|
+
},
|
|
168
|
+
linkFocus: {
|
|
169
|
+
backgroundColor: linkColor,
|
|
170
|
+
color: createContrastColor(linkColor),
|
|
171
|
+
},
|
|
172
|
+
button: {
|
|
173
|
+
backgroundColor: buttonBackgroundColor,
|
|
174
|
+
borderColor: buttonForegroundColor,
|
|
175
|
+
},
|
|
176
|
+
buttonText: {
|
|
177
|
+
color: buttonForegroundColor,
|
|
178
|
+
},
|
|
179
|
+
buttonFocus: {
|
|
180
|
+
backgroundColor: createContrastColor(buttonBackgroundColor, 0.08),
|
|
181
|
+
borderColor: createContrastColor(buttonForegroundColor, 0.08),
|
|
182
|
+
},
|
|
183
|
+
buttonHover: {
|
|
184
|
+
backgroundColor: createContrastColor(buttonBackgroundColor, 0.16),
|
|
185
|
+
borderColor: createContrastColor(buttonForegroundColor, 0.16),
|
|
186
|
+
},
|
|
187
|
+
buttonDeny: {
|
|
188
|
+
backgroundColor: buttonDenyBackgroundColor,
|
|
189
|
+
borderColor: buttonDenyForegroundColor,
|
|
190
|
+
},
|
|
191
|
+
buttonDenyText: {
|
|
192
|
+
color: buttonDenyForegroundColor,
|
|
193
|
+
},
|
|
194
|
+
buttonDenyFocus: {
|
|
195
|
+
backgroundColor: createContrastColor(buttonDenyBackgroundColor, 0.08),
|
|
196
|
+
borderColor: createContrastColor(buttonDenyForegroundColor, 0.08),
|
|
197
|
+
},
|
|
198
|
+
buttonDenyHover: {
|
|
199
|
+
backgroundColor: createContrastColor(buttonDenyBackgroundColor, 0.16),
|
|
200
|
+
borderColor: createContrastColor(buttonDenyForegroundColor, 0.16),
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ConsentCategory } from '../constants';
|
|
2
|
+
import type { Flavor } from '../flavors';
|
|
3
|
+
import type { Iab } from '../iab/types';
|
|
4
|
+
|
|
5
|
+
type DialogType = 'bar' | 'box';
|
|
6
|
+
type DialogPosition =
|
|
7
|
+
| 'bottom'
|
|
8
|
+
| 'bottom-left'
|
|
9
|
+
| 'bottom-right'
|
|
10
|
+
| 'center'
|
|
11
|
+
| 'top'
|
|
12
|
+
| 'top-left'
|
|
13
|
+
| 'top-right';
|
|
14
|
+
type WidgetDrawerPosition = 'left' | 'right';
|
|
15
|
+
type Mode = '' | 'debug' | 'listener' | 'permissive' | 'production';
|
|
16
|
+
|
|
17
|
+
type Palette = {
|
|
18
|
+
linkColor: string;
|
|
19
|
+
borderless: boolean;
|
|
20
|
+
dialogType: DialogType;
|
|
21
|
+
widgetPosition: WidgetDrawerPosition;
|
|
22
|
+
displayPosition: DialogPosition;
|
|
23
|
+
infoDialogPosition: WidgetDrawerPosition;
|
|
24
|
+
toggleButtonOnColor: string;
|
|
25
|
+
toggleOnBackgroundColor: string;
|
|
26
|
+
toggleButtonOffColor: string;
|
|
27
|
+
toggleOffBackgroundColor: string;
|
|
28
|
+
buttonBackgroundColor: string;
|
|
29
|
+
buttonForegroundColor: string;
|
|
30
|
+
dialogBackgroundColor: string;
|
|
31
|
+
dialogForegroundColor: string;
|
|
32
|
+
buttonDenyBackgroundColor: string;
|
|
33
|
+
buttonDenyForegroundColor: string;
|
|
34
|
+
infoDialogBackgroundColor: string;
|
|
35
|
+
infoDialogForegroundColor: string;
|
|
36
|
+
infoDialogOverlayColor: string;
|
|
37
|
+
widgetColor: string;
|
|
38
|
+
widgetOutlineColor: string;
|
|
39
|
+
widgetFillColor: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type Config = {
|
|
43
|
+
allowTimeout: boolean;
|
|
44
|
+
gpcSupport: boolean;
|
|
45
|
+
categories: ConsentCategory[];
|
|
46
|
+
ccpaRelaxed: boolean;
|
|
47
|
+
crossDomain: boolean;
|
|
48
|
+
ccpaApplies: boolean;
|
|
49
|
+
forceManagePreferences: boolean;
|
|
50
|
+
forceReconsent?: Date;
|
|
51
|
+
googleConsent: boolean;
|
|
52
|
+
iframeBlocking: Mode;
|
|
53
|
+
scriptBlocking: Mode;
|
|
54
|
+
timeoutSeconds: number;
|
|
55
|
+
storagePolicyHref: string;
|
|
56
|
+
policyLinkText: string;
|
|
57
|
+
policyLinkInDrawer: boolean;
|
|
58
|
+
forcedClassifyEnabled: boolean;
|
|
59
|
+
managePreferencesEnabled: boolean;
|
|
60
|
+
customerId: string;
|
|
61
|
+
configId: string;
|
|
62
|
+
mode: Mode;
|
|
63
|
+
noTattle: boolean;
|
|
64
|
+
domains: Array<string>;
|
|
65
|
+
remoteConsent: boolean;
|
|
66
|
+
type?: Flavor;
|
|
67
|
+
variant: 'one' | 'two' | 'three' | 'four' | 'five' | 'six';
|
|
68
|
+
country: string;
|
|
69
|
+
region: string;
|
|
70
|
+
iab: Iab;
|
|
71
|
+
palette: Palette;
|
|
72
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FlavorKeys } from '../flavors';
|
|
2
|
+
|
|
3
|
+
export type OsanoOverrides = {
|
|
4
|
+
flavor?: FlavorKeys;
|
|
5
|
+
locale?: string;
|
|
6
|
+
iabEnabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface OsanoProps {
|
|
10
|
+
configId: string;
|
|
11
|
+
customerId: string;
|
|
12
|
+
hideDisclosures?: boolean;
|
|
13
|
+
onConfigLoadSuccess?:()=>void;
|
|
14
|
+
onConfigLoadFailure?:()=>void;
|
|
15
|
+
onLangLoadSuccess?:()=>void;
|
|
16
|
+
onLangLoadFailure?:()=>void;
|
|
17
|
+
overrides?: OsanoOverrides;
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ConsentConfig } from '../ConsentManager';
|
|
2
|
+
import { ConsentCategory } from '../store';
|
|
3
|
+
|
|
4
|
+
export type OsanoAction = {
|
|
5
|
+
type: string;
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
payload?: any;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type OsanoState = {
|
|
11
|
+
config?: ConsentConfig;
|
|
12
|
+
configId: string;
|
|
13
|
+
consent: Record<ConsentCategory, boolean | undefined>;
|
|
14
|
+
customerId: string;
|
|
15
|
+
dialogOpen: boolean;
|
|
16
|
+
disclosures: {
|
|
17
|
+
fetched: ConsentCategory[];
|
|
18
|
+
loading: boolean;
|
|
19
|
+
results: Partial<Record<ConsentCategory, Disclosure[]>>;
|
|
20
|
+
};
|
|
21
|
+
locale: string;
|
|
22
|
+
scrollToType: string;
|
|
23
|
+
scrollToId: number;
|
|
24
|
+
stack: string[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type DisclosureType =
|
|
28
|
+
| 'cookie'
|
|
29
|
+
| 'script'
|
|
30
|
+
| 'iframe'
|
|
31
|
+
| 'image'
|
|
32
|
+
| 'third-party'
|
|
33
|
+
| 'no-results'
|
|
34
|
+
| 'text';
|
|
35
|
+
|
|
36
|
+
export type Disclosure = {
|
|
37
|
+
classification?: ConsentCategory;
|
|
38
|
+
type?: DisclosureType;
|
|
39
|
+
expiry?: string | number;
|
|
40
|
+
name: string;
|
|
41
|
+
provider?: string;
|
|
42
|
+
purpose?: string;
|
|
43
|
+
};
|
package/src/utils/API.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const makeFetch = (
|
|
2
|
+
method: string,
|
|
3
|
+
path: string,
|
|
4
|
+
params = {},
|
|
5
|
+
returnHeaders = false,
|
|
6
|
+
): Promise<unknown | { json: object; headers: Headers }> => {
|
|
7
|
+
const url = new URL(path);
|
|
8
|
+
if (method.toLowerCase() === 'get') {
|
|
9
|
+
url.search = new URLSearchParams(params).toString();
|
|
10
|
+
}
|
|
11
|
+
// Remove trailing slash that is added by React Native polyfill
|
|
12
|
+
const href = url.toString().endsWith('/')
|
|
13
|
+
? url.toString().slice(0, -1)
|
|
14
|
+
: url.toString();
|
|
15
|
+
return fetch(href, {
|
|
16
|
+
method: method.toUpperCase(),
|
|
17
|
+
headers: {
|
|
18
|
+
'Accept': 'application/json',
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
},
|
|
21
|
+
mode: 'cors',
|
|
22
|
+
referrer: 'no-referrer',
|
|
23
|
+
body: method !== 'GET' ? JSON.stringify(params) : undefined,
|
|
24
|
+
}).then(response => {
|
|
25
|
+
if (response.status === 204 || response.type === 'opaque') {
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
return response.json().then(json => {
|
|
29
|
+
if (response.ok) {
|
|
30
|
+
return returnHeaders ? { headers: response.headers, json } : json;
|
|
31
|
+
} else {
|
|
32
|
+
return Promise.reject(response);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
get: (path: string, queryObj?: object | boolean | undefined) =>
|
|
40
|
+
makeFetch(
|
|
41
|
+
'GET',
|
|
42
|
+
path,
|
|
43
|
+
typeof queryObj !== 'boolean' ? queryObj : undefined,
|
|
44
|
+
typeof queryObj === 'boolean',
|
|
45
|
+
),
|
|
46
|
+
post: (path: string, params?: object) => makeFetch('POST', path, params),
|
|
47
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export const parseColor = (
|
|
2
|
+
color = '',
|
|
3
|
+
defaultColor?: string,
|
|
4
|
+
): [r: number, g: number, b: number, a?: number] => {
|
|
5
|
+
if (color.indexOf('rgb') === 0) {
|
|
6
|
+
try {
|
|
7
|
+
const colorArray = color
|
|
8
|
+
.replace(/[^\d,.]/g, '')
|
|
9
|
+
.split(',')
|
|
10
|
+
.map(value => {
|
|
11
|
+
const val = parseFloat(value);
|
|
12
|
+
if (isNaN(val)) {
|
|
13
|
+
throw new Error('Invalid color value');
|
|
14
|
+
}
|
|
15
|
+
return val;
|
|
16
|
+
});
|
|
17
|
+
return colorArray as [r: number, g: number, b: number, a?: number];
|
|
18
|
+
} catch (error) {
|
|
19
|
+
// Error parsing rgb color
|
|
20
|
+
return parseColor(defaultColor, 'rgba(0,0,0,1)');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let hex = `${color || ''}`.toLowerCase().replace(/[^0-9a-f]/, '');
|
|
25
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
26
|
+
// HEX short code
|
|
27
|
+
hex = hex
|
|
28
|
+
.split('')
|
|
29
|
+
.map(c => `${c}${c}`)
|
|
30
|
+
.join('');
|
|
31
|
+
} else if (hex.length !== 6 && hex.length !== 8) {
|
|
32
|
+
return parseColor(defaultColor, 'rgba(0,0,0,1)');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const components = [];
|
|
36
|
+
let pointer = 0;
|
|
37
|
+
while (pointer < hex.length && components.length < 3) {
|
|
38
|
+
const colorInt = parseInt(hex.slice(pointer, pointer + 2), 16);
|
|
39
|
+
// eslint-disable-next-line no-bitwise
|
|
40
|
+
components.push(colorInt & 255);
|
|
41
|
+
pointer += 2;
|
|
42
|
+
}
|
|
43
|
+
if (pointer < hex.length && components.length === 3) {
|
|
44
|
+
// Parse the alpha channel of a hex
|
|
45
|
+
const colorInt = parseInt(hex.slice(pointer, pointer + 2), 16);
|
|
46
|
+
components.push(colorInt / 255);
|
|
47
|
+
}
|
|
48
|
+
return components as [r: number, g: number, b: number, a?: number];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const intToHexInt = (...args: number[]) =>
|
|
52
|
+
args.map(i => ((i % 256) + 256) % 256);
|
|
53
|
+
export const intToHexString = (...args: number[]) =>
|
|
54
|
+
// Only RGB on hex strings
|
|
55
|
+
args
|
|
56
|
+
.slice(0, 3)
|
|
57
|
+
.reduce((hex, i) => `${hex}${`00${i.toString(16)}`.slice(-2)}`, '');
|
|
58
|
+
|
|
59
|
+
export const intToHue = (i: number) => ((i % 360) + 360) % 360;
|
|
60
|
+
|
|
61
|
+
// eslint-disable-next-line no-bitwise
|
|
62
|
+
export const floatToHexInt = (f: number) => ((~~(f * 255) % 256) + 256) % 256;
|
|
63
|
+
export const floatToHexString = (...args: number[]) =>
|
|
64
|
+
args.reduce(
|
|
65
|
+
(hex, f) => `${hex}${`00${floatToHexInt(f).toString(16)}`.slice(-2)}`,
|
|
66
|
+
'',
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
export const contrastRgb = (r: number, g: number, b: number, _a?: number) => {
|
|
70
|
+
// calculate contrast of color (standard grayscale algorithmic formula)
|
|
71
|
+
const contrast =
|
|
72
|
+
(Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000;
|
|
73
|
+
return contrast >= 128 ? 0 : 1;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const luminosityGrayscale = (
|
|
77
|
+
r: number,
|
|
78
|
+
g: number,
|
|
79
|
+
b: number,
|
|
80
|
+
_a?: number,
|
|
81
|
+
) => floatToHexInt(0.21 * r + 0.72 * g + 0.07 * b);
|
|
82
|
+
export const LightenDarkenColor = (
|
|
83
|
+
col: string | number[],
|
|
84
|
+
percentage: number,
|
|
85
|
+
) => {
|
|
86
|
+
const invert = Math.abs(percentage) !== percentage ? -1 : 1;
|
|
87
|
+
const isPercentage = Math.abs(percentage) <= 1;
|
|
88
|
+
let amt = Math.abs(percentage);
|
|
89
|
+
amt =
|
|
90
|
+
Math.floor(
|
|
91
|
+
Math.min(255, Math.max(-255, isPercentage ? Math.round(255 * amt) : amt)),
|
|
92
|
+
) * invert;
|
|
93
|
+
|
|
94
|
+
let [r = invert ? 255 : 0, g = invert ? 255 : 0, b = invert ? 255 : 0] =
|
|
95
|
+
typeof col === 'string' ? parseColor(col) : col;
|
|
96
|
+
|
|
97
|
+
r += amt;
|
|
98
|
+
|
|
99
|
+
if (r > 255) {
|
|
100
|
+
r = 255;
|
|
101
|
+
} else if (r < 0) {
|
|
102
|
+
r = 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
b += amt;
|
|
106
|
+
|
|
107
|
+
if (b > 255) {
|
|
108
|
+
b = 255;
|
|
109
|
+
} else if (b < 0) {
|
|
110
|
+
b = 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
g += amt;
|
|
114
|
+
|
|
115
|
+
if (g > 255) {
|
|
116
|
+
g = 255;
|
|
117
|
+
} else if (g < 0) {
|
|
118
|
+
g = 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return `#${intToHexString(r, g, b)}`;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const darken = (col: string | number[], amt: number) =>
|
|
125
|
+
LightenDarkenColor(col, -amt);
|
|
126
|
+
export const lighten = (col: string | number[], amt: number) =>
|
|
127
|
+
LightenDarkenColor(col, amt);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
export class EventSubscription {
|
|
3
|
+
private _emitter: EventEmitter;
|
|
4
|
+
private _event: string;
|
|
5
|
+
private _listener: Function;
|
|
6
|
+
|
|
7
|
+
constructor(emitter: EventEmitter, event: string, listener: Function) {
|
|
8
|
+
this._emitter = emitter;
|
|
9
|
+
this._event = event;
|
|
10
|
+
this._listener = listener;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
remove() {
|
|
14
|
+
this._emitter.off(this._event, this._listener);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class EventEmitter {
|
|
19
|
+
private _events: Record<string, Function[]> = {};
|
|
20
|
+
|
|
21
|
+
on(event: string, listener: Function) {
|
|
22
|
+
// console.log('EventEmitter.on', event, listener);
|
|
23
|
+
if (typeof this._events[event] !== 'object') {
|
|
24
|
+
this._events[event] = [];
|
|
25
|
+
}
|
|
26
|
+
const subscription = new EventSubscription(this, event, listener);
|
|
27
|
+
this._events[event]!.push(listener);
|
|
28
|
+
return subscription;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
off(event: string, listener: Function) {
|
|
32
|
+
// console.log('EventEmitter.off', event, listener);
|
|
33
|
+
if (typeof this._events[event] === 'object') {
|
|
34
|
+
const idx = this._events[event]!.indexOf(listener);
|
|
35
|
+
if (idx > -1) {
|
|
36
|
+
this._events[event]!.splice(idx, 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
emit(event: string, ...args: unknown[]) {
|
|
42
|
+
if (typeof this._events[event] === 'object') {
|
|
43
|
+
this._events[event]?.forEach(listener => listener.apply(this, args));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
once(event: string, listener: Function) {
|
|
48
|
+
const g = (...args: unknown[]) => {
|
|
49
|
+
this.off(event, g);
|
|
50
|
+
listener.apply(this, args);
|
|
51
|
+
};
|
|
52
|
+
return this.on(event, g);
|
|
53
|
+
}
|
|
54
|
+
}
|