@expo/styleguide-cookie-consent 0.1.8 → 0.1.10

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/dist/index.d.ts CHANGED
@@ -3,4 +3,3 @@ export { PrivacyChoicesButton } from './src/PrivacyChoicesButton';
3
3
  export { isConsentEnabled, shouldSkipBannerForAuth, getAnalyticsConsentStatus, getMarketingConsentStatus, isAnalyticsConsented, isMarketingConsented, enqueueAnalyticsEvent, enqueueMarketingEvent, setAnalyticsReplayFn, setMarketingReplayFn, setAnalyticsConsent, setMarketingConsent, resetConsentState, MAX_QUEUE_SIZE, } from './src/consent';
4
4
  export { useConsentManager } from '@c15t/react/hooks';
5
5
  export type { ConsentStatus, QueuedEvent, CookieConsentProviderProps } from './src/types';
6
- export type { GoogleTagManagerOptions } from '@c15t/scripts/google-tag-manager';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,9 @@
1
+ declare global {
2
+ interface Window {
3
+ dataLayer: unknown[];
4
+ gtag: (...args: unknown[]) => void;
5
+ }
6
+ }
1
7
  export type ConsentStatus = 'pending' | 'granted' | 'denied';
2
8
  export type QueuedEvent = {
3
9
  type: 'track' | 'identify' | 'group' | 'gtag' | 'adwords';
package/mock.js ADDED
@@ -0,0 +1,58 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * Test mock for @expo/styleguide-cookie-consent.
5
+ *
6
+ * The real bundle includes CSS injected via style-loader at runtime,
7
+ * which throws "Could not parse CSS stylesheet" in jsdom. Import this
8
+ * entry point in your test config to avoid that:
9
+ *
10
+ * // jest.config.js
11
+ * moduleNameMapper: {
12
+ * '@expo/styleguide-cookie-consent': '@expo/styleguide-cookie-consent/mock',
13
+ * }
14
+ */
15
+
16
+ export function CookieConsentProvider({ children }) {
17
+ return children;
18
+ }
19
+
20
+ export function PrivacyChoicesButton() {
21
+ return null;
22
+ }
23
+
24
+ export function useConsentManager() {
25
+ return {
26
+ has: () => false,
27
+ hasConsented: () => false,
28
+ setIsPrivacyDialogOpen: () => {},
29
+ };
30
+ }
31
+
32
+ export const MAX_QUEUE_SIZE = 200;
33
+
34
+ export function isConsentEnabled() {
35
+ return false;
36
+ }
37
+ export function shouldSkipBannerForAuth() {
38
+ return false;
39
+ }
40
+ export function getAnalyticsConsentStatus() {
41
+ return 'pending';
42
+ }
43
+ export function getMarketingConsentStatus() {
44
+ return 'pending';
45
+ }
46
+ export function isAnalyticsConsented() {
47
+ return false;
48
+ }
49
+ export function isMarketingConsented() {
50
+ return false;
51
+ }
52
+ export function enqueueAnalyticsEvent() {}
53
+ export function enqueueMarketingEvent() {}
54
+ export function setAnalyticsReplayFn() {}
55
+ export function setMarketingReplayFn() {}
56
+ export function setAnalyticsConsent() {}
57
+ export function setMarketingConsent() {}
58
+ export function resetConsentState() {}
package/package.json CHANGED
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "name": "@expo/styleguide-cookie-consent",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Cookie consent provider for Expo websites with c15t integration.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "sideEffects": false,
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./mock": "./mock.js"
16
+ },
10
17
  "files": [
11
- "dist"
18
+ "dist",
19
+ "mock.js"
12
20
  ],
13
21
  "homepage": "https://github.com/expo/styleguide",
14
22
  "repository": {
@@ -21,7 +29,8 @@
21
29
  "bundle": "rollup --config",
22
30
  "types": "yarn run -T tsc",
23
31
  "build": "run-s clean bundle types",
24
- "dev": "rollup --config --watch"
32
+ "dev": "rollup --config --watch",
33
+ "test": "vitest run"
25
34
  },
26
35
  "dependencies": {
27
36
  "@radix-ui/react-accordion": "^1.2.4",
@@ -39,10 +48,11 @@
39
48
  "@rollup/plugin-alias": "^6.0.0",
40
49
  "npm-run-all": "*",
41
50
  "rimraf": "*",
42
- "rollup": "*"
51
+ "rollup": "*",
52
+ "vitest": "*"
43
53
  },
44
54
  "eslintConfig": {
45
55
  "extends": "universe/web"
46
56
  },
47
- "gitHead": "d3454b0cc17232c5290f6f83ccf1f0f9f9499555"
57
+ "gitHead": "6510d5d9f67dab99dabbebfc3ec1eb96d1d551ea"
48
58
  }