@datagouv/components-next 1.0.2-dev.190 → 1.0.2-dev.192

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.
@@ -1,4 +1,4 @@
1
- import { g as Ke } from "./main-HzoTSLAM.js";
1
+ import { g as Ke } from "./main-C2kCZkPD.js";
2
2
  import We from "vue";
3
3
  function Fe($, K) {
4
4
  for (var V = 0; V < K.length; V++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "1.0.2-dev.190",
3
+ "version": "1.0.2-dev.192",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -43,37 +43,43 @@
43
43
 
44
44
  <!-- Hover card: the row truncates the title, so surface the full name plus the
45
45
  same metadata line as the viewer header. Placed beside the row (not below) so
46
- it doesn't hide the sibling rows we're scanning. -->
47
- <Teleport to="body">
48
- <div
49
- v-if="show"
50
- ref="card"
51
- role="tooltip"
52
- class="pointer-events-none z-[80] w-max rounded border border-gray-default bg-white p-2 text-left shadow-[0_2px_4px_rgba(0,0,0,0.04),2px_4px_16px_rgba(0,0,0,0.12)]"
53
- :style="floatingStyles"
54
- >
55
- <span class="block whitespace-nowrap text-[13px] font-medium leading-5 text-gray-title">{{ resource.title || t('Fichier sans nom') }}</span>
56
- <div class="mt-1 flex items-center gap-1 text-[12px] leading-4 text-gray-medium">
57
- <span>{{ t('mis à jour {date}', { date: formatRelativeIfRecentDate(resource.last_modified) }) }}</span>
58
- <template v-if="humanFilesize">
59
- <span>·</span>
60
- <span>{{ humanFilesize }}</span>
61
- </template>
62
- <template v-if="resource.format">
46
+ it doesn't hide the sibling rows we're scanning.
47
+ ClientOnly: Vue hydrates a teleport by scanning the target from its first child,
48
+ so an SSR-rendered teleport to `body` breaks as soon as anything else is prepended
49
+ there — and Nuxt emits the `bodyOpen` head tags before it. The card only ever opens
50
+ on hover, so there is nothing to render on the server anyway. -->
51
+ <ClientOnly>
52
+ <Teleport to="body">
53
+ <div
54
+ v-if="show"
55
+ ref="card"
56
+ role="tooltip"
57
+ class="pointer-events-none z-[80] w-max rounded border border-gray-default bg-white p-2 text-left shadow-[0_2px_4px_rgba(0,0,0,0.04),2px_4px_16px_rgba(0,0,0,0.12)]"
58
+ :style="floatingStyles"
59
+ >
60
+ <span class="block whitespace-nowrap text-[13px] font-medium leading-5 text-gray-title">{{ resource.title || t('Fichier sans nom') }}</span>
61
+ <div class="mt-1 flex items-center gap-1 text-[12px] leading-4 text-gray-medium">
62
+ <span>{{ t('mis à jour {date}', { date: formatRelativeIfRecentDate(resource.last_modified) }) }}</span>
63
+ <template v-if="humanFilesize">
64
+ <span>·</span>
65
+ <span>{{ humanFilesize }}</span>
66
+ </template>
67
+ <template v-if="resource.format">
68
+ <span>·</span>
69
+ <span class="rounded bg-gray-lower px-1.5 py-0.5 uppercase leading-4">{{ resource.format }}</span>
70
+ </template>
63
71
  <span>·</span>
64
- <span class="rounded bg-gray-lower px-1.5 py-0.5 uppercase leading-4">{{ resource.format }}</span>
65
- </template>
66
- <span>·</span>
67
- <span class="inline-flex items-center gap-0.5">
68
- <RiDownloadLine
69
- class="size-3"
70
- aria-hidden="true"
71
- />
72
- {{ summarize(resource.metrics.views) }}
73
- </span>
72
+ <span class="inline-flex items-center gap-0.5">
73
+ <RiDownloadLine
74
+ class="size-3"
75
+ aria-hidden="true"
76
+ />
77
+ {{ summarize(resource.metrics.views) }}
78
+ </span>
79
+ </div>
74
80
  </div>
75
- </div>
76
- </Teleport>
81
+ </Teleport>
82
+ </ClientOnly>
77
83
  </template>
78
84
 
79
85
  <script setup lang="ts">
@@ -83,6 +89,7 @@ import { useEventListener } from '@vueuse/core'
83
89
  import type { RouteLocationRaw } from 'vue-router'
84
90
  import { RiDownloadLine } from '@remixicon/vue'
85
91
  import AppLink from './AppLink.vue'
92
+ import ClientOnly from './ClientOnly.vue'
86
93
  import File from './Icons/File.vue'
87
94
  import { getResourceFormatIcon, getResourceIconColor, getResourceFilesize } from '../functions/resources'
88
95
  import { filesize, summarize } from '../functions/helpers'