@datagouv/components-next 1.4.1-dev.1363.ga6a9113d → 1.4.1-dev.1369.ge90e64f3

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 (43) hide show
  1. package/dist/Datafair.client-Ci2WOgAS.js +28 -0
  2. package/dist/ImagePreview.client-B4RtxuiJ.js +36 -0
  3. package/dist/{JsonPreview.client-DcnN7kTh.js → JsonPreview.client-r7swv2fp.js} +13 -5
  4. package/dist/MapContainer.client-CxH1a8Tn.js +75 -0
  5. package/dist/{PdfPreview.client-D-jPm4dP.js → PdfPreview.client-BjeMcqcy.js} +783 -773
  6. package/dist/{PdfSkeleton-5HBfBlXx.js → PdfSkeleton-CVZxJaeL.js} +1 -1
  7. package/dist/{Pmtiles.client-DBaMKSO-.js → Pmtiles.client-D8idR2l7.js} +44 -44
  8. package/dist/{config-jrnuUDOH.js → PreviewError-Cx7CItT_.js} +11729 -9691
  9. package/dist/PreviewWrapper-Cd1RSmS-.js +62 -0
  10. package/dist/{XmlPreview.client-WnIR6jRO.js → XmlPreview.client-cSebx8br.js} +13 -5
  11. package/dist/components-next.css +1 -1
  12. package/dist/components-next.js +10841 -11704
  13. package/dist/components.css +1 -1
  14. package/dist/france-DPcdJc84.js +75 -0
  15. package/package.json +1 -1
  16. package/src/components/ResourceAccordion/Datafair.client.vue +8 -6
  17. package/src/components/ResourceAccordion/ImagePreview.client.vue +22 -10
  18. package/src/components/ResourceAccordion/JsonPreview.client.vue +2 -0
  19. package/src/components/ResourceAccordion/MapContainer.client.vue +13 -5
  20. package/src/components/ResourceAccordion/PdfPreview.client.vue +15 -0
  21. package/src/components/ResourceAccordion/Pmtiles.client.vue +6 -4
  22. package/src/components/ResourceAccordion/Preview.vue +13 -5
  23. package/src/components/ResourceAccordion/PreviewError.vue +148 -0
  24. package/src/components/ResourceAccordion/PreviewWrapper.vue +63 -20
  25. package/src/components/ResourceAccordion/ResourceAccordion.vue +54 -67
  26. package/src/components/ResourceAccordion/UrlPreview.vue +31 -0
  27. package/src/components/ResourceAccordion/XmlPreview.client.vue +2 -0
  28. package/src/components/ResourceExplorer/ResourceExplorer.vue +3 -1
  29. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +24 -22
  30. package/src/components/TabularExplorer/TabularExplorer.vue +6 -6
  31. package/src/composables/useResourceCapabilities.ts +27 -11
  32. package/src/config.ts +1 -0
  33. package/src/functions/previewErrors.ts +188 -0
  34. package/src/functions/resources.ts +22 -1
  35. package/src/main.ts +1 -0
  36. package/dist/Datafair.client-DV0kxqBW.js +0 -27
  37. package/dist/ImagePreview.client-0mW3sY5X.js +0 -30
  38. package/dist/MapContainer.client-ZoJqauC6.js +0 -74
  39. package/dist/PreviewUnavailable-BJkpCiyL.js +0 -82
  40. package/dist/PreviewWrapper-DEl1D2rR.js +0 -47
  41. package/dist/france-DxksUv5K.js +0 -694
  42. package/dist/resources-CmwQ4DAB.js +0 -316
  43. package/src/components/ResourceAccordion/PreviewUnavailable.vue +0 -22
@@ -1,4 +1,4 @@
1
- import { o as e } from "./PreviewUnavailable-BJkpCiyL.js";
1
+ import { H as e } from "./PreviewError-Cx7CItT_.js";
2
2
  import { createElementBlock as t, createStaticVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, unref as o } from "vue";
3
3
  //#region src/components/ResourceAccordion/PdfSkeleton.vue?vue&type=script&setup=true&lang.ts
