@gouvfr/dsfr-roller 1.0.23 → 1.0.25

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gouvfr/dsfr-roller",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
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.23",
59
+ "@gouvfr/dsfr-forge": "=1.0.25",
60
60
  "@gouvfr/dsfr-publisher": "npm:@gouvfr/dsfr@1.13.1",
61
61
  "deepmerge": "^4.3.1",
62
62
  "ejs": "^3.1.10",
@@ -4,7 +4,7 @@ import { log } from '@gouvfr/dsfr-forge';
4
4
  class AnatomyContainerDirective extends Node {
5
5
  structure (data) {
6
6
  const image = Node.getImageChild(data);
7
- const col = data.properties?.col ?? 12;
7
+ const imageWidth = data.properties?.imageWidth;
8
8
 
9
9
  if (!image) {
10
10
  log.warn('GuidelineContainerDirective: missing image');
@@ -16,42 +16,30 @@ class AnatomyContainerDirective extends Node {
16
16
  return super.structure({
17
17
  type: 'htmlContainer',
18
18
  tagName: 'div',
19
- classes: ['fr-grid-row', 'fr-grid-row--gutters'],
19
+ classes: ['dsfr-doc-anatomy'],
20
20
  children: [
21
21
  {
22
22
  type: 'htmlContainer',
23
23
  tagName: 'div',
24
- classes: ['fr-col-12', `fr-col-sm-${col}`],
24
+ classes: ['dsfr-doc-anatomy__image'],
25
25
  children: [
26
26
  {
27
- type: 'htmlContainer',
28
- tagName: 'div',
29
- classes: ['dsfr-doc-anatomy'],
30
- children: [
31
- {
32
- type: 'htmlContainer',
33
- tagName: 'div',
34
- classes: ['dsfr-doc-anatomy__image'],
35
- children: [
36
- {
37
- ...image,
38
- classes: ['fr-responsive-img']
39
- }
40
- ]
41
- },
42
- {
43
- type: 'htmlContainer',
44
- tagName: 'ol',
45
- classes: ['dsfr-doc-anatomy__content'],
46
- children: contentChildren
47
- }
48
- ]
27
+ ...image,
28
+ classes: ['fr-responsive-img'],
29
+ attributes: {
30
+ style: `max-width: ${imageWidth ? imageWidth + 'px' : '100%'};`
31
+ }
49
32
  }
50
33
  ]
34
+ },
35
+ {
36
+ type: 'htmlContainer',
37
+ tagName: 'ol',
38
+ classes: ['dsfr-doc-anatomy__content'],
39
+ children: contentChildren
51
40
  }
52
41
  ]
53
42
  });
54
-
55
43
  }
56
44
 
57
45
  }
@@ -19,12 +19,16 @@ class PageItemCardContainerDirective extends CardContainerDirective {
19
19
  ...data.properties,
20
20
  };
21
21
 
22
- data.children = [
23
- {
22
+ data.children = [];
23
+
24
+ if (data.noCover !== true) {
25
+ data.children.push({
24
26
  type: 'image',
25
27
  url: data.cover ?? '/static/img/placeholder.16x9.png',
26
- },
27
- {
28
+ });
29
+ }
30
+
31
+ data.children.push({
28
32
  type: 'heading',
29
33
  depth: 2,
30
34
  children: [
@@ -39,8 +43,7 @@ class PageItemCardContainerDirective extends CardContainerDirective {
39
43
  ],
40
44
  },
41
45
  ],
42
- }
43
- ];
46
+ });
44
47
 
45
48
  if (data.shortDescription || data.excerpt) {
46
49
  data.children.push({
@@ -2,7 +2,11 @@
2
2
  margin-bottom: 2rem;
3
3
 
4
4
  &__image {
5
- margin-bottom: 0.75rem;
5
+ margin-bottom: 1rem;
6
+ background-color: var(--background-alt-grey);
7
+ width: 100%;
8
+ display: flex;
9
+ justify-content: center;
6
10
  }
7
11
 
8
12
  &__content {