@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,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GetState,
|
|
3
|
+
type MiddlewareNext,
|
|
4
|
+
type Store,
|
|
5
|
+
type ThunkDispatch,
|
|
6
|
+
} from './hooks/useThunkReducer';
|
|
7
|
+
import { type OsanoAction, type OsanoState } from './types/store';
|
|
8
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
9
|
+
import { StyleSheet, View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
import { ConsentManager } from './ConsentManager';
|
|
12
|
+
import { Dialog } from './views/Dialog';
|
|
13
|
+
import { Drawer } from './views/Drawer';
|
|
14
|
+
import { OsanoPrivateContext } from './context';
|
|
15
|
+
import { createSharedStyles } from './styles';
|
|
16
|
+
import { setConfig } from './store';
|
|
17
|
+
|
|
18
|
+
export const ConsentUiBuilder: React.FC<{
|
|
19
|
+
addMiddleware: (
|
|
20
|
+
m: (
|
|
21
|
+
store: Store<OsanoState, OsanoAction>
|
|
22
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>
|
|
23
|
+
) => void;
|
|
24
|
+
cmp: React.MutableRefObject<ConsentManager>;
|
|
25
|
+
dispatch: ThunkDispatch<OsanoState, OsanoAction, any>;
|
|
26
|
+
getState: GetState<OsanoState>;
|
|
27
|
+
hideDisclosures: boolean;
|
|
28
|
+
removeMiddleware: (
|
|
29
|
+
m: (
|
|
30
|
+
store: Store<OsanoState, OsanoAction>
|
|
31
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>
|
|
32
|
+
) => void;
|
|
33
|
+
}> = (props): React.ReactElement<View> => {
|
|
34
|
+
const {
|
|
35
|
+
addMiddleware,
|
|
36
|
+
cmp,
|
|
37
|
+
dispatch,
|
|
38
|
+
getState,
|
|
39
|
+
hideDisclosures,
|
|
40
|
+
removeMiddleware,
|
|
41
|
+
} = props;
|
|
42
|
+
const { disclosures, stack } = getState();
|
|
43
|
+
|
|
44
|
+
const handleTranslate = useCallback(
|
|
45
|
+
(
|
|
46
|
+
path: string | string[],
|
|
47
|
+
translationProps = {},
|
|
48
|
+
defaultPhrase?: string
|
|
49
|
+
) => {
|
|
50
|
+
const translated = cmp.current.translator.translate(
|
|
51
|
+
path,
|
|
52
|
+
translationProps,
|
|
53
|
+
defaultPhrase
|
|
54
|
+
);
|
|
55
|
+
return translated;
|
|
56
|
+
},
|
|
57
|
+
[cmp]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const privateContext = useMemo(() => {
|
|
61
|
+
return {
|
|
62
|
+
addMiddleware,
|
|
63
|
+
removeMiddleware,
|
|
64
|
+
cmp: cmp.current,
|
|
65
|
+
config: cmp.current.config,
|
|
66
|
+
loadingDisclosures: disclosures.loading,
|
|
67
|
+
dispatch,
|
|
68
|
+
hideDisclosures,
|
|
69
|
+
translate: handleTranslate,
|
|
70
|
+
getState,
|
|
71
|
+
locale: cmp.current.translator.locale,
|
|
72
|
+
sharedStyles: createSharedStyles(cmp.current.config || {}),
|
|
73
|
+
stack,
|
|
74
|
+
};
|
|
75
|
+
}, [
|
|
76
|
+
addMiddleware,
|
|
77
|
+
removeMiddleware,
|
|
78
|
+
cmp,
|
|
79
|
+
disclosures.loading,
|
|
80
|
+
dispatch,
|
|
81
|
+
hideDisclosures,
|
|
82
|
+
handleTranslate,
|
|
83
|
+
getState,
|
|
84
|
+
stack,
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
// Update our store with the config when CMP loads or config changes
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (cmp.current.loaded) {
|
|
90
|
+
dispatch(
|
|
91
|
+
setConfig({
|
|
92
|
+
config: cmp.current.config,
|
|
93
|
+
customerId: cmp.current.customerId,
|
|
94
|
+
configId: cmp.current.configId,
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}, [cmp, dispatch, cmp.current.loaded, cmp.current.config]);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<OsanoPrivateContext.Provider value={privateContext}>
|
|
102
|
+
<View style={[styles.overlay]}>
|
|
103
|
+
<Dialog />
|
|
104
|
+
<Drawer />
|
|
105
|
+
</View>
|
|
106
|
+
</OsanoPrivateContext.Provider>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const styles = StyleSheet.create({
|
|
111
|
+
overlay: {
|
|
112
|
+
flex: 1,
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
marginTop: 22,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Path, Polygon, Svg } from 'react-native-svg';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type PressableProps,
|
|
5
|
+
type StyleProp,
|
|
6
|
+
Text,
|
|
7
|
+
type TextStyle,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
View,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
12
|
+
import {
|
|
13
|
+
acceptAll,
|
|
14
|
+
close,
|
|
15
|
+
denyAll,
|
|
16
|
+
goBack,
|
|
17
|
+
saveConsent,
|
|
18
|
+
showDrawer,
|
|
19
|
+
} from '../store';
|
|
20
|
+
|
|
21
|
+
import Locale from './Locale';
|
|
22
|
+
import { OsanoPrivateContext } from '../context';
|
|
23
|
+
|
|
24
|
+
type ButtonProps = React.PropsWithoutRef<
|
|
25
|
+
Omit<PressableProps, 'style' | 'title'> & {
|
|
26
|
+
title?: string;
|
|
27
|
+
defaultPhrase?: string;
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
29
|
+
}
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
export const Button: React.FC<ButtonProps> = props => {
|
|
33
|
+
const { defaultPhrase, disabled, title, onPress, style: buttonStyle } = props;
|
|
34
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
35
|
+
const { palette } = config || {};
|
|
36
|
+
const { buttonBackgroundColor, buttonForegroundColor } = palette || {};
|
|
37
|
+
const button: StyleProp<ViewStyle> = useMemo(
|
|
38
|
+
() => ({
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
backgroundColor: buttonBackgroundColor,
|
|
41
|
+
borderColor: buttonForegroundColor,
|
|
42
|
+
borderWidth: 1,
|
|
43
|
+
borderRadius: 4,
|
|
44
|
+
paddingVertical: 8,
|
|
45
|
+
paddingHorizontal: 16,
|
|
46
|
+
flexBasis: 'auto',
|
|
47
|
+
}),
|
|
48
|
+
[buttonBackgroundColor, buttonForegroundColor],
|
|
49
|
+
);
|
|
50
|
+
const buttonText: StyleProp<TextStyle> = useMemo(
|
|
51
|
+
() => ({
|
|
52
|
+
color: buttonForegroundColor,
|
|
53
|
+
fontSize: 16,
|
|
54
|
+
fontWeight: 'bold',
|
|
55
|
+
}),
|
|
56
|
+
[buttonForegroundColor],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Pressable
|
|
61
|
+
style={[button, buttonStyle]}
|
|
62
|
+
onPress={onPress}
|
|
63
|
+
disabled={disabled}
|
|
64
|
+
>
|
|
65
|
+
<Text style={buttonText}>
|
|
66
|
+
<Locale path={title || ''} defaultPhrase={defaultPhrase} />
|
|
67
|
+
</Text>
|
|
68
|
+
</Pressable>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DenyButton = (props: ButtonProps) => {
|
|
73
|
+
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
74
|
+
const { onPress, title } = props;
|
|
75
|
+
|
|
76
|
+
const handleReject = useCallback(() => {
|
|
77
|
+
// dispatch(setAllVendorConsent(DENY)); // IAB
|
|
78
|
+
// dispatch(setAxllPurposeConsent(ACCEPT)); // IAB
|
|
79
|
+
// dispatch(setAllSpecialFeatureConsent(DENY)); // IAB
|
|
80
|
+
dispatch(denyAll);
|
|
81
|
+
dispatch(saveConsent(cmp));
|
|
82
|
+
dispatch(close(cmp));
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
return Button({
|
|
86
|
+
...props,
|
|
87
|
+
title: title || 'buttons.deny',
|
|
88
|
+
onPress: onPress || handleReject,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const AcceptButton = (props: ButtonProps) => {
|
|
93
|
+
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
94
|
+
const { onPress, title } = props;
|
|
95
|
+
|
|
96
|
+
const handleSave = useCallback(() => {
|
|
97
|
+
dispatch(saveConsent(cmp));
|
|
98
|
+
dispatch(close(cmp));
|
|
99
|
+
}, []);
|
|
100
|
+
|
|
101
|
+
return Button({
|
|
102
|
+
...props,
|
|
103
|
+
title: title || 'buttons.accept',
|
|
104
|
+
onPress: onPress || handleSave,
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const CloseButton = React.forwardRef(
|
|
109
|
+
(
|
|
110
|
+
props: PressableProps & {
|
|
111
|
+
color?: string;
|
|
112
|
+
},
|
|
113
|
+
ref: React.Ref<View>,
|
|
114
|
+
) => {
|
|
115
|
+
const { color = '#fafafa', onPress, ...remain } = props;
|
|
116
|
+
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
117
|
+
const handleClose = useCallback(() => {
|
|
118
|
+
dispatch(close(cmp));
|
|
119
|
+
}, []);
|
|
120
|
+
return (
|
|
121
|
+
<Pressable {...remain} ref={ref} onPress={onPress || handleClose}>
|
|
122
|
+
<Svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
123
|
+
<Path
|
|
124
|
+
d="M5.54695 4.13965L19.622 18.2146L18.2147 19.6219L4.13965 5.54695L5.54695 4.13965Z"
|
|
125
|
+
fill={color}
|
|
126
|
+
/>
|
|
127
|
+
<Path
|
|
128
|
+
d="M19.6203 5.54499L5.54524 19.62L4.13794 18.2127L18.2129 4.1377L19.6203 5.54499Z"
|
|
129
|
+
fill={color}
|
|
130
|
+
/>
|
|
131
|
+
</Svg>
|
|
132
|
+
</Pressable>
|
|
133
|
+
);
|
|
134
|
+
},
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
export const BackButton = (
|
|
138
|
+
props: PressableProps & {
|
|
139
|
+
color?: string;
|
|
140
|
+
},
|
|
141
|
+
) => {
|
|
142
|
+
const { color = '#fafafa', onPress, ...remain } = props;
|
|
143
|
+
const { dispatch } = useContext(OsanoPrivateContext);
|
|
144
|
+
const handleBack = useCallback(() => {
|
|
145
|
+
dispatch(goBack);
|
|
146
|
+
}, []);
|
|
147
|
+
return (
|
|
148
|
+
<Pressable {...remain} onPress={onPress || handleBack}>
|
|
149
|
+
<Svg height="16px" viewBox="0 0 512 512" width="16px" fill={color}>
|
|
150
|
+
<Polygon points="352,128.4 319.7,96 160,256 160,256 160,256 319.7,416 352,383.6 224.7,256 " />
|
|
151
|
+
</Svg>
|
|
152
|
+
</Pressable>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const ManagePreferencesButton = (props: ButtonProps) => {
|
|
157
|
+
const { onPress, ...remain } = props;
|
|
158
|
+
const { config, dispatch, cmp } = useContext(OsanoPrivateContext);
|
|
159
|
+
const handleShowDrawer = useCallback(() => {
|
|
160
|
+
dispatch(close(cmp));
|
|
161
|
+
dispatch(showDrawer);
|
|
162
|
+
}, []);
|
|
163
|
+
|
|
164
|
+
return Button({
|
|
165
|
+
...remain,
|
|
166
|
+
onPress: onPress || handleShowDrawer,
|
|
167
|
+
title: `buttons.dialog.openDrawer.${config?.jurisdiction}`,
|
|
168
|
+
defaultPhrase: 'buttons.managePreferences',
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const RejectAllButton = (props: ButtonProps) => {
|
|
173
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
174
|
+
return DenyButton({
|
|
175
|
+
...props,
|
|
176
|
+
title: `buttons.dialog.denyAll.${config?.jurisdiction}`,
|
|
177
|
+
defaultPhrase: 'buttons.denyAll',
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const SaveButton = (props: ButtonProps) => {
|
|
182
|
+
return AcceptButton({
|
|
183
|
+
...props,
|
|
184
|
+
title: `buttons.save`,
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const AcceptAllButton = (props: ButtonProps) => {
|
|
189
|
+
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
190
|
+
const { onPress, ...remain } = props;
|
|
191
|
+
const handleAcceptAllConsent = useCallback(() => {
|
|
192
|
+
// dispatch(setAllVendorConsent(ACCEPT)); // IAB
|
|
193
|
+
// dispatch(setAllPurposeConsent(DENY)); // IAB
|
|
194
|
+
dispatch(acceptAll);
|
|
195
|
+
dispatch(saveConsent(cmp));
|
|
196
|
+
dispatch(close(cmp));
|
|
197
|
+
}, []);
|
|
198
|
+
|
|
199
|
+
return Button({
|
|
200
|
+
...remain,
|
|
201
|
+
onPress: onPress || handleAcceptAllConsent,
|
|
202
|
+
title: `buttons.acceptAll`,
|
|
203
|
+
});
|
|
204
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Path, Svg } from 'react-native-svg';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type StyleProp,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
type ViewStyle,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import React, { useContext, useMemo, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { OsanoPrivateContext } from '../context';
|
|
11
|
+
import { createContrastColor } from '../styles';
|
|
12
|
+
import useBoundCallback from '../hooks/useBoundCallback';
|
|
13
|
+
|
|
14
|
+
const uncheckedPath =
|
|
15
|
+
'M18,3 C19.6568542,3 21,4.34314575 21,6 L21,18 C21,19.6568542 19.6568542,21 18,21 L6,21 C4.34314575,21 3,19.6568542 3,18 L3,6 C3,4.34314575 4.34314575,3 6,3 L18,3 Z';
|
|
16
|
+
const checkedPath =
|
|
17
|
+
'M18,3 C19.6568542,3 21,4.34314575 21,6 L21,18 C21,19.6568542 19.6568542,21 18,21 L6,21 C4.34314575,21 3,19.6568542 3,18 L3,6 C3,4.34314575 4.34314575,3 6,3 L18,3 Z M16.4696699,7.96966991 L10,14.4393398 L7.53033009,11.9696699 C7.23743687,11.6767767 6.76256313,11.6767767 6.46966991,11.9696699 C6.1767767,12.2625631 6.1767767,12.7374369 6.46966991,13.0303301 L9.46966991,16.0303301 C9.76256313,16.3232233 10.2374369,16.3232233 10.5303301,16.0303301 L17.5303301,9.03033009 C17.8232233,8.73743687 17.8232233,8.26256313 17.5303301,7.96966991 C17.2374369,7.6767767 16.7625631,7.6767767 16.4696699,7.96966991 Z';
|
|
18
|
+
|
|
19
|
+
type CheckboxProps = React.PropsWithChildren<{
|
|
20
|
+
align?: 'left' | 'right';
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
onValueChange?: ((value: boolean) => Promise<void> | void) | null | undefined;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
value?: boolean | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
|
|
27
|
+
export const Checkbox: React.FC<CheckboxProps> = props => {
|
|
28
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
29
|
+
const { palette } = config || {};
|
|
30
|
+
const {
|
|
31
|
+
toggleOffBackgroundColor = '#d2cfff',
|
|
32
|
+
toggleOnBackgroundColor = '#37cd8f',
|
|
33
|
+
} = palette || {};
|
|
34
|
+
const { align, children, disabled, onValueChange, style, value } = props;
|
|
35
|
+
const [checked, setValue] = useState(value);
|
|
36
|
+
|
|
37
|
+
const color = useMemo(() => {
|
|
38
|
+
const newColor = checked
|
|
39
|
+
? toggleOnBackgroundColor
|
|
40
|
+
: toggleOffBackgroundColor;
|
|
41
|
+
return disabled ? createContrastColor(newColor, 0.25) : newColor;
|
|
42
|
+
}, [config, checked, disabled]);
|
|
43
|
+
|
|
44
|
+
const handleTouchUp = useBoundCallback(
|
|
45
|
+
(changeValue: (b: boolean) => void | undefined, currentValue: boolean) => {
|
|
46
|
+
changeValue ? changeValue(!currentValue) : null;
|
|
47
|
+
setValue(!currentValue);
|
|
48
|
+
},
|
|
49
|
+
[onValueChange, checked],
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Pressable
|
|
54
|
+
style={[styles.container, style]}
|
|
55
|
+
onPress={handleTouchUp}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
>
|
|
58
|
+
{align === 'left' ? null : children}
|
|
59
|
+
<Svg
|
|
60
|
+
width="32"
|
|
61
|
+
height="32"
|
|
62
|
+
viewBox="0 0 24 24"
|
|
63
|
+
style={align === 'left' ? styles.left : styles.right}
|
|
64
|
+
>
|
|
65
|
+
<Path d={checked ? checkedPath : uncheckedPath} fill={color} />
|
|
66
|
+
</Svg>
|
|
67
|
+
{align === 'left' ? children : null}
|
|
68
|
+
</Pressable>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
container: {
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
flexDirection: 'row',
|
|
76
|
+
justifyContent: 'space-between',
|
|
77
|
+
},
|
|
78
|
+
left: {
|
|
79
|
+
marginRight: 4,
|
|
80
|
+
},
|
|
81
|
+
right: {
|
|
82
|
+
marginLeft: 4,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export default Checkbox;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
type DividerProps = React.PropsWithoutRef<{
|
|
6
|
+
highlight: () => void;
|
|
7
|
+
unhighlight: () => void;
|
|
8
|
+
updateProps: (select: 'leading' | 'trailing', newProps: unknown) => void;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
export const Divider = (_props: DividerProps) => {
|
|
12
|
+
return <View style={styles.divider} />;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
divider: {
|
|
17
|
+
backgroundColor: 'rgba(0,0,0,.1)',
|
|
18
|
+
height: 1,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LayoutAnimation,
|
|
3
|
+
Pressable,
|
|
4
|
+
type StyleProp,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
type TextStyle,
|
|
8
|
+
View,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import Locale from './Locale';
|
|
13
|
+
import { OsanoPrivateContext } from '../context';
|
|
14
|
+
|
|
15
|
+
type ExpansionPanelProps = React.PropsWithChildren<{
|
|
16
|
+
title: string;
|
|
17
|
+
style?: StyleProp<TextStyle>;
|
|
18
|
+
onOpen?: () => void;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export const ExpansionPanel = ({
|
|
22
|
+
children,
|
|
23
|
+
style,
|
|
24
|
+
title,
|
|
25
|
+
onOpen,
|
|
26
|
+
}: ExpansionPanelProps) => {
|
|
27
|
+
const [expanded, setExpanded] = useState(false);
|
|
28
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
29
|
+
const { palette } = config || {};
|
|
30
|
+
|
|
31
|
+
const { linkColor } = palette || {};
|
|
32
|
+
const headerStyle = useMemo(() => {
|
|
33
|
+
return {
|
|
34
|
+
color: linkColor,
|
|
35
|
+
};
|
|
36
|
+
}, [linkColor]);
|
|
37
|
+
|
|
38
|
+
const toggleItem = useCallback(() => {
|
|
39
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
40
|
+
!expanded && onOpen && onOpen();
|
|
41
|
+
setExpanded(!expanded);
|
|
42
|
+
}, [expanded, onOpen]);
|
|
43
|
+
|
|
44
|
+
const body = <View style={[styles.panelBody]}>{children}</View>;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View style={styles.panelContainer}>
|
|
48
|
+
<Pressable style={[styles.panelHeader, style]} onPress={toggleItem}>
|
|
49
|
+
<Text style={[styles.panelTitle, headerStyle]}>
|
|
50
|
+
<Locale path={title} />
|
|
51
|
+
</Text>
|
|
52
|
+
</Pressable>
|
|
53
|
+
{expanded && body}
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
panelContainer: {
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
},
|
|
62
|
+
panelHeader: {
|
|
63
|
+
paddingVertical: 16,
|
|
64
|
+
},
|
|
65
|
+
panelTitle: {
|
|
66
|
+
fontSize: 14,
|
|
67
|
+
},
|
|
68
|
+
panelBody: {
|
|
69
|
+
backgroundColor: 'rgba(0,0,0,.1)',
|
|
70
|
+
paddingVertical: 16,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Linking,
|
|
3
|
+
type StyleProp,
|
|
4
|
+
Text,
|
|
5
|
+
type TextProps,
|
|
6
|
+
type TextStyle,
|
|
7
|
+
type GestureResponderEvent,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
10
|
+
|
|
11
|
+
import { OsanoPrivateContext } from '../context';
|
|
12
|
+
|
|
13
|
+
type LinkProps = React.PropsWithChildren<
|
|
14
|
+
TextProps & {
|
|
15
|
+
href?: string;
|
|
16
|
+
onPress?: (e?: GestureResponderEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export const Link = (props: LinkProps) => {
|
|
21
|
+
const { config } = useContext(OsanoPrivateContext);
|
|
22
|
+
const { palette } = config || {};
|
|
23
|
+
const { linkColor } = palette || {};
|
|
24
|
+
const linkStyle = useMemo<StyleProp<TextStyle>>(() => {
|
|
25
|
+
return {
|
|
26
|
+
color: linkColor,
|
|
27
|
+
fontSize: 12,
|
|
28
|
+
lineHeight: 16,
|
|
29
|
+
textDecorationLine: 'underline',
|
|
30
|
+
};
|
|
31
|
+
}, [linkColor]);
|
|
32
|
+
|
|
33
|
+
const { children, href, onPress, style, ...remain } = props;
|
|
34
|
+
const handleOnPress = useCallback(
|
|
35
|
+
(e: GestureResponderEvent) => {
|
|
36
|
+
if (onPress) {
|
|
37
|
+
onPress(e);
|
|
38
|
+
} else if (href) {
|
|
39
|
+
Linking.openURL(href);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
[href, onPress],
|
|
43
|
+
);
|
|
44
|
+
return (
|
|
45
|
+
<Text style={[linkStyle, style]} onPress={handleOnPress} {...remain}>
|
|
46
|
+
{children}
|
|
47
|
+
</Text>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FlatList, type FlatListProps, Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import Locale from './Locale';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
type ListType = 'description' | 'expansion' | 'unordered' | 'ordered';
|
|
7
|
+
|
|
8
|
+
type ListProps = React.PropsWithChildren<
|
|
9
|
+
FlatListProps<unknown> & {
|
|
10
|
+
title?: string;
|
|
11
|
+
type?: ListType;
|
|
12
|
+
}
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export const List: React.FC<ListProps> = props => {
|
|
16
|
+
const { title, type, ...remain } = props;
|
|
17
|
+
switch (type) {
|
|
18
|
+
case 'description': {
|
|
19
|
+
return (
|
|
20
|
+
<FlatList
|
|
21
|
+
{...remain}
|
|
22
|
+
ListHeaderComponent={
|
|
23
|
+
title ? (
|
|
24
|
+
<Text
|
|
25
|
+
style={{
|
|
26
|
+
fontWeight: 'bold',
|
|
27
|
+
flexWrap: 'wrap',
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<Locale path={title} />
|
|
31
|
+
</Text>
|
|
32
|
+
) : null
|
|
33
|
+
}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return <FlatList {...remain} />;
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OsanoPrivateContext } from '../context';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
type LocaleOption = Record<string, string>;
|
|
5
|
+
|
|
6
|
+
type LocaleProps = {
|
|
7
|
+
formatter?: (phrase: string) => string;
|
|
8
|
+
path: string | string[];
|
|
9
|
+
options?: Record<string, string | LocaleOption>;
|
|
10
|
+
defaultPhrase?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Locale = (props: LocaleProps = { path: '' }) => {
|
|
14
|
+
const { defaultPhrase, formatter = v => v, path, options = {} } = props;
|
|
15
|
+
const { translate } = useContext(OsanoPrivateContext);
|
|
16
|
+
return (
|
|
17
|
+
(path &&
|
|
18
|
+
formatter(
|
|
19
|
+
translate(
|
|
20
|
+
path,
|
|
21
|
+
Object.entries(options).reduce(
|
|
22
|
+
(acc, [key, value]) => {
|
|
23
|
+
acc[key] =
|
|
24
|
+
typeof value === 'string'
|
|
25
|
+
? (translate(value, options) as string)
|
|
26
|
+
: value;
|
|
27
|
+
return acc;
|
|
28
|
+
},
|
|
29
|
+
{} as Record<string, string | LocaleOption>,
|
|
30
|
+
),
|
|
31
|
+
defaultPhrase,
|
|
32
|
+
) as string,
|
|
33
|
+
)) ||
|
|
34
|
+
null
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default Locale;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Link } from './Link';
|
|
2
|
+
import { OsanoPrivateContext } from '../context';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
|
|
6
|
+
export const StoragePolicyLink = () => {
|
|
7
|
+
const { config, translate } = useContext(OsanoPrivateContext);
|
|
8
|
+
const policyLinkText = config?.policyLinkText;
|
|
9
|
+
const label = translate(
|
|
10
|
+
`buttons.${policyLinkText}`,
|
|
11
|
+
undefined,
|
|
12
|
+
`${translate(`messaging.${policyLinkText}`)}`,
|
|
13
|
+
);
|
|
14
|
+
let href = config?.storagePolicyHref || '';
|
|
15
|
+
// The HREF could be a relative path so we need to format into a fully qualified URL
|
|
16
|
+
// if it is not already.
|
|
17
|
+
if (href) {
|
|
18
|
+
const domains = config?.domains || [];
|
|
19
|
+
href = new URL(href, `https://${domains[0]}`).toString();
|
|
20
|
+
}
|
|
21
|
+
return <Link href={href}>{`${label}`}</Link>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default StoragePolicyLink;
|