4
4
  var s = ["aria-label"], c = /* @__PURE__ */ r({
@@ -1,6 +1,5 @@
1
- import { n as e, o as t, r as n, t as r, u as i } from "./france-DxksUv5K.js";
2
- import { D as a, n as o } from "./config-jrnuUDOH.js";
3
- import { o as s, t as c } from "./PreviewUnavailable-BJkpCiyL.js";
1
+ import { H as e, L as t, M as n, dt as r, t as i } from "./PreviewError-Cx7CItT_.js";
2
+ import { c as a, n as o, r as s, t as c } from "./france-DPcdJc84.js";
4
3
  import { t as l } from "./purify.es-D6pPunDo.js";
5
4
  import { computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, onMounted as v, openBlock as y, ref as b, toDisplayString as x, unref as S, useTemplateRef as C, withCtx as w } from "vue";
6
5
  //#region ../node_modules/fflate/esm/browser.js
@@ -41242,66 +41241,66 @@ var tL = "/assets/maplibre-gl-worker-C24SsKwV.js", nL = {
41242
41241
  dataset: {}
41243
41242
  },
41244
41243
  setup(_) {
41245
- let T = _, { t: E } = s(), { formatDate: D } = i(), O = o(), k = b(!1), A = u(() => T.resource.extras["analysis:parsing:pmtiles_url"] ? T.resource.extras["analysis:parsing:pmtiles_url"] : T.resource.url), j = u(() => O.pmtilesViewerBaseUrl ? `${O.pmtilesViewerBaseUrl}${encodeURIComponent(A.value)}` : null), ee = u(() => T.resource.extras["analysis:parsing:pmtiles_url"] ? D(T.resource.extras["analysis:parsing:finished_at"]) : D(T.resource.last_modified)), te = C("containerRef");
41244
+ let T = _, { t: E } = e(), { formatDate: D } = a(), O = t(), k = b(!1), A = u(() => T.resource.extras["analysis:parsing:pmtiles_url"] ? T.resource.extras["analysis:parsing:pmtiles_url"] : T.resource.url), j = u(() => O.pmtilesViewerBaseUrl ? `${O.pmtilesViewerBaseUrl}${encodeURIComponent(A.value)}` : null), ee = u(() => T.resource.extras["analysis:parsing:pmtiles_url"] ? D(T.resource.extras["analysis:parsing:finished_at"]) : D(T.resource.last_modified)), te = C("containerRef");
41246
41245
  eL(tL);
41247
- let ne = u(() => n(T.dataset));
41246
+ let ne = u(() => s(T.dataset));
41248
41247
  async function re() {
41249
41248
  await Promise.resolve({ });
41250
- let t = new Fe();
41251
- hi("pmtiles", t.tile);
41252
- let n = new ot(A.value);
41253
- t.add(n), n.getHeader().then((t) => {
41254
- let r = t.minLon < t.maxLon && t.minLat < t.maxLat, i = new CI({
41249
+ let e = new Fe();
41250
+ hi("pmtiles", e.tile);
41251
+ let t = new ot(A.value);
41252
+ e.add(t), t.getHeader().then((e) => {
41253
+ let n = e.minLon < e.maxLon && e.minLat < e.maxLat, r = new CI({
41255
41254
  container: te.value,
41256
41255
  style: nL,
41257
- ...r ? {
41258
- bounds: [[t.minLon, t.minLat], [t.maxLon, t.maxLat]],
41256
+ ...n ? {
41257
+ bounds: [[e.minLon, e.minLat], [e.maxLon, e.maxLat]],
41259
41258
  fitBoundsOptions: { padding: 24 }
41260
41259
  } : {
41261
- center: [t.centerLon, t.centerLat],
41262
- zoom: t.centerZoom
41260
+ center: [e.centerLon, e.centerLat],
41261
+ zoom: e.centerZoom
41263
41262
  }
41264
41263
  });
41265
- i.addControl(new TI()), i.addControl(new qI({
41264
+ r.addControl(new TI()), r.addControl(new qI({
41266
41265
  positionOptions: { enableHighAccuracy: !0 },
41267
41266
  trackUserLocation: !0,
41268
41267
  showAccuracyCircle: !1
41269
41268
  }));
41270
- let a = new ZI({
41269
+ let i = new ZI({
41271
41270
  closeButton: !0,
41272
41271
  closeOnClick: !0
41273
41272
  }).addClassName("rounded-full").setMaxWidth("300px");
41274
- function o(e) {
41275
- if (!e.features || !e.features[0]) a.remove();
41273
+ function a(e) {
41274
+ if (!e.features || !e.features[0]) i.remove();
41276
41275
  else {
41277
41276
  let t = e.lngLat, n = Object.keys(e.features[0].properties).map((t) => `<p class="my-0"><b class="font-marianne text-sm" !important;">${l.sanitize(t, { USE_PROFILES: { html: !1 } })} :</b> <span class="font-mono text-xs">${l.sanitize(e.features[0].properties[t], { USE_PROFILES: { html: !1 } })}</span></p>`).join("");
41278
- a.setLngLat(t).setHTML(n).addTo(i);
41277
+ i.setLngLat(t).setHTML(n).addTo(r);
41279
41278
  }
41280
41279
  }
41281
- i.on("load", () => {
41282
- n.getMetadata().then((t) => {
41283
- let n = t;
41284
- i.addSource("pmtiles_source", {
41280
+ r.on("load", () => {
41281
+ t.getMetadata().then((e) => {
41282
+ let t = e;
41283
+ r.addSource("pmtiles_source", {
41285
41284
  type: "vector",
41286
41285
  url: `pmtiles://${A.value}`,
41287
41286
  attribution: ne.value
41288
- }), n.tilestats.layers.forEach((t) => {
41289
- let n = u(() => {
41290
- switch (t.geometry) {
41287
+ }), t.tilestats.layers.forEach((e) => {
41288
+ let t = u(() => {
41289
+ switch (e.geometry) {
41291
41290
  case "Polygon": return "fill";
41292
41291
  case "Point": return "circle";
41293
41292
  case "LineString": return "line";
41294
- default: return e(t.geometry, "Unsupported geometry"), "";
41293
+ default: return o(e.geometry, "Unsupported geometry"), "";
41295
41294
  }
41296
41295
  });
41297
- i.addLayer({
41298
- id: t.layer,
41296
+ r.addLayer({
41297
+ id: e.layer,
41299
41298
  source: "pmtiles_source",
41300
- "source-layer": t.layer,
41301
- type: n.value,
41299
+ "source-layer": e.layer,
41300
+ type: t.value,
41302
41301
  paint: {
41303
- [`${n.value}-color`]: "steelblue",
41304
- [`${n.value}-opacity`]: [
41302
+ [`${t.value}-color`]: "steelblue",
41303
+ [`${t.value}-opacity`]: [
41305
41304
  "interpolate",
41306
41305
  ["linear"],
41307
41306
  ["zoom"],
@@ -41311,10 +41310,10 @@ var tL = "/assets/maplibre-gl-worker-C24SsKwV.js", nL = {
41311
41310
  .6
41312
41311
  ]
41313
41312
  }
41314
- }), i.on("click", t.layer, o), i.on("mouseenter", t.layer, () => {
41315
- i.getCanvas().style.cursor = "pointer";
41316
- }), i.on("mouseleave", t.layer, () => {
41317
- i.getCanvas().style.cursor = "";
41313
+ }), r.on("click", e.layer, a), r.on("mouseenter", e.layer, () => {
41314
+ r.getCanvas().style.cursor = "pointer";
41315
+ }), r.on("mouseleave", e.layer, () => {
41316
+ r.getCanvas().style.cursor = "";
41318
41317
  });
41319
41318
  });
41320
41319
  }).catch(() => k.value = !0);
@@ -41323,18 +41322,19 @@ var tL = "/assets/maplibre-gl-worker-C24SsKwV.js", nL = {
41323
41322
  }
41324
41323
  return v(() => {
41325
41324
  re();
41326
- }), (e, n) => (y(), p("div", rL, [k.value ? (y(), d(c, { key: 0 }, {
41327
- default: w(() => [h(x(S(E)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)]),
41328
- _: 1
41329
- })) : (y(), p("div", iL, [j.value ? (y(), p("div", aL, [m("div", oL, [
41325
+ }), (e, t) => (y(), p("div", rL, [k.value ? (y(), d(i, {
41326
+ key: 0,
41327
+ resource: _.resource,
41328
+ "error-type": "map_load"
41329
+ }, null, 8, ["resource"])) : (y(), p("div", iL, [j.value ? (y(), p("div", aL, [m("div", oL, [
41330
41330
  m("div", {
41331
41331
  class: "fr-col-auto",
41332
- innerHTML: S(r)
41332
+ innerHTML: S(c)
41333
41333
  }, null, 8, sL),
41334
41334
  m("div", cL, [m("p", lL, x(S(E)("Explorer les données en détail")), 1), m("p", uL, x(S(E)("Utiliser un visualisateur PMTiles pour obtenir un aperçu des données.")), 1)]),
41335
- m("p", dL, [g(t, {
41335
+ m("p", dL, [g(n, {
41336
41336
  href: j.value,
41337
- icon: S(a),
41337
+ icon: S(r),
41338
41338
  "icon-right": ""
41339
41339
  }, {
41340
41340
  default: w(() => [h(x(S(E)("Explorer la carte")), 1)]),