@vcmap/ui 5.1.0-rc.3 → 5.1.0

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 (33) hide show
  1. package/build/getPluginProxies.js +16 -2
  2. package/config/www.config.json +7 -0
  3. package/dist/assets/cesium.js +1 -1
  4. package/dist/assets/{core.ee9f31.js → core.8fff97.js} +3592 -3536
  5. package/dist/assets/core.js +1 -1
  6. package/dist/assets/index-de529e1b.js +1 -0
  7. package/dist/assets/ol.js +1 -1
  8. package/dist/assets/{ui.7d2c2e.js → ui.301d83.js} +551 -508
  9. package/dist/assets/ui.js +1 -1
  10. package/dist/assets/vue.js +2 -2
  11. package/dist/assets/{vuetify.d22222.js → vuetify.2fbc17.js} +1 -1
  12. package/dist/assets/vuetify.js +2 -2
  13. package/dist/index.html +1 -1
  14. package/index.d.ts +2 -2
  15. package/index.js +4 -1
  16. package/package.json +3 -3
  17. package/plugins/package.json +4 -2
  18. package/src/components/flight/VcsFlightComponent.vue +1 -0
  19. package/src/components/import/ImportComponent.vue +13 -2
  20. package/src/components/import/ImportComponent.vue.d.ts +1 -1
  21. package/src/contentTree/contentTreeCollection.js +6 -1
  22. package/src/manager/collectionManager/categoryManager.d.ts +17 -0
  23. package/src/manager/collectionManager/categoryManager.js +41 -3
  24. package/src/manager/collectionManager/collectionComponentClass.d.ts +7 -0
  25. package/src/manager/collectionManager/collectionComponentClass.js +34 -1
  26. package/src/vcsUiApp.d.ts +2 -1
  27. package/src/vcsUiApp.js +9 -2
  28. package/dist/assets/index-94e13552.js +0 -1
  29. /package/dist/assets/{cesium.271bcd.js → cesium.f4573f.js} +0 -0
  30. /package/dist/assets/{ol.d99267.js → ol.25a933.js} +0 -0
  31. /package/dist/assets/{ui.7d2c2e.css → ui.301d83.css} +0 -0
  32. /package/dist/assets/{vue.e8ee6a.js → vue.806e32.js} +0 -0
  33. /package/dist/assets/{vuetify.d22222.css → vuetify.2fbc17.css} +0 -0
package/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui.7d2c2e.js";
1
+ export * from "./ui.301d83.js";
@@ -1,5 +1,5 @@
1
- export * from "./vue.e8ee6a.js";
2
- import { default as f } from "./vue.e8ee6a.js";
1
+ export * from "./vue.806e32.js";
2
+ import { default as f } from "./vue.806e32.js";
3
3
  export {
4
4
  f as default
5
5
  };
@@ -13,7 +13,7 @@ function loadCss(href) {
13
13
  elem.onerror = reject;
14
14
  document.head.appendChild(elem);
15
15
  });
