@patternfly/documentation-framework 2.0.0-alpha.9 → 5.0.2

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +614 -0
  2. package/README.md +1 -1
  3. package/app.js +20 -14
  4. package/assets/Favicon-Light-16x16.png +0 -0
  5. package/assets/Favicon-Light-32x32.png +0 -0
  6. package/assets/Favicon-Light-48x48.png +0 -0
  7. package/assets/Favicon-Light.png +0 -0
  8. package/assets/android-chrome-36x36.png +0 -0
  9. package/assets/android-chrome-48x48.png +0 -0
  10. package/assets/android-chrome-96x96.png +0 -0
  11. package/components/autoLinkHeader/autoLinkHeader.css +2 -2
  12. package/components/autoLinkHeader/autoLinkHeader.js +18 -13
  13. package/components/cssVariables/cssSearch.js +3 -4
  14. package/components/cssVariables/cssVariables.css +4 -4
  15. package/components/cssVariables/cssVariables.js +83 -84
  16. package/components/example/example.css +29 -29
  17. package/components/example/example.js +34 -6
  18. package/components/footer/footer.css +16 -16
  19. package/components/footer/footer.js +16 -16
  20. package/components/functionsTable/functionsTable.js +57 -0
  21. package/components/gdprBanner/gdprBanner.css +2 -2
  22. package/components/gdprBanner/gdprBanner.js +3 -3
  23. package/components/inlineAlert/inlineAlert.js +1 -1
  24. package/components/link/link.js +1 -2
  25. package/components/propsTable/propsTable.js +85 -79
  26. package/components/sectionGallery/TextSummary.js +31 -0
  27. package/components/sectionGallery/sectionDataListLayout.js +51 -0
  28. package/components/sectionGallery/sectionGallery.css +53 -0
  29. package/components/sectionGallery/sectionGallery.js +76 -0
  30. package/components/sectionGallery/sectionGalleryLayout.js +41 -0
  31. package/components/sectionGallery/sectionGalleryToolbar.js +38 -0
  32. package/components/sectionGallery/sectionGalleryWrapper.js +110 -0
  33. package/components/sideNav/sideNav.css +12 -12
  34. package/components/sideNav/sideNav.js +44 -16
  35. package/components/tableOfContents/tableOfContents.css +17 -17
  36. package/helpers/codesandbox.js +3 -5
  37. package/helpers/getTitle.js +2 -2
  38. package/layouts/sideNavLayout/sideNavLayout.css +7 -11
  39. package/layouts/sideNavLayout/sideNavLayout.js +59 -45
  40. package/package.json +28 -29
  41. package/pages/404/404.css +2 -2
  42. package/pages/404/index.js +1 -1
  43. package/pages/global-css-variables.md +16 -16
  44. package/routes.js +20 -10
  45. package/scripts/cli/build.js +0 -1
  46. package/scripts/cli/cli.js +2 -1
  47. package/scripts/cli/generate.js +2 -2
  48. package/scripts/cli/start.js +6 -8
  49. package/scripts/md/parseMD.js +46 -11
  50. package/scripts/md/styled-tags.js +8 -4
  51. package/scripts/tsDocgen.js +119 -91
  52. package/scripts/typeDocGen.js +209 -0
  53. package/scripts/webpack/getHtmlWebpackPlugins.js +1 -2
  54. package/scripts/webpack/prerender.js +1 -2
  55. package/scripts/webpack/webpack.base.config.js +35 -35
  56. package/scripts/webpack/webpack.client.config.js +11 -8
  57. package/scripts/webpack/webpack.server.config.js +8 -5
  58. package/scripts/writeScreenshots.js +3 -3
  59. package/templates/html.ejs +6 -8
  60. package/templates/mdx.css +156 -161
  61. package/templates/mdx.js +122 -51
  62. package/templates/patternfly-docs/content/extensions/extension/design-guidelines/design-guidelines.md +2 -0
  63. package/templates/patternfly-docs/content/extensions/extension/examples/basic.md +2 -0
  64. package/templates/sitemap.ejs +1 -1
  65. package/versions.json +32 -14
  66. package/assets/favicon-16x16.png +0 -0
  67. package/assets/favicon-32x32.png +0 -0
  68. package/assets/favicon-48x48.png +0 -0
  69. package/assets/favicon.ico +0 -0
  70. package/components/topNav/topNav.css +0 -30
  71. package/pages/red-hat-font.md +0 -40
