@mdn/fred 2.6.2 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/components/content-section/server.css +12 -0
- package/l10n/fluent.js +35 -5
- package/l10n/locales/de.ftl +17 -17
- package/l10n/locales/en-US.ftl +15 -15
- package/l10n/locales/fr.ftl +17 -17
- package/l10n/locales/zh-CN.ftl +17 -17
- package/l10n/template.ftl +17 -17
- package/out/service-worker.js +1 -1
- package/out/static/client/{1550.c301ea407e875fce.js → 1550.28c1604f8ddeb85d.js} +19 -19
- package/out/static/client/1550.28c1604f8ddeb85d.js.map +1 -0
- package/out/static/client/{6333.530138f4b30df5a7.js → 6333.d2c9af5b65988046.js} +18 -18
- package/out/static/client/6333.d2c9af5b65988046.js.map +1 -0
- package/out/static/client/{9456.a17794342ff9086a.js → 9456.c664136cffa5c45c.js} +18 -18
- package/out/static/client/9456.c664136cffa5c45c.js.map +1 -0
- package/out/static/client/{index.b844cbb014edfacd.js → index.8d9d3fc7007ac6c9.js} +24 -24
- package/out/static/client/index.8d9d3fc7007ac6c9.js.map +1 -0
- package/out/static/client/{runtime.3fa2ea9a7bb6b997.js → runtime.b626b01b6203a207.js} +2 -2
- package/out/static/client/{runtime.3fa2ea9a7bb6b997.js.map → runtime.b626b01b6203a207.js.map} +1 -1
- package/out/static/client/stats.json +90 -90
- package/out/static/client/{styles-content-section.13aa5a74b0e474ad.css → styles-content-section.64d82cff4db3bf61.css} +2 -2
- package/out/static/client/{styles-content-section.13aa5a74b0e474ad.css.map → styles-content-section.64d82cff4db3bf61.css.map} +1 -1
- package/out/static/client/{styles-global.fc33817861428c47.js → styles-global.bbe62c66bfdbcd4d.js} +1 -1
- package/out/static/client/styles-global.e9f66980fd6d9827.css +2 -0
- package/out/static/client/styles-global.e9f66980fd6d9827.css.map +1 -0
- package/out/static/legacy/asset-manifest.json +4 -4
- package/out/static/ssr/1550.js +18 -18
- package/out/static/ssr/1550.js.map +1 -1
- package/out/static/ssr/6333.js +17 -17
- package/out/static/ssr/6333.js.map +1 -1
- package/out/static/ssr/9456.js +17 -17
- package/out/static/ssr/9456.js.map +1 -1
- package/out/static/ssr/index.js +17 -17
- package/out/static/ssr/index.js.map +1 -1
- package/out/static/ssr/stats.json +4 -4
- package/package.json +10 -10
- package/scripts/tests.js +90 -113
- package/test/README.md +7 -9
- package/out/static/client/1550.c301ea407e875fce.js.map +0 -1
- package/out/static/client/6333.530138f4b30df5a7.js.map +0 -1
- package/out/static/client/9456.a17794342ff9086a.js.map +0 -1
- package/out/static/client/index.b844cbb014edfacd.js.map +0 -1
- package/out/static/client/styles-global.60e972055623450a.css +0 -2
- package/out/static/client/styles-global.60e972055623450a.css.map +0 -1
- /package/out/static/client/{index.b844cbb014edfacd.js.LICENSE.txt → index.8d9d3fc7007ac6c9.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.6.4](https://github.com/mdn/fred/compare/v2.6.3...v2.6.4) (2026-05-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **l10n:** correct compat-support-flags rendering across locales ([#1562](https://github.com/mdn/fred/issues/1562)) ([2f5b04f](https://github.com/mdn/fred/commit/2f5b04fa8ea970c839102d211aa8efd06a585880))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Miscellaneous
|
|
12
|
+
|
|
13
|
+
* **deps:** bump @mdn/rari from 0.2.24 to 0.2.25 ([#1597](https://github.com/mdn/fred/issues/1597)) ([ed147d1](https://github.com/mdn/fred/commit/ed147d19d49fdb3e1d6b8b3e222a492f86844bcd))
|
|
14
|
+
|
|
15
|
+
## [2.6.3](https://github.com/mdn/fred/compare/v2.6.2...v2.6.3) (2026-05-21)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **content-section:** display index in multiple columns ([#1563](https://github.com/mdn/fred/issues/1563)) ([77cb0d0](https://github.com/mdn/fred/commit/77cb0d07f9b322e6e9d118932280193cfba5984e))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Miscellaneous
|
|
24
|
+
|
|
25
|
+
* **deps:** bump @mdn/rari from 0.2.23 to 0.2.24 ([#1594](https://github.com/mdn/fred/issues/1594)) ([f7a9855](https://github.com/mdn/fred/commit/f7a985549bfc357d6b565ca0f17488a4c954d951))
|
|
26
|
+
* **tests:** move from args to commands in cli ([#1590](https://github.com/mdn/fred/issues/1590)) ([f3afadc](https://github.com/mdn/fred/commit/f3afadc5f64d6f02e9cf923d70673adf545b6cc1))
|
|
27
|
+
|
|
3
28
|
## [2.6.2](https://github.com/mdn/fred/compare/v2.6.1...v2.6.2) (2026-05-15)
|
|
4
29
|
|
|
5
30
|
|
|
@@ -384,6 +384,18 @@
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/* Alphabetical/grouped indexes (rari `CSS_Ref`, `ListGroups`, `APIListAlpha`, `css_ref_list`) */
|
|
388
|
+
.index {
|
|
389
|
+
ul {
|
|
390
|
+
columns: 18rem;
|
|
391
|
+
column-gap: 2rem;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
li {
|
|
395
|
+
break-inside: avoid;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
387
399
|
/* Article footer */
|
|
388
400
|
&.article-footer {
|
|
389
401
|
margin: 2rem 0;
|
package/l10n/fluent.js
CHANGED
|
@@ -5,7 +5,8 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
|
5
5
|
import enUS_ftl from "./locales/en-US.ftl";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @import {
|
|
8
|
+
* @import { FluentVariable } from "@fluent/bundle"
|
|
9
|
+
* @import { AllowedTags } from "insane"
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
/** @type {Record<string, string>} */
|
|
@@ -56,7 +57,7 @@ export class Fluent {
|
|
|
56
57
|
/**
|
|
57
58
|
* @param {string} id
|
|
58
59
|
* @param {string} [attr]
|
|
59
|
-
* @param {Record<string,
|
|
60
|
+
* @param {Record<string, FluentVariable | undefined>} [args]
|
|
60
61
|
* @param {Record<string, import("../types/fluent.js").Element>} [elements]
|
|
61
62
|
* @returns {string | ReturnType<typeof unsafeHTML> | undefined}
|
|
62
63
|
*/
|
|
@@ -123,7 +124,7 @@ export class Fluent {
|
|
|
123
124
|
/**
|
|
124
125
|
* @param {string} id
|
|
125
126
|
* @param {string} [attr]
|
|
126
|
-
* @param {Record<string,
|
|
127
|
+
* @param {Record<string, FluentVariable | undefined>} [args]
|
|
127
128
|
* @param {FluentBundle | undefined} [bundle]
|
|
128
129
|
* @param {boolean} [us]
|
|
129
130
|
* @returns {string | undefined}
|
|
@@ -165,7 +166,7 @@ export class Fluent {
|
|
|
165
166
|
|
|
166
167
|
/** @type {Error[]} */
|
|
167
168
|
const errors = [];
|
|
168
|
-
const formatted = bundle?.formatPattern(message, args, errors);
|
|
169
|
+
const formatted = bundle?.formatPattern(message, escapeArgs(args), errors);
|
|
169
170
|
if (errors.length > 0) {
|
|
170
171
|
console.error(errors);
|
|
171
172
|
}
|
|
@@ -173,6 +174,35 @@ export class Fluent {
|
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
|
|
177
|
+
/**
|
|
178
|
+
* HTML-escape string-valued args so that variable substitution can't inject
|
|
179
|
+
* tags that confuse the downstream sanitizer. Only string values are touched
|
|
180
|
+
* so that Number/Date selectors keep working.
|
|
181
|
+
*
|
|
182
|
+
* @param {Record<string, FluentVariable | undefined>} args
|
|
183
|
+
* @returns {Record<string, FluentVariable>}
|
|
184
|
+
*/
|
|
185
|
+
function escapeArgs(args) {
|
|
186
|
+
/** @type {Record<string, FluentVariable>} */
|
|
187
|
+
const out = {};
|
|
188
|
+
for (const [k, v] of Object.entries(args)) {
|
|
189
|
+
if (v !== undefined) {
|
|
190
|
+
out[k] = typeof v === "string" ? escapeHtml(v) : v;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @param {string} s
|
|
198
|
+
*/
|
|
199
|
+
function escapeHtml(s) {
|
|
200
|
+
return s
|
|
201
|
+
.replaceAll("&", "&")
|
|
202
|
+
.replaceAll("<", "<")
|
|
203
|
+
.replaceAll(">", ">");
|
|
204
|
+
}
|
|
205
|
+
|
|
176
206
|
/** @type {Map<string, Fluent>} */
|
|
177
207
|
const fluent = new Map();
|
|
178
208
|
|
|
@@ -245,7 +275,7 @@ export default function getFluentContext(locale) {
|
|
|
245
275
|
}
|
|
246
276
|
|
|
247
277
|
/**
|
|
248
|
-
* @param {{ id: string, attr?: string, args?: Record<string,
|
|
278
|
+
* @param {{ id: string, attr?: string, args?: Record<string, FluentVariable | undefined>, elements?: Record<string, import("../types/fluent.js").Element> }} param0
|
|
249
279
|
*/
|
|
250
280
|
l10n.raw = function ({ id, attr, args, elements }) {
|
|
251
281
|
const fluent = getLocale(locale);
|
package/l10n/locales/de.ftl
CHANGED
|
@@ -58,19 +58,19 @@ compat-support-altname = Alternativer Name: { $altname }
|
|
|
58
58
|
compat-support-removed = Ab { $version } entfernt
|
|
59
59
|
compat-support-see-impl-url = Siehe <a data-l10n-name="impl_url">{ $label }</a>
|
|
60
60
|
compat-support-flags =
|
|
61
|
-
{
|
|
62
|
-
[
|
|
63
|
-
*[
|
|
61
|
+
{ $has_added ->
|
|
62
|
+
[1] Ab Version { $version_added }
|
|
63
|
+
*[0] { "" }
|
|
64
64
|
}{ $has_last ->
|
|
65
|
-
[
|
|
66
|
-
{
|
|
67
|
-
*[
|
|
68
|
-
[
|
|
65
|
+
[1]
|
|
66
|
+
{ $has_added ->
|
|
67
|
+
*[0] Bis { $versionLast } muss
|
|
68
|
+
[1] { " " }bis { $versionLast } muss
|
|
69
69
|
}
|
|
70
|
-
*[
|
|
71
|
-
{
|
|
72
|
-
*[
|
|
73
|
-
[
|
|
70
|
+
*[0]
|
|
71
|
+
{ $has_added ->
|
|
72
|
+
*[0] muss
|
|
73
|
+
[1] { " " }muss
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
{ " " }die Einstellung <code data-l10n-name="name">{ $flag_name }</code>{ " " }
|
|
@@ -78,17 +78,17 @@ compat-support-flags =
|
|
|
78
78
|
*[preference] explizit festgelegt werden
|
|
79
79
|
[runtime_flag] als Laufzeit-Flag explizit festgelegt werden
|
|
80
80
|
|
|
81
|
-
}{
|
|
82
|
-
[
|
|
83
|
-
*[
|
|
81
|
+
}{ $has_value ->
|
|
82
|
+
[1] { " " }auf <code data-l10n-name="value">{ $flag_value }</code>
|
|
83
|
+
*[0] { "" }
|
|
84
84
|
}{ "." }
|
|
85
|
-
{
|
|
86
|
-
[
|
|
85
|
+
{ $has_pref_url ->
|
|
86
|
+
[1]
|
|
87
87
|
{ $flag_type ->
|
|
88
88
|
[preference] Um die Einstellungen in { $browser_name } zu ändern, besuchen Sie { $browser_pref_url }.
|
|
89
89
|
*[other] { "" }
|
|
90
90
|
}
|
|
91
|
-
*[
|
|
91
|
+
*[0] { "" }
|
|
92
92
|
}
|
|
93
93
|
compat-legend-yes = { compat-support-full }
|
|
94
94
|
compat-legend-partial = { compat-support-partial }
|
package/l10n/locales/en-US.ftl
CHANGED
|
@@ -91,33 +91,33 @@ compat-support-altname = Alternate name: { $altname }
|
|
|
91
91
|
compat-support-removed = Removed in { $version } and later
|
|
92
92
|
compat-support-see-impl-url = See <a data-l10n-name="impl_url">{ $label }</a>
|
|
93
93
|
compat-support-flags =
|
|
94
|
-
{
|
|
95
|
-
[
|
|
96
|
-
*[
|
|
94
|
+
{ $has_added ->
|
|
95
|
+
[1] From version { $version_added }
|
|
96
|
+
*[0] {""}
|
|
97
97
|
}{ $has_last ->
|
|
98
|
-
[
|
|
99
|
-
*[
|
|
100
|
-
[
|
|
98
|
+
[1] { $has_added ->
|
|
99
|
+
*[0] Until { $versionLast } users
|
|
100
|
+
[1] {" "}until { $versionLast } users
|
|
101
101
|
}
|
|
102
|
-
*[
|
|
103
|
-
*[
|
|
104
|
-
[
|
|
102
|
+
*[0] { $has_added ->
|
|
103
|
+
*[0] Users
|
|
104
|
+
[1] {" "}users
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
{" "}must explicitly set the <code data-l10n-name="name">{ $flag_name }</code>{" "}
|
|
108
108
|
{ $flag_type ->
|
|
109
109
|
*[preference] preference
|
|
110
110
|
[runtime_flag] runtime flag
|
|
111
|
-
}{
|
|
112
|
-
[
|
|
113
|
-
*[
|
|
111
|
+
}{ $has_value ->
|
|
112
|
+
[1] {" "}to <code data-l10n-name="value">{ $flag_value }</code>
|
|
113
|
+
*[0] {""}
|
|
114
114
|
}{"."}
|
|
115
|
-
{
|
|
116
|
-
[
|
|
115
|
+
{ $has_pref_url ->
|
|
116
|
+
[1] { $flag_type ->
|
|
117
117
|
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
|
|
118
118
|
*[other] {""}
|
|
119
119
|
}
|
|
120
|
-
*[
|
|
120
|
+
*[0] {""}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
compat-legend = Legend
|
package/l10n/locales/fr.ftl
CHANGED
|
@@ -52,19 +52,19 @@ compat-support-altname = Nom alternatif : { $altname }
|
|
|
52
52
|
compat-support-removed = Supprimé en version { $version } et supérieure
|
|
53
53
|
compat-support-see-impl-url = Voir <a data-l10n-name="impl_url">{ $label }</a>
|
|
54
54
|
compat-support-flags =
|
|
55
|
-
{
|
|
56
|
-
[
|
|
57
|
-
*[
|
|
55
|
+
{ $has_added ->
|
|
56
|
+
[1] De la version { $version_added }
|
|
57
|
+
*[0] { "" }
|
|
58
58
|
}{ $has_last ->
|
|
59
|
-
[
|
|
60
|
-
{
|
|
61
|
-
*[
|
|
62
|
-
[
|
|
59
|
+
[1]
|
|
60
|
+
{ $has_added ->
|
|
61
|
+
*[0] Jusqu'à la version { $versionLast }, les utilisateur·ice·s
|
|
62
|
+
[1] { " " }jusqu'à { $versionLast }, les utilisateur·ice·s
|
|
63
63
|
}
|
|
64
|
-
*[
|
|
65
|
-
{
|
|
66
|
-
*[
|
|
67
|
-
[
|
|
64
|
+
*[0]
|
|
65
|
+
{ $has_added ->
|
|
66
|
+
*[0] Les utilisateur·ice·s
|
|
67
|
+
[1] {" "}les utilisateur·ice·s
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
{ " " }doivent explicitement définir
|
|
@@ -73,17 +73,17 @@ compat-support-flags =
|
|
|
73
73
|
[runtime_flag] l'indicateur d'exécution
|
|
74
74
|
}
|
|
75
75
|
{ " " }<code data-l10n-name="name">{ $flag_name }</code>
|
|
76
|
-
{
|
|
77
|
-
[
|
|
78
|
-
*[
|
|
76
|
+
{ $has_value ->
|
|
77
|
+
[1] { " " }à <code data-l10n-name="value">{ $flag_value }</code>
|
|
78
|
+
*[0] { "" }
|
|
79
79
|
}{"."}
|
|
80
|
-
{
|
|
81
|
-
[
|
|
80
|
+
{ $has_pref_url ->
|
|
81
|
+
[1]
|
|
82
82
|
{ $flag_type ->
|
|
83
83
|
[preference] Pour changer vos préférences sur le navigateur { $browser_name }, visitez { $browser_pref_url }.
|
|
84
84
|
*[other] { "" }
|
|
85
85
|
}
|
|
86
|
-
*[
|
|
86
|
+
*[0] { "" }
|
|
87
87
|
}
|
|
88
88
|
compat-legend-yes = { compat-support-full }
|
|
89
89
|
compat-legend-partial = { compat-support-partial }
|
package/l10n/locales/zh-CN.ftl
CHANGED
|
@@ -52,36 +52,36 @@ compat-support-altname = 备用名称:{ $altname }
|
|
|
52
52
|
compat-support-removed = 已在 { $version } 及更高版本中移除
|
|
53
53
|
compat-support-see-impl-url = 参见 <a data-l10n-name="impl_url">{ $label }</a>
|
|
54
54
|
compat-support-flags =
|
|
55
|
-
{
|
|
56
|
-
[
|
|
57
|
-
*[
|
|
55
|
+
{ $has_added ->
|
|
56
|
+
[1] 自版本 { $version_added } 起
|
|
57
|
+
*[0] { "" }
|
|
58
58
|
}{ $has_last ->
|
|
59
|
-
[
|
|
60
|
-
{
|
|
61
|
-
*[
|
|
62
|
-
[
|
|
59
|
+
[1]
|
|
60
|
+
{ $has_added ->
|
|
61
|
+
*[0] 截至 { $versionLast },用户
|
|
62
|
+
[1] { " " }截至 { $versionLast },用户
|
|
63
63
|
}
|
|
64
|
-
*[
|
|
65
|
-
{
|
|
66
|
-
*[
|
|
67
|
-
[
|
|
64
|
+
*[0]
|
|
65
|
+
{ $has_added ->
|
|
66
|
+
*[0] 用户
|
|
67
|
+
[1] { " " }用户
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
{ " " }必须显式将 <code data-l10n-name="name">{ $flag_name }</code>{ " " }
|
|
71
71
|
{ $flag_type ->
|
|
72
72
|
*[preference] 首选项
|
|
73
73
|
[runtime_flag] 运行时标志
|
|
74
|
-
}{
|
|
75
|
-
[
|
|
76
|
-
*[
|
|
74
|
+
}{ $has_value ->
|
|
75
|
+
[1] { " " }设置为 <code data-l10n-name="value">{ $flag_value }</code>
|
|
76
|
+
*[0] { "" }
|
|
77
77
|
}{ "。" }
|
|
78
|
-
{
|
|
79
|
-
[
|
|
78
|
+
{ $has_pref_url ->
|
|
79
|
+
[1]
|
|
80
80
|
{ $flag_type ->
|
|
81
81
|
[preference] 要更改 { $browser_name } 中的首选项,请访问 { $browser_pref_url }。
|
|
82
82
|
*[other] { "" }
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
*[0] { "" }
|
|
85
85
|
}
|
|
86
86
|
compat-legend-yes = { compat-support-full }
|
|
87
87
|
compat-legend-partial = { compat-support-partial }
|
package/l10n/template.ftl
CHANGED
|
@@ -56,36 +56,36 @@ compat-support-altname = Alternate name: { $altname }
|
|
|
56
56
|
compat-support-removed = Removed in { $version } and later
|
|
57
57
|
compat-support-see-impl-url = See <a data-l10n-name="impl_url">{ $label }</a>
|
|
58
58
|
compat-support-flags =
|
|
59
|
-
{
|
|
60
|
-
[
|
|
61
|
-
*[
|
|
59
|
+
{ $has_added ->
|
|
60
|
+
[1] From version { $version_added }
|
|
61
|
+
*[0] { "" }
|
|
62
62
|
}{ $has_last ->
|
|
63
|
-
[
|
|
64
|
-
{
|
|
65
|
-
*[
|
|
66
|
-
[
|
|
63
|
+
[1]
|
|
64
|
+
{ $has_added ->
|
|
65
|
+
*[0] Until { $versionLast } users
|
|
66
|
+
[1] { " " }until { $versionLast } users
|
|
67
67
|
}
|
|
68
|
-
*[
|
|
69
|
-
{
|
|
70
|
-
*[
|
|
71
|
-
[
|
|
68
|
+
*[0]
|
|
69
|
+
{ $has_added ->
|
|
70
|
+
*[0] Users
|
|
71
|
+
[1] { " " }users
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
{ " " }must explicitly set the <code data-l10n-name="name">{ $flag_name }</code>{ " " }
|
|
75
75
|
{ $flag_type ->
|
|
76
76
|
*[preference] preference
|
|
77
77
|
[runtime_flag] runtime flag
|
|
78
|
-
}{
|
|
79
|
-
[
|
|
80
|
-
*[
|
|
78
|
+
}{ $has_value ->
|
|
79
|
+
[1] { " " }to <code data-l10n-name="value">{ $flag_value }</code>
|
|
80
|
+
*[0] { "" }
|
|
81
81
|
}{ "." }
|
|
82
|
-
{
|
|
83
|
-
[
|
|
82
|
+
{ $has_pref_url ->
|
|
83
|
+
[1]
|
|
84
84
|
{ $flag_type ->
|
|
85
85
|
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
|
|
86
86
|
*[other] { "" }
|
|
87
87
|
}
|
|
88
|
-
*[
|
|
88
|
+
*[0] { "" }
|
|
89
89
|
}
|
|
90
90
|
compat-legend-yes = { compat-support-full }
|
|
91
91
|
compat-legend-partial = { compat-support-partial }
|