@osano/osano-cmp-react-native 0.11.0 โ 0.13.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/README.dev.md +216 -1
- package/README.md +2 -267
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +41 -0
- package/ios/OsanoCmpSDK.mm +42 -0
- package/lib/commonjs/ConsentManager.js +82 -11
- package/lib/commonjs/ConsentManager.js.map +1 -1
- package/lib/commonjs/ConsentUiBuilder.js +10 -7
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -1
- package/lib/commonjs/commands.js +10 -5
- package/lib/commonjs/commands.js.map +1 -1
- package/lib/commonjs/components/Button.js +6 -7
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Checkbox.js +1 -2
- package/lib/commonjs/components/Checkbox.js.map +1 -1
- package/lib/commonjs/components/ExpansionPanel.js +1 -2
- package/lib/commonjs/components/ExpansionPanel.js.map +1 -1
- package/lib/commonjs/components/Link.js +1 -2
- package/lib/commonjs/components/Link.js.map +1 -1
- package/lib/commonjs/components/StoragePolicyLink.js +1 -2
- package/lib/commonjs/components/StoragePolicyLink.js.map +1 -1
- package/lib/commonjs/components/Toggle.js +1 -2
- package/lib/commonjs/components/Toggle.js.map +1 -1
- package/lib/commonjs/context.js +7 -5
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/iab/tcf/consent.js +0 -5
- package/lib/commonjs/iab/tcf/consent.js.map +1 -1
- package/lib/commonjs/iab/tcf/constants.js +34 -1
- package/lib/commonjs/iab/tcf/constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/iab-storage-utils.js +102 -0
- package/lib/commonjs/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +1 -2
- package/lib/commonjs/iab/tcf/index.js.map +1 -1
- package/lib/commonjs/iab/tcf/middleware.js +33 -35
- package/lib/commonjs/iab/tcf/middleware.js.map +1 -1
- package/lib/commonjs/iab/tcf/selectors.js +1 -1
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +1 -2
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -1
- package/lib/commonjs/index.js +54 -15
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/af.json +342 -323
- package/lib/commonjs/locale/ar.json +342 -323
- package/lib/commonjs/locale/bg.json +342 -323
- package/lib/commonjs/locale/ca.json +342 -323
- package/lib/commonjs/locale/cs.json +342 -323
- package/lib/commonjs/locale/da.json +342 -323
- package/lib/commonjs/locale/de-at.json +342 -323
- package/lib/commonjs/locale/de.json +342 -323
- package/lib/commonjs/locale/el.json +342 -323
- package/lib/commonjs/locale/en-au.json +342 -323
- package/lib/commonjs/locale/en-ca.json +342 -323
- package/lib/commonjs/locale/en-gb.json +342 -323
- package/lib/commonjs/locale/en.json +342 -323
- package/lib/commonjs/locale/es-mx.json +342 -323
- package/lib/commonjs/locale/es.json +342 -323
- package/lib/commonjs/locale/et.json +342 -323
- package/lib/commonjs/locale/fa.json +342 -323
- package/lib/commonjs/locale/fi.json +342 -323
- package/lib/commonjs/locale/fr-ca.json +342 -323
- package/lib/commonjs/locale/fr.json +342 -323
- package/lib/commonjs/locale/gd.json +342 -323
- package/lib/commonjs/locale/he.json +342 -323
- package/lib/commonjs/locale/hi.json +342 -323
- package/lib/commonjs/locale/hr.json +342 -323
- package/lib/commonjs/locale/hu.json +342 -323
- package/lib/commonjs/locale/hy.json +342 -323
- package/lib/commonjs/locale/id.json +342 -323
- package/lib/commonjs/locale/is.json +342 -323
- package/lib/commonjs/locale/it.json +342 -323
- package/lib/commonjs/locale/ja.json +342 -323
- package/lib/commonjs/locale/kk.json +342 -323
- package/lib/commonjs/locale/ko.json +342 -323
- package/lib/commonjs/locale/lt.json +342 -323
- package/lib/commonjs/locale/lv.json +342 -323
- package/lib/commonjs/locale/mi.json +342 -323
- package/lib/commonjs/locale/ms.json +342 -323
- package/lib/commonjs/locale/nb.json +342 -323
- package/lib/commonjs/locale/nl-be.json +342 -323
- package/lib/commonjs/locale/nl.json +342 -323
- package/lib/commonjs/locale/nn.json +342 -323
- package/lib/commonjs/locale/no.json +342 -323
- package/lib/commonjs/locale/pl.json +342 -323
- package/lib/commonjs/locale/pt-br.json +342 -323
- package/lib/commonjs/locale/pt.json +342 -323
- package/lib/commonjs/locale/ro.json +342 -323
- package/lib/commonjs/locale/ru.json +342 -323
- package/lib/commonjs/locale/sk.json +342 -323
- package/lib/commonjs/locale/sl.json +342 -323
- package/lib/commonjs/locale/sq.json +342 -323
- package/lib/commonjs/locale/sr.json +342 -323
- package/lib/commonjs/locale/sv.json +342 -323
- package/lib/commonjs/locale/th.json +342 -323
- package/lib/commonjs/locale/tl.json +342 -323
- package/lib/commonjs/locale/tr.json +342 -323
- package/lib/commonjs/locale/uk.json +342 -323
- package/lib/commonjs/locale/vi.json +342 -323
- package/lib/commonjs/locale/zh-hk.json +342 -323
- package/lib/commonjs/locale/zh-tw.json +342 -323
- package/lib/commonjs/locale/zh.json +342 -323
- package/lib/commonjs/locale/zu.json +342 -323
- package/lib/commonjs/native/OsanoCmp.js +16 -0
- package/lib/commonjs/native/OsanoCmp.js.map +1 -1
- package/lib/commonjs/selectors.js +1 -1
- package/lib/commonjs/selectors.js.map +1 -1
- package/lib/commonjs/services/consent.js +60 -8
- package/lib/commonjs/services/consent.js.map +1 -1
- package/lib/commonjs/services/google-consent-mode-mapper.js +109 -0
- package/lib/commonjs/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/commonjs/types/google-consent-mode.js +73 -0
- package/lib/commonjs/types/google-consent-mode.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +0 -2
- package/lib/commonjs/utils/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/OsanoLogger.js +51 -0
- package/lib/commonjs/utils/OsanoLogger.js.map +1 -0
- package/lib/commonjs/utils/Translator.js +2 -2
- package/lib/commonjs/utils/Translator.js.map +1 -1
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/views/Dialog/Buttons.js +1 -2
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js +1 -2
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js.map +1 -1
- package/lib/commonjs/views/Dialog/Message.js +1 -2
- package/lib/commonjs/views/Dialog/Message.js.map +1 -1
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +1 -2
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
- package/lib/commonjs/views/Dialog/index.js +1 -2
- package/lib/commonjs/views/Dialog/index.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Header.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
- package/lib/commonjs/views/Drawer/index.js +1 -2
- package/lib/commonjs/views/Drawer/index.js.map +1 -1
- package/lib/module/ConsentManager.js +81 -9
- package/lib/module/ConsentManager.js.map +1 -1
- package/lib/module/ConsentUiBuilder.js +9 -5
- package/lib/module/ConsentUiBuilder.js.map +1 -1
- package/lib/module/commands.js +10 -5
- package/lib/module/commands.js.map +1 -1
- package/lib/module/components/Button.js +5 -5
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/context.js +7 -5
- package/lib/module/context.js.map +1 -1
- package/lib/module/iab/tcf/consent.js +0 -5
- package/lib/module/iab/tcf/consent.js.map +1 -1
- package/lib/module/iab/tcf/constants.js +32 -0
- package/lib/module/iab/tcf/constants.js.map +1 -1
- package/lib/module/iab/tcf/iab-storage-utils.js +89 -0
- package/lib/module/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/module/iab/tcf/middleware.js +25 -27
- package/lib/module/iab/tcf/middleware.js.map +1 -1
- package/lib/module/iab/tcf/selectors.js +1 -1
- package/lib/module/iab/tcf/selectors.js.map +1 -1
- package/lib/module/index.js +47 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/locale/af.json +342 -323
- package/lib/module/locale/ar.json +342 -323
- package/lib/module/locale/bg.json +342 -323
- package/lib/module/locale/ca.json +342 -323
- package/lib/module/locale/cs.json +342 -323
- package/lib/module/locale/da.json +342 -323
- package/lib/module/locale/de-at.json +342 -323
- package/lib/module/locale/de.json +342 -323
- package/lib/module/locale/el.json +342 -323
- package/lib/module/locale/en-au.json +342 -323
- package/lib/module/locale/en-ca.json +342 -323
- package/lib/module/locale/en-gb.json +342 -323
- package/lib/module/locale/en.json +342 -323
- package/lib/module/locale/es-mx.json +342 -323
- package/lib/module/locale/es.json +342 -323
- package/lib/module/locale/et.json +342 -323
- package/lib/module/locale/fa.json +342 -323
- package/lib/module/locale/fi.json +342 -323
- package/lib/module/locale/fr-ca.json +342 -323
- package/lib/module/locale/fr.json +342 -323
- package/lib/module/locale/gd.json +342 -323
- package/lib/module/locale/he.json +342 -323
- package/lib/module/locale/hi.json +342 -323
- package/lib/module/locale/hr.json +342 -323
- package/lib/module/locale/hu.json +342 -323
- package/lib/module/locale/hy.json +342 -323
- package/lib/module/locale/id.json +342 -323
- package/lib/module/locale/is.json +342 -323
- package/lib/module/locale/it.json +342 -323
- package/lib/module/locale/ja.json +342 -323
- package/lib/module/locale/kk.json +342 -323
- package/lib/module/locale/ko.json +342 -323
- package/lib/module/locale/lt.json +342 -323
- package/lib/module/locale/lv.json +342 -323
- package/lib/module/locale/mi.json +342 -323
- package/lib/module/locale/ms.json +342 -323
- package/lib/module/locale/nb.json +342 -323
- package/lib/module/locale/nl-be.json +342 -323
- package/lib/module/locale/nl.json +342 -323
- package/lib/module/locale/nn.json +342 -323
- package/lib/module/locale/no.json +342 -323
- package/lib/module/locale/pl.json +342 -323
- package/lib/module/locale/pt-br.json +342 -323
- package/lib/module/locale/pt.json +342 -323
- package/lib/module/locale/ro.json +342 -323
- package/lib/module/locale/ru.json +342 -323
- package/lib/module/locale/sk.json +342 -323
- package/lib/module/locale/sl.json +342 -323
- package/lib/module/locale/sq.json +342 -323
- package/lib/module/locale/sr.json +342 -323
- package/lib/module/locale/sv.json +342 -323
- package/lib/module/locale/th.json +342 -323
- package/lib/module/locale/tl.json +342 -323
- package/lib/module/locale/tr.json +342 -323
- package/lib/module/locale/uk.json +342 -323
- package/lib/module/locale/vi.json +342 -323
- package/lib/module/locale/zh-hk.json +342 -323
- package/lib/module/locale/zh-tw.json +342 -323
- package/lib/module/locale/zh.json +342 -323
- package/lib/module/locale/zu.json +342 -323
- package/lib/module/native/OsanoCmp.js +12 -0
- package/lib/module/native/OsanoCmp.js.map +1 -1
- package/lib/module/selectors.js +1 -1
- package/lib/module/selectors.js.map +1 -1
- package/lib/module/services/consent.js +54 -7
- package/lib/module/services/consent.js.map +1 -1
- package/lib/module/services/google-consent-mode-mapper.js +103 -0
- package/lib/module/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/module/types/google-consent-mode.js +70 -0
- package/lib/module/types/google-consent-mode.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +0 -2
- package/lib/module/utils/EventEmitter.js.map +1 -1
- package/lib/module/utils/OsanoLogger.js +44 -0
- package/lib/module/utils/OsanoLogger.js.map +1 -0
- package/lib/module/utils/Translator.js +2 -2
- package/lib/module/utils/Translator.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts +17 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/commands.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Link.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts +7 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/consent.d.ts +4 -0
- package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts +72 -0
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts +32 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts +16 -0
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentManager.d.ts +18 -2
- package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts +1 -0
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/module/actions.d.ts.map +1 -1
- package/lib/typescript/lib/module/commands.d.ts +1 -1
- package/lib/typescript/lib/module/commands.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/context.d.ts +10 -1
- package/lib/typescript/lib/module/context.d.ts.map +1 -1
- package/lib/typescript/lib/module/flavors/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts +8 -0
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +5 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/module/reducer.d.ts +7 -1
- package/lib/typescript/lib/module/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/services/consent.d.ts +4 -0
- package/lib/typescript/lib/module/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts +71 -0
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts +38 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/module/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/index.d.ts +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +24 -7
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/src/commands.d.ts.map +1 -1
- package/lib/typescript/src/components/Button.d.ts +1 -1
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts.map +1 -1
- package/lib/typescript/src/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/src/components/Link.d.ts.map +1 -1
- package/lib/typescript/src/components/Locale.d.ts.map +1 -1
- package/lib/typescript/src/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/src/context.d.ts +5 -2
- package/lib/typescript/src/context.d.ts.map +1 -1
- package/lib/typescript/src/iab/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/src/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/constants.d.ts +32 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/helpers.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts +24 -0
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/src/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/utilities.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/src/reducer.d.ts.map +1 -1
- package/lib/typescript/src/selectors.d.ts.map +1 -1
- package/lib/typescript/src/services/consent.d.ts +13 -2
- package/lib/typescript/src/services/consent.d.ts.map +1 -1
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts +66 -0
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/src/styles.d.ts.map +1 -1
- package/lib/typescript/src/types/google-consent-mode.d.ts +77 -0
- package/lib/typescript/src/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/src/utils/Color.d.ts.map +1 -1
- package/lib/typescript/src/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/src/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/ConsentManager.ts +131 -22
- package/src/ConsentUiBuilder.tsx +23 -13
- package/src/commands.ts +11 -8
- package/src/components/Button.tsx +17 -17
- package/src/context.ts +14 -9
- package/src/iab/tcf/consent.ts +11 -16
- package/src/iab/tcf/constants.ts +46 -0
- package/src/iab/tcf/iab-storage-utils.ts +166 -0
- package/src/iab/tcf/middleware.ts +43 -51
- package/src/index.tsx +77 -22
- package/src/locale/af.json +342 -323
- package/src/locale/ar.json +342 -323
- package/src/locale/bg.json +342 -323
- package/src/locale/ca.json +342 -323
- package/src/locale/cs.json +342 -323
- package/src/locale/da.json +342 -323
- package/src/locale/de-at.json +342 -323
- package/src/locale/de.json +342 -323
- package/src/locale/el.json +342 -323
- package/src/locale/en-au.json +342 -323
- package/src/locale/en-ca.json +342 -323
- package/src/locale/en-gb.json +342 -323
- package/src/locale/en.json +342 -323
- package/src/locale/es-mx.json +342 -323
- package/src/locale/es.json +342 -323
- package/src/locale/et.json +342 -323
- package/src/locale/fa.json +342 -323
- package/src/locale/fi.json +342 -323
- package/src/locale/fr-ca.json +342 -323
- package/src/locale/fr.json +342 -323
- package/src/locale/gd.json +342 -323
- package/src/locale/he.json +342 -323
- package/src/locale/hi.json +342 -323
- package/src/locale/hr.json +342 -323
- package/src/locale/hu.json +342 -323
- package/src/locale/hy.json +342 -323
- package/src/locale/id.json +342 -323
- package/src/locale/is.json +342 -323
- package/src/locale/it.json +342 -323
- package/src/locale/ja.json +342 -323
- package/src/locale/kk.json +342 -323
- package/src/locale/ko.json +342 -323
- package/src/locale/lt.json +342 -323
- package/src/locale/lv.json +342 -323
- package/src/locale/mi.json +342 -323
- package/src/locale/ms.json +342 -323
- package/src/locale/nb.json +342 -323
- package/src/locale/nl-be.json +342 -323
- package/src/locale/nl.json +342 -323
- package/src/locale/nn.json +342 -323
- package/src/locale/no.json +342 -323
- package/src/locale/pl.json +342 -323
- package/src/locale/pt-br.json +342 -323
- package/src/locale/pt.json +342 -323
- package/src/locale/ro.json +342 -323
- package/src/locale/ru.json +342 -323
- package/src/locale/sk.json +342 -323
- package/src/locale/sl.json +342 -323
- package/src/locale/sq.json +342 -323
- package/src/locale/sr.json +342 -323
- package/src/locale/sv.json +342 -323
- package/src/locale/th.json +342 -323
- package/src/locale/tl.json +342 -323
- package/src/locale/tr.json +342 -323
- package/src/locale/uk.json +342 -323
- package/src/locale/vi.json +342 -323
- package/src/locale/zh-hk.json +342 -323
- package/src/locale/zh-tw.json +342 -323
- package/src/locale/zh.json +342 -323
- package/src/locale/zu.json +342 -323
- package/src/native/OsanoCmp.ts +29 -0
- package/src/selectors.ts +1 -0
- package/src/services/consent.ts +75 -9
- package/src/services/google-consent-mode-mapper.ts +122 -0
- package/src/types/consent-config.d.ts +0 -3
- package/src/types/google-consent-mode.ts +122 -0
- package/src/types/index.d.ts +4 -2
- package/src/utils/EventEmitter.ts +1 -3
- package/src/utils/OsanoLogger.ts +53 -0
- package/src/utils/Translator.ts +15 -15
- package/src/utils/index.ts +2 -0
package/src/commands.ts
CHANGED
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
SAVE_SUCCESS,
|
|
8
8
|
} from './actions';
|
|
9
9
|
import type { ConsentManager } from './ConsentManager';
|
|
10
|
-
import type { OsanoAction, OsanoState } from './types/store';
|
|
11
10
|
import {
|
|
12
11
|
getConsent,
|
|
13
12
|
hasFetchedDisclosuresForCategory,
|
|
14
13
|
isLoadingDisclosures,
|
|
15
14
|
} from './selectors';
|
|
15
|
+
import type { OsanoAction, OsanoState } from './types/store';
|
|
16
16
|
|
|
17
17
|
import { type ConsentCategory as ConsentCategoryType } from './constants';
|
|
18
|
-
import { fetchDisclosures } from './services/disclosures';
|
|
19
|
-
import { recordConsent } from './services/consent';
|
|
20
18
|
import type { AsyncAction } from './hooks/useThunkReducer';
|
|
19
|
+
import { recordConsent } from './services/consent';
|
|
20
|
+
import { fetchDisclosures } from './services/disclosures';
|
|
21
21
|
|
|
22
22
|
export const toggleDisclosure =
|
|
23
23
|
(payload: {
|
|
@@ -47,7 +47,7 @@ export const toggleDisclosure =
|
|
|
47
47
|
customerId,
|
|
48
48
|
configId,
|
|
49
49
|
undefined /* category */,
|
|
50
|
-
state.locale
|
|
50
|
+
state.locale,
|
|
51
51
|
)
|
|
52
52
|
.then((response) => {
|
|
53
53
|
const disclosureResults = response || [];
|
|
@@ -70,7 +70,7 @@ export const toggleDisclosure =
|
|
|
70
70
|
|
|
71
71
|
export const saveConsent =
|
|
72
72
|
(
|
|
73
|
-
cmp: ConsentManager
|
|
73
|
+
cmp: ConsentManager,
|
|
74
74
|
): AsyncAction<
|
|
75
75
|
OsanoState,
|
|
76
76
|
OsanoAction<
|
|
@@ -87,9 +87,12 @@ export const saveConsent =
|
|
|
87
87
|
const consent = getConsent(state);
|
|
88
88
|
dispatch({ type: SAVE_BEGIN });
|
|
89
89
|
return recordConsent(cmp, consent)
|
|
90
|
-
.then((newConsent: ConsentCategoryType[] | null) =>
|
|
91
|
-
dispatch({ type: SAVE_SUCCESS, payload: newConsent })
|
|
92
|
-
|
|
90
|
+
.then((newConsent: ConsentCategoryType[] | null) => {
|
|
91
|
+
dispatch({ type: SAVE_SUCCESS, payload: newConsent });
|
|
92
|
+
if (newConsent) {
|
|
93
|
+
cmp.triggerGoogleConsentUpdate(newConsent);
|
|
94
|
+
}
|
|
95
|
+
})
|
|
93
96
|
.catch(() => {
|
|
94
97
|
dispatch({ type: SAVE_FAILURE, payload: oldConsent });
|
|
95
98
|
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Pressable,
|
|
4
4
|
type PressableProps,
|
|
5
5
|
type StyleProp,
|
|
6
6
|
Text,
|
|
7
7
|
type TextStyle,
|
|
8
|
-
type ViewStyle,
|
|
9
8
|
type View,
|
|
9
|
+
type ViewStyle,
|
|
10
10
|
} from 'react-native';
|
|
11
|
-
import
|
|
11
|
+
import { Path, Polygon, Svg } from 'react-native-svg';
|
|
12
12
|
import { acceptAll, close, denyAll, goBack, showDrawer } from '../actions';
|
|
13
13
|
import { saveConsent } from '../commands';
|
|
14
14
|
|
|
15
|
-
import Locale from './Locale';
|
|
16
15
|
import { OsanoPrivateContext } from '../context';
|
|
17
16
|
import {
|
|
18
17
|
setAllPurposeConsent,
|
|
19
18
|
setAllSpecialFeatureConsent,
|
|
20
19
|
setAllVendorConsent,
|
|
21
20
|
} from '../iab/tcf/actions';
|
|
21
|
+
import Locale from './Locale';
|
|
22
22
|
|
|
23
23
|
type ButtonProps = React.PropsWithoutRef<
|
|
24
24
|
Omit<PressableProps, 'style' | 'title'> & {
|
|
@@ -44,7 +44,7 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
|
|
44
44
|
paddingHorizontal: 16,
|
|
45
45
|
flexBasis: 'auto',
|
|
46
46
|
}),
|
|
47
|
-
[buttonBackgroundColor, buttonForegroundColor]
|
|
47
|
+
[buttonBackgroundColor, buttonForegroundColor],
|
|
48
48
|
);
|
|
49
49
|
const buttonText: StyleProp<TextStyle> = useMemo(
|
|
50
50
|
() => ({
|
|
@@ -52,7 +52,7 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
|
|
52
52
|
fontSize: 16,
|
|
53
53
|
fontWeight: 'bold',
|
|
54
54
|
}),
|
|
55
|
-
[buttonForegroundColor]
|
|
55
|
+
[buttonForegroundColor],
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
return (
|
|
@@ -71,7 +71,7 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
|
|
71
71
|
|
|
72
72
|
export const DenyButton = (props: ButtonProps) => {
|
|
73
73
|
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
74
|
-
const { onPress, title
|
|
74
|
+
const { onPress, title, testID } = props;
|
|
75
75
|
|
|
76
76
|
const handleReject = useCallback(() => {
|
|
77
77
|
dispatch(setAllVendorConsent(false));
|
|
@@ -84,9 +84,9 @@ export const DenyButton = (props: ButtonProps) => {
|
|
|
84
84
|
|
|
85
85
|
return Button({
|
|
86
86
|
...props,
|
|
87
|
-
title: title ||
|
|
87
|
+
title: title || 'buttons.denyNonEssential',
|
|
88
88
|
onPress: onPress || handleReject,
|
|
89
|
-
testID: testID || '
|
|
89
|
+
testID: testID || 'DenyNonEssential',
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
92
|
|
|
@@ -104,7 +104,7 @@ export const AcceptButton = (props: ButtonProps) => {
|
|
|
104
104
|
...props,
|
|
105
105
|
title: title || 'buttons.accept',
|
|
106
106
|
onPress: onPress || handleAcceptConsent,
|
|
107
|
-
testID: 'Accept'
|
|
107
|
+
testID: 'Accept',
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
110
|
|
|
@@ -113,7 +113,7 @@ export const CloseButton = React.forwardRef(
|
|
|
113
113
|
props: PressableProps & {
|
|
114
114
|
color?: string;
|
|
115
115
|
},
|
|
116
|
-
ref: React.Ref<View
|
|
116
|
+
ref: React.Ref<View>,
|
|
117
117
|
) => {
|
|
118
118
|
const { color = '#fafafa', onPress, ...remain } = props;
|
|
119
119
|
const { cmp, dispatch } = useContext(OsanoPrivateContext);
|
|
@@ -134,13 +134,13 @@ export const CloseButton = React.forwardRef(
|
|
|
134
134
|
</Svg>
|
|
135
135
|
</Pressable>
|
|
136
136
|
);
|
|
137
|
-
}
|
|
137
|
+
},
|
|
138
138
|
);
|
|
139
139
|
|
|
140
140
|
export const BackButton = (
|
|
141
141
|
props: PressableProps & {
|
|
142
142
|
color?: string;
|
|
143
|
-
}
|
|
143
|
+
},
|
|
144
144
|
) => {
|
|
145
145
|
const { color = '#fafafa', onPress, ...remain } = props;
|
|
146
146
|
const { dispatch } = useContext(OsanoPrivateContext);
|
|
@@ -169,7 +169,7 @@ export const ManagePreferencesButton = (props: ButtonProps) => {
|
|
|
169
169
|
onPress: onPress || handleShowDrawer,
|
|
170
170
|
title: `buttons.dialog.openDrawer.${config?.jurisdiction}`,
|
|
171
171
|
defaultPhrase: 'buttons.managePreferences',
|
|
172
|
-
testID: `Manage Preferences
|
|
172
|
+
testID: `Manage Preferences`,
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
175
|
|
|
@@ -179,7 +179,7 @@ export const RejectAllButton = (props: ButtonProps) => {
|
|
|
179
179
|
...props,
|
|
180
180
|
title: `buttons.dialog.denyAll.${config?.jurisdiction}`,
|
|
181
181
|
defaultPhrase: 'buttons.denyAll',
|
|
182
|
-
testID: `Reject All
|
|
182
|
+
testID: `Reject All`,
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
185
|
|
|
@@ -196,7 +196,7 @@ export const SaveButton = (props: ButtonProps) => {
|
|
|
196
196
|
...props,
|
|
197
197
|
title: title || `buttons.save`,
|
|
198
198
|
onPress: onPress || handleSave,
|
|
199
|
-
testID: `Save
|
|
199
|
+
testID: `Save`,
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
202
|
|
|
@@ -216,6 +216,6 @@ export const AcceptAllButton = (props: ButtonProps) => {
|
|
|
216
216
|
...remain,
|
|
217
217
|
onPress: onPress || handleAcceptAllConsent,
|
|
218
218
|
title: `buttons.acceptAll`,
|
|
219
|
-
testID: `Accept All
|
|
219
|
+
testID: `Accept All`,
|
|
220
220
|
});
|
|
221
221
|
};
|
package/src/context.ts
CHANGED
|
@@ -5,14 +5,15 @@ import type {
|
|
|
5
5
|
Store,
|
|
6
6
|
ThunkDispatch,
|
|
7
7
|
} from './hooks/useThunkReducer';
|
|
8
|
+
import type { GoogleConsentModeCallback } from './types/google-consent-mode';
|
|
8
9
|
import type { OsanoAction, OsanoState } from './types/store';
|
|
9
10
|
|
|
10
|
-
import { ConsentCategory } from './constants';
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import
|
|
13
|
-
import { createSharedStyles } from './styles';
|
|
12
|
+
import { ConsentCategory } from './constants';
|
|
14
13
|
import { initialState } from './reducer';
|
|
14
|
+
import { createSharedStyles } from './styles';
|
|
15
15
|
import { noop } from './utils';
|
|
16
|
+
import Translator from './utils/Translator';
|
|
16
17
|
|
|
17
18
|
type OsanoPublicContextType = {
|
|
18
19
|
locale: string;
|
|
@@ -20,23 +21,24 @@ type OsanoPublicContextType = {
|
|
|
20
21
|
getDeviceId: () => string;
|
|
21
22
|
clearConsent: () => void;
|
|
22
23
|
consent: (
|
|
23
|
-
consent?: ConsentCategory | ConsentCategory[]
|
|
24
|
+
consent?: ConsentCategory | ConsentCategory[],
|
|
24
25
|
) => Promise<ConsentCategory[]>;
|
|
25
26
|
setLocale: (locale: string) => void;
|
|
26
27
|
showBanner: () => void;
|
|
27
28
|
showDrawer: () => void;
|
|
29
|
+
isReady: boolean;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
type OsanoPrivateContextType = {
|
|
31
33
|
addMiddleware: (
|
|
32
34
|
m: (
|
|
33
|
-
store: Store<OsanoState, OsanoAction
|
|
34
|
-
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction
|
|
35
|
+
store: Store<OsanoState, OsanoAction>,
|
|
36
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>,
|
|
35
37
|
) => void;
|
|
36
38
|
removeMiddleware: (
|
|
37
39
|
m: (
|
|
38
|
-
store: Store<OsanoState, OsanoAction
|
|
39
|
-
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction
|
|
40
|
+
store: Store<OsanoState, OsanoAction>,
|
|
41
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>,
|
|
40
42
|
) => void;
|
|
41
43
|
cmp?: ConsentManager;
|
|
42
44
|
config?: ConsentConfig;
|
|
@@ -47,6 +49,7 @@ type OsanoPrivateContextType = {
|
|
|
47
49
|
locale: string;
|
|
48
50
|
sharedStyles: ReturnType<typeof createSharedStyles>;
|
|
49
51
|
translate: Translator['translate'];
|
|
52
|
+
setGoogleConsentModeCallback: (callback: GoogleConsentModeCallback) => void;
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
export const OsanoPublicContext = React.createContext<OsanoPublicContextType>({
|
|
@@ -60,6 +63,7 @@ export const OsanoPublicContext = React.createContext<OsanoPublicContextType>({
|
|
|
60
63
|
setLocale: noop,
|
|
61
64
|
showBanner: noop,
|
|
62
65
|
showDrawer: noop,
|
|
66
|
+
isReady: false,
|
|
63
67
|
});
|
|
64
68
|
|
|
65
69
|
export const OsanoPrivateContext = React.createContext<OsanoPrivateContextType>(
|
|
@@ -75,5 +79,6 @@ export const OsanoPrivateContext = React.createContext<OsanoPrivateContextType>(
|
|
|
75
79
|
locale: 'en',
|
|
76
80
|
sharedStyles: createSharedStyles(),
|
|
77
81
|
translate: () => '',
|
|
78
|
-
|
|
82
|
+
setGoogleConsentModeCallback: noop,
|
|
83
|
+
},
|
|
79
84
|
);
|
package/src/iab/tcf/consent.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const commonConsent = {
|
|
|
38
38
|
export const getVendorConsents = (
|
|
39
39
|
config: ConsentConfig,
|
|
40
40
|
state: OsanoState & IabState,
|
|
41
|
-
apiVersion: TcfVersionType
|
|
41
|
+
apiVersion: TcfVersionType,
|
|
42
42
|
) => {
|
|
43
43
|
const vendors = config.getVendors();
|
|
44
44
|
/*
|
|
@@ -53,7 +53,7 @@ export const getVendorConsents = (
|
|
|
53
53
|
*/
|
|
54
54
|
const purposeConsent = consentToPurpose(
|
|
55
55
|
getSavedConsent(state) || getConsent(state),
|
|
56
|
-
apiVersion
|
|
56
|
+
apiVersion,
|
|
57
57
|
);
|
|
58
58
|
|
|
59
59
|
const consents: Record<string, boolean> = Object.entries(vendors).reduce(
|
|
@@ -81,7 +81,7 @@ export const getVendorConsents = (
|
|
|
81
81
|
}
|
|
82
82
|
return vendorConsents;
|
|
83
83
|
},
|
|
84
|
-
{} as Record<string, boolean
|
|
84
|
+
{} as Record<string, boolean>,
|
|
85
85
|
);
|
|
86
86
|
return consents;
|
|
87
87
|
};
|
|
@@ -89,7 +89,7 @@ export const getVendorConsents = (
|
|
|
89
89
|
export const getVendorLegitimateInterests = (
|
|
90
90
|
config: ConsentConfig,
|
|
91
91
|
state: IabState & OsanoState,
|
|
92
|
-
apiVersion: TcfVersionType
|
|
92
|
+
apiVersion: TcfVersionType,
|
|
93
93
|
) => {
|
|
94
94
|
/*
|
|
95
95
|
* Unless a use has specifically opted out of a vendor, the consent
|
|
@@ -131,7 +131,7 @@ export const getVendorLegitimateInterests = (
|
|
|
131
131
|
// If any legIntPurposes is not opted out
|
|
132
132
|
(legIntPurposes &&
|
|
133
133
|
legIntPurposes.some(
|
|
134
|
-
(purposeId) => !optOutPurposes[`${purposeId}`]
|
|
134
|
+
(purposeId) => !optOutPurposes[`${purposeId}`],
|
|
135
135
|
)) ||
|
|
136
136
|
/**
|
|
137
137
|
* Per June 2021 Policy change, Vendors declaring only
|
|
@@ -145,7 +145,7 @@ export const getVendorLegitimateInterests = (
|
|
|
145
145
|
vendorLegitimateInterests[`${vendorId}`] = true;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}
|
|
148
|
+
},
|
|
149
149
|
);
|
|
150
150
|
return vendorLegitimateInterests;
|
|
151
151
|
};
|
|
@@ -181,7 +181,7 @@ export const makeParseConsentString =
|
|
|
181
181
|
set(tcData, fieldName, decodedValue);
|
|
182
182
|
return startBit + bitLength;
|
|
183
183
|
},
|
|
184
|
-
0
|
|
184
|
+
0,
|
|
185
185
|
);
|
|
186
186
|
return tcData as unknown as TcData;
|
|
187
187
|
};
|
|
@@ -231,7 +231,7 @@ export const makeConsentFromOptions =
|
|
|
231
231
|
acc[`${field}`] = getter(initOptions, state);
|
|
232
232
|
return acc;
|
|
233
233
|
},
|
|
234
|
-
{} as Record<string, any
|
|
234
|
+
{} as Record<string, any>,
|
|
235
235
|
);
|
|
236
236
|
return {
|
|
237
237
|
version: staticFields.version,
|
|
@@ -260,7 +260,7 @@ export const makeConsentFromOptions =
|
|
|
260
260
|
legitimateInterests: getVendorLegitimateInterests(
|
|
261
261
|
config,
|
|
262
262
|
state,
|
|
263
|
-
version
|
|
263
|
+
version,
|
|
264
264
|
),
|
|
265
265
|
},
|
|
266
266
|
specialFeatureOptins: getSpecialFeatureOptIns(state, version),
|
|
@@ -287,7 +287,7 @@ export const makeFormatConsentString =
|
|
|
287
287
|
const [bitFields] = coreFieldSequence.reduce(
|
|
288
288
|
(
|
|
289
289
|
[bitString, startBit],
|
|
290
|
-
[key, numBits, { encode: encodeField }, dataField = key]
|
|
290
|
+
[key, numBits, { encode: encodeField }, dataField = key],
|
|
291
291
|
) => {
|
|
292
292
|
let value;
|
|
293
293
|
if (Object.hasOwnProperty.call(staticFields, dataField)) {
|
|
@@ -297,15 +297,10 @@ export const makeFormatConsentString =
|
|
|
297
297
|
} else {
|
|
298
298
|
value = get(tcData, dataField);
|
|
299
299
|
}
|
|
300
|
-
// if (process.env.NODE_ENV === 'development') {
|
|
301
|
-
// console.log(
|
|
302
|
-
// `TCString encode: ${dataField} -> ${JSON.stringify(value)} :: ${numBits} bits`
|
|
303
|
-
// );
|
|
304
|
-
// }
|
|
305
300
|
const encodedValue = encodeField(value, numBits);
|
|
306
301
|
return [bitString + encodedValue, startBit + encodedValue.length];
|
|
307
302
|
},
|
|
308
|
-
['', 0]
|
|
303
|
+
['', 0],
|
|
309
304
|
);
|
|
310
305
|
const newCoreString = encode(bitFields);
|
|
311
306
|
segments.unshift(newCoreString);
|
package/src/iab/tcf/constants.ts
CHANGED
|
@@ -21,6 +21,52 @@ export const DisplayStatusCodes = {
|
|
|
21
21
|
DISABLED: 'disabled',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
export const IABKeys = {
|
|
25
|
+
LEGACY: {
|
|
26
|
+
CMP_PRESENT: 'IABConsent_CMPPresent',
|
|
27
|
+
SUBJECT_TO_GDPR: 'IABConsent_SubjectToGDPR',
|
|
28
|
+
CONSENT_STRING: 'IABConsent_ConsentString',
|
|
29
|
+
PARSED_PURPOSE_CONSENTS: 'IABConsent_ParsedPurposeConsents',
|
|
30
|
+
PARSED_VENDOR_CONSENTS: 'IABConsent_ParsedVendorConsents',
|
|
31
|
+
},
|
|
32
|
+
IABTCF: {
|
|
33
|
+
CMP_SDK_ID: 'IABTCF_CmpSdkID',
|
|
34
|
+
CMP_SDK_VERSION: 'IABTCF_CmpSdkVersion',
|
|
35
|
+
POLICY_VERSION: 'IABTCF_PolicyVersion',
|
|
36
|
+
GDPR_APPLIES: 'IABTCF_gdprApplies',
|
|
37
|
+
PUBLISHER_CC: 'IABTCF_PublisherCC',
|
|
38
|
+
PURPOSE_ONE_TREATMENT: 'IABTCF_PurposeOneTreatment',
|
|
39
|
+
USE_NON_STANDARD_TEXTS: 'IABTCF_UseNonStandardTexts',
|
|
40
|
+
TC_STRING: 'IABTCF_TCString',
|
|
41
|
+
VENDOR_CONSENTS: 'IABTCF_VendorConsents',
|
|
42
|
+
VENDOR_LEGITIMATE_INTERESTS: 'IABTCF_VendorLegitimateInterests',
|
|
43
|
+
PURPOSE_CONSENTS: 'IABTCF_PurposeConsents',
|
|
44
|
+
PURPOSE_LEGITIMATE_INTERESTS: 'IABTCF_PurposeLegitimateInterests',
|
|
45
|
+
SPECIAL_FEATURES_OPT_INS: 'IABTCF_SpecialFeaturesOptIns',
|
|
46
|
+
ADDTL_CONSENT: 'IABTCF_AddtlConsent',
|
|
47
|
+
ENABLE_ADVERTISER_CONSENT_MODE: 'IABTCF_EnableAdvertiserConsentMode',
|
|
48
|
+
},
|
|
49
|
+
} as const;
|
|
50
|
+
|
|
51
|
+
export const getAllIABKeys = () => [
|
|
52
|
+
...Object.values(IABKeys.LEGACY),
|
|
53
|
+
...Object.values(IABKeys.IABTCF),
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export const DEFAULT_STORAGE_KEYS = {
|
|
57
|
+
LEGACY: Object.values(IABKeys.LEGACY),
|
|
58
|
+
IABTCF: [
|
|
59
|
+
IABKeys.IABTCF.GDPR_APPLIES,
|
|
60
|
+
IABKeys.IABTCF.TC_STRING,
|
|
61
|
+
IABKeys.IABTCF.PURPOSE_CONSENTS,
|
|
62
|
+
IABKeys.IABTCF.VENDOR_CONSENTS,
|
|
63
|
+
IABKeys.IABTCF.ADDTL_CONSENT,
|
|
64
|
+
IABKeys.IABTCF.ENABLE_ADVERTISER_CONSENT_MODE,
|
|
65
|
+
],
|
|
66
|
+
} as const;
|
|
67
|
+
|
|
68
|
+
export const CUSTOM_STORAGE_KEYS = Object.values(IABKeys.IABTCF);
|
|
69
|
+
|
|
24
70
|
export const purposeIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
25
71
|
export const purposeMap: Record<ConsentCategoryType, number[]> = {
|
|
26
72
|
[ConsentCategory.ESSENTIAL]: [1],
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearStorage,
|
|
3
|
+
clearStorageFromDefault,
|
|
4
|
+
setIntStorageToDefault,
|
|
5
|
+
setStorage,
|
|
6
|
+
setStorageToDefault,
|
|
7
|
+
} from '../../native/OsanoCmp';
|
|
8
|
+
import { osanoLogger } from '../../utils/OsanoLogger';
|
|
9
|
+
import {
|
|
10
|
+
CUSTOM_STORAGE_KEYS,
|
|
11
|
+
DEFAULT_STORAGE_KEYS,
|
|
12
|
+
IABKeys,
|
|
13
|
+
} from './constants';
|
|
14
|
+
|
|
15
|
+
export interface IABConsentData {
|
|
16
|
+
tcString: string;
|
|
17
|
+
cmpId: number;
|
|
18
|
+
cmpVersion: number;
|
|
19
|
+
policyVersion: string;
|
|
20
|
+
publisherCC: string;
|
|
21
|
+
gdprApplies: boolean;
|
|
22
|
+
purposeOneTreatment: boolean;
|
|
23
|
+
useNonStandardStacks: boolean;
|
|
24
|
+
vendorConsentsString: string;
|
|
25
|
+
vendorLegitimateInterestsString: string;
|
|
26
|
+
purposeConsentsString: string;
|
|
27
|
+
purposeLegitimateInterestsString: string;
|
|
28
|
+
specialFeatureOptinsString: string;
|
|
29
|
+
enableAdvertiserConsentMode?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const clearAllIABKeys = (): void => {
|
|
33
|
+
osanoLogger.info('๐งน Clearing all IAB consent keys...');
|
|
34
|
+
|
|
35
|
+
Object.values(IABKeys.LEGACY).forEach((key) => {
|
|
36
|
+
clearStorageFromDefault(key);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
DEFAULT_STORAGE_KEYS.IABTCF.forEach((key) => {
|
|
40
|
+
clearStorageFromDefault(key);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
CUSTOM_STORAGE_KEYS.forEach((key) => {
|
|
44
|
+
clearStorage(key);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
osanoLogger.info(
|
|
48
|
+
'โ
All IAB consent keys cleared from both custom and default storage',
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const setAllIABKeys = (consentData: IABConsentData): void => {
|
|
53
|
+
const {
|
|
54
|
+
tcString,
|
|
55
|
+
cmpId,
|
|
56
|
+
cmpVersion,
|
|
57
|
+
policyVersion,
|
|
58
|
+
publisherCC,
|
|
59
|
+
gdprApplies,
|
|
60
|
+
purposeOneTreatment,
|
|
61
|
+
useNonStandardStacks,
|
|
62
|
+
vendorConsentsString,
|
|
63
|
+
vendorLegitimateInterestsString,
|
|
64
|
+
purposeConsentsString,
|
|
65
|
+
purposeLegitimateInterestsString,
|
|
66
|
+
specialFeatureOptinsString,
|
|
67
|
+
enableAdvertiserConsentMode,
|
|
68
|
+
} = consentData;
|
|
69
|
+
|
|
70
|
+
osanoLogger.info('๐พ Setting IAB consent keys to storage...');
|
|
71
|
+
|
|
72
|
+
const subjectToGDPR = gdprApplies ? '1' : '0';
|
|
73
|
+
|
|
74
|
+
// === Save to Custom Storage ===
|
|
75
|
+
setStorage(IABKeys.IABTCF.CMP_SDK_ID, cmpId.toString());
|
|
76
|
+
setStorage(IABKeys.IABTCF.CMP_SDK_VERSION, cmpVersion.toString());
|
|
77
|
+
setStorage(IABKeys.IABTCF.POLICY_VERSION, policyVersion);
|
|
78
|
+
setStorage(IABKeys.IABTCF.PUBLISHER_CC, publisherCC);
|
|
79
|
+
setStorage(IABKeys.IABTCF.GDPR_APPLIES, subjectToGDPR);
|
|
80
|
+
setStorage(
|
|
81
|
+
IABKeys.IABTCF.PURPOSE_ONE_TREATMENT,
|
|
82
|
+
purposeOneTreatment ? '1' : '0',
|
|
83
|
+
);
|
|
84
|
+
setStorage(
|
|
85
|
+
IABKeys.IABTCF.USE_NON_STANDARD_TEXTS,
|
|
86
|
+
useNonStandardStacks ? '1' : '0',
|
|
87
|
+
);
|
|
88
|
+
setStorage(IABKeys.IABTCF.VENDOR_CONSENTS, vendorConsentsString);
|
|
89
|
+
setStorage(
|
|
90
|
+
IABKeys.IABTCF.VENDOR_LEGITIMATE_INTERESTS,
|
|
91
|
+
vendorLegitimateInterestsString,
|
|
92
|
+
);
|
|
93
|
+
setStorage(IABKeys.IABTCF.PURPOSE_CONSENTS, purposeConsentsString);
|
|
94
|
+
setStorage(
|
|
95
|
+
IABKeys.IABTCF.PURPOSE_LEGITIMATE_INTERESTS,
|
|
96
|
+
purposeLegitimateInterestsString,
|
|
97
|
+
);
|
|
98
|
+
setStorage(
|
|
99
|
+
IABKeys.IABTCF.SPECIAL_FEATURES_OPT_INS,
|
|
100
|
+
specialFeatureOptinsString,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// === Save to Default Storage for AdMob Compatibility ===
|
|
104
|
+
|
|
105
|
+
setStorageToDefault(IABKeys.LEGACY.CMP_PRESENT, 'true');
|
|
106
|
+
setStorageToDefault(IABKeys.LEGACY.SUBJECT_TO_GDPR, subjectToGDPR);
|
|
107
|
+
setStorageToDefault(IABKeys.LEGACY.CONSENT_STRING, tcString);
|
|
108
|
+
setStorageToDefault(
|
|
109
|
+
IABKeys.LEGACY.PARSED_PURPOSE_CONSENTS,
|
|
110
|
+
purposeConsentsString,
|
|
111
|
+
);
|
|
112
|
+
setStorageToDefault(
|
|
113
|
+
IABKeys.LEGACY.PARSED_VENDOR_CONSENTS,
|
|
114
|
+
vendorConsentsString,
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
setIntStorageToDefault(IABKeys.IABTCF.GDPR_APPLIES, gdprApplies ? 1 : 0);
|
|
118
|
+
setStorageToDefault(IABKeys.IABTCF.TC_STRING, tcString);
|
|
119
|
+
setStorageToDefault(IABKeys.IABTCF.PURPOSE_CONSENTS, purposeConsentsString);
|
|
120
|
+
setStorageToDefault(IABKeys.IABTCF.VENDOR_CONSENTS, vendorConsentsString);
|
|
121
|
+
setStorageToDefault(IABKeys.IABTCF.ADDTL_CONSENT, '');
|
|
122
|
+
|
|
123
|
+
// Handle Google Consent Mode integration
|
|
124
|
+
if (enableAdvertiserConsentMode !== undefined) {
|
|
125
|
+
setIntStorageToDefault(
|
|
126
|
+
IABKeys.IABTCF.ENABLE_ADVERTISER_CONSENT_MODE,
|
|
127
|
+
enableAdvertiserConsentMode ? 1 : 0,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const status = enableAdvertiserConsentMode ? 'enabled' : 'disabled';
|
|
131
|
+
const reason = enableAdvertiserConsentMode
|
|
132
|
+
? '(both Google Consent Mode and IAB TCF are applicable)'
|
|
133
|
+
: '(Google Consent Mode or IAB TCF not applicable)';
|
|
134
|
+
|
|
135
|
+
osanoLogger.info(
|
|
136
|
+
`๐ Google TCF integration ${status}: ${IABKeys.IABTCF.ENABLE_ADVERTISER_CONSENT_MODE} = ${enableAdvertiserConsentMode ? 1 : 0} ${reason}`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
osanoLogger.info(
|
|
141
|
+
'โ
IAB consent keys saved to both custom and default storage for AdMob compatibility',
|
|
142
|
+
);
|
|
143
|
+
osanoLogger.debug(
|
|
144
|
+
`๐ Updated IAB keys: CMP=true, SubjectToGDPR=${subjectToGDPR}, PurposeConsents=${purposeConsentsString.length} chars, VendorConsents=${vendorConsentsString.length} chars`,
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const setCustomIABKey = (key: string, value: string): void => {
|
|
149
|
+
setStorage(key, value);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const setDefaultIABKey = (key: string, value: string): void => {
|
|
153
|
+
setStorageToDefault(key, value);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const setDefaultIABKeyAsInt = (key: string, value: number): void => {
|
|
157
|
+
setIntStorageToDefault(key, value);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const clearCustomIABKey = (key: string): void => {
|
|
161
|
+
clearStorage(key);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const clearDefaultIABKey = (key: string): void => {
|
|
165
|
+
clearStorageFromDefault(key);
|
|
166
|
+
};
|