@datagouv/components-next 0.2.0 → 1.0.1

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.
Files changed (155) hide show
  1. package/README.md +1 -1
  2. package/assets/main.css +49 -22
  3. package/dist/Control-BNCDn-8E.js +148 -0
  4. package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
  5. package/dist/Event-BOgJUhNR.js +738 -0
  6. package/dist/Image-BN-4XkIn.js +247 -0
  7. package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-Doz1Z0BS.js} +23 -23
  8. package/dist/Map-BdT3i2C4.js +7609 -0
  9. package/dist/MapContainer.client-oiieO8H-.js +105 -0
  10. package/dist/OSM-CamriM9b.js +71 -0
  11. package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
  12. package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
  13. package/dist/ScaleLine-BiesrgOv.js +165 -0
  14. package/dist/Swagger.client-CsK65JnG.js +4 -0
  15. package/dist/Tile-DCuqwNOI.js +1206 -0
  16. package/dist/TileImage-CmZf8EdU.js +1067 -0
  17. package/dist/View-DcDc7N2K.js +2858 -0
  18. package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-CrjHf74q.js} +17 -17
  19. package/dist/common-C4rDcQpp.js +243 -0
  20. package/dist/components-next.css +1 -1
  21. package/dist/components-next.js +158 -117
  22. package/dist/components.css +1 -1
  23. package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
  24. package/dist/leaflet-src-7m1mB8LI.js +6338 -0
  25. package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
  26. package/dist/proj-CKwYjU38.js +1569 -0
  27. package/dist/tilecoord-YW3qEH_j.js +884 -0
  28. package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-Bi_bsV6C.js} +1 -1
  29. package/package.json +6 -2
  30. package/src/components/ActivityList/ActivityList.vue +6 -2
  31. package/src/components/AppLink.vue +4 -1
  32. package/src/components/Avatar.vue +2 -2
  33. package/src/components/AvatarWithName.vue +8 -4
  34. package/src/components/BouncingDots.vue +21 -0
  35. package/src/components/BrandedButton.vue +2 -0
  36. package/src/components/CopyButton.vue +19 -7
  37. package/src/components/DataserviceCard.vue +85 -120
  38. package/src/components/DatasetCard.vue +110 -171
  39. package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
  40. package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
  41. package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
  42. package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
  43. package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
  44. package/src/components/DatasetInformation/index.ts +5 -0
  45. package/src/components/DatasetQuality.vue +23 -16
  46. package/src/components/DatasetQualityInline.vue +13 -17
  47. package/src/components/DatasetQualityScore.vue +12 -15
  48. package/src/components/DatasetQualityTooltipContent.vue +3 -3
  49. package/src/components/DescriptionList.vue +1 -4
  50. package/src/components/DescriptionListDetails.vue +5 -0
  51. package/src/components/DescriptionListTerm.vue +5 -0
  52. package/src/components/DiscussionMessageCard.vue +63 -0
  53. package/src/components/ExtraAccordion.vue +4 -4
  54. package/src/components/Form/BadgeSelect.vue +35 -0
  55. package/src/components/Form/FormatSelect.vue +28 -0
  56. package/src/components/Form/GeozoneSelect.vue +52 -0
  57. package/src/components/Form/GranularitySelect.vue +29 -0
  58. package/src/components/Form/LicenseSelect.vue +30 -0
  59. package/src/components/Form/OrganizationSelect.vue +62 -0
  60. package/src/components/Form/OrganizationTypeSelect.vue +34 -0
  61. package/src/components/Form/ReuseTopicSelect.vue +29 -0
  62. package/src/components/Form/SchemaSelect.vue +30 -0
  63. package/src/components/Form/SearchableSelect.vue +334 -0
  64. package/src/components/Form/SelectGroup.vue +132 -0
  65. package/src/components/Form/TagSelect.vue +38 -0
  66. package/src/components/LeafletMap.vue +31 -0
  67. package/src/components/LicenseBadge.vue +24 -0
  68. package/src/components/LoadingBlock.vue +23 -2
  69. package/src/components/MarkdownViewer.vue +3 -1
  70. package/src/components/ObjectCard.vue +42 -0
  71. package/src/components/ObjectCardBadge.vue +22 -0
  72. package/src/components/ObjectCardHeader.vue +35 -0
  73. package/src/components/ObjectCardOwner.vue +43 -0
  74. package/src/components/ObjectCardShortDescription.vue +28 -0
  75. package/src/components/OrganizationCard.vue +35 -20
  76. package/src/components/OrganizationHorizontalCard.vue +87 -0
  77. package/src/components/OrganizationLogo.vue +1 -1
  78. package/src/components/OrganizationNameWithCertificate.vue +12 -6
  79. package/src/components/OwnerTypeIcon.vue +1 -0
  80. package/src/components/Pagination.vue +1 -1
  81. package/src/components/Placeholder.vue +5 -2
  82. package/src/components/PostCard.vue +62 -0
  83. package/src/components/ProgressBar.vue +31 -0
  84. package/src/components/RadioGroup.vue +32 -0
  85. package/src/components/RadioInput.vue +64 -0
  86. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  87. package/src/components/ResourceAccordion/EditButton.vue +2 -3
  88. package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
  89. package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
  90. package/src/components/ResourceAccordion/Metadata.vue +11 -24
  91. package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
  92. package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
  93. package/src/components/ResourceAccordion/Preview.vue +2 -2
  94. package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
  95. package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
  96. package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
  97. package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
  98. package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
  99. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
  100. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
  101. package/src/components/ReuseCard.vue +8 -28
  102. package/src/components/ReuseHorizontalCard.vue +80 -0
  103. package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
  104. package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
  105. package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
  106. package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
  107. package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
  108. package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
  109. package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
  110. package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
  111. package/src/components/Search/GlobalSearch.vue +707 -0
  112. package/src/components/Search/SearchInput.vue +63 -0
  113. package/src/components/Search/Sidemenu.vue +38 -0
  114. package/src/components/StatBox.vue +5 -5
  115. package/src/components/Tag.vue +30 -0
  116. package/src/components/Toggletip.vue +11 -4
  117. package/src/components/Tooltip.vue +2 -3
  118. package/src/components/TopicCard.vue +134 -0
  119. package/src/components/radioGroupContext.ts +9 -0
  120. package/src/composables/useDebouncedRef.ts +31 -0
  121. package/src/composables/useHasTabularData.ts +15 -0
  122. package/src/composables/useMetrics.ts +4 -3
  123. package/src/composables/useResourceCapabilities.ts +131 -0
  124. package/src/composables/useRouteQueryBoolean.ts +10 -0
  125. package/src/composables/useSelectModelSync.ts +89 -0
  126. package/src/composables/useStableQueryParams.ts +84 -0
  127. package/src/composables/useTranslation.ts +2 -1
  128. package/src/config.ts +4 -0
  129. package/src/functions/api.ts +25 -6
  130. package/src/functions/api.types.ts +5 -3
  131. package/src/functions/datasets.ts +1 -29
  132. package/src/functions/description.ts +33 -0
  133. package/src/functions/helpers.ts +11 -0
  134. package/src/functions/markdown.ts +60 -16
  135. package/src/functions/metrics.ts +33 -0
  136. package/src/functions/organizations.ts +5 -5
  137. package/src/functions/resourceCapabilities.ts +55 -0
  138. package/src/main.ts +96 -7
  139. package/src/types/dataservices.ts +14 -12
  140. package/src/types/datasets.ts +20 -7
  141. package/src/types/discussions.ts +20 -0
  142. package/src/types/licenses.ts +3 -3
  143. package/src/types/organizations.ts +13 -1
  144. package/src/types/owned.ts +4 -2
  145. package/src/types/pages.ts +70 -0
  146. package/src/types/posts.ts +27 -0
  147. package/src/types/resources.ts +16 -0
  148. package/src/types/reuses.ts +14 -5
  149. package/src/types/search.ts +407 -0
  150. package/src/types/users.ts +12 -3
  151. package/dist/PdfPreview.client-COOkEkRA.js +0 -107
  152. package/dist/Swagger.client-CpLgaLg6.js +0 -4
  153. package/dist/pdf-vue3-IkJO65RH.js +0 -273
  154. package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
  155. package/src/components/DatasetInformationPanel.vue +0 -211
