@el7ven/cookie-kit 0.2.19 → 0.2.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@el7ven/cookie-kit",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "module": "./src/index.js",
package/src/core/index.js CHANGED
@@ -1,13 +1,120 @@
1
1
  import { VERSION, getVersion, getVersionInfo, logVersion } from './version.js'
2
2
 
3
3
  const DEFAULT_CONFIG = {
4
- storageKey: 'cookie_consent',
4
+ // Version and revision for consent invalidation
5
+ version: 'v2',
6
+ revision: 0,
7
+
8
+ // GDPR compliance
5
9
  consentExpireDays: 365,
10
+ auditLog: false,
11
+
12
+ // Storage
13
+ storageKey: 'cookie_consent',
14
+ storageType: 'localStorage', // 'localStorage' | 'cookie' | 'both'
15
+
16
+ // Mode
17
+ mode: 'gdpr', // 'gdpr' | 'essential'
18
+
19
+ // Auto show
20
+ autoShow: true,
21
+
22
+ // Debug
23
+ debug: false,
24
+
25
+ // Region (optional)
26
+ region: null, // 'EU' | 'US' | 'OTHER'
27
+
28
+ // Categories
6
29
  categories: {
7
- necessary: { required: true, enabled: true },
8
- analytics: { required: false, enabled: false },
9
- marketing: { required: false, enabled: false },
10
- preferences: { required: false, enabled: false }
30
+ necessary: {
31
+ id: 'necessary',
32
+ label: 'Necesare',
33
+ description: 'Cookie-uri esențiale pentru funcționarea site-ului',
34
+ required: true,
35
+ locked: true,
36
+ enabled: true
37
+ },
38
+ analytics: {
39
+ id: 'analytics',
40
+ label: 'Analiză',
41
+ description: 'Cookie-uri pentru analiza traficului și comportamentului utilizatorilor',
42
+ required: false,
43
+ locked: false,
44
+ enabled: true
45
+ },
46
+ marketing: {
47
+ id: 'marketing',
48
+ label: 'Marketing',
49
+ description: 'Cookie-uri pentru publicitate personalizată',
50
+ required: false,
51
+ locked: false,
52
+ enabled: true
53
+ },
54
+ preferences: {
55
+ id: 'preferences',
56
+ label: 'Preferințe',
57
+ description: 'Cookie-uri pentru salvarea preferințelor utilizatorului',
58
+ required: false,
59
+ locked: false,
60
+ enabled: true
61
+ }
62
+ },
63
+
64
+ // Texts
65
+ texts: {
66
+ essential: {
67
+ title: '🍪 Файлы Cookie',
68
+ message: 'Мы используем необходимые файлы cookie для работы сайта. Никакой аналитики и маркетинга.',
69
+ button: 'Принять'
70
+ },
71
+ gdpr: {
72
+ title: 'Preferințe Cookie-uri',
73
+ message: 'Folosim cookie-uri pentru a-ți oferi cea mai bună experiență. Alege ce tipuri de cookie-uri accepți.',
74
+ buttons: {
75
+ acceptAll: 'Acceptă toate',
76
+ rejectAll: 'Respinge toate',
77
+ acceptSelection: 'Acceptă selecția',
78
+ settings: 'Setări'
79
+ }
80
+ },
81
+ settings: {
82
+ title: 'Setări Cookie-uri',
83
+ tabs: {
84
+ privacy: 'Confidențialitate'
85
+ },
86
+ buttons: {
87
+ acceptAll: 'Acceptă toate',
88
+ rejectAll: 'Respinge toate',
89
+ acceptSelection: 'Salvează selecția'
90
+ },
91
+ links: {
92
+ moreInfo: 'Mai multe informații',
93
+ cookieDetails: 'Detalii cookie-uri'
94
+ }
95
+ }
96
+ },
97
+
98
+ // Policy links
99
+ policies: {
100
+ privacy: '/privacy-policy',
101
+ cookies: '/cookie-policy'
102
+ },
103
+
104
+ // Display options
105
+ display: {
106
+ position: 'bottom-right', // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center'
107
+ backdrop: true,
108
+ closeOnBackdrop: true
109
+ },
110
+
111
+ // Analytics providers (optional)
112
+ analytics: null,
113
+
114
+ // Script blocking (optional)
115
+ scriptBlocking: {
116
+ enabled: true,
117
+ strategy: 'data-category' // 'data-category' | 'type-rewrite'
11
118
  }
12
119
  }
13
120
 
package/src/index.js CHANGED
@@ -22,6 +22,9 @@ export * from './react/index.js'
22
22
  // Vue components
23
23
  export * from './vue/index.js'
24
24
 
25
+ // Vue composable
26
+ export { useCookieConsent } from './vue/composables/useCookieConsent.js'
27
+
25
28
  // Version info
26
29
  export { VERSION, getVersion, getVersionInfo, logVersion } from './core/version.js'
27
30
 
package/src/vue/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { computed, ref } from 'vue'
2
2
  import { createCookieKit, DEFAULT_CONFIG } from '../core/index.js'
3
3
  import { VERSION, getVersion, getVersionInfo, logVersion } from './version.js'
4
+ import { useCookieConsent } from './composables/useCookieConsent.js'
4
5
 
5
- export { createCookieKit, DEFAULT_CONFIG, VERSION, getVersion, getVersionInfo, logVersion }
6
+ export { createCookieKit, DEFAULT_CONFIG, VERSION, getVersion, getVersionInfo, logVersion, useCookieConsent }
6
7
 
7
8
  export function useCookieKitVue(userConfig = {}) {
8
9
  const core = createCookieKit(userConfig)