@mdn/fred 1.6.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env-dist +4 -0
- package/CHANGELOG.md +25 -0
- package/build/eslint-fred.js +6 -4
- package/build/plugins/generate-element-map.js +3 -2
- package/build/utils.js +0 -23
- package/components/curriculum/module.css +1 -0
- package/components/curriculum-module/server.css +1 -0
- package/components/env/index.js +3 -0
- package/components/footer/server.js +1 -1
- package/components/live-sample-result/element.js +1 -0
- package/components/menu/base.css +2 -1
- package/components/menu/constants.js +443 -147
- package/components/menu/missing-docs.json +140 -0
- package/components/menu/server.js +78 -657
- package/components/menu/types.d.ts +50 -0
- package/components/menu/update-missing-docs.js +66 -0
- package/components/outer-layout/utils.js +2 -2
- package/components/play-runner/element.js +14 -6
- package/entry.client.js +1 -0
- package/hooks/ga-init.js +31 -0
- package/hooks/glean-init.js +2 -6
- package/l10n/fr.ftl +145 -1
- package/out/service-worker.js +1 -1
- package/out/service-worker.js.map +1 -1
- package/out/static/client/{6480.09f744cd2fb69ed8.js → 6480.c839ead24f125a7e.js} +3 -2
- package/out/static/client/{6480.09f744cd2fb69ed8.js.map → 6480.c839ead24f125a7e.js.map} +1 -1
- package/out/static/client/9914.021220acc0d3e777.js +11 -0
- package/out/static/client/9914.021220acc0d3e777.js.map +1 -0
- package/out/static/client/index.0f1f5c05b3c9458b.js +412 -0
- package/out/static/client/index.0f1f5c05b3c9458b.js.map +1 -0
- package/out/static/client/{runtime.b178b9749f31202a.js → runtime.f3c0cd5b45c6e874.js} +2 -2
- package/out/static/client/{runtime.b178b9749f31202a.js.map → runtime.f3c0cd5b45c6e874.js.map} +1 -1
- package/out/static/client/stats.json +116 -116
- package/out/static/client/styles-curriculum-landing.cbaf6ff367369a26.css.map +1 -1
- package/out/static/client/styles-curriculum-module.c7ec78d3e724cf64.css.map +1 -1
- package/out/static/client/{styles-global.fb7afecd89ca2dff.js → styles-global.52fa98f0e9ec0040.js} +1 -1
- package/out/static/client/{styles-global.684fd2c5254c94b8.css → styles-global.75b8c75561733419.css} +2 -2
- package/out/static/client/{styles-global.684fd2c5254c94b8.css.map → styles-global.75b8c75561733419.css.map} +1 -1
- package/out/static/client/styles-menu.c41c14be9597dcd9.css +2 -0
- package/out/static/client/styles-menu.c41c14be9597dcd9.css.map +1 -0
- package/out/static/legacy/asset-manifest.json +5 -5
- package/out/static/legacy/{index.ad3600b01e18974e.html → index.4d5b9af908771553.html} +1 -1
- package/out/static/legacy/{index.5592b02d966df8ba.js → index.e275f57e34e5ad42.js} +3 -3
- package/out/static/legacy/{index.5592b02d966df8ba.js.map → index.e275f57e34e5ad42.js.map} +1 -1
- package/out/static/legacy/stats.json +10 -10
- package/out/static/legacy/{yari.8ce0be252d1ae155.js → yari.28c752c4002c881d.js} +3 -3
- package/out/static/legacy/{yari.8ce0be252d1ae155.js.map → yari.28c752c4002c881d.js.map} +1 -1
- package/out/static/ssr/index.js +306 -580
- package/out/static/ssr/index.js.map +1 -1
- package/out/static/ssr/stats.json +4 -4
- package/package.json +9 -9
- package/utils/dnt-helper.js +59 -0
- package/utils/name-transformation.js +40 -0
- package/utils/telemetry-opt-out.js +12 -0
- package/components/menu/check-missing-docs.js +0 -44
- package/out/static/client/9914.251fe19f0038e97b.js +0 -11
- package/out/static/client/9914.251fe19f0038e97b.js.map +0 -1
- package/out/static/client/index.26176fe4ab13dce5.js +0 -268
- package/out/static/client/index.26176fe4ab13dce5.js.map +0 -1
- package/out/static/client/styles-menu.5193bf2642ae7d64.css +0 -2
- package/out/static/client/styles-menu.5193bf2642ae7d64.css.map +0 -1
- /package/out/static/client/{6480.09f744cd2fb69ed8.js.LICENSE.txt → 6480.c839ead24f125a7e.js.LICENSE.txt} +0 -0
- /package/out/static/client/{index.26176fe4ab13dce5.js.LICENSE.txt → index.0f1f5c05b3c9458b.js.LICENSE.txt} +0 -0
- /package/out/static/legacy/{index.5592b02d966df8ba.js.LICENSE.txt → index.e275f57e34e5ad42.js.LICENSE.txt} +0 -0
- /package/out/static/legacy/{yari.8ce0be252d1ae155.js.LICENSE.txt → yari.28c752c4002c881d.js.LICENSE.txt} +0 -0
|
@@ -4,7 +4,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
4
4
|
|
|
5
5
|
import { ServerComponent } from "../server/index.js";
|
|
6
6
|
|
|
7
|
-
import { MISSING_DOCS } from "./constants.js";
|
|
7
|
+
import { MISSING_DOCS, TABS } from "./constants.js";
|
|
8
8
|
|
|
9
9
|
export class Menu extends ServerComponent {
|
|
10
10
|
/**
|
|
@@ -12,11 +12,11 @@ export class Menu extends ServerComponent {
|
|
|
12
12
|
*/
|
|
13
13
|
render(context) {
|
|
14
14
|
/**
|
|
15
|
-
* Holds the id of the
|
|
15
|
+
* Holds the id of the tab being rendered.
|
|
16
16
|
*
|
|
17
17
|
* @type {string|null}
|
|
18
18
|
*/
|
|
19
|
-
let
|
|
19
|
+
let currentTab = null;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Generates a Glean ID for menu/submenu links.
|
|
@@ -27,7 +27,7 @@ export class Menu extends ServerComponent {
|
|
|
27
27
|
* @returns {string} the Glean ID.
|
|
28
28
|
*/
|
|
29
29
|
const gleanId = (href, { primary = false } = {}) =>
|
|
30
|
-
`${primary ? "menu_click_menu" : "menu_click_submenu"}: ${
|
|
30
|
+
`${primary ? "menu_click_menu" : "menu_click_submenu"}: ${currentTab ?? "?"} -> ${href}`;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Renders a link to a page.
|
|
@@ -59,662 +59,83 @@ export class Menu extends ServerComponent {
|
|
|
59
59
|
>`;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const sections = [
|
|
63
|
-
{
|
|
64
|
-
id: "html",
|
|
65
|
-
render: () =>
|
|
66
|
-
html`<mdn-dropdown>
|
|
67
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
68
|
-
<span class="menu__tab-label">HTML</span>
|
|
69
|
-
</button>
|
|
70
|
-
<div class="menu__panel" slot="dropdown">
|
|
71
|
-
<p class="menu__panel-title">
|
|
72
|
-
${link("Web/HTML", "HTML: Markup language", { primary: true })}
|
|
73
|
-
</p>
|
|
74
|
-
<div class="menu__panel-content">
|
|
75
|
-
<dl>
|
|
76
|
-
<dt>HTML reference</dt>
|
|
77
|
-
<dd>
|
|
78
|
-
<ul>
|
|
79
|
-
<li>
|
|
80
|
-
${link("Web/HTML/Reference/Elements", "Elements")}
|
|
81
|
-
</li>
|
|
82
|
-
<li>
|
|
83
|
-
${link(
|
|
84
|
-
"Web/HTML/Reference/Global_attributes",
|
|
85
|
-
"Global attributes",
|
|
86
|
-
)}
|
|
87
|
-
</li>
|
|
88
|
-
<li>
|
|
89
|
-
${link("Web/HTML/Reference/Attributes", "Attributes")}
|
|
90
|
-
</li>
|
|
91
|
-
<li>
|
|
92
|
-
${link("Web/HTML/Reference", "See all…", {
|
|
93
|
-
label: "See all HTML references",
|
|
94
|
-
})}
|
|
95
|
-
</li>
|
|
96
|
-
</ul>
|
|
97
|
-
</dd>
|
|
98
|
-
</dl>
|
|
99
|
-
<dl>
|
|
100
|
-
<dt>HTML guides</dt>
|
|
101
|
-
<dd>
|
|
102
|
-
<ul>
|
|
103
|
-
<li>
|
|
104
|
-
${link(
|
|
105
|
-
"Web/HTML/Guides/Responsive_images",
|
|
106
|
-
"Responsive images",
|
|
107
|
-
)}
|
|
108
|
-
</li>
|
|
109
|
-
<li>
|
|
110
|
-
${link("Web/HTML/Guides/Cheatsheet", "HTML cheatsheet")}
|
|
111
|
-
</li>
|
|
112
|
-
<li>
|
|
113
|
-
${link(
|
|
114
|
-
"Web/HTML/Guides/Date_and_time_formats",
|
|
115
|
-
"Date & time formats",
|
|
116
|
-
)}
|
|
117
|
-
</li>
|
|
118
|
-
<li>
|
|
119
|
-
${link("Web/HTML/Guides", "See all…", {
|
|
120
|
-
label: "See all HTML guides",
|
|
121
|
-
})}
|
|
122
|
-
</li>
|
|
123
|
-
</ul>
|
|
124
|
-
</dd>
|
|
125
|
-
</dl>
|
|
126
|
-
<dl>
|
|
127
|
-
<dt>Markup languages</dt>
|
|
128
|
-
<dd>
|
|
129
|
-
<ul>
|
|
130
|
-
<li>${link("Web/SVG", "SVG")}</li>
|
|
131
|
-
<li>${link("Web/MathML", "MathML")}</li>
|
|
132
|
-
<li>${link("Web/XML", "XML")}</li>
|
|
133
|
-
</ul>
|
|
134
|
-
</dd>
|
|
135
|
-
</dl>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</mdn-dropdown>`,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "css",
|
|
142
|
-
render: () =>
|
|
143
|
-
html`<mdn-dropdown>
|
|
144
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
145
|
-
<span class="menu__tab-label">CSS</span>
|
|
146
|
-
</button>
|
|
147
|
-
<div class="menu__panel" slot="dropdown">
|
|
148
|
-
<p class="menu__panel-title">
|
|
149
|
-
${link("Web/CSS", "CSS: Styling language", { primary: true })}
|
|
150
|
-
</p>
|
|
151
|
-
<div class="menu__panel-content">
|
|
152
|
-
<dl>
|
|
153
|
-
<dt>CSS reference</dt>
|
|
154
|
-
<dd>
|
|
155
|
-
<ul>
|
|
156
|
-
<li>${link("Web/CSS/Properties", "Properties")}</li>
|
|
157
|
-
<li>${link("Web/CSS/CSS_selectors", "Selectors")}</li>
|
|
158
|
-
<li>${link("Web/CSS/CSS_syntax/At-rule", "At-rules")}</li>
|
|
159
|
-
<li>
|
|
160
|
-
${link(
|
|
161
|
-
"Web/CSS/CSS_values_and_units",
|
|
162
|
-
"Values & units",
|
|
163
|
-
)}
|
|
164
|
-
</li>
|
|
165
|
-
<li>
|
|
166
|
-
${link("Web/CSS/Reference", "See all…", {
|
|
167
|
-
label: "See all CSS references",
|
|
168
|
-
})}
|
|
169
|
-
</li>
|
|
170
|
-
</ul>
|
|
171
|
-
</dd>
|
|
172
|
-
</dl>
|
|
173
|
-
<dl>
|
|
174
|
-
<dt>CSS guides</dt>
|
|
175
|
-
<dd>
|
|
176
|
-
<ul>
|
|
177
|
-
<li>
|
|
178
|
-
${link(
|
|
179
|
-
"Web/CSS/CSS_box_model/Introduction_to_the_CSS_box_model",
|
|
180
|
-
"Box model",
|
|
181
|
-
)}
|
|
182
|
-
</li>
|
|
183
|
-
<li>
|
|
184
|
-
${link(
|
|
185
|
-
"Web/CSS/CSS_animations/Using_CSS_animations",
|
|
186
|
-
"Animations",
|
|
187
|
-
)}
|
|
188
|
-
</li>
|
|
189
|
-
<li>
|
|
190
|
-
${link(
|
|
191
|
-
"Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox",
|
|
192
|
-
"Flexbox",
|
|
193
|
-
)}
|
|
194
|
-
</li>
|
|
195
|
-
<li>${link("Web/CSS/CSS_colors", "Colors")}</li>
|
|
196
|
-
<li>
|
|
197
|
-
${link("Web/CSS/Guides", "See all…", {
|
|
198
|
-
label: "See all CSS guides",
|
|
199
|
-
})}
|
|
200
|
-
</li>
|
|
201
|
-
</ul>
|
|
202
|
-
</dd>
|
|
203
|
-
</dl>
|
|
204
|
-
<dl>
|
|
205
|
-
<dt>Layout cookbook</dt>
|
|
206
|
-
<dd>
|
|
207
|
-
<ul>
|
|
208
|
-
<li>
|
|
209
|
-
${link(
|
|
210
|
-
"Web/CSS/Layout_cookbook/Column_layouts",
|
|
211
|
-
"Column layouts",
|
|
212
|
-
)}
|
|
213
|
-
</li>
|
|
214
|
-
<li>
|
|
215
|
-
${link(
|
|
216
|
-
"Web/CSS/Layout_cookbook/Center_an_element",
|
|
217
|
-
"Centering an element",
|
|
218
|
-
)}
|
|
219
|
-
</li>
|
|
220
|
-
<li>
|
|
221
|
-
${link(
|
|
222
|
-
"Web/CSS/Layout_cookbook/Card",
|
|
223
|
-
"Card component",
|
|
224
|
-
)}
|
|
225
|
-
</li>
|
|
226
|
-
<li>${link("Web/CSS/Layout_cookbook", "See all…")}</li>
|
|
227
|
-
</ul>
|
|
228
|
-
</dd>
|
|
229
|
-
</dl>
|
|
230
|
-
</div>
|
|
231
|
-
</div>
|
|
232
|
-
</mdn-dropdown>`,
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
id: "javascript",
|
|
236
|
-
render: () =>
|
|
237
|
-
html`<mdn-dropdown>
|
|
238
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
239
|
-
<span class="menu__tab-label" data-type="long">JavaScript</span>
|
|
240
|
-
<span class="menu__tab-label" data-type="short">JS</span>
|
|
241
|
-
</button>
|
|
242
|
-
<div class="menu__panel" slot="dropdown">
|
|
243
|
-
<p class="menu__panel-title">
|
|
244
|
-
${link("Web/JavaScript", "JavaScript: Scripting language", {
|
|
245
|
-
primary: true,
|
|
246
|
-
})}
|
|
247
|
-
</p>
|
|
248
|
-
<div class="menu__panel-content">
|
|
249
|
-
<dl>
|
|
250
|
-
<dt>JS reference</dt>
|
|
251
|
-
<dd>
|
|
252
|
-
<ul>
|
|
253
|
-
<li>
|
|
254
|
-
${link(
|
|
255
|
-
"Web/JavaScript/Reference/Global_Objects",
|
|
256
|
-
"Standard built-in objects",
|
|
257
|
-
)}
|
|
258
|
-
</li>
|
|
259
|
-
<li>
|
|
260
|
-
${link(
|
|
261
|
-
"Web/JavaScript/Reference/Operators",
|
|
262
|
-
"Expressions & operators",
|
|
263
|
-
)}
|
|
264
|
-
</li>
|
|
265
|
-
<li>
|
|
266
|
-
${link(
|
|
267
|
-
"Web/JavaScript/Reference/Statements",
|
|
268
|
-
"Statements & declarations",
|
|
269
|
-
)}
|
|
270
|
-
</li>
|
|
271
|
-
<li>
|
|
272
|
-
${link(
|
|
273
|
-
"Web/JavaScript/Reference/Functions",
|
|
274
|
-
"Functions",
|
|
275
|
-
)}
|
|
276
|
-
</li>
|
|
277
|
-
<li>
|
|
278
|
-
${link("Web/JavaScript/Reference", "See all…", {
|
|
279
|
-
label: "See all JavaScript references",
|
|
280
|
-
})}
|
|
281
|
-
</li>
|
|
282
|
-
</ul>
|
|
283
|
-
</dd>
|
|
284
|
-
</dl>
|
|
285
|
-
<dl>
|
|
286
|
-
<dt>JS guides</dt>
|
|
287
|
-
<dd>
|
|
288
|
-
<ul>
|
|
289
|
-
<li>
|
|
290
|
-
${link(
|
|
291
|
-
"Web/JavaScript/Guide/Control_flow_and_error_handling",
|
|
292
|
-
"Control flow & error handing",
|
|
293
|
-
)}
|
|
294
|
-
</li>
|
|
295
|
-
<li>
|
|
296
|
-
${link(
|
|
297
|
-
"Web/JavaScript/Guide/Loops_and_iteration",
|
|
298
|
-
"Loops and iteration",
|
|
299
|
-
)}
|
|
300
|
-
</li>
|
|
301
|
-
<li>
|
|
302
|
-
${link(
|
|
303
|
-
"Web/JavaScript/Guide/Working_with_objects",
|
|
304
|
-
"Working with objects",
|
|
305
|
-
)}
|
|
306
|
-
</li>
|
|
307
|
-
<li>
|
|
308
|
-
${link(
|
|
309
|
-
"Web/JavaScript/Guide/Using_classes",
|
|
310
|
-
"Using classes",
|
|
311
|
-
)}
|
|
312
|
-
</li>
|
|
313
|
-
<li>
|
|
314
|
-
${link("Web/JavaScript/Guide", "See all…", {
|
|
315
|
-
label: "See all JavaScript guides",
|
|
316
|
-
})}
|
|
317
|
-
</li>
|
|
318
|
-
</ul>
|
|
319
|
-
</dd>
|
|
320
|
-
</dl>
|
|
321
|
-
</div>
|
|
322
|
-
</div>
|
|
323
|
-
</mdn-dropdown>`,
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
id: "webapis",
|
|
327
|
-
render: () =>
|
|
328
|
-
html`<mdn-dropdown>
|
|
329
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
330
|
-
<span class="menu__tab-label">Web APIs</span>
|
|
331
|
-
</button>
|
|
332
|
-
<div class="menu__panel" slot="dropdown">
|
|
333
|
-
<p class="menu__panel-title">
|
|
334
|
-
${link("Web/API", "Web APIs: Programming interfaces", {
|
|
335
|
-
primary: true,
|
|
336
|
-
})}
|
|
337
|
-
</p>
|
|
338
|
-
<div class="menu__panel-content">
|
|
339
|
-
<dl>
|
|
340
|
-
<dt>Web API reference</dt>
|
|
341
|
-
<dd>
|
|
342
|
-
<ul>
|
|
343
|
-
<li>
|
|
344
|
-
${link("Web/API/File_System_API", "File system API")}
|
|
345
|
-
</li>
|
|
346
|
-
<li>${link("Web/API/Fetch_API", "Fetch API")}</li>
|
|
347
|
-
<li>
|
|
348
|
-
${link("Web/API/Geolocation_API", "Geolocation API")}
|
|
349
|
-
</li>
|
|
350
|
-
<li>${link("Web/API/HTML_DOM_API", "HTML DOM API")}</li>
|
|
351
|
-
<li>${link("Web/API/Push_API", "Push API")}</li>
|
|
352
|
-
<li>
|
|
353
|
-
${link(
|
|
354
|
-
"Web/API/Service_Worker_API",
|
|
355
|
-
"Service worker API",
|
|
356
|
-
)}
|
|
357
|
-
</li>
|
|
358
|
-
<li>
|
|
359
|
-
${link("Web/API", "See all…", {
|
|
360
|
-
label: "See all Web API guides",
|
|
361
|
-
})}
|
|
362
|
-
</li>
|
|
363
|
-
</ul>
|
|
364
|
-
</dd>
|
|
365
|
-
</dl>
|
|
366
|
-
<dl>
|
|
367
|
-
<dt>Web API guides</dt>
|
|
368
|
-
<dd>
|
|
369
|
-
<ul>
|
|
370
|
-
<li>
|
|
371
|
-
${link(
|
|
372
|
-
"Web/API/Web_Animations_API/Using_the_Web_Animations_API",
|
|
373
|
-
"Using the Web animation API",
|
|
374
|
-
)}
|
|
375
|
-
</li>
|
|
376
|
-
<li>
|
|
377
|
-
${link(
|
|
378
|
-
"Web/API/Fetch_API/Using_Fetch",
|
|
379
|
-
"Using the Fetch API",
|
|
380
|
-
)}
|
|
381
|
-
</li>
|
|
382
|
-
<li>
|
|
383
|
-
${link(
|
|
384
|
-
"Web/API/History_API/Working_with_the_History_API",
|
|
385
|
-
"Working with the History API",
|
|
386
|
-
)}
|
|
387
|
-
</li>
|
|
388
|
-
<li>
|
|
389
|
-
${link(
|
|
390
|
-
"Web/API/Web_Speech_API/Using_the_Web_Speech_API",
|
|
391
|
-
"Using the Web speech API",
|
|
392
|
-
)}
|
|
393
|
-
</li>
|
|
394
|
-
<li>
|
|
395
|
-
${link(
|
|
396
|
-
"Web/API/Web_Workers_API/Using_web_workers",
|
|
397
|
-
"Using web workers",
|
|
398
|
-
)}
|
|
399
|
-
</li>
|
|
400
|
-
</ul>
|
|
401
|
-
</dd>
|
|
402
|
-
</dl>
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
</mdn-dropdown>`,
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
id: "all",
|
|
409
|
-
render: () =>
|
|
410
|
-
html`<mdn-dropdown>
|
|
411
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
412
|
-
<span class="menu__tab-label">All</span>
|
|
413
|
-
</button>
|
|
414
|
-
<div class="menu__panel" slot="dropdown">
|
|
415
|
-
<p class="menu__panel-title">
|
|
416
|
-
${link("Web", "All web technology", { primary: true })}
|
|
417
|
-
</p>
|
|
418
|
-
<div class="menu__panel-content">
|
|
419
|
-
<dl>
|
|
420
|
-
<dt>Technologies</dt>
|
|
421
|
-
<dd>
|
|
422
|
-
<ul>
|
|
423
|
-
<li>${link("Web/Accessibility", "Accessibility")}</li>
|
|
424
|
-
<li>${link("Web/HTTP", "HTTP")}</li>
|
|
425
|
-
<li>${link("Web/URI", "URI")}</li>
|
|
426
|
-
<li>
|
|
427
|
-
${link(
|
|
428
|
-
"Mozilla/Add-ons/WebExtensions",
|
|
429
|
-
"Web extensions",
|
|
430
|
-
)}
|
|
431
|
-
</li>
|
|
432
|
-
<li>${link("WebAssembly", "WebAssembly")}</li>
|
|
433
|
-
<li>${link("Web/WebDriver", "WebDriver")}</li>
|
|
434
|
-
<li>
|
|
435
|
-
${link("Web", "See all…", {
|
|
436
|
-
label: "See all web technology references",
|
|
437
|
-
})}
|
|
438
|
-
</li>
|
|
439
|
-
</ul>
|
|
440
|
-
</dd>
|
|
441
|
-
</dl>
|
|
442
|
-
<dl>
|
|
443
|
-
<dt>Topics</dt>
|
|
444
|
-
<dd>
|
|
445
|
-
<ul>
|
|
446
|
-
<li>${link("Web/Media", "Media")}</li>
|
|
447
|
-
<li>${link("Web/API/Performance", "Performance")}</li>
|
|
448
|
-
<li>${link("Web/Privacy", "Privacy")}</li>
|
|
449
|
-
<li>${link("Web/Security", "Security")}</li>
|
|
450
|
-
<li>
|
|
451
|
-
${link(
|
|
452
|
-
"Web/Progressive_web_apps",
|
|
453
|
-
"Progressive web apps",
|
|
454
|
-
)}
|
|
455
|
-
</li>
|
|
456
|
-
</ul>
|
|
457
|
-
</dd>
|
|
458
|
-
</dl>
|
|
459
|
-
</div>
|
|
460
|
-
</div>
|
|
461
|
-
</mdn-dropdown>`,
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
id: "learn",
|
|
465
|
-
render: () =>
|
|
466
|
-
html`<mdn-dropdown>
|
|
467
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
468
|
-
<span class="menu__tab-label">Learn</span>
|
|
469
|
-
</button>
|
|
470
|
-
<div class="menu__panel" slot="dropdown">
|
|
471
|
-
<p class="menu__panel-title">
|
|
472
|
-
${link("Learn_web_development", "Learn web development", {
|
|
473
|
-
primary: true,
|
|
474
|
-
})}
|
|
475
|
-
</p>
|
|
476
|
-
<div class="menu__panel-content">
|
|
477
|
-
<dl>
|
|
478
|
-
<dt>Frontend developer course</dt>
|
|
479
|
-
<dd>
|
|
480
|
-
<ul>
|
|
481
|
-
<li>
|
|
482
|
-
${link(
|
|
483
|
-
"Learn_web_development/Getting_started",
|
|
484
|
-
"Getting started",
|
|
485
|
-
)}
|
|
486
|
-
</li>
|
|
487
|
-
<li>
|
|
488
|
-
${link(
|
|
489
|
-
"Learn_web_development/Howto",
|
|
490
|
-
"Common questions",
|
|
491
|
-
)}
|
|
492
|
-
</li>
|
|
493
|
-
<li>
|
|
494
|
-
<a
|
|
495
|
-
class=${ifDefined(
|
|
496
|
-
context.locale === "en-US"
|
|
497
|
-
? undefined
|
|
498
|
-
: "only-in-en-us",
|
|
499
|
-
)}
|
|
500
|
-
href="/en-US/curriculum/"
|
|
501
|
-
data-glean-id=${gleanId("/en-US/curriculum/")}
|
|
502
|
-
>Curriculum</a
|
|
503
|
-
>
|
|
504
|
-
</li>
|
|
505
|
-
</ul>
|
|
506
|
-
</dd>
|
|
507
|
-
</dl>
|
|
508
|
-
<dl>
|
|
509
|
-
<dt>Learn HTML</dt>
|
|
510
|
-
<dd>
|
|
511
|
-
<ul>
|
|
512
|
-
<li>
|
|
513
|
-
${link(
|
|
514
|
-
"Learn_web_development/Core/Structuring_content",
|
|
515
|
-
"Introduction to HTML",
|
|
516
|
-
)}
|
|
517
|
-
</li>
|
|
518
|
-
<li>
|
|
519
|
-
${link(
|
|
520
|
-
"Learn_web_development/Core/Structuring_content/Basic_HTML_syntax",
|
|
521
|
-
"Getting started with HTML",
|
|
522
|
-
)}
|
|
523
|
-
</li>
|
|
524
|
-
</ul>
|
|
525
|
-
</dd>
|
|
526
|
-
</dl>
|
|
527
|
-
<dl>
|
|
528
|
-
<dt>Learn CSS</dt>
|
|
529
|
-
<dd>
|
|
530
|
-
<ul>
|
|
531
|
-
<li>
|
|
532
|
-
${link(
|
|
533
|
-
"Learn_web_development/Core/Styling_basics/What_is_CSS",
|
|
534
|
-
"What is CSS",
|
|
535
|
-
)}
|
|
536
|
-
</li>
|
|
537
|
-
<li>
|
|
538
|
-
${link(
|
|
539
|
-
"Learn_web_development/Core/Styling_basics/Getting_started",
|
|
540
|
-
"Getting started with CSS",
|
|
541
|
-
)}
|
|
542
|
-
</li>
|
|
543
|
-
</ul>
|
|
544
|
-
</dd>
|
|
545
|
-
</dl>
|
|
546
|
-
<dl>
|
|
547
|
-
<dt>Learn JavaScript</dt>
|
|
548
|
-
<dd>
|
|
549
|
-
<ul>
|
|
550
|
-
<li>
|
|
551
|
-
${link(
|
|
552
|
-
"Web/HTML/How_to/Use_data_attributes",
|
|
553
|
-
"How to use data attributes",
|
|
554
|
-
)}
|
|
555
|
-
</li>
|
|
556
|
-
<li>
|
|
557
|
-
${link(
|
|
558
|
-
"Web/HTML/How_to/Add_JavaScript_to_your_web_page",
|
|
559
|
-
"Add JavaScript to your web page",
|
|
560
|
-
)}
|
|
561
|
-
</li>
|
|
562
|
-
</ul>
|
|
563
|
-
</dd>
|
|
564
|
-
</dl>
|
|
565
|
-
</div>
|
|
566
|
-
</div>
|
|
567
|
-
</mdn-dropdown>`,
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
id: "tools",
|
|
571
|
-
render: () =>
|
|
572
|
-
html`<mdn-dropdown>
|
|
573
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
574
|
-
<span class="menu__tab-label">Tools</span>
|
|
575
|
-
</button>
|
|
576
|
-
<div class="menu__panel" slot="dropdown">
|
|
577
|
-
<p class="menu__panel-title">Discover our tools</p>
|
|
578
|
-
<div class="menu__panel-content">
|
|
579
|
-
<ul>
|
|
580
|
-
<li>
|
|
581
|
-
<a
|
|
582
|
-
class="menu__panel-icon"
|
|
583
|
-
data-icon="circle-play"
|
|
584
|
-
href=${`/en-US/play`}
|
|
585
|
-
data-glean-id=${gleanId("/en-US/play/")}
|
|
586
|
-
>
|
|
587
|
-
Playground
|
|
588
|
-
</a>
|
|
589
|
-
</li>
|
|
590
|
-
<li>
|
|
591
|
-
<a
|
|
592
|
-
class="menu__panel-icon"
|
|
593
|
-
data-icon="shield-check"
|
|
594
|
-
href=${`/en-US/observatory`}
|
|
595
|
-
data-glean-id=${gleanId("/en-US/observatory/")}
|
|
596
|
-
>
|
|
597
|
-
HTTP Observatory
|
|
598
|
-
</a>
|
|
599
|
-
</li>
|
|
600
|
-
</ul>
|
|
601
|
-
<ul>
|
|
602
|
-
<li>
|
|
603
|
-
${link(
|
|
604
|
-
"Web/CSS/CSS_backgrounds_and_borders/Border-image_generator",
|
|
605
|
-
"Border-image generator",
|
|
606
|
-
)}
|
|
607
|
-
</li>
|
|
608
|
-
<li>
|
|
609
|
-
${link(
|
|
610
|
-
"Web/CSS/CSS_backgrounds_and_borders/Border-radius_generator",
|
|
611
|
-
"Border-radius generator",
|
|
612
|
-
)}
|
|
613
|
-
</li>
|
|
614
|
-
<li>
|
|
615
|
-
${link(
|
|
616
|
-
"Web/CSS/CSS_backgrounds_and_borders/Box-shadow_generator",
|
|
617
|
-
"Box-shadow generator",
|
|
618
|
-
)}
|
|
619
|
-
</li>
|
|
620
|
-
<li>
|
|
621
|
-
${link(
|
|
622
|
-
"Web/CSS/CSS_colors/Color_format_converter",
|
|
623
|
-
"Color format converter",
|
|
624
|
-
)}
|
|
625
|
-
</li>
|
|
626
|
-
<li>
|
|
627
|
-
${link("Web/CSS/CSS_colors/Color_mixer", "Color mixer")}
|
|
628
|
-
</li>
|
|
629
|
-
<li>
|
|
630
|
-
${link(
|
|
631
|
-
"Web/CSS/CSS_shapes/Shape_generator",
|
|
632
|
-
"Shape generator",
|
|
633
|
-
)}
|
|
634
|
-
</li>
|
|
635
|
-
</ul>
|
|
636
|
-
</div>
|
|
637
|
-
</div>
|
|
638
|
-
</mdn-dropdown>`,
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
id: "about",
|
|
642
|
-
render: () =>
|
|
643
|
-
html`<mdn-dropdown>
|
|
644
|
-
<button class="menu__tab-button" type="button" slot="button">
|
|
645
|
-
<span class="menu__tab-label">About</span>
|
|
646
|
-
</button>
|
|
647
|
-
<div class="menu__panel" slot="dropdown">
|
|
648
|
-
<p class="menu__panel-title">Get to know MDN better</p>
|
|
649
|
-
<div class="menu__panel-content">
|
|
650
|
-
<ul>
|
|
651
|
-
<li>
|
|
652
|
-
<a
|
|
653
|
-
class="menu__panel-icon"
|
|
654
|
-
data-icon="mdn-m"
|
|
655
|
-
href=${`/en-US/about`}
|
|
656
|
-
data-glean-id=${gleanId("/en-US/about")}
|
|
657
|
-
>
|
|
658
|
-
About MDN
|
|
659
|
-
</a>
|
|
660
|
-
</li>
|
|
661
|
-
<li>
|
|
662
|
-
<a
|
|
663
|
-
class="menu__panel-icon"
|
|
664
|
-
data-icon="chart-no-axes-combined"
|
|
665
|
-
href=${`/en-US/advertising`}
|
|
666
|
-
data-glean-id=${gleanId("/en-US/advertising")}
|
|
667
|
-
>
|
|
668
|
-
Advertise with us
|
|
669
|
-
</a>
|
|
670
|
-
</li>
|
|
671
|
-
</ul>
|
|
672
|
-
<ul>
|
|
673
|
-
<li>
|
|
674
|
-
<a
|
|
675
|
-
class="menu__panel-icon"
|
|
676
|
-
data-icon="users"
|
|
677
|
-
href=${`/en-US/community`}
|
|
678
|
-
data-glean-id=${gleanId("/en-US/community")}
|
|
679
|
-
>
|
|
680
|
-
Community
|
|
681
|
-
</a>
|
|
682
|
-
</li>
|
|
683
|
-
<li>
|
|
684
|
-
<a
|
|
685
|
-
class="menu__panel-icon"
|
|
686
|
-
data-icon="github"
|
|
687
|
-
href="https://github.com/mdn"
|
|
688
|
-
data-glean-id=${gleanId("https://github.com/mdn")}
|
|
689
|
-
>
|
|
690
|
-
MDN on GitHub
|
|
691
|
-
</a>
|
|
692
|
-
</li>
|
|
693
|
-
</ul>
|
|
694
|
-
</div>
|
|
695
|
-
</div>
|
|
696
|
-
</mdn-dropdown>`,
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
id: "blog",
|
|
700
|
-
render: () =>
|
|
701
|
-
html`<a
|
|
702
|
-
class="menu__tab-link"
|
|
703
|
-
href=${`/en-US/blog/`}
|
|
704
|
-
data-glean-id=${`menu_click_link: top-level -> /en-US/blog/`}
|
|
705
|
-
>Blog</a
|
|
706
|
-
>`,
|
|
707
|
-
},
|
|
708
|
-
];
|
|
709
|
-
|
|
710
62
|
return html`
|
|
711
63
|
<nav class="menu">
|
|
712
|
-
${
|
|
713
|
-
|
|
714
|
-
const result = html`<div class="menu__tab" data-section=${
|
|
715
|
-
${
|
|
64
|
+
${TABS.map((tab) => {
|
|
65
|
+
currentTab = tab.id;
|
|
66
|
+
const result = html`<div class="menu__tab" data-section=${tab.id}>
|
|
67
|
+
${"href" in tab
|
|
68
|
+
? html`<a
|
|
69
|
+
class="menu__tab-link"
|
|
70
|
+
href=${tab.href}
|
|
71
|
+
data-glean-id=${`menu_click_link: top-level -> ${tab.href}`}
|
|
72
|
+
>${tab.buttonText}</a
|
|
73
|
+
>`
|
|
74
|
+
: html`<mdn-dropdown>
|
|
75
|
+
<button class="menu__tab-button" type="button" slot="button">
|
|
76
|
+
${typeof tab.buttonText === "string"
|
|
77
|
+
? html`<span class="menu__tab-label"
|
|
78
|
+
>${tab.buttonText}</span
|
|
79
|
+
>`
|
|
80
|
+
: html`<span class="menu__tab-label" data-type="long"
|
|
81
|
+
>${tab.buttonText.long}</span
|
|
82
|
+
><span class="menu__tab-label" data-type="short"
|
|
83
|
+
>${tab.buttonText.short}</span
|
|
84
|
+
>`}
|
|
85
|
+
</button>
|
|
86
|
+
<div class="menu__panel" slot="dropdown">
|
|
87
|
+
<p class="menu__panel-title">
|
|
88
|
+
${tab.panelTitle.slug
|
|
89
|
+
? link(tab.panelTitle.slug, tab.panelTitle.text, {
|
|
90
|
+
primary: true,
|
|
91
|
+
})
|
|
92
|
+
: tab.panelTitle.text}
|
|
93
|
+
</p>
|
|
94
|
+
<div class="menu__panel-content">
|
|
95
|
+
${tab.panelGroups.map((group) => {
|
|
96
|
+
const items = html`<ul>
|
|
97
|
+
${group.items.map(
|
|
98
|
+
(item) =>
|
|
99
|
+
html`<li>
|
|
100
|
+
${"render" in item
|
|
101
|
+
? item.render()
|
|
102
|
+
: "slug" in item
|
|
103
|
+
? link(item.slug, item.text, {
|
|
104
|
+
label: item.label,
|
|
105
|
+
})
|
|
106
|
+
: html`<a
|
|
107
|
+
class=${ifDefined(
|
|
108
|
+
[
|
|
109
|
+
item.icon && "menu__panel-icon",
|
|
110
|
+
context.locale !== "en-US" &&
|
|
111
|
+
"only-in-en-us",
|
|
112
|
+
]
|
|
113
|
+
.filter(Boolean)
|
|
114
|
+
.join(" "),
|
|
115
|
+
)}
|
|
116
|
+
data-icon=${ifDefined(item.icon)}
|
|
117
|
+
href=${item.href}
|
|
118
|
+
aria-label=${ifDefined(item.label)}
|
|
119
|
+
title=${ifDefined(item.label)}
|
|
120
|
+
data-glean-id=${gleanId(item.href)}
|
|
121
|
+
>${item.text}</a
|
|
122
|
+
>`}
|
|
123
|
+
</li>`,
|
|
124
|
+
)}
|
|
125
|
+
</ul>`;
|
|
126
|
+
|
|
127
|
+
return "title" in group
|
|
128
|
+
? html`<dl>
|
|
129
|
+
<dt>${group.title}</dt>
|
|
130
|
+
<dd>${items}</dd>
|
|
131
|
+
</dl>`
|
|
132
|
+
: items;
|
|
133
|
+
})}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</mdn-dropdown>`}
|
|
716
137
|
</div>`;
|
|
717
|
-
|
|
138
|
+
currentTab = null;
|
|
718
139
|
return result;
|
|
719
140
|
})}
|
|
720
141
|
</nav>
|