@datagouv/components-next 0.0.27 → 0.0.28
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/dist/{JsonPreview.client-LKxB-065.js → JsonPreview.client-CTVlEXLB.js} +1 -1
- package/dist/{MapContainer.client-D9eDI4Vb.js → MapContainer.client-OzbKd1q2.js} +1 -1
- package/dist/{PdfPreview.client-Beh_siOr.js → PdfPreview.client-BJCj1V2Y.js} +1 -1
- package/dist/{Pmtiles.client-C-jRjbtQ.js → Pmtiles.client-BP1vaS18.js} +1 -1
- package/dist/Swagger.client-DxtT4qu8.js +4 -0
- package/dist/{XmlPreview.client-C6J-DwQf.js → XmlPreview.client-CFz4_AKn.js} +2 -2
- package/dist/components-next.js +1 -1
- package/dist/{main-CZXf5f3h.js → main-DsdzSeFn.js} +293 -291
- package/dist/{vue3-xml-viewer.common-Bb5dDJsR.js → vue3-xml-viewer.common-ekkwEa2k.js} +1 -1
- package/package.json +1 -1
- package/src/config.ts +0 -5
- package/src/main.ts +6 -3
- package/dist/Swagger.client-B5lyf4lI.js +0 -4
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -21,11 +21,6 @@ export type PluginConfig = {
|
|
|
21
21
|
maxJsonPreviewSize?: number // Maximum size of JSON to preview in characters
|
|
22
22
|
maxPdfPreviewSize?: number // Maximum size of PDF to preview in bytes
|
|
23
23
|
maxXmlPreviewSize?: number // Maximum size of XML to preview in characters
|
|
24
|
-
i18n?: {
|
|
25
|
-
global: {
|
|
26
|
-
mergeLocaleMessage: (locale: string, messages: unknown) => void
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
export const configKey = Symbol() as InjectionKey<PluginConfig>
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue'
|
|
2
|
-
import { createI18n } from 'vue-i18n'
|
|
2
|
+
import { createI18n, useI18n } from 'vue-i18n'
|
|
3
3
|
import type { ContactPoint, ContactPointRole } from './types/contact_point.js'
|
|
4
4
|
import type { Badge, Badges } from './types/badges'
|
|
5
5
|
import type { Dataset, DatasetV2, DatasetV2WithFullObject, NewDataset, Quality, Rel } from './types/datasets'
|
|
@@ -119,7 +119,11 @@ const datagouv: Plugin<PluginConfig> = {
|
|
|
119
119
|
const textClamp = await import('vue3-text-clamp')
|
|
120
120
|
options.textClamp = textClamp.default
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
try {
|
|
123
|
+
// There is no condition to check if vue-i18n is instancied, only an error...
|
|
124
|
+
useI18n()
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
123
127
|
const i18n = createI18n({
|
|
124
128
|
legacy: false,
|
|
125
129
|
globalInjection: true,
|
|
@@ -130,7 +134,6 @@ const datagouv: Plugin<PluginConfig> = {
|
|
|
130
134
|
fallbackFormat: true,
|
|
131
135
|
fallbackWarn: false,
|
|
132
136
|
})
|
|
133
|
-
options.i18n = i18n
|
|
134
137
|
app.use(i18n)
|
|
135
138
|
}
|
|
136
139
|
},
|