@paris-ias/list 1.1.7 → 1.1.9

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paris-ias/list",
3
3
  "configKey": "list",
4
- "version": "1.1.7",
4
+ "version": "1.1.9",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -32,7 +32,7 @@
32
32
  "
33
33
  />
34
34
 
35
- <div v-else class="d-flex align-center flex-column mt-12">
35
+ <div v-else-if="item" class="d-flex align-center flex-column mt-12">
36
36
  <div
37
37
  class="d-flex text-center text-wrap text-h4 text-md-h3 text-black"
38
38
  >
@@ -80,7 +80,7 @@
80
80
  ][['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')]
81
81
  "
82
82
  />
83
- <MDC v-if="item.description" :value="item.description" />
83
+ <MDC v-if="item && item.description" :value="item.description" />
84
84
 
85
85
  <v-responsive class="mx-auto my-9" width="120">
86
86
  <v-divider class="mb-1" />
@@ -18,19 +18,23 @@
18
18
  :aspect-ratio="ratio"
19
19
  :class="{ 'img-animation': animate }"
20
20
  :lazy-src="
21
- img(computedSrc, {
22
- width,
23
- quality: 70,
24
- })
21
+ isLocalAsset
22
+ ? computedSrc
23
+ : img(computedSrc, {
24
+ width,
25
+ quality: 70,
26
+ })
25
27
  "
26
28
  :src="
27
- img(computedSrc, {
28
- width,
29
- quality: 70,
30
- })
29
+ isLocalAsset
30
+ ? computedSrc
31
+ : img(computedSrc, {
32
+ width,
33
+ quality: 70,
34
+ })
31
35
  "
32
- :srcset="_srcset.srcset"
33
- :sizes="_srcset.sizes"
36
+ :srcset="isLocalAsset ? undefined : _srcset.srcset"
37
+ :sizes="isLocalAsset ? undefined : _srcset.sizes"
34
38
  :title="caption"
35
39
  v-bind="$attrs"
36
40
  >
@@ -49,6 +53,12 @@ const computedSrc = computed(() => {
49
53
  if (!props.src) return null
50
54
  return typeof props.src === "string" ? props.src : props.src?.url || null
51
55
  })
56
+
57
+ // Root-relative paths (e.g. /default.png) are static public assets shipped
58
+ // with the site. The static deploy (nuxt generate → S3) has no live IPX server
59
+ // and only pre-generates /_ipx/ variants for images crawled during prerender,
60
+ // which the conditional fallback isn't — so route those raw and skip IPX.
61
+ const isLocalAsset = computed(() => computedSrc.value?.startsWith("/") ?? false)
52
62
  const props = defineProps({
53
63
  src: {
54
64
  type: [Object, String],
@@ -10,11 +10,13 @@
10
10
  :type="['heading', 'heading'][['xs', 'sm'].indexOf(name || 'sm')]"
11
11
  />
12
12
  <template v-else>
13
- <v-chip v-if="item && item.category && item.name" class="mb-4">
14
- {{ $t("list.filters.news.category." + item.category) }}
15
- </v-chip>
16
- <br />
17
- {{ item.name }}
13
+ <template v-if="item">
14
+ <v-chip v-if="item.category && item.name" class="mb-4">
15
+ {{ $t("list.filters.news.category." + item.category) }}
16
+ </v-chip>
17
+ <br />
18
+ {{ item.name }}
19
+ </template>
18
20
  </template>
19
21
  </v-col>
20
22
  <v-col cols="12" md="4" class="pb-0">
@@ -58,7 +60,7 @@
58
60
  </div>
59
61
 
60
62
  <div
61
- v-if="item.description && mdAndUp"
63
+ v-if="item && item.description && mdAndUp"
62
64
  class="mt-md-n2 mx-4 mx-sm-8 mx-md-0 d-flex text-wrap text-h6 text-black mt-3"
63
65
  >
64
66
  <MDC v-if="item.description" :value="item.description" class="" />
@@ -120,7 +122,7 @@
120
122
  ]
121
123
  "
122
124
  />
123
- <div v-if="item.description" class="mt-md-n2 mx-4 mx-sm-8 mx-md-0">
125
+ <div v-if="item && item.description" class="mt-md-n2 mx-4 mx-sm-8 mx-md-0">
124
126
  <MDC :value="item.description" />
125
127
  </div>
126
128
  </v-col>
@@ -9,7 +9,7 @@
9
9
  <v-skeleton-loader v-if="loading" height="100%" type="image" />
10
10
 
11
11
  <MiscAtomsImageContainer
12
- v-else
12
+ v-else-if="item && item.image"
13
13
  contain
14
14
  :loading="$stores.publications.loading"
15
15
  :src="item.image.url ? item.image : '/default.png'"
@@ -31,7 +31,7 @@
31
31
  "
32
32
  />
33
33
 
34
- <div v-else class="d-flex align-center flex-column mt-12">
34
+ <div v-else-if="item" class="d-flex align-center flex-column mt-12">
35
35
  <div class="d-flex text-center text-wrap text-h4 text-md-h3 text-black">
36
36
  {{ item.name }}
37
37
  </div>
@@ -75,7 +75,7 @@
75
75
  ]
76
76
  "
77
77
  />
78
- <div v-if="item.description" class="mt-md-n2">
78
+ <div v-if="item && item.description" class="mt-md-n2">
79
79
  <MDC :value="item.description" />
80
80
  </div>
81
81
  </v-col>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "AGPL-3.0-only",
3
3
  "main": "./dist/module.mjs",
4
- "version": "1.1.7",
4
+ "version": "1.1.9",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",