@datagouv/components-next 1.0.1 → 1.0.2-dev.0

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 (33) hide show
  1. package/dist/{Control-BNCDn-8E.js → Control-DuZJdKV_.js} +1 -1
  2. package/dist/{Datafair.client-B5lBpOl8.js → Datafair.client-DpeBuzZZ.js} +1 -1
  3. package/dist/{Event-BOgJUhNR.js → Event--kp8kMdJ.js} +21 -21
  4. package/dist/{Image-BN-4XkIn.js → Image-34hvypZI.js} +114 -58
  5. package/dist/{JsonPreview.client-Doz1Z0BS.js → JsonPreview.client-B3sQR-rW.js} +1 -1
  6. package/dist/{Map-BdT3i2C4.js → Map-BjUnLyj8.js} +1534 -1466
  7. package/dist/{MapContainer.client-oiieO8H-.js → MapContainer.client-BA6GCqKX.js} +7 -7
  8. package/dist/{OSM-CamriM9b.js → OSM-s40W6sQ2.js} +22 -12
  9. package/dist/{PdfPreview.client-CdAhkDFJ.js → PdfPreview.client-CbeSChb8.js} +1 -1
  10. package/dist/Pmtiles.client-D8pFim1L.js +25190 -0
  11. package/dist/{ScaleLine-BiesrgOv.js → ScaleLine-KW-nXqp3.js} +2 -2
  12. package/dist/Swagger.client-B-2Q16qa.js +4 -0
  13. package/dist/{Tile-DCuqwNOI.js → Tile-DbNFNPfU.js} +189 -172
  14. package/dist/{TileImage-CmZf8EdU.js → TileImage-BsXBxMtq.js} +132 -102
  15. package/dist/{View-DcDc7N2K.js → View-BR92hTWP.js} +8 -8
  16. package/dist/{XmlPreview.client-CrjHf74q.js → XmlPreview.client-DWJt61wG.js} +2 -2
  17. package/dist/{common-C4rDcQpp.js → common-PJfpC179.js} +34 -33
  18. package/dist/components-next.css +4 -4
  19. package/dist/components-next.js +1 -1
  20. package/dist/components.css +1 -1
  21. package/dist/{index-Bbu9rOHt.js → index-DVp7Y0Xu.js} +11105 -6743
  22. package/dist/{main-CiH8ZmBI.js → main-CrSRA2X-.js} +22125 -22173
  23. package/dist/{proj-CKwYjU38.js → proj-DsetBcW7.js} +513 -498
  24. package/dist/{tilecoord-YW3qEH_j.js → tilecoord-Db24Px13.js} +242 -224
  25. package/dist/{vue3-xml-viewer.common-Bi_bsV6C.js → vue3-xml-viewer.common-BjA4LdSC.js} +1 -1
  26. package/package.json +2 -1
  27. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +1 -50
  28. package/src/composables/useResourceCapabilities.ts +1 -15
  29. package/src/functions/api.ts +3 -11
  30. package/src/types/resources.ts +0 -10
  31. package/dist/Pmtiles.client-B0v8tGJQ.js +0 -22812
  32. package/dist/Swagger.client-CsK65JnG.js +0 -4
  33. package/src/functions/resourceCapabilities.ts +0 -55
@@ -1,4 +1,4 @@
1
- import { b as Ke } from "./main-CiH8ZmBI.js";
1
+ import { b as Ke } from "./main-CrSRA2X-.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": "1.0.1",
3
+ "version": "1.0.2-dev.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -104,6 +104,7 @@
104
104
  "format": "prettier --write src/",
105
105
  "css": "tailwindcss -i ./assets/main.css -o ./dist/components.css --minify --optimize",
106
106
  "preversion": "pnpm run build && pnpm run css",
107
+ "publish-dev": "pnpm publish --tag dev --access public",
107
108
  "publish-stable": "pnpm publish --access public"
108
109
  }
109
110
  }
@@ -228,52 +228,6 @@
228
228
  />
229
229
  </dd>
230
230
  </template>
