@datagouv/components-next 0.0.18 → 0.0.20

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 (31) hide show
  1. package/dist/{JsonPreview.client-DvhnzVAV.js → JsonPreview.client-SDR6QQ7R.js} +33 -32
  2. package/dist/{MapContainer.client-BTa4cY2w.js → MapContainer.client-grQTB4fm.js} +5 -3
  3. package/dist/{PdfPreview.client-CFMYzFUs.js → PdfPreview.client-BD1xfGym.js} +32 -31
  4. package/dist/Pmtiles.client-B3aT7Aun.js +22696 -0
  5. package/dist/Swagger.client-fEwFVkkQ.js +4 -0
  6. package/dist/{XmlPreview.client-0NtLStzb.js → XmlPreview.client-CjNckhEP.js} +27 -26
  7. package/dist/components-next.css +4 -4
  8. package/dist/components-next.js +33 -32
  9. package/dist/main-CgjLq1oz.js +100647 -0
  10. package/dist/{pdf-vue3-D5SzycIl.js → pdf-vue3-Dm2ZCc3P.js} +1 -1
  11. package/dist/{text-clamp.esm-D43nX9La.js → text-clamp.esm-Mb7Qdtu9.js} +5 -5
  12. package/dist/{vue3-json-viewer-BiPkSVJb.js → vue3-json-viewer-B1fiyuLU.js} +100 -100
  13. package/dist/vue3-xml-viewer.common-qOUjnppK.js +759 -0
  14. package/package.json +3 -3
  15. package/src/components/AppLink.vue +1 -1
  16. package/src/components/ResourceAccordion/MapContainer.client.vue +5 -2
  17. package/src/components/ResourceAccordion/Pmtiles.client.vue +11 -4
  18. package/src/components/ResourceAccordion/Preview.vue +1 -1
  19. package/src/components/ResourceAccordion/ResourceAccordion.vue +1 -1
  20. package/src/components/ResourceAccordion/SchemaBadge.vue +1 -1
  21. package/src/components/ResourceAccordion/Swagger.client.vue +1 -0
  22. package/src/components/SmallChart.vue +44 -23
  23. package/src/functions/api.types.ts +4 -4
  24. package/src/functions/dates.ts +3 -3
  25. package/src/functions/matomo.ts +1 -0
  26. package/src/functions/never.ts +3 -0
  27. package/src/main.ts +1 -0
  28. package/dist/Pmtiles.client-CCMKYGsj.js +0 -22377
  29. package/dist/Swagger.client-Ci_pwa2Z.js +0 -4
  30. package/dist/main-BGN65wY4.js +0 -100461
  31. package/dist/vue3-xml-viewer.common-ARb4d9zr.js +0 -5443