16
- } await loadCss('./assets/vuetify.d22222.css');import v from "./vue.e8ee6a.js";
16
+ } await loadCss('./assets/vuetify.2fbc17.css');import v from "./vue.806e32.js";
17
17
  const Ne = v.extend().extend({
18
18
  name: "themeable",
19
19
  provide() {
@@ -1,5 +1,5 @@
1
- export * from "./vuetify.d22222.js";
2
- import { default as f } from "./vuetify.d22222.js";
1
+ export * from "./vuetify.2fbc17.js";
2
+ import { default as f } from "./vuetify.2fbc17.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/dist/index.html CHANGED
@@ -91,7 +91,7 @@
91
91
  }
92
92
  }
93
93
  </style>
94
- <script type="module" crossorigin src="./assets/index-94e13552.js"></script>
94
+ <script type="module" crossorigin src="./assets/index-de529e1b.js"></script>
95
95
  </head>
96
96
  <body style="height: 100vh; margin: 0;">
97
97
  <noscript>
package/index.d.ts CHANGED
@@ -52,8 +52,6 @@ export { default as CollectionManagerComponent } from "./src/manager/collectionM
52
52
  export type * from "./src/manager/collectionManager/CollectionManager.vue.d.ts";
53
53
  export { default as CollectionComponentProvider } from "./src/manager/collectionManager/CollectionComponentProvider.vue";
54
54
  export type * from "./src/manager/collectionManager/CollectionComponentProvider.vue.d.ts";
55
- export { default as CollectionComponentClass } from "./src/manager/collectionManager/collectionComponentClass.js";
56
- export type * from "./src/manager/collectionManager/collectionComponentClass.d.ts";
57
55
  export { default as CollectionComponent } from "./src/manager/collectionManager/CollectionComponent.vue";
58
56
  export type * from "./src/manager/collectionManager/CollectionComponent.vue.d.ts";
59
57
  export { default as CollectionComponentList } from "./src/manager/collectionManager/CollectionComponentList.vue";
@@ -218,6 +216,8 @@ export { default as NavbarManager, ButtonLocation, getActionsByLocation } from "
218
216
  export type * from "./src/manager/navbarManager.d.ts";
219
217
  export { default as ToolboxManager, ToolboxType, defaultToolboxName } from "./src/manager/toolbox/toolboxManager.js";
220
218
  export type * from "./src/manager/toolbox/toolboxManager.d.ts";
219
+ export { default as CollectionComponentClass, createSupportedMapMappingFunction } from "./src/manager/collectionManager/collectionComponentClass.js";
220
+ export type * from "./src/manager/collectionManager/collectionComponentClass.d.ts";
221
221
  export { makeEditorCollectionComponentClass, isEditorCollectionComponentClass } from "./src/manager/collectionManager/editorCollectionComponentClass.js";
222
222
  export type * from "./src/manager/collectionManager/editorCollectionComponentClass.d.ts";
223
223
  export { applyKeyMapping, applyValueMapping, default as AbstractFeatureInfoView } from "./src/featureInfo/abstractFeatureInfoView.js";
package/index.js CHANGED
@@ -111,7 +111,10 @@ export { default as CategoryManager } from './src/manager/collectionManager/cate
111
111
  export { default as CollectionManager } from './src/manager/collectionManager/collectionManager.js';
112
112
  export { default as CollectionManagerComponent } from './src/manager/collectionManager/CollectionManager.vue';
113
113
  export { default as CollectionComponentProvider } from './src/manager/collectionManager/CollectionComponentProvider.vue';
114
- export { default as CollectionComponentClass } from './src/manager/collectionManager/collectionComponentClass.js';
114
+ export {
115
+ default as CollectionComponentClass,
116
+ createSupportedMapMappingFunction,
117
+ } from './src/manager/collectionManager/collectionComponentClass.js';
115
118
  export {
116
119
  makeEditorCollectionComponentClass,
117
120
  isEditorCollectionComponentClass,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "5.1.0-rc.3",
3
+ "version": "5.1.0",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "lint": "npm run lint:js && npm run lint:prettier && npm run lint:types",
20
20
  "format": "prettier --write --list-different . && npm run lint:js -- --fix",
21
21
  "prepack": "node build/build.js && node build/buildTypes.js",
22
- "install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force --include optional"
22
+ "install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@vcmap-cesium/engine": "^4.0.3",
56
- "@vcmap/core": "^5.1.0-rc.3",
56
+ "@vcmap/core": "^5.1.0",
57
57
  "ol": "^7.5.2",
58
58
  "vue": "~2.7.3",
59
59
  "vuetify": "~2.6.7"
@@ -3,7 +3,7 @@
3
3
  "@vcmap/print": "^1.0.2",
4
4
  "@vcmap/swipe-tool": "^1.0.3",
5
5
  "@vcmap/export": "^1.0.1",
6
- "@vcmap/shadow": "^1.0.1",
6
+ "@vcmap/shadow": "^2.0.0",
7
7
  "@vcmap/draw": "^2.0.0",
8
8
  "@vcmap/create-link": "^1.0.1",
9
9
  "@vcmap/search-nominatim": "^1.0.1",
@@ -13,5 +13,7 @@
13
13
  "@vcmap/measurement": "^1.0.2",
14
14
  "@vcmap/flight": "^1.0.1"
15
15
  },
16
- "optionalDependencies": {}
16
+ "optionalDependencies": {
17
+ "@vcmap/planning": "^5.0.1"
18
+ }
17
19
  }
@@ -74,6 +74,7 @@
74
74
  unit="s"
75
75
  step="1"
76
76
  :decimals="2"
77
+ :disabled="disablePlayer"
77
78
  :rules="[durationRule]"
