@datagouv/components-next 1.0.2-dev.30 → 1.0.2-dev.31

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 (26) hide show
  1. package/dist/{Datafair.client-CSUWxY1U.js → Datafair.client-BzyuQrsK.js} +1 -1
  2. package/dist/JsonPreview.client-CsFH4_pc.js +78 -0
  3. package/dist/{MapContainer.client-B0oJPrx5.js → MapContainer.client-PxTb3GFB.js} +2 -2
  4. package/dist/{PdfPreview.client-B2E_IWUj.js → PdfPreview.client-F9riTFzW.js} +561 -552
  5. package/dist/{Pmtiles.client-STSFvULL.js → Pmtiles.client-BdN6D_o3.js} +1 -1
  6. package/dist/Swagger.client-DRsUsdkD.js +4 -0
  7. package/dist/XmlPreview.client-CLDalkuE.js +70 -0
  8. package/dist/components-next.css +1 -1
  9. package/dist/components-next.js +56 -55
  10. package/dist/{index-kxzw3Ssm.js → index-DwQ7YeNi.js} +1 -1
  11. package/dist/{leaflet-src-DfyFSZpM.js → leaflet-src-DKk3Q492.js} +1 -1
  12. package/dist/{main-BMXOPzsN.js → main-BLApSdTQ.js} +869 -854
  13. package/dist/{vue3-xml-viewer.common-CwN-5lms.js → vue3-xml-viewer.common-DkEC3fSC.js} +1 -1
  14. package/package.json +1 -1
  15. package/src/components/ResourceAccordion/JsonPreview.client.vue +21 -17
  16. package/src/components/ResourceAccordion/Metadata.vue +1 -2
  17. package/src/components/ResourceAccordion/PdfPreview.client.vue +15 -3
  18. package/src/components/ResourceAccordion/ResourceAccordion.vue +1 -2
  19. package/src/components/ResourceAccordion/XmlPreview.client.vue +21 -17
  20. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +1 -2
  21. package/src/config.ts +2 -0
  22. package/src/functions/datasets.ts +0 -17
  23. package/src/functions/resources.ts +56 -1
  24. package/dist/JsonPreview.client-DWP5adeD.js +0 -72
  25. package/dist/Swagger.client-mrRTl6ll.js +0 -4
  26. package/dist/XmlPreview.client-C0zaJXWA.js +0 -64
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as l, computed as a, openBlock as t, createElementBlock as o, createElementVNode as u, createBlock as f, withCtx as p, createTextVNode as m, toDisplayString as _, unref as h } from "vue";
2
- import { a as x, _ as g } from "./main-BMXOPzsN.js";
2
+ import { a as x, _ as g } from "./main-BLApSdTQ.js";
3
3
  const v = { class: "fr-text--xs" }, b = { key: 0 }, k = ["src"], $ = /* @__PURE__ */ l({
4
4
  __name: "Datafair.client",
5
5
  props: {
@@ -0,0 +1,78 @@
1
+ import { defineComponent as S, defineAsyncComponent as z, ref as u, computed as g, onMounted as J, openBlock as r, createElementBlock as m, createVNode as N, unref as s, toDisplayString as l, createBlock as i, withCtx as c, createTextVNode as p, createCommentVNode as b } from "vue";
2
+ import { u as B, a as O, b as V, c as E, _ as d } from "./main-BLApSdTQ.js";
3
+ const L = { class: "fr-text--xs" }, D = { key: 0 }, P = {
4
+ key: 1,
5
+ class: "text-gray-medium"
6
+ }, q = /* @__PURE__ */ S({
7
+ __name: "JsonPreview.client",
8
+ props: {
9
+ resource: {}
10
+ },
11
+ setup(T) {
12
+ const y = z(
13
+ () => import("./vue3-json-viewer-BgCuOAH6.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
14
+ ), f = T, x = B(), { t: a } = O(), o = u(null), h = u(!1), t = u(null), v = u(!1), _ = g(() => V(f.resource)), k = g(() => E(f.resource)), w = g(() => {
15
+ const e = _.value, n = x.maxJsonPreviewCharSize;
16
+ return !e || !n ? !1 : e <= n;
17
+ }), C = async () => {
18
+ if (t.value = null, v.value = !1, !w.value) {
19
+ v.value = !0;
20
+ return;
21
+ }
22
+ if (k.value === "blocked") {
23
+ t.value = "cors";
24
+ return;
25
+ }
26
+ h.value = !0;
27
+ try {
28
+ const e = await fetch(f.resource.url);
29
+ if (!e.ok)
30
+ throw new Error(`HTTP error! status: ${e.status}`);
31
+ const n = await e.json();
32
+ o.value = n;
33
+ } catch (e) {
34
+ console.error("Error loading JSON:", e), e instanceof TypeError ? t.value = "network" : t.value = "generic", o.value = null;
35
+ } finally {
36
+ h.value = !1;
37
+ }
38
+ };
39
+ return J(() => {
40
+ C();
41
+ }), (e, n) => (r(), m("div", L, [
42
+ o.value ? (r(), m("div", D, [
43
+ N(s(y), {
44
+ value: o.value,
45
+ boxed: "",
46
+ sort: "",
47
+ theme: "light",
48
+ "max-depth": 3,
49
+ "expand-depth": 2,
50
+ "indent-width": 2
51
+ }, null, 8, ["value"])
52
+ ])) : h.value ? (r(), m("div", P, l(s(a)("Chargement de l'aperçu JSON...")), 1)) : v.value ? (r(), i(d, { key: 2 }, {
53
+ default: c(() => [
54
+ p(l(_.value ? s(a)("Le fichier JSON est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.") : s(a)("La taille du fichier est inconnue, l'aperçu n'est pas disponible. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
55
+ ]),
56
+ _: 1
57
+ })) : t.value === "cors" ? (r(), i(d, { key: 3 }, {
58
+ default: c(() => [
59
+ p(l(s(a)("Ce fichier JSON ne peut pas être prévisualisé car il est hébergé sur un site distant qui restreint l'accès (CORS). Téléchargez-le depuis l'onglet Téléchargements.")), 1)
60
+ ]),
61
+ _: 1
62
+ })) : t.value === "network" ? (r(), i(d, { key: 4 }, {
63
+ default: c(() => [
64
+ p(l(s(a)("Ce fichier est hébergé sur un site externe qui ne permet pas la prévisualisation. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
65
+ ]),
66
+ _: 1
67
+ })) : t.value ? (r(), i(d, { key: 5 }, {
68
+ default: c(() => [
69
+ p(l(s(a)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
70
+ ]),
71
+ _: 1
72
+ })) : b("", !0)
73
+ ]));
74
+ }
75
+ });
76
+ export {
77
+ q as default
78
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as E, useTemplateRef as G, ref as W, onMounted as B, openBlock as m, createBlock as z, withCtx as N, createTextVNode as U, toDisplayString as V, unref as q, createElementBlock as A } from "vue";
2
- import { a as D, _ as F } from "./main-BMXOPzsN.js";
2
+ import { a as D, _ as F } from "./main-BLApSdTQ.js";
3
3
  const Z = /* @__PURE__ */ E({
4
4
  __name: "MapContainer.client",
5
5
  props: {
@@ -24,7 +24,7 @@ const Z = /* @__PURE__ */ E({
24
24
  import("./Tile-nykTnQlb.js").then((t) => t.d),
25
25
  import("./OSM-FSBCBM2l.js"),
26
26
  // @ts-expect-error no types provided
27
- import("./index-kxzw3Ssm.js")
27
+ import("./index-DwQ7YeNi.js")
28
28
  ]), { CRS: S, GeoportalAttribution: g, GeoportalFullScreen: M, GeoportalZoom: b, LayerImport: v, LayerSwitcher: L } = _;
29
29
  await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), S.load(), e = new s({
30
30
  target: a.value,