@@ -1,51 +1,52 @@
1
- import { d as b, x as S, r as l, c as x, e as C, b as p, f as t, m as f, y as N, q as o, u, C as P, t as i, p as d, g as h, F as m, s as g } from "./main-BGN65wY4.js";
2
- const T = { class: "fr-text--xs" }, $ = { key: 0 }, q = {
1
+ import { defineComponent as b, defineAsyncComponent as S, ref as o, computed as x, onMounted as C, createElementBlock as p, openBlock as n, createBlock as f, createCommentVNode as N, createVNode as a, unref as u, toDisplayString as i, withCtx as d, createElementVNode as m } from "vue";
2
+ import { d as P, a as h, F as v } from "./main-CgjLq1oz.js";
3
+ const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
3
4
  key: 1,
4
5
  class: "text-gray-medium"
5
- }, E = /* @__PURE__ */ b({
6
+ }, O = /* @__PURE__ */ b({
6
7
  __name: "JsonPreview.client",
7
8
  props: {
8
9
  resource: {}
9
10
  },
10
11
  setup(k) {
11
- const z = P(
12
- () => import("./vue3-json-viewer-BiPkSVJb.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
13
- ), r = k, v = S(), a = l(null), c = l(!1), n = l(null), y = l(!1), w = x(() => {
14
- var s;
15
- if (r.resource.filesize)
16
- return r.resource.filesize;
17
- const e = (s = r.resource.extras) == null ? void 0 : s["analysis:content-length"];
12
+ const z = S(
13
+ () => import("./vue3-json-viewer-B1fiyuLU.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
14
+ ), s = k, g = P(), l = o(null), c = o(!1), r = o(null), y = o(!1), w = x(() => {
15
+ var t;
16
+ if (s.resource.filesize)
17
+ return s.resource.filesize;
18
+ const e = (t = s.resource.extras) == null ? void 0 : t["analysis:content-length"];
18
19
  return e && typeof e == "number" ? e : null;
19
20
  }), J = x(() => {
20
21
  const e = w.value;
21
- if (!e || !v.maxJsonPreviewSize)
22
+ if (!e || !g.maxJsonPreviewSize)
22
23
  return !1;
23
- const s = v.maxJsonPreviewSize;
24
- return e <= s;
24
+ const t = g.maxJsonPreviewSize;
25
+ return e <= t;
25
26
  }), _ = async () => {
26
27
  if (!J.value) {
27
28
  y.value = !0;
28
29
  return;
29
30
  }
30
- c.value = !0, n.value = null;
31
+ c.value = !0, r.value = null;
31
32
  try {
32
- const e = await fetch(r.resource.url);
33
+ const e = await fetch(s.resource.url);
33
34
  if (!e.ok)
34
35
  throw new Error(`HTTP error! status: ${e.status}`);
35
- const s = await e.json();
36
- a.value = s;
36
+ const t = await e.json();
37
+ l.value = t;
37
38
  } catch (e) {
38
- console.error("Error loading JSON:", e), e instanceof TypeError ? n.value = "network" : n.value = "generic", a.value = null;
39
+ console.error("Error loading JSON:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", l.value = null;
39
40
  } finally {
40
41
  c.value = !1;
41
42
  }
42
43
  };
43
44
  return C(() => {
44
45
  _();
45
- }), (e, s) => (t(), p("div", T, [
46
- a.value ? (t(), p("div", $, [
47
- o(u(z), {
48
- value: a.value,
46
+ }), (e, t) => (n(), p("div", T, [
47
+ l.value ? (n(), p("div", $, [
48
+ a(u(z), {
49
+ value: l.value,
49
50
  boxed: "",
50
51
  sort: "",
51
52
  theme: "light",
@@ -53,34 +54,34 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, q = {
53
54
  "expand-depth": 2,
54
55
  "indent-width": 2
55
56
  }, null, 8, ["value"])
56
- ])) : c.value ? (t(), p("div", q, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (t(), f(g, {
57
+ ])) : c.value ? (n(), p("div", E, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (n(), f(h, {
57
58
  key: 2,
58
59
  type: "warning",
59
60
  class: "flex items-center space-x-2"
60
61
  }, {
61
62
  default: d(() => [
62
- o(u(m), { class: "shink-0 size-6" }),
63
- h("span", null, i(w.value ? e.$t("Fichier JSON trop volumineux pour l'aperçu. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.") : e.$t("L'aperçu n'est pas disponible car la taille du fichier est inconnue. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
63
+ a(u(v), { class: "shink-0 size-6" }),
64
+ m("span", null, i(w.value ? e.$t("Fichier JSON trop volumineux pour l'aperçu. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.") : e.$t("L'aperçu n'est pas disponible car la taille du fichier est inconnue. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
64
65
  ]),
65
66
  _: 1
66
- })) : n.value === "network" ? (t(), f(g, {
67
+ })) : r.value === "network" ? (n(), f(h, {
67
68
  key: 3,
68
69
  type: "warning",
69
70
  class: "flex items-center space-x-2"
70
71
  }, {
71
72
  default: d(() => [
72
- o(u(m), { class: "shink-0 size-6" }),
73
- h("span", null, i(e.$t("Ce fichier JSON ne peut pas être prévisualisé, peut-être parce qu'il est hébergé sur un autre site qui ne l'autorise pas. Pour le consulter, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
73
+ a(u(v), { class: "shink-0 size-6" }),
74
+ m("span", null, i(e.$t("Ce fichier JSON ne peut pas être prévisualisé, peut-être parce qu'il est hébergé sur un autre site qui ne l'autorise pas. Pour le consulter, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
74
75
  ]),
75
76
  _: 1
76
- })) : n.value ? (t(), f(g, {
77
+ })) : r.value ? (n(), f(h, {
77
78
  key: 4,
78
79
  type: "warning",
79
80
  class: "flex items-center space-x-2"
80
81
  }, {
81
82
  default: d(() => [
82
- o(u(m), { class: "shink-0 size-6" }),
83
- h("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
83
+ a(u(v), { class: "shink-0 size-6" }),
84
+ m("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
84
85
  ]),
85
86
  _: 1
86
87
  })) : N("", !0)
@@ -88,5 +89,5 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, q = {
88
89
  }
89
90
  });
90
91
  export {
91
- E as default
92
+ O as default
92
93
  };
@@ -6,7 +6,8 @@ var si = (i, e, t) => e in i ? ri(i, e, { enumerable: !0, configurable: !0, writ
6
6
  var mt = (i, e, t) => si(i, typeof e != "symbol" ? e + "" : e, t), ai = (i, e, t) => e.has(i) || Rt("Cannot " + t);
7
7
  var Pt = (i, e, t) => e.has(i) ? Rt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t);
8
8
  var ft = (i, e, t) => (ai(i, e, "access private method"), t);
9
- import { j as commonjsGlobal, k as getDefaultExportFromCjs$1, d as defineComponent, l as useI18n, r as ref, e as onMounted, m as createBlock, b as createElementBlock, f as openBlock, p as withCtx, q as createVNode, g as createBaseVNode, u as unref, F as Fe, t as toDisplayString, s as _sfc_main$1 } from "./main-BGN65wY4.js";
9
+ import { defineComponent, useTemplateRef, ref, onMounted, createBlock, createElementBlock, openBlock, withCtx, createVNode, createElementVNode, unref, toDisplayString } from "vue";
10
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs$1, u as useI18n, a as _sfc_main$1, F as Fe } from "./main-CgjLq1oz.js";
10
11
  const ObjectEventType = {
11
12
  /**
12
13
  * Triggered when a property is changed.
@@ -78233,9 +78234,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78233
78234
  setup(i) {
78234
78235
  const e = i, { t } = useI18n();
78235
78236
  let n = null;
78236
- const s = ref(0), o = ref(!1);
78237
+ const s = useTemplateRef("mapRef"), o = ref(!1);
78237
78238
  async function l() {
78238
78239
  await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), CRS.load(), n = new Map$1({
78240
+ // @ts-expect-error null is not happening during onMount
78239
78241
  target: s.value,
78240
78242
  layers: [
78241
78243
  new TileLayer({
@@ -78298,7 +78300,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78298
78300
  }, {
78299
78301
  default: withCtx(() => [
78300
78302
  createVNode(unref(Fe), { class: "shink-0 size-6" }),
78301
- createBaseVNode("span", null, toDisplayString(unref(t)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
78303
+ createElementVNode("span", null, toDisplayString(unref(t)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
78302
78304
  ]),
78303
78305
  _: 1
78304
78306
  })) : (openBlock(), createElementBlock("div", {
@@ -1,40 +1,41 @@
1
- import { d as T, x as $, r as l, c as y, e as q, b as p, f as r, m as f, y as B, q as a, u, C as L, t as c, p as d, g, F as h, s as m } from "./main-BGN65wY4.js";
1
+ import { defineComponent as T, defineAsyncComponent as $, ref as l, computed as y, onMounted as q, createElementBlock as p, openBlock as t, createBlock as f, createCommentVNode as B, createVNode as a, unref as u, toDisplayString as c, withCtx as d, createElementVNode as g } from "vue";
2
+ import { d as L, a as h, F as m } from "./main-CgjLq1oz.js";
2
3
  const O = { class: "text-xs" }, S = { key: 0 }, N = {
3
4
  key: 1,
4
5
  class: "text-gray-medium"
5
- }, A = /* @__PURE__ */ T({
6
+ }, H = /* @__PURE__ */ T({
6
7
  __name: "PdfPreview.client",
7
8
  props: {
8
9
  resource: {}
9
10
  },
10
11
  setup(w) {
11
- const b = L(
12
- () => import("./pdf-vue3-D5SzycIl.js").then((e) => e.default)
13
- ), t = w, k = $(), o = l(!1), i = l(!1), s = l(null), P = l(!1), v = y(() => {
14
- var n;
15
- if (t.resource.filesize)
16
- return t.resource.filesize;
17
- const e = (n = t.resource.extras) == null ? void 0 : n["analysis:content-length"];
12
+ const k = $(
13
+ () => import("./pdf-vue3-Dm2ZCc3P.js").then((e) => e.default)
14
+ ), s = w, b = L(), n = l(!1), i = l(!1), r = l(null), P = l(!1), v = y(() => {
15
+ var o;
16
+ if (s.resource.filesize)
17
+ return s.resource.filesize;
18
+ const e = (o = s.resource.extras) == null ? void 0 : o["analysis:content-length"];
18
19
  return e && typeof e == "number" ? e : null;
19
20
  }), z = y(() => {
20
21
  const e = v.value;
21
22
  if (!e)
22
23
  return !1;
23
- const n = k.maxPdfPreviewSize ?? 1e7;
24
- return e <= n;
24
+ const o = b.maxPdfPreviewSize ?? 1e7;
25
+ return e <= o;
25
26
  }), D = async () => {
26
27
  if (!z.value) {
27
28
  P.value = !0;
28
29
  return;
29
30
  }
30
- i.value = !0, s.value = null;
31
+ i.value = !0, r.value = null;
31
32
  try {
32
- const e = await fetch(t.resource.url, { method: "HEAD" });
33
+ const e = await fetch(s.resource.url, { method: "HEAD" });
33
34
  if (!e.ok)
34
35
  throw new Error(`HTTP error! status: ${e.status}`);
35
- o.value = !0;
36
+ n.value = !0;
36
37
  } catch (e) {
37
- console.error("Error testing PDF URL:", e), e instanceof TypeError ? s.value = "network" : s.value = "generic", o.value = !1;
38
+ console.error("Error testing PDF URL:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", n.value = !1;
38
39
  } finally {
39
40
  i.value = !1;
40
41
  }
@@ -42,19 +43,19 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
42
43
  console.log(`PDF loading progress: ${e}%`);
43
44
  }, C = () => {
44
45
  console.log("PDF download completed");
45
- }, x = (e) => {
46
- console.log(`PDF page changed to: ${e}`);
47
46
  }, _ = (e) => {
47
+ console.log(`PDF page changed to: ${e}`);
48
+ }, x = (e) => {
48
49
  console.log("PDF initialized:", e);
49
50
  }, E = (e) => {
50
- console.error("PDF loading error:", e), e instanceof TypeError ? s.value = "network" : s.value = "generic", o.value = !1;
51
+ console.error("PDF loading error:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", n.value = !1;
51
52
  };
52
53
  return q(() => {
53
54
  D();
54
- }), (e, n) => (r(), p("div", O, [
55
- o.value ? (r(), p("div", S, [
56
- a(u(b), {
57
- src: t.resource.url,
55
+ }), (e, o) => (t(), p("div", O, [
56
+ n.value ? (t(), p("div", S, [
57
+ a(u(k), {
58
+ src: s.resource.url,
58
59
  "show-progress": !0,
59
60
  "progress-color": "#0063cb",
60
61
  "show-page-tooltip": !0,
@@ -69,37 +70,37 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
69
70
  class: "w-full",
70
71
  onOnProgress: F,
71
72
  onOnComplete: C,
72
- onOnPageChange: x,
73
- onOnPdfInit: _,
73
+ onOnPageChange: _,
74
+ onOnPdfInit: x,
74
75
  onOnError: E
75
76
  }, null, 8, ["src"])
76
- ])) : i.value ? (r(), p("div", N, c(e.$t("Chargement de l'aperçu PDF...")), 1)) : P.value ? (r(), f(m, {
77
+ ])) : i.value ? (t(), p("div", N, c(e.$t("Chargement de l'aperçu PDF...")), 1)) : P.value ? (t(), f(h, {
77
78
  key: 2,
78
79
  type: "warning",
79
80
  class: "flex items-center space-x-2"
80
81
  }, {
81
82
  default: d(() => [
82
- a(u(h), { class: "shink-0 size-6" }),
83
+ a(u(m), { class: "shink-0 size-6" }),
83
84
  g("span", null, c(v.value ? e.$t("Fichier PDF trop volumineux pour l'aperçu. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.") : e.$t("L'aperçu n'est pas disponible car la taille du fichier est inconnue. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
84
85
  ]),
85
86
  _: 1
86
- })) : s.value === "network" ? (r(), f(m, {
87
+ })) : r.value === "network" ? (t(), f(h, {
87
88
  key: 3,
88
89
  type: "warning",
89
90
  class: "flex items-center space-x-2"
90
91
  }, {
91
92
  default: d(() => [
92
- a(u(h), { class: "shink-0 size-6" }),
93
+ a(u(m), { class: "shink-0 size-6" }),
93
94
  g("span", null, c(e.$t("Ce fichier PDF ne peut pas être prévisualisé, peut-être parce qu'il est hébergé sur un autre site qui ne l'autorise pas. Pour le consulter, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
94
95
  ]),
95
96
  _: 1
96
- })) : s.value ? (r(), f(m, {
97
+ })) : r.value ? (t(), f(h, {
97
98
  key: 4,
98
99
  type: "warning",
99
100
  class: "flex items-center space-x-2"
100
101
  }, {
101
102
  default: d(() => [
102
- a(u(h), { class: "shink-0 size-6" }),
103
+ a(u(m), { class: "shink-0 size-6" }),
103
104
  g("span", null, c(e.$t("Erreur lors du chargement de l'aperçu PDF. Pour consulter le fichier, téléchargez-le depuis l'onglet Téléchargements.")), 1)
104
105
  ]),
105
106
  _: 1
@@ -108,5 +109,5 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
108
109
  }
109
110
  });
110
111
  export {
111
- A as default
112
+ H as default
112
113
  };