78
79
  />
79
80
  </v-col>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <script>
25
25
  import { VCard } from 'vuetify/lib';
26
- import { inject, ref } from 'vue';
26
+ import { computed, inject, ref } from 'vue';
27
27
  import FileDrop from './FileDrop.vue';
28
28
  import VcsFormButton from '../buttons/VcsFormButton.vue';
29
29
  import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
@@ -53,7 +53,18 @@
53
53
  },
54
54
  setup(props, { emit }) {
55
55
  const app = inject('vcsApp');
56
- const files = ref([]);
56
+ const localFiles = ref([]);
57
+ /**
58
+ * @type {WritableComputedRef<Array<File>>}
59
+ */
60
+ const files = computed({
61
+ get() {
62
+ return localFiles.value;
63
+ },
64
+ set(value) {
65
+ localFiles.value = Array.isArray(value) ? value : [value];
66
+ },
67
+ });
57
68
 
58
69
  return {
59
70
  files,
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  default: boolean;
13
13
  };
14
14
  }, {
15
- files: import("vue").Ref<never[]>;
15
+ files: WritableComputedRef<File[]>;
16
16
  doImport(): Promise<void>;
17
17
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
18
18
  importFiles: {
@@ -85,7 +85,12 @@ class ContentTreeCollection extends IndexedCollection {
85
85
  * @private
86
86
  */
87
87
  this._defaultSubtreeItem = new SubContentTreeItem(
88
- { name: 'Content', icon: '$vcsLayers', title: 'content.title' },
88
+ {
89
+ name: 'Content',
90
+ icon: '$vcsLayers',
91
+ title: 'content.title',
92
+ tooltip: 'content.title',
93
+ },
89
94
  app,
90
95
  );
91
96
  /**
@@ -6,6 +6,8 @@ export type ICategoryManager = import("../../vcsUiApp.js").VcsComponentManager<i
6
6
  /**
7
7
  * Manages all requested category collections.
8
8
  * Provides an API to add/remove collectionsComponents.
9
+ * Per default only items of the defaultDynamicModuleId are shown in the CategoryManager.
10
+ * Further modules can be supported using the addModuleId API.
9
11
  * @implements {ICategoryManager}
10
12
  * @extends CollectionManager
11
13
  */
@@ -27,6 +29,11 @@ declare class CategoryManager extends CollectionManager implements ICategoryMana
27
29
  * @private
28
30
  */
29
31
  private _dynamicModuleId;
32
+ /**
33
+ * @type {string[]}
34
+ * @private
35
+ */
36
+ private _moduleIds;
30
37
  /**
31
38
  * @param {Object} item
32
39
  * @return {boolean}
@@ -52,5 +59,15 @@ declare class CategoryManager extends CollectionManager implements ICategoryMana
52
59
  collectionComponent: import("./collectionComponentClass.js").default<T>;
53
60
  category: import("@vcmap/core/dist/src/category/category.js").default<T>;
54
61
  }>;
62
+ /**
63
+ * Updates the filterFunction for added moduleIds.
64
+ * Items of added moduleIds, are shown in the CategoryManager
65
+ * @param {string} id
66
+ */
67
+ addModuleId(id: string): void;
68
+ /**
69
+ * @param {string} id
70
+ */
71
+ removeModuleId(id: string): void;
55
72
  }
56
73
  import CollectionManager from './collectionManager.js';
@@ -1,4 +1,5 @@
1
- import { moduleIdSymbol } from '@vcmap/core';
1
+ import { defaultDynamicModuleId, moduleIdSymbol } from '@vcmap/core';
2
+ import { check } from '@vcsuite/check';
2
3
  import { vcsAppSymbol } from '../../pluginHelper.js';
3
4
  import CollectionManager from './collectionManager.js';
4
5
 
@@ -9,6 +10,8 @@ import CollectionManager from './collectionManager.js';
9
10
  /**
10
11
  * Manages all requested category collections.
11
12
  * Provides an API to add/remove collectionsComponents.
13
+ * Per default only items of the defaultDynamicModuleId are shown in the CategoryManager.
14
+ * Further modules can be supported using the addModuleId API.
12
15
  * @implements {ICategoryManager}
13
16
  * @extends CollectionManager
14
17
  */
@@ -31,7 +34,12 @@ class CategoryManager extends CollectionManager {
31
34
  * @type {string}
32
35
  * @private
33
36
  */
34
- this._dynamicModuleId = this._app.dynamicModuleId;
37
+ this._dynamicModuleId = defaultDynamicModuleId;
38
+ /**
39
+ * @type {string[]}
40
+ * @private
41
+ */
42
+ this._moduleIds = [];
35
43
 
36
44
  /**
37
45
  * @param {Object} item
@@ -49,7 +57,9 @@ class CategoryManager extends CollectionManager {
49
57
  */
50
58
  this._categoryListeners = [
51
59
  this._app.dynamicModuleIdChanged.addEventListener((id) => {
52
- this._dynamicModuleId = id;
60
+ if (id === defaultDynamicModuleId || this._moduleIds.includes(id)) {
61
+ this._dynamicModuleId = id;
62
+ }
53
63
  this.reset();
54
64
  }),
55
65
  this._app.categories.removed.addEventListener((category) => {
@@ -88,6 +98,34 @@ class CategoryManager extends CollectionManager {
88
98
  return { collectionComponent, category };
89
99
  }
90
100
 
101
+ /**
102
+ * Updates the filterFunction for added moduleIds.
103
+ * Items of added moduleIds, are shown in the CategoryManager
104
+ * @param {string} id
105
+ */
106
+ addModuleId(id) {
107
+ check(id, String);
108
+ if (!this._moduleIds.includes(id)) {
109
+ this._moduleIds.push(id);
110
+ }
111
+ if (id === this._app.dynamicModuleId) {
112
+ this.reset();
113
+ }
114
+ }
115
+
116
+ /**
117
+ * @param {string} id
118
+ */
119
+ removeModuleId(id) {
120
+ const idx = this._moduleIds.indexOf(id);
121
+ if (idx > -1) {
122
+ this._moduleIds.splice(idx, 1);
123
+ }
124
+ if (id === this._app.dynamicModuleId) {
125
+ this.reset();
126
+ }
127
+ }
128
+
91
129
  destroy() {
92
130
  super.destroy();
93
131
  this._categoryListeners.forEach((cb) => cb());
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @param {string[]|function(T):string[]} supportedMaps
3
+ * @param {import("@vcmap/core").MapCollection} mapCollection
4
+ * @template {Object|import("@vcmap/core").VcsObject} T
5
+ * @returns {import("./collectionManager.js").MappingFunction<T>}
6
+ */
7
+ export function createSupportedMapMappingFunction<T extends Object | import("@vcmap/core/dist/src/vcsObject.js").default>(supportedMaps: string[] | ((arg0: T) => string[]), mapCollection: import("@vcmap/core").MapCollection): import("./collectionManager.js").MappingFunction<T>;
1
8
  export default CollectionComponentClass;
2
9
  export type CollectionComponentUiOptions = {
3
10
  id?: string | undefined;
@@ -3,6 +3,7 @@ import { getLogger } from '@vcsuite/logger';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { computed, ref, watch } from 'vue';
5
5
  import { parseBoolean, parseNumber } from '@vcsuite/parsers';
6
+ import { check } from '@vcsuite/check';
6
7
  import { validateAction } from '../../components/lists/VcsActionList.vue';
7
8
  import { sortByWeight } from '../buttonManager.js';
8
9
  import {
@@ -63,6 +64,30 @@ function titleChanged(item, listItem, newTitle) {
63
64
  listItem.title = newTitle;
64
65
  }
65
66
 
67
+ /**
68
+ * @param {string[]|function(T):string[]} supportedMaps
69
+ * @param {import("@vcmap/core").MapCollection} mapCollection
70
+ * @template {Object|import("@vcmap/core").VcsObject} T
71
+ * @returns {import("./collectionManager.js").MappingFunction<T>}
72
+ */
73
+ export function createSupportedMapMappingFunction(
74
+ supportedMaps,
75
+ mapCollection,
76
+ ) {
77
+ check(supportedMaps, [[String], Function]);
78
+
79
+ return (item, _c, listItem) => {
80
+ const mapNames =
81
+ typeof supportedMaps === 'function' ? supportedMaps(item) : supportedMaps;
82
+ listItem.disabled = !mapNames.includes(mapCollection.activeMap.className);
83
+ listItem.destroyFunctions.push(
84
+ mapCollection.mapActivated.addEventListener((map) => {
85
+ listItem.disabled = !mapNames.includes(map.className);
86
+ }),
87
+ );
88
+ };
89
+ }
90
+
66
91
  /**
67
92
  * Manages one collection and creates a mirrored items array with ListItems.
68
93
  * Listens to all collection events and synchronizes changes to the items array.
@@ -400,6 +425,9 @@ class CollectionComponentClass {
400
425
  */
401
426
  _handleItemReplaced(replaced) {
402
427
  const listItemHasUpdate = this.getListItemForItem(replaced.old)?.hasUpdate;
428
+ const idx = this._listItems.value.findIndex(
429
+ (l) => l.name === replaced.old[this.collection.uniqueKey],
430
+ );
403
431
  const selectedIdx = this.selection.value.findIndex(
404
432
  (l) => l.name === replaced.old[this.collection.uniqueKey],
405
433
  );
@@ -407,13 +435,18 @@ class CollectionComponentClass {
407
435
  if (selectedIdx > -1 || listItemHasUpdate !== undefined) {
408
436
  const addedListener = this._collection.added.addEventListener((added) => {
409
437
  if (added === replaced.new) {
410
- const newListItem = this.items.value.find(
438
+ const newIdx = this.items.value.findIndex(
411
439
  (l) => l.name === added[this.collection.uniqueKey],
412
440
  );
441
+ const newListItem = this._listItems.value[newIdx];
413
442
  if (newListItem) {
414
443
  if (listItemHasUpdate !== undefined) {
415
444
  newListItem.hasUpdate = listItemHasUpdate;
416
445
  }
446
+ if (newIdx !== idx) {
447
+ this._listItems.value.splice(newIdx, 1);
448
+ this._listItems.value.splice(idx, 0, newListItem);
449
+ }
417
450
  if (selectedIdx > -1) {
418
451
  this.selection.value.splice(selectedIdx, 0, newListItem);
419
452
  }
package/src/vcsUiApp.d.ts CHANGED
@@ -263,9 +263,10 @@ declare class VcsUiApp extends VcsApp {
263
263
  * This function can be used for the WindowState infoUrlCallback property.
264
264
  * @param {string} [path] - the path to a help section
265
265
  * @param {string} [subpage='vc-map'] - path to a subpage. Default is 'vc-map'.
266
+ * @param {string=} [subpageVersion=undefined] - default version is the mapVersion, can be provided to use a plugin specific version
266
267
  * @returns {function():string}
267
268
  */
268
- getHelpUrlCallback(path?: string | undefined, subpage?: string | undefined): () => string;
269
+ getHelpUrlCallback(path?: string | undefined, subpage?: string | undefined, subpageVersion?: string | undefined): () => string;
269
270
  /**
270
271
  * Get the state of the application. When passed the forUrl flag, only a minimal set of states shall be provided for a sharable link to the current state (to ensure
271
272
  * the maximum URL length is not exceeded). This includes: layer active state & styling, active map, active viewpoint,
package/src/vcsUiApp.js CHANGED
@@ -458,10 +458,17 @@ class VcsUiApp extends VcsApp {
458
458
  * This function can be used for the WindowState infoUrlCallback property.
459
459
  * @param {string} [path] - the path to a help section
460
460
  * @param {string} [subpage='vc-map'] - path to a subpage. Default is 'vc-map'.
461
+ * @param {string=} [subpageVersion=undefined] - default version is the mapVersion, can be provided to use a plugin specific version
461
462
  * @returns {function():string}
462
463
  */
463
- getHelpUrlCallback(path = '', subpage = 'vc-map') {
464
- const mayorMinorVersion = /\d+\.\d+/.exec(VcsUiApp.getVersion())[0];
464
+ getHelpUrlCallback(
465
+ path = '',
466
+ subpage = 'vc-map',
467
+ subpageVersion = undefined,
468
+ ) {
469
+ const mayorMinorVersion = /\d+\.\d+/.exec(
470
+ subpageVersion || VcsUiApp.getVersion(),
471
+ )[0];
465
472
  return () => {
466
473
  const base =
467
474
  this.uiConfig.config.value.helpBaseUrl || 'https://help.vc.systems/';
@@ -1 +0,0 @@
1
- import{initAppFromAppConfig as p}from"./ui.7d2c2e.js";p("#app","app.config.json");
File without changes
File without changes
File without changes