231
- <template v-if="wfsFormats.length">
232
- <dt class="font-bold fr-text--sm fr-mb-0">
233
- <div class="flex gap-1 items-center">
234
- {{ t('Formats exportés depuis le service WFS') }}
235
- <span v-if="defaultWfsProjection"> ({{ t('projection {crs}', { crs: defaultWfsProjection }) }})</span>
236
- <Tooltip>
237
- <RiInformationLine
238
- class="flex-none size-4"
239
- :aria-label="t(`Le lien de téléchargement interroge directement le flux WFS distant. Le nombre de features téléchargées peut être limité.`)"
240
- aria-hidden="true"
241
- />
242
- <template #tooltip>
243
- <p class="text-sm font-normal mb-0">
244
- {{ t(`Le lien de téléchargement interroge directement le flux WFS distant.`) }}
245
- </p>
246
- <p class="text-sm font-normal mb-0">
247
- {{ t(`Le nombre de features téléchargées peut être limité.`) }}
248
- </p>
249
- </template>
250
- </Tooltip>
251
- </div>
252
- </dt>
253
- <dd
254
- v-for="wfsFormat in wfsFormats"
255
- :key="wfsFormat.format"
256
- class="text-sm pl-0 mb-4 text-gray-medium h-8 flex flex-wrap items-center"
257
- >
258
- <span>
259
- <span class="text-datagouv fr-icon-download-line fr-icon--sm fr-mr-1v fr-mt-1v" />
260
- <a
261
- :href="wfsFormat.url"
262
- class="fr-link"
263
- rel="ugc nofollow noopener"
264
- @click="trackEvent('Jeux de données', 'Télécharger un fichier', `Bouton : format ${wfsFormat.format}`)"
265
- >
266
- <span>{{ t('Format {format}', { format: wfsFormat.format }) }}</span>
267
- </a>
268
- </span>
269
- <CopyButton
270
- :label="t('Copier le lien')"
271
- :copied-label="t('Lien copié !')"
272
- :text="wfsFormat.url"
273
- class="relative"
274
- />
275
- </dd>
276
- </template>
277
231
  </dl>
278
232
  </div>
279
233
  <div v-if="tab.key === 'swagger'">
@@ -297,7 +251,7 @@
297
251
 
298
252
  <script setup lang="ts">
299
253
  import { computed, defineAsyncComponent } from 'vue'
300
- import { RiDownloadLine, RiFileCopyLine, RiFileWarningLine, RiInformationLine, RiSubtractLine } from '@remixicon/vue'
254
+ import { RiDownloadLine, RiFileCopyLine, RiFileWarningLine, RiSubtractLine } from '@remixicon/vue'
301
255
  import { toast } from 'vue-sonner'
302
256
  import BrandedButton from '../BrandedButton.vue'
303
257
  import CopyButton from '../CopyButton.vue'
@@ -309,7 +263,6 @@ import TabList from '../Tabs/TabList.vue'
309
263
  import Tab from '../Tabs/Tab.vue'
310
264
  import TabPanels from '../Tabs/TabPanels.vue'
311
265
  import TabPanel from '../Tabs/TabPanel.vue'
312
- import Tooltip from '../Tooltip.vue'
313
266
  import Preview from '../ResourceAccordion/Preview.vue'
314
267
  import DataStructure from '../ResourceAccordion/DataStructure.vue'
315
268
  import Metadata from '../ResourceAccordion/Metadata.vue'
@@ -363,8 +316,6 @@ const {
363
316
  ogcService,
364
317
  ogcWms,
365
318
  generatedFormats,
366
- wfsFormats,
367
- defaultWfsProjection,
368
319
  isResourceUrl,
369
320
  tabsOptions,
370
321
  } = useResourceCapabilities(() => props.resource, () => props.dataset)
@@ -4,9 +4,8 @@ import { useTranslation } from './useTranslation'
4
4
  import { useHasTabularData } from './useHasTabularData'
5
5
  import { detectOgcService } from '../functions/resources'