@@ -1,4 +1,4 @@
1
- import { g as Ke } from "./main-Dgri3TQL.js";
1
+ import { b as Ke } from "./main-CiH8ZmBI.js";
2
2
  import We from "vue";
3
3
  function Fe(I, 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": "0.2.0",
3
+ "version": "1.0.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -17,17 +17,20 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "@floating-ui/vue": "^1.1.8",
20
+ "@types/leaflet": "^1.9.17",
20
21
  "@headlessui/vue": "^1.7.23",
21
22
  "@remixicon/vue": "^4.5.0",
22
23
  "@types/hast": "^3.0.4",
23
24
  "@vueuse/core": "^13.1.0",
25
+ "@vueuse/router": "^13.1.0",
24
26
  "chart.js": "^4.4.8",
25
27
  "dompurify": "^3.2.5",
26
28
  "geopf-extensions-openlayers": "^1.0.0-beta.5",
29
+ "leaflet": "^1.9.4",
27
30
  "maplibre-gl": "^5.6.2",
28
31
  "ofetch": "^1.4.1",
29
32
  "ol": "^10.6.1",
30
- "pdf-vue3": "^1.0.12",
33
+ "pdfjs-dist": "^4.10.38",
31
34
  "pmtiles": "^4.3.0",
32
35
  "popmotion": "^11.0",
33
36
  "rehype-highlight": "^7.0.2",
@@ -48,6 +51,7 @@
48
51
  "vue": "^3.5.13",
49
52
  "vue-content-loader": "^2.0.1",
50
53
  "vue-router": "^4.5.0",
54
+ "vue-sonner": "^2.0.9",
51
55
  "vue3-json-viewer": "^2.4.1",
52
56
  "vue3-text-clamp": "^0.1.2",
53
57
  "vue3-xml-viewer": "^0.0.14"
@@ -1,7 +1,11 @@
1
1
  <template>
2
2
  <PaddedContainer class="p-4 pr-7">
3
- <LoadingBlock :status>
4
- <template v-if="activities && activities.total">
3
+ <LoadingBlock
4
+ v-slot="{ data: activities }"
5
+ :status
6
+ :data="activities"
7
+ >
8
+ <template v-if="activities.total">
5
9
  <div
6
10
  v-for="(monthlyActivities, month) in groupedActivities"
7
11
  :key="month"
@@ -6,6 +6,9 @@
6
6
  >
7
7
  <slot />
8
8
  </component>
9
+ <span v-else-if="!to">
10
+ <slot />
11
+ </span>
9
12
  <a
10
13
  v-else-if="isExternal"
11
14
  :href="(to as string)"
@@ -29,7 +32,7 @@ const config = useComponentsConfig()
29
32
  const { locale } = useTranslation()
30
33
 
31
34
  const props = defineProps<{
32
- to: string | RouteLocationRaw
35
+ to: string | RouteLocationRaw | null | undefined
33
36
  }>()
34
37
 
35
38
  const isExternal = computed(() => {
@@ -13,12 +13,12 @@
13
13
  <script setup lang="ts">
14
14
  import { computed } from 'vue'
15
15
  import { useGetUserAvatar } from '../functions/users'
16
- import type { UserReference } from '../types/users'
16
+ import type { User, UserReference } from '../types/users'
17
17
 
18
18
  type Props = {
19
19
  rounded?: boolean
20
20
  size?: number
21
- user: UserReference
21
+ user: User | UserReference
22
22
  }
23
23
  const props = withDefaults(defineProps<Props>(), {
24
24
  rounded: false,
@@ -6,13 +6,15 @@
6
6
  :size
7
7
  :rounded="true"
8
8
  />
9
- <AppLink
10
- :to="user.page"
11
- class="fr-text--bold truncate"
9
+ <component
10
+ :is="withLink ? AppLink : 'span'"
11
+ :to="withLink ? user.page : undefined"
12
+ class="truncate"
13
+ :class="{ 'font-bold': withLink }"
12
14
  >
13
15
  {{ user.first_name }}
14
16
  {{ user.last_name }}
15
- </AppLink>
17
+ </component>
16
18
  </span>
17
19
  </template>
18
20
 
@@ -24,7 +26,9 @@ import Avatar from './Avatar.vue'
24
26
  withDefaults(defineProps<{
25
27
  user: User | UserReference
26
28
  size?: number
29
+ withLink?: boolean
27
30
  }>(), {
28
31
  size: 12,
32
+ withLink: true,
29
33
  })
30
34
  </script>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <span class="inline-flex gap-0.5 items-end h-2">
3
+ <span
4
+ v-for="i in 3"
5
+ :key="i"
6
+ class="w-1 h-1 bg-current rounded-full animate-[bounce-dot_0.6s_ease-in-out_infinite]"
7
+ :style="`animation-delay: ${(i - 1) * 100}ms !important`"
8
+ />
9
+ </span>
10
+ </template>
11
+
12
+ <style>
13
+ @keyframes bounce-dot {
14
+ 0%, 100% {
15
+ transform: translateY(0);
16
+ }
17
+ 50% {
18
+ transform: translateY(-3px);
19
+ }
20
+ }
21
+ </style>
@@ -21,6 +21,7 @@
21
21
  v-else-if="icon"
22
22
  :class="iconSize"
23
23
  v-bind="iconAttrs"
24
+ aria-hidden="true"
24
25
  />
25
26
  <span
26
27
  v-if="hasText"
@@ -29,6 +30,7 @@
29
30
  ><slot /></span>
30
31
  <RiExternalLinkLine
31
32
  v-if="newTab"
33
+ aria-hidden="true"
32
34
  :class="iconSize"
33
35
  />
34
36
  </component>
@@ -11,10 +11,13 @@
11
11
  :class="{ 'flex-row-reverse': reverse }"
12
12
  style="color: #3558a2;"
13
13
  >
14
- <RiCheckLine class="flex-none size-4 inline" />
14
+ <RiCheckLine
15
+ class="flex-none size-4 inline"
16
+ aria-hidden="true"
17
+ />
15
18
  <span
16
19
  class="copy-label"
17
- :class="{ 'fr-sr-only': hideLabel }"
20
+ :class="{ 'sr-only': hideLabel }"
18
21
  >{{ copiedLabel }}</span>
19
22
  </span>
20
23
  <span
@@ -25,10 +28,11 @@
25
28
  <component
26
29
  :is="hideLabel ? RiClipboardLine : RiFileCopyLine"
27
30
  class="size-4 flex-none inline"
31
+ aria-hidden="true"
28
32
  />
29
33
  <span
30
34
  class="copy-link copy-label"
31
- :class="{ 'fr-sr-only': hideLabel }"
35
+ :class="{ 'sr-only': hideLabel }"
32
36
  >{{ label }}</span>
33
37
  </span>
34
38
  </button>
@@ -37,6 +41,8 @@
37
41
  <script setup lang="ts">
38
42
  import { RiCheckLine, RiClipboardLine, RiFileCopyLine } from '@remixicon/vue'
39
43
  import { ref } from 'vue'
44
+ import { toast } from 'vue-sonner'
45
+ import { useTranslation } from '../composables/useTranslation'
40
46
 
41
47
  const props = withDefaults(defineProps<{
42
48
  text: string
@@ -49,12 +55,18 @@ const props = withDefaults(defineProps<{
49
55
  reverse: false,
50
56
  })
51
57
 
58
+ const { t } = useTranslation()
52
59
  const copied = ref(false)
53
60
 
54
- const copy = () => {
55
- void navigator.clipboard.writeText(props.text)
56
- copied.value = true
57
- setTimeout(() => copied.value = false, 2000)
61
+ const copy = async () => {
62
+ try {
63
+ await navigator.clipboard.writeText(props.text)
64
+ copied.value = true
65
+ setTimeout(() => copied.value = false, 2000)
66
+ }
67
+ catch {
68
+ toast.error(t('Impossible de copier dans le presse-papier'))
69
+ }
58
70
  }
59
71
  </script>
60
72
 
@@ -1,100 +1,83 @@
1
1
  <template>
2
- <article
3
- class="my-4 p-4 bg-white hover:bg-gray-some border fr-enlarge-link"
4
- :class="{
2
+ <ObjectCard
3
+ :article-class="{
5
4
  'border-tabular-api': isTabularApi,
6
5
  'border-gray-default': !isTabularApi,
7
- 'mt-6': showBadge,
8
6
  }"
9
7
  >
10
- <div
11
- v-if="showBadge"
12
- class="absolute top-0 fr-grid-row fr-grid-row--middle fr-mt-n3v fr-ml-n1v"
13
- >
14
- <p
15
- v-if="dataservice.access_type === 'restricted'"
16
- class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
17
- >
18
- <RiLockLine class="size-4 mr-1" />
19
- {{ t('Accès restreint') }}
20
- </p>
21
- <p
22
- v-else-if="dataservice.access_type === 'open_with_account'"
23
- class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
24
- >
25
- <RiPassValidLine class="size-4 mr-1" />
26
- {{ t('Ouvert avec un compte') }}
27
- </p>
28
- <p
8
+ <template #badge>
9
+ <ObjectCardBadge
29
10
  v-if="dataservice.private"
30
- class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
11
+ :icon="RiLockLine"
31
12
  >
32
- <RiLockLine class="size-4 mr-1" />
33
13
  {{ t('Brouillon') }}
34
- </p>
35
- <p
36
- v-if="dataservice.archived_at"
37
- class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
14
+ </ObjectCardBadge>
15
+ <ObjectCardBadge
16
+ v-else-if="dataservice.archived_at"
17
+ :icon="RiArchiveLine"
38
18
  >
39
- <RiLockLine class="size-4 mr-1" />
40
19
  {{ t('Archivé') }}
41
- </p>
42
- </div>
43
- <h4 class="text-base mb-0 flex items-center gap-1">
44
- <slot
45
- name="dataserviceUrl"
46
- :dataservice="dataservice"
47
- :dataservice-url="dataserviceUrl"
20
+ </ObjectCardBadge>
21
+ <ObjectCardBadge
22
+ v-else-if="dataservice.access_type === 'restricted'"
23
+ :icon="RiLockLine"
48
24
  >
49
- <RiSparklingLine
50
- v-if="isTabularApi"
51
- class="size-4 flex-none"
52
- />
53
- <RiTerminalLine
54
- v-else
55
- class="size-4 flex-none"
56
- />
57
- <AppLink
58
- class="truncate"
59
- :to="dataserviceUrl"
60
- >
61
- {{ dataservice.title }}
62
- </AppLink>
63
- </slot>
64
- </h4>
25
+ {{ t('Accès restreint') }}
26
+ </ObjectCardBadge>
27
+ <ObjectCardBadge
28
+ v-else-if="dataservice.access_type === 'open_with_account'"
29
+ :icon="RiPassValidLine"
30
+ >
31
+ {{ t('Ouvert avec un compte') }}
32
+ </ObjectCardBadge>
33
+ </template>
34
+
35
+ <template #media>
36
+ <OrganizationLogo
37
+ v-if="dataservice.organization"
38
+ :organization="dataservice.organization"
39
+ size-class="size-12"
40
+ />
41
+ <Avatar
42
+ v-else-if="dataservice.owner"
43
+ :user="dataservice.owner"
44
+ :size="48"
45
+ />
46
+ <Placeholder
47
+ v-else
48
+ type="Dataservice"
49
+ class="size-12"
50
+ />
51
+ </template>
52
+
53
+ <ObjectCardHeader
54
+ :icon="isTabularApi ? RiSparklingLine : RiTerminalLine"
55
+ :url="dataserviceUrl || dataservice.self_web_url"
56
+ >
57
+ {{ dataservice.title }}
58
+ </ObjectCardHeader>
65
59
  <div
66
60
  v-if="dataservice.organization || dataservice.owner"
67
- class="text-gray-medium overflow-hidden flex items-center gap-1 mt-1 mb-0"
61
+ class="text-sm flex flex-wrap md:flex-nowrap gap-y-1 items-center truncate"
68
62
  >
69
- <p
70
- v-if="dataservice.organization"
71
- class="text-sm block not-enlarged overflow-hidden mb-0"
72
- >
73
- <AppLink
74
- v-if="organizationUrl"
75
- class="link text-sm overflow-hidden"
76
- :to="organizationUrl"
77
- >
78
- <OrganizationNameWithCertificate :organization="dataservice.organization" />
79
- </AppLink>
80
- <OrganizationNameWithCertificate
81
- v-else
82
- :organization="dataservice.organization"
83
- />
84
- </p>
85
- <p
86
- v-else
87
- class="text-sm mb-0 truncate"
88
- >
89
- {{ ownerName }}
90
- </p>
91
- <RiSubtractLine class="size-4 flex-none fill-gray-medium" />
92
- <!-- This comment is only here to fix this issue https://github.com/datagouv/cdata/issues/653, it could be empty… -->
93
- <p class="text-sm whitespace-nowrap mb-0">
63
+ <ObjectCardOwner
64
+ :organization="dataservice.organization"
65
+ :owner="dataservice.owner"
66
+ :organization-url="organizationUrl"
67
+ />
68
+ <RiSubtractLine
69
+ aria-hidden="true"
70
+ class="size-4 flex-none fill-gray-medium"
71
+ />
72
+ <!-- https://github.com/datagouv/cdata/issues/653 -->
73
+ <p class="text-sm whitespace-nowrap mb-0 text-gray-medium">
94
74
  {{ t('Mis à jour {date}', { date: formatRelativeIfRecentDate(dataservice.metadata_modified_at, { dateStyle: 'medium' }) }) }}
95
75
  </p>
96
- <RiSubtractLine class="size-4 flex-none fill-gray-medium" />
97
- <div class="flex items-center gap-1">
76
+ <RiSubtractLine
77
+ aria-hidden="true"
78
+ class="size-4 flex-none fill-gray-medium"
79
+ />
80
+ <div class="flex items-center gap-1 text-gray-medium">
98
81
  <p
99
82
  class="text-sm mb-0 flex items-center gap-0.5"
100
83
  :aria-label="t('{n} vues | {n} vue | {n} vues', dataservice.metrics.views)"
@@ -115,73 +98,55 @@
115
98
  </p>
116
99
  </div>
117
100
  </div>
118
- <component
119
- :is="config.textClamp"
120
- v-if="config.textClamp && description && showDescription"
121
- class="text-sm mt-2 mb-0"
122
- :auto-resize="true"
123
- :text="description"
124
- :max-lines="2"
101
+ <ObjectCardShortDescription
102
+ v-if="showDescription"
103
+ :text="dataservice.description"
125
104
  />
126
- </article>
105
+
106
+ <slot />
107
+ </ObjectCard>
127
108
  </template>
128
109
 
129
110
  <script setup lang="ts">
130
- import { computed, ref, watchEffect } from 'vue'
111
+ import { computed } from 'vue'
131
112
  import type { RouteLocationRaw } from 'vue-router'
132
- import { RiEyeLine, RiLockLine, RiPassValidLine, RiSparklingLine, RiStarLine, RiSubtractLine, RiTerminalLine } from '@remixicon/vue'
113
+ import { RiArchiveLine, RiEyeLine, RiLockLine, RiPassValidLine, RiSparklingLine, RiStarLine, RiSubtractLine, RiTerminalLine } from '@remixicon/vue'
133
114
  import { useComponentsConfig } from '../config'
134
115
  import { useFormatDate } from '../functions/dates'
135
116
  import { summarize } from '../functions/helpers'
136
- import { removeMarkdown } from '../functions/markdown'
137
- import { getOwnerName } from '../functions/owned'
138
117
  import type { Dataservice } from '../types/dataservices'
139
118
  import { useTranslation } from '../composables/useTranslation'
140
- import OrganizationNameWithCertificate from './OrganizationNameWithCertificate.vue'
141
- import AppLink from './AppLink.vue'
119
+ import OrganizationLogo from './OrganizationLogo.vue'
120
+ import Avatar from './Avatar.vue'
121
+ import Placeholder from './Placeholder.vue'
122
+ import ObjectCard from './ObjectCard.vue'
123
+ import ObjectCardBadge from './ObjectCardBadge.vue'
124
+ import ObjectCardHeader from './ObjectCardHeader.vue'
125
+ import ObjectCardOwner from './ObjectCardOwner.vue'
126
+ import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
142
127
 
143
128
  type Props = {
144
129
  dataservice: Dataservice
145
-
146
- /**
147
- * The dataserviceUrl is a route location object to allow Vue Router to navigate to the details of a dataservice.
148
- * It is used as a separate prop to allow other sites using the package to define their own dataservice pages.
149
- */
150
130
  dataserviceUrl?: RouteLocationRaw
151
-
152
- /**
153
- * The organizationUrl is an optional route location object to allow Vue Router to navigate to the details of the organization linked to tha dataservice.
154
- * It is used as a separate prop to allow other sites using the package to define their own organization pages.
155
- */
156
131
  organizationUrl?: RouteLocationRaw
157
132
  showDescription?: boolean
158
133
  }
159
134
 
160
135
  const props = withDefaults(defineProps<Props>(), {
161
- style: () => ({}),
162
136
  showDescription: true,
163
137
  })
164
138
 
165
- const dataserviceUrl = computed(() => props.dataserviceUrl || props.dataservice.self_web_url)
166
-
167
139
  const { t } = useTranslation()
168
140
  const { formatRelativeIfRecentDate } = useFormatDate()
169
- const ownerName = computed(() => getOwnerName(props.dataservice))
170
- const showBadge = computed(() => props.dataservice.access_type === 'restricted' || props.dataservice.access_type === 'open_with_account' || props.dataservice.private || props.dataservice.archived_at)
171
141
 
172
142
  const config = useComponentsConfig()
173
143
  const isTabularApi = computed(() => {
174
144
  return config.tabularApiDataserviceId === props.dataservice.id
175
145
  })
176
-
177
- const description = ref('')
178
- watchEffect(async () => {
179
- description.value = await removeMarkdown(props.dataservice.description)
180
- })
181
146
  </script>
182
147
 
183
- <style scoped>
184
- .border-tabular-api {
185
- border-color: #373C42 !important;
186
- }
187
- </style>
148
+ <style scoped>
149
+ .border-tabular-api {
150
+ border-color: #373C42 !important;
151
+ }
152
+ </style>