package/CHANGELOG.md CHANGED
@@ -3,6 +3,620 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.0.2 (2023-06-26)
7
+
8
+ **Note:** Version bump only for package @patternfly/documentation-framework
9
+
10
+
11
+
12
+
13
+
14
+ ## 5.0.1 (2023-06-23)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * turn dry run off ([#3627](https://github.com/patternfly/patternfly-org/issues/3627)) ([f0a2d51](https://github.com/patternfly/patternfly-org/commit/f0a2d510b75b69b18cdbbd7ceb663241ef30093f))
20
+
21
+
22
+
23
+
24
+
25
+ # 2.0.0-alpha.74 (2023-06-23)
26
+
27
+ **Note:** Version bump only for package @patternfly/documentation-framework
28
+
29
+
30
+
31
+
32
+
33
+ # 2.0.0-alpha.73 (2023-06-23)
34
+
35
+ **Note:** Version bump only for package @patternfly/documentation-framework
36
+
37
+
38
+
39
+
40
+
41
+ # 2.0.0-alpha.72 (2023-06-22)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **deps:** update docs-framework to the latest prereleases ([#3615](https://github.com/patternfly/patternfly-org/issues/3615)) ([54091c3](https://github.com/patternfly/patternfly-org/commit/54091c358f01f65269f314c2717ad58767aa669a))
47
+
48
+
49
+
50
+
51
+
52
+ # 2.0.0-alpha.71 (2023-06-22)
53
+
54
+ **Note:** Version bump only for package @patternfly/documentation-framework
55
+
56
+
57
+
58
+
59
+
60
+ # 2.0.0-alpha.70 (2023-06-22)
61
+
62
+ **Note:** Version bump only for package @patternfly/documentation-framework
63
+
64
+
65
+
66
+
67
+
68
+ # 2.0.0-alpha.69 (2023-06-22)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * **docs:** fixed broken css vars header link ([#3617](https://github.com/patternfly/patternfly-org/issues/3617)) ([ad2b012](https://github.com/patternfly/patternfly-org/commit/ad2b01252d68cf8c4e53fac283b142b13994b222))
74
+
75
+
76
+
77
+
78
+
79
+ # 2.0.0-alpha.68 (2023-06-21)
80
+
81
+ **Note:** Version bump only for package @patternfly/documentation-framework
82
+
83
+
84
+
85
+
86
+
87
+ # 2.0.0-alpha.67 (2023-06-21)
88
+
89
+ **Note:** Version bump only for package @patternfly/documentation-framework
90
+
91
+
92
+
93
+
94
+
95
+ # 2.0.0-alpha.66 (2023-06-16)
96
+
97
+ **Note:** Version bump only for package @patternfly/documentation-framework
98
+
99
+
100
+
101
+
102
+
103
+ # 2.0.0-alpha.65 (2023-06-15)
104
+
105
+ **Note:** Version bump only for package @patternfly/documentation-framework
106
+
107
+
108
+
109
+
110
+
111
+ # 2.0.0-alpha.64 (2023-06-15)
112
+
113
+
114
+ ### Bug Fixes
115
+
116
+ * **Sidenav:** updated PageContext props ([#3593](https://github.com/patternfly/patternfly-org/issues/3593)) ([1cc24ea](https://github.com/patternfly/patternfly-org/commit/1cc24ea1ef88c42a6b62a4a6b2421d157bc298d8))
117
+
118
+
119
+
120
+
121
+
122
+ # 2.0.0-alpha.63 (2023-06-14)
123
+
124
+ **Note:** Version bump only for package @patternfly/documentation-framework
125
+
126
+
127
+
128
+
129
+
130
+ # 2.0.0-alpha.62 (2023-06-14)
131
+
132
+ **Note:** Version bump only for package @patternfly/documentation-framework
133
+
134
+
135
+
136
+
137
+
138
+ # 2.0.0-alpha.61 (2023-06-14)
139
+
140
+ **Note:** Version bump only for package @patternfly/documentation-framework
141
+
142
+
143
+
144
+
145
+
146
+ # 2.0.0-alpha.60 (2023-06-13)
147
+
148
+
149
+ ### Bug Fixes
150
+
151
+ * **docs:** fixed gallery styles affecting width, font vars ([#3596](https://github.com/patternfly/patternfly-org/issues/3596)) ([04f1b54](https://github.com/patternfly/patternfly-org/commit/04f1b54f947e1afca88926d8f371d3bf37a70e25))
152
+
153
+
154
+
155
+
156
+
157
+ # 2.0.0-alpha.59 (2023-06-13)
158
+
159
+ **Note:** Version bump only for package @patternfly/documentation-framework
160
+
161
+
162
+
163
+
164
+
165
+ # 2.0.0-alpha.58 (2023-06-13)
166
+
167
+ **Note:** Version bump only for package @patternfly/documentation-framework
168
+
169
+
170
+
171
+
172
+
173
+ # 2.0.0-alpha.57 (2023-06-12)
174
+
175
+ **Note:** Version bump only for package @patternfly/documentation-framework
176
+
177
+
178
+
179
+
180
+
181
+ # 2.0.0-alpha.56 (2023-06-12)
182
+
183
+
184
+ ### Features
185
+
186
+ * turn on dark switcher, remove extra css ([#3519](https://github.com/patternfly/patternfly-org/issues/3519)) ([0059891](https://github.com/patternfly/patternfly-org/commit/005989134d6a962189690a49faccb8dfc6e3de77))
187
+
188
+
189
+
190
+
191
+
192
+ # 2.0.0-alpha.55 (2023-06-12)
193
+
194
+
195
+ ### Bug Fixes
196
+
197
+ * **whitespace:** whitespace change to push out new release ([84d1bb3](https://github.com/patternfly/patternfly-org/commit/84d1bb3ccc79a9ef2c4cf5fb93b19fbb719b6078))
198
+
199
+
200
+
201
+
202
+
203
+ # 2.0.0-alpha.54 (2023-06-09)
204
+
205
+ **Note:** Version bump only for package @patternfly/documentation-framework
206
+
207
+
208
+
209
+
210
+
211
+ # 2.0.0-alpha.53 (2023-06-09)
212
+
213
+ **Note:** Version bump only for package @patternfly/documentation-framework
214
+
215
+
216
+
217
+
218
+
219
+ # 2.0.0-alpha.52 (2023-06-07)
220
+
221
+ **Note:** Version bump only for package @patternfly/documentation-framework
222
+
223
+
224
+
225
+
226
+
227
+ # 2.0.0-alpha.51 (2023-06-06)
228
+
229
+ **Note:** Version bump only for package @patternfly/documentation-framework
230
+
231
+
232
+
233
+
234
+
235
+ # 2.0.0-alpha.50 (2023-06-01)
236
+
237
+
238
+ ### Bug Fixes
239
+
240
+ * **labels:** Update label logic to include html components ([#3567](https://github.com/patternfly/patternfly-org/issues/3567)) ([32bdc0f](https://github.com/patternfly/patternfly-org/commit/32bdc0fe2120e2c86f39c1e5da94e3f2d11d9705))
241
+
242
+
243
+
244
+
245
+
246
+ # 2.0.0-alpha.49 (2023-06-01)
247
+
248
+ **Note:** Version bump only for package @patternfly/documentation-framework
249
+
250
+
251
+
252
+
253
+
254
+ # 2.0.0-alpha.48 (2023-05-31)
255
+
256
+ **Note:** Version bump only for package @patternfly/documentation-framework
257
+
258
+
259
+
260
+
261
+
262
+ # 2.0.0-alpha.47 (2023-05-31)
263
+
264
+
265
+ ### Bug Fixes
266
+
267
+ * **CSSVariables:** check for values before looping over them ([f2d167f](https://github.com/patternfly/patternfly-org/commit/f2d167f57c0cd38b289ade62d98022d7902de38f))
268
+
269
+
270
+
271
+
272
+
273
+ # 2.0.0-alpha.46 (2023-05-31)
274
+
275
+
276
+ ### Bug Fixes
277
+
278
+ * **CSSVariables:** resolve a11y issues in tables ([41a7837](https://github.com/patternfly/patternfly-org/commit/41a78379de36c08d7b36fe48a9ff40a4140cdc63))
279
+
280
+
281
+
282
+
283
+
284
+ # 2.0.0-alpha.45 (2023-05-25)
285
+
286
+ **Note:** Version bump only for package @patternfly/documentation-framework
287
+
288
+
289
+
290
+
291
+
292
+ # 2.0.0-alpha.44 (2023-05-25)
293
+
294
+ **Note:** Version bump only for package @patternfly/documentation-framework
295
+
296
+
297
+
298
+
299
+
300
+ # 2.0.0-alpha.43 (2023-05-25)
301
+
302
+
303
+ ### Features
304
+
305
+ * **labels:** add deprecated/demo/beta labels to headers + nav items ([#3547](https://github.com/patternfly/patternfly-org/issues/3547)) ([010a0e0](https://github.com/patternfly/patternfly-org/commit/010a0e05baea661964660d2a733569a34abbf243))
306
+
307
+
308
+
309
+
310
+
311
+ # 2.0.0-alpha.42 (2023-05-18)
312
+
313
+ **Note:** Version bump only for package @patternfly/documentation-framework
314
+
315
+
316
+
317
+
318
+
319
+ # 2.0.0-alpha.41 (2023-05-15)
320
+
321
+
322
+ ### Bug Fixes
323
+
324
+ * broken link in search-input summary ([7cbf968](https://github.com/patternfly/patternfly-org/commit/7cbf968c1b00aef2257ef8b7434c7ff8b9a4255a))
325
+
326
+
327
+
328
+
329
+
330
+ # 2.0.0-alpha.40 (2023-05-15)
331
+
332
+
333
+ ### Bug Fixes
334
+
335
+ * **docs:** use correct theme class on full page dark theme switcher ([#3532](https://github.com/patternfly/patternfly-org/issues/3532)) ([0008236](https://github.com/patternfly/patternfly-org/commit/0008236da2b105fd1789db2263323c59780b5194))
336
+
337
+
338
+
339
+
340
+
341
+ # 2.0.0-alpha.39 (2023-05-11)
342
+
343
+ **Note:** Version bump only for package @patternfly/documentation-framework
344
+
345
+
346
+
347
+
348
+
349
+ # 2.0.0-alpha.38 (2023-05-11)
350
+
351
+ **Note:** Version bump only for package @patternfly/documentation-framework
352
+
353
+
354
+
355
+
356
+
357
+ # 2.0.0-alpha.37 (2023-05-10)
358
+
359
+ **Note:** Version bump only for package @patternfly/documentation-framework
360
+
361
+
362
+
363
+
364
+
365
+ # 2.0.0-alpha.36 (2023-05-10)
366
+
367
+ **Note:** Version bump only for package @patternfly/documentation-framework
368
+
369
+
370
+
371
+
372
+
373
+ # 2.0.0-alpha.35 (2023-05-09)
374
+
375
+
376
+ ### Bug Fixes
377
+
378
+ * **org:** Fix up org css issues after doc framework update ([#3518](https://github.com/patternfly/patternfly-org/issues/3518)) ([a6f20c5](https://github.com/patternfly/patternfly-org/commit/a6f20c569a8ba8df2da23722c48f73f750e229e3))
379
+
380
+
381
+
382
+
383
+
384
+ # 2.0.0-alpha.34 (2023-05-05)
385
+
386
+
387
+ ### Features
388
+
389
+ * **docs:** Update docs framework with latest react code ([#3517](https://github.com/patternfly/patternfly-org/issues/3517)) ([2df0147](https://github.com/patternfly/patternfly-org/commit/2df014737dbbe35033d0b28ee71b40d5fbe22ed2))
390
+
391
+
392
+
393
+
394
+
395
+ # 2.0.0-alpha.33 (2023-05-04)
396
+
397
+
398
+ ### Bug Fixes
399
+
400
+ * **css:** update css selectors for v5 versioning ([#3516](https://github.com/patternfly/patternfly-org/issues/3516)) ([f681945](https://github.com/patternfly/patternfly-org/commit/f681945e2de1200fbb7d2d6ab8262091b1e72a8e))
401
+
402
+
403
+
404
+
405
+
406
+ # 2.0.0-alpha.32 (2023-05-02)
407
+
408
+ **Note:** Version bump only for package @patternfly/documentation-framework
409
+
410
+
411
+
412
+
413
+
414
+ # 2.0.0-alpha.31 (2023-05-01)
415
+
416
+
417
+ ### Bug Fixes
418
+
419
+ * update Text component summary to fix build ([64b3590](https://github.com/patternfly/patternfly-org/commit/64b359029fa14be143ddec212fdf89a3033145d5))
420
+
421
+
422
+
423
+
424
+
425
+ # 2.0.0-alpha.30 (2023-04-27)
426
+
427
+
428
+ ### Bug Fixes
429
+
430
+ * white space change to test CI ([e9e7ed3](https://github.com/patternfly/patternfly-org/commit/e9e7ed3cf6007fcf022dd7693bfed12bdf9d7e9a))
431
+
432
+
433
+
434
+
435
+
436
+ # 2.0.0-alpha.29 (2023-04-26)
437
+
438
+
439
+ ### Bug Fixes
440
+
441
+ * sidebar open by default ([#3506](https://github.com/patternfly/patternfly-org/issues/3506)) ([fb5f086](https://github.com/patternfly/patternfly-org/commit/fb5f08611d3edde80a559635b39dab7138f06d1d))
442
+
443
+
444
+
445
+
446
+
447
+ # 2.0.0-alpha.28 (2023-04-26)
448
+
449
+ **Note:** Version bump only for package @patternfly/documentation-framework
450
+
451
+
452
+
453
+
454
+
455
+ # 2.0.0-alpha.27 (2023-04-25)
456
+
457
+
458
+ ### Bug Fixes
459
+
460
+ * **docs:** Update static dir and fix null loading ([#3505](https://github.com/patternfly/patternfly-org/issues/3505)) ([e65a1b2](https://github.com/patternfly/patternfly-org/commit/e65a1b21ae7671322adcbcef1ada69436fd07802))
461
+
462
+
463
+
464
+
465
+
466
+ # 2.0.0-alpha.26 (2023-04-21)
467
+
468
+ **Note:** Version bump only for package @patternfly/documentation-framework
469
+
470
+
471
+
472
+
473
+
474
+ # 2.0.0-alpha.25 (2023-04-19)
475
+
476
+ **Note:** Version bump only for package @patternfly/documentation-framework
477
+
478
+
479
+
480
+
481
+
482
+ # 2.0.0-alpha.24 (2023-04-17)
483
+
484
+ **Note:** Version bump only for package @patternfly/documentation-framework
485
+
486
+
487
+
488
+
489
+
490
+ # 2.0.0-alpha.23 (2023-04-17)
491
+
492
+
493
+ ### Features
494
+
495
+ * **docs-framework:** add support for exposing function documentation ([#3485](https://github.com/patternfly/patternfly-org/issues/3485)) ([2f19ded](https://github.com/patternfly/patternfly-org/commit/2f19deda84c75042df1870c0950bb173eb2c3d84))
496
+
497
+
498
+
499
+
500
+
501
+ # 2.0.0-alpha.22 (2023-04-17)
502
+
503
+ **Note:** Version bump only for package @patternfly/documentation-framework
504
+
505
+
506
+
507
+
508
+
509
+ # 2.0.0-alpha.21 (2023-04-15)
510
+
511
+
512
+ ### Bug Fixes
513
+
514
+ * clean up references to katacoda ([#3491](https://github.com/patternfly/patternfly-org/issues/3491)) ([5de986b](https://github.com/patternfly/patternfly-org/commit/5de986b917ee7edf9c476bb2df2f2ee4d454a7e1))
515
+
516
+
517
+
518
+
519
+
520
+ # 2.0.0-alpha.20 (2023-04-14)
521
+
522
+ **Note:** Version bump only for package @patternfly/documentation-framework
523
+
524
+
525
+
526
+
527
+
528
+ # 2.0.0-alpha.19 (2023-04-12)
529
+
530
+ **Note:** Version bump only for package @patternfly/documentation-framework
531
+
532
+
533
+
534
+
535
+
536
+ # 2.0.0-alpha.18 (2023-04-11)
537
+
538
+
539
+ ### Bug Fixes
540
+
541
+ * **cssVariables:** Update expandId ([b9b0a6e](https://github.com/patternfly/patternfly-org/commit/b9b0a6edcc103c442f24caae086b68558415be57))
542
+
543
+
544
+
545
+
546
+
547
+ # 2.0.0-alpha.17 (2023-04-11)
548
+
549
+
550
+ ### Bug Fixes
551
+
552
+ * **docs:** fixes display & search bugs on icons page ([#3483](https://github.com/patternfly/patternfly-org/issues/3483)) ([39b225c](https://github.com/patternfly/patternfly-org/commit/39b225cdcbdc4c01c5002750600708eab6427f60))
553
+
554
+
555
+
556
+
557
+
558
+ # 2.0.0-alpha.16 (2023-04-11)
559
+
560
+
561
+ ### Features
562
+
563
+ * **tables:** update tables, context selector ([#3474](https://github.com/patternfly/patternfly-org/issues/3474)) ([cd82c35](https://github.com/patternfly/patternfly-org/commit/cd82c356f568f3368bc22319d614fde8dd74fb38))
564
+
565
+
566
+
567
+
568
+
569
+ # 2.0.0-alpha.15 (2023-04-06)
570
+
571
+ **Note:** Version bump only for package @patternfly/documentation-framework
572
+
573
+
574
+
575
+
576
+
577
+ # 2.0.0-alpha.14 (2023-04-03)
578
+
579
+
580
+ ### Bug Fixes
581
+
582
+ * **Tables:** temporarily comment out tables so Table can be deprecated ([#3468](https://github.com/patternfly/patternfly-org/issues/3468)) ([f4aa5ed](https://github.com/patternfly/patternfly-org/commit/f4aa5ed791161851cdc92d02d0c752eef4028306))
583
+
584
+
585
+
586
+
587
+
588
+ # 2.0.0-alpha.13 (2023-03-31)
589
+
590
+ **Note:** Version bump only for package @patternfly/documentation-framework
591
+
592
+
593
+
594
+
595
+
596
+ # 2.0.0-alpha.12 (2023-03-30)
597
+
598
+ **Note:** Version bump only for package @patternfly/documentation-framework
599
+
600
+
601
+
602
+
603
+
604
+ # 2.0.0-alpha.11 (2023-03-29)
605
+
606
+ **Note:** Version bump only for package @patternfly/documentation-framework
607
+
608
+
609
+
610
+
611
+
612
+ # 2.0.0-alpha.10 (2023-03-15)
613
+
614
+ **Note:** Version bump only for package @patternfly/documentation-framework
615
+
616
+
617
+
618
+
619
+
6
620
  # 2.0.0-alpha.9 (2023-03-09)
7
621
 
8
622
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @patternfly/documentation-framework
2
2
 
3
- ## The PatternFly documentation framework lets you develop component examples in markdown format, so that they can be added to [patternfly.org](https://www.patternfly.org/v4/).
3
+ ## The PatternFly documentation framework lets you develop component examples in markdown format, so that they can be added to [patternfly.org](https://www.patternfly.org/).
4
4
 
5
5
  ## Install
6
6
 
package/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import ReactDOM from 'react-dom';
2
+ import { createRoot, hydrateRoot } from 'react-dom/client';
3
3
  import { Router, useLocation } from '@reach/router';
4
4
  import 'client-styles'; // Webpack replaces this import: patternfly-docs.css.js
5
5
  import { SideNavLayout } from '@patternfly/documentation-framework/layouts';
@@ -13,17 +13,23 @@ import './components/tableOfContents/tableOfContents.css';
13
13
  import './components/example/example.css';
14
14
  import './components/footer/footer.css';
15
15
  import './components/sideNav/sideNav.css';
16
- import './components/topNav/topNav.css';
17
16
  import './layouts/sideNavLayout/sideNavLayout.css';
18
17
 
19
- const AppRoute = ({ child, katacodaLayout, title, path }) => {
18
+ const AppRoute = ({ child, title, path }) => {
20
19
  const pathname = useLocation().pathname;
21
20
  if (typeof window !== 'undefined' && window.gtag) {
22
- gtag('config', 'UA-47523816-6', {
21
+ gtag('config', process.env.googleAnalyticsID, {
23
22
  'page_path': pathname,
24
23
  'page_title': (title || pathname)
25
24
  });
26
25
  }
26
+
27
+ // Redirect all v4 url paths to the archived v4 site
28
+ if(pathname.startsWith("/v4")){
29
+ window.location.href = `https://v4-archive.patternfly.org${pathname}`;
30
+ return;
31
+ }
32
+
27
33
  // Send 404 event if redirected to 404 page
28
34
  if (path === '/404' && pathname.split('/').pop() !== '404') {
29
35
  trackEvent('404_redirect', 'redirect', pathname);
@@ -31,26 +37,23 @@ const AppRoute = ({ child, katacodaLayout, title, path }) => {
31
37
  return (
32
38
  <React.Fragment>
33
39
  {child}
34
- {!katacodaLayout && process.env.hasFooter && <Footer />}
40
+ {process.env.hasFooter && <Footer />}
35
41
  </React.Fragment>
36
42
  );
37
43
  }
38
44
 
39
45
  const SideNavRouter = () => {
40
- const pathname = useLocation().pathname.replace(process.env.pathPrefix, '');
41
46
  const componentsData = process?.env?.componentsData;
42
- const navOpen = !routes[pathname] || !routes[pathname].katacodaLayout;
43
47
  return (
44
- <SideNavLayout groupedRoutes={groupedRoutes} navOpen={navOpen} >
48
+ <SideNavLayout groupedRoutes={groupedRoutes} navOpen={true} >
45
49
  <Router id="ws-page-content-router">
46
50
  {Object.entries(routes)
47
- .map(([path, { Component, title, sources, katacodaLayout, id }]) => Component
51
+ .map(([path, { Component, title, sources, id }]) => Component
48
52
  ? <AppRoute
49
53
  key={path}
50
54
  path={path}
51
55
  default={path === '/404'}
52
56
  child={<Component />}
53
- katacodaLayout={katacodaLayout}
54
57
  title={title}
55
58
  />
56
59
  : <AppRoute
@@ -65,7 +68,6 @@ const SideNavRouter = () => {
65
68
  componentsData={componentsData}
66
69
  />
67
70
  }
68
- katacodaLayout={katacodaLayout}
69
71
  title={title}
70
72
  />
71
73
  )
@@ -87,7 +89,7 @@ const FullscreenComponent = ({ Component, title }) => {
87
89
 
88
90
  // Export for SSR
89
91
  export const App = () => (
90
- <Router basepath={process.env.pathPrefix} id="ws-router">
92
+ <Router id="ws-router">
91
93
  <SideNavRouter path="/*" />
92
94
  {Object.entries(fullscreenRoutes)
93
95
  .map(([path, { title, Component }]) =>
@@ -107,8 +109,12 @@ const isPrerender = process.env.PRERENDER;
107
109
  // Don't use ReactDOM in SSR
108
110
  if (!isPrerender) {
109
111
  function render() {
110
- const renderFn = isProd ? ReactDOM.hydrate : ReactDOM.render;
111
- renderFn(<App />, document.getElementById('root'));
112
+ const container = document.getElementById('root');
113
+ if (isProd) {
114
+ hydrateRoot(container, <App />);
115
+ } else {
116
+ createRoot(container).render(<App />);
117
+ }
112
118
  }
113
119
  // On first load, await promise for the current page to avoid flashing a "Loading..." state
114
120
  const Component = getAsyncComponent(null);
Binary file
Binary file