@vcmap/ui 7.0.0-rc.3 → 7.0.0-rc.4
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/assets/cesium.js +1 -1
- package/dist/assets/{core-b8176469.js → core-85de2f04.js} +2 -2
- package/dist/assets/core-workers/panoramaImageWorker.js +1 -1
- package/dist/assets/core.js +1 -1
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui-3c5d612e.js → ui-d0e72380.js} +6 -6
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-f03b5337.js → vuetify-3e661aa3.js} +2 -2
- package/dist/assets/vuetify.js +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/package.json.js +1 -1
- package/lib/package.json.js.map +1 -1
- package/lib/src/contentTree/layerContentTreeItem.d.ts +1 -1
- package/lib/src/contentTree/layerContentTreeItem.js.map +1 -1
- package/lib/src/contentTree/obliqueCollectionContentTreeItem.d.ts +1 -1
- package/lib/src/contentTree/obliqueCollectionContentTreeItem.js.map +1 -1
- package/lib/src/vcsUiApp.d.ts +1 -1
- package/lib/src/vcsUiApp.js.map +1 -1
- package/lib/src/vuePlugins/i18n.d.ts +1 -1
- package/lib/src/vuePlugins/i18n.js.map +1 -1
- package/package.json +1 -1
- /package/dist/assets/{cesium-aec5ff6b.js → cesium-3acfab8f.js} +0 -0
- /package/dist/assets/core-workers/{panoramaImageWorker.js-d81ae8bf.js → panoramaImageWorker.js-a704f767.js} +0 -0
- /package/dist/assets/{ol-69e9b427.js → ol-c50145f6.js} +0 -0
- /package/dist/assets/{ui-3c5d612e.css → ui-d0e72380.css} +0 -0
- /package/dist/assets/{vue-0bcfd30c.js → vue-5343ee51.js} +0 -0
- /package/dist/assets/{vuetify-f03b5337.css → vuetify-3e661aa3.css} +0 -0
package/dist/assets/cesium.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./cesium-
|
|
1
|
+
export * from "./cesium-3acfab8f.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature as e, VectorTile as t, ol$Collection as n, ol$Feature as r, ol$ImageState as i, ol$Map as a, ol$Observable$unByKey as o, ol$TileState as s, ol$View as c, ol$color$fromString as l, ol$colorlike$asColorLike as u, ol$coordinate$distance as d, ol$coordinate$equals as f, ol$easing$inAndOut as p, ol$events$EventType as m, ol$expr$cpu$buildExpression as h, ol$expr$cpu$newEvaluationContext as g, ol$expr$expression$BooleanType as _, ol$expr$expression$NoneType as v, ol$expr$expression$StringType as y, ol$expr$expression$newParsingContext as b, ol$extent$boundingExtent as x, ol$extent$buffer as S, ol$extent$containsCoordinate as C, ol$extent$containsXY as w, ol$extent$createEmpty as T, ol$extent$createOrUpdateFromCoordinate as E, ol$extent$extend as D, ol$extent$getBottomLeft as O, ol$extent$getBottomRight as k, ol$extent$getCenter as ee, ol$extent$getHeight as A, ol$extent$getTopLeft as j, ol$extent$getTopRight as te, ol$extent$getWidth as ne, ol$extent$intersects as re, ol$extent$isEmpty as ie, ol$format$Feature$transformGeometryWithOptions as ae, ol$format$GML2 as oe, ol$format$GML3 as se, ol$format$GML32 as ce, ol$format$GeoJSON as le, ol$format$MVT as ue, ol$format$WFS as de, ol$format$WMSGetFeatureInfo as fe, ol$functions$toPromise as pe, ol$geom$Circle as me, ol$geom$GeometryCollection as he, ol$geom$LineString as ge, ol$geom$LinearRing as _e, ol$geom$MultiLineString as ve, ol$geom$MultiPoint as ye, ol$geom$MultiPolygon as be, ol$geom$Point as xe, ol$geom$Polygon as Se, ol$geom$Polygon$circular as Ce, ol$geom$Polygon$fromCircle as we, ol$geom$Polygon$fromExtent as Te, ol$geom$SimpleGeometry as Ee, ol$geom$SimpleGeometry$transformGeom2D as De, ol$geom$flat$transform$transform2D as Oe, ol$has$DEVICE_PIXEL_RATIO as ke, ol$has$WORKER_OFFSCREEN_CANVAS as Ae, ol$interaction$DragPan as je, ol$interaction$defaults as Me, ol$layer$Group as Ne, ol$layer$Image as Pe, ol$layer$Layer as Fe, ol$layer$Tile as Ie, ol$layer$Vector as Le, ol$layer$VectorTile as Re, ol$layer$WebGLTile as ze, ol$loadingstrategy$bbox as Be, ol$proj$Projection as Ve, ol$proj$Units$METERS_PER_UNIT as He, ol$proj$equivalent as Ue, ol$proj$fromLonLat as We, ol$proj$get as Ge, ol$proj$getPointResolution as Ke, ol$proj$getTransform as qe, ol$proj$getUserProjection as Je, ol$proj$proj4$register as Ye, ol$proj$transform as Xe, ol$proj$transformExtent as Ze, ol$render$Feature as Qe, ol$render$Feature$toFeature as $e, ol$render$canvas$Immediate as et, ol$render$canvas$checkedFonts as tt, ol$render$getRenderPixel as nt, ol$source$Cluster as rt, ol$source$GeoTIFF as it, ol$source$ImageStatic as at, ol$source$ImageWMS as ot, ol$source$OSM as st, ol$source$Raster as ct, ol$source$Source as lt, ol$source$TileDebug as ut, ol$source$TileImage as dt, ol$source$TileJSON as ft, ol$source$TileWMS as pt, ol$source$Vector as mt, ol$source$VectorTile as ht, ol$source$VectorTile$defaultLoadFunction as gt, ol$source$WMTS as _t, ol$source$XYZ as vt, ol$sphere$getDistance as yt, ol$sphere$offset as bt, ol$structs$LRUCache as xt, ol$style$Circle as St, ol$style$Fill as Ct, ol$style$Icon as wt, ol$style$Image as Tt, ol$style$RegularShape as Et, ol$style$Stroke as Dt, ol$style$Style as Ot, ol$style$Text as kt, ol$tilegrid$TileGrid as At, ol$tilegrid$WMTS as jt, ol$tilegrid$createXYZ as Mt, ol$transform$compose as Nt, ol$transform$create as Pt, ol$transform$scale as Ft, ol$util$getUid as It } from "./ol-
|
|
2
|
-
import { ArcType as Lt, Billboard as Rt, BillboardCollection as zt, BillboardVisualizer as Bt, BoundingSphere as Vt, BoundingSphereState as Ht, BoxGeometry as Ut, BoxOutlineGeometry as Wt, Camera as Gt, Cartesian2 as M, Cartesian3 as N, Cartesian4 as Kt, Cartographic as qt, CatmullRomSpline as Jt, Cesium3DTileColorBlendMode as Yt, Cesium3DTileFeature as Xt, Cesium3DTilePointFeature as Zt, Cesium3DTileStyle as Qt, Cesium3DTileset as $t, CesiumTerrainProvider as en, CesiumWidget as tn, CircleGeometry as nn, CircleOutlineGeometry as rn, ClassificationPrimitive as an, ClassificationType as on, ClippingPlane as sn, ClippingPlaneCollection as cn, ClippingPolygon as ln, ClippingPolygonCollection as un, Clock as dn, Color as P, ColorGeometryInstanceAttribute as fn, ConditionsExpression as pn, ConstantProperty as mn, CoplanarPolygonGeometry as hn, CustomDataSource as gn, CylinderGeometry as _n, CylinderOutlineGeometry as vn, CzmlDataSource as yn, DataSourceClock as bn, DataSourceCollection as xn, DataSourceDisplay as Sn, EasingFunction as Cn, Ellipsoid as wn, EllipsoidGeometry as Tn, EllipsoidOutlineGeometry as En, Entity as Dn, EntityCollection as On, Event as kn, Expression as An, FrustumGeometry as jn, FrustumOutlineGeometry as Mn, GeographicTilingScheme as Nn, GeometryInstance as Pn, Globe as Fn, GroundPolylineGeometry as In, GroundPolylinePrimitive as Ln, GroundPrimitive as Rn, HeadingPitchRange as zn, HeadingPitchRoll as Bn, HeightReference as Vn, HorizontalOrigin as Hn, I3SDataProvider as Un, ImageryLayer as Wn, Intersect as Gn, IntersectionTests as Kn, JulianDate as qn, KeyboardEventModifier as Jn, LabelCollection as Yn, LabelStyle as Xn, LabelVisualizer as Zn, LinearSpline as Qn, Material as $n, MaterialAppearance as er, Math as F, Matrix2 as tr, Matrix3 as nr, Matrix4 as I, Model as rr, ModelAnimationLoop as ir, NearFarScalar as ar, OpenStreetMapImageryProvider as or, PerInstanceColorAppearance as sr, PerspectiveFrustum as cr, PixelDatatype as lr, PixelFormat as ur, Plane as dr, PointVisualizer as fr, PolygonGeometry as pr, PolygonHierarchy as mr, PolygonOutlineGeometry as hr, PolylineGeometry as gr, PolylineMaterialAppearance as _r, Primitive as vr, PrimitiveCollection as yr, QuadtreePrimitive as br, QuadtreeTileLoadState as xr, QuadtreeTileProvider as Sr, Quaternion as Cr, QuaternionSpline as wr, Ray as Tr, Rectangle as Er, RequestScheduler as Dr, Resource as Or, Sampler as kr, SceneTransforms as Ar, ScreenSpaceEventHandler as jr, ScreenSpaceEventType as Mr, ShadowMode as Nr, SingleTileImageryProvider as Pr, SphereGeometry as Fr, SphereOutlineGeometry as Ir, SplitDirection as Lr, Texture as Rr, TileBoundingRegion as zr, TileMapServiceImageryProvider as Br, Transforms as Vr, TrustedServers as Hr, VertexFormat as Ur, VerticalOrigin as Wr, Visibility as Gr, WallGeometry as Kr, WallOutlineGeometry as qr, WebMapServiceImageryProvider as Jr, WebMapTileServiceImageryProvider as Yr, WebMercatorTilingScheme as Xr, defined as Zr, destroyObject as Qr, sampleTerrain as $r, sampleTerrainMostDetailed as ei } from "./cesium-
|
|
1
|
+
import { Feature as e, VectorTile as t, ol$Collection as n, ol$Feature as r, ol$ImageState as i, ol$Map as a, ol$Observable$unByKey as o, ol$TileState as s, ol$View as c, ol$color$fromString as l, ol$colorlike$asColorLike as u, ol$coordinate$distance as d, ol$coordinate$equals as f, ol$easing$inAndOut as p, ol$events$EventType as m, ol$expr$cpu$buildExpression as h, ol$expr$cpu$newEvaluationContext as g, ol$expr$expression$BooleanType as _, ol$expr$expression$NoneType as v, ol$expr$expression$StringType as y, ol$expr$expression$newParsingContext as b, ol$extent$boundingExtent as x, ol$extent$buffer as S, ol$extent$containsCoordinate as C, ol$extent$containsXY as w, ol$extent$createEmpty as T, ol$extent$createOrUpdateFromCoordinate as E, ol$extent$extend as D, ol$extent$getBottomLeft as O, ol$extent$getBottomRight as k, ol$extent$getCenter as ee, ol$extent$getHeight as A, ol$extent$getTopLeft as j, ol$extent$getTopRight as te, ol$extent$getWidth as ne, ol$extent$intersects as re, ol$extent$isEmpty as ie, ol$format$Feature$transformGeometryWithOptions as ae, ol$format$GML2 as oe, ol$format$GML3 as se, ol$format$GML32 as ce, ol$format$GeoJSON as le, ol$format$MVT as ue, ol$format$WFS as de, ol$format$WMSGetFeatureInfo as fe, ol$functions$toPromise as pe, ol$geom$Circle as me, ol$geom$GeometryCollection as he, ol$geom$LineString as ge, ol$geom$LinearRing as _e, ol$geom$MultiLineString as ve, ol$geom$MultiPoint as ye, ol$geom$MultiPolygon as be, ol$geom$Point as xe, ol$geom$Polygon as Se, ol$geom$Polygon$circular as Ce, ol$geom$Polygon$fromCircle as we, ol$geom$Polygon$fromExtent as Te, ol$geom$SimpleGeometry as Ee, ol$geom$SimpleGeometry$transformGeom2D as De, ol$geom$flat$transform$transform2D as Oe, ol$has$DEVICE_PIXEL_RATIO as ke, ol$has$WORKER_OFFSCREEN_CANVAS as Ae, ol$interaction$DragPan as je, ol$interaction$defaults as Me, ol$layer$Group as Ne, ol$layer$Image as Pe, ol$layer$Layer as Fe, ol$layer$Tile as Ie, ol$layer$Vector as Le, ol$layer$VectorTile as Re, ol$layer$WebGLTile as ze, ol$loadingstrategy$bbox as Be, ol$proj$Projection as Ve, ol$proj$Units$METERS_PER_UNIT as He, ol$proj$equivalent as Ue, ol$proj$fromLonLat as We, ol$proj$get as Ge, ol$proj$getPointResolution as Ke, ol$proj$getTransform as qe, ol$proj$getUserProjection as Je, ol$proj$proj4$register as Ye, ol$proj$transform as Xe, ol$proj$transformExtent as Ze, ol$render$Feature as Qe, ol$render$Feature$toFeature as $e, ol$render$canvas$Immediate as et, ol$render$canvas$checkedFonts as tt, ol$render$getRenderPixel as nt, ol$source$Cluster as rt, ol$source$GeoTIFF as it, ol$source$ImageStatic as at, ol$source$ImageWMS as ot, ol$source$OSM as st, ol$source$Raster as ct, ol$source$Source as lt, ol$source$TileDebug as ut, ol$source$TileImage as dt, ol$source$TileJSON as ft, ol$source$TileWMS as pt, ol$source$Vector as mt, ol$source$VectorTile as ht, ol$source$VectorTile$defaultLoadFunction as gt, ol$source$WMTS as _t, ol$source$XYZ as vt, ol$sphere$getDistance as yt, ol$sphere$offset as bt, ol$structs$LRUCache as xt, ol$style$Circle as St, ol$style$Fill as Ct, ol$style$Icon as wt, ol$style$Image as Tt, ol$style$RegularShape as Et, ol$style$Stroke as Dt, ol$style$Style as Ot, ol$style$Text as kt, ol$tilegrid$TileGrid as At, ol$tilegrid$WMTS as jt, ol$tilegrid$createXYZ as Mt, ol$transform$compose as Nt, ol$transform$create as Pt, ol$transform$scale as Ft, ol$util$getUid as It } from "./ol-c50145f6.js";
|
|
2
|
+
import { ArcType as Lt, Billboard as Rt, BillboardCollection as zt, BillboardVisualizer as Bt, BoundingSphere as Vt, BoundingSphereState as Ht, BoxGeometry as Ut, BoxOutlineGeometry as Wt, Camera as Gt, Cartesian2 as M, Cartesian3 as N, Cartesian4 as Kt, Cartographic as qt, CatmullRomSpline as Jt, Cesium3DTileColorBlendMode as Yt, Cesium3DTileFeature as Xt, Cesium3DTilePointFeature as Zt, Cesium3DTileStyle as Qt, Cesium3DTileset as $t, CesiumTerrainProvider as en, CesiumWidget as tn, CircleGeometry as nn, CircleOutlineGeometry as rn, ClassificationPrimitive as an, ClassificationType as on, ClippingPlane as sn, ClippingPlaneCollection as cn, ClippingPolygon as ln, ClippingPolygonCollection as un, Clock as dn, Color as P, ColorGeometryInstanceAttribute as fn, ConditionsExpression as pn, ConstantProperty as mn, CoplanarPolygonGeometry as hn, CustomDataSource as gn, CylinderGeometry as _n, CylinderOutlineGeometry as vn, CzmlDataSource as yn, DataSourceClock as bn, DataSourceCollection as xn, DataSourceDisplay as Sn, EasingFunction as Cn, Ellipsoid as wn, EllipsoidGeometry as Tn, EllipsoidOutlineGeometry as En, Entity as Dn, EntityCollection as On, Event as kn, Expression as An, FrustumGeometry as jn, FrustumOutlineGeometry as Mn, GeographicTilingScheme as Nn, GeometryInstance as Pn, Globe as Fn, GroundPolylineGeometry as In, GroundPolylinePrimitive as Ln, GroundPrimitive as Rn, HeadingPitchRange as zn, HeadingPitchRoll as Bn, HeightReference as Vn, HorizontalOrigin as Hn, I3SDataProvider as Un, ImageryLayer as Wn, Intersect as Gn, IntersectionTests as Kn, JulianDate as qn, KeyboardEventModifier as Jn, LabelCollection as Yn, LabelStyle as Xn, LabelVisualizer as Zn, LinearSpline as Qn, Material as $n, MaterialAppearance as er, Math as F, Matrix2 as tr, Matrix3 as nr, Matrix4 as I, Model as rr, ModelAnimationLoop as ir, NearFarScalar as ar, OpenStreetMapImageryProvider as or, PerInstanceColorAppearance as sr, PerspectiveFrustum as cr, PixelDatatype as lr, PixelFormat as ur, Plane as dr, PointVisualizer as fr, PolygonGeometry as pr, PolygonHierarchy as mr, PolygonOutlineGeometry as hr, PolylineGeometry as gr, PolylineMaterialAppearance as _r, Primitive as vr, PrimitiveCollection as yr, QuadtreePrimitive as br, QuadtreeTileLoadState as xr, QuadtreeTileProvider as Sr, Quaternion as Cr, QuaternionSpline as wr, Ray as Tr, Rectangle as Er, RequestScheduler as Dr, Resource as Or, Sampler as kr, SceneTransforms as Ar, ScreenSpaceEventHandler as jr, ScreenSpaceEventType as Mr, ShadowMode as Nr, SingleTileImageryProvider as Pr, SphereGeometry as Fr, SphereOutlineGeometry as Ir, SplitDirection as Lr, Texture as Rr, TileBoundingRegion as zr, TileMapServiceImageryProvider as Br, Transforms as Vr, TrustedServers as Hr, VertexFormat as Ur, VerticalOrigin as Wr, Visibility as Gr, WallGeometry as Kr, WallOutlineGeometry as qr, WebMapServiceImageryProvider as Jr, WebMapTileServiceImageryProvider as Yr, WebMercatorTilingScheme as Xr, defined as Zr, destroyObject as Qr, sampleTerrain as $r, sampleTerrainMostDetailed as ei } from "./cesium-3acfab8f.js";
|
|
3
3
|
// \0rolldown/runtime.js
|
|
4
4
|
var ti = Object.create, ni = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, ii = Object.getOwnPropertyNames, ai = Object.getPrototypeOf, oi = Object.prototype.hasOwnProperty, si = (e, t, n) => () => {
|
|
5
5
|
if (n) throw n[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './panoramaImageWorker.js-
|
|
1
|
+
import './panoramaImageWorker.js-a704f767.js';
|
package/dist/assets/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./core-
|
|
1
|
+
export * from "./core-85de2f04.js";
|
package/dist/assets/ol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./ol-
|
|
1
|
+
export * from "./ol-c50145f6.js";
|
|
@@ -10,11 +10,11 @@ function loadCss(href) {
|
|
|
10
10
|
elem.onerror = reject;
|
|
11
11
|
document.head.appendChild(elem);
|
|
12
12
|
});
|
|
13
|
-
} await loadCss('./assets/ui-
|
|
14
|
-
import { Fragment as C, Text as Nt, computed as w, createApp as Pt, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createSlots as Ft, createStaticVNode as It, createTextVNode as k, createVNode as A, defineComponent as j, effectScope as Lt, getCurrentInstance as Rt, guardReactiveProps as zt, h as Bt, inject as M, isReactive as Vt, isRef as Ht, mergeProps as N, nextTick as Ut, normalizeClass as P, normalizeProps as F, normalizeStyle as Wt, onBeforeMount as Gt, onMounted as Kt, onScopeDispose as qt, onUnmounted as Jt, openBlock as I, provide as Yt, reactive as L, readonly as Xt, ref as R, renderList as z, renderSlot as B, resolveComponent as V, resolveDynamicComponent as Zt, shallowReactive as Qt, shallowRef as $t, toDisplayString as H, toHandlers as en, toRaw as tn, toRef as nn, unref as U, useAttrs as rn, useCssVars as an, useModel as on, useSlots as sn, watch as W, withCtx as G, withKeys as cn, withModifiers as ln } from "./vue-
|
|
15
|
-
import { VApp as un, VBtn as dn, VCard as fn, VCardActions as pn, VCardText as mn, VCardTitle as hn, VCheckbox as gn, VChip as _n, VCol as K, VColorPicker as vn, VContainer as yn, VDataTable as bn, VDataTableServer as xn, VDatePicker as Sn, VDialog as Cn, VDivider as wn, VExpandTransition as Tn, VExpansionPanel as En, VExpansionPanelText as Dn, VExpansionPanelTitle as On, VExpansionPanels as kn, VFileInput as An, VFooter as jn, VForm as Mn, VIcon as Nn, VImg as Pn, VList as Fn, VListItem as In, VListItemSubtitle as Ln, VListItemTitle as Rn, VMenu as zn, VPagination as Bn, VProgressLinear as Vn, VRadio as Hn, VRadioGroup as Un, VRow as q, VSelect as Wn, VSheet as Gn, VSlider as Kn, VSnackbar as qn, VSpacer as Jn, VStepperVertical as Yn, VStepperVerticalItem as Xn, VSvgIcon as Zn, VTab as Qn, VTabs as $n, VTextField as er, VTextarea as tr, VToolbar as nr, VToolbarItems as rr, VTooltip as ir, createVuetify as ar, useDisplay as or, useTheme as sr } from "./vuetify-
|
|
16
|
-
import { Feature as cr, ol$Feature as lr, ol$Observable$unByKey as ur, ol$extent$createOrUpdateFromCoordinates as dr, ol$extent$getCenter as fr, ol$format$WMSCapabilities as pr, ol$geom$Circle as mr, ol$geom$LineString as hr, ol$geom$Point as gr, ol$geom$Polygon as _r, ol$geom$Polygon$fromExtent as vr, ol$proj$get as yr, ol$proj$getTransform as br, ol$proj$transformExtent as xr, ol$render$toContext as Sr, ol$source$Vector as Cr, ol$style$Circle as wr, ol$style$Fill as Tr, ol$style$Icon as Er, ol$style$Stroke as Dr, ol$style$Style as Or } from "./ol-
|
|
17
|
-
import { Cartesian2 as kr, Cartesian3 as Ar, Cartographic as jr, Cesium3DTileFeature as Mr, Cesium3DTilePointFeature as Nr, Color as Pr, Entity as Fr, HeightReference as Ir, Math as Lr, Ray as Rr, SceneTransforms as zr } from "./cesium-
|
|
13
|
+
} await loadCss('./assets/ui-d0e72380.css');await loadCss('./assets/@mdi/font/css/materialdesignicons.min-680621ca.css');import { AbstractInteraction as e, BaseCesiumMap as t, BaseOLMap as n, CesiumMap as r, ClassRegistry as i, Collection as a, DataState as o, DefaultObliqueCollection as s, DisplayQualityLevel as c, EventHandler as l, EventType as u, Extent as d, FeatureLayer as f, FeatureProviderInteraction as p, FlightInstance as m, GeometryType as h, IndexedCollection as g, LayerState as _, MapCollection as v, ModificationKeyType as y, ObliqueMap as b, ObliqueViewDirection as x, OpenlayersMap as ee, OverrideClassRegistry as te, PanoramaImageSelection as ne, PanoramaMap as S, PatternType as re, PointerKeyType as ie, Projection as ae, SessionType as oe, TransformationMode as se, VcsApp as ce, VcsEvent as le, VcsModule as ue, VcsObject as de, VectorLayer as fe, VectorProperties as pe, VectorStyleItem as me, Viewpoint as he, WMSLayer as ge, alreadyTransformedToImage as _e, anchorFromViewpoint as ve, anchorToViewpoint as ye, cartesianToMercator as be, createFlightMovie as xe, createFlightPlayer as Se, createFlightVisualization as Ce, defaultDynamicModuleId as we, deserializeLayer as Te, destroyCollection as Ee, emptyStyle as De, exportFlightAsGeoJson as Oe, exportFlightPathAsGeoJson as ke, fromCesiumColor as Ae, getCaughtError as je, getDefaultProjection as Me, getDefaultVectorStyleItemOptions as Ne, getFeatureFromPickObject as Pe, getGeometryHeight as Fe, getHeightInfo as Ie, getImageStyleFromOptions as Le, getImageStyleOptions as Re, getInitForUrl as ze, getMetersPerDegreeAtCoordinate as Be, getObjectFromClassRegistry as Ve, getRegularShapeImageUrl as He, getShapeFromOptions as Ue, getSplineAndTimesForInstance as We, getStringColor as Ge, getStyleOptions as Ke, getTextFromOptions as qe, getTextOptions as Je, getVcsAppById as Ye, hidden as Xe, highlighted as Ze, is2DLayout as Qe, isAbsoluteHeightReference as $e, isOverrideCollection as et, isProvidedClusterFeature as tt, isProvidedFeature as nt, isRelativeHeightReference as rt, isSameOrigin as it, makeOverrideCollection as at, markVolatile as ot, maxZIndex as st, maxZIndexMin50 as ct, mercatorProjection as lt, mercatorToCartesian as ut, moduleIdSymbol as dt, originalFeatureSymbol as ft, originalStyle as pt, panoramaFeature as mt, parseColor as ht, parseFlightOptionsFromGeoJson as gt, parseGeoJSON as _t, placeGeometryOnSurface as vt, renderTemplate as yt, renderTemplate as bt, rotationMapControlSymbol as xt, snapTypes as St, startCreateFeatureSession as Ct, startEditFeaturesSession as wt, startEditGeometrySession as Tt, startRotation as Et, transformToImage as Dt, vcsLayerName as Ot, vectorClusterGroupName as kt, vectorStyleSymbol as At, volatileModuleId as jt, wgs84Projection as Mt } from "./core-85de2f04.js";
|
|
14
|
+
import { Fragment as C, Text as Nt, computed as w, createApp as Pt, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createSlots as Ft, createStaticVNode as It, createTextVNode as k, createVNode as A, defineComponent as j, effectScope as Lt, getCurrentInstance as Rt, guardReactiveProps as zt, h as Bt, inject as M, isReactive as Vt, isRef as Ht, mergeProps as N, nextTick as Ut, normalizeClass as P, normalizeProps as F, normalizeStyle as Wt, onBeforeMount as Gt, onMounted as Kt, onScopeDispose as qt, onUnmounted as Jt, openBlock as I, provide as Yt, reactive as L, readonly as Xt, ref as R, renderList as z, renderSlot as B, resolveComponent as V, resolveDynamicComponent as Zt, shallowReactive as Qt, shallowRef as $t, toDisplayString as H, toHandlers as en, toRaw as tn, toRef as nn, unref as U, useAttrs as rn, useCssVars as an, useModel as on, useSlots as sn, watch as W, withCtx as G, withKeys as cn, withModifiers as ln } from "./vue-5343ee51.js";
|
|
15
|
+
import { VApp as un, VBtn as dn, VCard as fn, VCardActions as pn, VCardText as mn, VCardTitle as hn, VCheckbox as gn, VChip as _n, VCol as K, VColorPicker as vn, VContainer as yn, VDataTable as bn, VDataTableServer as xn, VDatePicker as Sn, VDialog as Cn, VDivider as wn, VExpandTransition as Tn, VExpansionPanel as En, VExpansionPanelText as Dn, VExpansionPanelTitle as On, VExpansionPanels as kn, VFileInput as An, VFooter as jn, VForm as Mn, VIcon as Nn, VImg as Pn, VList as Fn, VListItem as In, VListItemSubtitle as Ln, VListItemTitle as Rn, VMenu as zn, VPagination as Bn, VProgressLinear as Vn, VRadio as Hn, VRadioGroup as Un, VRow as q, VSelect as Wn, VSheet as Gn, VSlider as Kn, VSnackbar as qn, VSpacer as Jn, VStepperVertical as Yn, VStepperVerticalItem as Xn, VSvgIcon as Zn, VTab as Qn, VTabs as $n, VTextField as er, VTextarea as tr, VToolbar as nr, VToolbarItems as rr, VTooltip as ir, createVuetify as ar, useDisplay as or, useTheme as sr } from "./vuetify-3e661aa3.js";
|
|
16
|
+
import { Feature as cr, ol$Feature as lr, ol$Observable$unByKey as ur, ol$extent$createOrUpdateFromCoordinates as dr, ol$extent$getCenter as fr, ol$format$WMSCapabilities as pr, ol$geom$Circle as mr, ol$geom$LineString as hr, ol$geom$Point as gr, ol$geom$Polygon as _r, ol$geom$Polygon$fromExtent as vr, ol$proj$get as yr, ol$proj$getTransform as br, ol$proj$transformExtent as xr, ol$render$toContext as Sr, ol$source$Vector as Cr, ol$style$Circle as wr, ol$style$Fill as Tr, ol$style$Icon as Er, ol$style$Stroke as Dr, ol$style$Style as Or } from "./ol-c50145f6.js";
|
|
17
|
+
import { Cartesian2 as kr, Cartesian3 as Ar, Cartographic as jr, Cesium3DTileFeature as Mr, Cesium3DTilePointFeature as Nr, Color as Pr, Entity as Fr, HeightReference as Ir, Math as Lr, Ray as Rr, SceneTransforms as zr } from "./cesium-3acfab8f.js";
|
|
18
18
|
// \0rolldown/runtime.js
|
|
19
19
|
var Br = Object.create, Vr = Object.defineProperty, Hr = Object.getOwnPropertyDescriptor, Ur = Object.getOwnPropertyNames, Wr = Object.getPrototypeOf, Gr = Object.prototype.hasOwnProperty, Kr = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), qr = (e, t, n, r) => {
|
|
20
20
|
if (t && typeof t == "object" || typeof t == "function") for (var i = Ur(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Gr.call(e, s) && s !== n && Vr(e, s, {
|
|
@@ -3843,7 +3843,7 @@ var wl = /* @__PURE__ */ Kr(((e, t) => {
|
|
|
3843
3843
|
};
|
|
3844
3844
|
})))(), gu = "@vcmap/ui", _u = {
|
|
3845
3845
|
name: gu,
|
|
3846
|
-
version: "7.0.0-rc.
|
|
3846
|
+
version: "7.0.0-rc.4",
|
|
3847
3847
|
author: "Virtual City Systems",
|
|
3848
3848
|
license: "MIT",
|
|
3849
3849
|
scripts: {
|
package/dist/assets/ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./ui-
|
|
1
|
+
export * from "./ui-d0e72380.js";
|
package/dist/assets/vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./vue-
|
|
1
|
+
export * from "./vue-5343ee51.js";
|
|
@@ -10,8 +10,8 @@ function loadCss(href) {
|
|
|
10
10
|
elem.onerror = reject;
|
|
11
11
|
document.head.appendChild(elem);
|
|
12
12
|
});
|
|
13
|
-
} await loadCss('./assets/vuetify-
|
|
14
|
-
import { Comment as t, Fragment as n, Teleport as r, Text as i, Transition as a, TransitionGroup as o, camelize as s, capitalize as c, cloneVNode as l, computed as u, createCommentVNode as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, effectScope as g, getCurrentInstance as _, getCurrentScope as v, guardReactiveProps as y, h as b, hasInjectionContext as x, inject as S, isProxy as C, isReactive as w, isRef as T, isVNode as E, markRaw as D, mergeProps as O, nextTick as k, normalizeClass as A, normalizeProps as j, normalizeStyle as M, onActivated as N, onBeforeMount as P, onBeforeUnmount as F, onBeforeUpdate as I, onDeactivated as L, onMounted as R, onScopeDispose as ee, onUnmounted as te, onUpdated as ne, provide as z, reactive as re, readonly as B, ref as V, render as ie, resolveComponent as ae, resolveDynamicComponent as oe, shallowReactive as se, shallowReadonly as ce, shallowRef as H, toDisplayString as le, toRaw as ue, toRef as U, toRefs as de, toValue as W, triggerRef as fe, unref as pe, useId as me, vModelText as he, vShow as ge, warn as _e, watch as G, watchEffect as ve, withDirectives as ye, withModifiers as be } from "./vue-
|
|
13
|
+
} await loadCss('./assets/vuetify-3e661aa3.css');import * as e from "./vue-5343ee51.js";
|
|
14
|
+
import { Comment as t, Fragment as n, Teleport as r, Text as i, Transition as a, TransitionGroup as o, camelize as s, capitalize as c, cloneVNode as l, computed as u, createCommentVNode as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, effectScope as g, getCurrentInstance as _, getCurrentScope as v, guardReactiveProps as y, h as b, hasInjectionContext as x, inject as S, isProxy as C, isReactive as w, isRef as T, isVNode as E, markRaw as D, mergeProps as O, nextTick as k, normalizeClass as A, normalizeProps as j, normalizeStyle as M, onActivated as N, onBeforeMount as P, onBeforeUnmount as F, onBeforeUpdate as I, onDeactivated as L, onMounted as R, onScopeDispose as ee, onUnmounted as te, onUpdated as ne, provide as z, reactive as re, readonly as B, ref as V, render as ie, resolveComponent as ae, resolveDynamicComponent as oe, shallowReactive as se, shallowReadonly as ce, shallowRef as H, toDisplayString as le, toRaw as ue, toRef as U, toRefs as de, toValue as W, triggerRef as fe, unref as pe, useId as me, vModelText as he, vShow as ge, warn as _e, watch as G, watchEffect as ve, withDirectives as ye, withModifiers as be } from "./vue-5343ee51.js";
|
|
15
15
|
// node_modules/vuetify/lib/util/console.js
|
|
16
16
|
function xe(e) {
|
|
17
17
|
_e(`Vuetify: ${e}`);
|
package/dist/assets/vuetify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./vuetify-
|
|
1
|
+
export * from "./vuetify-3e661aa3.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -205,7 +205,8 @@ export type { callbackClassRegistry, VcsCallbackOptions, } from './src/callback/
|
|
|
205
205
|
export type { isSingleComponent, isSelectComponent, isGroupComponent, } from './src/callback/toggleToolbarButtonCallback.js';
|
|
206
206
|
export type { subTreeSymbol, subTreeItemWeight, subTreeOpenStateSymbol, ContentTreeItemOptions, TreeViewItem, contentTreeClassRegistry, } from './src/contentTree/contentTreeItem.js';
|
|
207
207
|
export type { WMSEntry } from './src/contentTree/wmsGroupContentTreeItem.js';
|
|
208
|
-
export type { setStyleAction } from './src/contentTree/layerContentTreeItem.js';
|
|
208
|
+
export type { setStyleAction, LayerContentTreeItemOptions, } from './src/contentTree/layerContentTreeItem.js';
|
|
209
|
+
export type { ObliqueCollectionContentTreeItemOptions } from './src/contentTree/obliqueCollectionContentTreeItem.js';
|
|
209
210
|
export type { VcsObjectContentTreeItemProperties } from './src/contentTree/vcsObjectContentTreeItem.js';
|
|
210
211
|
export type { isSlotPosition, WindowSlotType, WindowPositionOptions, WindowPosition, WindowComponentOptions, OptionOrRef, WindowStateOptions, WindowState, } from './src/manager/window/windowManager.js';
|
|
211
212
|
export type { getPanelTargetSize, windowMoveMargin, } from './src/manager/window/windowHelper.js';
|
|
@@ -231,7 +232,7 @@ export type { isUiConfigurationItem, UiConfigurationItem, TextPageType, SplashSc
|
|
|
231
232
|
export type { setTheme, isMobileLandscape, useIconSize, defaultPrimaryColor, VcsThemes, } from './src/vuePlugins/vuetify.js';
|
|
232
233
|
export type { getModuleUrl, getPluginEntry, pluginVersionRangeSymbol, } from './src/pluginHelper.js';
|
|
233
234
|
export type { parseUrlProjectedViewpointState, parseUrlExtentState, parseWMSStyle, writeWMSStyleForLayer, LayerState, PluginState, ClippingPolygonState, AppState, CachedAppState, } from './src/state.js';
|
|
234
|
-
export type { PluginConfig, SerializedPluginConfig, PluginConfigEditorComponent, PluginConfigEditor, VcsPlugin, VcsComponentManager, } from './src/vcsUiApp.js';
|
|
235
|
+
export type { VcsUiModuleConfig, PluginConfig, SerializedPluginConfig, PluginConfigEditorComponent, PluginConfigEditor, VcsPlugin, VcsComponentManager, } from './src/vcsUiApp.js';
|
|
235
236
|
export type { attributesToItems, getTag, getTagOptions, defaultTagOptions, } from './src/components/tables/VcsTable.ts.vue.js';
|
|
236
237
|
export type { SortKey, UpdateItemsEvent, } from './src/components/tables/VcsDataTable.ts.vue.js';
|
|
237
238
|
export type { VcsRadioItem } from './src/components/form-inputs-controls/VcsRadio.ts.vue.js';
|
package/lib/package.json.js
CHANGED
package/lib/package.json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@vcmap/ui\",\n \"version\": \"7.0.0-rc.
|
|
1
|
+
{"version":3,"file":"package.json.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@vcmap/ui\",\n \"version\": \"7.0.0-rc.4\",\n \"author\": \"Virtual City Systems\",\n \"license\": \"MIT\",\n \"scripts\": {\n \"start\": \"vite\",\n \"test\": \"vitest\",\n \"coverage\": \"vitest run --coverage\",\n \"coverage:gitlab\": \"vitest run --coverage --reporter junit --outputFile test-report.xml\",\n \"build-preview\": \"node build/buildPreview.js\",\n \"preview\": \"vite preview\",\n \"build\": \"node build/build.js\",\n \"build-library\": \"node build/buildLibrary.js\",\n \"build-library:watch\": \"node build/buildLibrary.js --watch\",\n \"bundle\": \"node build/bundle.js\",\n \"lint:js\": \"eslint . --ext .vue,.js,.cjs,.mjs,.ts,.cts,.mts\",\n \"lint:prettier\": \"prettier --check .\",\n \"lint\": \"npm run lint:js && npm run lint:prettier\",\n \"type-check\": \"vue-tsc --noEmit\",\n \"format\": \"prettier --write --list-different . && npm run lint:js -- --fix\",\n \"prepack\": \"npm run build && npm run build-library\",\n \"install-plugins\": \"cd plugins && npm i --omit peer --no-package-lock --force\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/virtualcitySYSTEMS/map-ui.git\"\n },\n \"files\": [\n \"index.html\",\n \"app.config.json\",\n \"dist/\",\n \"plugins/\",\n \"public/\",\n \"lib/\",\n \"build/\",\n \"config/\",\n \"!plugins/node_modules/\"\n ],\n \"dependencies\": {\n \"@intlify/core-base\": \"^9.13.1\",\n \"@vcsuite/check\": \"^3.0.0\",\n \"@vcsuite/logger\": \"^1.0.1\",\n \"@vcsuite/parsers\": \"^2.0.1\",\n \"dompurify\": \"^3.4.11\",\n \"fast-deep-equal\": \"^3.1.3\",\n \"marked\": \"^15.0.7\",\n \"semver\": \"^7.6.3\",\n \"uuid\": \"^14.0.0\",\n \"vue-i18n\": \"^9.13.1\"\n },\n \"peerDependencies\": {\n \"@vcmap-cesium/engine\": \"^26.0.1\",\n \"@vcmap/core\": \"^7.0.0-rc.3\",\n \"ol\": \"^10.10.0\",\n \"vue\": \"^3.5.40\",\n \"vuetify\": \"^4.2.1\"\n },\n \"devDependencies\": {\n \"@types/semver\": \"^7.8.0\",\n \"@vcmap/rollup-plugin-vcs-ol\": \"^1.0.5\",\n \"@vcsuite/eslint-config\": \"^4.1.0\",\n \"@vitejs/plugin-vue\": \"^6.0.8\",\n \"@vitest/coverage-v8\": \"^5.0.1\",\n \"@vue/test-utils\": \"^2.4.11\",\n \"jest-canvas-mock\": \"^2.5.2\",\n \"jsdoc\": \"^4.0.3\",\n \"jsdoc-plugin-intersection\": \"^1.0.4\",\n \"jsdoc-plugin-typescript\": \"^2.2.1\",\n \"jsdom\": \"^30.0.1\",\n \"nock\": \"^14.0.1\",\n \"resize-observer-polyfill\": \"1.5.1\",\n \"rollup-plugin-strip-pragma\": \"^1.0.0\",\n \"sass\": \"^1.80.2\",\n \"tar\": \"^7.4.3\",\n \"typescript\": \"^6.0.3\",\n \"vite\": \"^8.2.0\",\n \"vite-plugin-vuetify\": \"^2.1.3\",\n \"vitest\": \"^5.0.3\",\n \"vue-tsc\": \"^3.3.6\"\n },\n \"stylelint\": {\n \"extends\": \"stylelint-config-standard\",\n \"rules\": {\n \"selector-pseudo-element-no-unknown\": [\n true,\n {\n \"ignorePseudoElements\": [\n \"v-deep\"\n ]\n }\n ]\n }\n },\n \"prettier\": \"@vcsuite/eslint-config/prettier.js\",\n \"browserslist\": [\n \"last 2 Chrome versions\",\n \"not Chrome < 116\",\n \"last 2 Safari versions\",\n \"not Safari < 15\",\n \"last 2 iOS versions\",\n \"not iOS < 15\",\n \"last 2 Firefox versions\",\n \"not Firefox < 114\",\n \"last 2 Edge versions\",\n \"not Edge < 116\"\n ],\n \"engines\": {\n \"node\": \">=24.0.0\",\n \"npm\": \">=10.0.0\"\n },\n \"type\": \"module\",\n \"types\": \"./lib/index.d.ts\",\n \"main\": \"./lib/index.js\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"default\": \"./lib/index.js\"\n },\n \"./config/*.json\": \"./config/*.json\",\n \"./importmap.json\": \"./dist/importmap.json\",\n \"./build/commonViteConfig.js\": \"./build/commonViteConfig.js\",\n \"./build/devImportMap.js\": \"./build/devImportMap.js\",\n \"./build/buildHelpers.js\": \"./build/buildHelpers.js\",\n \"./build/getPluginProxies.js\": \"./build/getPluginProxies.js\",\n \"./build/determineHost.js\": \"./build/determineHost.js\"\n }\n}\n"],"mappings":""}
|
|
@@ -4,7 +4,7 @@ import { StateActionState } from '../actions/stateRefAction.js';
|
|
|
4
4
|
import VcsObjectContentTreeItem, { type VcsObjectContentTreeItemProperties } from './vcsObjectContentTreeItem.js';
|
|
5
5
|
import type ContentTreeItem from './contentTreeItem.js';
|
|
6
6
|
import { type ContentTreeItemOptions } from './contentTreeItem.js';
|
|
7
|
-
type LayerContentTreeItemOptions = ContentTreeItemOptions & {
|
|
7
|
+
export type LayerContentTreeItemOptions = ContentTreeItemOptions & {
|
|
8
8
|
layerName: string;
|
|
9
9
|
/** optional flag to show the item even if it is not supported by the activeMap. */
|
|
10
10
|
showWhenNotSupported?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerContentTreeItem.js","names":[],"sources":["../../../src/contentTree/layerContentTreeItem.ts"],"sourcesContent":["import { Extent, type Layer, type VcsMap, Viewpoint } from '@vcmap/core';\nimport { parseBoolean } from '@vcsuite/parsers';\nimport { reactive } from 'vue';\nimport type VcsUiApp from '../vcsUiApp.js';\nimport { StateActionState } from '../actions/stateRefAction.js';\nimport {\n createGoToViewpointAction,\n createModalAction,\n} from '../actions/actionHelper.js';\nimport component from '../actions/StyleSelector.ts.vue';\nimport VcsObjectContentTreeItem, {\n type VcsObjectContentTreeItemProperties,\n} from './vcsObjectContentTreeItem.js';\nimport { vcsAppSymbol } from '../pluginHelper.js';\nimport type ContentTreeItem from './contentTreeItem.js';\nimport {\n type ContentTreeItemOptions,\n contentTreeClassRegistry,\n} from './contentTreeItem.js';\nimport { executeCallbacks } from '../callback/vcsCallback.js';\n\ntype LayerContentTreeItemOptions = ContentTreeItemOptions & {\n layerName: string;\n /** optional flag to show the item even if it is not supported by the activeMap. */\n showWhenNotSupported?: boolean;\n};\n\ntype LayerContentTreeItemProperties = VcsObjectContentTreeItemProperties & {\n availableStyles?: string[];\n defaultViewpoint?: string;\n};\n\nexport function setViewpointAction(\n item: ContentTreeItem,\n app: VcsUiApp,\n viewpoint?: string | Viewpoint,\n): void {\n const name = 'ViewpointAction';\n item.removeAction(name);\n\n if (viewpoint) {\n const action = createGoToViewpointAction(\n { name, icon: 'mdi-target' },\n viewpoint,\n app.viewpoints,\n app.maps,\n );\n item.addAction(action, 2);\n }\n}\n\nexport function setStyleAction(\n item: ContentTreeItem,\n app: VcsUiApp,\n listeners: Array<() => void>,\n layerNames: Array<string>,\n availableStyles?: Array<string>,\n): void {\n const name = 'StyleSelector';\n item.removeAction(name);\n if (Array.isArray(availableStyles) && availableStyles.length > 0) {\n const { action, destroy } = createModalAction(\n { name, icon: '$vcsColorSwatch', title: 'content.styleAction.title' },\n {\n component,\n position: { width: 200 },\n props: reactive({\n availableStyles: availableStyles.slice(),\n layerNames: layerNames.slice(),\n }),\n },\n app,\n vcsAppSymbol,\n );\n item.addAction(action, 4);\n listeners.push(destroy);\n }\n}\n\nexport function getStateFromLayer(layer: Layer): StateActionState {\n if (layer.active) {\n return StateActionState.ACTIVE;\n } else if (layer.loading) {\n return StateActionState.LOADING;\n }\n return StateActionState.INACTIVE;\n}\n\n/**\n * A layer item. Activates/deactivates the layer when clicked.\n */\nclass LayerContentTreeItem extends VcsObjectContentTreeItem<LayerContentTreeItemProperties> {\n /**\n * @todo this has to be refactored, just so we can read the config as is\n */\n static get className(): string {\n return 'LayerContentTreeItem';\n }\n\n private _layerName: string;\n private _showWhenNotSupported: boolean;\n private _listeners: Array<() => void> = [];\n\n constructor(options: LayerContentTreeItemOptions, app: VcsUiApp) {\n super(options, app);\n this.state = StateActionState.INACTIVE;\n\n this._layerName = options.layerName;\n\n this._showWhenNotSupported = parseBoolean(\n options.showWhenNotSupported,\n false,\n );\n\n this._setup();\n }\n\n private get _layer(): Layer {\n return this._app.layers.getByKey(this._layerName)!;\n }\n\n private _setLayerExtentAction(): void {\n const name = 'content.layerExtentAction.name';\n this.removeAction(name);\n if (this._layer) {\n const { extent } = this._layer.toJSON();\n if (extent) {\n const viewpoint = Viewpoint.createViewpointFromExtent(\n new Extent(extent),\n );\n if (viewpoint) {\n const action = createGoToViewpointAction(\n { name, title: 'content.layerExtentAction.title' },\n viewpoint,\n this._app.viewpoints,\n this._app.maps,\n );\n this.addAction(action, 8);\n }\n }\n }\n }\n\n protected _setProperties(properties: LayerContentTreeItemProperties): void {\n super._setProperties(properties);\n setStyleAction(\n this,\n this._app,\n this._listeners,\n [this._layerName],\n properties.availableStyles,\n );\n setViewpointAction(this, this._app, properties.defaultViewpoint);\n }\n\n private _clearListeners(): void {\n this._listeners.forEach((cb) => {\n cb();\n });\n this._listeners.splice(0);\n }\n\n private _determineSupport(): void {\n const isSupported = this._layer.isSupported(this._app.maps.activeMap!);\n this.visible = isSupported || this._showWhenNotSupported;\n if (this._showWhenNotSupported) {\n this.disabled = !isSupported;\n }\n }\n\n private _setup(): void {\n this._clearListeners();\n /**\n * Called when a layer is added or removed to reset the item if needed\n */\n const resetHandler = (layer: Layer): void => {\n if (layer.name === this._layerName) {\n this._setup();\n }\n };\n\n let supportedLayersListener = (): void => {};\n const setActiveMap = (map: VcsMap | null): void => {\n supportedLayersListener();\n this._determineSupport();\n supportedLayersListener = map\n ? map.layerTypesChanged.addEventListener(() => {\n this._determineSupport();\n })\n : (): void => {};\n };\n if (!this._layer) {\n this.visible = false;\n this._listeners.push(\n this._app.layers.added.addEventListener(resetHandler),\n );\n } else {\n setActiveMap(this._app.maps.activeMap);\n this.state = getStateFromLayer(this._layer);\n this._setLayerExtentAction();\n this.setPropertiesFromObject(this._layer);\n\n this._listeners.push(\n this._app.layers.removed.addEventListener(resetHandler),\n this._app.layers.added.addEventListener(resetHandler),\n this._layer.stateChanged.addEventListener(() => {\n this.state = getStateFromLayer(this._layer);\n }),\n this._app.maps.mapActivated.addEventListener(setActiveMap),\n () => {\n supportedLayersListener();\n },\n );\n }\n }\n\n async clicked(): Promise<void> {\n await super.clicked();\n if (this._layer) {\n if (this.state === StateActionState.INACTIVE) {\n await this._layer.activate();\n executeCallbacks(this._app, this._onActivate);\n } else {\n this._layer.deactivate();\n executeCallbacks(this._app, this._onDeactivate);\n }\n }\n }\n\n toJSON(): LayerContentTreeItemOptions {\n const config = super.toJSON() as LayerContentTreeItemOptions;\n config.layerName = this._layerName;\n if (this._showWhenNotSupported) {\n config.showWhenNotSupported = this._showWhenNotSupported;\n }\n return config;\n }\n\n destroy(): void {\n super.destroy();\n this._clearListeners();\n }\n}\n\nexport default LayerContentTreeItem;\ncontentTreeClassRegistry.registerClass(\n LayerContentTreeItem.className,\n LayerContentTreeItem,\n);\n"],"mappings":";;;;;;;;;;;AAgCA,SAAgB,mBACd,MACA,KACA,WACM;CACN,MAAM,OAAO;CACb,KAAK,aAAa,IAAI;CAEtB,IAAI,WAAW;EACb,MAAM,SAAS,0BACb;GAAE;GAAM,MAAM;EAAa,GAC3B,WACA,IAAI,YACJ,IAAI,IACN;EACA,KAAK,UAAU,QAAQ,CAAC;CAC1B;AACF;AAEA,SAAgB,eACd,MACA,KACA,WACA,YACA,iBACM;CACN,MAAM,OAAO;CACb,KAAK,aAAa,IAAI;CACtB,IAAI,MAAM,QAAQ,eAAe,KAAK,gBAAgB,SAAS,GAAG;EAChE,MAAM,EAAE,QAAQ,YAAY,kBAC1B;GAAE;GAAM,MAAM;GAAmB,OAAO;EAA4B,GACpE;GACE,WAAA;GACA,UAAU,EAAE,OAAO,IAAI;GACvB,OAAO,SAAS;IACd,iBAAiB,gBAAgB,MAAM;IACvC,YAAY,WAAW,MAAM;GAC/B,CAAC;EACH,GACA,KACA,YACF;EACA,KAAK,UAAU,QAAQ,CAAC;EACxB,UAAU,KAAK,OAAO;CACxB;AACF;AAEA,SAAgB,kBAAkB,OAAgC;CAChE,IAAI,MAAM,QACR,OAAO,iBAAiB;MACnB,IAAI,MAAM,SACf,OAAO,iBAAiB;CAE1B,OAAO,iBAAiB;AAC1B;;;;AAKA,IAAM,uBA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oBACF"}
|
|
1
|
+
{"version":3,"file":"layerContentTreeItem.js","names":[],"sources":["../../../src/contentTree/layerContentTreeItem.ts"],"sourcesContent":["import { Extent, type Layer, type VcsMap, Viewpoint } from '@vcmap/core';\nimport { parseBoolean } from '@vcsuite/parsers';\nimport { reactive } from 'vue';\nimport type VcsUiApp from '../vcsUiApp.js';\nimport { StateActionState } from '../actions/stateRefAction.js';\nimport {\n createGoToViewpointAction,\n createModalAction,\n} from '../actions/actionHelper.js';\nimport component from '../actions/StyleSelector.ts.vue';\nimport VcsObjectContentTreeItem, {\n type VcsObjectContentTreeItemProperties,\n} from './vcsObjectContentTreeItem.js';\nimport { vcsAppSymbol } from '../pluginHelper.js';\nimport type ContentTreeItem from './contentTreeItem.js';\nimport {\n type ContentTreeItemOptions,\n contentTreeClassRegistry,\n} from './contentTreeItem.js';\nimport { executeCallbacks } from '../callback/vcsCallback.js';\n\nexport type LayerContentTreeItemOptions = ContentTreeItemOptions & {\n layerName: string;\n /** optional flag to show the item even if it is not supported by the activeMap. */\n showWhenNotSupported?: boolean;\n};\n\ntype LayerContentTreeItemProperties = VcsObjectContentTreeItemProperties & {\n availableStyles?: string[];\n defaultViewpoint?: string;\n};\n\nexport function setViewpointAction(\n item: ContentTreeItem,\n app: VcsUiApp,\n viewpoint?: string | Viewpoint,\n): void {\n const name = 'ViewpointAction';\n item.removeAction(name);\n\n if (viewpoint) {\n const action = createGoToViewpointAction(\n { name, icon: 'mdi-target' },\n viewpoint,\n app.viewpoints,\n app.maps,\n );\n item.addAction(action, 2);\n }\n}\n\nexport function setStyleAction(\n item: ContentTreeItem,\n app: VcsUiApp,\n listeners: Array<() => void>,\n layerNames: Array<string>,\n availableStyles?: Array<string>,\n): void {\n const name = 'StyleSelector';\n item.removeAction(name);\n if (Array.isArray(availableStyles) && availableStyles.length > 0) {\n const { action, destroy } = createModalAction(\n { name, icon: '$vcsColorSwatch', title: 'content.styleAction.title' },\n {\n component,\n position: { width: 200 },\n props: reactive({\n availableStyles: availableStyles.slice(),\n layerNames: layerNames.slice(),\n }),\n },\n app,\n vcsAppSymbol,\n );\n item.addAction(action, 4);\n listeners.push(destroy);\n }\n}\n\nexport function getStateFromLayer(layer: Layer): StateActionState {\n if (layer.active) {\n return StateActionState.ACTIVE;\n } else if (layer.loading) {\n return StateActionState.LOADING;\n }\n return StateActionState.INACTIVE;\n}\n\n/**\n * A layer item. Activates/deactivates the layer when clicked.\n */\nclass LayerContentTreeItem extends VcsObjectContentTreeItem<LayerContentTreeItemProperties> {\n /**\n * @todo this has to be refactored, just so we can read the config as is\n */\n static get className(): string {\n return 'LayerContentTreeItem';\n }\n\n private _layerName: string;\n private _showWhenNotSupported: boolean;\n private _listeners: Array<() => void> = [];\n\n constructor(options: LayerContentTreeItemOptions, app: VcsUiApp) {\n super(options, app);\n this.state = StateActionState.INACTIVE;\n\n this._layerName = options.layerName;\n\n this._showWhenNotSupported = parseBoolean(\n options.showWhenNotSupported,\n false,\n );\n\n this._setup();\n }\n\n private get _layer(): Layer {\n return this._app.layers.getByKey(this._layerName)!;\n }\n\n private _setLayerExtentAction(): void {\n const name = 'content.layerExtentAction.name';\n this.removeAction(name);\n if (this._layer) {\n const { extent } = this._layer.toJSON();\n if (extent) {\n const viewpoint = Viewpoint.createViewpointFromExtent(\n new Extent(extent),\n );\n if (viewpoint) {\n const action = createGoToViewpointAction(\n { name, title: 'content.layerExtentAction.title' },\n viewpoint,\n this._app.viewpoints,\n this._app.maps,\n );\n this.addAction(action, 8);\n }\n }\n }\n }\n\n protected _setProperties(properties: LayerContentTreeItemProperties): void {\n super._setProperties(properties);\n setStyleAction(\n this,\n this._app,\n this._listeners,\n [this._layerName],\n properties.availableStyles,\n );\n setViewpointAction(this, this._app, properties.defaultViewpoint);\n }\n\n private _clearListeners(): void {\n this._listeners.forEach((cb) => {\n cb();\n });\n this._listeners.splice(0);\n }\n\n private _determineSupport(): void {\n const isSupported = this._layer.isSupported(this._app.maps.activeMap!);\n this.visible = isSupported || this._showWhenNotSupported;\n if (this._showWhenNotSupported) {\n this.disabled = !isSupported;\n }\n }\n\n private _setup(): void {\n this._clearListeners();\n /**\n * Called when a layer is added or removed to reset the item if needed\n */\n const resetHandler = (layer: Layer): void => {\n if (layer.name === this._layerName) {\n this._setup();\n }\n };\n\n let supportedLayersListener = (): void => {};\n const setActiveMap = (map: VcsMap | null): void => {\n supportedLayersListener();\n this._determineSupport();\n supportedLayersListener = map\n ? map.layerTypesChanged.addEventListener(() => {\n this._determineSupport();\n })\n : (): void => {};\n };\n if (!this._layer) {\n this.visible = false;\n this._listeners.push(\n this._app.layers.added.addEventListener(resetHandler),\n );\n } else {\n setActiveMap(this._app.maps.activeMap);\n this.state = getStateFromLayer(this._layer);\n this._setLayerExtentAction();\n this.setPropertiesFromObject(this._layer);\n\n this._listeners.push(\n this._app.layers.removed.addEventListener(resetHandler),\n this._app.layers.added.addEventListener(resetHandler),\n this._layer.stateChanged.addEventListener(() => {\n this.state = getStateFromLayer(this._layer);\n }),\n this._app.maps.mapActivated.addEventListener(setActiveMap),\n () => {\n supportedLayersListener();\n },\n );\n }\n }\n\n async clicked(): Promise<void> {\n await super.clicked();\n if (this._layer) {\n if (this.state === StateActionState.INACTIVE) {\n await this._layer.activate();\n executeCallbacks(this._app, this._onActivate);\n } else {\n this._layer.deactivate();\n executeCallbacks(this._app, this._onDeactivate);\n }\n }\n }\n\n toJSON(): LayerContentTreeItemOptions {\n const config = super.toJSON() as LayerContentTreeItemOptions;\n config.layerName = this._layerName;\n if (this._showWhenNotSupported) {\n config.showWhenNotSupported = this._showWhenNotSupported;\n }\n return config;\n }\n\n destroy(): void {\n super.destroy();\n this._clearListeners();\n }\n}\n\nexport default LayerContentTreeItem;\ncontentTreeClassRegistry.registerClass(\n LayerContentTreeItem.className,\n LayerContentTreeItem,\n);\n"],"mappings":";;;;;;;;;;;AAgCA,SAAgB,mBACd,MACA,KACA,WACM;CACN,MAAM,OAAO;CACb,KAAK,aAAa,IAAI;CAEtB,IAAI,WAA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tD,KAAK,KAAK,OAAO,MAAM,iBAAiB,YAAY,GACpD,KAAK,OAAO,aAAa,uBAAuB;IAC9C,KAAK,QAAQ,kBAAkB,KAAK,MAAM;GAC5C,CAAC,GACD,KAAK,KAAK,KAAK,aAAa,iBAAiB,YAAY,SACnD;IACJ,wBAAwB;GAC1B,CACF;EACF;CACF;CAEA,MAAM,UAAyB;EAC7B,MAAM,MAAM,QAAQ;EACpB,IAAI,KAAK,QAAQ;GACf,IAAI,KAAK,UAAU,iBAAiB,UAAU;IAC5C,MAAM,KAAK,OAAO,SAAS;IAC3B,iBAAiB,KAAK,MAAM,KAAK,WAAW;GAC9C,OAAO;IACL,KAAK,OAAO,WAAW;IACvB,iBAAiB,KAAK,MAAM,KAAK,aAAa;GAChD;EACF;CACF;CAEA,SAAsC;EACpC,MAAM,SAAS,MAAM,OAAO;EAC5B,OAAO,YAAY,KAAK;EACxB,IAAI,KAAK,uBACP,OAAO,uBAAuB,KAAK;EAErC,OAAO;CACT;CAEA,UAAgB;EACd,MAAM,QAAQ;EACd,KAAK,gBAAgB;CACvB;AACF;AAGA,yBAAyB,cACvB,qBAAqB,WACrB,oBACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type VcsUiApp from '../vcsUiApp.js';
|
|
2
2
|
import VcsObjectContentTreeItem, { type VcsObjectContentTreeItemProperties } from './vcsObjectContentTreeItem.js';
|
|
3
3
|
import { type ContentTreeItemOptions } from './contentTreeItem.js';
|
|
4
|
-
type ObliqueCollectionContentTreeItemOptions = ContentTreeItemOptions & {
|
|
4
|
+
export type ObliqueCollectionContentTreeItemOptions = ContentTreeItemOptions & {
|
|
5
5
|
collectionName: string;
|
|
6
6
|
/** optional flag to show the item even if it is not supported by the activeMap. */
|
|
7
7
|
showWhenNotSupported?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obliqueCollectionContentTreeItem.js","names":[],"sources":["../../../src/contentTree/obliqueCollectionContentTreeItem.ts"],"sourcesContent":["import {\n DefaultObliqueCollection,\n type ObliqueCollection,\n ObliqueMap,\n} from '@vcmap/core';\nimport { parseBoolean } from '@vcsuite/parsers';\nimport type VcsUiApp from '../vcsUiApp.js';\nimport VcsObjectContentTreeItem, {\n type VcsObjectContentTreeItemProperties,\n} from './vcsObjectContentTreeItem.js';\nimport { setViewpointAction } from './layerContentTreeItem.js';\nimport { StateActionState } from '../actions/stateRefAction.js';\nimport {\n type ContentTreeItemOptions,\n contentTreeClassRegistry,\n} from './contentTreeItem.js';\nimport { executeCallbacks } from '../callback/vcsCallback.js';\n\
|
|
1
|
+
{"version":3,"file":"obliqueCollectionContentTreeItem.js","names":[],"sources":["../../../src/contentTree/obliqueCollectionContentTreeItem.ts"],"sourcesContent":["import {\n DefaultObliqueCollection,\n type ObliqueCollection,\n ObliqueMap,\n} from '@vcmap/core';\nimport { parseBoolean } from '@vcsuite/parsers';\nimport type VcsUiApp from '../vcsUiApp.js';\nimport VcsObjectContentTreeItem, {\n type VcsObjectContentTreeItemProperties,\n} from './vcsObjectContentTreeItem.js';\nimport { setViewpointAction } from './layerContentTreeItem.js';\nimport { StateActionState } from '../actions/stateRefAction.js';\nimport {\n type ContentTreeItemOptions,\n contentTreeClassRegistry,\n} from './contentTreeItem.js';\nimport { executeCallbacks } from '../callback/vcsCallback.js';\n\nexport type ObliqueCollectionContentTreeItemOptions = ContentTreeItemOptions & {\n collectionName: string;\n /** optional flag to show the item even if it is not supported by the activeMap. */\n showWhenNotSupported?: boolean;\n};\n\ntype ObliqueCollectionContentTreeItemProperties =\n VcsObjectContentTreeItemProperties & {\n defaultViewpoint?: string;\n };\n\nconst defaultCollection = new DefaultObliqueCollection();\n\n/**\n * An oblique collection item. Sets/unsets the oblique collection when clicked.\n */\nclass ObliqueCollectionContentTreeItem extends VcsObjectContentTreeItem<ObliqueCollectionContentTreeItemProperties> {\n static get className(): string {\n return 'ObliqueCollectionContentTreeItem';\n }\n\n private _collectionName: string;\n private _showWhenNotSupported: boolean;\n private _listeners: Array<() => void> = [];\n\n constructor(options: ObliqueCollectionContentTreeItemOptions, app: VcsUiApp) {\n super(options, app);\n this.state = StateActionState.INACTIVE;\n\n this._collectionName = options.collectionName;\n this._showWhenNotSupported = parseBoolean(\n options.showWhenNotSupported,\n false,\n );\n\n this._setup();\n }\n\n private get _collection(): ObliqueCollection | undefined {\n return this._app.obliqueCollections.getByKey(this._collectionName);\n }\n\n protected _setProperties(\n properties: ObliqueCollectionContentTreeItemProperties,\n ): void {\n super._setProperties(properties);\n\n setViewpointAction(this, this._app, properties.defaultViewpoint);\n }\n\n private _clearListeners(): void {\n this._listeners.forEach((cb) => {\n cb();\n });\n this._listeners.splice(0);\n }\n\n private _setup(): void {\n this._clearListeners();\n\n /**\n * Called when an obliqueCollection is added or removed to reset the item if needed\n */\n const resetCallback = (collection: ObliqueCollection): void => {\n if (collection.name === this._collectionName) {\n this._setup();\n }\n };\n\n if (!this._collection) {\n this.visible = false;\n this._listeners.push(\n this._app.obliqueCollections.added.addEventListener(resetCallback),\n );\n } else {\n const map = this._app.maps.activeMap;\n if (map instanceof ObliqueMap) {\n this.visible = true;\n if (this._showWhenNotSupported) {\n this.disabled = false;\n }\n this.state =\n map.collection === this._collection\n ? StateActionState.ACTIVE\n : StateActionState.INACTIVE;\n this._listeners.push(\n map.collectionChanged.addEventListener(() => {\n this.state =\n map.collection === this._collection\n ? StateActionState.ACTIVE\n : StateActionState.INACTIVE;\n }),\n );\n } else {\n this.visible = this._showWhenNotSupported;\n if (this._showWhenNotSupported) {\n this.disabled = this._showWhenNotSupported;\n }\n }\n\n this.setPropertiesFromObject(this._collection);\n this._listeners.push(\n this._app.maps.mapActivated.addEventListener(() => {\n this._setup();\n }),\n );\n\n this._listeners.push(\n this._app.obliqueCollections.removed.addEventListener(resetCallback),\n );\n this._listeners.push(\n this._app.obliqueCollections.added.addEventListener(resetCallback),\n );\n }\n }\n\n async clicked(): Promise<void> {\n await super.clicked();\n if (\n this.visible &&\n this._collection &&\n this._app.maps.activeMap instanceof ObliqueMap\n ) {\n const map = this._app.maps.activeMap;\n const vp = (await map.getViewpoint())!;\n if (this.state === StateActionState.INACTIVE) {\n this.state = StateActionState.LOADING;\n await map.setCollection(this._collection, vp);\n if (map.collection === this._collection) {\n executeCallbacks(this._app, this._onActivate);\n } else {\n // failed to activate collection\n this.state = StateActionState.INACTIVE;\n }\n } else if (this.state === StateActionState.ACTIVE) {\n this.state = StateActionState.INACTIVE;\n await map.setCollection(defaultCollection, vp);\n executeCallbacks(this._app, this._onDeactivate);\n }\n }\n }\n\n toJSON(): ObliqueCollectionContentTreeItemOptions {\n const config = super.toJSON() as ObliqueCollectionContentTreeItemOptions;\n config.collectionName = this._collectionName;\n if (this._showWhenNotSupported) {\n config.showWhenNotSupported = this._showWhenNotSupported;\n }\n return config;\n }\n\n destroy(): void {\n this._clearListeners();\n super.destroy();\n }\n}\n\nexport default ObliqueCollectionContentTreeItem;\ncontentTreeClassRegistry.registerClass(\n ObliqueCollectionContentTreeItem.className,\n ObliqueCollectionContentTreeItem,\n);\n"],"mappings":";;;;;;;;AA6BA,IAAM,oBAAoB,IAAI,yBAAyB;;;;AAKvD,IAAM,mCAAN,cAA+C,yBAAqE;CAClH,WAAW,YAAoB;EAC7B,OAAO;CACT;CAEA;CACA;CACA,aAAwC,CAAC;CAEzC,YAAY,SAAkD,KAAe;EAC3E,MAAM,SAAS,GAAG;EAClB,KAAK,QAAQ,iBAAiB;EAE9B,KAAK,kBAAkB,QAAQ;EAC/B,KAAK,wBAAwB,aAC3B,QAAQ,sBACR,KACF;EAEA,KAAK,OAAO;CACd;CAEA,IAAY,cAA6C;EACvD,OAAO,KAAK,KAAK,mBAAmB,SAAS,KAAK,eAAe;CACnE;CAEA,eACE,YACM;EACN,MAAM,eAAe,UAAU;EAE/B,mBAAmB,MAAM,KAAK,MAAM,WAAW,gBAAgB;CACjE;CAEA,kBAAgC;EAC9B,KAAK,WAAW,SAAS,OAAO;GAC9B,GAAG;EACL,CAAC;EACD,K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AAE;IAC5C,IAAI,IAAI,eAAe,KAAK,aAC1B,iBAAiB,KAAK,MAAM,KAAK,WAAW;SAG5C,KAAK,QAAQ,iBAAiB;GAElC,OAAO,IAAI,KAAK,UAAU,iBAAiB,QAAQ;IACjD,KAAK,QAAQ,iBAAiB;IAC9B,MAAM,IAAI,cAAc,mBAAmB,EAAE;IAC7C,iBAAiB,KAAK,MAAM,KAAK,aAAa;GAChD;EACF;CACF;CAEA,SAAkD;EAChD,MAAM,SAAS,MAAM,OAAO;EAC5B,OAAO,iBAAiB,KAAK;EAC7B,IAAI,KAAK,uBACP,OAAO,uBAAuB,KAAK;EAErC,OAAO;CACT;CAEA,UAAgB;EACd,KAAK,gBAAgB;EACrB,MAAM,QAAQ;CAChB;AACF;AAGA,yBAAyB,cACvB,iCAAiC,WACjC,gCACF"}
|
package/lib/src/vcsUiApp.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import Notifier from './notifier/notifier.js';
|
|
|
22
22
|
import AbstractFeatureInfoView, { type FeatureInfoViewOptions } from './featureInfo/abstractFeatureInfoView.js';
|
|
23
23
|
import type VcsCallback from './callback/vcsCallback.js';
|
|
24
24
|
import { type Attributions } from './application/attributionsHelper.js';
|
|
25
|
-
type VcsUiModuleConfig = VcsModuleConfig & {
|
|
25
|
+
export type VcsUiModuleConfig = VcsModuleConfig & {
|
|
26
26
|
plugins?: SerializedPluginConfig[];
|
|
27
27
|
contentTree?: ContentTreeItemOptions[];
|
|
28
28
|
uiConfig?: UiConfigurationItem<unknown>[];
|
package/lib/src/vcsUiApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vcsUiApp.js","names":["getLogger","getLoggerByName","packageJson"],"sources":["../../src/vcsUiApp.ts"],"sourcesContent":["import type { Component, Reactive } from 'vue';\nimport {\n Collection,\n ObliqueMap,\n OverrideClassRegistry,\n type OverrideCollection,\n VcsApp,\n VcsEvent,\n type VcsModule,\n type VcsModuleConfig,\n type VcsObject,\n Viewpoint,\n WMSLayer,\n defaultDynamicModuleId,\n destroyCollection,\n getCaughtError,\n getObjectFromClassRegistry,\n makeOverrideCollection,\n moduleIdSymbol,\n volatileModuleId,\n} from '@vcmap/core';\nimport { type Logger, getLogger as getLoggerByName } from '@vcsuite/logger';\nimport type { Composer, I18n } from 'vue-i18n';\nimport type { createVuetify } from 'vuetify';\nimport {\n deserializePlugin,\n type pluginBaseUrlSymbol,\n type pluginFactorySymbol,\n type pluginModuleUrlSymbol,\n type pluginVersionRangeSymbol,\n serializePlugin,\n type vcsAppSymbol,\n} from './pluginHelper.js';\nimport ToolboxManager, {\n setupDefaultGroups,\n} from './manager/toolbox/toolboxManager.js';\nimport WindowManager from './manager/window/windowManager.js';\nimport PanelManager from './manager/panel/panelManager.js';\nimport NavbarManager from './manager/navbarManager.js';\nimport { createContentTreeCollection } from './contentTree/contentTreeCollection.js';\nimport type ContentTreeCollection from './contentTree/contentTreeCollection.js';\nimport type ContentTreeItem from './contentTree/contentTreeItem.js';\nimport {\n contentTreeClassRegistry,\n type ContentTreeItemOptions,\n} from './contentTree/contentTreeItem.js';\nimport OverviewMap from './navigation/overviewMap.js';\nimport I18nCollection, {\n type I18nConfigurationItem,\n} from './i18n/i18nCollection.js';\nimport CategoryManager from './manager/collectionManager/categoryManager.js';\nimport ContextMenuManager from './manager/contextMenu/contextMenuManager.js';\nimport FeatureInfo, {\n featureInfoClassRegistry,\n} from './featureInfo/featureInfo.js';\nimport UiConfig, { type UiConfigurationItem } from './uiConfig.js';\nimport {\n type AppState,\n type CachedAppState,\n type ClippingPolygonState,\n type LayerState,\n type PluginState,\n createEmptyState,\n getStateFromURL,\n parseWMSStyle,\n writeWMSStyleForLayer,\n} from './state.js';\nimport packageJson from '../package.json' with { type: 'json' };\nimport Search from './search/search.js';\nimport Notifier from './notifier/notifier.js';\nimport AbstractFeatureInfoView, {\n type FeatureInfoViewOptions,\n} from './featureInfo/abstractFeatureInfoView.js';\nimport { createVueI18n, setupI18n } from './vuePlugins/i18n.js';\nimport type VcsCallback from './callback/vcsCallback.js';\nimport { callbackClassRegistry } from './callback/vcsCallback.js';\nimport createSiteConfig from './siteConfig.js';\nimport { createVcsVuetify } from './vuePlugins/vuetify.js';\nimport createObliqueFallbackWarnings from './obliqueFallbackWarnings.js';\nimport {\n type Attributions,\n getAttributions,\n} from './application/attributionsHelper.js';\n\ntype VcsUiModuleConfig = VcsModuleConfig & {\n plugins?: SerializedPluginConfig[];\n contentTree?: ContentTreeItemOptions[];\n uiConfig?: UiConfigurationItem<unknown>[];\n featureInfo?: FeatureInfoViewOptions[];\n i18n?: I18nConfigurationItem[];\n};\n\nexport type PluginConfig = {\n name: string;\n /** path to the plugin's entry file */\n entry?: string;\n /** version or version range */\n version?: string;\n mapVersion?: string;\n};\n\nexport type SerializedPluginConfig = PluginConfig &\n Record<string | symbol, unknown>;\n\nexport type PluginConfigEditorComponent<C extends object = PluginConfig> =\n Component<{\n getConfig(): C;\n setConfig(config?: C): void;\n }>;\n\nexport type PluginConfigEditor<C extends object = PluginConfig> = {\n /** an editor component for the plugin or item */\n component: PluginConfigEditorComponent<C>;\n /** optional title to render in the window header & actions of this editor */\n title?: string;\n /** the collection the item belongs to. Default is plugins collection. */\n collectionName?: string;\n /** the item the editor can be used for. Can be a name or className. Default is the plugin's name. */\n itemName?: string;\n /** An optional function returning an url referencing help or further information regarding the config editor. */\n infoUrlCallback?: () => string;\n};\n\nexport type VcsPlugin<\n C extends Record<string, unknown> = Record<string, unknown>,\n S extends Record<string, unknown> = Record<string, unknown>,\n> = {\n name: string;\n version: string;\n mapVersion: string;\n i18n?: Record<string, unknown>;\n /** called on plugin added, is passed the VcsUiApp and optionally, the state for the plugin */\n initialize?: (app: VcsUiApp, state?: S) => void | Promise<void>;\n /** called on mounted of VcsApp.ts.vue */\n onVcsAppMounted?: (app: VcsUiApp) => void;\n /** should return the plugin's serialization excluding all default values */\n toJSON?: () => C;\n /** should return the plugin's default options */\n getDefaultOptions?: () => C;\n /** should return the plugin's state or a promise for said state. is passed a \"for url\" flag. If true, only the state relevant for sharing a URL should be passed and short keys shall be used */\n getState?: (forUrl?: boolean) => S | Promise<S>;\n /** should return components for configuring the plugin or custom items defined by the plugin */\n getConfigEditors?: () => PluginConfigEditor<C>[];\n destroy?: () => void;\n [pluginFactorySymbol]?: (\n config: SerializedPluginConfig,\n ) => Promise<VcsPlugin>;\n [pluginBaseUrlSymbol]?: string;\n [pluginModuleUrlSymbol]?: string;\n [pluginVersionRangeSymbol]?: string;\n [moduleIdSymbol]?: string;\n};\n\nexport type VcsComponentManager<\n T extends object | VcsObject,\n O extends object,\n> = {\n added: VcsEvent<T>;\n removed: VcsEvent<T>;\n /** all registered component ids as a reactive array */\n componentIds: Reactive<Array<string>>;\n get: (id: string) => T | undefined;\n has: (id: string) => boolean;\n remove: (id: string) => void;\n add: (options: O, owner: string | typeof vcsAppSymbol) => T;\n /** remove all components of the owner */\n removeOwner: (owner: string | typeof vcsAppSymbol) => void;\n /** remove all registered components */\n clear: () => void;\n destroy: () => void;\n};\n\nfunction getLogger(): Logger {\n return getLoggerByName('VcsUiApp');\n}\n\nclass VcsUiApp extends VcsApp {\n /**\n * Gets the version of the @vcmap/ui npm package\n */\n static getVersion(): string {\n return packageJson.version;\n }\n\n /**\n * An event triggered when the vuetify theme mode changes or the primary color is updated by a new uiConfig entry.\n */\n themeChanged = new VcsEvent<void>();\n\n private _plugins: OverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n > = makeOverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n >(\n new Collection<VcsPlugin>(),\n () => this.dynamicModuleId,\n serializePlugin,\n // deserializePlugin resolves to null on failure, which the makeOverrideCollection callers already handle at runtime\n deserializePlugin as (\n item: SerializedPluginConfig,\n ) => Promise<VcsPlugin> | null,\n );\n /**\n * I18n Collection adds plugin listener first, so the plugin i18n data is available on plugin initialize\n * @type {I18nCollection<Object>}\n */\n private _i18n: OverrideCollection<\n I18nConfigurationItem,\n I18nCollection,\n I18nConfigurationItem\n > = makeOverrideCollection(\n new I18nCollection(this._plugins),\n () => this.dynamicModuleId,\n );\n\n private _pluginListeners: Array<() => void> = [];\n\n private _vueI18nPlugin: I18n = createVueI18n();\n\n private _vuetify: ReturnType<typeof createVcsVuetify> = createVcsVuetify(\n this._vueI18nPlugin,\n );\n\n private _vueI18n: Composer = this._vueI18nPlugin.global as Composer;\n\n private _vueI18nDestroy: () => void = setupI18n(this);\n\n private _callbackClassRegistry = new OverrideClassRegistry<\n typeof VcsCallback\n >(callbackClassRegistry);\n\n private _contentTreeClassRegistry = new OverrideClassRegistry<\n typeof ContentTreeItem\n >(contentTreeClassRegistry);\n private _uiConfig: UiConfig &\n OverrideCollection<UiConfigurationItem<unknown>, UiConfig> = new UiConfig(\n () => this.dynamicModuleId,\n ) as UiConfig & OverrideCollection<UiConfigurationItem<unknown>, UiConfig>;\n\n private _contentTree = createContentTreeCollection(this);\n\n private _toolboxManager = new ToolboxManager();\n\n private _windowManager = new WindowManager();\n\n private _panelManager = new PanelManager();\n\n private _navbarManager = new NavbarManager();\n\n private _search = new Search(this);\n\n private _featureInfoClassRegistry = new OverrideClassRegistry<\n typeof AbstractFeatureInfoView\n >(featureInfoClassRegistry);\n\n private _featureInfo = makeOverrideCollection<\n AbstractFeatureInfoView,\n FeatureInfo,\n FeatureInfoViewOptions\n >(\n new FeatureInfo(this),\n () => this.dynamicModuleId,\n undefined,\n (config) =>\n getObjectFromClassRegistry(this._featureInfoClassRegistry, config),\n AbstractFeatureInfoView,\n );\n\n private _overviewMap = new OverviewMap(this);\n\n private _attributions: Attributions = getAttributions(this);\n\n private _categoryManager = new CategoryManager(this);\n\n private _contextMenuManager = new ContextMenuManager(this);\n\n private _notifier = new Notifier();\n\n private _cachedAppState: CachedAppState = getStateFromURL(\n new URL(window.location.href),\n );\n\n /**\n * An event triggered when the VcsApp was mounted and a target was set for the maps.\n * Provides the id of the target html element.\n * */\n mounted = new VcsEvent<string>();\n\n private _destroySiteConfig: () => void = createSiteConfig(this._uiConfig);\n\n private _destroyObliqueFallback: () => void =\n createObliqueFallbackWarnings(this);\n\n constructor() {\n super();\n\n this._pluginListeners = [\n this._plugins.added.addEventListener((plugin) => {\n this._windowManager.removeOwner(plugin.name);\n this._panelManager.removeOwner(plugin.name);\n this._navbarManager.removeOwner(plugin.name);\n this._toolboxManager.removeOwner(plugin.name);\n this._categoryManager.removeOwner(plugin.name);\n this._contextMenuManager.removeOwner(plugin.name);\n this._search.removeOwner(plugin.name);\n this._attributions.removeOwner(plugin.name);\n // i18n messages of the plugin are added by the i18n collection\n if (plugin.initialize) {\n let state: PluginState<unknown> | undefined;\n if (\n plugin[moduleIdSymbol] &&\n this._cachedAppState.moduleIds.includes(plugin[moduleIdSymbol])\n ) {\n state = this._cachedAppState.plugins.find(\n (s: PluginState<unknown>) => s.name === plugin.name,\n );\n }\n\n const logError = (e: unknown): void => {\n getLogger().error(\n `Error in plugin ${plugin.name} initialize hook`,\n e,\n );\n };\n\n try {\n const optPromise = plugin.initialize(\n this,\n state?.state as Record<string, unknown> | undefined,\n );\n if (optPromise instanceof Promise) {\n optPromise.catch(logError);\n }\n } catch (e) {\n logError(e);\n }\n }\n }),\n this._plugins.removed.addEventListener((plugin) => {\n this._windowManager.removeOwner(plugin.name);\n this._panelManager.removeOwner(plugin.name);\n this._navbarManager.removeOwner(plugin.name);\n this._toolboxManager.removeOwner(plugin.name);\n this._categoryManager.removeOwner(plugin.name);\n this._contextMenuManager.removeOwner(plugin.name);\n this._search.removeOwner(plugin.name);\n this._attributions.removeOwner(plugin.name);\n // i18n messages of the plugin are removed by the i18n collection\n }),\n ];\n\n setupDefaultGroups(this._toolboxManager);\n }\n\n get plugins(): OverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n > {\n return this._plugins;\n }\n get contentTree(): ContentTreeCollection {\n return this._contentTree;\n }\n get callbackClassRegistry(): OverrideClassRegistry<typeof VcsCallback> {\n return this._callbackClassRegistry;\n }\n get contentTreeClassRegistry(): OverrideClassRegistry<\n typeof ContentTreeItem\n > {\n return this._contentTreeClassRegistry;\n }\n get featureInfoClassRegistry(): OverrideClassRegistry<\n typeof AbstractFeatureInfoView\n > {\n return this._featureInfoClassRegistry;\n }\n get toolboxManager(): ToolboxManager {\n return this._toolboxManager;\n }\n get windowManager(): WindowManager {\n return this._windowManager;\n }\n get panelManager(): PanelManager {\n return this._panelManager;\n }\n get navbarManager(): NavbarManager {\n return this._navbarManager;\n }\n get featureInfo(): FeatureInfo {\n return this._featureInfo;\n }\n get overviewMap(): OverviewMap {\n return this._overviewMap;\n }\n get attributions(): Attributions {\n return this._attributions;\n }\n get i18n(): I18nCollection {\n return this._i18n;\n }\n get vueI18nPlugin(): I18n {\n return this._vueI18nPlugin;\n }\n get vuetify(): ReturnType<typeof createVuetify> {\n return this._vuetify;\n }\n get vueI18n(): Composer {\n return this._vueI18n;\n }\n get categoryManager(): CategoryManager {\n return this._categoryManager;\n }\n get contextMenuManager(): ContextMenuManager {\n return this._contextMenuManager;\n }\n get search(): Search {\n return this._search;\n }\n get uiConfig(): UiConfig &\n OverrideCollection<UiConfigurationItem<unknown>, UiConfig> {\n return this._uiConfig;\n }\n get notifier(): Notifier {\n return this._notifier;\n }\n\n /**\n * Returns a callback function providing a URL to help page.\n * The default helpBaseUrl can be changed by adding an 'helpBaseUrl' item to the UiConfig Collection.\n * The callback derives the url from the VC Map mayor and minor version, the current app locale and a provided path pointing to a specific help section.\n * This function can be used for the WindowState infoUrlCallback property.\n * @param path the path to a help section\n * @param subpage path to a subpage. Default is 'vc-map'.\n * @param subpageVersion - default version is the mapVersion, can be provided to use a plugin specific version\n */\n getHelpUrlCallback(\n path = '',\n subpage = 'vc-map',\n subpageVersion = VcsUiApp.getVersion(),\n ): () => string {\n const mayorMinorVersion = /\\d+\\.\\d+/.exec(subpageVersion)?.[0];\n return () => {\n const base =\n this.uiConfig.config.helpBaseUrl || 'https://help.vc.systems/';\n const url = `${\n this.locale\n }/${subpage}/v${mayorMinorVersion}/${path.replace(/^\\//, '')}`;\n const { href } = new URL(url, base);\n return href;\n };\n }\n\n /**\n * 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\n * the maximum URL length is not exceeded). This includes: layer active state & styling, active map, active viewpoint,\n * currently selected feature info & any state deemed required for a sharable URL by the currently loaded plugins.\n */\n async getState(forUrl?: boolean): Promise<AppState> {\n const state = createEmptyState();\n const { activeMap } = this.maps;\n if (!activeMap) {\n return state;\n }\n\n const nonDynamicModules = this.modules.filter(\n ({ _id }) => _id !== defaultDynamicModuleId,\n );\n\n if (nonDynamicModules.some((m) => !m.config._id)) {\n getLogger().warning(\n 'Some modules you are creating are missing a stable _id property. This may lead to issues while restoring application state.',\n );\n }\n\n state.moduleIds = nonDynamicModules.map(({ _id }) => _id);\n\n state.activeMap = activeMap.name;\n const viewpoint = await activeMap.getViewpoint();\n state.activeViewpoint = viewpoint?.isValid?.()\n ? viewpoint.toJSON()\n : undefined;\n state.layers = [...this.layers]\n .filter((l) => {\n const layerWithStyle = l as typeof l & {\n style?: { name: string; [moduleIdSymbol]?: string };\n defaultStyle?: { name: string };\n };\n\n return (\n l.isSupported(activeMap) &&\n l[moduleIdSymbol] !== defaultDynamicModuleId &&\n l[moduleIdSymbol] !== volatileModuleId &&\n (((l.active || l.loading) && !l.activeOnStartup) ||\n (!l.active && l.activeOnStartup) ||\n ((l.active || l.loading) &&\n layerWithStyle.style !== layerWithStyle.defaultStyle &&\n this.styles.has(layerWithStyle.style as never)))\n );\n })\n .map((l) => {\n const layerWithStyle = l as typeof l & {\n style?: { name: string; [moduleIdSymbol]?: string };\n defaultStyle?: { name: string };\n };\n\n const layerState: LayerState = {\n name: l.name,\n active: l.active || l.loading,\n };\n if (\n layerWithStyle.style &&\n layerWithStyle.defaultStyle &&\n layerWithStyle.style.name !== layerWithStyle.defaultStyle.name &&\n this.styles.has(layerWithStyle.style as never) &&\n layerWithStyle.style[moduleIdSymbol] !== defaultDynamicModuleId &&\n layerWithStyle.style[moduleIdSymbol] !== volatileModuleId\n ) {\n layerState.styleName = layerWithStyle.style.name;\n } else if (l instanceof WMSLayer) {\n const module = this.getModuleById(l[moduleIdSymbol]!);\n const styleName = writeWMSStyleForLayer(l, module?.config);\n if (styleName) {\n layerState.styleName = styleName;\n }\n }\n return layerState;\n });\n\n state.clippingPolygons = [...this.clippingPolygons]\n .filter(\n (p) =>\n p[moduleIdSymbol] !== defaultDynamicModuleId &&\n p[moduleIdSymbol] !== volatileModuleId &&\n ((p.active && !p.activeOnStartup) ||\n (!p.active && p.activeOnStartup)),\n )\n .map((p) => ({ name: p.name, active: p.active }));\n\n const plugins: Array<PluginState<unknown> | null> = await Promise.all(\n [...this.plugins]\n .filter(\n (p) =>\n p[moduleIdSymbol] !== defaultDynamicModuleId &&\n p[moduleIdSymbol] !== volatileModuleId &&\n typeof p.getState === 'function',\n )\n .map(async (p): Promise<PluginState<unknown> | null> => {\n try {\n if (!p.getState) {\n return null;\n }\n\n const pluginState = await p.getState(forUrl);\n if (pluginState && Object.keys(pluginState).length > 0) {\n return { name: p.name, state: pluginState };\n }\n return null;\n } catch (e: unknown) {\n getLogger().error(getCaughtError(e).message);\n return null;\n }\n }),\n );\n\n state.plugins = plugins.filter(\n (p): p is PluginState<unknown> => p !== null,\n );\n\n if (activeMap instanceof ObliqueMap && activeMap.collection) {\n state.activeObliqueCollection = activeMap.collection.name;\n }\n return state;\n }\n\n protected async _parseModule(module: VcsModule): Promise<void> {\n const config = module.config as VcsUiModuleConfig;\n if (!config._id) {\n getLogger().warning(\n 'A module is missing a stable _id property. This may lead to issues while restoring application state.',\n );\n }\n if (Array.isArray(config.plugins)) {\n await this._plugins.parseItems(config.plugins, module._id);\n }\n if (Array.isArray(config.i18n)) {\n await this._i18n.parseItems(config.i18n, module._id);\n }\n await super._parseModule(module);\n await this._contentTree.parseItems(config.contentTree, module._id);\n await this._uiConfig.parseItems(config.uiConfig, module._id);\n await this._featureInfo.parseItems(config.featureInfo, module._id);\n }\n\n protected async _setModuleState(module: VcsModule): Promise<void> {\n await super._setModuleState(module);\n if (this._cachedAppState.moduleIds.includes(module._id)) {\n this._cachedAppState.layers.forEach((layerState: LayerState) => {\n const layer = this.layers.getByKey(layerState.name);\n if (layer) {\n const layerWithStyle = layer as typeof layer & {\n setStyle?: (style: unknown) => void;\n };\n if (layerState.active) {\n layer.activate().catch((e: unknown) => {\n getLogger().warning(\n 'Failed to activate cached app state. layer failed: ',\n layer.name,\n e,\n );\n });\n } else {\n layer.deactivate();\n }\n\n if (layerState.styleName) {\n if (\n this.styles.hasKey(layerState.styleName) &&\n layerWithStyle.setStyle\n ) {\n layerWithStyle.setStyle(\n this.styles.getByKey(layerState.styleName),\n );\n } else if (layer instanceof WMSLayer) {\n const { layers, styles } = parseWMSStyle(layerState.styleName);\n if (styles) {\n layer.parameters.STYLES = styles;\n }\n layer\n .setLayers(layers || layer.getLayers())\n .catch((err: unknown) => {\n getLogger().warning(\n `Failed to set WMS layers ${layers} on layer ${layer.name}`,\n err,\n );\n });\n }\n }\n }\n });\n if (\n this._cachedAppState.activeMap &&\n this.maps.hasKey(this._cachedAppState.activeMap)\n ) {\n await this.maps.setActiveMap(this._cachedAppState.activeMap);\n }\n if (\n this._cachedAppState.activeObliqueCollection &&\n this.maps.activeMap instanceof ObliqueMap &&\n this.obliqueCollections.hasKey(\n this._cachedAppState.activeObliqueCollection,\n )\n ) {\n const obliqueCollection = this.obliqueCollections.getByKey(\n this._cachedAppState.activeObliqueCollection,\n );\n await this.maps.activeMap.setCollection(\n obliqueCollection as NonNullable<typeof obliqueCollection>,\n );\n }\n const viewpointOptions =\n this._cachedAppState.activeViewpoint ??\n this._cachedAppState.getViewpoint?.(module._id);\n if (viewpointOptions) {\n await this.maps.activeMap?.gotoViewpoint(\n new Viewpoint(viewpointOptions),\n );\n }\n this._cachedAppState.clippingPolygons.forEach(\n (cpState: ClippingPolygonState) => {\n const clippingPolygon = this.clippingPolygons.getByKey(cpState.name);\n if (clippingPolygon) {\n if (cpState.active) {\n clippingPolygon.activate();\n } else {\n clippingPolygon.deactivate();\n }\n }\n },\n );\n this._cachedAppState.moduleIds.splice(\n this._cachedAppState.moduleIds.indexOf(module._id),\n 1,\n );\n }\n }\n\n serializeModule(moduleId: string): VcsUiModuleConfig {\n const config = super.serializeModule(moduleId) as VcsUiModuleConfig;\n config.uiConfig = this._uiConfig.serializeModule(moduleId);\n config.featureInfo = this._featureInfo.serializeModule(moduleId);\n config.i18n = this._i18n.serializeModule(moduleId);\n config.contentTree = this._contentTree.serializeModule(moduleId);\n config.plugins = this._plugins.serializeModule(moduleId);\n return config;\n }\n\n protected async _removeModule(moduleId: string): Promise<void> {\n await super._removeModule(moduleId);\n this._plugins.removeModule(moduleId);\n this._i18n.removeModule(moduleId);\n this._contentTree.removeModule(moduleId);\n this._featureInfo.removeModule(moduleId);\n this._uiConfig.removeModule(moduleId);\n }\n\n /**\n * Destroys the vcsUiApp and all its collections, their content and ui managers.\n */\n destroy(): void {\n this.windowManager.destroy();\n this.panelManager.destroy();\n this.navbarManager.destroy();\n this.toolboxManager.destroy();\n this.categoryManager.destroy();\n this.contextMenuManager.destroy();\n this._attributions.destroy();\n this._overviewMap.destroy();\n this._pluginListeners.forEach((cb: () => void) => {\n cb();\n });\n this._pluginListeners = [];\n destroyCollection(this._plugins);\n destroyCollection(this._contentTree);\n this._i18n.destroy();\n destroyCollection(this._search);\n this._vueI18nDestroy();\n this._contentTreeClassRegistry.destroy();\n this._featureInfoClassRegistry.destroy();\n this._featureInfo.destroy();\n this._uiConfig.destroy();\n this._destroySiteConfig();\n this._destroyObliqueFallback();\n super.destroy();\n }\n}\n\nexport default VcsUiApp;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4KA,SAASA,cAAoB;CAC3B,OAAOC,UAAgB,UAAU;AACnC;AAEA,IAAM,WAAN,MAAM,iBAAiB,OAAO;;;;CAI5B,OAAO,aA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AAO;EAC9B,KAAK,gBAAgB;EACrB,KAAK,0BAA0B,QAAQ;EACvC,KAAK,0BAA0B,QAAQ;EACvC,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,QAAQ;EACvB,KAAK,mBAAmB;EACxB,KAAK,wBAAwB;EAC7B,MAAM,QAAQ;CAChB;AACF"}
|
|
1
|
+
{"version":3,"file":"vcsUiApp.js","names":["getLogger","getLoggerByName","packageJson"],"sources":["../../src/vcsUiApp.ts"],"sourcesContent":["import type { Component, Reactive } from 'vue';\nimport {\n Collection,\n ObliqueMap,\n OverrideClassRegistry,\n type OverrideCollection,\n VcsApp,\n VcsEvent,\n type VcsModule,\n type VcsModuleConfig,\n type VcsObject,\n Viewpoint,\n WMSLayer,\n defaultDynamicModuleId,\n destroyCollection,\n getCaughtError,\n getObjectFromClassRegistry,\n makeOverrideCollection,\n moduleIdSymbol,\n volatileModuleId,\n} from '@vcmap/core';\nimport { type Logger, getLogger as getLoggerByName } from '@vcsuite/logger';\nimport type { Composer, I18n } from 'vue-i18n';\nimport type { createVuetify } from 'vuetify';\nimport {\n deserializePlugin,\n type pluginBaseUrlSymbol,\n type pluginFactorySymbol,\n type pluginModuleUrlSymbol,\n type pluginVersionRangeSymbol,\n serializePlugin,\n type vcsAppSymbol,\n} from './pluginHelper.js';\nimport ToolboxManager, {\n setupDefaultGroups,\n} from './manager/toolbox/toolboxManager.js';\nimport WindowManager from './manager/window/windowManager.js';\nimport PanelManager from './manager/panel/panelManager.js';\nimport NavbarManager from './manager/navbarManager.js';\nimport { createContentTreeCollection } from './contentTree/contentTreeCollection.js';\nimport type ContentTreeCollection from './contentTree/contentTreeCollection.js';\nimport type ContentTreeItem from './contentTree/contentTreeItem.js';\nimport {\n contentTreeClassRegistry,\n type ContentTreeItemOptions,\n} from './contentTree/contentTreeItem.js';\nimport OverviewMap from './navigation/overviewMap.js';\nimport I18nCollection, {\n type I18nConfigurationItem,\n} from './i18n/i18nCollection.js';\nimport CategoryManager from './manager/collectionManager/categoryManager.js';\nimport ContextMenuManager from './manager/contextMenu/contextMenuManager.js';\nimport FeatureInfo, {\n featureInfoClassRegistry,\n} from './featureInfo/featureInfo.js';\nimport UiConfig, { type UiConfigurationItem } from './uiConfig.js';\nimport {\n type AppState,\n type CachedAppState,\n type ClippingPolygonState,\n type LayerState,\n type PluginState,\n createEmptyState,\n getStateFromURL,\n parseWMSStyle,\n writeWMSStyleForLayer,\n} from './state.js';\nimport packageJson from '../package.json' with { type: 'json' };\nimport Search from './search/search.js';\nimport Notifier from './notifier/notifier.js';\nimport AbstractFeatureInfoView, {\n type FeatureInfoViewOptions,\n} from './featureInfo/abstractFeatureInfoView.js';\nimport { createVueI18n, setupI18n } from './vuePlugins/i18n.js';\nimport type VcsCallback from './callback/vcsCallback.js';\nimport { callbackClassRegistry } from './callback/vcsCallback.js';\nimport createSiteConfig from './siteConfig.js';\nimport { createVcsVuetify } from './vuePlugins/vuetify.js';\nimport createObliqueFallbackWarnings from './obliqueFallbackWarnings.js';\nimport {\n type Attributions,\n getAttributions,\n} from './application/attributionsHelper.js';\n\nexport type VcsUiModuleConfig = VcsModuleConfig & {\n plugins?: SerializedPluginConfig[];\n contentTree?: ContentTreeItemOptions[];\n uiConfig?: UiConfigurationItem<unknown>[];\n featureInfo?: FeatureInfoViewOptions[];\n i18n?: I18nConfigurationItem[];\n};\n\nexport type PluginConfig = {\n name: string;\n /** path to the plugin's entry file */\n entry?: string;\n /** version or version range */\n version?: string;\n mapVersion?: string;\n};\n\nexport type SerializedPluginConfig = PluginConfig &\n Record<string | symbol, unknown>;\n\nexport type PluginConfigEditorComponent<C extends object = PluginConfig> =\n Component<{\n getConfig(): C;\n setConfig(config?: C): void;\n }>;\n\nexport type PluginConfigEditor<C extends object = PluginConfig> = {\n /** an editor component for the plugin or item */\n component: PluginConfigEditorComponent<C>;\n /** optional title to render in the window header & actions of this editor */\n title?: string;\n /** the collection the item belongs to. Default is plugins collection. */\n collectionName?: string;\n /** the item the editor can be used for. Can be a name or className. Default is the plugin's name. */\n itemName?: string;\n /** An optional function returning an url referencing help or further information regarding the config editor. */\n infoUrlCallback?: () => string;\n};\n\nexport type VcsPlugin<\n C extends Record<string, unknown> = Record<string, unknown>,\n S extends Record<string, unknown> = Record<string, unknown>,\n> = {\n name: string;\n version: string;\n mapVersion: string;\n i18n?: Record<string, unknown>;\n /** called on plugin added, is passed the VcsUiApp and optionally, the state for the plugin */\n initialize?: (app: VcsUiApp, state?: S) => void | Promise<void>;\n /** called on mounted of VcsApp.ts.vue */\n onVcsAppMounted?: (app: VcsUiApp) => void;\n /** should return the plugin's serialization excluding all default values */\n toJSON?: () => C;\n /** should return the plugin's default options */\n getDefaultOptions?: () => C;\n /** should return the plugin's state or a promise for said state. is passed a \"for url\" flag. If true, only the state relevant for sharing a URL should be passed and short keys shall be used */\n getState?: (forUrl?: boolean) => S | Promise<S>;\n /** should return components for configuring the plugin or custom items defined by the plugin */\n getConfigEditors?: () => PluginConfigEditor<C>[];\n destroy?: () => void;\n [pluginFactorySymbol]?: (\n config: SerializedPluginConfig,\n ) => Promise<VcsPlugin>;\n [pluginBaseUrlSymbol]?: string;\n [pluginModuleUrlSymbol]?: string;\n [pluginVersionRangeSymbol]?: string;\n [moduleIdSymbol]?: string;\n};\n\nexport type VcsComponentManager<\n T extends object | VcsObject,\n O extends object,\n> = {\n added: VcsEvent<T>;\n removed: VcsEvent<T>;\n /** all registered component ids as a reactive array */\n componentIds: Reactive<Array<string>>;\n get: (id: string) => T | undefined;\n has: (id: string) => boolean;\n remove: (id: string) => void;\n add: (options: O, owner: string | typeof vcsAppSymbol) => T;\n /** remove all components of the owner */\n removeOwner: (owner: string | typeof vcsAppSymbol) => void;\n /** remove all registered components */\n clear: () => void;\n destroy: () => void;\n};\n\nfunction getLogger(): Logger {\n return getLoggerByName('VcsUiApp');\n}\n\nclass VcsUiApp extends VcsApp {\n /**\n * Gets the version of the @vcmap/ui npm package\n */\n static getVersion(): string {\n return packageJson.version;\n }\n\n /**\n * An event triggered when the vuetify theme mode changes or the primary color is updated by a new uiConfig entry.\n */\n themeChanged = new VcsEvent<void>();\n\n private _plugins: OverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n > = makeOverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n >(\n new Collection<VcsPlugin>(),\n () => this.dynamicModuleId,\n serializePlugin,\n // deserializePlugin resolves to null on failure, which the makeOverrideCollection callers already handle at runtime\n deserializePlugin as (\n item: SerializedPluginConfig,\n ) => Promise<VcsPlugin> | null,\n );\n /**\n * I18n Collection adds plugin listener first, so the plugin i18n data is available on plugin initialize\n * @type {I18nCollection<Object>}\n */\n private _i18n: OverrideCollection<\n I18nConfigurationItem,\n I18nCollection,\n I18nConfigurationItem\n > = makeOverrideCollection(\n new I18nCollection(this._plugins),\n () => this.dynamicModuleId,\n );\n\n private _pluginListeners: Array<() => void> = [];\n\n private _vueI18nPlugin: I18n = createVueI18n();\n\n private _vuetify: ReturnType<typeof createVcsVuetify> = createVcsVuetify(\n this._vueI18nPlugin,\n );\n\n private _vueI18n: Composer = this._vueI18nPlugin.global as Composer;\n\n private _vueI18nDestroy: () => void = setupI18n(this);\n\n private _callbackClassRegistry = new OverrideClassRegistry<\n typeof VcsCallback\n >(callbackClassRegistry);\n\n private _contentTreeClassRegistry = new OverrideClassRegistry<\n typeof ContentTreeItem\n >(contentTreeClassRegistry);\n private _uiConfig: UiConfig &\n OverrideCollection<UiConfigurationItem<unknown>, UiConfig> = new UiConfig(\n () => this.dynamicModuleId,\n ) as UiConfig & OverrideCollection<UiConfigurationItem<unknown>, UiConfig>;\n\n private _contentTree = createContentTreeCollection(this);\n\n private _toolboxManager = new ToolboxManager();\n\n private _windowManager = new WindowManager();\n\n private _panelManager = new PanelManager();\n\n private _navbarManager = new NavbarManager();\n\n private _search = new Search(this);\n\n private _featureInfoClassRegistry = new OverrideClassRegistry<\n typeof AbstractFeatureInfoView\n >(featureInfoClassRegistry);\n\n private _featureInfo = makeOverrideCollection<\n AbstractFeatureInfoView,\n FeatureInfo,\n FeatureInfoViewOptions\n >(\n new FeatureInfo(this),\n () => this.dynamicModuleId,\n undefined,\n (config) =>\n getObjectFromClassRegistry(this._featureInfoClassRegistry, config),\n AbstractFeatureInfoView,\n );\n\n private _overviewMap = new OverviewMap(this);\n\n private _attributions: Attributions = getAttributions(this);\n\n private _categoryManager = new CategoryManager(this);\n\n private _contextMenuManager = new ContextMenuManager(this);\n\n private _notifier = new Notifier();\n\n private _cachedAppState: CachedAppState = getStateFromURL(\n new URL(window.location.href),\n );\n\n /**\n * An event triggered when the VcsApp was mounted and a target was set for the maps.\n * Provides the id of the target html element.\n * */\n mounted = new VcsEvent<string>();\n\n private _destroySiteConfig: () => void = createSiteConfig(this._uiConfig);\n\n private _destroyObliqueFallback: () => void =\n createObliqueFallbackWarnings(this);\n\n constructor() {\n super();\n\n this._pluginListeners = [\n this._plugins.added.addEventListener((plugin) => {\n this._windowManager.removeOwner(plugin.name);\n this._panelManager.removeOwner(plugin.name);\n this._navbarManager.removeOwner(plugin.name);\n this._toolboxManager.removeOwner(plugin.name);\n this._categoryManager.removeOwner(plugin.name);\n this._contextMenuManager.removeOwner(plugin.name);\n this._search.removeOwner(plugin.name);\n this._attributions.removeOwner(plugin.name);\n // i18n messages of the plugin are added by the i18n collection\n if (plugin.initialize) {\n let state: PluginState<unknown> | undefined;\n if (\n plugin[moduleIdSymbol] &&\n this._cachedAppState.moduleIds.includes(plugin[moduleIdSymbol])\n ) {\n state = this._cachedAppState.plugins.find(\n (s: PluginState<unknown>) => s.name === plugin.name,\n );\n }\n\n const logError = (e: unknown): void => {\n getLogger().error(\n `Error in plugin ${plugin.name} initialize hook`,\n e,\n );\n };\n\n try {\n const optPromise = plugin.initialize(\n this,\n state?.state as Record<string, unknown> | undefined,\n );\n if (optPromise instanceof Promise) {\n optPromise.catch(logError);\n }\n } catch (e) {\n logError(e);\n }\n }\n }),\n this._plugins.removed.addEventListener((plugin) => {\n this._windowManager.removeOwner(plugin.name);\n this._panelManager.removeOwner(plugin.name);\n this._navbarManager.removeOwner(plugin.name);\n this._toolboxManager.removeOwner(plugin.name);\n this._categoryManager.removeOwner(plugin.name);\n this._contextMenuManager.removeOwner(plugin.name);\n this._search.removeOwner(plugin.name);\n this._attributions.removeOwner(plugin.name);\n // i18n messages of the plugin are removed by the i18n collection\n }),\n ];\n\n setupDefaultGroups(this._toolboxManager);\n }\n\n get plugins(): OverrideCollection<\n VcsPlugin,\n Collection<VcsPlugin>,\n SerializedPluginConfig\n > {\n return this._plugins;\n }\n get contentTree(): ContentTreeCollection {\n return this._contentTree;\n }\n get callbackClassRegistry(): OverrideClassRegistry<typeof VcsCallback> {\n return this._callbackClassRegistry;\n }\n get contentTreeClassRegistry(): OverrideClassRegistry<\n typeof ContentTreeItem\n > {\n return this._contentTreeClassRegistry;\n }\n get featureInfoClassRegistry(): OverrideClassRegistry<\n typeof AbstractFeatureInfoView\n > {\n return this._featureInfoClassRegistry;\n }\n get toolboxManager(): ToolboxManager {\n return this._toolboxManager;\n }\n get windowManager(): WindowManager {\n return this._windowManager;\n }\n get panelManager(): PanelManager {\n return this._panelManager;\n }\n get navbarManager(): NavbarManager {\n return this._navbarManager;\n }\n get featureInfo(): FeatureInfo {\n return this._featureInfo;\n }\n get overviewMap(): OverviewMap {\n return this._overviewMap;\n }\n get attributions(): Attributions {\n return this._attributions;\n }\n get i18n(): I18nCollection {\n return this._i18n;\n }\n get vueI18nPlugin(): I18n {\n return this._vueI18nPlugin;\n }\n get vuetify(): ReturnType<typeof createVuetify> {\n return this._vuetify;\n }\n get vueI18n(): Composer {\n return this._vueI18n;\n }\n get categoryManager(): CategoryManager {\n return this._categoryManager;\n }\n get contextMenuManager(): ContextMenuManager {\n return this._contextMenuManager;\n }\n get search(): Search {\n return this._search;\n }\n get uiConfig(): UiConfig &\n OverrideCollection<UiConfigurationItem<unknown>, UiConfig> {\n return this._uiConfig;\n }\n get notifier(): Notifier {\n return this._notifier;\n }\n\n /**\n * Returns a callback function providing a URL to help page.\n * The default helpBaseUrl can be changed by adding an 'helpBaseUrl' item to the UiConfig Collection.\n * The callback derives the url from the VC Map mayor and minor version, the current app locale and a provided path pointing to a specific help section.\n * This function can be used for the WindowState infoUrlCallback property.\n * @param path the path to a help section\n * @param subpage path to a subpage. Default is 'vc-map'.\n * @param subpageVersion - default version is the mapVersion, can be provided to use a plugin specific version\n */\n getHelpUrlCallback(\n path = '',\n subpage = 'vc-map',\n subpageVersion = VcsUiApp.getVersion(),\n ): () => string {\n const mayorMinorVersion = /\\d+\\.\\d+/.exec(subpageVersion)?.[0];\n return () => {\n const base =\n this.uiConfig.config.helpBaseUrl || 'https://help.vc.systems/';\n const url = `${\n this.locale\n }/${subpage}/v${mayorMinorVersion}/${path.replace(/^\\//, '')}`;\n const { href } = new URL(url, base);\n return href;\n };\n }\n\n /**\n * 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\n * the maximum URL length is not exceeded). This includes: layer active state & styling, active map, active viewpoint,\n * currently selected feature info & any state deemed required for a sharable URL by the currently loaded plugins.\n */\n async getState(forUrl?: boolean): Promise<AppState> {\n const state = createEmptyState();\n const { activeMap } = this.maps;\n if (!activeMap) {\n return state;\n }\n\n const nonDynamicModules = this.modules.filter(\n ({ _id }) => _id !== defaultDynamicModuleId,\n );\n\n if (nonDynamicModules.some((m) => !m.config._id)) {\n getLogger().warning(\n 'Some modules you are creating are missing a stable _id property. This may lead to issues while restoring application state.',\n );\n }\n\n state.moduleIds = nonDynamicModules.map(({ _id }) => _id);\n\n state.activeMap = activeMap.name;\n const viewpoint = await activeMap.getViewpoint();\n state.activeViewpoint = viewpoint?.isValid?.()\n ? viewpoint.toJSON()\n : undefined;\n state.layers = [...this.layers]\n .filter((l) => {\n const layerWithStyle = l as typeof l & {\n style?: { name: string; [moduleIdSymbol]?: string };\n defaultStyle?: { name: string };\n };\n\n return (\n l.isSupported(activeMap) &&\n l[moduleIdSymbol] !== defaultDynamicModuleId &&\n l[moduleIdSymbol] !== volatileModuleId &&\n (((l.active || l.loading) && !l.activeOnStartup) ||\n (!l.active && l.activeOnStartup) ||\n ((l.active || l.loading) &&\n layerWithStyle.style !== layerWithStyle.defaultStyle &&\n this.styles.has(layerWithStyle.style as never)))\n );\n })\n .map((l) => {\n const layerWithStyle = l as typeof l & {\n style?: { name: string; [moduleIdSymbol]?: string };\n defaultStyle?: { name: string };\n };\n\n const layerState: LayerState = {\n name: l.name,\n active: l.active || l.loading,\n };\n if (\n layerWithStyle.style &&\n layerWithStyle.defaultStyle &&\n layerWithStyle.style.name !== layerWithStyle.defaultStyle.name &&\n this.styles.has(layerWithStyle.style as never) &&\n layerWithStyle.style[moduleIdSymbol] !== defaultDynamicModuleId &&\n layerWithStyle.style[moduleIdSymbol] !== volatileModuleId\n ) {\n layerState.styleName = layerWithStyle.style.name;\n } else if (l instanceof WMSLayer) {\n const module = this.getModuleById(l[moduleIdSymbol]!);\n const styleName = writeWMSStyleForLayer(l, module?.config);\n if (styleName) {\n layerState.styleName = styleName;\n }\n }\n return layerState;\n });\n\n state.clippingPolygons = [...this.clippingPolygons]\n .filter(\n (p) =>\n p[moduleIdSymbol] !== defaultDynamicModuleId &&\n p[moduleIdSymbol] !== volatileModuleId &&\n ((p.active && !p.activeOnStartup) ||\n (!p.active && p.activeOnStartup)),\n )\n .map((p) => ({ name: p.name, active: p.active }));\n\n const plugins: Array<PluginState<unknown> | null> = await Promise.all(\n [...this.plugins]\n .filter(\n (p) =>\n p[moduleIdSymbol] !== defaultDynamicModuleId &&\n p[moduleIdSymbol] !== volatileModuleId &&\n typeof p.getState === 'function',\n )\n .map(async (p): Promise<PluginState<unknown> | null> => {\n try {\n if (!p.getState) {\n return null;\n }\n\n const pluginState = await p.getState(forUrl);\n if (pluginState && Object.keys(pluginState).length > 0) {\n return { name: p.name, state: pluginState };\n }\n return null;\n } catch (e: unknown) {\n getLogger().error(getCaughtError(e).message);\n return null;\n }\n }),\n );\n\n state.plugins = plugins.filter(\n (p): p is PluginState<unknown> => p !== null,\n );\n\n if (activeMap instanceof ObliqueMap && activeMap.collection) {\n state.activeObliqueCollection = activeMap.collection.name;\n }\n return state;\n }\n\n protected async _parseModule(module: VcsModule): Promise<void> {\n const config = module.config as VcsUiModuleConfig;\n if (!config._id) {\n getLogger().warning(\n 'A module is missing a stable _id property. This may lead to issues while restoring application state.',\n );\n }\n if (Array.isArray(config.plugins)) {\n await this._plugins.parseItems(config.plugins, module._id);\n }\n if (Array.isArray(config.i18n)) {\n await this._i18n.parseItems(config.i18n, module._id);\n }\n await super._parseModule(module);\n await this._contentTree.parseItems(config.contentTree, module._id);\n await this._uiConfig.parseItems(config.uiConfig, module._id);\n await this._featureInfo.parseItems(config.featureInfo, module._id);\n }\n\n protected async _setModuleState(module: VcsModule): Promise<void> {\n await super._setModuleState(module);\n if (this._cachedAppState.moduleIds.includes(module._id)) {\n this._cachedAppState.layers.forEach((layerState: LayerState) => {\n const layer = this.layers.getByKey(layerState.name);\n if (layer) {\n const layerWithStyle = layer as typeof layer & {\n setStyle?: (style: unknown) => void;\n };\n if (layerState.active) {\n layer.activate().catch((e: unknown) => {\n getLogger().warning(\n 'Failed to activate cached app state. layer failed: ',\n layer.name,\n e,\n );\n });\n } else {\n layer.deactivate();\n }\n\n if (layerState.styleName) {\n if (\n this.styles.hasKey(layerState.styleName) &&\n layerWithStyle.setStyle\n ) {\n layerWithStyle.setStyle(\n this.styles.getByKey(layerState.styleName),\n );\n } else if (layer instanceof WMSLayer) {\n const { layers, styles } = parseWMSStyle(layerState.styleName);\n if (styles) {\n layer.parameters.STYLES = styles;\n }\n layer\n .setLayers(layers || layer.getLayers())\n .catch((err: unknown) => {\n getLogger().warning(\n `Failed to set WMS layers ${layers} on layer ${layer.name}`,\n err,\n );\n });\n }\n }\n }\n });\n if (\n this._cachedAppState.activeMap &&\n this.maps.hasKey(this._cachedAppState.activeMap)\n ) {\n await this.maps.setActiveMap(this._cachedAppState.activeMap);\n }\n if (\n this._cachedAppState.activeObliqueCollection &&\n this.maps.activeMap instanceof ObliqueMap &&\n this.obliqueCollections.hasKey(\n this._cachedAppState.activeObliqueCollection,\n )\n ) {\n const obliqueCollection = this.obliqueCollections.getByKey(\n this._cachedAppState.activeObliqueCollection,\n );\n await this.maps.activeMap.setCollection(\n obliqueCollection as NonNullable<typeof obliqueCollection>,\n );\n }\n const viewpointOptions =\n this._cachedAppState.activeViewpoint ??\n this._cachedAppState.getViewpoint?.(module._id);\n if (viewpointOptions) {\n await this.maps.activeMap?.gotoViewpoint(\n new Viewpoint(viewpointOptions),\n );\n }\n this._cachedAppState.clippingPolygons.forEach(\n (cpState: ClippingPolygonState) => {\n const clippingPolygon = this.clippingPolygons.getByKey(cpState.name);\n if (clippingPolygon) {\n if (cpState.active) {\n clippingPolygon.activate();\n } else {\n clippingPolygon.deactivate();\n }\n }\n },\n );\n this._cachedAppState.moduleIds.splice(\n this._cachedAppState.moduleIds.indexOf(module._id),\n 1,\n );\n }\n }\n\n serializeModule(moduleId: string): VcsUiModuleConfig {\n const config = super.serializeModule(moduleId) as VcsUiModuleConfig;\n config.uiConfig = this._uiConfig.serializeModule(moduleId);\n config.featureInfo = this._featureInfo.serializeModule(moduleId);\n config.i18n = this._i18n.serializeModule(moduleId);\n config.contentTree = this._contentTree.serializeModule(moduleId);\n config.plugins = this._plugins.serializeModule(moduleId);\n return config;\n }\n\n protected async _removeModule(moduleId: string): Promise<void> {\n await super._removeModule(moduleId);\n this._plugins.removeModule(moduleId);\n this._i18n.removeModule(moduleId);\n this._contentTree.removeModule(moduleId);\n this._featureInfo.removeModule(moduleId);\n this._uiConfig.removeModule(moduleId);\n }\n\n /**\n * Destroys the vcsUiApp and all its collections, their content and ui managers.\n */\n destroy(): void {\n this.windowManager.destroy();\n this.panelManager.destroy();\n this.navbarManager.destroy();\n this.toolboxManager.destroy();\n this.categoryManager.destroy();\n this.contextMenuManager.destroy();\n this._attributions.destroy();\n this._overviewMap.destroy();\n this._pluginListeners.forEach((cb: () => void) => {\n cb();\n });\n this._pluginListeners = [];\n destroyCollection(this._plugins);\n destroyCollection(this._contentTree);\n this._i18n.destroy();\n destroyCollection(this._search);\n this._vueI18nDestroy();\n this._contentTreeClassRegistry.destroy();\n this._featureInfoClassRegistry.destroy();\n this._featureInfo.destroy();\n this._uiConfig.destroy();\n this._destroySiteConfig();\n this._destroyObliqueFallback();\n super.destroy();\n }\n}\n\nexport default VcsUiApp;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4KA,SAASA,cAAoB;CAC3B,OAAOC,UAAgB,UAAU;AACnC;AAEA,IAAM,WAAN,MAAM,iBAAiB,OAAO;;;;CAI5B,OAAO,aAAqB;EAC1B,OAAOC,gBAAY;CACrB;;;;CAKA,eAAe,IAAI,SAAe;CAElC,WAII,uBAKF,IAAI,WAAsB,SACpB,KAAK,iBACX,iBAEA,iBAGF;;;;;CAKA,QAII,uBACF,IAAI,eAAe,KAAK,QAAQ,SAC1B,KAAK,eACb;CAEA,mBAA8C,CAAC;CAE/C,iBAA+B,cAAc;CAE7C,WAAwD,iBACtD,KAAK,cACP;CAEA,WAA6B,KAAK,eAAe;CAEjD,kBAAsC,UAAU,IAAI;CAEpD,yBAAiC,IAAI,sBAEnC,qBAAqB;CAEvB,4BAAoC,IAAI,sBAEtC,wBAAwB;CAC1B,YAC+D,IAAI,eAC3D,KAAK,eACb;CAEA,eAAuB,4BAA4B,IAAI;CAEvD,kBAA0B,IAAI,eAAe;CAE7C,iBAAyB,IAAI,cAAc;CAE3C,gBAAwB,IAAI,aAAa;CAEzC,iBAAyB,IAAI,cAAc;CAE3C,UAAkB,IAAI,OAAO,IAAI;CAEjC,4BAAoC,IAAI,sBAEtC,wBAAwB;CAE1B,eAAuB,uBAKrB,IAAI,YAAY,IAAI,SACd,KAAK,iBACX,KAAA,IACC,WACC,2BAA2B,KAAK,2BAA2B,MAAM,GACnE,uBACF;CAEA,eAAuB,IAAI,YAAY,IAA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,KAAK,UAAU,aAAa,QAAQ;CACtC;;;;CAKA,UAAgB;EACd,KAAK,cAAc,QAAQ;EAC3B,KAAK,aAAa,QAAQ;EAC1B,KAAK,cAAc,QAAQ;EAC3B,KAAK,eAAe,QAAQ;EAC5B,KAAK,gBAAgB,QAAQ;EAC7B,KAAK,mBAAmB,QAAQ;EAChC,KAAK,cAAc,QAAQ;EAC3B,KAAK,aAAa,QAAQ;EAC1B,KAAK,iBAAiB,SAAS,OAAmB;GAChD,GAAG;EACL,CAAC;EACD,KAAK,mBAAmB,CAAC;EACzB,kBAAkB,KAAK,QAAQ;EAC/B,kBAAkB,KAAK,YAAY;EACnC,KAAK,MAAM,QAAQ;EACnB,kBAAkB,KAAK,OAAO;EAC9B,KAAK,gBAAgB;EACrB,KAAK,0BAA0B,QAAQ;EACvC,KAAK,0BAA0B,QAAQ;EACvC,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,QAAQ;EACvB,KAAK,mBAAmB;EACxB,KAAK,wBAAwB;EAC7B,MAAM,QAAQ;CAChB;AACF"}
|
|
@@ -5,7 +5,7 @@ import type VcsUiApp from '../vcsUiApp.js';
|
|
|
5
5
|
* creates a new VueI18n Instance.
|
|
6
6
|
*/
|
|
7
7
|
export declare function createVueI18n(): I18n;
|
|
8
|
-
declare module '
|
|
8
|
+
declare module 'vue' {
|
|
9
9
|
interface ComponentCustomProperties {
|
|
10
10
|
$st(key: string | number | undefined | null): string;
|
|
11
11
|
$st(key: string | number | undefined | null, plural: number, options?: TranslateOptions): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":[],"sources":["../../../src/vuePlugins/i18n.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unified-signatures */\nimport {\n createI18n,\n type I18n,\n type TranslateOptions,\n type NamedValue,\n} from 'vue-i18n';\nimport { is } from '@vcsuite/check';\nimport { resolveValue } from '@intlify/core-base';\nimport type { Plugin } from 'vue';\nimport type VcsUiApp from '../vcsUiApp.js';\n\n/**\n * creates a new VueI18n Instance.\n */\nexport function createVueI18n(): I18n {\n return createI18n({\n legacy: false,\n globalInjection: true,\n locale: 'en',\n missingWarn: false,\n fallbackWarn: false,\n fallbackLocale: ['en', 'de'],\n messageResolver: (obj, path) => {\n const value = resolveValue(obj, path);\n return typeof value === 'string'\n ? value.replaceAll(/@/g, \"{'@'}\")\n : value;\n },\n messages: {\n en: {},\n },\n postTranslation: (val, key) => (typeof val === 'string' ? val : key),\n });\n}\n\ndeclare module '
|
|
1
|
+
{"version":3,"file":"i18n.js","names":[],"sources":["../../../src/vuePlugins/i18n.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unified-signatures */\nimport {\n createI18n,\n type I18n,\n type TranslateOptions,\n type NamedValue,\n} from 'vue-i18n';\nimport { is } from '@vcsuite/check';\nimport { resolveValue } from '@intlify/core-base';\nimport type { Plugin } from 'vue';\nimport type VcsUiApp from '../vcsUiApp.js';\n\n/**\n * creates a new VueI18n Instance.\n */\nexport function createVueI18n(): I18n {\n return createI18n({\n legacy: false,\n globalInjection: true,\n locale: 'en',\n missingWarn: false,\n fallbackWarn: false,\n fallbackLocale: ['en', 'de'],\n messageResolver: (obj, path) => {\n const value = resolveValue(obj, path);\n return typeof value === 'string'\n ? value.replaceAll(/@/g, \"{'@'}\")\n : value;\n },\n messages: {\n en: {},\n },\n postTranslation: (val, key) => (typeof val === 'string' ? val : key),\n });\n}\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $st(key: string | number | undefined | null): string;\n $st(\n key: string | number | undefined | null,\n plural: number,\n options?: TranslateOptions,\n ): string;\n $st(\n key: string | number | undefined | null,\n defaultMsg: string,\n options?: TranslateOptions,\n ): string;\n $st(\n key: string | number | undefined | null,\n list: unknown[],\n options?: TranslateOptions,\n ): string;\n $st(\n key: string | number | undefined | null,\n list: unknown[],\n plural: number,\n ): string;\n $st(\n key: string | number | undefined | null,\n list: unknown[],\n defaultMsg: string,\n ): string;\n $st(\n key: string | number | undefined | null,\n named: NamedValue,\n options?: TranslateOptions,\n ): string;\n $st(\n key: string | number | undefined | null,\n named: NamedValue,\n plural: number,\n ): string;\n $st(\n key: string | number | undefined | null,\n named: NamedValue,\n defaultMsg: string,\n ): string;\n }\n}\n\n/**\n * creates a Vue Plugin with a new $st template helper which can handle undefined. Will just redirect to vueI18n,\n * if key is a string\n */\nexport function createSafeI18n(): Plugin {\n return {\n install: (vApp): void => {\n vApp.config.globalProperties.$st = (\n key: string | number | undefined | null,\n ...args: unknown[]\n ): string => {\n if (!is(key, String)) {\n if (key !== null && key !== undefined) {\n return String(key);\n }\n return '';\n }\n return vApp.config.globalProperties.$t(key, ...args);\n };\n },\n } satisfies Plugin;\n}\n\n/**\n * sets the messages to the app's I18n Instance;\n * @param {import(\"../vcsUiApp.js\").default} app\n */\nfunction setI18nMessages(app: VcsUiApp): void {\n app.vueI18n.availableLocales.forEach((locale) => {\n app.vueI18n.setLocaleMessage(locale, {});\n });\n Object.entries(app.i18n.getMergedMessages()).forEach(\n ([locale, localeMessages]) => {\n app.vueI18n.setLocaleMessage(\n locale,\n localeMessages as Record<string, unknown>,\n );\n },\n );\n}\n\nexport function setupI18n(app: VcsUiApp): () => void {\n setI18nMessages(app);\n app.vueI18n.locale.value = app.locale;\n const destroyFunctions = [\n app.i18n.changed.addEventListener(() => {\n setI18nMessages(app);\n }),\n app.localeChanged.addEventListener((locale) => {\n app.vueI18n.locale.value = locale;\n }),\n ];\n return function tearDownI18nSetup() {\n destroyFunctions.forEach((destroy) => {\n destroy();\n });\n app.vueI18nPlugin.dispose();\n };\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,gBAAsB;CACpC,OAAO,WAAW;EAChB,QAAQ;EACR,iBAAiB;EACjB,QAAQ;EACR,aAAa;EACb,cAAc;EACd,gBAAgB,CAAC,MAAM,IAAI;EAC3B,kBAAkB,KAAK,SAAS;GAC9B,MAAM,QAAQ,aAAa,KAAK,IAAI;GACpC,OAAO,OAAO,UAAU,WACpB,MAAM,WAAW,MAAM,OAAO,IAC9B;EACN;EACA,UAAU,EACR,IAAI,CAAC,EACP;EACA,kBAAkB,KAAK,QAAS,OAAO,QAAQ,WAAW,MAAM;CAClE,CAAC;AACH;;;;;AAoDA,SAAgB,iBAAyB;CACvC,OAAO,EACL,UAAU,SAAe;EACvB,KAAK,OAAO,iBAAiB,OAC3B,KACA,GAAG,SACQ;GACX,IAAI,CAAC,GAAG,KAAK,MAAM,GAAG;IACpB,IAAI,QAAQ,QAAQ,QAAQ,KAAA,GAC1B,OAAO,OAAO,GAAG;IAEnB,OAAO;GACT;GACA,OAAO,KAAK,OAAO,iBAAiB,GAAG,KAAK,GAAG,IAAI;EACrD;CACF,EACF;AACF;;;;;AAMA,SAAS,gBAAgB,KAAqB;CAC5C,IAAI,QAAQ,iBAAiB,SAAS,WAAW;EAC/C,IAAI,QAAQ,iBAAiB,QAAQ,CAAC,CAAC;CACzC,CAAC;CACD,OAAO,QAAQ,IAAI,KAAK,kBAAkB,CAAC,CAAC,CAAC,SAC1C,CAAC,QAAQ,oBAAoB;EAC5B,IAAI,QAAQ,iBACV,QACA,cACF;CACF,CACF;AACF;AAEA,SAAgB,UAAU,KAA2B;CACnD,gBAAgB,GAAG;CACnB,IAAI,QAAQ,OAAO,QAAQ,IAAI;CAC/B,MAAM,mBAAmB,CACvB,IAAI,KAAK,QAAQ,uBAAuB;EACtC,gBAAgB,GAAG;CACrB,CAAC,GACD,IAAI,cAAc,kBAAkB,WAAW;EAC7C,IAAI,QAAQ,OAAO,QAAQ;CAC7B,CAAC,CACH;CACA,OAAO,SAAS,oBAAoB;EAClC,iBAAiB,SAAS,YAAY;GACpC,QAAQ;EACV,CAAC;EACD,IAAI,cAAc,QAAQ;CAC5B;AACF"}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|