prunelle 0.1.1 → 0.7.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/LICENSE +21 -0
- package/llms.txt +137 -40
- package/package.json +11 -2
- package/src/a11y/declaration.ts +369 -0
- package/src/a11y/index.ts +466 -0
- package/src/a11y/rgaa-map.ts +230 -0
- package/src/attrs.ts +11 -3
- package/src/build/bundle.ts +88 -40
- package/src/build/byte-size.ts +11 -0
- package/src/build/client-entries.ts +3 -2
- package/src/build/client-plugin.ts +11 -5
- package/src/build/client-prune.ts +56 -6
- package/src/build/compile.ts +13 -10
- package/src/build/ecoindex.ts +230 -0
- package/src/build/files.ts +6 -0
- package/src/build/first-load.ts +83 -11
- package/src/build/graph.ts +29 -39
- package/src/build/index.ts +218 -113
- package/src/build/island-promote.ts +229 -0
- package/src/build/islands.ts +11 -203
- package/src/build/manifest.ts +56 -116
- package/src/build/output.ts +2 -2
- package/src/build/plugin-host.ts +113 -41
- package/src/build/precompress.ts +16 -3
- package/src/build/prerender.ts +173 -38
- package/src/build/reach.ts +136 -0
- package/src/build/render-rules.ts +2 -2
- package/src/build/report.ts +42 -5
- package/src/build/resolve.ts +8 -6
- package/src/build/routes.ts +175 -10
- package/src/build/static-headers.ts +93 -0
- package/src/build/static.ts +139 -39
- package/src/build/status-pages.ts +127 -0
- package/src/build/style-bundles.ts +526 -0
- package/src/cli/check-forms.ts +610 -0
- package/src/cli/check-imports.ts +25 -0
- package/src/cli/check-links.ts +632 -0
- package/src/cli/check-security.ts +64 -0
- package/src/cli/check.ts +107 -26
- package/src/cli/commands.ts +120 -11
- package/src/cli/docs.ts +403 -0
- package/src/cli/inspect.ts +105 -15
- package/src/cli/mcp-tools.ts +492 -0
- package/src/cli/mcp.ts +205 -0
- package/src/cli/new.ts +16 -5
- package/src/cli/render.ts +416 -0
- package/src/cli/upgrade-names.ts +73 -13
- package/src/cli/upgrade.ts +156 -18
- package/src/compiler/analyze.ts +68 -14
- package/src/compiler/browser-globals.ts +140 -17
- package/src/compiler/cacheability.ts +636 -0
- package/src/compiler/compliance-eco.ts +71 -0
- package/src/compiler/compliance-rgaa.ts +614 -0
- package/src/compiler/compliance-urls.ts +145 -0
- package/src/compiler/compliance.ts +355 -351
- package/src/compiler/data-keys.ts +199 -192
- package/src/compiler/dev-source.ts +87 -0
- package/src/compiler/dom-attrs.ts +138 -65
- package/src/compiler/dom.ts +517 -442
- package/src/compiler/expr-context.ts +167 -57
- package/src/compiler/foreign-imports.ts +88 -0
- package/src/compiler/mistakes.ts +23 -2
- package/src/compiler/props-body.ts +52 -0
- package/src/compiler/props.ts +87 -36
- package/src/compiler/scope.ts +400 -333
- package/src/compiler/server-only.ts +190 -151
- package/src/compiler/shared.ts +42 -14
- package/src/compiler/signal-reads.ts +6 -2
- package/src/compiler/ssr-prunelle-tags.ts +27 -14
- package/src/compiler/ssr.ts +220 -89
- package/src/context.ts +34 -0
- package/src/dev/error-log.ts +177 -0
- package/src/dev/host-check.ts +26 -0
- package/src/dev/index.ts +91 -34
- package/src/dev/open-editor.ts +208 -0
- package/src/dev/protocol.ts +3 -0
- package/src/dev/reload.ts +5 -3
- package/src/dev/supervisor.ts +50 -25
- package/src/dev/watchers.ts +74 -13
- package/src/dom/action.ts +47 -21
- package/src/dom/attrs.ts +15 -3
- package/src/dom/extras.ts +29 -14
- package/src/dom/index.ts +39 -10
- package/src/dom/island.ts +54 -35
- package/src/dom/loop.ts +33 -23
- package/src/eco/declaration.ts +257 -0
- package/src/eco/index.ts +65 -0
- package/src/index.ts +2 -2
- package/src/jsx-runtime.ts +2 -2
- package/src/plugins/config.ts +8 -7
- package/src/plugins/context.ts +16 -1
- package/src/plugins/index.ts +2 -2
- package/src/plugins/load.ts +30 -10
- package/src/plugins/order.ts +38 -1
- package/src/plugins/public.ts +6 -3
- package/src/plugins/services.ts +84 -0
- package/src/plugins/types.ts +51 -2
- package/src/reactivity/graph.ts +10 -0
- package/src/reactivity/index.ts +24 -16
- package/src/reactivity/selector.ts +31 -4
- package/src/reactivity/store.ts +45 -13
- package/src/server/action-flash.ts +158 -0
- package/src/server/action-protect.ts +199 -0
- package/src/server/action-registry.ts +1 -1
- package/src/server/action.ts +56 -117
- package/src/server/app-secret.ts +63 -0
- package/src/server/assets.ts +34 -2
- package/src/server/compress.ts +96 -10
- package/src/server/consent.ts +59 -22
- package/src/server/cookies.ts +16 -2
- package/src/server/document.ts +25 -10
- package/src/server/env.ts +14 -0
- package/src/server/errors.ts +305 -65
- package/src/server/form-schema.ts +343 -0
- package/src/server/health.ts +275 -0
- package/src/server/http.ts +177 -38
- package/src/server/index.ts +264 -272
- package/src/server/loader.ts +11 -2
- package/src/server/param-matchers.ts +112 -0
- package/src/server/plugin-host.ts +125 -88
- package/src/server/public.ts +6 -5
- package/src/server/rate-limit.ts +102 -36
- package/src/server/request-body.ts +1 -1
- package/src/server/route-cache.ts +445 -0
- package/src/server/route-table.ts +344 -9
- package/src/server/router.ts +125 -40
- package/src/server/routing.ts +112 -63
- package/src/server/sanitize-html.ts +309 -0
- package/src/server/security.ts +277 -50
- package/src/server/serve-handlers.ts +31 -7
- package/src/server/start.ts +60 -16
- package/src/server/static-dir.ts +87 -11
- package/src/server/stream.ts +68 -27
- package/src/ssr/consent-banner.ts +58 -0
- package/src/ssr/context.ts +105 -7
- package/src/ssr/index.ts +148 -3
- package/src/ssr/navigation.ts +2 -2
- package/src/ssr/region.ts +31 -19
- package/src/style.ts +32 -1
- package/src/test/browser.ts +28 -13
- package/src/test/index.ts +97 -12
- package/src/ts-plugin/diagnostics.ts +505 -0
- package/src/ts-plugin/fixes.ts +364 -0
- package/src/ts-plugin/index.ts +194 -0
- package/templates/_shared/AGENTS.md +2 -2
- package/templates/_shared/gitignore +5 -0
- package/templates/_shared/mcp.json +11 -0
- package/templates/_shared/src/routes/legal.tsx +15 -1
- package/templates/_shared/tsconfig.json +5 -0
- package/templates/app/.env.example +4 -0
- package/templates/app/package.json +2 -1
- package/templates/app/prunelle.config.ts +2 -0
- package/templates/app/src/auth.ts +4 -6
- package/templates/app/src/mail.ts +4 -0
- package/templates/app/src/routes/_layout.tsx +9 -1
- package/templates/app/src/routes/dashboard/index.tsx +42 -8
- package/templates/app/src/routes/login.tsx +49 -30
- package/templates/app/src/routes/privacy.tsx +25 -0
- package/templates/app/src/styles/app.css +8 -1
- package/templates/app/tests/app.test.ts +44 -3
- package/templates/blog/package.json +1 -1
- package/templates/blog/prunelle.config.ts +1 -1
- package/templates/blog/src/routes/_layout.tsx +6 -1
- package/templates/blog/src/routes/index.tsx +5 -1
- package/templates/blog/src/styles/app.css +6 -1
- package/templates/fullstack/package.json +1 -1
- package/templates/fullstack/src/components/GreetForm.tsx +2 -1
- package/templates/fullstack/src/routes/_layout.tsx +4 -0
- package/templates/fullstack/src/styles/app.css +11 -1
- package/templates/minimal/package.json +1 -1
- package/templates/minimal/src/routes/_layout.tsx +4 -0
- package/templates/minimal/src/styles/app.css +11 -1
- package/ts-plugin.cjs +4277 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
// Generates an editable French RGAA 4.1.2 accessibility declaration page (Décret n° 2019-768).
|
|
2
|
+
|
|
3
|
+
import type { A11yAuditReport } from './index'
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
5
|
+
import { dirname, join, resolve } from 'node:path'
|
|
6
|
+
import { relPosix } from '../build/files'
|
|
7
|
+
|
|
8
|
+
export type ComplianceStatus = 'full' | 'partial' | 'none'
|
|
9
|
+
|
|
10
|
+
/** The manual RGAA audit a statement reports: the day it ended and the share of applicable criteria met. */
|
|
11
|
+
export interface ManualAudit {
|
|
12
|
+
date: Date
|
|
13
|
+
/** Applicable RGAA criteria met, in percent (0 to 100). */
|
|
14
|
+
rate: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AccessibilityDeclarationOptions {
|
|
18
|
+
/** Application root directory. */
|
|
19
|
+
root: string
|
|
20
|
+
/** Destination path relative to `root` (or absolute). Default: `'src/routes/accessibilite.tsx'`. */
|
|
21
|
+
outPath?: string | undefined
|
|
22
|
+
/** Optional audit report from `auditAccessibility()` used to pre-fill test results and non-conformities. */
|
|
23
|
+
report?: A11yAuditReport | undefined
|
|
24
|
+
/** Organization or publisher name (editable placeholder by default). */
|
|
25
|
+
organization?: string | undefined
|
|
26
|
+
/** Public site URL (editable placeholder by default). */
|
|
27
|
+
siteUrl?: string | undefined
|
|
28
|
+
/** Contact email for accessibility feedback (editable placeholder by default). */
|
|
29
|
+
contactEmail?: string | undefined
|
|
30
|
+
/** The manual RGAA audit behind the compliance level; without one the statement says "non conforme". */
|
|
31
|
+
audit?: ManualAudit | undefined
|
|
32
|
+
/** Day the statement is drawn up (defaults to today). */
|
|
33
|
+
date?: Date | undefined
|
|
34
|
+
/** Write the generated TSX page to disk (default: `true`). */
|
|
35
|
+
write?: boolean | undefined
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AccessibilityDeclarationResult {
|
|
39
|
+
/** Absolute path of the target declaration file. */
|
|
40
|
+
path: string
|
|
41
|
+
/** Root-relative POSIX path (e.g. `'src/routes/accessibilite.tsx'`). */
|
|
42
|
+
relativePath: string
|
|
43
|
+
/** Compliance status written into the declaration. */
|
|
44
|
+
status: ComplianceStatus
|
|
45
|
+
/** Generated TSX source code. */
|
|
46
|
+
content: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const DEFAULT_DECLARATION_PATH = 'src/routes/accessibilite.tsx'
|
|
50
|
+
/** Marks a fact a drafted statement still lacks: `prunelle check` warns while a published statement holds one. */
|
|
51
|
+
export const STATEMENT_PLACEHOLDER = '[à compléter'
|
|
52
|
+
|
|
53
|
+
const STATUS_LABELS: Readonly<Record<ComplianceStatus, string>> = {
|
|
54
|
+
full: 'totalement conforme',
|
|
55
|
+
partial: 'partiellement conforme',
|
|
56
|
+
none: 'non conforme',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The RGAA compliance level a manual audit supports: all criteria met, at least half, or less, or no audit at all. Automated checks never raise it. */
|
|
60
|
+
export function inferComplianceStatus(audit: ManualAudit | undefined): ComplianceStatus {
|
|
61
|
+
if (audit === undefined)
|
|
62
|
+
return 'none'
|
|
63
|
+
if (Number.isNaN(audit.date.getTime()))
|
|
64
|
+
throw new Error('prunelle: the manual audit date is not a valid date: pass the day the audit ended, such as 2026-03-31.')
|
|
65
|
+
if (!(audit.rate >= 0 && audit.rate <= 100))
|
|
66
|
+
throw new Error(`prunelle: the manual audit rate must be a percentage from 0 to 100, got ${audit.rate}.`)
|
|
67
|
+
if (audit.rate === 100)
|
|
68
|
+
return 'full'
|
|
69
|
+
return audit.rate >= 50 ? 'partial' : 'none'
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function escapeJsxText(value: string): string {
|
|
73
|
+
return value
|
|
74
|
+
.replaceAll('&', '&')
|
|
75
|
+
.replaceAll('<', '<')
|
|
76
|
+
.replaceAll('>', '>')
|
|
77
|
+
.replaceAll('{', '{')
|
|
78
|
+
.replaceAll('}', '}')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function escapeAttr(value: string): string {
|
|
82
|
+
return value
|
|
83
|
+
.replaceAll('&', '&')
|
|
84
|
+
.replaceAll('"', '"')
|
|
85
|
+
.replaceAll('<', '<')
|
|
86
|
+
.replaceAll('>', '>')
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function formatFrenchDate(date: Date): { iso: string, human: string } {
|
|
90
|
+
const iso = date.toISOString().slice(0, 10)
|
|
91
|
+
const human = new Intl.DateTimeFormat('fr-FR', {
|
|
92
|
+
day: 'numeric',
|
|
93
|
+
month: 'long',
|
|
94
|
+
year: 'numeric',
|
|
95
|
+
timeZone: 'UTC',
|
|
96
|
+
}).format(date)
|
|
97
|
+
return { iso, human }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function renderNonConformities(report: A11yAuditReport | undefined): string {
|
|
101
|
+
if (report === undefined)
|
|
102
|
+
return ' <p>Aucun audit n\'a encore été réalisé : les non-conformités ne sont pas encore connues.</p>'
|
|
103
|
+
const routesWithIssues = report?.routes.filter(r => r.violations.length > 0) ?? []
|
|
104
|
+
if (routesWithIssues.length === 0) {
|
|
105
|
+
return [
|
|
106
|
+
' <p>',
|
|
107
|
+
' {/* TODO: compléter avec les non-conformités relevées lors de l\'audit manuel RGAA 4.1.2 */}',
|
|
108
|
+
' Aucune non-conformité n\'a été détectée par l\'audit automatisé axe-core.',
|
|
109
|
+
' </p>',
|
|
110
|
+
].join('\n')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const items: string[] = []
|
|
114
|
+
for (const route of routesWithIssues) {
|
|
115
|
+
for (const v of route.violations) {
|
|
116
|
+
const rgaaLabel = v.rgaa.length > 0
|
|
117
|
+
? `RGAA ${v.rgaa.map(c => c.id).join(', ')}`
|
|
118
|
+
: 'WCAG / axe-core'
|
|
119
|
+
const count = v.nodes.length
|
|
120
|
+
const elemWord = count === 1 ? 'élément' : 'éléments'
|
|
121
|
+
const line = `${route.route} — ${rgaaLabel} (${v.id}, impact ${v.impact}, ${count} ${elemWord}) : ${v.help}.`
|
|
122
|
+
items.push(` <li>${escapeJsxText(line)}</li>`)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return [
|
|
126
|
+
' <p>Les non-conformités suivantes ont été détectées automatiquement par axe-core :</p>',
|
|
127
|
+
' <ul>',
|
|
128
|
+
...items,
|
|
129
|
+
' </ul>',
|
|
130
|
+
].join('\n')
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function renderAuditedRoutes(report: A11yAuditReport | undefined): string {
|
|
134
|
+
const routes = report?.routes ?? []
|
|
135
|
+
if (routes.length === 0) {
|
|
136
|
+
return [
|
|
137
|
+
' <ul>',
|
|
138
|
+
` <li>${STATEMENT_PLACEHOLDER} : pages de l'échantillon audité]</li>`,
|
|
139
|
+
' </ul>',
|
|
140
|
+
].join('\n')
|
|
141
|
+
}
|
|
142
|
+
const items = routes.map((r) => {
|
|
143
|
+
const summary = r.violations.length === 0
|
|
144
|
+
? '0 violation automatisée'
|
|
145
|
+
: `${r.violations.length} violation${r.violations.length === 1 ? '' : 's'} automatisée${r.violations.length === 1 ? '' : 's'}`
|
|
146
|
+
return ` <li><code>${escapeJsxText(r.route)}</code> (${escapeJsxText(summary)})</li>`
|
|
147
|
+
})
|
|
148
|
+
return [
|
|
149
|
+
' <ul>',
|
|
150
|
+
...items,
|
|
151
|
+
' </ul>',
|
|
152
|
+
].join('\n')
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function automatedResultParagraph(report: A11yAuditReport | undefined, axeLabel: string): string {
|
|
156
|
+
if (report === undefined)
|
|
157
|
+
return ' <p>Aucun audit automatisé n\'a encore été réalisé.</p>'
|
|
158
|
+
const routeCount = report.routes.length
|
|
159
|
+
const violationCount = report.totalViolations
|
|
160
|
+
return [
|
|
161
|
+
' <p>',
|
|
162
|
+
` L'audit automatisé réalisé via <code>prunelle a11y</code> (${escapeJsxText(axeLabel)}, règles RGAA 4 d'axe-core et WCAG 2.1`,
|
|
163
|
+
` niveaux A et AA) a porté sur <strong>${routeCount}</strong> page${routeCount === 1 ? '' : 's'} et a relevé{' '}`,
|
|
164
|
+
` <strong>${violationCount}</strong> violation${violationCount === 1 ? '' : 's'} automatisée${violationCount === 1 ? '' : 's'}.`,
|
|
165
|
+
' </p>',
|
|
166
|
+
].join('\n')
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function testEnvironmentItems(report: A11yAuditReport | undefined, axeLabel: string): string {
|
|
170
|
+
if (report === undefined)
|
|
171
|
+
return ` <li>${STATEMENT_PLACEHOLDER} : navigateurs et technologies d'assistance de l'audit]</li>`
|
|
172
|
+
return [
|
|
173
|
+
' <li>Navigateur : Chromium (headless via Playwright)</li>',
|
|
174
|
+
` <li>Moteur d'analyse : ${escapeJsxText(axeLabel)}</li>`,
|
|
175
|
+
' {/* TODO: ajouter les combinaisons navigateur et lecteur d\'écran de l\'audit manuel (ex. Firefox + NVDA, Safari + VoiceOver) */}',
|
|
176
|
+
].join('\n')
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function buildStatusParagraph(status: ComplianceStatus, siteUrl: string, audit: ManualAudit | undefined): string {
|
|
180
|
+
const reason = audit === undefined
|
|
181
|
+
? ' en l\'absence d\'audit de conformité RGAA 4.1.2'
|
|
182
|
+
: status === 'full' ? '' : ' en raison des non-conformités listées ci-dessous'
|
|
183
|
+
return [
|
|
184
|
+
` <p>`,
|
|
185
|
+
` <strong>${escapeJsxText(siteUrl)}</strong> est <strong>${STATUS_LABELS[status]}</strong> avec le référentiel général d'amélioration de l'accessibilité (RGAA), version 4.1.2${escapeJsxText(reason)}.`,
|
|
186
|
+
` </p>`,
|
|
187
|
+
].join('\n')
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function manualAuditParagraph(audit: ManualAudit | undefined, automated: boolean): string {
|
|
191
|
+
if (audit === undefined && !automated)
|
|
192
|
+
return ' <p>Aucun audit de conformité manuel RGAA 4.1.2 n\'a encore été réalisé.</p>'
|
|
193
|
+
if (audit === undefined)
|
|
194
|
+
return ' <p>Aucun audit de conformité manuel RGAA 4.1.2 n\'a encore été réalisé : seules les vérifications automatisées ci-dessus ont été menées.</p>'
|
|
195
|
+
const { iso, human } = formatFrenchDate(audit.date)
|
|
196
|
+
const rate = new Intl.NumberFormat('fr-FR', { maximumFractionDigits: 1 }).format(audit.rate)
|
|
197
|
+
return [
|
|
198
|
+
` <p>`,
|
|
199
|
+
` L'audit de conformité manuel RGAA 4.1.2, achevé le <time dateTime="${escapeAttr(iso)}">${escapeJsxText(human)}</time>, révèle que <strong>${rate} %</strong> des critères du RGAA version 4.1.2 sont respectés.`,
|
|
200
|
+
` </p>`,
|
|
201
|
+
].join('\n')
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function contactLine(contactEmail: string | undefined): string {
|
|
205
|
+
if (contactEmail === undefined)
|
|
206
|
+
return ` <li>Envoyer un courriel : ${STATEMENT_PLACEHOLDER} : adresse de contact accessibilité]</li>`
|
|
207
|
+
return ` <li>Envoyer un courriel : <a href="mailto:${escapeAttr(contactEmail)}">${escapeJsxText(contactEmail)}</a></li>`
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// The layouts above the page, nearest first, up to the app root: one already rendering <main> holds the statement, which must not open a second.
|
|
211
|
+
export function layoutRendersMain(root: string, dest: string): boolean {
|
|
212
|
+
for (let dir = dirname(dest); dir.startsWith(root); dir = dirname(dir)) {
|
|
213
|
+
const layout = join(dir, '_layout.tsx')
|
|
214
|
+
if (existsSync(layout) && /<main[\s>]/.test(readFileSync(layout, 'utf8')))
|
|
215
|
+
return true
|
|
216
|
+
if (dir === root)
|
|
217
|
+
break
|
|
218
|
+
}
|
|
219
|
+
return false
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Generates (and optionally writes) a draft French RGAA 4.1.2 accessibility declaration page in TSX. */
|
|
223
|
+
export function draftAccessibilityStatement(options: AccessibilityDeclarationOptions): AccessibilityDeclarationResult {
|
|
224
|
+
const root = resolve(options.root)
|
|
225
|
+
const dest = resolve(root, options.outPath ?? DEFAULT_DECLARATION_PATH)
|
|
226
|
+
const relativePath = relPosix(root, dest)
|
|
227
|
+
const status = inferComplianceStatus(options.audit)
|
|
228
|
+
const org = options.organization?.trim() || `${STATEMENT_PLACEHOLDER} : nom de l'organisme]`
|
|
229
|
+
const siteUrl = options.siteUrl?.trim() || `${STATEMENT_PLACEHOLDER} : adresse du site]`
|
|
230
|
+
const { iso, human } = formatFrenchDate(options.date ?? new Date())
|
|
231
|
+
const axeLabel = options.report?.axeVersion ? `axe-core ${options.report.axeVersion}` : 'axe-core'
|
|
232
|
+
const wrapper = layoutRendersMain(root, dest) ? 'article' : 'main'
|
|
233
|
+
|
|
234
|
+
const content = `// Brouillon de déclaration d'accessibilité RGAA 4.1.2 (Décret n° 2019-768) généré par \`prunelle a11y --draft\`.
|
|
235
|
+
// Les vérifications automatisées axe-core ne couvrent qu'une partie des 106 critères du RGAA 4.1.2 : le niveau de conformité vient de l'audit manuel (\`--audit-date\` et \`--rate\`).
|
|
236
|
+
// Remplacez chaque mention entre crochets avant publication : \`prunelle check\` signale celles qui restent.
|
|
237
|
+
|
|
238
|
+
import { Head } from 'prunelle'
|
|
239
|
+
|
|
240
|
+
export const prerender = true
|
|
241
|
+
|
|
242
|
+
export default function Accessibilite() {
|
|
243
|
+
return (
|
|
244
|
+
<>
|
|
245
|
+
<Head>
|
|
246
|
+
<title>Déclaration d'accessibilité</title>
|
|
247
|
+
</Head>
|
|
248
|
+
<${wrapper} lang="fr">
|
|
249
|
+
<h1>Déclaration d'accessibilité</h1>
|
|
250
|
+
<p>
|
|
251
|
+
<strong>${escapeJsxText(org)}</strong> s'engage à rendre ses sites internet, intranet, extranet et ses progiciels
|
|
252
|
+
accessibles (et ses applications mobiles et mobilier urbain numérique) conformément à l'article 47 de la loi n° 2005-102
|
|
253
|
+
du 11 février 2005.
|
|
254
|
+
</p>
|
|
255
|
+
<p>
|
|
256
|
+
Cette déclaration d'accessibilité s'applique à <strong>${escapeJsxText(siteUrl)}</strong>.
|
|
257
|
+
</p>
|
|
258
|
+
|
|
259
|
+
<section>
|
|
260
|
+
<h2>État de conformité</h2>
|
|
261
|
+
${buildStatusParagraph(status, siteUrl, options.audit)}
|
|
262
|
+
</section>
|
|
263
|
+
|
|
264
|
+
<section>
|
|
265
|
+
<h2>Résultats des tests</h2>
|
|
266
|
+
${automatedResultParagraph(options.report, axeLabel)}
|
|
267
|
+
${manualAuditParagraph(options.audit, options.report !== undefined)}
|
|
268
|
+
</section>
|
|
269
|
+
|
|
270
|
+
<section>
|
|
271
|
+
<h2>Contenus non accessibles</h2>
|
|
272
|
+
|
|
273
|
+
<h3>Non-conformités</h3>
|
|
274
|
+
${renderNonConformities(options.report)}
|
|
275
|
+
|
|
276
|
+
<h3>Dérogations pour charge disproportionnée</h3>
|
|
277
|
+
<p>
|
|
278
|
+
{/* TODO: lister ici les éventuelles dérogations justifiées */}
|
|
279
|
+
Aucune.
|
|
280
|
+
</p>
|
|
281
|
+
|
|
282
|
+
<h3>Contenus non soumis à l'obligation d'accessibilité</h3>
|
|
283
|
+
<p>
|
|
284
|
+
{/* TODO: lister ici les contenus tiers ou archives hors périmètre */}
|
|
285
|
+
Aucun.
|
|
286
|
+
</p>
|
|
287
|
+
</section>
|
|
288
|
+
|
|
289
|
+
<section>
|
|
290
|
+
<h2>Établissement de cette déclaration d'accessibilité</h2>
|
|
291
|
+
<p>
|
|
292
|
+
Cette déclaration a été établie le <time dateTime="${escapeAttr(iso)}">${escapeJsxText(human)}</time>.
|
|
293
|
+
</p>
|
|
294
|
+
|
|
295
|
+
<h3>Technologies utilisées pour la réalisation du site</h3>
|
|
296
|
+
<ul>
|
|
297
|
+
<li>HTML5</li>
|
|
298
|
+
<li>CSS</li>
|
|
299
|
+
<li>JavaScript</li>
|
|
300
|
+
<li>Prunelle</li>
|
|
301
|
+
</ul>
|
|
302
|
+
|
|
303
|
+
<h3>Environnement de test</h3>
|
|
304
|
+
<p>
|
|
305
|
+
Les vérifications de restitution de contenus ont été réalisées dans l'environnement suivant :
|
|
306
|
+
</p>
|
|
307
|
+
<ul>
|
|
308
|
+
${testEnvironmentItems(options.report, axeLabel)}
|
|
309
|
+
</ul>
|
|
310
|
+
|
|
311
|
+
<h3>Outils pour évaluer l'accessibilité</h3>
|
|
312
|
+
<ul>
|
|
313
|
+
<li><code>prunelle a11y</code> (${escapeJsxText(axeLabel)})</li>
|
|
314
|
+
<li><code>prunelle check</code> (vérifications statiques RGAA sur le JSX)</li>
|
|
315
|
+
</ul>
|
|
316
|
+
|
|
317
|
+
<h3>Pages du site ayant fait l'objet de la vérification de conformité</h3>
|
|
318
|
+
${renderAuditedRoutes(options.report)}
|
|
319
|
+
</section>
|
|
320
|
+
|
|
321
|
+
<section>
|
|
322
|
+
<h2>Retour d'information et contact</h2>
|
|
323
|
+
<p>
|
|
324
|
+
Si vous n'arrivez pas à accéder à un contenu ou à un service, vous pouvez contacter le responsable de{' '}
|
|
325
|
+
<strong>${escapeJsxText(siteUrl)}</strong> pour être orienté vers une alternative accessible ou obtenir le contenu sous une autre forme.
|
|
326
|
+
</p>
|
|
327
|
+
<ul>
|
|
328
|
+
${contactLine(options.contactEmail?.trim() || undefined)}
|
|
329
|
+
{/* TODO: ajouter si besoin l'adresse postale ou le lien du formulaire de contact */}
|
|
330
|
+
</ul>
|
|
331
|
+
</section>
|
|
332
|
+
|
|
333
|
+
<section>
|
|
334
|
+
<h2>Voies de recours</h2>
|
|
335
|
+
<p>
|
|
336
|
+
Cette procédure est à utiliser dans le cas suivant : vous avez signalé au responsable du site internet un défaut
|
|
337
|
+
d'accessibilité qui vous empêche d'accéder à un contenu ou à un des services du portail et vous n'avez pas obtenu
|
|
338
|
+
de réponse satisfaisante.
|
|
339
|
+
</p>
|
|
340
|
+
<ul>
|
|
341
|
+
<li>
|
|
342
|
+
<a href="https://formulaire.defenseurdesdroits.fr/">Écrire un message au Défenseur des droits</a>
|
|
343
|
+
</li>
|
|
344
|
+
<li>
|
|
345
|
+
<a href="https://www.defenseurdesdroits.fr/saisir/delegues">Contacter le délégué du Défenseur des droits dans votre région</a>
|
|
346
|
+
</li>
|
|
347
|
+
<li>
|
|
348
|
+
Envoyer un courrier par la poste (gratuit, ne pas mettre de timbre) : Défenseur des droits, Libre réponse 71120, 75342 Paris CEDEX 07.
|
|
349
|
+
</li>
|
|
350
|
+
</ul>
|
|
351
|
+
</section>
|
|
352
|
+
</${wrapper}>
|
|
353
|
+
</>
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
`
|
|
357
|
+
|
|
358
|
+
if (options.write !== false) {
|
|
359
|
+
mkdirSync(dirname(dest), { recursive: true })
|
|
360
|
+
writeFileSync(dest, content)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return {
|
|
364
|
+
path: dest,
|
|
365
|
+
relativePath,
|
|
366
|
+
status,
|
|
367
|
+
content,
|
|
368
|
+
}
|
|
369
|
+
}
|