@blakfy/cookie 2.1.2 → 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 CHANGED
@@ -1,140 +1,194 @@
1
- # Changelog
2
-
3
- All notable changes follow [Keep a Changelog](https://keepachangelog.com/) and SemVer.
4
-
5
- ---
6
-
7
- ## [2.1.2] — 2026-05-07
8
-
9
- ### Fixed
10
- - `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)
11
-
12
- ### Docs
13
- - 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
14
- - README Quick Start örneklerinden gereksiz `data-blakfy-position` override'ı kaldırıldı (default zaten alt-orta)
15
- - examples/vanilla-html.html + wordpress-snippet.php: `bottom-right` `bottom-center` (default ile hizalama)
16
- - Installation bölümü eklendi (npm install + CDN seçenekleri: pinned vs auto-patch)
17
- - `@blakfy/cookie-next` export tablosu eklendi
18
- - Migration v1→v2 örneği npm CDN akışına güncellendi
19
- - `RELEASE.md` baştan yeniden yazıldı (npm publish akışı, granular token, iki paket için manuel publish)
20
-
21
- ### Notes
22
- - Bu **sadece patch + docs yayınıdır**; davranış değişmedi, public API değişmedi.
23
- - `@2` semver tag jsDelivr CDN otomatik bu sürüme geçer.
24
-
25
- ---
26
-
27
- ## [2.1.1] 2026-05-07
28
-
29
- ### Changed
30
- - **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ğı)
31
- - `cookie-next` `BlakfyCookieProvider`: `cdnVersion` prop'u artık npm CDN URL'i üretir (default `"2"` → `@blakfy/cookie@2`)
32
- - `package.json` `files` listesine `status.json` eklendi (widget runtime'da fetch eder)
33
-
34
- ### Notes
35
- - Bu sadece patch yayınıdır; v2.1.0 ile tüm public API'ler ve davranış aynıdır.
36
- - `srcOverride` (Next wrapper) ile özel CDN URL'i geçenler etkilenmez.
37
-
38
- ---
39
-
40
- ## [2.1.0] — 2026-04-30
41
-
42
- ### Added
43
- - **3-tab preferences modal** Kategoriler / Hizmetler / Hakkında
44
- - 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)
45
- - Accordion kartlar: accordion expand/collapse per service
46
- - Hakkında sekmesi: CMP kimliği, platform açıklaması, sürüm
47
- - **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
48
- - **3 renk teması** — `light` (beyaz), `gray` (açık gri), `dark` (siyah); `auto` → `prefers-color-scheme`
49
- - 23 dile `tabs`, `service`, `svcAbout` çeviri anahtarları eklendi
50
-
51
- ### Changed
52
- - Banner emoji kaldırıldı (kurumsal uyumluluk)
53
- - Banner butonları `flex:1 flex-wrap:nowrap` ile eşit genişlikte, yatay düzen
54
- - Widget kart genişliği `min(96vw,1100px)` (önceki: 780px)
55
- - Widget kart `border-radius: 8px` (önceki: 16px)
56
- - Buton `min-height: 36px` (önceki: 44px)
57
- - Service list `max-height: 420px` (önceki: 340px)
58
- - Bundle size budget `32 KB` (önceki: 24 KB) — service-metadata DB nedeniyle
59
-
60
- ### Fixed
61
- - CDN URL `@v2` jsDelivr semver tag desteği
62
-
63
- ---
64
-
65
- ## [2.0.0] — Unreleased
66
-
67
- ### Architecture
68
- - **Modular source tree** under `src/` — split monolithic `cookie.js` into `core/`, `compliance/`, `i18n/`, `ui/`, `gating/`, `presets/`, `geo/`.
69
- - **Build pipeline** with esbuild — produces `dist/cookie.min.js`, `dist/cookie-defaults.min.js`, and tsup-built `cookie-next` package.
70
- - **Bundle size budget** core 22 KB minified+gzip, enforced in CI.
71
-
72
- ### Compliance (NEW)
73
- - Microsoft UET Consent Mode (Bing Ads, Clarity)
74
- - Yandex Metrica consent + Webvisor as separate `recording` category
75
- - IAB TCF v2.2 — `__tcfapi` global, TC string encoding, vendor list (preview mode until CMP ID assigned)
76
- - CCPA / CPRA opt-out mode, USP string, "Do Not Sell" footer link, GPC respect
77
- - GPC (Global Privacy Control) `navigator.globalPrivacyControl` auto-deny
78
- - DNT (Do Not Track) — opt-in respect mode
79
- - Jurisdiction detection (`GDPR` / `CCPA` / `LGPD` / `default`)
80
-
81
- ### Tag-Gating (NEW)
82
- - `<script type="text/plain" data-blakfy-category="...">` automatic activation
83
- - `<iframe data-blakfy-src="..." data-blakfy-category="...">` placeholder UI
84
- - MutationObserver for SPA / dynamically added tags
85
- - Cookie & localStorage cleanup on consent withdrawal
86
-
87
- ### Presets (NEW 18 tools)
88
- - Google: Analytics 4, Tag Manager, Maps, reCAPTCHA
89
- - Meta: Facebook Pixel
90
- - Video: YouTube, Vimeo
91
- - Analytics: Hotjar, Microsoft Clarity, LinkedIn Insight, Yandex Metrica
92
- - Ads: Bing Ads (UET), TikTok Pixel, Pinterest Tag
93
- - Chat/CRM: Tawk.to, Intercom, HubSpot, Mailchimp
94
-
95
- ### Public API Additions
96
- - `BlakfyCookie.onConsent(category, fn)` category-specific callback
97
- - `BlakfyCookie.registerCleanup({ category, cookies, storage })`
98
- - `BlakfyCookie.unblock(category)`
99
- - `BlakfyCookie.scan()` — re-scan DOM after SPA navigation
100
- - `BlakfyCookie.usePreset(name)`
101
- - `BlakfyCookie.tcf.getTCString()`
102
- - `BlakfyCookie.ccpa.optOut()` / `isOptedOut()`
103
- - `BlakfyCookie.getJurisdiction()`
104
- - `window.__tcfapi(...)` IAB standard
105
-
106
- ### Branding
107
- - "Powered by Blakfy Studio" badge — bottom-right, **non-removable**, anti-tampering protected (CSS `!important` + MutationObserver re-injection + code-baked HTML).
108
-
109
- ### Security & Privacy Fixes
110
- - `makeHash()` device fingerprint **removed** → replaced with `crypto.randomUUID()` anonymous ID.
111
- - `renderStatus` innerHTML XSS vector → `textContent` + DOM construction.
112
- - Consent cookie `SameSite=Lax` → `SameSite=Strict`.
113
- - status.json fetch `@latest` version-pinned `@2`.
114
-
115
- ### Bug Fixes
116
- - **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.
117
- - TypeScript `BlakfyLocale` type expanded from 9 to 23 locales.
118
- - Next.js `BlakfyCookieProvider` now uses `next/script` `beforeInteractive` (no more FOUC).
119
- - `useBlakfyConsent` polling removed event-driven now.
120
-
121
- ### Documentation
122
- - AI-readable README with copy-paste install, scenario coverage (vanilla / Next.js / WordPress / GTM), full attribute & API tables.
123
- - `ARCHITECTURE.md`, `COMPLIANCE.md`, `TCF-CERTIFICATION.md`, `MIGRATION.md`.
124
- - Real `examples/nextjs/` Next 15 app.
125
-
126
- ### Breaking Changes
127
- - None at API level — v1 contracts preserved.
128
- - `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.
129
-
130
- ---
131
-
132
- ## [1.2.0] 2026-04-30 (legacy)
133
-
134
- - Status bar via central `status.json` (CDN-hosted)
135
- - BCP47 locale detection (`zh-TW`, `pt-BR` etc.)
136
- - 23 languages
137
-
138
- ## [1.0.0] 2026-04-25
139
-
140
- - Initial release: Google Consent Mode v2, KVKK + GDPR + ePrivacy, 9 languages, vanilla JS, Next.js wrapper.
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.