@vcmap/ui 5.0.0-rc.11 → 5.0.0-rc.12
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/build/build.js +6 -0
- package/build/buildHelpers.js +12 -3
- package/build/getPluginProxies.js +4 -0
- package/config/base.config.json +310 -156
- package/config/dev.config.json +211 -6
- package/dist/assets/{cesium.e67536.js → cesium.4057e6.js} +0 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.ebf665.js → core.deb2b7.js} +1 -1
- package/dist/assets/core.js +1 -1
- package/dist/assets/font/OFL.txt +93 -0
- package/dist/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/dist/assets/{index.9b213929.js → index.7aa11f5a.js} +1 -1
- package/dist/assets/{ol.8bbd50.js → ol.70b137.js} +0 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.9eb282.css +1 -0
- package/dist/assets/{ui.fdfe0d.js → ui.9eb282.js} +42 -40
- package/dist/assets/ui.js +1 -1
- package/dist/assets/{vue.0bb7c6.js → vue.65d93f.js} +0 -0
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.53300f.css → vuetify.149dde.css} +1 -1
- package/dist/assets/{vuetify.53300f.js → vuetify.149dde.js} +3 -3
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -5
- package/index.js +2 -0
- package/package.json +1 -1
- package/plugins/@vcmap/pluginExample/index.js +1 -1
- package/plugins/test/index.js +1 -4
- package/src/application/VcsApp.vue +100 -24
- package/src/assets/font/OFL.txt +93 -0
- package/src/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +1 -1
- package/src/i18n/de.js +6 -0
- package/src/i18n/en.js +6 -0
- package/src/icons/+all.js +80 -0
- package/src/icons/ClippingHorizontalIcon.vue +7 -0
- package/src/icons/ClippingIcon.vue +7 -0
- package/src/icons/ClippingVerticalIcon.vue +7 -0
- package/src/icons/ColorPickerIcon.vue +7 -0
- package/src/icons/ComponentsIcon.vue +2 -2
- package/src/icons/DimensionsHouseIcon.vue +11 -9
- package/src/icons/EditIcon.vue +7 -0
- package/src/icons/GlobalTerrainIcon.vue +9 -0
- package/src/icons/GroundIcon.vue +18 -0
- package/src/icons/HideIcon.vue +12 -0
- package/src/icons/LogoutIcon.vue +7 -0
- package/src/icons/ObjectAttributeIcon.vue +2 -13
- package/src/icons/PedestrianIcon.vue +2 -3
- package/src/icons/PenIcon.vue +2 -9
- package/src/icons/PoiIcon.vue +5 -2
- package/src/icons/PointSelectIcon.vue +4 -2
- package/src/icons/QueryIcon.vue +6 -7
- package/src/icons/ScreenshotIcon.vue +16 -0
- package/src/icons/ShareIcon.vue +4 -16
- package/src/icons/SkipNextIcon.vue +3 -1
- package/src/icons/TerrainBoxIcon.vue +9 -0
- package/src/icons/ToolsIcon.vue +4 -30
- package/src/icons/UploadIcon.vue +2 -9
- package/src/icons/UserProfileIcon.vue +7 -0
- package/src/icons/UserShareIcon.vue +7 -0
- package/src/icons/VideoRecorderIcon.vue +5 -9
- package/src/icons/ViewpointFlightIcon.vue +11 -0
- package/src/icons/ViewpointIcon.vue +11 -0
- package/src/icons/Viewshed360Icon.vue +7 -0
- package/src/icons/ViewshedConeIcon.vue +7 -0
- package/src/icons/ViewshedIcon.vue +7 -0
- package/src/icons/WallIcon.vue +4 -9
- package/src/legend/legendHelper.js +193 -0
- package/src/legend/styleLegendItem.vue +129 -0
- package/src/legend/vcsLegend.vue +92 -0
- package/src/manager/toolbox/ToolboxGroupComponent.vue +7 -3
- package/src/manager/toolbox/ToolboxManager.vue +2 -1
- package/src/pluginHelper.js +42 -10
- package/src/styles/variables.scss +7 -0
- package/src/styles/vcsFont.scss +17 -0
- package/src/vcsUiApp.js +2 -1
- package/dist/assets/ui.fdfe0d.css +0 -1
@@ -8,6 +8,7 @@
|
|
8
8
|
:active="singleActionButton.active"
|
9
9
|
@click.stop="singleActionButton.callback($event)"
|
10
10
|
v-bind="{...$attrs}"
|
11
|
+
large
|
11
12
|
/>
|
12
13
|
<VcsButton
|
13
14
|
v-else-if="groupButtons.length > 0"
|
@@ -17,6 +18,7 @@
|
|
17
18
|
:tooltip="groupTitle"
|
18
19
|
:active="active"
|
19
20
|
@click="$emit('click')"
|
21
|
+
large
|
20
22
|
>
|
21
23
|
<v-icon v-text="active ? 'mdi-chevron-up' : 'mdi-chevron-down'" color="accent" class="text--darken-3" />
|
22
24
|
</VcsButton>
|
@@ -24,8 +26,7 @@
|
|
24
26
|
v-if="active"
|
25
27
|
dense
|
26
28
|
absolute
|
27
|
-
|
28
|
-
class="toolbar__secondary rounded-b mx-auto v-sheet mt-12 px-4"
|
29
|
+
class="toolbar__secondary rounded-b mx-auto v-sheet mt-12 px-4 second-toolbar"
|
29
30
|
:style="{left: `${nudgeLeft}px` }"
|
30
31
|
>
|
31
32
|
<v-toolbar-items class="w-full">
|
@@ -37,9 +38,9 @@
|
|
37
38
|
:icon="button.icon"
|
38
39
|
:active="button.active"
|
39
40
|
@click.stop="button.callback($event)"
|
40
|
-
small
|
41
41
|
:width="buttonSize"
|
42
42
|
v-bind="{...$attrs}"
|
43
|
+
large
|
43
44
|
/>
|
44
45
|
</div>
|
45
46
|
</v-toolbar-items>
|
@@ -53,6 +54,9 @@
|
|
53
54
|
.v-toolbar.v-sheet {
|
54
55
|
background-color: #ffffffda;
|
55
56
|
}
|
57
|
+
.second-toolbar{
|
58
|
+
display: table;
|
59
|
+
}
|
56
60
|
</style>
|
57
61
|
<script>
|
58
62
|
|
@@ -3,7 +3,8 @@
|
|
3
3
|
<v-toolbar
|
4
4
|
v-if="toolboxOpen && actionGroups.length > 0 && $vuetify.breakpoint.mdAndUp"
|
5
5
|
dense
|
6
|
-
class="vcs-toolbox toolbar__secondary
|
6
|
+
class="vcs-toolbox toolbar__secondary mx-auto v-sheet marginToTop"
|
7
|
+
:class="{ 'rounded-b': groupId === null }"
|
7
8
|
:width="width"
|
8
9
|
>
|
9
10
|
<v-toolbar-items class="w-full">
|
package/src/pluginHelper.js
CHANGED
@@ -19,6 +19,39 @@ export const vcsAppSymbol = Symbol('vcsApp');
|
|
19
19
|
*/
|
20
20
|
export const pluginFactorySymbol = Symbol('pluginFactory');
|
21
21
|
|
22
|
+
/**
|
23
|
+
* A symbol added to each plugin which describes the base URL from which the plugin was loaded (without the filename)
|
24
|
+
* @type {symbol}
|
25
|
+
*/
|
26
|
+
export const pluginBaseUrlSymbol = Symbol('pluginBaseUrl');
|
27
|
+
|
28
|
+
/**
|
29
|
+
* A helper function to create an absolute URL from a relative plugin asset URL. For example, when
|
30
|
+
* shipping your plugin with a "plugin-asset/icon.png", you can always retrieve said icon with getPluginAssetUrl(app, name, 'pluing-assets/icon.png')
|
31
|
+
* Returns null, if the plugin does not exist.
|
32
|
+
* @param {VcsUiApp} app
|
33
|
+
* @param {string} pluginName
|
34
|
+
* @param {string} asset
|
35
|
+
* @returns {string|null}
|
36
|
+
*/
|
37
|
+
export function getPluginAssetUrl(app, pluginName, asset) {
|
38
|
+
check(pluginName, String);
|
39
|
+
check(asset, String);
|
40
|
+
|
41
|
+
const plugin = app.plugins.getByKey(pluginName);
|
42
|
+
if (plugin && plugin[pluginBaseUrlSymbol]) {
|
43
|
+
const baseUrl = new URL(plugin[pluginBaseUrlSymbol]);
|
44
|
+
const assetUrl = new URL(asset.replace(/^\//, '/'), baseUrl);
|
45
|
+
baseUrl.searchParams.forEach((value, key) => {
|
46
|
+
if (!assetUrl.searchParams.has(key)) {
|
47
|
+
assetUrl.searchParams.set(key, value);
|
48
|
+
}
|
49
|
+
});
|
50
|
+
return assetUrl.toString();
|
51
|
+
}
|
52
|
+
return null;
|
53
|
+
}
|
54
|
+
|
22
55
|
/**
|
23
56
|
* validates the name according to package name pattern
|
24
57
|
* @param {string} name
|
@@ -32,18 +65,14 @@ export function isValidPackageName(name) {
|
|
32
65
|
}
|
33
66
|
|
34
67
|
/**
|
35
|
-
* @param {VcsUiApp} app
|
36
68
|
* @param {string} name
|
37
69
|
* @param {PluginConfig} config
|
38
|
-
* @param {string} [registry='https://plugins.virtualcitymap.de/']
|
39
70
|
* @returns {Promise<VcsPlugin|null>}
|
40
71
|
*/
|
41
|
-
export async function loadPlugin(
|
72
|
+
export async function loadPlugin(name, config) {
|
42
73
|
let module = config.entry;
|
43
74
|
|
44
|
-
if (
|
45
|
-
module = `${registry.replace(/\/?$/, '')}/${name}/${config.version || '*'}/index.js`;
|
46
|
-
} else if (!/^(https?:\/\/|\/)/.test(module)) {
|
75
|
+
if (!/^(https?:\/\/|\/)/.test(module)) {
|
47
76
|
module = `${window.location.origin}${window.location.pathname.replace(/\/?$/, '/')}${module}`;
|
48
77
|
} else if (module === '_dev') {
|
49
78
|
module = `/${name}.js`;
|
@@ -65,7 +94,9 @@ export async function loadPlugin(app, name, config, registry = 'https://plugins.
|
|
65
94
|
getLogger().error(`plugin ${name} does not provide a default exported function`);
|
66
95
|
return null;
|
67
96
|
}
|
68
|
-
const
|
97
|
+
const baseUrl = new URL(module);
|
98
|
+
baseUrl.pathname = baseUrl.pathname.replace(/\/[^/]+$/, '/');
|
99
|
+
const pluginInstance = await plugin.default(config, baseUrl.toString());
|
69
100
|
|
70
101
|
if (!pluginInstance.name) {
|
71
102
|
getLogger().error(`plugin ${name} does not expose a name`);
|
@@ -75,6 +106,7 @@ export async function loadPlugin(app, name, config, registry = 'https://plugins.
|
|
75
106
|
return null;
|
76
107
|
}
|
77
108
|
pluginInstance[pluginFactorySymbol] = plugin.default;
|
109
|
+
pluginInstance[pluginBaseUrlSymbol] = baseUrl.toString();
|
78
110
|
return pluginInstance;
|
79
111
|
} catch (err) {
|
80
112
|
getLogger().error(`failed to load plugin ${name}`);
|
@@ -89,9 +121,8 @@ export async function loadPlugin(app, name, config, registry = 'https://plugins.
|
|
89
121
|
*/
|
90
122
|
export function serializePlugin(plugin) {
|
91
123
|
const serializedPlugin = plugin.toJSON ? plugin.toJSON() : {};
|
92
|
-
|
93
|
-
|
94
|
-
}
|
124
|
+
serializedPlugin[pluginFactorySymbol] = plugin[pluginFactorySymbol];
|
125
|
+
serializedPlugin[pluginBaseUrlSymbol] = plugin[pluginBaseUrlSymbol];
|
95
126
|
return serializedPlugin;
|
96
127
|
}
|
97
128
|
|
@@ -102,5 +133,6 @@ export function serializePlugin(plugin) {
|
|
102
133
|
export async function deserializePlugin(serializedPlugin) {
|
103
134
|
const reincarnation = await serializedPlugin[pluginFactorySymbol](serializedPlugin);
|
104
135
|
reincarnation[pluginFactorySymbol] = serializedPlugin[pluginFactorySymbol];
|
136
|
+
reincarnation[pluginBaseUrlSymbol] = serializedPlugin[pluginBaseUrlSymbol];
|
105
137
|
return reincarnation;
|
106
138
|
}
|
@@ -55,6 +55,7 @@ $list-padding: 0 0; // 8px 0 !default;
|
|
55
55
|
$list-item-title-font-size: $font-size; // map-deep-get($headings, 'subtitle-1', 'size') !default;
|
56
56
|
$list-item-dense-title-font-size: $font-size; // 0.8125rem !default;
|
57
57
|
$list-item-dense-title-line-height: 24px; // 1rem !default;
|
58
|
+
$list-dense-subheader-height: 32px; // 40px !default;
|
58
59
|
$list-item-min-height: 32px; // 48px !default;
|
59
60
|
$list-dense-min-height: 24px; // 40px !default;
|
60
61
|
$list-item-content-padding: 4px 0; // 12px 0 !default;
|
@@ -68,3 +69,9 @@ $list-item-icon-margin: auto 0; // 16px 0 !default;
|
|
68
69
|
$treeview-node-level-width: 16px;
|
69
70
|
$treeview-node-margin: 4px;
|
70
71
|
$treeview-node-height: 32px; // 48px !default;
|
72
|
+
|
73
|
+
/** Expansion Panel */
|
74
|
+
$expansion-panel-header-min-height: 32px; // 48px !default;
|
75
|
+
$expansion-panel-active-header-min-height: 32px; // 64px !default;
|
76
|
+
$expansion-panel-header-padding: 6px 0; // 16px 24px !default;
|
77
|
+
$expansion-panel-content-padding: 0 0 4px; // 0 24px 16px !default;
|
package/src/styles/vcsFont.scss
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
/* latin-ext */
|
2
|
+
@font-face {
|
3
|
+
font-family: 'Titillium Web';
|
4
|
+
font-style: normal;
|
5
|
+
font-weight: 400;
|
6
|
+
src: url(../assets/font/TitilliumWeb-Regular.woff2) format('woff2');
|
7
|
+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
8
|
+
}
|
9
|
+
/* latin */
|
10
|
+
@font-face {
|
11
|
+
font-family: 'Titillium Web';
|
12
|
+
font-style: normal;
|
13
|
+
font-weight: 400;
|
14
|
+
src: url(../assets/font/TitilliumWeb-Regular.woff2) format('woff2');
|
15
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
16
|
+
}
|
17
|
+
|
1
18
|
// fonts
|
2
19
|
$base-font-size: 14px; // base font-size minimum size
|
3
20
|
|
package/src/vcsUiApp.js
CHANGED
@@ -47,6 +47,7 @@ import { createEmptyState, getStateFromURL } from './state.js';
|
|
47
47
|
* @callback createPlugin
|
48
48
|
* @template {Object} P
|
49
49
|
* @param {P} config
|
50
|
+
* @param {string} pluginBaseUrl
|
50
51
|
* @returns {VcsPlugin<P>}
|
51
52
|
*/
|
52
53
|
|
@@ -343,7 +344,7 @@ class VcsUiApp extends VcsApp {
|
|
343
344
|
const { config } = context;
|
344
345
|
if (Array.isArray(config.plugins)) {
|
345
346
|
const plugins = await Promise.all(config.plugins.map(async (pluginConfig) => {
|
346
|
-
const plugin = await loadPlugin(
|
347
|
+
const plugin = await loadPlugin(pluginConfig.name, pluginConfig);
|
347
348
|
if (!plugin) {
|
348
349
|
return null;
|
349
350
|
}
|