@osano/osano-cmp-react-native 0.1.0 → 0.2.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.md +251 -0
- package/lib/commonjs/ConsentManager.js +209 -69
- package/lib/commonjs/ConsentManager.js.map +1 -1
- package/lib/commonjs/ConsentUiBuilder.js +2 -2
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -1
- package/lib/commonjs/actions.js +84 -0
- package/lib/commonjs/actions.js.map +1 -0
- package/lib/commonjs/commands.js +63 -0
- package/lib/commonjs/commands.js.map +1 -0
- package/lib/commonjs/components/Button.js +35 -25
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Locale.js +5 -3
- package/lib/commonjs/components/Locale.js.map +1 -1
- package/lib/commonjs/context.js +4 -3
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/flavors/index.js +1 -1
- package/lib/commonjs/hooks/usePrevious.js +1 -1
- package/lib/commonjs/hooks/usePrevious.js.map +1 -1
- package/lib/commonjs/hooks/useThunkReducer.js +40 -15
- package/lib/commonjs/hooks/useThunkReducer.js.map +1 -1
- package/lib/commonjs/iab/actions.js +17 -0
- package/lib/commonjs/iab/actions.js.map +1 -0
- package/lib/commonjs/iab/constants.js +3 -1
- package/lib/commonjs/iab/constants.js.map +1 -1
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js +1 -1
- package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -1
- package/lib/commonjs/iab/index.js +33 -0
- package/lib/commonjs/iab/index.js.map +1 -0
- package/lib/commonjs/iab/reducer.js +46 -0
- package/lib/commonjs/iab/reducer.js.map +1 -0
- package/lib/commonjs/iab/tcf/actions.js +74 -14
- package/lib/commonjs/iab/tcf/actions.js.map +1 -1
- package/lib/commonjs/iab/tcf/consent.js +51 -87
- package/lib/commonjs/iab/tcf/consent.js.map +1 -1
- package/lib/commonjs/iab/tcf/constants.js +5 -5
- package/lib/commonjs/iab/tcf/constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/helpers.js +72 -0
- package/lib/commonjs/iab/tcf/helpers.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +5 -3
- package/lib/commonjs/iab/tcf/index.js.map +1 -1
- package/lib/commonjs/iab/tcf/middleware.js +172 -0
- package/lib/commonjs/iab/tcf/middleware.js.map +1 -0
- package/lib/commonjs/iab/tcf/reducer.js +225 -40
- package/lib/commonjs/iab/tcf/reducer.js.map +1 -1
- package/lib/commonjs/iab/tcf/selectors.js +60 -69
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/encoders.js +0 -8
- package/lib/commonjs/iab/tcf/v2.0/encoders.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/formatters.js +5 -7
- package/lib/commonjs/iab/tcf/v2.0/formatters.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/index.js +18 -16
- package/lib/commonjs/iab/tcf/v2.0/index.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +19 -3
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js +2 -14
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js +2 -13
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
- package/lib/commonjs/index.js +77 -30
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/reducer.js +366 -0
- package/lib/commonjs/reducer.js.map +1 -0
- package/lib/commonjs/selectors.js +83 -0
- package/lib/commonjs/selectors.js.map +1 -0
- package/lib/commonjs/services/consent.js +20 -4
- package/lib/commonjs/services/consent.js.map +1 -1
- package/lib/commonjs/styles.js +1 -1
- package/lib/commonjs/styles.js.map +1 -1
- package/lib/commonjs/utils/Translator.js +4 -2
- package/lib/commonjs/utils/Translator.js.map +1 -1
- package/lib/commonjs/utils/index.js +3 -16
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/types.js +2 -0
- package/lib/commonjs/utils/types.js.map +1 -0
- package/lib/commonjs/views/Dialog/Buttons.js +2 -2
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
- package/lib/commonjs/views/Dialog/Message.js +1 -1
- package/lib/commonjs/views/Dialog/Message.js.map +1 -1
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +5 -5
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
- package/lib/commonjs/views/Dialog/index.js +15 -9
- package/lib/commonjs/views/Dialog/index.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +50 -22
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Header.js +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +26 -14
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +60 -36
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
- package/lib/commonjs/views/Drawer/index.js +11 -10
- package/lib/commonjs/views/Drawer/index.js.map +1 -1
- package/lib/module/ConsentManager.js +209 -71
- package/lib/module/ConsentManager.js.map +1 -1
- package/lib/module/ConsentUiBuilder.js +1 -1
- package/lib/module/ConsentUiBuilder.js.map +1 -1
- package/lib/module/actions.js +66 -0
- package/lib/module/actions.js.map +1 -0
- package/lib/module/commands.js +55 -0
- package/lib/module/commands.js.map +1 -0
- package/lib/module/components/Button.js +30 -20
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/components/Locale.js +5 -3
- package/lib/module/components/Locale.js.map +1 -1
- package/lib/module/context.js +3 -2
- package/lib/module/context.js.map +1 -1
- package/lib/module/flavors/index.js +1 -1
- package/lib/module/hooks/usePrevious.js +1 -1
- package/lib/module/hooks/usePrevious.js.map +1 -1
- package/lib/module/hooks/useThunkReducer.js +40 -16
- package/lib/module/hooks/useThunkReducer.js.map +1 -1
- package/lib/module/iab/actions.js +10 -0
- package/lib/module/iab/actions.js.map +1 -0
- package/lib/module/iab/constants.js +2 -0
- package/lib/module/iab/constants.js.map +1 -1
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js +1 -1
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -1
- package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -1
- package/lib/module/iab/index.js +26 -0
- package/lib/module/iab/index.js.map +1 -0
- package/lib/module/iab/reducer.js +39 -0
- package/lib/module/iab/reducer.js.map +1 -0
- package/lib/module/iab/tcf/actions.js +63 -13
- package/lib/module/iab/tcf/actions.js.map +1 -1
- package/lib/module/iab/tcf/consent.js +47 -84
- package/lib/module/iab/tcf/consent.js.map +1 -1
- package/lib/module/iab/tcf/constants.js +5 -5
- package/lib/module/iab/tcf/constants.js.map +1 -1
- package/lib/module/iab/tcf/helpers.js +62 -0
- package/lib/module/iab/tcf/helpers.js.map +1 -0
- package/lib/module/iab/tcf/index.js +3 -3
- package/lib/module/iab/tcf/index.js.map +1 -1
- package/lib/module/iab/tcf/middleware.js +164 -0
- package/lib/module/iab/tcf/middleware.js.map +1 -0
- package/lib/module/iab/tcf/reducer.js +223 -40
- package/lib/module/iab/tcf/reducer.js.map +1 -1
- package/lib/module/iab/tcf/selectors.js +45 -57
- package/lib/module/iab/tcf/selectors.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/encoders.js +0 -9
- package/lib/module/iab/tcf/v2.0/encoders.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/formatters.js +5 -7
- package/lib/module/iab/tcf/v2.0/formatters.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/index.js +18 -16
- package/lib/module/iab/tcf/v2.0/index.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/shared-constants.js +17 -3
- package/lib/module/iab/tcf/v2.0/shared-constants.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js +2 -14
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js +2 -13
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
- package/lib/module/index.js +77 -29
- package/lib/module/index.js.map +1 -1
- package/lib/module/{store.js → reducer.js} +76 -238
- package/lib/module/reducer.js.map +1 -0
- package/lib/module/selectors.js +60 -0
- package/lib/module/selectors.js.map +1 -0
- package/lib/module/services/consent.js +20 -4
- package/lib/module/services/consent.js.map +1 -1
- package/lib/module/styles.js +1 -1
- package/lib/module/styles.js.map +1 -1
- package/lib/module/utils/Translator.js +4 -2
- package/lib/module/utils/Translator.js.map +1 -1
- package/lib/module/utils/index.js +3 -16
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/types.js +2 -0
- package/lib/module/utils/types.js.map +1 -0
- package/lib/module/views/Dialog/Buttons.js +1 -1
- package/lib/module/views/Dialog/Buttons.js.map +1 -1
- package/lib/module/views/Dialog/Message.js +1 -1
- package/lib/module/views/Dialog/Message.js.map +1 -1
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js +4 -4
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
- package/lib/module/views/Dialog/index.js +11 -5
- package/lib/module/views/Dialog/index.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js +41 -12
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.Header.js +1 -0
- package/lib/module/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +24 -12
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js +55 -31
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
- package/lib/module/views/Drawer/index.js +3 -1
- package/lib/module/views/Drawer/index.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +2 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/documentation/babel.config.d.ts +2 -0
- package/lib/typescript/documentation/babel.config.d.ts.map +1 -0
- package/lib/typescript/documentation/docusaurus.config.d.ts +4 -0
- package/lib/typescript/documentation/docusaurus.config.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts +190 -0
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts +3 -0
- package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/actions.d.ts +66 -0
- package/lib/typescript/lib/commonjs/actions.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/commands.d.ts +4 -0
- package/lib/typescript/lib/commonjs/commands.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Button.d.ts +11 -0
- package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Checkbox.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Checkbox.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Divider.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Divider.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts +8 -0
- package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Link.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Link.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/List.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/List.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Locale.d.ts +6 -0
- package/lib/typescript/lib/commonjs/components/Locale.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Toggle.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Toggle.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/constants.d.ts +20 -0
- package/lib/typescript/lib/commonjs/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/context.d.ts +4 -0
- package/lib/typescript/lib/commonjs/context.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/flavors/index.d.ts +122 -0
- package/lib/typescript/lib/commonjs/flavors/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/hooks/useBoundCallback.d.ts +18 -0
- package/lib/typescript/lib/commonjs/hooks/useBoundCallback.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts +4 -0
- package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/hooks/usePrevious.d.ts +3 -0
- package/lib/typescript/lib/commonjs/hooks/usePrevious.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/hooks/useThunkReducer.d.ts +8 -0
- package/lib/typescript/lib/commonjs/hooks/useThunkReducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/actions.d.ts +10 -0
- package/lib/typescript/lib/commonjs/iab/actions.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/constants.d.ts +5 -0
- package/lib/typescript/lib/commonjs/iab/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts +30 -0
- package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts +25 -0
- package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/constants.d.ts +26 -0
- package/lib/typescript/lib/commonjs/iab/gpp/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/BooleanEncoder.d.ts +32 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +10 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +19 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +7 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.d.ts +29 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +10 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/errors.d.ts +17 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/errors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/index.d.ts +16 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/types.d.ts +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/gpp/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/reducer.d.ts +7 -0
- package/lib/typescript/lib/commonjs/iab/gpp/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/selectors.d.ts +7 -0
- package/lib/typescript/lib/commonjs/iab/gpp/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/types.d.ts +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/v1/constants.d.ts +13 -0
- package/lib/typescript/lib/commonjs/iab/gpp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts +14 -0
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/iab/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/reducer.d.ts +6 -0
- package/lib/typescript/lib/commonjs/iab/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/actions.d.ts +64 -0
- package/lib/typescript/lib/commonjs/iab/tcf/actions.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts +59 -0
- package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts +22 -0
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/helpers.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/tcf/helpers.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/iab/tcf/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts +4 -0
- package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts +22 -0
- package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +48 -0
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/types.d.ts +2 -0
- package/lib/typescript/lib/commonjs/iab/tcf/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/encoders.d.ts +14 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/encoders.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/formatters.d.ts +5 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/formatters.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts +191 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts +32 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.d.ts +43 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.d.ts +48 -0
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/types.d.ts +2 -0
- package/lib/typescript/lib/commonjs/iab/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts +6 -0
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts +27 -0
- package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/constants.d.ts +109 -0
- package/lib/typescript/lib/commonjs/iab/usp/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/usp/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/reducer.d.ts +14 -0
- package/lib/typescript/lib/commonjs/iab/usp/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts +10 -0
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/types.d.ts +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/v1/constants.d.ts +13 -0
- package/lib/typescript/lib/commonjs/iab/usp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts +12 -0
- package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/utilities.d.ts +3 -0
- package/lib/typescript/lib/commonjs/iab/utilities.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/locale/index.d.ts +62 -0
- package/lib/typescript/lib/commonjs/locale/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts +6 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/reducer.d.ts +29 -0
- package/lib/typescript/lib/commonjs/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/selectors.d.ts +16 -0
- package/lib/typescript/lib/commonjs/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/services/consent.d.ts +6 -0
- package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/services/disclosures.d.ts +3 -0
- package/lib/typescript/lib/commonjs/services/disclosures.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/services/locale.d.ts +4 -0
- package/lib/typescript/lib/commonjs/services/locale.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/styles.d.ts +141 -0
- package/lib/typescript/lib/commonjs/styles.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/consent-config.d.d.ts +2 -0
- package/lib/typescript/lib/commonjs/types/consent-config.d.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/env.d.d.ts +1 -0
- package/lib/typescript/lib/commonjs/types/env.d.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/index.d.d.ts +2 -0
- package/lib/typescript/lib/commonjs/types/index.d.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/store.d.d.ts +2 -0
- package/lib/typescript/lib/commonjs/types/store.d.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/API.d.ts +7 -0
- package/lib/typescript/lib/commonjs/utils/API.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/Color.d.ts +13 -0
- package/lib/typescript/lib/commonjs/utils/Color.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts +16 -0
- package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts +54 -0
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/index.d.ts +6 -0
- package/lib/typescript/lib/commonjs/utils/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/types.d.ts +1 -0
- package/lib/typescript/lib/commonjs/utils/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts +4 -0
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/ConsentManager.d.ts +347 -0
- package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -0
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts +174 -0
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts.map +1 -0
- package/lib/typescript/lib/module/actions.d.ts +65 -0
- package/lib/typescript/lib/module/actions.d.ts.map +1 -0
- package/lib/typescript/lib/module/commands.d.ts +3 -0
- package/lib/typescript/lib/module/commands.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Button.d.ts +11 -0
- package/lib/typescript/lib/module/components/Button.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Checkbox.d.ts +4 -0
- package/lib/typescript/lib/module/components/Checkbox.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Divider.d.ts +4 -0
- package/lib/typescript/lib/module/components/Divider.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/ExpansionPanel.d.ts +9 -0
- package/lib/typescript/lib/module/components/ExpansionPanel.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Link.d.ts +4 -0
- package/lib/typescript/lib/module/components/Link.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/List.d.ts +4 -0
- package/lib/typescript/lib/module/components/List.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Locale.d.ts +5 -0
- package/lib/typescript/lib/module/components/Locale.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/StoragePolicyLink.d.ts +4 -0
- package/lib/typescript/lib/module/components/StoragePolicyLink.d.ts.map +1 -0
- package/lib/typescript/lib/module/components/Toggle.d.ts +4 -0
- package/lib/typescript/lib/module/components/Toggle.d.ts.map +1 -0
- package/lib/typescript/lib/module/constants.d.ts +19 -0
- package/lib/typescript/lib/module/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/context.d.ts +185 -0
- package/lib/typescript/lib/module/context.d.ts.map +1 -0
- package/lib/typescript/lib/module/flavors/index.d.ts +17 -0
- package/lib/typescript/lib/module/flavors/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/hooks/useBoundCallback.d.ts +17 -0
- package/lib/typescript/lib/module/hooks/useBoundCallback.d.ts.map +1 -0
- package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts +3 -0
- package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts.map +1 -0
- package/lib/typescript/lib/module/hooks/usePrevious.d.ts +2 -0
- package/lib/typescript/lib/module/hooks/usePrevious.d.ts.map +1 -0
- package/lib/typescript/lib/module/hooks/useThunkReducer.d.ts +7 -0
- package/lib/typescript/lib/module/hooks/useThunkReducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/actions.d.ts +9 -0
- package/lib/typescript/lib/module/iab/actions.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/constants.d.ts +4 -0
- package/lib/typescript/lib/module/iab/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/api.d.ts +28 -0
- package/lib/typescript/lib/module/iab/gpp/api.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/consent.d.ts +24 -0
- package/lib/typescript/lib/module/iab/gpp/consent.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/constants.d.ts +37 -0
- package/lib/typescript/lib/module/iab/gpp/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/BooleanEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +9 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/DatetimeEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +18 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +6 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedStringEncoder.d.ts +8 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +9 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/errors.d.ts +16 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/errors.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/index.d.ts +15 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/types.d.ts +1 -0
- package/lib/typescript/lib/module/iab/gpp/encoders/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/index.d.ts +10 -0
- package/lib/typescript/lib/module/iab/gpp/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/reducer.d.ts +6 -0
- package/lib/typescript/lib/module/iab/gpp/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/selectors.d.ts +6 -0
- package/lib/typescript/lib/module/iab/gpp/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/types.d.ts +1 -0
- package/lib/typescript/lib/module/iab/gpp/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts +9 -0
- package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts +19 -0
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/index.d.ts +2 -0
- package/lib/typescript/lib/module/iab/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/reducer.d.ts +5 -0
- package/lib/typescript/lib/module/iab/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/actions.d.ts +63 -0
- package/lib/typescript/lib/module/iab/tcf/actions.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/consent.d.ts +58 -0
- package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts +21 -0
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/helpers.d.ts +8 -0
- package/lib/typescript/lib/module/iab/tcf/helpers.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/index.d.ts +303 -0
- package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/middleware.d.ts +3 -0
- package/lib/typescript/lib/module/iab/tcf/middleware.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/reducer.d.ts +20 -0
- package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +47 -0
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/types.d.ts +2 -0
- package/lib/typescript/lib/module/iab/tcf/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/encoders.d.ts +13 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/encoders.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/formatters.d.ts +4 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/formatters.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +308 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +80 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +104 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +103 -0
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/types.d.ts +2 -0
- package/lib/typescript/lib/module/iab/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/api.d.ts +4 -0
- package/lib/typescript/lib/module/iab/usp/api.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/consent.d.ts +13 -0
- package/lib/typescript/lib/module/iab/usp/consent.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/constants.d.ts +77 -0
- package/lib/typescript/lib/module/iab/usp/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/index.d.ts +10 -0
- package/lib/typescript/lib/module/iab/usp/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/reducer.d.ts +13 -0
- package/lib/typescript/lib/module/iab/usp/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts +9 -0
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/types.d.ts +1 -0
- package/lib/typescript/lib/module/iab/usp/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts +9 -0
- package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts +16 -0
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/utilities.d.ts +2 -0
- package/lib/typescript/lib/module/iab/utilities.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +4 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/locale/index.d.ts +61 -0
- package/lib/typescript/lib/module/locale/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts +5 -0
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -0
- package/lib/typescript/lib/module/reducer.d.ts +28 -0
- package/lib/typescript/lib/module/reducer.d.ts.map +1 -0
- package/lib/typescript/lib/module/selectors.d.ts +15 -0
- package/lib/typescript/lib/module/selectors.d.ts.map +1 -0
- package/lib/typescript/lib/module/services/consent.d.ts +5 -0
- package/lib/typescript/lib/module/services/consent.d.ts.map +1 -0
- package/lib/typescript/lib/module/services/disclosures.d.ts +2 -0
- package/lib/typescript/lib/module/services/disclosures.d.ts.map +1 -0
- package/lib/typescript/lib/module/services/locale.d.ts +3 -0
- package/lib/typescript/lib/module/services/locale.d.ts.map +1 -0
- package/lib/typescript/lib/module/styles.d.ts +140 -0
- package/lib/typescript/lib/module/styles.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/consent-config.d.d.ts +2 -0
- package/lib/typescript/lib/module/types/consent-config.d.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/env.d.d.ts +1 -0
- package/lib/typescript/lib/module/types/env.d.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/index.d.d.ts +2 -0
- package/lib/typescript/lib/module/types/index.d.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/store.d.d.ts +2 -0
- package/lib/typescript/lib/module/types/store.d.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/API.d.ts +6 -0
- package/lib/typescript/lib/module/utils/API.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/Color.d.ts +12 -0
- package/lib/typescript/lib/module/utils/Color.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/EventEmitter.d.ts +15 -0
- package/lib/typescript/lib/module/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/Translator.d.ts +52 -0
- package/lib/typescript/lib/module/utils/Translator.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/index.d.ts +5 -0
- package/lib/typescript/lib/module/utils/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/types.d.ts +1 -0
- package/lib/typescript/lib/module/utils/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts +5 -0
- package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/FirstLayerUsage.d.ts +5 -0
- package/lib/typescript/lib/module/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/Message.d.ts +4 -0
- package/lib/typescript/lib/module/views/Dialog/Message.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/PreferenceManagementDeepLinks.d.ts +6 -0
- package/lib/typescript/lib/module/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/index.d.ts +5 -0
- package/lib/typescript/lib/module/views/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts +5 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts +5 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts +5 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Vendors.d.ts +5 -0
- package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Drawer/index.d.ts +4 -0
- package/lib/typescript/lib/module/views/Drawer/index.d.ts.map +1 -0
- package/lib/typescript/scripts/updateLocalization.d.ts +2 -0
- package/lib/typescript/scripts/updateLocalization.d.ts.map +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +31 -16
- 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/actions.d.ts +42 -0
- package/lib/typescript/src/actions.d.ts.map +1 -0
- package/lib/typescript/src/commands.d.ts +14 -0
- package/lib/typescript/src/commands.d.ts.map +1 -0
- 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/Locale.d.ts +1 -0
- package/lib/typescript/src/components/Locale.d.ts.map +1 -1
- package/lib/typescript/src/context.d.ts +3 -3
- package/lib/typescript/src/context.d.ts.map +1 -1
- package/lib/typescript/src/flavors/index.d.ts +1 -1
- package/lib/typescript/src/hooks/usePrevious.d.ts +1 -1
- package/lib/typescript/src/hooks/usePrevious.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useThunkReducer.d.ts +6 -8
- package/lib/typescript/src/hooks/useThunkReducer.d.ts.map +1 -1
- package/lib/typescript/src/iab/actions.d.ts +7 -0
- package/lib/typescript/src/iab/actions.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 -1
- package/lib/typescript/src/iab/gpp/api.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/api.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/consent.d.ts +24 -0
- package/lib/typescript/src/iab/gpp/consent.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/constants.d.ts +37 -0
- package/lib/typescript/src/iab/gpp/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts +2 -2
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +4 -2
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/index.d.ts +10 -0
- package/lib/typescript/src/iab/gpp/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/reducer.d.ts +6 -0
- package/lib/typescript/src/iab/gpp/reducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/selectors.d.ts +6 -0
- package/lib/typescript/src/iab/gpp/selectors.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/v1/constants.d.ts +9 -0
- package/lib/typescript/src/iab/gpp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/v1/index.d.ts +19 -0
- package/lib/typescript/src/iab/gpp/v1/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/index.d.ts +5 -0
- package/lib/typescript/src/iab/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/reducer.d.ts +6 -0
- package/lib/typescript/src/iab/reducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/actions.d.ts +35 -0
- package/lib/typescript/src/iab/tcf/actions.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/consent.d.ts +25 -0
- package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/helpers.d.ts +15 -0
- package/lib/typescript/src/iab/tcf/helpers.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/index.d.ts +8 -0
- package/lib/typescript/src/iab/tcf/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/middleware.d.ts +4 -0
- package/lib/typescript/src/iab/tcf/middleware.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/reducer.d.ts +59 -0
- package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/selectors.d.ts +52 -0
- package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/types.d.ts +82 -4
- package/lib/typescript/src/iab/tcf/types.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts +35 -6
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts +4 -0
- package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/index.d.ts +7 -0
- package/lib/typescript/src/iab/tcf/v2.0/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts +60 -0
- package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts +77 -0
- package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts +82 -0
- package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/types.d.ts +14 -5
- package/lib/typescript/src/iab/types.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts +4 -0
- package/lib/typescript/src/iab/usp/api.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/consent.d.ts +13 -0
- package/lib/typescript/src/iab/usp/consent.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/constants.d.ts +77 -0
- package/lib/typescript/src/iab/usp/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/index.d.ts +10 -0
- package/lib/typescript/src/iab/usp/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/reducer.d.ts +13 -0
- package/lib/typescript/src/iab/usp/reducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/selectors.d.ts +9 -0
- package/lib/typescript/src/iab/usp/selectors.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/v1/constants.d.ts +9 -0
- package/lib/typescript/src/iab/usp/v1/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/v1/index.d.ts +16 -0
- package/lib/typescript/src/iab/usp/v1/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/locale/index.d.ts +61 -0
- package/lib/typescript/src/locale/index.d.ts.map +1 -0
- package/lib/typescript/src/reducer.d.ts +7 -0
- package/lib/typescript/src/reducer.d.ts.map +1 -0
- package/lib/typescript/src/selectors.d.ts +19 -0
- package/lib/typescript/src/selectors.d.ts.map +1 -0
- package/lib/typescript/src/services/consent.d.ts.map +1 -1
- package/lib/typescript/src/styles.d.ts +2 -2
- package/lib/typescript/src/styles.d.ts.map +1 -1
- package/lib/typescript/src/utils/Translator.d.ts +1 -1
- package/lib/typescript/src/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/types.d.ts +5 -0
- package/lib/typescript/src/utils/types.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -1
- package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -1
- package/package.json +18 -38
- package/src/ConsentManager.ts +325 -120
- package/src/ConsentUiBuilder.tsx +2 -2
- package/src/actions.ts +80 -0
- package/src/commands.ts +96 -0
- package/src/components/Button.tsx +34 -27
- package/src/components/Locale.tsx +30 -16
- package/src/context.ts +12 -12
- package/src/flavors/index.ts +1 -1
- package/src/hooks/usePrevious.ts +1 -1
- package/src/hooks/useThunkReducer.ts +86 -54
- package/src/iab/actions.ts +19 -0
- package/src/iab/constants.ts +2 -0
- package/src/iab/gpp/encoders/FixedIntegerEncoder.ts +1 -1
- package/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.ts +1 -2
- package/src/iab/index.ts +34 -0
- package/src/iab/reducer.ts +38 -0
- package/src/iab/tcf/actions.ts +116 -0
- package/src/iab/tcf/{consent.js → consent.ts} +143 -164
- package/src/iab/tcf/constants.ts +6 -6
- package/src/iab/tcf/helpers.ts +95 -0
- package/src/iab/tcf/index.ts +8 -0
- package/src/iab/tcf/middleware.ts +217 -0
- package/src/iab/tcf/reducer.ts +250 -0
- package/src/iab/tcf/selectors.ts +192 -0
- package/src/iab/tcf/types.ts +108 -4
- package/src/iab/tcf/v2.0/encoders.ts +7 -16
- package/src/iab/tcf/v2.0/formatters.ts +18 -0
- package/src/iab/tcf/v2.0/index.ts +40 -0
- package/src/iab/tcf/v2.0/shared-constants.ts +53 -0
- package/src/iab/tcf/v2.0/{tcfcav1-constants.js → tcfcav1-constants.ts} +4 -15
- package/src/iab/tcf/v2.0/{tcfeuv2-constants.js → tcfeuv2-constants.ts} +4 -14
- package/src/iab/types.ts +21 -5
- package/src/index.tsx +184 -99
- package/src/reducer.ts +416 -0
- package/src/selectors.ts +109 -0
- package/src/services/consent.ts +35 -12
- package/src/styles.ts +3 -5
- package/src/types/consent-config.d.ts +16 -12
- package/src/types/index.d.ts +21 -5
- package/src/types/store.d.ts +14 -4
- package/src/utils/Translator.ts +47 -43
- package/src/utils/index.ts +23 -27
- package/src/utils/types.ts +35 -0
- package/src/views/Dialog/Buttons.tsx +2 -2
- package/src/views/Dialog/Message.tsx +1 -1
- package/src/views/Dialog/PreferenceManagementDeepLinks.tsx +7 -5
- package/src/views/Dialog/index.tsx +22 -38
- package/src/views/Drawer/Drawer.ConsentCategories.tsx +84 -41
- package/src/views/Drawer/Drawer.Header.tsx +3 -2
- package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +71 -41
- package/src/views/Drawer/Drawer.Iab.Vendors.tsx +78 -37
- package/src/views/Drawer/index.tsx +8 -8
- package/lib/commonjs/iab/tcf/tcfcav1-api.js +0 -41
- package/lib/commonjs/iab/tcf/tcfcav1-api.js.map +0 -1
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js +0 -256
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js.map +0 -1
- package/lib/commonjs/iab/tcf/v2.0/helpers.js +0 -25
- package/lib/commonjs/iab/tcf/v2.0/helpers.js.map +0 -1
- package/lib/commonjs/iab/tcf/v2.0/middleware.js +0 -80
- package/lib/commonjs/iab/tcf/v2.0/middleware.js.map +0 -1
- package/lib/commonjs/iab/tcf/v2.0/reducer.js +0 -318
- package/lib/commonjs/iab/tcf/v2.0/reducer.js.map +0 -1
- package/lib/commonjs/store.js +0 -558
- package/lib/commonjs/store.js.map +0 -1
- package/lib/module/iab/tcf/tcfcav1-api.js +0 -35
- package/lib/module/iab/tcf/tcfcav1-api.js.map +0 -1
- package/lib/module/iab/tcf/tcfeuv2-api.js +0 -251
- package/lib/module/iab/tcf/tcfeuv2-api.js.map +0 -1
- package/lib/module/iab/tcf/v2.0/helpers.js +0 -18
- package/lib/module/iab/tcf/v2.0/helpers.js.map +0 -1
- package/lib/module/iab/tcf/v2.0/middleware.js +0 -74
- package/lib/module/iab/tcf/v2.0/middleware.js.map +0 -1
- package/lib/module/iab/tcf/v2.0/reducer.js +0 -311
- package/lib/module/iab/tcf/v2.0/reducer.js.map +0 -1
- package/lib/module/store.js.map +0 -1
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts +0 -5
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts.map +0 -1
- package/lib/typescript/src/store.d.ts +0 -55
- package/lib/typescript/src/store.d.ts.map +0 -1
- package/src/iab/tcf/actions.js +0 -52
- package/src/iab/tcf/index.js +0 -7
- package/src/iab/tcf/reducer.js +0 -59
- package/src/iab/tcf/selectors.js +0 -151
- package/src/iab/tcf/tcfcav1-api.js +0 -39
- package/src/iab/tcf/tcfeuv2-api.js +0 -264
- package/src/iab/tcf/v2.0/formatters.js +0 -14
- package/src/iab/tcf/v2.0/helpers.ts +0 -23
- package/src/iab/tcf/v2.0/index.js +0 -36
- package/src/iab/tcf/v2.0/middleware.js +0 -72
- package/src/iab/tcf/v2.0/reducer.js +0 -327
- package/src/iab/tcf/v2.0/shared-constants.js +0 -17
- package/src/store.ts +0 -602
|
@@ -1,25 +1,8 @@
|
|
|
1
|
+
import { CLEAR_CONSENT, CLOSE, FETCH_DISCLOSURES_BEGIN, FETCH_DISCLOSURES_FAILURE, FETCH_DISCLOSURES_SUCCESS, GO_BACK, RELOAD, REVERT_CONSENT, SAVE_SUCCESS, SET_ALL_CONSENT, SET_CONFIG, SET_LOCALE, SHOW_DIALOG, SHOW_DRAWER, SHOW_IAB_DISCLOSURES, SHOW_IAB_VENDORS, TOGGLE_CATEGORY } from './actions';
|
|
1
2
|
import { ConsentCategory } from './constants';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { recordConsent } from './services/consent';
|
|
3
|
+
import { getFinalOptOutValue, getSavedConsent } from './iab/tcf/selectors';
|
|
4
|
+
import { isAnalyticsAlwaysAllowed, shouldUseGPCOptOut } from './selectors';
|
|
5
5
|
export const OsanoCategories = Object.values(ConsentCategory);
|
|
6
|
-
export const SHOW_DIALOG = 'DIALOG';
|
|
7
|
-
export const SHOW_DRAWER = 'DRAWER';
|
|
8
|
-
export const SHOW_IAB_DISCLOSURES = 'IAB_DISCLOSURES';
|
|
9
|
-
export const SHOW_IAB_VENDORS = 'IAB_VENDORS';
|
|
10
|
-
const CLOSE = 'CLOSE';
|
|
11
|
-
const GO_BACK = 'GO_BACK';
|
|
12
|
-
const RELOAD = 'RELOAD';
|
|
13
|
-
const SET_LOCALE = 'SET_LOCALE';
|
|
14
|
-
const SAVE_BEGIN = '@async-SAVE-begin';
|
|
15
|
-
const SAVE_SUCCESS = 'SAVE_SUCCESS';
|
|
16
|
-
const SAVE_FAILURE = 'SAVE_FAILURE';
|
|
17
|
-
const TOGGLE_CATEGORY = 'TOGGLE_CATEGORY';
|
|
18
|
-
const SET_ALL_CONSENT = 'SET_ALL_CONSENT';
|
|
19
|
-
const FETCH_DISCLOSURES_BEGIN = 'FETCH_DISCLOSURES_BEGIN';
|
|
20
|
-
const FETCH_DISCLOSURES_SUCCESS = 'FETCH_DISCLOSURES_SUCCESS';
|
|
21
|
-
const FETCH_DISCLOSURES_FAILURE = 'FETCH_DISCLOSURES_FAILURE';
|
|
22
|
-
const SET_CONFIG = 'SET_CONFIG';
|
|
23
6
|
export const initialState = {
|
|
24
7
|
config: undefined,
|
|
25
8
|
configId: '',
|
|
@@ -31,6 +14,7 @@ export const initialState = {
|
|
|
31
14
|
[ConsentCategory.ANALYTICS]: false,
|
|
32
15
|
[ConsentCategory.OPT_OUT]: false
|
|
33
16
|
},
|
|
17
|
+
consentTimestamp: 0,
|
|
34
18
|
customerId: '',
|
|
35
19
|
dialogOpen: false,
|
|
36
20
|
disclosures: {
|
|
@@ -39,16 +23,33 @@ export const initialState = {
|
|
|
39
23
|
results: {}
|
|
40
24
|
},
|
|
41
25
|
locale: 'en',
|
|
26
|
+
ready: {
|
|
27
|
+
consent: false
|
|
28
|
+
},
|
|
29
|
+
savedConsent: null,
|
|
42
30
|
scrollToType: '',
|
|
43
31
|
scrollToId: -1,
|
|
44
32
|
stack: []
|
|
45
33
|
};
|
|
46
34
|
export const init = initialArgs => {
|
|
47
|
-
const
|
|
48
|
-
|
|
35
|
+
const {
|
|
36
|
+
consent,
|
|
37
|
+
...reloadProps
|
|
38
|
+
} = initialArgs;
|
|
39
|
+
return {
|
|
40
|
+
...initialState,
|
|
41
|
+
...reloadProps,
|
|
42
|
+
consent: consent ? Array.isArray(consent) ? OsanoCategories.reduce((newConsent, category) => {
|
|
43
|
+
newConsent[`${category}`] = consent.includes(category);
|
|
44
|
+
return newConsent;
|
|
45
|
+
}, {}) : {
|
|
46
|
+
...consent
|
|
47
|
+
} : initialState.consent
|
|
48
|
+
};
|
|
49
49
|
};
|
|
50
50
|
const setAllConsent = acceptOrDeny => state => {
|
|
51
51
|
function formatStatus(category, status) {
|
|
52
|
+
const useGPC = shouldUseGPCOptOut(state, !status);
|
|
52
53
|
switch (category) {
|
|
53
54
|
case 'ESSENTIAL':
|
|
54
55
|
{
|
|
@@ -57,28 +58,24 @@ const setAllConsent = acceptOrDeny => state => {
|
|
|
57
58
|
case 'OPT_OUT':
|
|
58
59
|
{
|
|
59
60
|
// This is inverted because we would assume consent to all would be DENY for OPT_OUT
|
|
60
|
-
return
|
|
61
|
+
return useGPC || !status;
|
|
61
62
|
}
|
|
62
63
|
case 'MARKETING':
|
|
63
64
|
{
|
|
64
|
-
// Never set marketing to true if
|
|
65
|
-
return status && !
|
|
65
|
+
// Never set marketing to true if GPC is detected
|
|
66
|
+
return status && !useGPC;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
return status;
|
|
69
70
|
}
|
|
71
|
+
const newConsent = OsanoCategories.reduce((consent, category) => {
|
|
72
|
+
const status = formatStatus(category, acceptOrDeny);
|
|
73
|
+
consent[`${category}`] = status;
|
|
74
|
+
return consent;
|
|
75
|
+
}, {});
|
|
70
76
|
return {
|
|
71
77
|
...state,
|
|
72
|
-
consent:
|
|
73
|
-
...state.consent,
|
|
74
|
-
...OsanoCategories.reduce((consent, category) => {
|
|
75
|
-
const status = formatStatus(category, acceptOrDeny);
|
|
76
|
-
if (status) {
|
|
77
|
-
consent[`${category}`] = status;
|
|
78
|
-
}
|
|
79
|
-
return consent;
|
|
80
|
-
}, {})
|
|
81
|
-
}
|
|
78
|
+
consent: newConsent
|
|
82
79
|
};
|
|
83
80
|
};
|
|
84
81
|
export function reducer(state, action) {
|
|
@@ -99,7 +96,9 @@ export function reducer(state, action) {
|
|
|
99
96
|
}
|
|
100
97
|
return init({
|
|
101
98
|
...state,
|
|
102
|
-
config: consentConfig
|
|
99
|
+
config: consentConfig,
|
|
100
|
+
configId,
|
|
101
|
+
customerId
|
|
103
102
|
});
|
|
104
103
|
}
|
|
105
104
|
case SET_LOCALE:
|
|
@@ -110,16 +109,52 @@ export function reducer(state, action) {
|
|
|
110
109
|
case SAVE_SUCCESS:
|
|
111
110
|
{
|
|
112
111
|
const consentedCategories = action.payload;
|
|
112
|
+
const consent = OsanoCategories.reduce((consent, category) => {
|
|
113
|
+
consent[`${category}`] = consentedCategories.includes(category);
|
|
114
|
+
return consent;
|
|
115
|
+
}, {});
|
|
116
|
+
consent[ConsentCategory.ESSENTIAL] = true;
|
|
117
|
+
if (consent[ConsentCategory.OPT_OUT]) {
|
|
118
|
+
consent[ConsentCategory.MARKETING] = false;
|
|
119
|
+
}
|
|
113
120
|
return {
|
|
114
121
|
...state,
|
|
115
|
-
consent
|
|
116
|
-
consent[`${category}`] = consentedCategories.includes(category);
|
|
117
|
-
return consent;
|
|
118
|
-
}, {}),
|
|
122
|
+
consent,
|
|
119
123
|
dialogOpen: false,
|
|
124
|
+
savedConsent: {
|
|
125
|
+
...consent
|
|
126
|
+
},
|
|
120
127
|
stack: []
|
|
121
128
|
};
|
|
122
129
|
}
|
|
130
|
+
case CLEAR_CONSENT:
|
|
131
|
+
{
|
|
132
|
+
const optOutStatus = getFinalOptOutValue(state, initialState.consent[ConsentCategory.OPT_OUT]);
|
|
133
|
+
return {
|
|
134
|
+
...state,
|
|
135
|
+
consent: {
|
|
136
|
+
...initialState.consent,
|
|
137
|
+
[ConsentCategory.OPT_OUT]: optOutStatus,
|
|
138
|
+
[ConsentCategory.ANALYTICS]: isAnalyticsAlwaysAllowed(state) ? true : false
|
|
139
|
+
},
|
|
140
|
+
consentTimestamp: 0,
|
|
141
|
+
savedConsent: initialState.savedConsent
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
case REVERT_CONSENT:
|
|
145
|
+
{
|
|
146
|
+
const previousConsent = {
|
|
147
|
+
...(getSavedConsent(state) || initialState.consent)
|
|
148
|
+
};
|
|
149
|
+
if (!getSavedConsent(state)) {
|
|
150
|
+
previousConsent[ConsentCategory.OPT_OUT] = getFinalOptOutValue(state, previousConsent[ConsentCategory.OPT_OUT]);
|
|
151
|
+
previousConsent[ConsentCategory.ANALYTICS] = isAnalyticsAlwaysAllowed(state) ? true : false;
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
...state,
|
|
155
|
+
consent: previousConsent
|
|
156
|
+
};
|
|
157
|
+
}
|
|
123
158
|
case SET_ALL_CONSENT:
|
|
124
159
|
{
|
|
125
160
|
const acceptOrDeny = action.payload;
|
|
@@ -320,201 +355,4 @@ export function reducer(state, action) {
|
|
|
320
355
|
return state;
|
|
321
356
|
}
|
|
322
357
|
}
|
|
323
|
-
|
|
324
|
-
// THUNK COMMANDS
|
|
325
|
-
|
|
326
|
-
export const reload = initialArgs => dispatch => {
|
|
327
|
-
dispatch({
|
|
328
|
-
type: RELOAD,
|
|
329
|
-
payload: init(initialArgs)
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
export const showDialog = dispatch => dispatch({
|
|
333
|
-
type: SHOW_DIALOG
|
|
334
|
-
});
|
|
335
|
-
export const showDrawer = dispatch => {
|
|
336
|
-
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
337
|
-
dispatch({
|
|
338
|
-
type: SHOW_DRAWER
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
export const setLocale = payload => dispatch => {
|
|
342
|
-
dispatch({
|
|
343
|
-
type: SET_LOCALE,
|
|
344
|
-
payload
|
|
345
|
-
});
|
|
346
|
-
};
|
|
347
|
-
export const setConfig = payload => dispatch => {
|
|
348
|
-
dispatch({
|
|
349
|
-
type: SET_CONFIG,
|
|
350
|
-
payload
|
|
351
|
-
});
|
|
352
|
-
};
|
|
353
|
-
export const showIabDisclosures = payload => dispatch => {
|
|
354
|
-
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
355
|
-
dispatch({
|
|
356
|
-
type: SHOW_IAB_DISCLOSURES,
|
|
357
|
-
payload
|
|
358
|
-
});
|
|
359
|
-
};
|
|
360
|
-
export const showIabVendors = payload => dispatch => {
|
|
361
|
-
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
362
|
-
dispatch({
|
|
363
|
-
type: SHOW_IAB_VENDORS,
|
|
364
|
-
payload
|
|
365
|
-
});
|
|
366
|
-
};
|
|
367
|
-
export const toggleCategory = payload => dispatch => dispatch({
|
|
368
|
-
type: TOGGLE_CATEGORY,
|
|
369
|
-
payload
|
|
370
|
-
});
|
|
371
|
-
export const toggleDisclosure = payload => (dispatch, getState) => {
|
|
372
|
-
const state = getState();
|
|
373
|
-
const {
|
|
374
|
-
category = '',
|
|
375
|
-
configId = '',
|
|
376
|
-
customerId = ''
|
|
377
|
-
} = payload;
|
|
378
|
-
const shouldLoad = !isLoadingDisclosures(state) && !hasFetchedDisclosuresForCategory(state, category);
|
|
379
|
-
if (shouldLoad) {
|
|
380
|
-
// TODO: Fetch only specific category disclosures when API is ready, commenting out category for now
|
|
381
|
-
dispatch({
|
|
382
|
-
type: FETCH_DISCLOSURES_BEGIN /* payload: category */
|
|
383
|
-
});
|
|
384
|
-
fetchDisclosures(customerId, configId, undefined /* category */, state.locale).then(response => {
|
|
385
|
-
const disclosureResults = response || [];
|
|
386
|
-
dispatch({
|
|
387
|
-
type: FETCH_DISCLOSURES_SUCCESS,
|
|
388
|
-
payload: {
|
|
389
|
-
disclosures: disclosureResults /* category */
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
return response;
|
|
393
|
-
}).catch(error => {
|
|
394
|
-
dispatch({
|
|
395
|
-
type: FETCH_DISCLOSURES_FAILURE,
|
|
396
|
-
payload: {
|
|
397
|
-
error /* category */
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
export const toggleIabSpecialFeature = payload => () => {
|
|
404
|
-
console.log(`TODO: toggleIabSpecialFeature ${JSON.stringify(payload, null, 2)}`);
|
|
405
|
-
};
|
|
406
|
-
export const toggleIabPurposeOptOut = payload => () => {
|
|
407
|
-
const {
|
|
408
|
-
id,
|
|
409
|
-
value
|
|
410
|
-
} = payload || {};
|
|
411
|
-
console.log(`TODO: toggleIabPurposeOptOut ${id} ${value}`);
|
|
412
|
-
};
|
|
413
|
-
export const toggleIabVendorOptOut = payload => () => {
|
|
414
|
-
const {
|
|
415
|
-
id,
|
|
416
|
-
value
|
|
417
|
-
} = payload || {};
|
|
418
|
-
console.log(`TODO: toggleIabVendorOptOut ${id} ${value}`);
|
|
419
|
-
};
|
|
420
|
-
export const acceptAll = dispatch => {
|
|
421
|
-
dispatch({
|
|
422
|
-
type: SET_ALL_CONSENT,
|
|
423
|
-
payload: true
|
|
424
|
-
});
|
|
425
|
-
};
|
|
426
|
-
export const denyAll = dispatch => {
|
|
427
|
-
dispatch({
|
|
428
|
-
type: SET_ALL_CONSENT,
|
|
429
|
-
payload: false
|
|
430
|
-
});
|
|
431
|
-
};
|
|
432
|
-
export const goBack = dispatch => {
|
|
433
|
-
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
434
|
-
dispatch({
|
|
435
|
-
type: GO_BACK
|
|
436
|
-
});
|
|
437
|
-
};
|
|
438
|
-
export const close = cmp => dispatch => {
|
|
439
|
-
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
440
|
-
dispatch({
|
|
441
|
-
type: CLOSE,
|
|
442
|
-
payload: cmp
|
|
443
|
-
});
|
|
444
|
-
};
|
|
445
|
-
export const saveConsent = cmp => (dispatch, getState) => {
|
|
446
|
-
if (!cmp) {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
const state = getState();
|
|
450
|
-
const oldConsent = cmp?.consent;
|
|
451
|
-
const consent = getConsent(state);
|
|
452
|
-
dispatch({
|
|
453
|
-
type: SAVE_BEGIN
|
|
454
|
-
});
|
|
455
|
-
return recordConsent(cmp, consent).then(newConsent => dispatch({
|
|
456
|
-
type: SAVE_SUCCESS,
|
|
457
|
-
payload: newConsent
|
|
458
|
-
})).catch(() => {
|
|
459
|
-
dispatch({
|
|
460
|
-
type: SAVE_FAILURE,
|
|
461
|
-
payload: oldConsent
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
// SELECTORS
|
|
467
|
-
export const isCategoryAccepted = (state, category) => getConsent(state).includes(category);
|
|
468
|
-
export const isCategoryDisabled = (state, category) => category === ConsentCategory.ESSENTIAL || category === ConsentCategory.OPT_OUT && isGPCSupportEnabled(state) || category === ConsentCategory.MARKETING && (state.config?.shouldRenderOptOut || isGPCSupportEnabled(state)) && isCategoryAccepted(state, ConsentCategory.OPT_OUT);
|
|
469
|
-
export const isDrawerOpen = state => state.stack.length > 0;
|
|
470
|
-
export const isDialogOpen = state => state.dialogOpen && !isDrawerOpen(state);
|
|
471
|
-
export const isGPCSupportEnabled = state => !!state.config?.gpcSupport && (
|
|
472
|
-
// Native browser support uses Navigator.prototype
|
|
473
|
-
Object.hasOwnProperty.call(navigator, 'globalPrivacyControl') ||
|
|
474
|
-
// Browser extension support uses the Navigator instance on window
|
|
475
|
-
Object.hasOwnProperty.call(window?.navigator, 'globalPrivacyControl'));
|
|
476
|
-
export const shouldUseGPCOptOut = (state, acceptOrDeny) => isGPCSupportEnabled(state) ? Object.hasOwn(window.navigator, 'globalPrivacyControl') ? true : false : acceptOrDeny;
|
|
477
|
-
export function getConsent(state, category) {
|
|
478
|
-
if (typeof category === 'string') {
|
|
479
|
-
return state.consent[category];
|
|
480
|
-
}
|
|
481
|
-
return Object.entries(state.consent).filter(([_key, value]) => value).map(([key]) => key);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// Array Constants for common disclosures
|
|
485
|
-
const loadingDisclosures = [];
|
|
486
|
-
const noDisclosures = [{
|
|
487
|
-
type: 'no-results',
|
|
488
|
-
name: 'disclosure.none'
|
|
489
|
-
}];
|
|
490
|
-
export const isLoadingDisclosures = state => {
|
|
491
|
-
return state.disclosures.loading;
|
|
492
|
-
};
|
|
493
|
-
export const hasFetchedDisclosuresForCategory = (state, category) => {
|
|
494
|
-
const fetched = category ? state.disclosures.fetched || [] : [];
|
|
495
|
-
if (fetched.indexOf(category) >= 0) {
|
|
496
|
-
return true;
|
|
497
|
-
}
|
|
498
|
-
return false;
|
|
499
|
-
};
|
|
500
|
-
export const getCategoryDisclosures = (state, category) => {
|
|
501
|
-
const disclosures = get(state, `disclosures.results.${category}`) || [];
|
|
502
|
-
if (disclosures.length) {
|
|
503
|
-
return disclosures;
|
|
504
|
-
}
|
|
505
|
-
const loading = isLoadingDisclosures(state) && !hasFetchedDisclosuresForCategory(state, category);
|
|
506
|
-
return loading ? loadingDisclosures : noDisclosures;
|
|
507
|
-
};
|
|
508
|
-
export function getStack(state, index) {
|
|
509
|
-
if (typeof index === 'number') {
|
|
510
|
-
if (index < 0) {
|
|
511
|
-
if (index >= -state.stack.length) {
|
|
512
|
-
return state.stack[state.stack.length + index];
|
|
513
|
-
}
|
|
514
|
-
return undefined;
|
|
515
|
-
}
|
|
516
|
-
return state.stack[index];
|
|
517
|
-
}
|
|
518
|
-
return state.stack;
|
|
519
|
-
}
|
|
520
|
-
//# sourceMappingURL=store.js.map
|
|
358
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CLEAR_CONSENT","CLOSE","FETCH_DISCLOSURES_BEGIN","FETCH_DISCLOSURES_FAILURE","FETCH_DISCLOSURES_SUCCESS","GO_BACK","RELOAD","REVERT_CONSENT","SAVE_SUCCESS","SET_ALL_CONSENT","SET_CONFIG","SET_LOCALE","SHOW_DIALOG","SHOW_DRAWER","SHOW_IAB_DISCLOSURES","SHOW_IAB_VENDORS","TOGGLE_CATEGORY","ConsentCategory","getFinalOptOutValue","getSavedConsent","isAnalyticsAlwaysAllowed","shouldUseGPCOptOut","OsanoCategories","Object","values","initialState","config","undefined","configId","consent","ESSENTIAL","STORAGE","MARKETING","PERSONALIZATION","ANALYTICS","OPT_OUT","consentTimestamp","customerId","dialogOpen","disclosures","fetched","loading","results","locale","ready","savedConsent","scrollToType","scrollToId","stack","init","initialArgs","reloadProps","Array","isArray","reduce","newConsent","category","includes","setAllConsent","acceptOrDeny","state","formatStatus","status","useGPC","reducer","action","type","payload","consentConfig","consentedCategories","optOutStatus","previousConsent","value","id","length","slice","cmp","keys","indexOf","filter","cat","currentlyFetched","disclosuresByCategory","categories","disclosure","classification","categoryName","categoryDisclosures","push","newResults","entries","validCategories","lookup","name","uuid","sort","a","b","localeCompare","index","list"],"sourceRoot":"../../src","sources":["reducer.ts"],"mappings":"AAAA,SACCA,aAAa,EACbC,KAAK,EACLC,uBAAuB,EACvBC,yBAAyB,EACzBC,yBAAyB,EACzBC,OAAO,EACPC,MAAM,EACNC,cAAc,EACdC,YAAY,EACZC,eAAe,EACfC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,WAAW,EACXC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,QACT,WAAW;AAClB,SACCC,eAAe,QAET,aAAa;AAGpB,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,qBAAqB;AAC1E,SAASC,wBAAwB,EAAEC,kBAAkB,QAA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UACH,OAAOF,eAAe;QACvB,CAAC,EACD,CAAC,CACF,CAAC;QACF,OAAO;UACN,GAAG/B,KAAK;UACRrB,WAAW,EAAE;YACZ,GAAGqB,KAAK,CAACrB,WAAW;YACpBG,OAAO,EAAE+C,UAAU;YACnBjD,OAAO,EAAEA,OAAO,CAACuC,MAAM,CACtB,CAACC,GAAG,EAAEmB,KAAK,EAAEC,IAAI,KAAKA,IAAI,CAACtB,OAAO,CAACE,GAAG,CAAC,KAAKmB,KAC7C,CAAC;YACD1D,OAAO,EAAE;UACV;QACD,CAAC;MACF;IACA;MACC,OAAOmB,KAAK;EACd;AACD","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { ConsentCategory } from './constants';
|
|
3
|
+
import { get } from './utils';
|
|
4
|
+
export const isCategoryAccepted = (state, category) => getConsent(state).includes(category);
|
|
5
|
+
export const isAnalyticsAlwaysAllowed = state => !!state.config?.type.analyticsAlways;
|
|
6
|
+
export const isCategoryDisabled = (state, category) => category === ConsentCategory.ESSENTIAL || category === ConsentCategory.OPT_OUT && isGPCSupportEnabled(state) || category === ConsentCategory.MARKETING && (state.config?.shouldRenderOptOut || isGPCSupportEnabled(state)) && isCategoryAccepted(state, ConsentCategory.OPT_OUT);
|
|
7
|
+
export const isDrawerOpen = state => state.stack.length > 0;
|
|
8
|
+
export const isDialogOpen = state => state.dialogOpen && !isDrawerOpen(state);
|
|
9
|
+
export const isGPCSupportEnabled = state => !!state.config?.gpcSupport && (
|
|
10
|
+
// Native browser support uses Navigator.prototype
|
|
11
|
+
Object.hasOwnProperty.call(navigator, 'globalPrivacyControl') ||
|
|
12
|
+
// Browser extension support uses the Navigator instance on window
|
|
13
|
+
Object.hasOwnProperty.call(window?.navigator, 'globalPrivacyControl'));
|
|
14
|
+
export const shouldUseGPCOptOut = (state, acceptOrDeny) => isGPCSupportEnabled(state) ? Object.hasOwn(window.navigator, 'globalPrivacyControl') ? true : false : acceptOrDeny;
|
|
15
|
+
export function getConsent(state, category) {
|
|
16
|
+
if (typeof category === 'string') {
|
|
17
|
+
return state.consent[category];
|
|
18
|
+
}
|
|
19
|
+
return Object.entries(state.consent).filter(([_key, value]) => value).map(([key]) => key);
|
|
20
|
+
}
|
|
21
|
+
export const getConsentTimestamp = state => get(state, 'consentTimestamp') || 0;
|
|
22
|
+
|
|
23
|
+
// Array Constants for common disclosures
|
|
24
|
+
const loadingDisclosures = [];
|
|
25
|
+
const noDisclosures = [{
|
|
26
|
+
type: 'no-results',
|
|
27
|
+
name: 'disclosure.none'
|
|
28
|
+
}];
|
|
29
|
+
export const isConsentReady = state => get(state, 'ready.consent'); // ReadyState could be a consent object
|
|
30
|
+
export const isLoadingDisclosures = state => {
|
|
31
|
+
return state.disclosures.loading;
|
|
32
|
+
};
|
|
33
|
+
export const hasFetchedDisclosuresForCategory = (state, category) => {
|
|
34
|
+
const fetched = category ? state.disclosures.fetched || [] : [];
|
|
35
|
+
if (fetched.indexOf(category) >= 0) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
export const getCategoryDisclosures = (state, category) => {
|
|
41
|
+
const disclosures = get(state, `disclosures.results.${category}`) || [];
|
|
42
|
+
if (disclosures.length) {
|
|
43
|
+
return disclosures;
|
|
44
|
+
}
|
|
45
|
+
const loading = isLoadingDisclosures(state) && !hasFetchedDisclosuresForCategory(state, category);
|
|
46
|
+
return loading ? loadingDisclosures : noDisclosures;
|
|
47
|
+
};
|
|
48
|
+
export function getStack(state, index) {
|
|
49
|
+
if (typeof index === 'number') {
|
|
50
|
+
if (index < 0) {
|
|
51
|
+
if (index >= -state.stack.length) {
|
|
52
|
+
return state.stack[state.stack.length + index];
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return state.stack[index];
|
|
57
|
+
}
|
|
58
|
+
return state.stack;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ConsentCategory","get","isCategoryAccepted","state","category","getConsent","includes","isAnalyticsAlwaysAllowed","config","type","analyticsAlways","isCategoryDisabled","ESSENTIAL","OPT_OUT","isGPCSupportEnabled","MARKETING","shouldRenderOptOut","isDrawerOpen","stack","length","isDialogOpen","dialogOpen","gpcSupport","Object","hasOwnProperty","call","navigator","window","shouldUseGPCOptOut","acceptOrDeny","hasOwn","consent","entries","filter","_key","value","map","key","getConsentTimestamp","loadingDisclosures","noDisclosures","name","isConsentReady","isLoadingDisclosures","disclosures","loading","hasFetchedDisclosuresForCategory","fetched","indexOf","getCategoryDisclosures","getStack","index","undefined"],"sourceRoot":"../../src","sources":["selectors.ts"],"mappings":"AAAA;AACA,SACCA,eAAe,QAET,aAAa;AAGpB,SAASC,GAAG,QAAQ,SAAS;AAE7B,OAAO,MAAMC,kBAAkB,GAAGA,CACjCC,KAAiB,EACjBC,QAA6B,KACzBC,UAAU,CAACF,KAAK,CAAC,CAACG,QAAQ,CAACF,QAAQ,CAAC;AAEzC,OAAO,MAAMG,wBAAwB,GAAIJ,KAAiB,IACzD,CAAC,CAACA,KAAK,CAACK,MAAM,EAAEC,IAAI,CAACC,eAAe;AACrC,OAAO,MAAMC,kBAAkB,GAAGA,CACjCR,KAAiB,EACjBC,QAA6B,KAE7BA,QAAQ,KAAKJ,eAAe,CAACY,SAAS,IACrCR,QAAQ,KAAKJ,eAAe,CAACa,OAAO,IAAIC,mBAAmB,CAACX,KAAK,CAAE,IACnEC,QAAQ,KAAKJ,eAAe,CAACe,SAAS,KACrCZ,KAAK,CAACK,MAAM,EAAEQ,kBAAkB,IAAIF,mBAAmB,CAACX,KAAK,CAAC,CAAC,IAChED,kBAAkB,CAACC,KAAK,EAAEH,eAAe,CAACa,OAAO,CAAE;AAErD,OAAO,MAAMI,YAAY,GAAId,KAAiB,IAAKA,KAAK,CAACe,KAAK,CAACC,MAAM,GAAG,CAAC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,CAACiC,KAAK,CAAC;EAC1B;EACA,OAAOhD,KAAK,CAACe,KAAK;AACnB","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
// file deepcode ignore DuplicateCaseBody: <please specify a reason of ignoring this>
|
|
2
3
|
import { env } from '../constants';
|
|
3
4
|
import { Platform } from 'react-native';
|
|
@@ -28,12 +29,15 @@ function createConsentPayload(cmp, consent) {
|
|
|
28
29
|
const STORAGE_KEY = 'osano_consentmanager';
|
|
29
30
|
const storeConsent = async (cmp, consent) => {
|
|
30
31
|
cmp.consent = consent ?? cmp.consent;
|
|
31
|
-
return new Promise(resolve => {
|
|
32
|
-
const resConsent = () =>
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const resConsent = () => {
|
|
34
|
+
resolve(cmp.consent ?? []);
|
|
35
|
+
return cmp.consent;
|
|
36
|
+
};
|
|
33
37
|
switch (Platform.OS) {
|
|
34
38
|
case 'ios':
|
|
35
39
|
case 'android':
|
|
36
|
-
setStorage(`${STORAGE_KEY}_${cmp.configId}`, JSON.stringify(cmp.consent)).then(resConsent);
|
|
40
|
+
setStorage(`${STORAGE_KEY}_${cmp.configId}`, JSON.stringify(cmp.consent)).then(resConsent).catch(reject);
|
|
37
41
|
break;
|
|
38
42
|
}
|
|
39
43
|
});
|
|
@@ -43,12 +47,16 @@ export const clearConsent = async cmp => {
|
|
|
43
47
|
const resConsent = () => {
|
|
44
48
|
cmp.consent = [ConsentCategory.ESSENTIAL];
|
|
45
49
|
resolve([ConsentCategory.ESSENTIAL]);
|
|
50
|
+
return cmp.consent;
|
|
46
51
|
};
|
|
47
52
|
switch (Platform.OS) {
|
|
48
53
|
case 'android':
|
|
49
54
|
case 'ios':
|
|
50
55
|
clearStorage(`${STORAGE_KEY}_${cmp.configId}`).then(resConsent);
|
|
51
56
|
break;
|
|
57
|
+
default:
|
|
58
|
+
window.localStorage.removeItem(`${STORAGE_KEY}_${cmp.configId}`);
|
|
59
|
+
break;
|
|
52
60
|
}
|
|
53
61
|
});
|
|
54
62
|
};
|
|
@@ -63,6 +71,7 @@ const retrieveConsent = async cmp => {
|
|
|
63
71
|
}
|
|
64
72
|
if (cmp.consent && cmp.consent.length > 0) {
|
|
65
73
|
resolve(cmp.consent);
|
|
74
|
+
return cmp.consent;
|
|
66
75
|
}
|
|
67
76
|
throw new Error('Consent not found');
|
|
68
77
|
};
|
|
@@ -71,9 +80,16 @@ const retrieveConsent = async cmp => {
|
|
|
71
80
|
case 'android':
|
|
72
81
|
getStorage(`${STORAGE_KEY}_${cmp.configId}`).then(resConsent).catch(() => {
|
|
73
82
|
// Consent not found
|
|
74
|
-
|
|
83
|
+
clearConsent(cmp).then(resolve);
|
|
75
84
|
});
|
|
76
85
|
break;
|
|
86
|
+
default:
|
|
87
|
+
try {
|
|
88
|
+
resConsent(window.localStorage.getItem(`${STORAGE_KEY}_${cmp.configId}`));
|
|
89
|
+
} catch (e) {
|
|
90
|
+
clearConsent(cmp).then(resolve);
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
77
93
|
}
|
|
78
94
|
});
|
|
79
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["env","Platform","API","merge","ConsentCategory","clearStorage","getStorage","setStorage","CONSENT_URI","LOOKUPS_URI","OSANO_ORIGIN","overrideConfig","variant","createConsentPayload","cmp","consent","Object","fromEntries","entries","customerId","configId","consented","consentingDomain","consentingPlatform","OS","deviceId","extUsrData","filter","value","undefined","STORAGE_KEY","storeConsent","Promise","resolve","resConsent","JSON","stringify","then","clearConsent","ESSENTIAL","retrieveConsent","consentJson","parse","length","Error","
|
|
1
|
+
{"version":3,"names":["env","Platform","API","merge","ConsentCategory","clearStorage","getStorage","setStorage","CONSENT_URI","LOOKUPS_URI","OSANO_ORIGIN","overrideConfig","variant","createConsentPayload","cmp","consent","Object","fromEntries","entries","customerId","configId","consented","consentingDomain","consentingPlatform","OS","deviceId","extUsrData","filter","value","undefined","STORAGE_KEY","storeConsent","Promise","resolve","reject","resConsent","JSON","stringify","then","catch","clearConsent","ESSENTIAL","window","localStorage","removeItem","retrieveConsent","consentJson","parse","length","Error","getItem","e","recordConsent","payload","post","consentCategories","error","fetchConsent","userData","get","response","fetchConfig","headers","json","country","region"],"sourceRoot":"../../../src","sources":["services/consent.ts"],"mappings":"AAAA;AACA;AACA,SAASA,GAAG,QAAQ,cAAc;AAClC,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,GAAG,MAAM,cAAc;AAG9B,SAASC,KAAK,QAAQ,UAAU;AAChC,SAECC,eAAe,QACT,cAAc;AACrB,SAASC,YAAY,EAAEC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAEzE,MAAM;EAAEC,WAAW;EAAEC,WAAW;EAAEC;AAAa,CAAC,GAAGV,GAAG;AAEtD,MAAMW,cAA+B,GAAG;EACvC;EACAC,OAAO,EAAE;AACV,CAAC;AAYD,SAASC,oBAAoBA,CAC5BC,GAAmB,EACnBC,OAA+B,EACd;EACjB,OAAOC,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAAC;IACdC,UAAU,EAAEL,GAAG,CAACK,UAAU;IAC1BC,QAAQ,EAAEN,GAAG,CAACM,QAAQ;IACtBC,SAAS,EAAEN,OAAO,IAAID,GAAG,CAACC,OAAO;IACjCO,gBAAgB,EAAER,GAAG,CAACQ,gBAAgB;IACtCC,kBAAkB,EAAG,GAAEtB,QAAQ,CAACuB,EAAG,eAAc;IACjDC,QAAQ,EAAEX,GAAG,CAACW,QAAQ;IACtBC,UAAU,EAAEZ,GAAG,CAACY;EACjB,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC,GAAGC,KAAK,CAAC,KAAKA,KAAK,KAAKC,SAAS,CAC7C,CAAC;AACF;AAEA,MAAMC,WAAW,GAAG,sBAAsB;AAE1C,MAAMC,YAAY,GAAG,MAAAA,CACpBjB,GAAmB,EACnBC,OAA+B,KAC3B;EACJD,GAAG,C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,QAGzB;IACD,OAAOzD,KAAK,CACX;MACC,GAAG4D,IAAI;MACPC,OAAO,EAAEF,OAAO,CAACH,GAAG,CAAC,iBAAiB,CAAC;MACvCM,MAAM,EAAEH,OAAO,CAACH,GAAG,CAAC,gBAAgB,CAAC;MACrC/C,OAAO,EAAEkD,OAAO,CAACH,GAAG,CAAC,iBAAiB;IACvC,CAAC,EACDhD,cACD,CAAC;EACF,CAAC,CAAC,CACD4B,KAAK,CAAC,MAAM;IACZ;IACA,OAAO,IAAI;EACZ,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/lib/module/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG } from './ConsentManager';
|
|
1
2
|
import { Platform, StyleSheet } from 'react-native';
|
|
2
3
|
import { contrastRgb, darken, lighten, luminosityGrayscale, parseColor } from './utils/Color';
|
|
3
|
-
import { DEFAULT_CONFIG } from './ConsentManager';
|
|
4
4
|
const colorLookupTable = {};
|
|
5
5
|
const ARIA_CONTRAST_AMOUNT = 0.08;
|
|
6
6
|
/**
|
package/lib/module/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","StyleSheet","contrastRgb","darken","lighten","luminosityGrayscale","parseColor","
|
|
1
|
+
{"version":3,"names":["DEFAULT_CONFIG","Platform","StyleSheet","contrastRgb","darken","lighten","luminosityGrayscale","parseColor","colorLookupTable","ARIA_CONTRAST_AMOUNT","lookupColor","color","lookup","createContrastColor","amount","contrast","Math","abs","createSharedStyles","config","buttonBackgroundColor","buttonForegroundColor","buttonDenyBackgroundColor","buttonDenyForegroundColor","dialogBackgroundColor","dialogForegroundColor","infoDialogBackgroundColor","infoDialogForegroundColor","infoDialogOverlayColor","linkColor","toggleOffBackgroundColor","toggleButtonOffColor","toggleOnBackgroundColor","toggleButtonOnColor","palette","clearDialogBackground","slice","join","create","grow","flex","row","flexDirection","rowReverse","col","colReverse","ltr","textAlign","writingDirection","OS","undefined","rtl","alignStart","alignItems","alignCenter","alignEnd","justifyStart","justifyContent","justifyCenter","justifyEnd","dialog","backgroundColor","dialogText","dialogClose","dialogCloseFocus","borderColor","dialogCloseHover","dialogOverlay","drawer","padding","drawerText","drawerHeader","drawerClose","drawerCloseFocus","drawerCloseHover","toggleOff","toggleOn","toggleOffDisabled","toggleOnDisabled","link","linkFocus","button","buttonText","buttonFocus","buttonHover","buttonDeny","buttonDenyText","buttonDenyFocus","buttonDenyHover"],"sourceRoot":"../../src","sources":["styles.ts"],"mappings":"AAAA,SAAwBA,cAAc,QAAQ,kBAAkB;AAChE,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SACCC,WAAW,EACXC,MAAM,EACNC,OAAO,EACPC,mBAAmB,EACnBC,UAAU,QACJ,eAAe;AAQtB,MAAMC,gBAAsD,GAAG,CAAC,CAAC;AACjE,MAAMC,oBAAoB,GAAG,IAAI;AACjC;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAIC,KAAa,IAAK;EACtC,MAAMC,MAAM,GAAGJ,gBAAgB,CAAE,GAAEG,KAAM,EAAC,CAAC,IAAI,CAACJ,UAAU,CAACI,KAAK,CAAC,CAAC;EAClEC,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,IAAIT,WAAW,CAAC,GAAGS,MAAM,CAAC,CAAC,CAAC,CAAC;EAClDA,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,IAAIN,mBAAmB,CAAC,GAAGM,MAAM,CAAC,CAAC,CAAC,CAAC;EAC1DJ,gBAAgB,CAAE,GAAEG,KAAM,EAAC,CAAC,GAAGC,MAAM;EACrC,OAAOA,MAAM;AACd,CAAC;AAED,OAAO,MAAMC,mBAAmB,GAAGA,CAClCF,KAAa,EACbG,MAAM,GAAGL,oBAAoB,KACzB;EACJ,MAAM,GAAGM,QAAQ,CAAC,GAAGL,WAAW,CAACC,KAAK,CAAC;EACvC,OAA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C;MACrE2C,WAAW,EAAEpD,mBAAmB,CAACU,yBAAyB,EAAE,IAAI;IACjE,CAAC;IACDiE,eAAe,EAAE;MAChB3B,eAAe,EAAEhD,mBAAmB,CAACS,yBAAyB,EAAE,IAAI,CAAC;MACrE2C,WAAW,EAAEpD,mBAAmB,CAACU,yBAAyB,EAAE,IAAI;IACjE;EACD,CAAC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { EventEmitter } from './EventEmitter';
|
|
1
2
|
import { fetchGlobalLocalePhrases, fetchLocalLocalePhrases } from '../services/locale';
|
|
2
3
|
import { get, merge } from './index';
|
|
3
|
-
import { EventEmitter } from './EventEmitter';
|
|
4
4
|
const unavailableLocales = [];
|
|
5
5
|
const rtlLocaleCodes = ['ar', 'arc', 'ckb', 'dv', 'fa', 'ha', 'he', 'khw', 'ks', 'ps', 'ur', 'uz-af', 'yi'];
|
|
6
6
|
const locales = {};
|
|
@@ -189,7 +189,9 @@ export default class Translator extends EventEmitter {
|
|
|
189
189
|
} = localePassed ? {} : props;
|
|
190
190
|
Object.entries(interpolations).forEach(([key, value]) => {
|
|
191
191
|
const pattern = new RegExp(`%{${key}}`, 'g');
|
|
192
|
-
|
|
192
|
+
if (typeof translation === 'string') {
|
|
193
|
+
translation = translation.replace(pattern, value);
|
|
194
|
+
}
|
|
193
195
|
});
|
|
194
196
|
return translation;
|
|
195
197
|
}
|