@templatical/quality 0.6.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 +56 -0
- package/README.md +81 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.js +644 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Templatical
|
|
4
|
+
|
|
5
|
+
## Terms and Conditions
|
|
6
|
+
|
|
7
|
+
### Licensor ("We")
|
|
8
|
+
|
|
9
|
+
Templatical
|
|
10
|
+
|
|
11
|
+
### The Software
|
|
12
|
+
|
|
13
|
+
Templatical Email Editor — the visual drag-and-drop email template editor
|
|
14
|
+
(@templatical/core, @templatical/editor, and @templatical/media-library
|
|
15
|
+
packages).
|
|
16
|
+
|
|
17
|
+
### Grant of Rights
|
|
18
|
+
|
|
19
|
+
Subject to the terms and conditions of this License, We hereby grant You a
|
|
20
|
+
non-exclusive, worldwide, non-transferable license to use, copy, modify,
|
|
21
|
+
create derivative works, and redistribute the Software, subject to the
|
|
22
|
+
following conditions:
|
|
23
|
+
|
|
24
|
+
### Permitted Uses
|
|
25
|
+
|
|
26
|
+
You may use the Software for any purpose, including commercial purposes,
|
|
27
|
+
**provided that** you do not offer the Software, or a substantially similar
|
|
28
|
+
product built using the Software, as a hosted or managed service that
|
|
29
|
+
competes with Templatical's commercial offerings.
|
|
30
|
+
|
|
31
|
+
### Change Date
|
|
32
|
+
|
|
33
|
+
Two (2) years from the date of each release of the Software.
|
|
34
|
+
|
|
35
|
+
### Change License
|
|
36
|
+
|
|
37
|
+
MIT License
|
|
38
|
+
|
|
39
|
+
On the Change Date, the above copyright notice and this permission notice
|
|
40
|
+
shall be replaced with the MIT License, and the Software will be available
|
|
41
|
+
under the MIT License for all purposes without restriction.
|
|
42
|
+
|
|
43
|
+
### Notices
|
|
44
|
+
|
|
45
|
+
You must retain this license notice in all copies or substantial portions
|
|
46
|
+
of the Software.
|
|
47
|
+
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
49
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
50
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
Note: The @templatical/types, @templatical/renderer, and
|
|
55
|
+
@templatical/import-beefree packages are licensed separately under the MIT
|
|
56
|
+
License. See LICENSE-MIT for those packages' terms.
|
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @templatical/quality
|
|
2
|
+
|
|
3
|
+
> Accessibility linter for Templatical email templates. Runs in the browser or on Node.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@templatical/quality)
|
|
6
|
+
[](https://github.com/templatical/sdk/blob/main/LICENSE-MIT)
|
|
7
|
+
|
|
8
|
+
Deterministic accessibility checks against the JSON `TemplateContent` block tree — missing alt text, low-contrast text and buttons, vague link / CTA copy, heading-skip, undersized touch targets, and more. Same package validates inside the editor (live sidebar tab + canvas badges) and in headless / CI checks.
|
|
9
|
+
|
|
10
|
+
MIT-licensed, JSON-only, no Vue, no DOM. Optional peer of `@templatical/editor`.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @templatical/quality
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Headless
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { lintAccessibility } from "@templatical/quality";
|
|
24
|
+
import type { TemplateContent } from "@templatical/types";
|
|
25
|
+
|
|
26
|
+
const content: TemplateContent = JSON.parse(stored);
|
|
27
|
+
const issues = lintAccessibility(content);
|
|
28
|
+
|
|
29
|
+
for (const issue of issues) {
|
|
30
|
+
console.log(`[${issue.severity}] ${issue.ruleId}: ${issue.message}`);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`lintAccessibility(content, options?)` is synchronous and pure — no DOM, no network, no fetch.
|
|
35
|
+
|
|
36
|
+
### Editor
|
|
37
|
+
|
|
38
|
+
`@templatical/editor` lazy-imports this package on demand. Pass `accessibility` to `init()` / `initCloud()`:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { init } from "@templatical/editor";
|
|
42
|
+
|
|
43
|
+
init({
|
|
44
|
+
container: "#editor",
|
|
45
|
+
locale: "en",
|
|
46
|
+
accessibility: {
|
|
47
|
+
rules: {
|
|
48
|
+
"img-missing-alt": "warning",
|
|
49
|
+
"text-all-caps": "off",
|
|
50
|
+
},
|
|
51
|
+
thresholds: { minFontSize: 16 },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The sidebar tab and inline canvas badges appear automatically once this peer is resolved.
|
|
57
|
+
|
|
58
|
+
### Custom rules
|
|
59
|
+
|
|
60
|
+
Compose your own walkers using the same primitives the package ships:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { walkBlocks, getContrastRatio } from "@templatical/quality";
|
|
64
|
+
|
|
65
|
+
walkBlocks(content, (block, ctx) => {
|
|
66
|
+
if (block.type === "title" && block.color) {
|
|
67
|
+
const ratio = getContrastRatio(block.color, ctx.resolvedBackgroundColor);
|
|
68
|
+
if (ratio < 4.5) {
|
|
69
|
+
console.warn(`Heading ${block.id} contrast ${ratio.toFixed(2)}:1`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Docs
|
|
76
|
+
|
|
77
|
+
- [Overview](https://docs.templatical.com/quality/accessibility/)
|
|
78
|
+
- [Rule catalog](https://docs.templatical.com/quality/accessibility/rule-catalog)
|
|
79
|
+
- [Options](https://docs.templatical.com/quality/accessibility/options)
|
|
80
|
+
- [Headless usage](https://docs.templatical.com/quality/accessibility/headless-usage)
|
|
81
|
+
- [Contributing locales](https://docs.templatical.com/quality/accessibility/contributing-locales)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Block } from '../../types/src/index.ts';
|
|
2
|
+
import { SectionBlock } from '../../types/src/index.ts';
|
|
3
|
+
import { TemplateContent } from '../../../types/src/index.ts';
|
|
4
|
+
import { TemplateContent as TemplateContent_2 } from '../../types/src/index.ts';
|
|
5
|
+
import { TemplateSettings } from '../../types/src/index.ts';
|
|
6
|
+
|
|
7
|
+
export declare interface A11yIssue {
|
|
8
|
+
/** Block id, or null for template-level issues. */
|
|
9
|
+
blockId: string | null;
|
|
10
|
+
ruleId: string;
|
|
11
|
+
severity: Exclude<Severity, "off">;
|
|
12
|
+
message: string;
|
|
13
|
+
fix?: A11yPatch;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface A11yOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Fully disable linting. When true, the editor skips lazy-loading the
|
|
19
|
+
* package, hides the sidebar tab, and suppresses inline badges.
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Locale for vague-text dictionaries and message text. Falls back to `en`. */
|
|
23
|
+
locale?: string;
|
|
24
|
+
/** Per-rule severity override. Set to `'off'` to disable a specific rule. */
|
|
25
|
+
rules?: Record<string, Severity>;
|
|
26
|
+
thresholds?: Partial<A11yThresholds>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare interface A11yPatch {
|
|
30
|
+
description: string;
|
|
31
|
+
apply: (ctx: A11yPatchContext) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare interface A11yPatchContext {
|
|
35
|
+
updateBlock: (blockId: string, patch: Partial<Block>) => void;
|
|
36
|
+
updateSettings: (patch: Partial<TemplateSettings>) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare interface A11yThresholds {
|
|
40
|
+
altMaxLength: number;
|
|
41
|
+
minFontSize: number;
|
|
42
|
+
allCapsMinLength: number;
|
|
43
|
+
minTouchTargetPx: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare interface AnchorInfo {
|
|
47
|
+
href: string;
|
|
48
|
+
text: string;
|
|
49
|
+
target: string | null;
|
|
50
|
+
rel: string | null;
|
|
51
|
+
/** True if the anchor wraps an image with non-empty alt. */
|
|
52
|
+
hasImageWithAlt: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare const DEFAULT_THRESHOLDS: A11yThresholds;
|
|
56
|
+
|
|
57
|
+
export declare type Dictionary = typeof en;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* English vague-text dictionaries. Treated as the source of truth — other
|
|
61
|
+
* locales annotate themselves `typeof en` so missing/extra phrases fail
|
|
62
|
+
* typecheck.
|
|
63
|
+
*
|
|
64
|
+
* Phrases are matched case-insensitively against trimmed text content.
|
|
65
|
+
*/
|
|
66
|
+
declare const en: {
|
|
67
|
+
vagueLinkText: string[];
|
|
68
|
+
vagueButtonLabels: string[];
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* English rule messages. The source of truth — other locales annotate
|
|
73
|
+
* themselves `typeof en` so missing or extra keys fail typecheck.
|
|
74
|
+
*
|
|
75
|
+
* Templates use `{name}` placeholders, interpolated by `formatMessage`.
|
|
76
|
+
*/
|
|
77
|
+
declare const en_2: {
|
|
78
|
+
"img-missing-alt": string;
|
|
79
|
+
"img-alt-is-filename": string;
|
|
80
|
+
"img-alt-too-long": string;
|
|
81
|
+
"img-decorative-needs-empty-alt": string;
|
|
82
|
+
"img-linked-no-context": string;
|
|
83
|
+
"heading-empty": string;
|
|
84
|
+
"heading-skip-level": string;
|
|
85
|
+
"heading-multiple-h1": string;
|
|
86
|
+
"link-empty": string;
|
|
87
|
+
"link-vague-text": string;
|
|
88
|
+
"link-href-empty": string;
|
|
89
|
+
"link-target-blank-no-rel": string;
|
|
90
|
+
"text-all-caps": string;
|
|
91
|
+
"text-low-contrast": string;
|
|
92
|
+
"text-too-small": string;
|
|
93
|
+
"button-vague-label": string;
|
|
94
|
+
"button-touch-target": string;
|
|
95
|
+
"button-low-contrast": string;
|
|
96
|
+
"missing-preheader": string;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Extract every anchor from a TipTap-style HTML fragment. Used by
|
|
101
|
+
* link-* rules. Doesn't try to be a full DOM — only the data the rules
|
|
102
|
+
* need.
|
|
103
|
+
*/
|
|
104
|
+
export declare function extractAnchors(html: string): AnchorInfo[];
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Strip tags and return the visible text content of an HTML fragment.
|
|
108
|
+
* Used by heading-empty and other text-presence rules.
|
|
109
|
+
*/
|
|
110
|
+
export declare function extractText(html: string): string;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Resolve a localized message for a rule. `params` interpolate `{name}`
|
|
114
|
+
* placeholders. Falls back to English when the locale doesn't ship the
|
|
115
|
+
* key (shouldn't happen — the parity test enforces it).
|
|
116
|
+
*/
|
|
117
|
+
export declare function formatMessage(locale: string, ruleId: RuleMessageId, params?: Record<string, string | number>): string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* WCAG 2.1 sRGB relative-luminance contrast.
|
|
121
|
+
*
|
|
122
|
+
* Inputs are hex strings (`#rgb`, `#rrggbb`, optional leading `#`).
|
|
123
|
+
* Returns the contrast ratio (1–21) per WCAG, or `NaN` if either input
|
|
124
|
+
* cannot be parsed as an opaque solid hex color.
|
|
125
|
+
*
|
|
126
|
+
* The codebase uses OKLch for design tokens, but contrast math is
|
|
127
|
+
* sRGB-defined; mixing the two gives incorrect results.
|
|
128
|
+
*/
|
|
129
|
+
export declare function getContrastRatio(fg: string, bg: string): number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Returns a dictionary that unions every registered locale. Vague phrases
|
|
133
|
+
* are universally vague — a German-locale email with an English "Click here"
|
|
134
|
+
* CTA, or an English email with a French "cliquez ici", is still a vague
|
|
135
|
+
* CTA, so the rule must detect across languages regardless of editor locale.
|
|
136
|
+
*
|
|
137
|
+
* The `locale` argument is accepted for API symmetry and future use (e.g.
|
|
138
|
+
* weighted matching) but currently doesn't change the returned set.
|
|
139
|
+
*/
|
|
140
|
+
export declare function getDictionary(_locale: string): Dictionary;
|
|
141
|
+
|
|
142
|
+
export declare function getMessages(locale: string): MessageMap;
|
|
143
|
+
|
|
144
|
+
export declare function isOpaqueHex(input: string | undefined | null): boolean;
|
|
145
|
+
|
|
146
|
+
export declare function lintAccessibility(content: TemplateContent, options?: A11yOptions): A11yIssue[];
|
|
147
|
+
|
|
148
|
+
export declare type MessageMap = typeof en_2;
|
|
149
|
+
|
|
150
|
+
export declare function parseHex(input: string | undefined | null): Rgb | null;
|
|
151
|
+
|
|
152
|
+
export declare interface ResolvedOptions {
|
|
153
|
+
locale: string;
|
|
154
|
+
rules: Record<string, Severity>;
|
|
155
|
+
thresholds: A11yThresholds;
|
|
156
|
+
/** Returns the effective severity for a rule (override or default). */
|
|
157
|
+
severity: (ruleId: string) => Severity;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare interface Rgb {
|
|
161
|
+
r: number;
|
|
162
|
+
g: number;
|
|
163
|
+
b: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export declare interface Rule {
|
|
167
|
+
meta: RuleMeta;
|
|
168
|
+
/** Block-level rule. Returns a hit or null. */
|
|
169
|
+
block?: (block: Block, ctx: WalkContext, opts: ResolvedOptions) => RuleHit | null;
|
|
170
|
+
/** Template-level rule. Runs once after the walk. */
|
|
171
|
+
template?: (content: TemplateContent_2, opts: ResolvedOptions) => RuleHit[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* What a rule emits per match. The orchestrator combines this with the
|
|
176
|
+
* rule's `meta` (for `ruleId` + default severity) and resolves the
|
|
177
|
+
* localized message via the active locale's message map.
|
|
178
|
+
*/
|
|
179
|
+
export declare interface RuleHit {
|
|
180
|
+
blockId: string | null;
|
|
181
|
+
/** Interpolation values for the rule's localized message template. */
|
|
182
|
+
params?: Record<string, string | number>;
|
|
183
|
+
fix?: A11yPatch;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export declare type RuleMessageId = keyof MessageMap;
|
|
187
|
+
|
|
188
|
+
export declare interface RuleMeta {
|
|
189
|
+
/** Stable identifier — used for severity overrides and message lookup. */
|
|
190
|
+
id: string;
|
|
191
|
+
/** Default severity when no override is supplied. */
|
|
192
|
+
severity: Exclude<Severity, "off">;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare const RULES: Rule[];
|
|
196
|
+
|
|
197
|
+
export declare type Severity = "error" | "warning" | "info" | "off";
|
|
198
|
+
|
|
199
|
+
export declare const SUPPORTED_DICTIONARY_LOCALES: string[];
|
|
200
|
+
|
|
201
|
+
export declare const SUPPORTED_MESSAGE_LOCALES: string[];
|
|
202
|
+
|
|
203
|
+
export declare type Visitor = (block: Block, ctx: WalkContext) => void;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Pure traversal of the block tree. Calls `visit` once per block in
|
|
207
|
+
* document order, providing a `WalkContext` that includes the resolved
|
|
208
|
+
* background color (nearest opaque ancestor) and structural refs.
|
|
209
|
+
*
|
|
210
|
+
* Sections cannot nest (renderer enforces this), so the walker doesn't
|
|
211
|
+
* descend into a section that lives inside a column. Custom blocks are
|
|
212
|
+
* visited but not descended into.
|
|
213
|
+
*/
|
|
214
|
+
export declare function walkBlocks(content: TemplateContent_2, visit: Visitor): void;
|
|
215
|
+
|
|
216
|
+
export declare interface WalkContext {
|
|
217
|
+
parent: Block | null;
|
|
218
|
+
section: SectionBlock | null;
|
|
219
|
+
columnIndex: number | null;
|
|
220
|
+
depth: number;
|
|
221
|
+
/**
|
|
222
|
+
* Nearest opaque ancestor background, or template settings background.
|
|
223
|
+
* Hex string, lowercased.
|
|
224
|
+
*/
|
|
225
|
+
resolvedBackgroundColor: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import { HEADING_LEVEL_FONT_SIZE as e, isButton as t, isImage as n, isMenu as r, isParagraph as i, isSection as a, isTable as o, isTitle as s } from "@templatical/types";
|
|
2
|
+
import { Parser as c } from "htmlparser2";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var l = Object.defineProperty, u = (e, t) => {
|
|
5
|
+
let n = {};
|
|
6
|
+
for (var r in e) l(n, r, {
|
|
7
|
+
get: e[r],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
return t || l(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, d = {
|
|
12
|
+
altMaxLength: 125,
|
|
13
|
+
minFontSize: 14,
|
|
14
|
+
allCapsMinLength: 20,
|
|
15
|
+
minTouchTargetPx: 44
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/contrast.ts
|
|
19
|
+
function f(e, t) {
|
|
20
|
+
let n = h(e), r = h(t);
|
|
21
|
+
if (!n || !r) return NaN;
|
|
22
|
+
let i = _(n), a = _(r), o = Math.max(i, a), s = Math.min(i, a);
|
|
23
|
+
return (o + .05) / (s + .05);
|
|
24
|
+
}
|
|
25
|
+
var p = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, m = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
|
|
26
|
+
function h(e) {
|
|
27
|
+
if (typeof e != "string") return null;
|
|
28
|
+
let t = e.trim(), n = m.exec(t);
|
|
29
|
+
if (n) return {
|
|
30
|
+
r: parseInt(n[1], 16),
|
|
31
|
+
g: parseInt(n[2], 16),
|
|
32
|
+
b: parseInt(n[3], 16)
|
|
33
|
+
};
|
|
34
|
+
let r = p.exec(t);
|
|
35
|
+
return r ? {
|
|
36
|
+
r: parseInt(r[1] + r[1], 16),
|
|
37
|
+
g: parseInt(r[2] + r[2], 16),
|
|
38
|
+
b: parseInt(r[3] + r[3], 16)
|
|
39
|
+
} : null;
|
|
40
|
+
}
|
|
41
|
+
function g(e) {
|
|
42
|
+
return h(e ?? "") !== null;
|
|
43
|
+
}
|
|
44
|
+
function _({ r: e, g: t, b: n }) {
|
|
45
|
+
let r = v(e / 255), i = v(t / 255), a = v(n / 255);
|
|
46
|
+
return .2126 * r + .7152 * i + .0722 * a;
|
|
47
|
+
}
|
|
48
|
+
function v(e) {
|
|
49
|
+
return e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/walk.ts
|
|
53
|
+
var y = "#ffffff";
|
|
54
|
+
function b(e, t) {
|
|
55
|
+
let n = g(e.settings.backgroundColor) ? e.settings.backgroundColor.toLowerCase() : y, r = (e, n) => {
|
|
56
|
+
if (t(e, n), !a(e)) return;
|
|
57
|
+
let i = e.styles?.backgroundColor, o = g(i) ? i.toLowerCase() : n.resolvedBackgroundColor;
|
|
58
|
+
e.children.forEach((t, i) => {
|
|
59
|
+
t.forEach((t) => r(t, {
|
|
60
|
+
parent: e,
|
|
61
|
+
section: e,
|
|
62
|
+
columnIndex: i,
|
|
63
|
+
depth: n.depth + 1,
|
|
64
|
+
resolvedBackgroundColor: o
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
for (let t of e.blocks) r(t, {
|
|
69
|
+
parent: null,
|
|
70
|
+
section: null,
|
|
71
|
+
columnIndex: null,
|
|
72
|
+
depth: 0,
|
|
73
|
+
resolvedBackgroundColor: n
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/accessibility/messages/de.ts
|
|
78
|
+
var x = /* @__PURE__ */ u({ default: () => S }), S = {
|
|
79
|
+
"img-missing-alt": "Bild ohne Alt-Text. Füge eine kurze Beschreibung hinzu oder markiere das Bild als dekorativ.",
|
|
80
|
+
"img-alt-is-filename": "Alt-Text sieht wie ein Dateiname aus (\"{alt}\"). Beschreibe stattdessen kurz, was das Bild zeigt.",
|
|
81
|
+
"img-alt-too-long": "Alt-Text ist {length} Zeichen lang; bleibe unter {max}.",
|
|
82
|
+
"img-decorative-needs-empty-alt": "Dekoratives Bild hat Alt-Text. Entferne den Alt-Text oder hebe die Markierung als dekorativ auf.",
|
|
83
|
+
"img-linked-no-context": "Verlinktes Bild beschreibt nur das Motiv, nicht das Linkziel. Nenne das Ziel (z. B. „Frühlingssale ansehen“).",
|
|
84
|
+
"heading-empty": "Überschrift ist leer. Füge Text hinzu oder entferne den Block.",
|
|
85
|
+
"heading-skip-level": "Überschrift springt von H{from} auf H{to}. Eine Ebene pro Schritt.",
|
|
86
|
+
"heading-multiple-h1": "E-Mail enthält mehr als eine H1. Verwende H1 nur einmal für die Hauptüberschrift.",
|
|
87
|
+
"link-empty": "Ein Link in diesem Block hat keinen Text und kein beschriebenes Bild.",
|
|
88
|
+
"link-vague-text": "Link-Text „{text}“ ist unspezifisch. Beschreibe stattdessen das Ziel.",
|
|
89
|
+
"link-href-empty": "Ein Link in diesem Block hat ein leeres oder „#“-href.",
|
|
90
|
+
"link-target-blank-no-rel": "Link öffnet in neuem Tab, aber rel=\"noopener\" fehlt – ergänze es, damit das Ziel nicht auf window.opener zugreifen kann.",
|
|
91
|
+
"text-all-caps": "Längere Texte in Großbuchstaben sind schwerer lesbar. Verwende Groß- und Kleinschreibung.",
|
|
92
|
+
"text-low-contrast": "Überschriftskontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.",
|
|
93
|
+
"text-too-small": "Text ist {size}px; mindestens {min}px verwenden.",
|
|
94
|
+
"button-vague-label": "Button-Beschriftung „{text}“ ist unspezifisch. Beschreibe die Aktion.",
|
|
95
|
+
"button-touch-target": "Button ist etwa {height}px hoch; mindestens {min}px verwenden, um Fehltipper auf Mobilgeräten zu vermeiden.",
|
|
96
|
+
"button-low-contrast": "Buttontextkontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.",
|
|
97
|
+
"missing-preheader": "Kein Preheader-Text gesetzt. Postfächer zeigen sonst Bruchstücke des ersten Blocks an."
|
|
98
|
+
}, C = /* @__PURE__ */ u({ default: () => w }), w = {
|
|
99
|
+
"img-missing-alt": "Image is missing alt text. Add a short description, or mark the image as decorative.",
|
|
100
|
+
"img-alt-is-filename": "Alt text looks like a filename (\"{alt}\"). Replace with a short description of what the image conveys.",
|
|
101
|
+
"img-alt-too-long": "Alt text is {length} characters; aim for under {max}.",
|
|
102
|
+
"img-decorative-needs-empty-alt": "Decorative image has alt text. Either clear the alt text or unmark the image as decorative.",
|
|
103
|
+
"img-linked-no-context": "Linked image alt describes the image but not the link destination. Include where the link goes (e.g. 'Buy spring sale').",
|
|
104
|
+
"heading-empty": "Heading is empty. Add text or remove the block.",
|
|
105
|
+
"heading-skip-level": "Heading jumps from H{from} to H{to}. Step one level at a time.",
|
|
106
|
+
"heading-multiple-h1": "Email has more than one H1. Use H1 once for the main heading.",
|
|
107
|
+
"link-empty": "A link in this block has no text and no described image.",
|
|
108
|
+
"link-vague-text": "Link text \"{text}\" is vague. Describe the destination instead.",
|
|
109
|
+
"link-href-empty": "A link in this block has an empty or '#' href.",
|
|
110
|
+
"link-target-blank-no-rel": "Link opens in a new tab but is missing rel=\"noopener\" — add it to prevent the destination from accessing window.opener.",
|
|
111
|
+
"text-all-caps": "Long all-caps text is harder to read for everyone. Use sentence case.",
|
|
112
|
+
"text-low-contrast": "Heading contrast is {ratio}:1; WCAG AA requires at least {required}:1.",
|
|
113
|
+
"text-too-small": "Text is {size}px; aim for at least {min}px.",
|
|
114
|
+
"button-vague-label": "Button label \"{text}\" is vague. Describe the action.",
|
|
115
|
+
"button-touch-target": "Button is roughly {height}px tall; aim for at least {min}px to avoid mis-taps on mobile.",
|
|
116
|
+
"button-low-contrast": "Button text contrast is {ratio}:1; WCAG AA requires at least {required}:1.",
|
|
117
|
+
"missing-preheader": "No preheader text set. Inboxes will fall back to fragments of the first block."
|
|
118
|
+
}, T = /* @__PURE__ */ Object.assign({
|
|
119
|
+
"./de.ts": x,
|
|
120
|
+
"./en.ts": C
|
|
121
|
+
}), E = {};
|
|
122
|
+
for (let e in T) {
|
|
123
|
+
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
124
|
+
if (!t) continue;
|
|
125
|
+
let n = t[1];
|
|
126
|
+
n !== "index" && (E[n] = T[e].default);
|
|
127
|
+
}
|
|
128
|
+
var D = Object.keys(E);
|
|
129
|
+
function O(e) {
|
|
130
|
+
return E[e.split("-")[0]?.toLowerCase() ?? "en"] ?? E.en ?? w;
|
|
131
|
+
}
|
|
132
|
+
function k(e, t, n) {
|
|
133
|
+
let r = O(e)[t] ?? w[t];
|
|
134
|
+
return n ? r.replace(/\{(\w+)\}/g, (e, t) => {
|
|
135
|
+
let r = n[t];
|
|
136
|
+
return r === void 0 ? `{${t}}` : String(r);
|
|
137
|
+
}) : r;
|
|
138
|
+
}
|
|
139
|
+
var ee = {
|
|
140
|
+
meta: {
|
|
141
|
+
id: "img-missing-alt",
|
|
142
|
+
severity: "error"
|
|
143
|
+
},
|
|
144
|
+
block(e) {
|
|
145
|
+
return !n(e) || e.decorative === !0 || (e.alt?.trim() ?? "") !== "" || (e.src ?? "").trim() === "" ? null : { blockId: e.id };
|
|
146
|
+
}
|
|
147
|
+
}, te = {
|
|
148
|
+
id: "img-alt-is-filename",
|
|
149
|
+
severity: "warning"
|
|
150
|
+
}, ne = [
|
|
151
|
+
/\.(jpe?g|png|gif|webp|svg)$/i,
|
|
152
|
+
/^IMG[_-]?\d+/i,
|
|
153
|
+
/^Untitled/i,
|
|
154
|
+
/^Screen[\s_-]?Shot/i,
|
|
155
|
+
/^DSC\d+/i
|
|
156
|
+
], A = {
|
|
157
|
+
meta: te,
|
|
158
|
+
block(e) {
|
|
159
|
+
if (!n(e) || e.decorative === !0) return null;
|
|
160
|
+
let t = e.alt?.trim() ?? "";
|
|
161
|
+
return t === "" || !ne.some((e) => e.test(t)) ? null : {
|
|
162
|
+
blockId: e.id,
|
|
163
|
+
params: { alt: t },
|
|
164
|
+
fix: {
|
|
165
|
+
description: "Clear alt text",
|
|
166
|
+
apply: (t) => t.updateBlock(e.id, { alt: "" })
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}, j = {
|
|
171
|
+
meta: {
|
|
172
|
+
id: "img-alt-too-long",
|
|
173
|
+
severity: "warning"
|
|
174
|
+
},
|
|
175
|
+
block(e, t, r) {
|
|
176
|
+
if (!n(e) || e.decorative === !0) return null;
|
|
177
|
+
let i = e.alt ?? "";
|
|
178
|
+
return i.length <= r.thresholds.altMaxLength ? null : {
|
|
179
|
+
blockId: e.id,
|
|
180
|
+
params: {
|
|
181
|
+
length: i.length,
|
|
182
|
+
max: r.thresholds.altMaxLength
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}, M = {
|
|
187
|
+
meta: {
|
|
188
|
+
id: "img-decorative-needs-empty-alt",
|
|
189
|
+
severity: "info"
|
|
190
|
+
},
|
|
191
|
+
block(e) {
|
|
192
|
+
return !n(e) || e.decorative !== !0 || (e.alt ?? "") === "" ? null : {
|
|
193
|
+
blockId: e.id,
|
|
194
|
+
fix: {
|
|
195
|
+
description: "Clear alt text",
|
|
196
|
+
apply: (t) => t.updateBlock(e.id, { alt: "" })
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}, N = {
|
|
201
|
+
id: "img-linked-no-context",
|
|
202
|
+
severity: "warning"
|
|
203
|
+
}, P = [
|
|
204
|
+
"buy",
|
|
205
|
+
"shop",
|
|
206
|
+
"view",
|
|
207
|
+
"read",
|
|
208
|
+
"learn",
|
|
209
|
+
"open",
|
|
210
|
+
"go",
|
|
211
|
+
"see",
|
|
212
|
+
"explore",
|
|
213
|
+
"discover",
|
|
214
|
+
"browse",
|
|
215
|
+
"download",
|
|
216
|
+
"get",
|
|
217
|
+
"claim",
|
|
218
|
+
"redeem",
|
|
219
|
+
"watch"
|
|
220
|
+
], F = {
|
|
221
|
+
meta: N,
|
|
222
|
+
block(e) {
|
|
223
|
+
if (!n(e) || e.decorative === !0 || !e.linkUrl || e.linkUrl.trim() === "") return null;
|
|
224
|
+
let t = (e.alt ?? "").trim();
|
|
225
|
+
if (t === "") return null;
|
|
226
|
+
let r = t.toLowerCase();
|
|
227
|
+
return P.some((e) => r.includes(e)) ? null : { blockId: e.id };
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/html-utils.ts
|
|
232
|
+
function I(e) {
|
|
233
|
+
let t = [], n = [], r = "", i = new c({
|
|
234
|
+
onopentag(e, t) {
|
|
235
|
+
if (e === "a") {
|
|
236
|
+
let e = {
|
|
237
|
+
href: t.href ?? "",
|
|
238
|
+
text: "",
|
|
239
|
+
target: t.target ?? null,
|
|
240
|
+
rel: t.rel ?? null,
|
|
241
|
+
hasImageWithAlt: !1
|
|
242
|
+
};
|
|
243
|
+
n.push(e), r = "";
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
e === "img" && n.length > 0 && (t.alt ?? "").trim() !== "" && (n[n.length - 1].hasImageWithAlt = !0);
|
|
247
|
+
},
|
|
248
|
+
ontext(e) {
|
|
249
|
+
n.length > 0 && (r += e);
|
|
250
|
+
},
|
|
251
|
+
onclosetag(e) {
|
|
252
|
+
if (e === "a" && n.length > 0) {
|
|
253
|
+
let e = n.pop();
|
|
254
|
+
e.text = r.trim(), t.push(e), r = "";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
return i.write(e), i.end(), t;
|
|
259
|
+
}
|
|
260
|
+
function L(e) {
|
|
261
|
+
let t = "", n = new c({ ontext(e) {
|
|
262
|
+
t += e;
|
|
263
|
+
} });
|
|
264
|
+
return n.write(e), n.end(), t.trim();
|
|
265
|
+
}
|
|
266
|
+
var R = {
|
|
267
|
+
meta: {
|
|
268
|
+
id: "heading-empty",
|
|
269
|
+
severity: "error"
|
|
270
|
+
},
|
|
271
|
+
block(e) {
|
|
272
|
+
return !s(e) || L(e.content ?? "") !== "" ? null : { blockId: e.id };
|
|
273
|
+
}
|
|
274
|
+
}, z = {
|
|
275
|
+
id: "heading-skip-level",
|
|
276
|
+
severity: "error"
|
|
277
|
+
};
|
|
278
|
+
function B(e, t) {
|
|
279
|
+
for (let n of e) {
|
|
280
|
+
if (s(n)) {
|
|
281
|
+
t.push(n);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (a(n)) for (let e of n.children) B(e, t);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
var V = {
|
|
288
|
+
meta: z,
|
|
289
|
+
template(e) {
|
|
290
|
+
let t = [];
|
|
291
|
+
B(e.blocks, t);
|
|
292
|
+
let n = [], r = 0;
|
|
293
|
+
for (let e of t) r !== 0 && e.level > r + 1 && n.push({
|
|
294
|
+
blockId: e.id,
|
|
295
|
+
params: {
|
|
296
|
+
from: r,
|
|
297
|
+
to: e.level
|
|
298
|
+
}
|
|
299
|
+
}), r = e.level;
|
|
300
|
+
return n;
|
|
301
|
+
}
|
|
302
|
+
}, H = {
|
|
303
|
+
id: "heading-multiple-h1",
|
|
304
|
+
severity: "warning"
|
|
305
|
+
};
|
|
306
|
+
function U(e, t) {
|
|
307
|
+
for (let n of e) {
|
|
308
|
+
if (s(n)) {
|
|
309
|
+
t.push(n);
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (a(n)) for (let e of n.children) U(e, t);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
var W = {
|
|
316
|
+
meta: H,
|
|
317
|
+
template(e) {
|
|
318
|
+
let t = [];
|
|
319
|
+
U(e.blocks, t);
|
|
320
|
+
let n = t.filter((e) => e.level === 1);
|
|
321
|
+
return n.length <= 1 ? [] : n.slice(1).map((e) => ({ blockId: e.id }));
|
|
322
|
+
}
|
|
323
|
+
}, G = {
|
|
324
|
+
id: "link-empty",
|
|
325
|
+
severity: "error"
|
|
326
|
+
};
|
|
327
|
+
function K(e) {
|
|
328
|
+
return i(e) || s(e) ? e.content : null;
|
|
329
|
+
}
|
|
330
|
+
var q = {
|
|
331
|
+
meta: G,
|
|
332
|
+
block(e) {
|
|
333
|
+
let t = K(e);
|
|
334
|
+
return t === null || !I(t).find((e) => e.text === "" && !e.hasImageWithAlt) ? null : { blockId: e.id };
|
|
335
|
+
}
|
|
336
|
+
}, J = {
|
|
337
|
+
en: {
|
|
338
|
+
vagueLinkText: [
|
|
339
|
+
"click here",
|
|
340
|
+
"here",
|
|
341
|
+
"read more",
|
|
342
|
+
"more",
|
|
343
|
+
"learn more",
|
|
344
|
+
"see more",
|
|
345
|
+
"this",
|
|
346
|
+
"this link",
|
|
347
|
+
"link",
|
|
348
|
+
"click"
|
|
349
|
+
],
|
|
350
|
+
vagueButtonLabels: [
|
|
351
|
+
"click here",
|
|
352
|
+
"click",
|
|
353
|
+
"submit",
|
|
354
|
+
"go",
|
|
355
|
+
"ok",
|
|
356
|
+
"okay",
|
|
357
|
+
"yes",
|
|
358
|
+
"no"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
de: {
|
|
362
|
+
vagueLinkText: [
|
|
363
|
+
"hier klicken",
|
|
364
|
+
"hier",
|
|
365
|
+
"mehr lesen",
|
|
366
|
+
"mehr",
|
|
367
|
+
"weiter",
|
|
368
|
+
"weiterlesen",
|
|
369
|
+
"siehe mehr",
|
|
370
|
+
"dies",
|
|
371
|
+
"dieser link",
|
|
372
|
+
"link",
|
|
373
|
+
"klick"
|
|
374
|
+
],
|
|
375
|
+
vagueButtonLabels: [
|
|
376
|
+
"hier klicken",
|
|
377
|
+
"klicken",
|
|
378
|
+
"senden",
|
|
379
|
+
"los",
|
|
380
|
+
"ok",
|
|
381
|
+
"okay",
|
|
382
|
+
"ja",
|
|
383
|
+
"nein"
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
function Y(e) {
|
|
388
|
+
return Z;
|
|
389
|
+
}
|
|
390
|
+
function X(e) {
|
|
391
|
+
let t = /* @__PURE__ */ new Set();
|
|
392
|
+
for (let n of Object.values(J)) for (let r of e(n)) t.add(r);
|
|
393
|
+
return Array.from(t);
|
|
394
|
+
}
|
|
395
|
+
var Z = {
|
|
396
|
+
vagueLinkText: X((e) => e.vagueLinkText),
|
|
397
|
+
vagueButtonLabels: X((e) => e.vagueButtonLabels)
|
|
398
|
+
}, re = Object.keys(J), ie = {
|
|
399
|
+
id: "link-vague-text",
|
|
400
|
+
severity: "warning"
|
|
401
|
+
};
|
|
402
|
+
function ae(e) {
|
|
403
|
+
return i(e) || s(e) ? e.content : null;
|
|
404
|
+
}
|
|
405
|
+
var oe = {
|
|
406
|
+
meta: ie,
|
|
407
|
+
block(e, t, n) {
|
|
408
|
+
let r = ae(e);
|
|
409
|
+
if (r === null) return null;
|
|
410
|
+
let i = Y(n.locale).vagueLinkText, a = I(r).find((e) => {
|
|
411
|
+
let t = e.text.toLowerCase().replace(/\s+/g, " ").trim();
|
|
412
|
+
return t !== "" && i.includes(t);
|
|
413
|
+
});
|
|
414
|
+
return a ? {
|
|
415
|
+
blockId: e.id,
|
|
416
|
+
params: { text: a.text }
|
|
417
|
+
} : null;
|
|
418
|
+
}
|
|
419
|
+
}, se = {
|
|
420
|
+
id: "link-href-empty",
|
|
421
|
+
severity: "error"
|
|
422
|
+
};
|
|
423
|
+
function ce(e) {
|
|
424
|
+
return i(e) || s(e) ? e.content : null;
|
|
425
|
+
}
|
|
426
|
+
var le = {
|
|
427
|
+
meta: se,
|
|
428
|
+
block(e) {
|
|
429
|
+
let t = ce(e);
|
|
430
|
+
return t === null || !I(t).find((e) => {
|
|
431
|
+
let t = e.href.trim();
|
|
432
|
+
return t === "" || t === "#";
|
|
433
|
+
}) ? null : { blockId: e.id };
|
|
434
|
+
}
|
|
435
|
+
}, ue = {
|
|
436
|
+
id: "link-target-blank-no-rel",
|
|
437
|
+
severity: "warning"
|
|
438
|
+
};
|
|
439
|
+
function de(e) {
|
|
440
|
+
return i(e) || s(e) ? e.content : null;
|
|
441
|
+
}
|
|
442
|
+
function fe(e) {
|
|
443
|
+
if (e === null) return !1;
|
|
444
|
+
let t = e.toLowerCase().split(/\s+/);
|
|
445
|
+
return t.includes("noopener") || t.includes("noreferrer");
|
|
446
|
+
}
|
|
447
|
+
var pe = {
|
|
448
|
+
meta: ue,
|
|
449
|
+
block(e) {
|
|
450
|
+
let t = de(e);
|
|
451
|
+
return t === null || !I(t).find((e) => e.target === "_blank" && !fe(e.rel)) ? null : {
|
|
452
|
+
blockId: e.id,
|
|
453
|
+
fix: {
|
|
454
|
+
description: "Add rel=\"noopener\"",
|
|
455
|
+
apply: (t) => {
|
|
456
|
+
if (!i(e) && !s(e)) return;
|
|
457
|
+
let n = me(e.content ?? "");
|
|
458
|
+
t.updateBlock(e.id, { content: n });
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
function me(e) {
|
|
465
|
+
return e.replace(/<a\b([^>]*)>/gi, (e, t) => {
|
|
466
|
+
if (!/\btarget\s*=\s*["']_blank["']/i.test(t)) return e;
|
|
467
|
+
let n = /\brel\s*=\s*["']([^"']*)["']/i.exec(t);
|
|
468
|
+
if (n) {
|
|
469
|
+
let r = n[1].toLowerCase().split(/\s+/);
|
|
470
|
+
if (r.includes("noopener") || r.includes("noreferrer")) return e;
|
|
471
|
+
let i = `${n[1]} noopener`.trim();
|
|
472
|
+
return `<a${t.replace(n[0], `rel="${i}"`)}>`;
|
|
473
|
+
}
|
|
474
|
+
return `<a${t} rel="noopener">`;
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
var he = {
|
|
478
|
+
meta: {
|
|
479
|
+
id: "text-all-caps",
|
|
480
|
+
severity: "warning"
|
|
481
|
+
},
|
|
482
|
+
block(e, t, n) {
|
|
483
|
+
if (!i(e) && !s(e)) return null;
|
|
484
|
+
let r = L(e.content ?? "").replace(/[^A-Za-zÀ-ɏ]/g, "");
|
|
485
|
+
return r.length < n.thresholds.allCapsMinLength || r !== r.toUpperCase() ? null : { blockId: e.id };
|
|
486
|
+
}
|
|
487
|
+
}, ge = {
|
|
488
|
+
meta: {
|
|
489
|
+
id: "text-low-contrast",
|
|
490
|
+
severity: "error"
|
|
491
|
+
},
|
|
492
|
+
block(t, n) {
|
|
493
|
+
if (!s(t) || !g(t.color) || !g(n.resolvedBackgroundColor)) return null;
|
|
494
|
+
let r = e[t.level] >= 18 ? 3 : 4.5, i = f(t.color, n.resolvedBackgroundColor);
|
|
495
|
+
return Number.isNaN(i) || i >= r ? null : {
|
|
496
|
+
blockId: t.id,
|
|
497
|
+
params: {
|
|
498
|
+
ratio: i.toFixed(2),
|
|
499
|
+
required: r
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}, _e = {
|
|
504
|
+
id: "text-too-small",
|
|
505
|
+
severity: "warning"
|
|
506
|
+
};
|
|
507
|
+
function ve(e) {
|
|
508
|
+
return r(e) || o(e) ? e.fontSize : null;
|
|
509
|
+
}
|
|
510
|
+
var ye = {
|
|
511
|
+
meta: _e,
|
|
512
|
+
block(e, t, n) {
|
|
513
|
+
let r = ve(e);
|
|
514
|
+
return r === null || r >= n.thresholds.minFontSize ? null : {
|
|
515
|
+
blockId: e.id,
|
|
516
|
+
params: {
|
|
517
|
+
size: r,
|
|
518
|
+
min: n.thresholds.minFontSize
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
}, be = {
|
|
523
|
+
meta: {
|
|
524
|
+
id: "button-vague-label",
|
|
525
|
+
severity: "warning"
|
|
526
|
+
},
|
|
527
|
+
block(e, n, r) {
|
|
528
|
+
if (!t(e)) return null;
|
|
529
|
+
let i = (e.text ?? "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
530
|
+
return i === "" || !Y(r.locale).vagueButtonLabels.includes(i) ? null : {
|
|
531
|
+
blockId: e.id,
|
|
532
|
+
params: { text: e.text }
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
}, xe = {
|
|
536
|
+
meta: {
|
|
537
|
+
id: "button-touch-target",
|
|
538
|
+
severity: "warning"
|
|
539
|
+
},
|
|
540
|
+
block(e, n, r) {
|
|
541
|
+
if (!t(e)) return null;
|
|
542
|
+
let i = e.buttonPadding;
|
|
543
|
+
if (!i) return null;
|
|
544
|
+
let a = e.fontSize * 1.4 + i.top + i.bottom;
|
|
545
|
+
return a >= r.thresholds.minTouchTargetPx ? null : {
|
|
546
|
+
blockId: e.id,
|
|
547
|
+
params: {
|
|
548
|
+
height: Math.round(a),
|
|
549
|
+
min: r.thresholds.minTouchTargetPx
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
}, Se = {
|
|
554
|
+
id: "button-low-contrast",
|
|
555
|
+
severity: "error"
|
|
556
|
+
}, Q = 4.5, $ = [
|
|
557
|
+
ee,
|
|
558
|
+
A,
|
|
559
|
+
j,
|
|
560
|
+
M,
|
|
561
|
+
F,
|
|
562
|
+
R,
|
|
563
|
+
V,
|
|
564
|
+
W,
|
|
565
|
+
q,
|
|
566
|
+
oe,
|
|
567
|
+
le,
|
|
568
|
+
pe,
|
|
569
|
+
he,
|
|
570
|
+
ge,
|
|
571
|
+
ye,
|
|
572
|
+
be,
|
|
573
|
+
xe,
|
|
574
|
+
{
|
|
575
|
+
meta: Se,
|
|
576
|
+
block(e) {
|
|
577
|
+
if (!t(e)) return null;
|
|
578
|
+
let n = f(e.textColor, e.backgroundColor);
|
|
579
|
+
return Number.isNaN(n) || n >= Q ? null : {
|
|
580
|
+
blockId: e.id,
|
|
581
|
+
params: {
|
|
582
|
+
ratio: n.toFixed(2),
|
|
583
|
+
required: Q
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
meta: {
|
|
590
|
+
id: "missing-preheader",
|
|
591
|
+
severity: "info"
|
|
592
|
+
},
|
|
593
|
+
template(e) {
|
|
594
|
+
return (e.settings.preheaderText?.trim() ?? "") === "" ? [{ blockId: null }] : [];
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
];
|
|
598
|
+
function Ce(e, t = {}) {
|
|
599
|
+
if (t.disabled === !0) return [];
|
|
600
|
+
let n = we(t), r = [];
|
|
601
|
+
function i(e, t, r) {
|
|
602
|
+
return {
|
|
603
|
+
blockId: r.blockId,
|
|
604
|
+
ruleId: e,
|
|
605
|
+
severity: t,
|
|
606
|
+
message: k(n.locale, e, r.params),
|
|
607
|
+
fix: r.fix
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
b(e, (e, t) => {
|
|
611
|
+
for (let a of $) {
|
|
612
|
+
let o = n.severity(a.meta.id);
|
|
613
|
+
if (o === "off" || !a.block) continue;
|
|
614
|
+
let s = a.block(e, t, n);
|
|
615
|
+
s !== null && r.push(i(a.meta.id, o, s));
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
for (let t of $) {
|
|
619
|
+
let a = n.severity(t.meta.id);
|
|
620
|
+
if (a === "off" || !t.template) continue;
|
|
621
|
+
let o = t.template(e, n);
|
|
622
|
+
for (let e of o) r.push(i(t.meta.id, a, e));
|
|
623
|
+
}
|
|
624
|
+
return r;
|
|
625
|
+
}
|
|
626
|
+
function we(e) {
|
|
627
|
+
let t = e.rules ?? {}, n = {
|
|
628
|
+
...d,
|
|
629
|
+
...e.thresholds ?? {}
|
|
630
|
+
};
|
|
631
|
+
return {
|
|
632
|
+
locale: e.locale ?? "en",
|
|
633
|
+
rules: t,
|
|
634
|
+
thresholds: n,
|
|
635
|
+
severity: (e) => {
|
|
636
|
+
let n = t[e];
|
|
637
|
+
return n === void 0 ? $.find((t) => t.meta.id === e)?.meta.severity ?? "warning" : n;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
//#endregion
|
|
642
|
+
export { d as DEFAULT_THRESHOLDS, $ as RULES, re as SUPPORTED_DICTIONARY_LOCALES, D as SUPPORTED_MESSAGE_LOCALES, I as extractAnchors, L as extractText, k as formatMessage, f as getContrastRatio, Y as getDictionary, O as getMessages, g as isOpaqueHex, Ce as lintAccessibility, h as parseHex, b as walkBlocks };
|
|
643
|
+
|
|
644
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/types.ts","../src/contrast.ts","../src/walk.ts","../src/accessibility/messages/de.ts","../src/accessibility/messages/en.ts","../src/accessibility/messages/index.ts","../src/accessibility/rules/img-missing-alt.ts","../src/accessibility/rules/img-alt-is-filename.ts","../src/accessibility/rules/img-alt-too-long.ts","../src/accessibility/rules/img-decorative-needs-empty-alt.ts","../src/accessibility/rules/img-linked-no-context.ts","../src/html-utils.ts","../src/accessibility/rules/heading-empty.ts","../src/accessibility/rules/heading-skip-level.ts","../src/accessibility/rules/heading-multiple-h1.ts","../src/accessibility/rules/link-empty.ts","../src/accessibility/dictionaries/en.ts","../src/accessibility/dictionaries/de.ts","../src/accessibility/dictionaries/index.ts","../src/accessibility/rules/link-vague-text.ts","../src/accessibility/rules/link-href-empty.ts","../src/accessibility/rules/link-target-blank-no-rel.ts","../src/accessibility/rules/text-all-caps.ts","../src/accessibility/rules/text-low-contrast.ts","../src/accessibility/rules/text-too-small.ts","../src/accessibility/rules/button-vague-label.ts","../src/accessibility/rules/button-touch-target.ts","../src/accessibility/rules/button-low-contrast.ts","../src/accessibility/rules/missing-preheader.ts","../src/accessibility/index.ts"],"sourcesContent":["import type {\n Block,\n SectionBlock,\n TemplateContent,\n TemplateSettings,\n} from \"@templatical/types\";\n\nexport type Severity = \"error\" | \"warning\" | \"info\" | \"off\";\n\nexport interface A11yIssue {\n /** Block id, or null for template-level issues. */\n blockId: string | null;\n ruleId: string;\n severity: Exclude<Severity, \"off\">;\n message: string;\n fix?: A11yPatch;\n}\n\nexport interface A11yPatchContext {\n updateBlock: (blockId: string, patch: Partial<Block>) => void;\n updateSettings: (patch: Partial<TemplateSettings>) => void;\n}\n\nexport interface A11yPatch {\n description: string;\n apply: (ctx: A11yPatchContext) => void;\n}\n\nexport interface A11yThresholds {\n altMaxLength: number;\n minFontSize: number;\n allCapsMinLength: number;\n minTouchTargetPx: number;\n}\n\nexport interface A11yOptions {\n /**\n * Fully disable linting. When true, the editor skips lazy-loading the\n * package, hides the sidebar tab, and suppresses inline badges.\n */\n disabled?: boolean;\n /** Locale for vague-text dictionaries and message text. Falls back to `en`. */\n locale?: string;\n /** Per-rule severity override. Set to `'off'` to disable a specific rule. */\n rules?: Record<string, Severity>;\n thresholds?: Partial<A11yThresholds>;\n}\n\nexport interface ResolvedOptions {\n locale: string;\n rules: Record<string, Severity>;\n thresholds: A11yThresholds;\n /** Returns the effective severity for a rule (override or default). */\n severity: (ruleId: string) => Severity;\n}\n\nexport interface WalkContext {\n parent: Block | null;\n section: SectionBlock | null;\n columnIndex: number | null;\n depth: number;\n /**\n * Nearest opaque ancestor background, or template settings background.\n * Hex string, lowercased.\n */\n resolvedBackgroundColor: string;\n}\n\nexport interface RuleMeta {\n /** Stable identifier — used for severity overrides and message lookup. */\n id: string;\n /** Default severity when no override is supplied. */\n severity: Exclude<Severity, \"off\">;\n}\n\n/**\n * What a rule emits per match. The orchestrator combines this with the\n * rule's `meta` (for `ruleId` + default severity) and resolves the\n * localized message via the active locale's message map.\n */\nexport interface RuleHit {\n blockId: string | null;\n /** Interpolation values for the rule's localized message template. */\n params?: Record<string, string | number>;\n fix?: A11yPatch;\n}\n\nexport interface Rule {\n meta: RuleMeta;\n /** Block-level rule. Returns a hit or null. */\n block?: (\n block: Block,\n ctx: WalkContext,\n opts: ResolvedOptions,\n ) => RuleHit | null;\n /** Template-level rule. Runs once after the walk. */\n template?: (content: TemplateContent, opts: ResolvedOptions) => RuleHit[];\n}\n\nexport const DEFAULT_THRESHOLDS: A11yThresholds = {\n altMaxLength: 125,\n minFontSize: 14,\n allCapsMinLength: 20,\n minTouchTargetPx: 44,\n};\n","/**\n * WCAG 2.1 sRGB relative-luminance contrast.\n *\n * Inputs are hex strings (`#rgb`, `#rrggbb`, optional leading `#`).\n * Returns the contrast ratio (1–21) per WCAG, or `NaN` if either input\n * cannot be parsed as an opaque solid hex color.\n *\n * The codebase uses OKLch for design tokens, but contrast math is\n * sRGB-defined; mixing the two gives incorrect results.\n */\nexport function getContrastRatio(fg: string, bg: string): number {\n const fgRgb = parseHex(fg);\n const bgRgb = parseHex(bg);\n\n if (!fgRgb || !bgRgb) {\n return Number.NaN;\n }\n\n const l1 = relativeLuminance(fgRgb);\n const l2 = relativeLuminance(bgRgb);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\nexport interface Rgb {\n r: number;\n g: number;\n b: number;\n}\n\nconst HEX3 = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i;\nconst HEX6 = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;\n\nexport function parseHex(input: string | undefined | null): Rgb | null {\n if (typeof input !== \"string\") {\n return null;\n }\n\n const trimmed = input.trim();\n\n const match6 = HEX6.exec(trimmed);\n if (match6) {\n return {\n r: parseInt(match6[1], 16),\n g: parseInt(match6[2], 16),\n b: parseInt(match6[3], 16),\n };\n }\n\n const match3 = HEX3.exec(trimmed);\n if (match3) {\n return {\n r: parseInt(match3[1] + match3[1], 16),\n g: parseInt(match3[2] + match3[2], 16),\n b: parseInt(match3[3] + match3[3], 16),\n };\n }\n\n return null;\n}\n\nexport function isOpaqueHex(input: string | undefined | null): boolean {\n return parseHex(input ?? \"\") !== null;\n}\n\nfunction relativeLuminance({ r, g, b }: Rgb): number {\n const rs = channel(r / 255);\n const gs = channel(g / 255);\n const bs = channel(b / 255);\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\nfunction channel(c: number): number {\n return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n","import type { Block, TemplateContent } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { WalkContext } from \"./types\";\nimport { isOpaqueHex } from \"./contrast\";\n\nexport type Visitor = (block: Block, ctx: WalkContext) => void;\n\nconst DEFAULT_BG = \"#ffffff\";\n\n/**\n * Pure traversal of the block tree. Calls `visit` once per block in\n * document order, providing a `WalkContext` that includes the resolved\n * background color (nearest opaque ancestor) and structural refs.\n *\n * Sections cannot nest (renderer enforces this), so the walker doesn't\n * descend into a section that lives inside a column. Custom blocks are\n * visited but not descended into.\n */\nexport function walkBlocks(content: TemplateContent, visit: Visitor): void {\n const rootBg = isOpaqueHex(content.settings.backgroundColor)\n ? content.settings.backgroundColor.toLowerCase()\n : DEFAULT_BG;\n\n const walk = (block: Block, ctx: WalkContext): void => {\n visit(block, ctx);\n\n if (!isSection(block)) {\n return;\n }\n\n const sectionBg = block.styles?.backgroundColor;\n const childBg = isOpaqueHex(sectionBg)\n ? (sectionBg as string).toLowerCase()\n : ctx.resolvedBackgroundColor;\n\n block.children.forEach((column, columnIndex) => {\n column.forEach((child) =>\n walk(child, {\n parent: block,\n section: block,\n columnIndex,\n depth: ctx.depth + 1,\n resolvedBackgroundColor: childBg,\n }),\n );\n });\n };\n\n for (const block of content.blocks) {\n walk(block, {\n parent: null,\n section: null,\n columnIndex: null,\n depth: 0,\n resolvedBackgroundColor: rootBg,\n });\n }\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"img-missing-alt\":\n \"Bild ohne Alt-Text. Füge eine kurze Beschreibung hinzu oder markiere das Bild als dekorativ.\",\n \"img-alt-is-filename\":\n 'Alt-Text sieht wie ein Dateiname aus (\"{alt}\"). Beschreibe stattdessen kurz, was das Bild zeigt.',\n \"img-alt-too-long\": \"Alt-Text ist {length} Zeichen lang; bleibe unter {max}.\",\n \"img-decorative-needs-empty-alt\":\n \"Dekoratives Bild hat Alt-Text. Entferne den Alt-Text oder hebe die Markierung als dekorativ auf.\",\n \"img-linked-no-context\":\n \"Verlinktes Bild beschreibt nur das Motiv, nicht das Linkziel. Nenne das Ziel (z. B. „Frühlingssale ansehen“).\",\n \"heading-empty\":\n \"Überschrift ist leer. Füge Text hinzu oder entferne den Block.\",\n \"heading-skip-level\":\n \"Überschrift springt von H{from} auf H{to}. Eine Ebene pro Schritt.\",\n \"heading-multiple-h1\":\n \"E-Mail enthält mehr als eine H1. Verwende H1 nur einmal für die Hauptüberschrift.\",\n \"link-empty\":\n \"Ein Link in diesem Block hat keinen Text und kein beschriebenes Bild.\",\n \"link-vague-text\":\n \"Link-Text „{text}“ ist unspezifisch. Beschreibe stattdessen das Ziel.\",\n \"link-href-empty\": \"Ein Link in diesem Block hat ein leeres oder „#“-href.\",\n \"link-target-blank-no-rel\":\n 'Link öffnet in neuem Tab, aber rel=\"noopener\" fehlt – ergänze es, damit das Ziel nicht auf window.opener zugreifen kann.',\n \"text-all-caps\":\n \"Längere Texte in Großbuchstaben sind schwerer lesbar. Verwende Groß- und Kleinschreibung.\",\n \"text-low-contrast\":\n \"Überschriftskontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.\",\n \"text-too-small\": \"Text ist {size}px; mindestens {min}px verwenden.\",\n \"button-vague-label\":\n \"Button-Beschriftung „{text}“ ist unspezifisch. Beschreibe die Aktion.\",\n \"button-touch-target\":\n \"Button ist etwa {height}px hoch; mindestens {min}px verwenden, um Fehltipper auf Mobilgeräten zu vermeiden.\",\n \"button-low-contrast\":\n \"Buttontextkontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.\",\n \"missing-preheader\":\n \"Kein Preheader-Text gesetzt. Postfächer zeigen sonst Bruchstücke des ersten Blocks an.\",\n};\n\nexport default de;\n","/**\n * English rule messages. The source of truth — other locales annotate\n * themselves `typeof en` so missing or extra keys fail typecheck.\n *\n * Templates use `{name}` placeholders, interpolated by `formatMessage`.\n */\nconst en = {\n \"img-missing-alt\":\n \"Image is missing alt text. Add a short description, or mark the image as decorative.\",\n \"img-alt-is-filename\":\n 'Alt text looks like a filename (\"{alt}\"). Replace with a short description of what the image conveys.',\n \"img-alt-too-long\": \"Alt text is {length} characters; aim for under {max}.\",\n \"img-decorative-needs-empty-alt\":\n \"Decorative image has alt text. Either clear the alt text or unmark the image as decorative.\",\n \"img-linked-no-context\":\n \"Linked image alt describes the image but not the link destination. Include where the link goes (e.g. 'Buy spring sale').\",\n \"heading-empty\": \"Heading is empty. Add text or remove the block.\",\n \"heading-skip-level\":\n \"Heading jumps from H{from} to H{to}. Step one level at a time.\",\n \"heading-multiple-h1\":\n \"Email has more than one H1. Use H1 once for the main heading.\",\n \"link-empty\": \"A link in this block has no text and no described image.\",\n \"link-vague-text\":\n 'Link text \"{text}\" is vague. Describe the destination instead.',\n \"link-href-empty\": \"A link in this block has an empty or '#' href.\",\n \"link-target-blank-no-rel\":\n 'Link opens in a new tab but is missing rel=\"noopener\" — add it to prevent the destination from accessing window.opener.',\n \"text-all-caps\":\n \"Long all-caps text is harder to read for everyone. Use sentence case.\",\n \"text-low-contrast\":\n \"Heading contrast is {ratio}:1; WCAG AA requires at least {required}:1.\",\n \"text-too-small\": \"Text is {size}px; aim for at least {min}px.\",\n \"button-vague-label\": 'Button label \"{text}\" is vague. Describe the action.',\n \"button-touch-target\":\n \"Button is roughly {height}px tall; aim for at least {min}px to avoid mis-taps on mobile.\",\n \"button-low-contrast\":\n \"Button text contrast is {ratio}:1; WCAG AA requires at least {required}:1.\",\n \"missing-preheader\":\n \"No preheader text set. Inboxes will fall back to fragments of the first block.\",\n};\n\nexport default en;\n","import en from \"./en\";\n\nexport type MessageMap = typeof en;\nexport type RuleMessageId = keyof MessageMap;\n\n/**\n * Auto-discovered locale registry. Drop a `messages/<lang>.ts` file and\n * it's bundled automatically — same pattern as the editor's i18n.\n *\n * Eager glob: synchronous, all locales bundled into the package. Tiny\n * (a few hundred bytes per locale) so the cost is negligible compared\n * to the lazy-loading overhead.\n */\nconst modules = import.meta.glob<{ default: MessageMap }>(\"./*.ts\", {\n eager: true,\n});\n\nconst MESSAGES: Record<string, MessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getMessages(locale: string): MessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\n/**\n * Resolve a localized message for a rule. `params` interpolate `{name}`\n * placeholders. Falls back to English when the locale doesn't ship the\n * key (shouldn't happen — the parity test enforces it).\n */\nexport function formatMessage(\n locale: string,\n ruleId: RuleMessageId,\n params?: Record<string, string | number>,\n): string {\n const map = getMessages(locale);\n const template = map[ruleId] ?? en[ruleId];\n if (!params) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_, key: string) => {\n const value = params[key];\n return value === undefined ? `{${key}}` : String(value);\n });\n}\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"img-missing-alt\",\n severity: \"error\",\n};\n\nexport const imgMissingAlt: Rule = {\n meta,\n block(block) {\n if (!isImage(block)) return null;\n if (block.decorative === true) return null;\n const alt = block.alt?.trim() ?? \"\";\n if (alt !== \"\") return null;\n if ((block.src ?? \"\").trim() === \"\") return null;\n return { blockId: block.id };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"img-alt-is-filename\",\n severity: \"warning\",\n};\n\nconst FILENAME_PATTERNS: RegExp[] = [\n /\\.(jpe?g|png|gif|webp|svg)$/i,\n /^IMG[_-]?\\d+/i,\n /^Untitled/i,\n /^Screen[\\s_-]?Shot/i,\n /^DSC\\d+/i,\n];\n\nexport const imgAltIsFilename: Rule = {\n meta,\n block(block) {\n if (!isImage(block) || block.decorative === true) return null;\n const alt = block.alt?.trim() ?? \"\";\n if (alt === \"\") return null;\n if (!FILENAME_PATTERNS.some((re) => re.test(alt))) return null;\n\n return {\n blockId: block.id,\n params: { alt },\n fix: {\n description: \"Clear alt text\",\n apply: (ctx) => ctx.updateBlock(block.id, { alt: \"\" }),\n },\n };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"img-alt-too-long\",\n severity: \"warning\",\n};\n\nexport const imgAltTooLong: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isImage(block) || block.decorative === true) return null;\n const alt = block.alt ?? \"\";\n if (alt.length <= opts.thresholds.altMaxLength) return null;\n return {\n blockId: block.id,\n params: { length: alt.length, max: opts.thresholds.altMaxLength },\n };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"img-decorative-needs-empty-alt\",\n severity: \"info\",\n};\n\nexport const imgDecorativeNeedsEmptyAlt: Rule = {\n meta,\n block(block) {\n if (!isImage(block)) return null;\n if (block.decorative !== true) return null;\n if ((block.alt ?? \"\") === \"\") return null;\n return {\n blockId: block.id,\n fix: {\n description: \"Clear alt text\",\n apply: (ctx) => ctx.updateBlock(block.id, { alt: \"\" }),\n },\n };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"img-linked-no-context\",\n severity: \"warning\",\n};\n\nconst ACTION_HINTS = [\n \"buy\",\n \"shop\",\n \"view\",\n \"read\",\n \"learn\",\n \"open\",\n \"go\",\n \"see\",\n \"explore\",\n \"discover\",\n \"browse\",\n \"download\",\n \"get\",\n \"claim\",\n \"redeem\",\n \"watch\",\n];\n\nexport const imgLinkedNoContext: Rule = {\n meta,\n block(block) {\n if (!isImage(block) || block.decorative === true) return null;\n if (!block.linkUrl || block.linkUrl.trim() === \"\") return null;\n const alt = (block.alt ?? \"\").trim();\n if (alt === \"\") return null;\n const lower = alt.toLowerCase();\n if (ACTION_HINTS.some((hint) => lower.includes(hint))) return null;\n return { blockId: block.id };\n },\n};\n","import { Parser } from \"htmlparser2\";\n\nexport interface AnchorInfo {\n href: string;\n text: string;\n target: string | null;\n rel: string | null;\n /** True if the anchor wraps an image with non-empty alt. */\n hasImageWithAlt: boolean;\n}\n\n/**\n * Extract every anchor from a TipTap-style HTML fragment. Used by\n * link-* rules. Doesn't try to be a full DOM — only the data the rules\n * need.\n */\nexport function extractAnchors(html: string): AnchorInfo[] {\n const anchors: AnchorInfo[] = [];\n const stack: AnchorInfo[] = [];\n let textBuffer = \"\";\n\n const parser = new Parser({\n onopentag(name, attribs) {\n if (name === \"a\") {\n const anchor: AnchorInfo = {\n href: attribs.href ?? \"\",\n text: \"\",\n target: attribs.target ?? null,\n rel: attribs.rel ?? null,\n hasImageWithAlt: false,\n };\n stack.push(anchor);\n textBuffer = \"\";\n return;\n }\n\n if (name === \"img\" && stack.length > 0) {\n const alt = (attribs.alt ?? \"\").trim();\n if (alt !== \"\") {\n stack[stack.length - 1].hasImageWithAlt = true;\n }\n }\n },\n ontext(text) {\n if (stack.length > 0) {\n textBuffer += text;\n }\n },\n onclosetag(name) {\n if (name === \"a\" && stack.length > 0) {\n const anchor = stack.pop()!;\n anchor.text = textBuffer.trim();\n anchors.push(anchor);\n textBuffer = \"\";\n }\n },\n });\n\n parser.write(html);\n parser.end();\n\n return anchors;\n}\n\n/**\n * Strip tags and return the visible text content of an HTML fragment.\n * Used by heading-empty and other text-presence rules.\n */\nexport function extractText(html: string): string {\n let text = \"\";\n const parser = new Parser({\n ontext(chunk) {\n text += chunk;\n },\n });\n parser.write(html);\n parser.end();\n return text.trim();\n}\n","import { isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractText } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"heading-empty\",\n severity: \"error\",\n};\n\nexport const headingEmpty: Rule = {\n meta,\n block(block) {\n if (!isTitle(block)) return null;\n const text = extractText(block.content ?? \"\");\n if (text !== \"\") return null;\n return { blockId: block.id };\n },\n};\n","import { isTitle, isSection } from \"@templatical/types\";\nimport type { Block, TitleBlock, TemplateContent } from \"@templatical/types\";\nimport type { Rule, RuleHit, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"heading-skip-level\",\n severity: \"error\",\n};\n\nfunction collectTitles(blocks: Block[], out: TitleBlock[]): void {\n for (const block of blocks) {\n if (isTitle(block)) {\n out.push(block);\n continue;\n }\n if (isSection(block)) {\n for (const column of block.children) {\n collectTitles(column, out);\n }\n }\n }\n}\n\nexport const headingSkipLevel: Rule = {\n meta,\n template(content: TemplateContent) {\n const titles: TitleBlock[] = [];\n collectTitles(content.blocks, titles);\n\n const hits: RuleHit[] = [];\n let lastLevel = 0;\n\n for (const title of titles) {\n if (lastLevel !== 0 && title.level > lastLevel + 1) {\n hits.push({\n blockId: title.id,\n params: { from: lastLevel, to: title.level },\n });\n }\n lastLevel = title.level;\n }\n\n return hits;\n },\n};\n","import { isTitle, isSection } from \"@templatical/types\";\nimport type { Block, TitleBlock, TemplateContent } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"heading-multiple-h1\",\n severity: \"warning\",\n};\n\nfunction collectTitles(blocks: Block[], out: TitleBlock[]): void {\n for (const block of blocks) {\n if (isTitle(block)) {\n out.push(block);\n continue;\n }\n if (isSection(block)) {\n for (const column of block.children) {\n collectTitles(column, out);\n }\n }\n }\n}\n\nexport const headingMultipleH1: Rule = {\n meta,\n template(content: TemplateContent) {\n const titles: TitleBlock[] = [];\n collectTitles(content.blocks, titles);\n const h1s = titles.filter((t) => t.level === 1);\n if (h1s.length <= 1) return [];\n return h1s.slice(1).map((title) => ({ blockId: title.id }));\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"link-empty\",\n severity: \"error\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkEmpty: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n\n const anchors = extractAnchors(html);\n const offender = anchors.find(\n (anchor) => anchor.text === \"\" && !anchor.hasImageWithAlt,\n );\n if (!offender) return null;\n\n return { blockId: block.id };\n },\n};\n","/**\n * English vague-text dictionaries. Treated as the source of truth — other\n * locales annotate themselves `typeof en` so missing/extra phrases fail\n * typecheck.\n *\n * Phrases are matched case-insensitively against trimmed text content.\n */\nconst en = {\n vagueLinkText: [\n \"click here\",\n \"here\",\n \"read more\",\n \"more\",\n \"learn more\",\n \"see more\",\n \"this\",\n \"this link\",\n \"link\",\n \"click\",\n ],\n vagueButtonLabels: [\n \"click here\",\n \"click\",\n \"submit\",\n \"go\",\n \"ok\",\n \"okay\",\n \"yes\",\n \"no\",\n ],\n};\n\nexport default en;\n","import type en from \"./en\";\n\nconst de: typeof en = {\n vagueLinkText: [\n \"hier klicken\",\n \"hier\",\n \"mehr lesen\",\n \"mehr\",\n \"weiter\",\n \"weiterlesen\",\n \"siehe mehr\",\n \"dies\",\n \"dieser link\",\n \"link\",\n \"klick\",\n ],\n vagueButtonLabels: [\n \"hier klicken\",\n \"klicken\",\n \"senden\",\n \"los\",\n \"ok\",\n \"okay\",\n \"ja\",\n \"nein\",\n ],\n};\n\nexport default de;\n","import en from \"./en\";\nimport de from \"./de\";\n\nexport type Dictionary = typeof en;\n\nconst DICTIONARIES: Record<string, Dictionary> = {\n en,\n de,\n};\n\n/**\n * Returns a dictionary that unions every registered locale. Vague phrases\n * are universally vague — a German-locale email with an English \"Click here\"\n * CTA, or an English email with a French \"cliquez ici\", is still a vague\n * CTA, so the rule must detect across languages regardless of editor locale.\n *\n * The `locale` argument is accepted for API symmetry and future use (e.g.\n * weighted matching) but currently doesn't change the returned set.\n */\nexport function getDictionary(_locale: string): Dictionary {\n return UNIONED_DICTIONARY;\n}\n\nfunction unionAll(pick: (d: Dictionary) => readonly string[]): string[] {\n const set = new Set<string>();\n for (const dict of Object.values(DICTIONARIES)) {\n for (const phrase of pick(dict)) set.add(phrase);\n }\n return Array.from(set);\n}\n\nconst UNIONED_DICTIONARY: Dictionary = {\n vagueLinkText: unionAll((d) => d.vagueLinkText),\n vagueButtonLabels: unionAll((d) => d.vagueButtonLabels),\n};\n\nexport const SUPPORTED_DICTIONARY_LOCALES = Object.keys(DICTIONARIES);\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\nimport { getDictionary } from \"../dictionaries\";\n\nexport const meta: RuleMeta = {\n id: \"link-vague-text\",\n severity: \"warning\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkVagueText: Rule = {\n meta,\n block(block, _ctx, opts) {\n const html = getHtml(block);\n if (html === null) return null;\n\n const phrases = getDictionary(opts.locale).vagueLinkText;\n const anchors = extractAnchors(html);\n const offender = anchors.find((a) => {\n const text = a.text.toLowerCase().replace(/\\s+/g, \" \").trim();\n return text !== \"\" && phrases.includes(text);\n });\n if (!offender) return null;\n\n return { blockId: block.id, params: { text: offender.text } };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"link-href-empty\",\n severity: \"error\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkHrefEmpty: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n const anchors = extractAnchors(html);\n const offender = anchors.find((a) => {\n const href = a.href.trim();\n return href === \"\" || href === \"#\";\n });\n if (!offender) return null;\n return { blockId: block.id };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"link-target-blank-no-rel\",\n severity: \"warning\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nfunction hasSafeRel(rel: string | null): boolean {\n if (rel === null) return false;\n const tokens = rel.toLowerCase().split(/\\s+/);\n return tokens.includes(\"noopener\") || tokens.includes(\"noreferrer\");\n}\n\nexport const linkTargetBlankNoRel: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n const anchors = extractAnchors(html);\n const offender = anchors.find(\n (a) => a.target === \"_blank\" && !hasSafeRel(a.rel),\n );\n if (!offender) return null;\n\n return {\n blockId: block.id,\n fix: {\n description: 'Add rel=\"noopener\"',\n apply: (ctx) => {\n if (!isParagraph(block) && !isTitle(block)) return;\n const updated = addNoopenerToTargetBlank(block.content ?? \"\");\n ctx.updateBlock(block.id, { content: updated } as Partial<Block>);\n },\n },\n };\n },\n};\n\nfunction addNoopenerToTargetBlank(html: string): string {\n return html.replace(/<a\\b([^>]*)>/gi, (match, attrs: string) => {\n const hasTargetBlank = /\\btarget\\s*=\\s*[\"']_blank[\"']/i.test(attrs);\n if (!hasTargetBlank) return match;\n const relMatch = /\\brel\\s*=\\s*[\"']([^\"']*)[\"']/i.exec(attrs);\n if (relMatch) {\n const tokens = relMatch[1].toLowerCase().split(/\\s+/);\n if (tokens.includes(\"noopener\") || tokens.includes(\"noreferrer\")) {\n return match;\n }\n const newRel = `${relMatch[1]} noopener`.trim();\n const newAttrs = attrs.replace(relMatch[0], `rel=\"${newRel}\"`);\n return `<a${newAttrs}>`;\n }\n return `<a${attrs} rel=\"noopener\">`;\n });\n}\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractText } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"text-all-caps\",\n severity: \"warning\",\n};\n\nexport const textAllCaps: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isParagraph(block) && !isTitle(block)) return null;\n const text = extractText(block.content ?? \"\");\n const letters = text.replace(/[^A-Za-zÀ-ɏ]/g, \"\");\n if (letters.length < opts.thresholds.allCapsMinLength) return null;\n if (letters !== letters.toUpperCase()) return null;\n return { blockId: block.id };\n },\n};\n","import { isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getContrastRatio, isOpaqueHex } from \"../../contrast\";\nimport { HEADING_LEVEL_FONT_SIZE } from \"@templatical/types\";\n\nexport const meta: RuleMeta = {\n id: \"text-low-contrast\",\n severity: \"error\",\n};\n\nexport const textLowContrast: Rule = {\n meta,\n block(block, ctx) {\n if (!isTitle(block)) return null;\n if (\n !isOpaqueHex(block.color) ||\n !isOpaqueHex(ctx.resolvedBackgroundColor)\n ) {\n return null;\n }\n const fontSize = HEADING_LEVEL_FONT_SIZE[block.level];\n const required = fontSize >= 18 ? 3 : 4.5;\n const ratio = getContrastRatio(block.color, ctx.resolvedBackgroundColor);\n if (Number.isNaN(ratio) || ratio >= required) return null;\n return {\n blockId: block.id,\n params: { ratio: ratio.toFixed(2), required },\n };\n },\n};\n","import { isMenu, isTable } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"text-too-small\",\n severity: \"warning\",\n};\n\nfunction getFontSize(block: Block): number | null {\n if (isMenu(block) || isTable(block)) return block.fontSize;\n return null;\n}\n\nexport const textTooSmall: Rule = {\n meta,\n block(block, _ctx, opts) {\n const fontSize = getFontSize(block);\n if (fontSize === null) return null;\n if (fontSize >= opts.thresholds.minFontSize) return null;\n return {\n blockId: block.id,\n params: { size: fontSize, min: opts.thresholds.minFontSize },\n };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getDictionary } from \"../dictionaries\";\n\nexport const meta: RuleMeta = {\n id: \"button-vague-label\",\n severity: \"warning\",\n};\n\nexport const buttonVagueLabel: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isButton(block)) return null;\n const text = (block.text ?? \"\").toLowerCase().replace(/\\s+/g, \" \").trim();\n if (text === \"\") return null;\n const phrases = getDictionary(opts.locale).vagueButtonLabels;\n if (!phrases.includes(text)) return null;\n return { blockId: block.id, params: { text: block.text } };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"button-touch-target\",\n severity: \"warning\",\n};\n\nexport const buttonTouchTarget: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isButton(block)) return null;\n const padding = block.buttonPadding;\n if (!padding) return null;\n const estimatedHeight = block.fontSize * 1.4 + padding.top + padding.bottom;\n if (estimatedHeight >= opts.thresholds.minTouchTargetPx) return null;\n return {\n blockId: block.id,\n params: {\n height: Math.round(estimatedHeight),\n min: opts.thresholds.minTouchTargetPx,\n },\n };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getContrastRatio } from \"../../contrast\";\n\nexport const meta: RuleMeta = {\n id: \"button-low-contrast\",\n severity: \"error\",\n};\n\nconst MIN_RATIO = 4.5;\n\nexport const buttonLowContrast: Rule = {\n meta,\n block(block) {\n if (!isButton(block)) return null;\n const ratio = getContrastRatio(block.textColor, block.backgroundColor);\n if (Number.isNaN(ratio) || ratio >= MIN_RATIO) return null;\n return {\n blockId: block.id,\n params: { ratio: ratio.toFixed(2), required: MIN_RATIO },\n };\n },\n};\n","import type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"missing-preheader\",\n severity: \"info\",\n};\n\nexport const missingPreheader: Rule = {\n meta,\n template(content) {\n const text = content.settings.preheaderText?.trim() ?? \"\";\n if (text !== \"\") return [];\n return [{ blockId: null }];\n },\n};\n","import type { TemplateContent } from \"@templatical/types\";\nimport type {\n A11yIssue,\n A11yOptions,\n ResolvedOptions,\n Rule,\n RuleHit,\n Severity,\n} from \"../types\";\nimport { DEFAULT_THRESHOLDS } from \"../types\";\nimport { walkBlocks } from \"../walk\";\nimport { formatMessage, type RuleMessageId } from \"./messages\";\nimport { imgMissingAlt } from \"./rules/img-missing-alt\";\nimport { imgAltIsFilename } from \"./rules/img-alt-is-filename\";\nimport { imgAltTooLong } from \"./rules/img-alt-too-long\";\nimport { imgDecorativeNeedsEmptyAlt } from \"./rules/img-decorative-needs-empty-alt\";\nimport { imgLinkedNoContext } from \"./rules/img-linked-no-context\";\nimport { headingEmpty } from \"./rules/heading-empty\";\nimport { headingSkipLevel } from \"./rules/heading-skip-level\";\nimport { headingMultipleH1 } from \"./rules/heading-multiple-h1\";\nimport { linkEmpty } from \"./rules/link-empty\";\nimport { linkVagueText } from \"./rules/link-vague-text\";\nimport { linkHrefEmpty } from \"./rules/link-href-empty\";\nimport { linkTargetBlankNoRel } from \"./rules/link-target-blank-no-rel\";\nimport { textAllCaps } from \"./rules/text-all-caps\";\nimport { textLowContrast } from \"./rules/text-low-contrast\";\nimport { textTooSmall } from \"./rules/text-too-small\";\nimport { buttonVagueLabel } from \"./rules/button-vague-label\";\nimport { buttonTouchTarget } from \"./rules/button-touch-target\";\nimport { buttonLowContrast } from \"./rules/button-low-contrast\";\nimport { missingPreheader } from \"./rules/missing-preheader\";\n\nexport const RULES: Rule[] = [\n imgMissingAlt,\n imgAltIsFilename,\n imgAltTooLong,\n imgDecorativeNeedsEmptyAlt,\n imgLinkedNoContext,\n headingEmpty,\n headingSkipLevel,\n headingMultipleH1,\n linkEmpty,\n linkVagueText,\n linkHrefEmpty,\n linkTargetBlankNoRel,\n textAllCaps,\n textLowContrast,\n textTooSmall,\n buttonVagueLabel,\n buttonTouchTarget,\n buttonLowContrast,\n missingPreheader,\n];\n\nexport function lintAccessibility(\n content: TemplateContent,\n options: A11yOptions = {},\n): A11yIssue[] {\n if (options.disabled === true) {\n return [];\n }\n\n const opts = resolveOptions(options);\n const issues: A11yIssue[] = [];\n\n function buildIssue(\n ruleId: string,\n severity: Exclude<Severity, \"off\">,\n hit: RuleHit,\n ): A11yIssue {\n return {\n blockId: hit.blockId,\n ruleId,\n severity,\n message: formatMessage(opts.locale, ruleId as RuleMessageId, hit.params),\n fix: hit.fix,\n };\n }\n\n walkBlocks(content, (block, ctx) => {\n for (const rule of RULES) {\n const sev = opts.severity(rule.meta.id);\n if (sev === \"off\" || !rule.block) continue;\n const hit = rule.block(block, ctx, opts);\n if (hit !== null) {\n issues.push(buildIssue(rule.meta.id, sev, hit));\n }\n }\n });\n\n for (const rule of RULES) {\n const sev = opts.severity(rule.meta.id);\n if (sev === \"off\" || !rule.template) continue;\n const hits = rule.template(content, opts);\n for (const hit of hits) {\n issues.push(buildIssue(rule.meta.id, sev, hit));\n }\n }\n\n return issues;\n}\n\nexport function resolveOptions(options: A11yOptions): ResolvedOptions {\n const overrides = options.rules ?? {};\n const thresholds = { ...DEFAULT_THRESHOLDS, ...(options.thresholds ?? {}) };\n const locale = options.locale ?? \"en\";\n\n return {\n locale,\n rules: overrides,\n thresholds,\n severity: (ruleId: string): Severity => {\n const override = overrides[ruleId];\n if (override !== undefined) {\n return override;\n }\n const rule = RULES.find((r) => r.meta.id === ruleId);\n return rule?.meta.severity ?? \"warning\";\n },\n };\n}\n"],"mappings":";;;;;;;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AAE,GAAG;EAAoB,GAAI,EAAQ,cAAc,EAAE;EAAG;AAG3E,QAAO;EACL,QAHa,EAAQ,UAAU;EAI/B,OAAO;EACP;EACA,WAAW,MAA6B;GACtC,IAAM,IAAW,EAAU;AAK3B,UAJI,MAAa,KAAA,IAGJ,EAAM,MAAM,MAAM,EAAE,KAAK,OAAO,EACtC,EAAM,KAAK,YAAY,YAHrB;;EAKZ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@templatical/quality",
|
|
3
|
+
"description": "Accessibility linter for Templatical email templates",
|
|
4
|
+
"version": "0.6.0",
|
|
5
|
+
"bugs": "https://github.com/templatical/sdk/issues",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"htmlparser2": "^9.1.0",
|
|
8
|
+
"@templatical/types": "0.6.0"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"typescript": "^6.0.3",
|
|
12
|
+
"vite": "^8.0.10",
|
|
13
|
+
"vite-plugin-dts": "^4.5.4",
|
|
14
|
+
"vitest": "^4.1.5"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"homepage": "https://templatical.com",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"a11y",
|
|
28
|
+
"accessibility",
|
|
29
|
+
"email",
|
|
30
|
+
"linter",
|
|
31
|
+
"templatical",
|
|
32
|
+
"wcag"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"module": "./dist/index.js",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/templatical/sdk.git",
|
|
42
|
+
"directory": "packages/quality"
|
|
43
|
+
},
|
|
44
|
+
"type": "module",
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "vite build",
|
|
48
|
+
"test": "vitest run --config vitest.config.ts",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
}
|
|
51
|
+
}
|