@gouvfr/dsfr-roller 1.0.25 → 1.0.27
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/package.json +2 -2
- package/src/component/components/button.js +7 -5
- package/src/component/components/edit.js +20 -0
- package/src/component/components/header.js +2 -2
- package/src/component/components/sidemenu.js +60 -3
- package/src/component/components/skiplink.js +1 -1
- package/src/component/ejs/edit/edit.ejs +32 -0
- package/src/component/ejs/version/version.ejs +2 -4
- package/src/core/format-link.js +6 -0
- package/src/node/directive/components/accordion/accordions-group-container-directive.js +1 -0
- package/src/node/directive/components/button/button-leaf-directive.js +1 -1
- package/src/node/directive/components/card/card-container-directive.js +5 -2
- package/src/node/directive/components/table/table-container-directive.js +1 -1
- package/src/node/directive/components/tile/tile-container-directive.js +2 -2
- package/src/node/directive/core/grid-container-directive.js +1 -0
- package/src/node/directive/doc/guidance/guideline-container-directive.js +2 -2
- package/src/node/directive/doc/guidance/pin-leaf-directive.js +2 -2
- package/src/node/directive/doc/page-item-card-container-directive.js +1 -1
- package/src/node/directive/doc/storybook-leaf-directive.js +1 -1
- package/src/node/directive/doc/tab-navigation-container-directive.js +25 -30
- package/src/node/directive/doc/video-leaf-directive.js +0 -2
- package/src/node/directive/home/hp-analytics-container-directive.js +3 -2
- package/src/node/directive/home/hp-community-container-directive.js +7 -2
- package/src/node/directive/home/hp-community-tile-container-directive.js +2 -1
- package/src/node/directive/home/hp-discover-tile-container-directive.js +4 -1
- package/src/node/directive/home/hp-hero-container-directive.js +4 -4
- package/src/node/directive/home/hp-showcase-card-container-directive.js +1 -1
- package/src/node/directive/home/hp-showcase-container-directive.js +1 -1
- package/src/node/directive/home/hp-slice-video-container-directive.js +11 -3
- package/src/node/generic/blockquote-node.js +1 -0
- package/src/node/generic/code-node.js +1 -1
- package/src/page/body/custom-header.js +8 -2
- package/src/page/body/toc.js +1 -1
- package/src/script/home/inject-svg.js +1 -2
- package/src/script/main/cmp/tarteaucitron/services.js +1 -1
- package/src/script/main/cmp/tarteaucitron/tarteaucitron.js +7 -7
- package/src/script/main/elements/pagination/pagination-list.js +89 -113
- package/src/script/main/elements/search-bar/index.js +15 -5
- package/src/script/main/elements/search-bar/results/results-button.js +1 -1
- package/src/script/main/elements/search-bar/results/results-dropdown.js +1 -0
- package/src/script/main/elements/storybook.js +1 -4
- package/src/script/search/elements/search-page.js +1 -0
- package/src/style/home/_community.scss +22 -19
- package/src/style/home/_showcase.scss +3 -0
- package/src/style/main/components/_dsfr-doc-code-snippet.scss +3 -2
- package/src/style/main/components/_dsfr-doc-edit.scss +34 -0
- package/src/style/main/components/_dsfr-doc-tab-navigation.scss +3 -3
- package/src/style/main/components/_dsfr-doc-version.scss +4 -3
- package/src/style/main/components/_index.scss +1 -0
- package/src/style/main/utility/_global.scss +64 -0
- package/src/style/main/utility/_index.scss +1 -0
- package/src/template/templates/editorial-template.js +8 -2
- package/src/template/templates/search-template.js +1 -1
|
@@ -14,10 +14,16 @@ class CustomHeader extends Renderable {
|
|
|
14
14
|
}
|
|
15
15
|
async render () {
|
|
16
16
|
let toolsContent = await this._version.render({ id: 'version', collapseId: 'version-collapse' });
|
|
17
|
-
if (this._translate)
|
|
17
|
+
if (this._translate) {
|
|
18
|
+
const translate = await this._translate.render({ id: 'translate', collapseId: 'translate-collapse' });
|
|
19
|
+
toolsContent += translate.replace('<nav', '<div').replace('</nav>', '</div>').replace('role="navigation" ', '');
|
|
20
|
+
}
|
|
18
21
|
|
|
19
22
|
let menuContent = await this._version.render({ id: 'version-menu', collapseId: 'version-collapse-menu' });
|
|
20
|
-
if (this._translate)
|
|
23
|
+
if (this._translate) {
|
|
24
|
+
const translate = await this._translate.render({ id: 'translate-menu', collapseId: 'translate-collapse-menu' });
|
|
25
|
+
menuContent += translate.replace('<nav', '<div').replace('</nav>', '</div>').replace('role="navigation" ', '');
|
|
26
|
+
}
|
|
21
27
|
|
|
22
28
|
const navigation = await this._navigation.format();
|
|
23
29
|
|
package/src/page/body/toc.js
CHANGED
|
@@ -85,7 +85,7 @@ class TOC extends Renderable {
|
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const summary = new Summary({ list: mainList });
|
|
88
|
+
const summary = new Summary({ title: this.data?.fragments?.summary?.title, list: mainList });
|
|
89
89
|
|
|
90
90
|
return `<div class="fr-mb-6v" >
|
|
91
91
|
${await summary.render()}
|
|
@@ -18,11 +18,10 @@ class InjectSvg extends Element {
|
|
|
18
18
|
const svgElement = svgDocument.querySelector('svg');
|
|
19
19
|
if (this._class) svgElement.setAttribute('class', this._class);
|
|
20
20
|
if (this._ariaHidden !== null) svgElement.setAttribute('aria-hidden', this._ariaHidden);
|
|
21
|
-
if (this._alt) svgElement.setAttribute('aria-label', this._alt);
|
|
22
21
|
this._element.parentNode.insertBefore(svgElement, this._element);
|
|
23
22
|
this._element.remove();
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
export { InjectSvg };
|
|
27
|
+
export { InjectSvg };
|
|
@@ -6301,7 +6301,7 @@ export const vimeo = {
|
|
|
6301
6301
|
'use strict';
|
|
6302
6302
|
tarteaucitron.fallback(['vimeo_player'], function (x) {
|
|
6303
6303
|
var frame_title =
|
|
6304
|
-
tarteaucitron.getElemAttr(x, 'title') || 'Vimeo
|
|
6304
|
+
tarteaucitron.getElemAttr(x, 'title') || 'Vimeo',
|
|
6305
6305
|
video_width = tarteaucitron.getElemAttr(x, 'width'),
|
|
6306
6306
|
frame_width = 'width=',
|
|
6307
6307
|
video_height = tarteaucitron.getElemAttr(x, 'height'),
|
|
@@ -436,9 +436,9 @@ export var tarteaucitron = {
|
|
|
436
436
|
</button>
|
|
437
437
|
</div>
|
|
438
438
|
<div class="fr-modal__content">
|
|
439
|
-
<
|
|
439
|
+
<h2 class="fr-modal__title fr-h3" id="fr-consent-modal-title">
|
|
440
440
|
${tarteaucitron.lang.title}
|
|
441
|
-
</
|
|
441
|
+
</h2>
|
|
442
442
|
<div class="fr-consent-manager">
|
|
443
443
|
<div class="fr-consent-service fr-consent-manager__header">
|
|
444
444
|
<fieldset class="fr-fieldset fr-fieldset--inline">
|
|
@@ -447,7 +447,7 @@ export var tarteaucitron = {
|
|
|
447
447
|
tarteaucitron
|
|
448
448
|
.lang
|
|
449
449
|
.disclaimer
|
|
450
|
-
?
|
|
450
|
+
? `${tarteaucitron.lang.disclaimer} `
|
|
451
451
|
: ''
|
|
452
452
|
}
|
|
453
453
|
${
|
|
@@ -455,7 +455,7 @@ export var tarteaucitron = {
|
|
|
455
455
|
.parameters
|
|
456
456
|
.privacyUrl !==
|
|
457
457
|
''
|
|
458
|
-
? `<a class="fr-link" id="tarteaucitronPrivacyUrlDialog" href="${tarteaucitron.parameters.privacyUrl}" title="${tarteaucitron.lang.privacyUrl}
|
|
458
|
+
? `<a class="fr-link" id="tarteaucitronPrivacyUrlDialog" href="${tarteaucitron.parameters.privacyUrl}" title="${tarteaucitron.lang.privacyUrl}">${tarteaucitron.lang.privacyUrl}</a>`
|
|
459
459
|
: ''
|
|
460
460
|
}
|
|
461
461
|
${
|
|
@@ -666,14 +666,14 @@ export var tarteaucitron = {
|
|
|
666
666
|
!tarteaucitron.parameters.AcceptAllCta
|
|
667
667
|
) {
|
|
668
668
|
html += `<div tabindex="-1" id="tarteaucitronAlertBig" class="fr-consent-banner" ${modalAttrs}>`;
|
|
669
|
-
html += `<
|
|
669
|
+
html += `<h2 class="fr-h6">${tarteaucitron.lang.alertBigPrivacy.title}</h2>`;
|
|
670
670
|
html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${tarteaucitron.lang.alertBigPrivacy.content}</p></div>`;
|
|
671
671
|
html += `<ul class="fr-consent-banner__buttons fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-sm">`;
|
|
672
672
|
html += `<li><button class="fr-btn fr-btn--secondary" data-fr-opened="false" aria-controls="consent-modal" aria-label="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}" title="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}" type="button" id="tarteaucitronPersonalize">${tarteaucitron.lang.personalize}</button></li>`;
|
|
673
673
|
html += '</ul></div>';
|
|
674
674
|
} else {
|
|
675
675
|
html += `<div tabindex="-1" id="tarteaucitronAlertBig" class="fr-consent-banner" ${modalAttrs}>`;
|
|
676
|
-
html += `<
|
|
676
|
+
html += `<h2 class="fr-h6">${tarteaucitron.lang.alertBigPrivacy.title}</h2>`;
|
|
677
677
|
html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${
|
|
678
678
|
tarteaucitron.parameters.highPrivacy
|
|
679
679
|
? tarteaucitron.lang.alertBigPrivacy.content
|
|
@@ -925,7 +925,7 @@ export var tarteaucitron = {
|
|
|
925
925
|
// The setimeout at 1500 ms will prevent the location.reload event to be properly binded...
|
|
926
926
|
if (tarteaucitronNoAdBlocker === false) {
|
|
927
927
|
html = `<div id="tarteaucitronAlertBig" class="fr-consent-banner tarteaucitronAlertBig tarteaucitron-display-block" role="alert" aria-live="polite">`;
|
|
928
|
-
html += `<
|
|
928
|
+
html += `<h2 class="fr-h6">${tarteaucitron.lang.adblock}</h2>`;
|
|
929
929
|
html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${tarteaucitron.lang.adblock_call}</p></div>`;
|
|
930
930
|
html += `<ul class="fr-consent-banner__buttons fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-sm">`;
|
|
931
931
|
html += `<li><button class="fr-btn tarteaucitronCTAButton" aria-label="${tarteaucitron.lang.reload}" title="${tarteaucitron.lang.reload}" type="button" id="tarteaucitronCTAButton">${tarteaucitron.lang.reload}</button></li>`;
|
|
@@ -1,131 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PaginationItem,
|
|
3
|
-
PaginationItemTypes,
|
|
4
|
-
PaginationItemPositions,
|
|
5
|
-
} from './pagination-item.js';
|
|
1
|
+
import { PaginationItem, PaginationItemTypes, PaginationItemPositions } from './pagination-item.js';
|
|
6
2
|
import { getCurrentPagination } from '../../core/get-query.js';
|
|
7
3
|
|
|
8
4
|
class PaginationList {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
constructor (pagesNumber) {
|
|
6
|
+
this._currentPage = getCurrentPagination() || 1;
|
|
7
|
+
this._totalPages = pagesNumber;
|
|
8
|
+
this._items = [];
|
|
9
|
+
this.init();
|
|
10
|
+
}
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
12
|
+
getPosition () {
|
|
13
|
+
switch (true) {
|
|
14
|
+
case this._currentPage === 1:
|
|
15
|
+
return PaginationItemPositions.FIRST;
|
|
16
|
+
case this._currentPage === this._totalPages:
|
|
17
|
+
return PaginationItemPositions.LAST;
|
|
18
|
+
default:
|
|
19
|
+
return null;
|
|
25
20
|
}
|
|
21
|
+
}
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this._items.push(
|
|
30
|
-
new PaginationItem(
|
|
31
|
-
PaginationItemTypes.FIRST,
|
|
32
|
-
1,
|
|
33
|
-
this._currentPage === 1,
|
|
34
|
-
position
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
this._items.push(
|
|
38
|
-
new PaginationItem(
|
|
39
|
-
PaginationItemTypes.PREV,
|
|
40
|
-
Math.max(this._currentPage - 1, 1),
|
|
41
|
-
this._currentPage === 1,
|
|
42
|
-
position
|
|
43
|
-
)
|
|
44
|
-
);
|
|
23
|
+
init () {
|
|
24
|
+
this.setPageTitle();
|
|
45
25
|
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
const position = this.getPosition();
|
|
27
|
+
this._items.push(new PaginationItem(PaginationItemTypes.FIRST, 1, this._currentPage === 1, position));
|
|
28
|
+
this._items.push(new PaginationItem(PaginationItemTypes.PREV, Math.max(this._currentPage - 1, 1), this._currentPage === 1, position));
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
this._items.push(
|
|
51
|
-
new PaginationItem(
|
|
52
|
-
page.type,
|
|
53
|
-
page.index,
|
|
54
|
-
this._currentPage === page.index
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
}
|
|
30
|
+
const pages = this._totalPages <= 5 ? this.getAllPages() : this.getDynamicPages();
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
PaginationItemTypes.NEXT,
|
|
62
|
-
Math.min(this._currentPage + 1, this._totalPages),
|
|
63
|
-
this._currentPage === this._totalPages,
|
|
64
|
-
position
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
this._items.push(
|
|
68
|
-
new PaginationItem(
|
|
69
|
-
PaginationItemTypes.LAST,
|
|
70
|
-
this._totalPages,
|
|
71
|
-
this._currentPage === this._totalPages,
|
|
72
|
-
position
|
|
73
|
-
)
|
|
74
|
-
);
|
|
32
|
+
for (const page of pages) {
|
|
33
|
+
this._items.push(new PaginationItem(page.type, page.index, this._currentPage === page.index));
|
|
75
34
|
}
|
|
76
35
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
36
|
+
this._items.push(
|
|
37
|
+
new PaginationItem(
|
|
38
|
+
PaginationItemTypes.NEXT,
|
|
39
|
+
Math.min(this._currentPage + 1, this._totalPages),
|
|
40
|
+
this._currentPage === this._totalPages,
|
|
41
|
+
position
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
this._items.push(new PaginationItem(PaginationItemTypes.LAST, this._totalPages, this._currentPage === this._totalPages, position));
|
|
45
|
+
}
|
|
85
46
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
47
|
+
getAllPages () {
|
|
48
|
+
return [
|
|
49
|
+
...Array.from({ length: this._totalPages }, (_, i) => ({
|
|
50
|
+
type: PaginationItemTypes.PAGE,
|
|
51
|
+
index: i + 1,
|
|
52
|
+
})),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getDynamicPages () {
|
|
57
|
+
const ellipsis = { type: PaginationItemTypes.ELLIPSIS };
|
|
58
|
+
if (this._currentPage <= 3) {
|
|
59
|
+
return [
|
|
60
|
+
...Array.from({ length: 3 }, (_, i) => ({
|
|
61
|
+
type: PaginationItemTypes.PAGE,
|
|
62
|
+
index: i + 1,
|
|
63
|
+
})),
|
|
64
|
+
ellipsis,
|
|
65
|
+
{ type: PaginationItemTypes.PAGE, index: this._totalPages },
|
|
66
|
+
];
|
|
67
|
+
} else if (this._currentPage >= this._totalPages - 2) {
|
|
68
|
+
return [
|
|
69
|
+
{ type: PaginationItemTypes.PAGE, index: 1 },
|
|
70
|
+
ellipsis,
|
|
71
|
+
{ type: PaginationItemTypes.PAGE, index: this._totalPages - 2 },
|
|
72
|
+
{ type: PaginationItemTypes.PAGE, index: this._totalPages - 1 },
|
|
73
|
+
{ type: PaginationItemTypes.PAGE, index: this._totalPages },
|
|
74
|
+
];
|
|
75
|
+
} else {
|
|
76
|
+
return [
|
|
77
|
+
{ type: PaginationItemTypes.PAGE, index: 1 },
|
|
78
|
+
ellipsis,
|
|
79
|
+
{
|
|
80
|
+
type: PaginationItemTypes.PAGE,
|
|
81
|
+
index: this._currentPage - 1,
|
|
82
|
+
},
|
|
83
|
+
{ type: PaginationItemTypes.PAGE, index: this._currentPage },
|
|
84
|
+
{
|
|
85
|
+
type: PaginationItemTypes.PAGE,
|
|
86
|
+
index: this._currentPage + 1,
|
|
87
|
+
},
|
|
88
|
+
ellipsis,
|
|
89
|
+
{ type: PaginationItemTypes.PAGE, index: this._totalPages },
|
|
90
|
+
];
|
|
122
91
|
}
|
|
92
|
+
}
|
|
123
93
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</ul>`;
|
|
94
|
+
setPageTitle () {
|
|
95
|
+
if (this._totalPages > 0) {
|
|
96
|
+
document.title = `${document.title} - ${window.resource.pagination.page} ${this._currentPage} ${window.resource.pagination.on} ${this._totalPages}`;
|
|
128
97
|
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
render () {
|
|
101
|
+
return `<ul class="fr-pagination__list">
|
|
102
|
+
${this._items.map(item => item.render()).join('')}
|
|
103
|
+
</ul>`;
|
|
104
|
+
}
|
|
129
105
|
}
|
|
130
106
|
|
|
131
107
|
export { PaginationList };
|
|
@@ -7,17 +7,21 @@ class SearchBar extends Element {
|
|
|
7
7
|
this._searchInput = this.element.querySelector('#search-input');
|
|
8
8
|
this._searchButton = this.element.querySelector('#search-button');
|
|
9
9
|
this._query = this._searchInput.value;
|
|
10
|
+
this._url = this._searchButton.getAttribute('data-href');
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
async init () {
|
|
13
|
-
this._url = this._searchButton.getAttribute('data-href');
|
|
14
|
-
|
|
15
14
|
this._resultsDropdown = new ResultsDropdown(this._url);
|
|
16
|
-
this.
|
|
15
|
+
this._searchInput.after(this._resultsDropdown.element);
|
|
17
16
|
await this._resultsDropdown.init();
|
|
18
17
|
|
|
19
18
|
document.addEventListener('click', this.handleDocumentClick.bind(this));
|
|
20
19
|
|
|
20
|
+
this._searchButton.addEventListener(
|
|
21
|
+
'click',
|
|
22
|
+
this.handleButtonClick.bind(this)
|
|
23
|
+
);
|
|
24
|
+
|
|
21
25
|
this._searchInput.addEventListener(
|
|
22
26
|
'focus',
|
|
23
27
|
this.handleInputFocus.bind(this)
|
|
@@ -37,10 +41,14 @@ class SearchBar extends Element {
|
|
|
37
41
|
|
|
38
42
|
update (query) {
|
|
39
43
|
this._query = query;
|
|
40
|
-
this._searchButton.setAttribute('href', `${this._url}?query=${query}`);
|
|
41
44
|
this._resultsDropdown.update(query);
|
|
42
45
|
}
|
|
43
46
|
|
|
47
|
+
handleButtonClick (event) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
document.location.href = `${this._url}?query=${this._query}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
handleDocumentClick (event) {
|
|
45
53
|
const outsideClick = !this.element.contains(event.target);
|
|
46
54
|
if (outsideClick) {
|
|
@@ -50,7 +58,9 @@ class SearchBar extends Element {
|
|
|
50
58
|
|
|
51
59
|
handleKeyup (event) {
|
|
52
60
|
if (event.key === 'Enter') {
|
|
53
|
-
|
|
61
|
+
this.handleButtonClick(event);
|
|
62
|
+
} else if (event.key === 'Escape') {
|
|
63
|
+
this._resultsDropdown.reset();
|
|
54
64
|
} else {
|
|
55
65
|
this.update(event.target.value);
|
|
56
66
|
}
|
|
@@ -13,7 +13,7 @@ class ResultsButton {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
render () {
|
|
16
|
-
return `<
|
|
16
|
+
return `<button id="results-dropdown-button" class="fr-btn fr-btn--secondary fr-mt-2v" onclick="document.location.href='${this._url}?query=${this._query}';">${window.resource?.search?.results?.button}</button>`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -7,6 +7,7 @@ class ResultsDropdown extends Element {
|
|
|
7
7
|
constructor(url) {
|
|
8
8
|
const element = document.createElement('div');
|
|
9
9
|
element.classList.add('dsfr-doc-search-results--dropdown');
|
|
10
|
+
element.setAttribute('aria-live', 'polite');
|
|
10
11
|
super(element);
|
|
11
12
|
|
|
12
13
|
this._button = new ResultsButton(url);
|
|
@@ -6,7 +6,6 @@ class Storybook extends Element {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
init() {
|
|
9
|
-
this.isResized = false;
|
|
10
9
|
this.setIframeTheme();
|
|
11
10
|
this.listenChangeDisplay();
|
|
12
11
|
window.addEventListener('message', this.handleMessage.bind(this));
|
|
@@ -18,10 +17,8 @@ class Storybook extends Element {
|
|
|
18
17
|
|
|
19
18
|
if (eventType === 'storyRendered') {
|
|
20
19
|
this._iframeDoc = this.iframe.contentDocument;
|
|
21
|
-
if (!this._iframeDoc
|
|
22
|
-
|
|
20
|
+
if (!this._iframeDoc) return;
|
|
23
21
|
this.resize();
|
|
24
|
-
this.isResized = true;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -28,6 +28,7 @@ class SearchPage extends Element {
|
|
|
28
28
|
const resultsList = new ResultsList(results, RESULTS_PER_PAGES);
|
|
29
29
|
|
|
30
30
|
this._resultsCount.innerHTML = count.render();
|
|
31
|
+
document.title = `${document.title} - ${count.render()}`;
|
|
31
32
|
|
|
32
33
|
this._container.appendChild(resultsList.element);
|
|
33
34
|
resultsList.init();
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
.dsfr-doc-hp-community {
|
|
2
2
|
padding: 2rem 0 3.25rem;
|
|
3
3
|
|
|
4
|
-
&
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: flex-start;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__img {
|
|
11
|
-
margin-bottom: 2rem;
|
|
12
|
-
width: 100%;
|
|
13
|
-
|
|
4
|
+
&[dsfr-doc-in-view='true'] {
|
|
14
5
|
img,
|
|
15
6
|
svg {
|
|
16
|
-
display: flex;
|
|
17
|
-
border: 1px solid var(--border-default-grey);
|
|
18
|
-
|
|
19
7
|
#cursor-1 {
|
|
20
|
-
animation: cursor1 3.2s ease-out
|
|
8
|
+
animation: cursor1 3.2s ease-out 1;
|
|
21
9
|
}
|
|
22
10
|
|
|
23
11
|
#cursor-2 {
|
|
24
|
-
animation: cursor2 3.2s ease-out
|
|
12
|
+
animation: cursor2 3.2s ease-out 1;
|
|
25
13
|
}
|
|
26
14
|
|
|
27
15
|
#cursor-3 {
|
|
28
|
-
animation: cursor3 3.2s ease-out
|
|
16
|
+
animation: cursor3 3.2s ease-out 1;
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -36,6 +24,23 @@
|
|
|
36
24
|
}
|
|
37
25
|
}
|
|
38
26
|
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__container {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__img {
|
|
36
|
+
margin-bottom: 2rem;
|
|
37
|
+
width: 100%;
|
|
38
|
+
|
|
39
|
+
img,
|
|
40
|
+
svg {
|
|
41
|
+
display: flex;
|
|
42
|
+
border: 1px solid var(--border-default-grey);
|
|
43
|
+
}
|
|
39
44
|
|
|
40
45
|
&--dark {
|
|
41
46
|
display: none;
|
|
@@ -174,7 +179,6 @@
|
|
|
174
179
|
}
|
|
175
180
|
}
|
|
176
181
|
|
|
177
|
-
|
|
178
182
|
@keyframes cursor3 {
|
|
179
183
|
0% {
|
|
180
184
|
transform: translate(50, 106);
|
|
@@ -211,7 +215,6 @@
|
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
217
|
|
|
214
|
-
|
|
215
218
|
[data-fr-theme='dark'] {
|
|
216
219
|
.dsfr-doc-hp-community .dsfr-doc-hp-community__img--dark {
|
|
217
220
|
display: block;
|
|
@@ -220,4 +223,4 @@
|
|
|
220
223
|
.dsfr-doc-hp-community .dsfr-doc-hp-community__img--light {
|
|
221
224
|
display: none;
|
|
222
225
|
}
|
|
223
|
-
}
|
|
226
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.dsfr-doc-edit {
|
|
2
|
+
margin-top: 2rem;
|
|
3
|
+
margin-bottom: 3rem;
|
|
4
|
+
margin-right: -1rem;
|
|
5
|
+
margin-left: -1rem;
|
|
6
|
+
padding: 2rem 1.5rem 1.25rem 3.375rem;
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
&::before {
|
|
10
|
+
--icon-size: 1.125rem;
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 2.25rem;
|
|
13
|
+
left: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__title,
|
|
17
|
+
&__description,
|
|
18
|
+
&__link {
|
|
19
|
+
margin-bottom: 0.75rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (min-width: 36em) {
|
|
23
|
+
margin-right: 0;
|
|
24
|
+
margin-left: 0;
|
|
25
|
+
padding: 2.5rem 2rem 1.75rem 3.875rem;
|
|
26
|
+
|
|
27
|
+
&::before {
|
|
28
|
+
--icon-size: 1.25rem;
|
|
29
|
+
top: 2.75rem;
|
|
30
|
+
left: 2rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
background-size: 100% 1px;
|
|
31
31
|
background-position: 0 100%;
|
|
32
32
|
|
|
33
|
-
&[aria-
|
|
33
|
+
&[aria-current='page'] {
|
|
34
34
|
display: none;
|
|
35
35
|
color: var(--text-active-blue-france);
|
|
36
36
|
}
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
background-size: 100% 2px;
|
|
72
72
|
background-position: 0 100%;
|
|
73
73
|
|
|
74
|
-
&:hover:not([aria-
|
|
74
|
+
&:hover:not([aria-current='page']) {
|
|
75
75
|
background-color: var(
|
|
76
76
|
--background-default-grey-hover
|
|
77
77
|
) !important;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
background-position: 0 100%;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
&[aria-
|
|
87
|
+
&[aria-current='page'] {
|
|
88
88
|
display: block;
|
|
89
89
|
background-image: linear-gradient(
|
|
90
90
|
0deg,
|
|
@@ -68,9 +68,10 @@
|
|
|
68
68
|
white-space: nowrap;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
// Hide the current version in the mobile menu while there is only one version available
|
|
72
|
+
// .dsfr-doc-version__version[aria-current]:not([aria-current=false]) {
|
|
73
|
+
// display: none;
|
|
74
|
+
// }
|
|
74
75
|
|
|
75
76
|
.dsfr-doc-version__menu {
|
|
76
77
|
margin: 0;
|