@kiva/kv-components 3.38.0 → 3.38.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/CHANGELOG.md +11 -0
- package/package.json +2 -3
- package/vue/.storybook/preview.js +0 -4
- package/vue/KvMap.vue +18 -38
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.38.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.38.0...@kiva/kv-components@3.38.1) (2023-08-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* kvmap component refactor to avoid using vue meta package ([#287](https://github.com/kiva/kv-ui-elements/issues/287)) ([72f5240](https://github.com/kiva/kv-ui-elements/commit/72f524037358f039032ebd1c8d1f4e106ab6ff10))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.38.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.37.0...@kiva/kv-components@3.38.0) (2023-08-29)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"tailwindcss": "^3.0.18",
|
|
43
43
|
"vue": "^2.6.14",
|
|
44
44
|
"vue-loader": "^15.9.6",
|
|
45
|
-
"vue-meta": "^2.4.0",
|
|
46
45
|
"vue-router": "^3.5.2",
|
|
47
46
|
"vue-template-compiler": "^2.6.12"
|
|
48
47
|
},
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"optional": true
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "75d76cdba8cf94ff0ae555f9933fcbd038df8404"
|
|
80
79
|
}
|
|
@@ -3,7 +3,6 @@ import addons from '@storybook/addons';
|
|
|
3
3
|
import KvThemeProvider from '../KvThemeProvider.vue';
|
|
4
4
|
import { defaultTheme, darkTheme } from '@kiva/kv-tokens/configs/kivaColors.cjs';
|
|
5
5
|
import Vue from 'vue';
|
|
6
|
-
import Meta from 'vue-meta';
|
|
7
6
|
import VueCompositionApi from '@vue/composition-api';
|
|
8
7
|
import VueRouter from 'vue-router';
|
|
9
8
|
|
|
@@ -12,9 +11,6 @@ Vue.use(VueCompositionApi);
|
|
|
12
11
|
|
|
13
12
|
Vue.use(VueRouter);
|
|
14
13
|
|
|
15
|
-
// initialize vue-meta
|
|
16
|
-
Vue.use(Meta);
|
|
17
|
-
|
|
18
14
|
export const parameters = {
|
|
19
15
|
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
20
16
|
controls: {
|
package/vue/KvMap.vue
CHANGED
|
@@ -15,43 +15,6 @@
|
|
|
15
15
|
<script>
|
|
16
16
|
export default {
|
|
17
17
|
name: 'KvMap',
|
|
18
|
-
metaInfo() {
|
|
19
|
-
return {
|
|
20
|
-
script: [].concat(!this.hasWebGL ? [
|
|
21
|
-
// leaflet - uses raster tiles for additional browser coverage
|
|
22
|
-
{
|
|
23
|
-
vmid: `leafletjs${this.mapId}`,
|
|
24
|
-
src: 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js',
|
|
25
|
-
async: true,
|
|
26
|
-
defer: true,
|
|
27
|
-
},
|
|
28
|
-
] : []).concat(this.hasWebGL ? [
|
|
29
|
-
// maplibregl - uses vector tiles and webgl for rendering
|
|
30
|
-
{
|
|
31
|
-
vmid: `maplibregljs${this.mapId}`,
|
|
32
|
-
src: 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js',
|
|
33
|
-
async: true,
|
|
34
|
-
defer: true,
|
|
35
|
-
},
|
|
36
|
-
] : []),
|
|
37
|
-
link: [
|
|
38
|
-
].concat(!this.hasWebGL ? [
|
|
39
|
-
// leaflet - uses raster tiles for additional browser coverage
|
|
40
|
-
{
|
|
41
|
-
vmid: `leafletcss${this.mapId}`,
|
|
42
|
-
rel: 'stylesheet',
|
|
43
|
-
href: 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css',
|
|
44
|
-
},
|
|
45
|
-
] : []).concat(this.hasWebGL ? [
|
|
46
|
-
// maplibregl - uses vector tiles and webgl for rendering
|
|
47
|
-
{
|
|
48
|
-
vmid: `maplibreglcss${this.mapId}`,
|
|
49
|
-
rel: 'stylesheet',
|
|
50
|
-
href: 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css',
|
|
51
|
-
},
|
|
52
|
-
] : []),
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
18
|
props: {
|
|
56
19
|
/**
|
|
57
20
|
* Aspect Ration for computed map dimensions
|
|
@@ -245,10 +208,20 @@ export default {
|
|
|
245
208
|
},
|
|
246
209
|
initializeMap() {
|
|
247
210
|
/**
|
|
248
|
-
* This initial checkWebGL() call kicks off the
|
|
211
|
+
* This initial checkWebGL() call kicks off the library asset inclusion
|
|
249
212
|
* We then start polling for the readiness of our selected map library and initialize it once ready
|
|
250
213
|
*/
|
|
214
|
+
const mapScript = document.createElement('script');
|
|
215
|
+
const mapStyle = document.createElement('link');
|
|
216
|
+
mapScript.setAttribute('async', true);
|
|
217
|
+
mapScript.setAttribute('defer', true);
|
|
218
|
+
mapStyle.setAttribute('rel', 'stylesheet');
|
|
251
219
|
if (this.checkWebGL()) {
|
|
220
|
+
mapScript.setAttribute('vmid', `maplibregljs${this.mapId}`);
|
|
221
|
+
mapStyle.setAttribute('vmid', `maplibreglcss${this.mapId}`);
|
|
222
|
+
mapScript.setAttribute('src', 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js');
|
|
223
|
+
mapStyle.setAttribute('href', 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css');
|
|
224
|
+
|
|
252
225
|
this.testDelayedGlobalLibrary('maplibregl').then((response) => {
|
|
253
226
|
if (response.loaded && !this.mapLoaded && !this.useLeaflet && this.lat && this.long) {
|
|
254
227
|
this.initializeMapLibre();
|
|
@@ -256,6 +229,11 @@ export default {
|
|
|
256
229
|
}
|
|
257
230
|
});
|
|
258
231
|
} else {
|
|
232
|
+
mapScript.setAttribute('vmid', `leafletjs${this.mapId}`);
|
|
233
|
+
mapStyle.setAttribute('vmid', `leaftletcss${this.mapId}`);
|
|
234
|
+
mapScript.setAttribute('src', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');
|
|
235
|
+
mapStyle.setAttribute('href', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');
|
|
236
|
+
|
|
259
237
|
this.testDelayedGlobalLibrary('L').then((leafletTest) => {
|
|
260
238
|
if (leafletTest.loaded && !this.mapLoaded && this.lat && this.long) {
|
|
261
239
|
this.initializeLeaflet();
|
|
@@ -263,6 +241,8 @@ export default {
|
|
|
263
241
|
}
|
|
264
242
|
});
|
|
265
243
|
}
|
|
244
|
+
document.head.appendChild(mapScript);
|
|
245
|
+
document.head.appendChild(mapStyle);
|
|
266
246
|
},
|
|
267
247
|
initializeLeaflet() {
|
|
268
248
|
/* eslint-disable no-undef, max-len */
|