@rayels/loi25-core 1.0.0 → 1.0.1
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 +155 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# @rayels/loi25-core
|
|
2
|
+
|
|
3
|
+
> **FR** | [English](#english)
|
|
4
|
+
|
|
5
|
+
Bannière de consentement aux cookies légère et bilingue pour la **Loi 25 du Québec** (Projet de loi 64). Zéro dépendance. Vanilla JS. Fonctionne partout.
|
|
6
|
+
|
|
7
|
+
**Par [Rayels Consulting](https://rayelsconsulting.com)** — Agence numérique à Montréal
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @rayels/loi25-core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Utilisation
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const Loi25 = require('@rayels/loi25-core');
|
|
19
|
+
|
|
20
|
+
Loi25.init({
|
|
21
|
+
lang: 'fr', // 'fr' ou 'en'
|
|
22
|
+
position: 'bottom', // 'bottom' ou 'top'
|
|
23
|
+
theme: 'light', // 'light' ou 'dark'
|
|
24
|
+
privacyPolicyUrl: '/politique-de-confidentialite'
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Ou via CDN :
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<script src="https://unpkg.com/@rayels/loi25-core"></script>
|
|
32
|
+
<script>
|
|
33
|
+
Loi25.init({ lang: 'fr' });
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Vérifier le consentement
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
if (Loi25.isAnalyticsAllowed()) {
|
|
41
|
+
// Charger Google Analytics, Meta Pixel, etc.
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## API
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
Loi25.init(config) // Afficher la bannière
|
|
49
|
+
Loi25.getConsent() // Retourne 'all' | 'necessary' | null
|
|
50
|
+
Loi25.setConsent(level) // Définir le consentement
|
|
51
|
+
Loi25.revokeConsent() // Révoquer (la bannière réapparaît)
|
|
52
|
+
Loi25.isAnalyticsAllowed() // true si consentement === 'all'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Options
|
|
56
|
+
|
|
57
|
+
| Option | Type | Défaut | Description |
|
|
58
|
+
|--------|------|--------|-------------|
|
|
59
|
+
| `lang` | `'fr' \| 'en'` | `'fr'` | Langue |
|
|
60
|
+
| `position` | `'bottom' \| 'top'` | `'bottom'` | Position |
|
|
61
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | Thème |
|
|
62
|
+
| `privacyPolicyUrl` | `string` | `'/politique-de-confidentialite'` | Lien confidentialité |
|
|
63
|
+
| `poweredByLink` | `boolean` | `true` | Afficher "Propulsé par Rayels" |
|
|
64
|
+
| `onAcceptAll` | `function` | — | Callback accepter tout |
|
|
65
|
+
| `onAcceptNecessary` | `function` | — | Callback nécessaire seulement |
|
|
66
|
+
|
|
67
|
+
## Aussi disponible
|
|
68
|
+
|
|
69
|
+
- [`@rayels/loi25`](https://www.npmjs.com/package/@rayels/loi25) — Composant React / Next.js
|
|
70
|
+
- [Plugin WordPress](https://github.com/raracx/rayels-loi25/tree/master/packages/wordpress)
|
|
71
|
+
- [Extension Chrome](https://github.com/raracx/rayels-loi25/tree/master/packages/chrome-extension)
|
|
72
|
+
- [Snippets VS Code](https://marketplace.visualstudio.com/items?itemName=rayels-consulting.rayels-loi25-snippets)
|
|
73
|
+
|
|
74
|
+
## Licence
|
|
75
|
+
|
|
76
|
+
MIT — [Rayels Consulting](https://rayelsconsulting.com)
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
<a id="english"></a>
|
|
81
|
+
|
|
82
|
+
# English
|
|
83
|
+
|
|
84
|
+
Lightweight, bilingual cookie consent banner for Quebec's **Law 25** (Bill 64). Zero dependencies. Vanilla JS. Works everywhere.
|
|
85
|
+
|
|
86
|
+
**By [Rayels Consulting](https://rayelsconsulting.com)** — Montreal Digital Agency
|
|
87
|
+
|
|
88
|
+
## Install
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm install @rayels/loi25-core
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
const Loi25 = require('@rayels/loi25-core');
|
|
98
|
+
|
|
99
|
+
Loi25.init({
|
|
100
|
+
lang: 'fr', // 'fr' or 'en'
|
|
101
|
+
position: 'bottom', // 'bottom' or 'top'
|
|
102
|
+
theme: 'light', // 'light' or 'dark'
|
|
103
|
+
privacyPolicyUrl: '/politique-de-confidentialite'
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or via CDN:
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<script src="https://unpkg.com/@rayels/loi25-core"></script>
|
|
111
|
+
<script>
|
|
112
|
+
Loi25.init({ lang: 'fr' });
|
|
113
|
+
</script>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Check consent
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
if (Loi25.isAnalyticsAllowed()) {
|
|
120
|
+
// Load Google Analytics, Meta Pixel, etc.
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## API
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
Loi25.init(config) // Show banner
|
|
128
|
+
Loi25.getConsent() // Returns 'all' | 'necessary' | null
|
|
129
|
+
Loi25.setConsent(level) // Manually set consent
|
|
130
|
+
Loi25.revokeConsent() // Revoke (banner reappears)
|
|
131
|
+
Loi25.isAnalyticsAllowed() // true if consent === 'all'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Options
|
|
135
|
+
|
|
136
|
+
| Option | Type | Default | Description |
|
|
137
|
+
|--------|------|---------|-------------|
|
|
138
|
+
| `lang` | `'fr' \| 'en'` | `'fr'` | Language |
|
|
139
|
+
| `position` | `'bottom' \| 'top'` | `'bottom'` | Position |
|
|
140
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | Theme |
|
|
141
|
+
| `privacyPolicyUrl` | `string` | `'/politique-de-confidentialite'` | Privacy policy link |
|
|
142
|
+
| `poweredByLink` | `boolean` | `true` | Show "Powered by Rayels" |
|
|
143
|
+
| `onAcceptAll` | `function` | — | Callback on accept all |
|
|
144
|
+
| `onAcceptNecessary` | `function` | — | Callback on necessary only |
|
|
145
|
+
|
|
146
|
+
## Also available
|
|
147
|
+
|
|
148
|
+
- [`@rayels/loi25`](https://www.npmjs.com/package/@rayels/loi25) — React / Next.js component
|
|
149
|
+
- [WordPress Plugin](https://github.com/raracx/rayels-loi25/tree/master/packages/wordpress)
|
|
150
|
+
- [Chrome Extension](https://github.com/raracx/rayels-loi25/tree/master/packages/chrome-extension)
|
|
151
|
+
- [VS Code Snippets](https://marketplace.visualstudio.com/items?itemName=rayels-consulting.rayels-loi25-snippets)
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT — [Rayels Consulting](https://rayelsconsulting.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rayels/loi25-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Loi 25 Quebec cookie consent manager — lightweight, bilingual, GDPR/Loi 25 compliant. By Rayels Consulting.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"homepage": "https://rayelsconsulting.com",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/raracx/rayels-loi25
|
|
29
|
+
"url": "https://github.com/raracx/rayels-loi25"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT"
|
|
32
32
|
}
|