@gouvfr/dsfr-roller 1.0.25 → 1.0.26
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 +5 -5
- package/src/node/directive/components/card/card-container-directive.js +2 -2
- package/src/node/directive/components/tile/tile-container-directive.js +2 -2
- package/src/node/directive/doc/guidance/guideline-container-directive.js +1 -1
- package/src/node/directive/doc/guidance/pin-leaf-directive.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gouvfr/dsfr-roller",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Le module `dsfr-roller` permet de publier le site de documentation du Système de Design de l’État - DSFR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Système de Design de l'État",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
],
|
|
57
57
|
"main": "./index.js",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@gouvfr/dsfr-forge": "=1.0.
|
|
59
|
+
"@gouvfr/dsfr-forge": "=1.0.26",
|
|
60
60
|
"@gouvfr/dsfr-publisher": "npm:@gouvfr/dsfr@1.13.1",
|
|
61
61
|
"deepmerge": "^4.3.1",
|
|
62
62
|
"ejs": "^3.1.10",
|
|
@@ -13,7 +13,7 @@ class Button extends Component {
|
|
|
13
13
|
async format () {
|
|
14
14
|
const index = [, , 'secondary', 'tertiary', 'tertiary-no-outline'].indexOf(this.data.kind);
|
|
15
15
|
const url = this.data.url ?? this.data.href;
|
|
16
|
-
const blank = this.data.blank
|
|
16
|
+
const blank = Boolean(this.data.blank) || /^(http|www)/.test(url);
|
|
17
17
|
return {
|
|
18
18
|
markup: url ? 'a' : this.data.markup,
|
|
19
19
|
kind: index > -1 ? index : parseInt(this.data.kind),
|
|
@@ -24,10 +24,10 @@ class Button extends Component {
|
|
|
24
24
|
href: url,
|
|
25
25
|
type: this.data.type,
|
|
26
26
|
blank,
|
|
27
|
-
self: !blank || this.data.self
|
|
28
|
-
disabled: this.data.disabled
|
|
29
|
-
classes:
|
|
30
|
-
attributes:
|
|
27
|
+
self: !blank || Boolean(this.data.self),
|
|
28
|
+
disabled: this.data.disabled,
|
|
29
|
+
classes: this.data.classes,
|
|
30
|
+
attributes: this.data.attributes,
|
|
31
31
|
icon: this.data.icon,
|
|
32
32
|
iconPlace: this.data['icon-place'],
|
|
33
33
|
}
|
|
@@ -32,8 +32,8 @@ class CardContainerDirective extends Node {
|
|
|
32
32
|
const hintEnd = this.structureHintEnd;
|
|
33
33
|
const classes = ['fr-card'];
|
|
34
34
|
switch (true) {
|
|
35
|
-
case data.properties.enlargeLink ===
|
|
36
|
-
case data.properties.enlargeLink !==
|
|
35
|
+
case data.properties.enlargeLink === true:
|
|
36
|
+
case data.properties.enlargeLink !== false && contentTitle?.children[0]?.type === 'link':
|
|
37
37
|
classes.push('fr-enlarge-link');
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
@@ -31,8 +31,8 @@ class TileContainerDirective extends Node {
|
|
|
31
31
|
const details = contentChildren[2];
|
|
32
32
|
const classes = ['fr-tile'];
|
|
33
33
|
switch (true) {
|
|
34
|
-
case data.properties.enlargeLink ===
|
|
35
|
-
case data.properties.enlargeLink !==
|
|
34
|
+
case data.properties.enlargeLink === true:
|
|
35
|
+
case data.properties.enlargeLink !== false && title?.children[0]?.type === 'link':
|
|
36
36
|
classes.push('fr-enlarge-link');
|
|
37
37
|
break;
|
|
38
38
|
}
|
|
@@ -10,7 +10,7 @@ class GuidelineContainerDirective extends Node {
|
|
|
10
10
|
return data;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const valid = data.properties.valid
|
|
13
|
+
const valid = data.properties.valid === true;
|
|
14
14
|
const col = data.properties.col || '12';
|
|
15
15
|
const description = data.children.filter(child => {
|
|
16
16
|
switch (true) {
|
|
@@ -7,7 +7,7 @@ class PinLeafDirective extends Node {
|
|
|
7
7
|
const titleChildren = data?.children[0];
|
|
8
8
|
const requiredFragment = data.fragments?.anatomy?.required;
|
|
9
9
|
const optionalFragment = data.fragments?.anatomy?.optional;
|
|
10
|
-
let descriptionValue = ` — ${required ===
|
|
10
|
+
let descriptionValue = ` — ${required === true ? requiredFragment : optionalFragment}`;
|
|
11
11
|
if (add) descriptionValue = `, ${add}${descriptionValue}`;
|
|
12
12
|
|
|
13
13
|
if (!titleChildren) {
|
|
@@ -17,7 +17,7 @@ class PinLeafDirective extends Node {
|
|
|
17
17
|
return {
|
|
18
18
|
type: 'htmlContainer',
|
|
19
19
|
tagName: 'li',
|
|
20
|
-
classes: ['dsfr-doc-anatomy__pin', required ===
|
|
20
|
+
classes: ['dsfr-doc-anatomy__pin', required === true ? 'dsfr-doc-anatomy__pin--required' : ''],
|
|
21
21
|
children: [
|
|
22
22
|
{
|
|
23
23
|
type: 'htmlContainer',
|