6
6
  import { isOrganizationCertified } from '../functions/organizations'
7
- import type { Resource, WfsMetadata } from '../types/resources'
7
+ import type { Resource } from '../types/resources'
8
8
  import type { Dataset, DatasetV2 } from '../types/datasets'
9
- import { getWfsExportFormats } from '../functions/resourceCapabilities'
10
9
 
11
10
  const GENERATED_FORMATS = ['parquet', 'pmtiles', 'geojson']
12
11
  const URL_FORMATS = ['url', 'doi', 'www:link', 'www:link-1.0-http--link', 'www:link-1.0-http--partners', 'www:link-1.0-http--related', 'www:link-1.0-http--samples']
@@ -68,17 +67,6 @@ export function useResourceCapabilities(
68
67
  return formats
69
68
  })
70
69
 
71
- const wfsFormats = computed(() => {
72
- return getWfsExportFormats(toValue(resource))
73
- })
74
-
75
- const defaultWfsProjection = computed<string | null>(() => {
76
- const r = toValue(resource)
77
- const wfsMetadata = r.extras['analysis:parsing:ogc_metadata'] as WfsMetadata | null
78
- if (!wfsMetadata || wfsMetadata.format !== `wfs`) return null
79
- return wfsMetadata?.detected_layer?.default_crs ?? null
80
- })
81
-
82
70
  const isResourceUrl = computed(() => URL_FORMATS.includes(toValue(resource).format))
83
71
 
84
72
  const tabsOptions = computed(() => {
@@ -123,8 +111,6 @@ export function useResourceCapabilities(
123
111
  ogcService,
124
112
  ogcWms,
125
113
  generatedFormats,
126
- wfsFormats,
127
- defaultWfsProjection,
128
114
  isResourceUrl,
129
115
  tabsOptions,
130
116
  }
@@ -1,17 +1,9 @@
1
- import { ref, toValue, watchEffect, onMounted, type ComputedRef, type MaybeRefOrGetter, type Ref } from 'vue'
1
+ import { ref, toValue, watchEffect, onMounted, type ComputedRef, type Ref } from 'vue'
2
2
  import { ofetch } from 'ofetch'
3
3
  import { useComponentsConfig } from '../config'
4
4
  import { useTranslation } from '../composables/useTranslation'
5
5
  import type { AsyncData, AsyncDataRequestStatus, UseFetchOptions } from './api.types'
6
6
 
7
- function deepToValue(obj: MaybeRefOrGetter<Record<string, unknown> | undefined>): Record<string, unknown> | undefined {
8
- const val = toValue(obj)
9
- if (!val || typeof val !== 'object') return val
10
- return Object.fromEntries(
11
- Object.entries(val).map(([k, v]) => [k, toValue(v as MaybeRefOrGetter<unknown>)]),
12
- )
13
- }
14
-
15
7
  export async function useFetch<DataT, ErrorT = never>(
16
8
  url: string | Request | Ref<string | Request> | ComputedRef<string | null> | (() => string | Request),
17
9
  options?: UseFetchOptions<DataT>,
@@ -31,8 +23,8 @@ export async function useFetch<DataT, ErrorT = never>(
31
23
  const execute = async () => {
32
24
  const urlValue = toValue(url)
33
25
  if (!urlValue) return
34
- const params = deepToValue(options?.params)
35
- const query = deepToValue(options?.query)
26
+ const params = toValue(options?.params)
27
+ const query = toValue(options?.query)
36
28
  status.value = 'pending'
37
29
  try {
38
30
  data.value = await ofetch<DataT | null>(urlValue, {
@@ -41,13 +41,3 @@ export interface ResourceGroup {
41
41
  total: number
42
42
  items: Resource[]
43
43
  }
44
-
45
- export type OgcLayerInfo = { name: string, default_crs: string | null }
46
-
47
- export type WfsMetadata = {
48
- format: string
49
- layers: Array<OgcLayerInfo>
50
- version: string
51
- detected_layer: OgcLayerInfo | null
52
- output_formats: Array<string>
53
- }