@datagouv/components-next 0.0.32 → 0.1.1
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.
- package/README.md +5 -15
- package/assets/labels/hvd.svg +15 -0
- package/assets/labels/inspire.svg +20 -0
- package/assets/labels/sl.svg +5 -0
- package/assets/labels/spd.svg +5 -0
- package/assets/labels/sr.svg +5 -0
- package/dist/JsonPreview.client-nkpNPvZb.js +92 -0
- package/dist/{MapContainer.client-Dhfz-YU8.js → MapContainer.client-CrTw-ai8.js} +17587 -6826
- package/dist/{PdfPreview.client--W0FK7CN.js → PdfPreview.client-JpAWf0A2.js} +47 -48
- package/dist/{Pmtiles.client-B6vRTwrm.js → Pmtiles.client-B83l4Ft5.js} +7609 -7503
- package/dist/Swagger.client-D1TfRQjI.js +4 -0
- package/dist/XmlPreview.client-DV8N1S9Y.js +84 -0
- package/dist/components-next.css +6 -6
- package/dist/components-next.js +95 -80
- package/dist/components.css +2 -2
- package/dist/en-CuSmdvir.js +30 -0
- package/dist/hvd-DYeke1vM.js +4 -0
- package/dist/inspire-BLXeJvob.js +4 -0
- package/dist/{main-yWiuApVL.js → main-CN6IuSUA.js} +53400 -55985
- package/dist/{pdf-vue3-Dm2ZCc3P.js → pdf-vue3-IkJO65RH.js} +2 -2
- package/dist/{pdf.min-f72cfa08-DAetWL3M.js → pdf.min-f72cfa08-CdgJTooZ.js} +78 -78
- package/dist/sl-VR8Tb1_u.js +4 -0
- package/dist/spd-BJ-Omhgt.js +4 -0
- package/dist/sr-DjSF-8xW.js +4 -0
- package/dist/{text-clamp.esm-Mb7Qdtu9.js → text-clamp.esm-B5kW_XMt.js} +54 -55
- package/dist/{vue3-json-viewer-B1fiyuLU.js → vue3-json-viewer-BXwup7nO.js} +88 -93
- package/dist/{vue3-xml-viewer.common-1QyofKqS.js → vue3-xml-viewer.common-9hga4rGF.js} +54 -54
- package/package.json +12 -11
- package/src/components/ActivityList/ActivityList.vue +159 -0
- package/src/components/ActivityList/UserActivityList.vue +30 -0
- package/src/components/AppLink.vue +3 -3
- package/src/components/Avatar.vue +1 -0
- package/src/components/DataserviceCard.vue +3 -3
- package/src/components/DatasetCard.vue +19 -18
- package/src/components/DatasetInformationPanel.vue +16 -16
- package/src/components/DatasetLabelTag.vue +40 -0
- package/src/components/DatasetQuality.vue +13 -10
- package/src/components/DatasetQualityInline.vue +5 -2
- package/src/components/DatasetQualityScore.vue +3 -3
- package/src/components/DatasetQualityTooltipContent.vue +2 -2
- package/src/components/DateRangeDetails.vue +7 -3
- package/src/components/ExtraAccordion.vue +3 -1
- package/src/components/OrganizationNameWithCertificate.vue +2 -2
- package/src/components/PaddedContainer.vue +28 -0
- package/src/components/Pagination.vue +2 -2
- package/src/components/Placeholder.vue +1 -1
- package/src/components/ReadMore.vue +17 -17
- package/src/components/ResourceAccordion/DataStructure.vue +8 -3
- package/src/components/ResourceAccordion/EditButton.vue +2 -2
- package/src/components/ResourceAccordion/JsonPreview.client.vue +7 -5
- package/src/components/ResourceAccordion/MapContainer.client.vue +2 -2
- package/src/components/ResourceAccordion/Metadata.vue +10 -10
- package/src/components/ResourceAccordion/PdfPreview.client.vue +7 -5
- package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -3
- package/src/components/ResourceAccordion/Preview.vue +2 -2
- package/src/components/ResourceAccordion/ResourceAccordion.vue +23 -15
- package/src/components/ResourceAccordion/SchemaBadge.vue +4 -4
- package/src/components/ResourceAccordion/XmlPreview.client.vue +7 -5
- package/src/components/ReuseCard.vue +3 -3
- package/src/components/ReuseDetails.vue +2 -2
- package/src/components/SmallChart.vue +33 -30
- package/src/components/StatBox.vue +12 -7
- package/src/components/Toggletip.vue +0 -1
- package/src/components/TranslationT.vue +51 -0
- package/src/composables/useTranslation.ts +169 -0
- package/src/functions/activities.ts +36 -0
- package/src/functions/api.ts +4 -4
- package/src/functions/datasets.ts +28 -0
- package/src/functions/dates.ts +4 -4
- package/src/functions/helpers.ts +3 -3
- package/src/functions/organizations.ts +2 -2
- package/src/functions/pagination.ts +9 -0
- package/src/functions/resources.ts +2 -2
- package/src/functions/reuses.ts +3 -3
- package/src/main.ts +24 -20
- package/src/types/activity.ts +24 -0
- package/src/types/api.ts +8 -0
- package/src/types/badges.ts +4 -0
- package/src/types/dataservices.ts +6 -8
- package/src/types/datasets.ts +6 -1
- package/src/types/site.ts +1 -0
- package/src/types/topics.ts +17 -2
- package/dist/JsonPreview.client-BRhCOHlE.js +0 -93
- package/dist/Swagger.client-ch5H8aT2.js +0 -4
- package/dist/XmlPreview.client-BcbnRWAp.js +0 -85
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Organization } from './organizations'
|
|
2
|
+
import type { User } from './users'
|
|
3
|
+
|
|
4
|
+
export type ActivityKey = 'dataset:created' | 'dataset:updated' | 'dataset:deleted' | 'dataset:discussed' | 'dataset:followed'
|
|
5
|
+
| 'dataset:resource:added' | 'dataset:resource:updated' | 'dataset:resource:deleted'
|
|
6
|
+
| 'dataservice:created' | 'dataservice:updated' | 'dataservice:deleted' | 'dataservice:discussed' | 'dataservice:followed'
|
|
7
|
+
| 'organization:created' | 'organization:updated' | 'organization:followed'
|
|
8
|
+
| 'reuse:created' | 'reuse:updated' | 'reuse:deleted' | 'reuse:discussed' | 'reuse:followed'
|
|
9
|
+
| 'user:followed' | 'topic:created' | 'topic:updated'
|
|
10
|
+
|
|
11
|
+
export type Activity = {
|
|
12
|
+
actor: User
|
|
13
|
+
organization: Organization | null
|
|
14
|
+
related_to: string
|
|
15
|
+
related_to_id: string
|
|
16
|
+
related_to_kind: string
|
|
17
|
+
related_to_url: string
|
|
18
|
+
created_at: string
|
|
19
|
+
label: string
|
|
20
|
+
key: ActivityKey
|
|
21
|
+
icon: string
|
|
22
|
+
extras: Record<string, unknown>
|
|
23
|
+
changes?: Array<string>
|
|
24
|
+
}
|
package/src/types/api.ts
ADDED
package/src/types/badges.ts
CHANGED
|
@@ -43,14 +43,12 @@ export type Dataservice = Owned & {
|
|
|
43
43
|
base_api_url: string | null
|
|
44
44
|
contact_points: Array<ContactPoint>
|
|
45
45
|
created_at: string
|
|
46
|
-
datasets:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
uri: string
|
|
53
|
-
}>
|
|
46
|
+
datasets: {
|
|
47
|
+
href: string
|
|
48
|
+
rel: 'subsection'
|
|
49
|
+
total: number
|
|
50
|
+
type: 'GET'
|
|
51
|
+
}
|
|
54
52
|
deleted_at: string | null
|
|
55
53
|
description: string
|
|
56
54
|
featured: boolean
|
package/src/types/datasets.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type BaseDataset = Owned & {
|
|
|
27
27
|
acronym: string
|
|
28
28
|
archived: boolean
|
|
29
29
|
description: string
|
|
30
|
+
description_short: string
|
|
30
31
|
tags: Array<string> | null
|
|
31
32
|
license: string
|
|
32
33
|
frequency: string
|
|
@@ -65,6 +66,10 @@ export type Dataset = BaseDataset & {
|
|
|
65
66
|
created_at: string
|
|
66
67
|
last_modified: string
|
|
67
68
|
last_update: string
|
|
69
|
+
internal: {
|
|
70
|
+
created_at_internal: string
|
|
71
|
+
last_modified_internal: string
|
|
72
|
+
}
|
|
68
73
|
uri: string
|
|
69
74
|
slug: string
|
|
70
75
|
quality: Quality
|
|
@@ -88,7 +93,7 @@ export type DatasetV2 = Owned & Omit<Dataset, 'resources' | 'community_resources
|
|
|
88
93
|
community_resources: Rel
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
export type DatasetV2WithFullObject = Omit<DatasetV2, 'license' | 'frequency' | 'spatial'> & {
|
|
96
|
+
export type DatasetV2WithFullObject = Owned & Omit<DatasetV2, 'license' | 'frequency' | 'spatial'> & {
|
|
92
97
|
license: License
|
|
93
98
|
frequency: Frequency
|
|
94
99
|
spatial: {
|
package/src/types/site.ts
CHANGED
package/src/types/topics.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import type { Rel } from './datasets'
|
|
2
2
|
import type { Owned } from './owned'
|
|
3
3
|
|
|
4
|
+
export type TopicElementClass = 'Dataset' | 'Reuse'
|
|
5
|
+
|
|
6
|
+
export type TopicElementRel = {
|
|
7
|
+
id: string
|
|
8
|
+
class: TopicElementClass
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type TopicElement = {
|
|
12
|
+
id: string
|
|
13
|
+
title?: string
|
|
14
|
+
description?: string
|
|
15
|
+
tags: Array<string>
|
|
16
|
+
extras: Record<string, unknown>
|
|
17
|
+
element: TopicElementRel
|
|
18
|
+
}
|
|
19
|
+
|
|
4
20
|
export type TopicV2 = Owned & {
|
|
5
21
|
id: string
|
|
6
22
|
name: string
|
|
7
23
|
slug: string
|
|
8
24
|
description: string
|
|
9
25
|
tags: Array<string>
|
|
10
|
-
|
|
11
|
-
reuses: Rel
|
|
26
|
+
elements: Rel
|
|
12
27
|
featured: boolean
|
|
13
28
|
private: boolean
|
|
14
29
|
created_at: string
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, defineAsyncComponent as C, ref as o, computed as x, onMounted as S, 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 h } from "vue";
|
|
2
|
-
import { d as P, a as m, F as v } from "./main-yWiuApVL.js";
|
|
3
|
-
const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
|
|
4
|
-
key: 1,
|
|
5
|
-
class: "text-gray-medium"
|
|
6
|
-
}, O = /* @__PURE__ */ b({
|
|
7
|
-
__name: "JsonPreview.client",
|
|
8
|
-
props: {
|
|
9
|
-
resource: {}
|
|
10
|
-
},
|
|
11
|
-
setup(k) {
|
|
12
|
-
const z = C(
|
|
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"];
|
|
19
|
-
return e && typeof e == "number" ? e : null;
|
|
20
|
-
}), J = x(() => {
|
|
21
|
-
const e = w.value;
|
|
22
|
-
if (!e || !g.maxJsonPreviewCharSize)
|
|
23
|
-
return !1;
|
|
24
|
-
const t = g.maxJsonPreviewCharSize;
|
|
25
|
-
return e <= t;
|
|
26
|
-
}), _ = async () => {
|
|
27
|
-
if (!J.value) {
|
|
28
|
-
y.value = !0;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
c.value = !0, r.value = null;
|
|
32
|
-
try {
|
|
33
|
-
const e = await fetch(s.resource.url);
|
|
34
|
-
if (!e.ok)
|
|
35
|
-
throw new Error(`HTTP error! status: ${e.status}`);
|
|
36
|
-
const t = await e.json();
|
|
37
|
-
l.value = t;
|
|
38
|
-
} catch (e) {
|
|
39
|
-
console.error("Error loading JSON:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", l.value = null;
|
|
40
|
-
} finally {
|
|
41
|
-
c.value = !1;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
return S(() => {
|
|
45
|
-
_();
|
|
46
|
-
}), (e, t) => (n(), p("div", T, [
|
|
47
|
-
l.value ? (n(), p("div", $, [
|
|
48
|
-
a(u(z), {
|
|
49
|
-
value: l.value,
|
|
50
|
-
boxed: "",
|
|
51
|
-
sort: "",
|
|
52
|
-
theme: "light",
|
|
53
|
-
"max-depth": 3,
|
|
54
|
-
"expand-depth": 2,
|
|
55
|
-
"indent-width": 2
|
|
56
|
-
}, null, 8, ["value"])
|
|
57
|
-
])) : c.value ? (n(), p("div", E, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (n(), f(m, {
|
|
58
|
-
key: 2,
|
|
59
|
-
type: "warning",
|
|
60
|
-
class: "flex items-center space-x-2"
|
|
61
|
-
}, {
|
|
62
|
-
default: d(() => [
|
|
63
|
-
a(u(v), { class: "shink-0 size-6" }),
|
|
64
|
-
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)
|
|
65
|
-
]),
|
|
66
|
-
_: 1
|
|
67
|
-
})) : r.value === "network" ? (n(), f(m, {
|
|
68
|
-
key: 3,
|
|
69
|
-
type: "warning",
|
|
70
|
-
class: "flex items-center space-x-2"
|
|
71
|
-
}, {
|
|
72
|
-
default: d(() => [
|
|
73
|
-
a(u(v), { class: "shink-0 size-6" }),
|
|
74
|
-
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)
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
})) : r.value ? (n(), f(m, {
|
|
78
|
-
key: 4,
|
|
79
|
-
type: "warning",
|
|
80
|
-
class: "flex items-center space-x-2"
|
|
81
|
-
}, {
|
|
82
|
-
default: d(() => [
|
|
83
|
-
a(u(v), { class: "shink-0 size-6" }),
|
|
84
|
-
h("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
})) : N("", !0)
|
|
88
|
-
]));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
export {
|
|
92
|
-
O as default
|
|
93
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, defineAsyncComponent as b, ref as a, computed as w, onMounted as L, createElementBlock as p, openBlock as r, createBlock as f, createCommentVNode as P, createVNode as o, unref as u, toDisplayString as i, withCtx as m, createElementVNode as h } from "vue";
|
|
2
|
-
import { d as T, a as d, F as v } from "./main-yWiuApVL.js";
|
|
3
|
-
const $ = { class: "fr-text--xs" }, E = { key: 0 }, M = {
|
|
4
|
-
key: 1,
|
|
5
|
-
class: "text-gray-medium"
|
|
6
|
-
}, S = /* @__PURE__ */ C({
|
|
7
|
-
__name: "XmlPreview.client",
|
|
8
|
-
props: {
|
|
9
|
-
resource: {}
|
|
10
|
-
},
|
|
11
|
-
setup(k) {
|
|
12
|
-
const z = b(
|
|
13
|
-
() => import("./vue3-xml-viewer.common-1QyofKqS.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
|
|
14
|
-
), n = k, g = T(), s = a(null), c = a(!1), l = a(null), y = a(!1), x = w(() => {
|
|
15
|
-
var t;
|
|
16
|
-
if (n.resource.filesize)
|
|
17
|
-
return n.resource.filesize;
|
|
18
|
-
const e = (t = n.resource.extras) == null ? void 0 : t["analysis:content-length"];
|
|
19
|
-
return e && typeof e == "number" ? e : null;
|
|
20
|
-
}), X = w(() => {
|
|
21
|
-
const e = x.value;
|
|
22
|
-
if (!e || !g.maxXmlPreviewCharSize)
|
|
23
|
-
return !1;
|
|
24
|
-
const t = g.maxXmlPreviewCharSize;
|
|
25
|
-
return e <= t;
|
|
26
|
-
}), _ = async () => {
|
|
27
|
-
if (!X.value) {
|
|
28
|
-
y.value = !0;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
c.value = !0, l.value = null;
|
|
32
|
-
try {
|
|
33
|
-
const e = await fetch(n.resource.url);
|
|
34
|
-
if (!e.ok)
|
|
35
|
-
throw new Error(`HTTP error! status: ${e.status}`);
|
|
36
|
-
const t = await e.text();
|
|
37
|
-
s.value = t;
|
|
38
|
-
} catch (e) {
|
|
39
|
-
console.error("Error loading XML:", e), e instanceof TypeError ? l.value = "network" : l.value = "generic", s.value = null;
|
|
40
|
-
} finally {
|
|
41
|
-
c.value = !1;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
return L(() => {
|
|
45
|
-
_();
|
|
46
|
-
}), (e, t) => (r(), p("div", $, [
|
|
47
|
-
s.value ? (r(), p("div", E, [
|
|
48
|
-
o(u(z), { xml: s.value }, null, 8, ["xml"])
|
|
49
|
-
])) : c.value ? (r(), p("div", M, i(e.$t("Chargement de l'aperçu XML...")), 1)) : y.value ? (r(), f(d, {
|
|
50
|
-
key: 2,
|
|
51
|
-
type: "warning",
|
|
52
|
-
class: "flex items-center space-x-2"
|
|
53
|
-
}, {
|
|
54
|
-
default: m(() => [
|
|
55
|
-
o(u(v), { class: "shink-0 size-6" }),
|
|
56
|
-
h("span", null, i(x.value ? e.$t("Fichier XML 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)
|
|
57
|
-
]),
|
|
58
|
-
_: 1
|
|
59
|
-
})) : l.value === "network" ? (r(), f(d, {
|
|
60
|
-
key: 3,
|
|
61
|
-
type: "warning",
|
|
62
|
-
class: "flex items-center space-x-2"
|
|
63
|
-
}, {
|
|
64
|
-
default: m(() => [
|
|
65
|
-
o(u(v), { class: "shink-0 size-6" }),
|
|
66
|
-
h("span", null, i(e.$t("Ce fichier XML 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)
|
|
67
|
-
]),
|
|
68
|
-
_: 1
|
|
69
|
-
})) : l.value ? (r(), f(d, {
|
|
70
|
-
key: 4,
|
|
71
|
-
type: "warning",
|
|
72
|
-
class: "flex items-center space-x-2"
|
|
73
|
-
}, {
|
|
74
|
-
default: m(() => [
|
|
75
|
-
o(u(v), { class: "shink-0 size-6" }),
|
|
76
|
-
h("span", null, i(e.$t("Erreur lors du chargement de l'aperçu XML.")), 1)
|
|
77
|
-
]),
|
|
78
|
-
_: 1
|
|
79
|
-
})) : P("", !0)
|
|
80
|
-
]));
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
export {
|
|
84
|
-
S as default
|
|
85
|
-
};
|