@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 ly, ref as cy, computed as dc, useTemplateRef as uy, onMounted as hy, openBlock as eh, createElementBlock as Mp, createBlock as py, withCtx as rm, createTextVNode as nm, toDisplayString as fc, unref as Gs, createElementVNode as is, createVNode as dy, createCommentVNode as fy } from "vue";
2
- import { g as my, a as gy, c as _y, u as yy, d as xy, e as vy, _ as by, f as wy, h as Ty, K as Sy, t as Py } from "./main-BMXOPzsN.js";
2
+ import { g as my, a as gy, d as _y, u as yy, e as xy, f as vy, _ as by, h as wy, i as Ty, K as Sy, t as Py } from "./main-BLApSdTQ.js";
3
3
  var fn = Uint8Array, Wo = Uint16Array, Iy = Int32Array, mm = new fn([
4
4
  0,
5
5
  0,
@@ -0,0 +1,4 @@
1
+ import { j as f } from "./main-BLApSdTQ.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,70 @@
1
+ import { defineComponent as z, defineAsyncComponent as X, ref as u, computed as v, onMounted as L, openBlock as r, createElementBlock as g, createVNode as S, unref as s, toDisplayString as n, createBlock as i, withCtx as c, createTextVNode as f, createCommentVNode as b } from "vue";
2
+ import { u as B, a as M, b as V, c as E, _ as p } from "./main-BLApSdTQ.js";
3
+ const D = { class: "fr-text--xs" }, N = { key: 0 }, P = {
4
+ key: 1,
5
+ class: "text-gray-medium"
6
+ }, A = /* @__PURE__ */ z({
7
+ __name: "XmlPreview.client",
8
+ props: {
9
+ resource: {}
10
+ },
11
+ setup(T) {
12
+ const x = X(
13
+ () => import("./vue3-xml-viewer.common-DkEC3fSC.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
14
+ ), d = T, y = B(), { t: a } = M(), o = u(null), m = u(!1), t = u(null), h = u(!1), _ = v(() => V(d.resource)), k = v(() => E(d.resource)), w = v(() => {
15
+ const e = _.value, l = y.maxXmlPreviewCharSize;
16
+ return !e || !l ? !1 : e <= l;
17
+ }), C = async () => {
18
+ if (t.value = null, h.value = !1, !w.value) {
19
+ h.value = !0;
20
+ return;
21
+ }
22
+ if (k.value === "blocked") {
23
+ t.value = "cors";
24
+ return;
25
+ }
26
+ m.value = !0;
27
+ try {
28
+ const e = await fetch(d.resource.url);
29
+ if (!e.ok)
30
+ throw new Error(`HTTP error! status: ${e.status}`);
31
+ const l = await e.text();
32
+ o.value = l;
33
+ } catch (e) {
34
+ console.error("Error loading XML:", e), e instanceof TypeError ? t.value = "network" : t.value = "generic", o.value = null;
35
+ } finally {
36
+ m.value = !1;
37
+ }
38
+ };
39
+ return L(() => {
40
+ C();
41
+ }), (e, l) => (r(), g("div", D, [
42
+ o.value ? (r(), g("div", N, [
43
+ S(s(x), { xml: o.value }, null, 8, ["xml"])
44
+ ])) : m.value ? (r(), g("div", P, n(s(a)("Chargement de l'aperçu XML...")), 1)) : h.value ? (r(), i(p, { key: 2 }, {
45
+ default: c(() => [
46
+ f(n(_.value ? s(a)("Le fichier XML 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)
47
+ ]),
48
+ _: 1
49
+ })) : t.value === "cors" ? (r(), i(p, { key: 3 }, {
50
+ default: c(() => [
51
+ f(n(s(a)("Ce fichier XML 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)
52
+ ]),
53
+ _: 1
54
+ })) : t.value === "network" ? (r(), i(p, { key: 4 }, {
55
+ default: c(() => [
56
+ f(n(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)
57
+ ]),
58
+ _: 1
59
+ })) : t.value ? (r(), i(p, { key: 5 }, {
60
+ default: c(() => [
61
+ f(n(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)
62
+ ]),
63
+ _: 1
64
+ })) : b("", !0)
65
+ ]));
66
+ }
67
+ });
68
+ export {
69
+ A as default
70
+ };