@blakfy/cookie 2.1.1 → 2.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/CHANGELOG.md +194 -120
- package/README.md +594 -480
- package/SECURITY.md +54 -0
- package/dist/cookie-defaults.js +1 -2
- package/dist/cookie-defaults.min.js +1 -2
- package/dist/cookie.d.ts +171 -0
- package/dist/cookie.js +2863 -2376
- package/dist/cookie.js.map +4 -4
- package/dist/cookie.min.js +2 -3
- package/{ARCHITECTURE.md → docs/architecture.md} +187 -186
- package/{COMPLIANCE.md → docs/compliance.md} +199 -191
- package/{MIGRATION.md → docs/migration.md} +172 -156
- package/docs/release.md +176 -0
- package/{TCF-CERTIFICATION.md → docs/tcf-certification.md} +115 -106
- package/package.json +145 -61
- package/status.json +30 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,120 +1,194 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes follow [Keep a Changelog](https://keepachangelog.com/) and SemVer.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## [2.
|
|
8
|
-
|
|
9
|
-
###
|
|
10
|
-
- **
|
|
11
|
-
-
|
|
12
|
-
- `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
###
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
###
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
- `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- `
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
- `
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes follow [Keep a Changelog](https://keepachangelog.com/) and SemVer.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [2.2.0] — 2026-05-07
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **TypeScript public types** — `dist/cookie.d.ts` artık paket içinde; TS kullanıcıları `import type { BlakfyCookieAPI, BlakfyConsentState, ConsentCategory } from "@blakfy/cookie"` yapabilir. Tam IntelliSense desteği.
|
|
11
|
+
- **`@blakfy/cookie-next` test kapsamı** — vitest + React Testing Library setup, 68 test (Provider/ConsentModeDefault/3 hook + SSR safety + Hydration + Pages Router compat + RSC use client lock).
|
|
12
|
+
- **Modern npm packaging** — `exports`, `sideEffects`, `engines: ">=18"`, `unpkg`, `jsdelivr`, `publishConfig.provenance`, `bugs.url`, `funding` alanları.
|
|
13
|
+
- **`status.json` paket içine alındı** — runtime'da widget cdn.jsdelivr.net/npm/@blakfy/cookie@2/status.json'u tüketir.
|
|
14
|
+
- **Pages Router uyumluluk dokümantasyonu** — README'ye `_app.tsx` örneği. Provider hâlihazırda router-agnostik (statik test ile lock'lı).
|
|
15
|
+
- **`@blakfy/cookie-next` peerDependencies range** — `next: ">=14 <16"`, `react: ">=18 <20"`, `react-dom: ">=18 <20"` (React 19 + Next 15 explicit destekli).
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **`cookie-next/package.json` `module`/`main` paths** — tsup 8.x output ile hizalandı: `main: dist/index.cjs` (CJS), `module: dist/index.js` (ESM). Önceki `dist/index.mjs` referansı yanlıştı.
|
|
19
|
+
- **README CDN örnekleri** — `cdn.jsdelivr.net/npm/@blakfy/cookie@2.2.0/...`.
|
|
20
|
+
- **CDN_BASE banner** — `scripts/build.js` dinamik olarak `package.json` version'ını okur (manuel sync hatası önlenir).
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **`window.BlakfyCookie.version`** runtime'da artık doğru sürümü (`"2.2.0"`) döndürür (önceki sürümlerde `src/api.js` `VERSION` constant senkronize değildi).
|
|
24
|
+
- **`data-blakfy-position` belgesi** — README'de yanlış olarak `bottom-right` default yazılmıştı; düzeltildi (`bottom-center`, kodda zaten 2.1.0'dan beri böyleydi).
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
- Public API davranışı değişmedi; mevcut kullanıcılar otomatik geçiş yapabilir.
|
|
28
|
+
- `@2` semver tag jsDelivr CDN otomatik bu sürüme geçer (~5-10 dk cache propagation).
|
|
29
|
+
- TypeScript users: ek `@types/blakfy-cookie` paketi GEREKMEZ — types pakete dahil.
|
|
30
|
+
|
|
31
|
+
### Dev Infrastructure (paket içeriğine girmez)
|
|
32
|
+
- ESLint v9 flat config + Prettier (React/jsx-a11y/Next plugin'leri)
|
|
33
|
+
- husky + lint-staged + commitlint (conventional commits)
|
|
34
|
+
- changesets (monorepo versioning)
|
|
35
|
+
- @vitest/coverage-v8 + threshold gate
|
|
36
|
+
- CodeQL security scanning workflow
|
|
37
|
+
- size-limit + PR comment action
|
|
38
|
+
- GitHub templates (issue, PR, security, CoC, dependabot)
|
|
39
|
+
- TypeScript infrastructure (tsconfig + types.d.ts; src/ migration deferred)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [2.1.2] — 2026-05-07
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- `src/api.js` `VERSION` constant `"2.1.0"` → `"2.1.2"` (önceki yayınlarda paket sürümü ile senkron değildi; `window.BlakfyCookie.version` artık doğru sürümü döner)
|
|
48
|
+
|
|
49
|
+
### Docs
|
|
50
|
+
|
|
51
|
+
- README'de `data-blakfy-position` default değeri `bottom-right` olarak yanlış belgelenmişti → düzeltildi (`bottom-center`, kodda zaten böyleydi); enum tam liste ile güncellendi
|
|
52
|
+
- README Quick Start örneklerinden gereksiz `data-blakfy-position` override'ı kaldırıldı (default zaten alt-orta)
|
|
53
|
+
- examples/vanilla-html.html + wordpress-snippet.php: `bottom-right` → `bottom-center` (default ile hizalama)
|
|
54
|
+
- Installation bölümü eklendi (npm install + CDN seçenekleri: pinned vs auto-patch)
|
|
55
|
+
- `@blakfy/cookie-next` export tablosu eklendi
|
|
56
|
+
- Migration v1→v2 örneği npm CDN akışına güncellendi
|
|
57
|
+
- `RELEASE.md` baştan yeniden yazıldı (npm publish akışı, granular token, iki paket için manuel publish)
|
|
58
|
+
|
|
59
|
+
### Notes
|
|
60
|
+
|
|
61
|
+
- Bu **sadece patch + docs yayınıdır**; davranış değişmedi, public API değişmedi.
|
|
62
|
+
- `@2` semver tag jsDelivr CDN otomatik bu sürüme geçer.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## [2.1.1] — 2026-05-07
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- **CDN_BASE** runtime URL'i `cdn.jsdelivr.net/gh/tariktunc/blakfy-cookie@v2` → `cdn.jsdelivr.net/npm/@blakfy/cookie@2` (versiyonlu, immutable, npm registry kaynağı)
|
|
71
|
+
- `cookie-next` `BlakfyCookieProvider`: `cdnVersion` prop'u artık npm CDN URL'i üretir (default `"2"` → `@blakfy/cookie@2`)
|
|
72
|
+
- `package.json` `files` listesine `status.json` eklendi (widget runtime'da fetch eder)
|
|
73
|
+
|
|
74
|
+
### Notes
|
|
75
|
+
|
|
76
|
+
- Bu sadece patch yayınıdır; v2.1.0 ile tüm public API'ler ve davranış aynıdır.
|
|
77
|
+
- `srcOverride` (Next wrapper) ile özel CDN URL'i geçenler etkilenmez.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## [2.1.0] — 2026-04-30
|
|
82
|
+
|
|
83
|
+
### Added
|
|
84
|
+
|
|
85
|
+
- **3-tab preferences modal** — Kategoriler / Hizmetler / Hakkında
|
|
86
|
+
- Hizmetler sekmesi: GDPR Madde 13/14 + KVKK Madde 10 uyumlu servis ifşası (veri işleyici, adres, amaçlar, teknolojiler, toplanan veriler, hukuki dayanak, saklama süresi, aktarım ülkeleri, gizlilik politikası linkleri)
|
|
87
|
+
- Accordion kartlar: accordion expand/collapse per service
|
|
88
|
+
- Hakkında sekmesi: CMP kimliği, platform açıklaması, sürüm
|
|
89
|
+
- **18 preset için `SERVICE_METADATA`** (`src/data/service-metadata.js`) — ga4, gtm, facebook, clarity, hotjar, youtube, vimeo, linkedin, yandex, bing, tiktok, pinterest, tawkto, intercom, hubspot, mailchimp, maps, recaptcha
|
|
90
|
+
- **3 renk teması** — `light` (beyaz), `gray` (açık gri), `dark` (siyah); `auto` → `prefers-color-scheme`
|
|
91
|
+
- 23 dile `tabs`, `service`, `svcAbout` çeviri anahtarları eklendi
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- Banner emoji kaldırıldı (kurumsal uyumluluk)
|
|
96
|
+
- Banner butonları `flex:1 flex-wrap:nowrap` ile eşit genişlikte, yatay düzen
|
|
97
|
+
- Widget kart genişliği `min(96vw,1100px)` (önceki: 780px)
|
|
98
|
+
- Widget kart `border-radius: 8px` (önceki: 16px)
|
|
99
|
+
- Buton `min-height: 36px` (önceki: 44px)
|
|
100
|
+
- Service list `max-height: 420px` (önceki: 340px)
|
|
101
|
+
- Bundle size budget `32 KB` (önceki: 24 KB) — service-metadata DB nedeniyle
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
|
|
105
|
+
- CDN URL `@v2` → jsDelivr semver tag desteği
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## [2.0.0] — Unreleased
|
|
110
|
+
|
|
111
|
+
### Architecture
|
|
112
|
+
|
|
113
|
+
- **Modular source tree** under `src/` — split monolithic `cookie.js` into `core/`, `compliance/`, `i18n/`, `ui/`, `gating/`, `presets/`, `geo/`.
|
|
114
|
+
- **Build pipeline** with esbuild — produces `dist/cookie.min.js`, `dist/cookie-defaults.min.js`, and tsup-built `cookie-next` package.
|
|
115
|
+
- **Bundle size budget** — core ≤ 22 KB minified+gzip, enforced in CI.
|
|
116
|
+
|
|
117
|
+
### Compliance (NEW)
|
|
118
|
+
|
|
119
|
+
- Microsoft UET Consent Mode (Bing Ads, Clarity)
|
|
120
|
+
- Yandex Metrica consent + Webvisor as separate `recording` category
|
|
121
|
+
- IAB TCF v2.2 — `__tcfapi` global, TC string encoding, vendor list (preview mode until CMP ID assigned)
|
|
122
|
+
- CCPA / CPRA — opt-out mode, USP string, "Do Not Sell" footer link, GPC respect
|
|
123
|
+
- GPC (Global Privacy Control) — `navigator.globalPrivacyControl` auto-deny
|
|
124
|
+
- DNT (Do Not Track) — opt-in respect mode
|
|
125
|
+
- Jurisdiction detection (`GDPR` / `CCPA` / `LGPD` / `default`)
|
|
126
|
+
|
|
127
|
+
### Tag-Gating (NEW)
|
|
128
|
+
|
|
129
|
+
- `<script type="text/plain" data-blakfy-category="...">` automatic activation
|
|
130
|
+
- `<iframe data-blakfy-src="..." data-blakfy-category="...">` placeholder UI
|
|
131
|
+
- MutationObserver for SPA / dynamically added tags
|
|
132
|
+
- Cookie & localStorage cleanup on consent withdrawal
|
|
133
|
+
|
|
134
|
+
### Presets (NEW — 18 tools)
|
|
135
|
+
|
|
136
|
+
- Google: Analytics 4, Tag Manager, Maps, reCAPTCHA
|
|
137
|
+
- Meta: Facebook Pixel
|
|
138
|
+
- Video: YouTube, Vimeo
|
|
139
|
+
- Analytics: Hotjar, Microsoft Clarity, LinkedIn Insight, Yandex Metrica
|
|
140
|
+
- Ads: Bing Ads (UET), TikTok Pixel, Pinterest Tag
|
|
141
|
+
- Chat/CRM: Tawk.to, Intercom, HubSpot, Mailchimp
|
|
142
|
+
|
|
143
|
+
### Public API Additions
|
|
144
|
+
|
|
145
|
+
- `BlakfyCookie.onConsent(category, fn)` — category-specific callback
|
|
146
|
+
- `BlakfyCookie.registerCleanup({ category, cookies, storage })`
|
|
147
|
+
- `BlakfyCookie.unblock(category)`
|
|
148
|
+
- `BlakfyCookie.scan()` — re-scan DOM after SPA navigation
|
|
149
|
+
- `BlakfyCookie.usePreset(name)`
|
|
150
|
+
- `BlakfyCookie.tcf.getTCString()`
|
|
151
|
+
- `BlakfyCookie.ccpa.optOut()` / `isOptedOut()`
|
|
152
|
+
- `BlakfyCookie.getJurisdiction()`
|
|
153
|
+
- `window.__tcfapi(...)` IAB standard
|
|
154
|
+
|
|
155
|
+
### Branding
|
|
156
|
+
|
|
157
|
+
- "Powered by Blakfy Studio" badge — bottom-right, **non-removable**, anti-tampering protected (CSS `!important` + MutationObserver re-injection + code-baked HTML).
|
|
158
|
+
|
|
159
|
+
### Security & Privacy Fixes
|
|
160
|
+
|
|
161
|
+
- `makeHash()` device fingerprint **removed** → replaced with `crypto.randomUUID()` anonymous ID.
|
|
162
|
+
- `renderStatus` innerHTML XSS vector → `textContent` + DOM construction.
|
|
163
|
+
- Consent cookie `SameSite=Lax` → `SameSite=Strict`.
|
|
164
|
+
- status.json fetch `@latest` → version-pinned `@2`.
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
- **Re-consent storm fix:** v1 triggered re-consent on every `cookie.js` version bump (`cookie.js:494`). Now only `data-blakfy-version` (policy version) triggers re-consent.
|
|
169
|
+
- TypeScript `BlakfyLocale` type expanded from 9 to 23 locales.
|
|
170
|
+
- Next.js `BlakfyCookieProvider` now uses `next/script` `beforeInteractive` (no more FOUC).
|
|
171
|
+
- `useBlakfyConsent` polling removed — event-driven now.
|
|
172
|
+
|
|
173
|
+
### Documentation
|
|
174
|
+
|
|
175
|
+
- AI-readable README with copy-paste install, scenario coverage (vanilla / Next.js / WordPress / GTM), full attribute & API tables.
|
|
176
|
+
- `ARCHITECTURE.md`, `COMPLIANCE.md`, `TCF-CERTIFICATION.md`, `MIGRATION.md`.
|
|
177
|
+
- Real `examples/nextjs/` Next 15 app.
|
|
178
|
+
|
|
179
|
+
### Breaking Changes
|
|
180
|
+
|
|
181
|
+
- None at API level — v1 contracts preserved.
|
|
182
|
+
- `cookie.js` location: `https://cdn.jsdelivr.net/gh/tariktunc/blakfy-cookie@1/cookie.js` → `@2/dist/cookie.min.js`. v1 users unaffected; opt into `@2` for new features.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## [1.2.0] — 2026-04-30 (legacy)
|
|
187
|
+
|
|
188
|
+
- Status bar via central `status.json` (CDN-hosted)
|
|
189
|
+
- BCP47 locale detection (`zh-TW`, `pt-BR` etc.)
|
|
190
|
+
- 23 languages
|
|
191
|
+
|
|
192
|
+
## [1.0.0] — 2026-04-25
|
|
193
|
+
|
|
194
|
+
- Initial release: Google Consent Mode v2, KVKK + GDPR + ePrivacy, 9 languages, vanilla JS, Next.js wrapper.
|