@collabdt/core 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/core/components/viewers/Viewer.d.ts.map +1 -1
  2. package/dist/core/components/viewers/Viewer.js +7 -10
  3. package/dist/core/components/viewers/Viewer.js.map +1 -1
  4. package/dist/core/components/viewers/bim/src/lib/buildingLocationParams.d.ts +1 -0
  5. package/dist/core/components/viewers/bim/src/lib/buildingLocationParams.d.ts.map +1 -1
  6. package/dist/core/components/viewers/bim/src/lib/buildingLocationParams.js +10 -2
  7. package/dist/core/components/viewers/bim/src/lib/buildingLocationParams.js.map +1 -1
  8. package/dist/core/components/viewers/bim/utils/setCameraLookAt.d.ts.map +1 -1
  9. package/dist/core/components/viewers/bim/utils/setCameraLookAt.js +13 -14
  10. package/dist/core/components/viewers/bim/utils/setCameraLookAt.js.map +1 -1
  11. package/dist/core/components/viewers/map/MapViewer.d.ts.map +1 -1
  12. package/dist/core/components/viewers/map/MapViewer.js +11 -8
  13. package/dist/core/components/viewers/map/MapViewer.js.map +1 -1
  14. package/dist/core/components/viewers/map/src/Geocoder.d.ts.map +1 -1
  15. package/dist/core/components/viewers/map/src/Geocoder.js +23 -20
  16. package/dist/core/components/viewers/map/src/Geocoder.js.map +1 -1
  17. package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.d.ts.map +1 -1
  18. package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.js +7 -6
  19. package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.js.map +1 -1
  20. package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/LocationSettings.d.ts.map +1 -1
  21. package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/LocationSettings.js +12 -32
  22. package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/LocationSettings.js.map +1 -1
  23. package/dist/core/components/viewers/map/src/tools/shareMapTool.d.ts.map +1 -1
  24. package/dist/core/components/viewers/map/src/tools/shareMapTool.js +24 -14
  25. package/dist/core/components/viewers/map/src/tools/shareMapTool.js.map +1 -1
  26. package/dist/core/components/viewers/map/utils/geocoder.d.ts +1 -0
  27. package/dist/core/components/viewers/map/utils/geocoder.d.ts.map +1 -1
  28. package/dist/core/components/viewers/map/utils/geocoder.js +5 -0
  29. package/dist/core/components/viewers/map/utils/geocoder.js.map +1 -1
  30. package/dist/core/components/viewers/map/utils/geocoding/adapters.d.ts +2 -0
  31. package/dist/core/components/viewers/map/utils/geocoding/adapters.d.ts.map +1 -1
  32. package/dist/core/components/viewers/map/utils/geocoding/adapters.js +8 -1
  33. package/dist/core/components/viewers/map/utils/geocoding/adapters.js.map +1 -1
  34. package/dist/core/components/viewers/map/utils/geocoding/index.d.ts +3 -0
  35. package/dist/core/components/viewers/map/utils/geocoding/index.d.ts.map +1 -1
  36. package/dist/core/components/viewers/map/utils/geocoding/index.js +20 -3
  37. package/dist/core/components/viewers/map/utils/geocoding/index.js.map +1 -1
  38. package/dist/core/components/viewers/map/utils/geocoding/osm.d.ts +2 -0
  39. package/dist/core/components/viewers/map/utils/geocoding/osm.d.ts.map +1 -1
  40. package/dist/core/components/viewers/map/utils/geocoding/osm.js +32 -1
  41. package/dist/core/components/viewers/map/utils/geocoding/osm.js.map +1 -1
  42. package/dist/core/components/viewers/map/utils/geocoding/pelias.d.ts +2 -0
  43. package/dist/core/components/viewers/map/utils/geocoding/pelias.d.ts.map +1 -1
  44. package/dist/core/components/viewers/map/utils/geocoding/pelias.js +30 -1
  45. package/dist/core/components/viewers/map/utils/geocoding/pelias.js.map +1 -1
  46. package/dist/core/components/viewers/map/utils/geocoding/placeSearch.d.ts +17 -0
  47. package/dist/core/components/viewers/map/utils/geocoding/placeSearch.d.ts.map +1 -0
  48. package/dist/core/components/viewers/map/utils/geocoding/placeSearch.js +26 -0
  49. package/dist/core/components/viewers/map/utils/geocoding/placeSearch.js.map +1 -0
  50. package/dist/core/components/viewers/map/utils/urlLocation/locationParams.d.ts +38 -0
  51. package/dist/core/components/viewers/map/utils/urlLocation/locationParams.d.ts.map +1 -0
  52. package/dist/core/components/viewers/map/utils/urlLocation/locationParams.js +91 -0
  53. package/dist/core/components/viewers/map/utils/urlLocation/locationParams.js.map +1 -0
  54. package/dist/core/components/viewers/map/utils/urlLocation/locationTarget.d.ts +25 -0
  55. package/dist/core/components/viewers/map/utils/urlLocation/locationTarget.d.ts.map +1 -0
  56. package/dist/core/components/viewers/map/utils/urlLocation/locationTarget.js +71 -0
  57. package/dist/core/components/viewers/map/utils/urlLocation/locationTarget.js.map +1 -0
  58. package/dist/core/components/viewers/map/utils/urlLocation/resolveLocationTarget.d.ts +20 -0
  59. package/dist/core/components/viewers/map/utils/urlLocation/resolveLocationTarget.d.ts.map +1 -0
  60. package/dist/core/components/viewers/map/utils/urlLocation/resolveLocationTarget.js +103 -0
  61. package/dist/core/components/viewers/map/utils/urlLocation/resolveLocationTarget.js.map +1 -0
  62. package/dist/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.d.ts +4 -0
  63. package/dist/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.d.ts.map +1 -0
  64. package/dist/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.js +72 -0
  65. package/dist/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.js.map +1 -0
  66. package/dist/core/hooks/useShareUrl.d.ts.map +1 -1
  67. package/dist/core/hooks/useShareUrl.js +5 -9
  68. package/dist/core/hooks/useShareUrl.js.map +1 -1
  69. package/package.json +3 -3
@@ -0,0 +1,103 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { isCountryCode, normalizeSubdivision, subdivisionCountry } from "../geocoding/placeSearch";
21
+ import { clearFinerLabels, labelsFromParams, labelsFromPlace } from "./locationParams";
22
+ import { DEFAULT_LEVEL_ZOOM, parseBbox, parseLngLat, parseZoom, presentLevels } from "./locationTarget";
23
+ const isNumber = (value) => typeof value === "number" && Number.isFinite(value);
24
+ const pointAt = (lng, lat, zoom) => isNumber(lng) && isNumber(lat) ? { center: [lng, lat], zoom } : null;
25
+ function placeContext(level, params, countryCode) {
26
+ var _a, _b;
27
+ const country = ((_a = params.get("country")) == null ? void 0 : _a.trim()) || subdivisionCountry(params.get("countrySubdivision")) || countryCode || void 0;
28
+ if (level === "country") return {};
29
+ const countrySubdivision = normalizeSubdivision(params.get("countrySubdivision")) || void 0;
30
+ if (level === "countrySubdivision") return { country };
31
+ const municipality = ((_b = params.get("municipality")) == null ? void 0 : _b.trim()) || void 0;
32
+ if (level === "municipality") return { country, countrySubdivision };
33
+ return { country, countrySubdivision, municipality };
34
+ }
35
+ function placeTarget(level, feature, zoom) {
36
+ var _a;
37
+ const bbox = feature.bbox;
38
+ if (level !== "address" && (bbox == null ? void 0 : bbox.length) === 4 && bbox[0] < bbox[2] && bbox[1] < bbox[3]) {
39
+ return { bounds: [bbox[0], bbox[1], bbox[2], bbox[3]] };
40
+ }
41
+ const [lng, lat] = ((_a = feature.geometry) == null ? void 0 : _a.type) === "Point" ? feature.geometry.coordinates : [];
42
+ return pointAt(lng, lat, zoom);
43
+ }
44
+ async function resolvePlace(level, params, deps) {
45
+ var _a, _b, _c;
46
+ const raw = (_b = (_a = params.get(level)) == null ? void 0 : _a.trim()) != null ? _b : "";
47
+ const name = level === "countrySubdivision" ? normalizeSubdivision(raw) : raw;
48
+ const context = placeContext(level, params, deps.countryCode);
49
+ const feature = await deps.searchPlace(level, name, context);
50
+ const zoom = level === "address" ? (_c = parseZoom(params)) != null ? _c : DEFAULT_LEVEL_ZOOM.address : DEFAULT_LEVEL_ZOOM[level];
51
+ const target = feature && placeTarget(level, feature, zoom);
52
+ if (!target) return null;
53
+ const found = labelsFromPlace(feature.properties, level === "address" ? name : void 0);
54
+ const country = found.country || (isCountryCode(context.country) ? context.country.toUpperCase() : void 0);
55
+ const merged = __spreadProps(__spreadValues(__spreadValues({}, labelsFromParams(params)), stripEmpty(__spreadProps(__spreadValues({}, found), { country }))), { [level]: level === "address" ? name : found[level] || name });
56
+ return { level, target, labels: clearFinerLabels(merged, level) };
57
+ }
58
+ const stripEmpty = (labels) => Object.fromEntries(Object.entries(labels).filter(([, value]) => value));
59
+ function resolveRecord(level, params, deps) {
60
+ var _a;
61
+ const zoom = (_a = parseZoom(params)) != null ? _a : DEFAULT_LEVEL_ZOOM[level];
62
+ const record = level === "site" ? deps.site && { lng: deps.site.siteLongitude, lat: deps.site.siteLatitude, municipality: deps.site.siteMunicipality, countrySubdivision: deps.site.siteCountrySubdivision } : deps.building && { lng: deps.building.buildingLongitude, lat: deps.building.buildingLatitude, municipality: deps.building.buildingMunicipality, countrySubdivision: deps.building.buildingCountrySubdivision };
63
+ const target = record && pointAt(record.lng, record.lat, zoom);
64
+ if (!target) return null;
65
+ const labels = __spreadValues(__spreadValues({}, labelsFromParams(params)), stripEmpty({ municipality: record.municipality, countrySubdivision: record.countrySubdivision }));
66
+ return { level, target, labels: clearFinerLabels(labels, level) };
67
+ }
68
+ async function resolveLevel(level, params, deps) {
69
+ var _a, _b;
70
+ switch (level) {
71
+ case "latlng": {
72
+ const [lng, lat] = (_a = parseLngLat(params)) != null ? _a : [];
73
+ const target = pointAt(lng, lat, (_b = parseZoom(params)) != null ? _b : DEFAULT_LEVEL_ZOOM.latlng);
74
+ return target && { level, target, labels: labelsFromParams(params) };
75
+ }
76
+ case "bbox": {
77
+ const bounds = parseBbox(params.get("bbox"));
78
+ return bounds && { level, target: { bounds }, labels: labelsFromParams(params) };
79
+ }
80
+ case "site":
81
+ case "buildingId":
82
+ return resolveRecord(level, params, deps);
83
+ case "asset":
84
+ return null;
85
+ default:
86
+ return resolvePlace(level, params, deps);
87
+ }
88
+ }
89
+ async function resolveLocationTarget(params, deps) {
90
+ for (const level of presentLevels(params)) {
91
+ try {
92
+ const resolved = await resolveLevel(level, params, deps);
93
+ if (resolved) return resolved;
94
+ } catch (error) {
95
+ console.warn(`Map URL: could not resolve ${level}; trying the next level up.`, error);
96
+ }
97
+ }
98
+ return null;
99
+ }
100
+ export {
101
+ resolveLocationTarget
102
+ };
103
+ //# sourceMappingURL=resolveLocationTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../src/core/components/viewers/map/utils/urlLocation/resolveLocationTarget.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { isCountryCode, normalizeSubdivision, subdivisionCountry } from '../geocoding/placeSearch'\n\nimport { clearFinerLabels, labelsFromParams, labelsFromPlace } from './locationParams'\nimport { DEFAULT_LEVEL_ZOOM, parseBbox, parseLngLat, parseZoom, presentLevels } from './locationTarget'\n\nimport type { LocationLabels } from './locationParams'\nimport type { CameraTarget, LocationLevel } from './locationTarget'\nimport type { Building, Site } from '../../../../../types/dbTypes'\nimport type { PlaceContext, PlaceLevel } from '../geocoding/placeSearch'\nimport type { Feature } from 'geojson'\n\nexport interface ResolvedLocation {\n level: LocationLevel\n target: CameraTarget\n labels: LocationLabels\n}\n\nexport interface ResolveDeps {\n searchPlace: (level: PlaceLevel, name: string, context: PlaceContext) => Promise<Feature | null>\n site?: Site | null\n building?: Building | null\n /** Used when the URL carries no `country`. */\n countryCode?: string\n}\n\nconst isNumber = (value: unknown): value is number => typeof value === 'number' && Number.isFinite(value)\n\nconst pointAt = (lng: unknown, lat: unknown, zoom: number): CameraTarget | null =>\n isNumber(lng) && isNumber(lat) ? { center: [lng, lat], zoom } : null\n\nfunction placeContext(level: PlaceLevel, params: URLSearchParams, countryCode?: string): PlaceContext {\n const country = params.get('country')?.trim() || subdivisionCountry(params.get('countrySubdivision')) || countryCode || undefined\n if (level === 'country') return {}\n const countrySubdivision = normalizeSubdivision(params.get('countrySubdivision')) || undefined\n if (level === 'countrySubdivision') return { country }\n const municipality = params.get('municipality')?.trim() || undefined\n if (level === 'municipality') return { country, countrySubdivision }\n return { country, countrySubdivision, municipality }\n}\n\nfunction placeTarget(level: PlaceLevel, feature: Feature, zoom: number): CameraTarget | null {\n const bbox = feature.bbox\n if (level !== 'address' && bbox?.length === 4 && bbox[0] < bbox[2] && bbox[1] < bbox[3]) {\n return { bounds: [bbox[0], bbox[1], bbox[2], bbox[3]] }\n }\n const [lng, lat] = feature.geometry?.type === 'Point' ? feature.geometry.coordinates : []\n return pointAt(lng, lat, zoom)\n}\n\nasync function resolvePlace(level: PlaceLevel, params: URLSearchParams, deps: ResolveDeps): Promise<ResolvedLocation | null> {\n const raw = params.get(level)?.trim() ?? ''\n const name = level === 'countrySubdivision' ? normalizeSubdivision(raw) : raw\n const context = placeContext(level, params, deps.countryCode)\n const feature = await deps.searchPlace(level, name, context)\n const zoom = level === 'address' ? parseZoom(params) ?? DEFAULT_LEVEL_ZOOM.address : DEFAULT_LEVEL_ZOOM[level]\n const target = feature && placeTarget(level, feature, zoom)\n if (!target) return null\n\n const found = labelsFromPlace(feature.properties, level === 'address' ? name : undefined)\n const country = found.country || (isCountryCode(context.country) ? context.country.toUpperCase() : undefined)\n const merged = { ...labelsFromParams(params), ...stripEmpty({ ...found, country }), [level]: level === 'address' ? name : found[level] || name }\n return { level, target, labels: clearFinerLabels(merged, level) }\n}\n\nconst stripEmpty = (labels: LocationLabels): LocationLabels =>\n Object.fromEntries(Object.entries(labels).filter(([, value]) => value))\n\nfunction resolveRecord(level: 'site' | 'buildingId', params: URLSearchParams, deps: ResolveDeps): ResolvedLocation | null {\n const zoom = parseZoom(params) ?? DEFAULT_LEVEL_ZOOM[level]\n const record = level === 'site'\n ? deps.site && { lng: deps.site.siteLongitude, lat: deps.site.siteLatitude, municipality: deps.site.siteMunicipality, countrySubdivision: deps.site.siteCountrySubdivision }\n : deps.building && { lng: deps.building.buildingLongitude, lat: deps.building.buildingLatitude, municipality: deps.building.buildingMunicipality, countrySubdivision: deps.building.buildingCountrySubdivision }\n const target = record && pointAt(record.lng, record.lat, zoom)\n if (!target) return null\n\n const labels = { ...labelsFromParams(params), ...stripEmpty({ municipality: record.municipality, countrySubdivision: record.countrySubdivision }) }\n return { level, target, labels: clearFinerLabels(labels, level) }\n}\n\nasync function resolveLevel(level: LocationLevel, params: URLSearchParams, deps: ResolveDeps): Promise<ResolvedLocation | null> {\n switch (level) {\n case 'latlng': {\n const [lng, lat] = parseLngLat(params) ?? []\n const target = pointAt(lng, lat, parseZoom(params) ?? DEFAULT_LEVEL_ZOOM.latlng)\n return target && { level, target, labels: labelsFromParams(params) }\n }\n case 'bbox': {\n const bounds = parseBbox(params.get('bbox'))\n return bounds && { level, target: { bounds }, labels: labelsFromParams(params) }\n }\n case 'site':\n case 'buildingId': return resolveRecord(level, params, deps)\n case 'asset': return null\n default: return resolvePlace(level, params, deps)\n }\n}\n\n/** Resolves the finest level in `params`, walking up the hierarchy until one lands. Null leaves the map where it is. */\nexport async function resolveLocationTarget(params: URLSearchParams, deps: ResolveDeps): Promise<ResolvedLocation | null> {\n for (const level of presentLevels(params)) {\n try {\n const resolved = await resolveLevel(level, params, deps)\n if (resolved) return resolved\n }\n catch (error) {\n console.warn(`Map URL: could not resolve ${level}; trying the next level up.`, error)\n }\n }\n return null\n}\n"],"mappings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KAAK,8BAA8B,KAAK,+BAA+B,KAAK;AAAA,IACtF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,4 @@
1
+ import type { Map as MapLibreMap } from 'maplibre-gl';
2
+ /** On load, flies to the finest location the URL names, then writes the full location back into the URL. */
3
+ export declare function useUrlFlyTo(map: MapLibreMap | undefined, countryCode?: string): void;
4
+ //# sourceMappingURL=useUrlFlyTo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUrlFlyTo.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,aAAa,CAAA;AAiBrD,4GAA4G;AAC5G,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,QA4B7E"}
@@ -0,0 +1,72 @@
1
+ 'use client'
2
+
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __defProps = Object.defineProperties;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ import { useSearchParams } from "next/navigation";
24
+ import * as React from "react";
25
+ import { useBuilding } from "../../../../../hooks/buildings/buildings";
26
+ import { useSite } from "../../../../../hooks/sites/sites";
27
+ import { MapContext } from "../../../../../store";
28
+ import { searchPlace } from "../geocoding";
29
+ import { flyAndSyncUrl, writeLocationParams } from "./locationParams";
30
+ import { presentLevels } from "./locationTarget";
31
+ import { resolveLocationTarget } from "./resolveLocationTarget";
32
+ function locationFrom(previous, labels, camera) {
33
+ var _a, _b, _c, _d;
34
+ return __spreadProps(__spreadValues({}, previous), {
35
+ countrySubdivision: (_a = labels.countrySubdivision) != null ? _a : "",
36
+ municipality: (_b = labels.municipality) != null ? _b : "",
37
+ address: (_c = labels.address) != null ? _c : "",
38
+ site: (_d = labels.site) != null ? _d : previous.site,
39
+ lat: camera.lat,
40
+ lng: camera.lng,
41
+ zoom: camera.zoom,
42
+ bearing: camera.bearing,
43
+ pitch: camera.pitch
44
+ });
45
+ }
46
+ function useUrlFlyTo(map, countryCode) {
47
+ var _a;
48
+ const searchParams = useSearchParams();
49
+ const [params] = React.useState(() => new URLSearchParams(searchParams.toString()));
50
+ const levels = React.useMemo(() => presentLevels(params), [params]);
51
+ const { site, isLoading: siteLoading } = useSite(levels.includes("site") ? (_a = params.get("site")) != null ? _a : "" : "");
52
+ const { building, isLoading: buildingLoading } = useBuilding(levels.includes("buildingId") ? Number(params.get("buildingId")) : null);
53
+ const { dispatch, state } = React.useContext(MapContext);
54
+ const currentLocationRef = React.useRef(state.map.currentLocation);
55
+ currentLocationRef.current = state.map.currentLocation;
56
+ const started = React.useRef(false);
57
+ React.useEffect(() => {
58
+ if (!map || started.current || siteLoading || buildingLoading) return;
59
+ started.current = true;
60
+ void (async () => {
61
+ const resolved = await resolveLocationTarget(params, { searchPlace, site, building, countryCode });
62
+ if (!resolved) return;
63
+ const camera = resolved.level === "latlng" ? writeLocationParams(map, resolved.labels) : await flyAndSyncUrl(map, resolved.target, resolved.labels);
64
+ const previous = currentLocationRef.current;
65
+ if (previous) dispatch({ type: "UPDATE_LOCATION", payload: { currentLocation: locationFrom(previous, resolved.labels, camera) } });
66
+ })();
67
+ }, [map, siteLoading, buildingLoading, params, site, building, countryCode, dispatch]);
68
+ }
69
+ export {
70
+ useUrlFlyTo
71
+ };
72
+ //# sourceMappingURL=useUrlFlyTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../src/core/components/viewers/map/utils/urlLocation/useUrlFlyTo.ts"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { useSearchParams } from 'next/navigation'\nimport * as React from 'react'\n\nimport { useBuilding } from '../../../../../hooks/buildings/buildings'\nimport { useSite } from '../../../../../hooks/sites/sites'\nimport { MapContext } from '../../../../../store'\nimport { searchPlace } from '../geocoding'\n\nimport { flyAndSyncUrl, writeLocationParams } from './locationParams'\nimport { presentLevels } from './locationTarget'\nimport { resolveLocationTarget } from './resolveLocationTarget'\n\nimport type { CameraSnapshot, LocationLabels } from './locationParams'\nimport type { CurrentLocation } from '../../../../../types/map'\nimport type { Map as MapLibreMap } from 'maplibre-gl'\n\nfunction locationFrom(previous: CurrentLocation, labels: LocationLabels, camera: CameraSnapshot): CurrentLocation {\n return {\n ...previous,\n countrySubdivision: labels.countrySubdivision ?? '',\n municipality: labels.municipality ?? '',\n address: labels.address ?? '',\n site: labels.site ?? previous.site,\n lat: camera.lat,\n lng: camera.lng,\n zoom: camera.zoom,\n bearing: camera.bearing,\n pitch: camera.pitch,\n }\n}\n\n/** On load, flies to the finest location the URL names, then writes the full location back into the URL. */\nexport function useUrlFlyTo(map: MapLibreMap | undefined, countryCode?: string) {\n const searchParams = useSearchParams()\n const [params] = React.useState(() => new URLSearchParams(searchParams.toString()))\n const levels = React.useMemo(() => presentLevels(params), [params])\n\n const { site, isLoading: siteLoading } = useSite(levels.includes('site') ? params.get('site') ?? '' : '')\n const { building, isLoading: buildingLoading } = useBuilding(levels.includes('buildingId') ? Number(params.get('buildingId')) : null)\n\n const { dispatch, state } = React.useContext(MapContext)\n const currentLocationRef = React.useRef(state.map.currentLocation)\n currentLocationRef.current = state.map.currentLocation\n\n const started = React.useRef(false)\n\n React.useEffect(() => {\n if (!map || started.current || siteLoading || buildingLoading) return\n started.current = true\n\n void (async () => {\n const resolved = await resolveLocationTarget(params, { searchPlace, site, building, countryCode })\n if (!resolved) return\n const camera = resolved.level === 'latlng'\n ? writeLocationParams(map, resolved.labels)\n : await flyAndSyncUrl(map, resolved.target, resolved.labels)\n const previous = currentLocationRef.current\n if (previous) dispatch({ type: 'UPDATE_LOCATION', payload: { currentLocation: locationFrom(previous, resolved.labels, camera) } })\n })()\n }, [map, siteLoading, buildingLoading, params, site, building, countryCode, dispatch])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAEvB,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAE5B,SAAS,eAAe,2BAA2B;AACnD,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAMtC,SAAS,aAAa,UAA2B,QAAwB,QAAyC;AArBlH;AAsBE,SAAO,iCACF,WADE;AAAA,IAEL,qBAAoB,YAAO,uBAAP,YAA6B;AAAA,IACjD,eAAc,YAAO,iBAAP,YAAuB;AAAA,IACrC,UAAS,YAAO,YAAP,YAAkB;AAAA,IAC3B,OAAM,YAAO,SAAP,YAAe,SAAS;AAAA,IAC9B,KAAK,OAAO;AAAA,IACZ,KAAK,OAAO;AAAA,IACZ,MAAM,OAAO;AAAA,IACb,SAAS,OAAO;AAAA,IAChB,OAAO,OAAO;AAAA,EAChB;AACF;AAGO,SAAS,YAAY,KAA8B,aAAsB;AArChF;AAsCE,QAAM,eAAe,gBAAgB;AACrC,QAAM,CAAC,MAAM,IAAI,MAAM,SAAS,MAAM,IAAI,gBAAgB,aAAa,SAAS,CAAC,CAAC;AAClF,QAAM,SAAS,MA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areUrl.d.ts","sourceRoot":"","sources":["../../../src/core/hooks/useShareUrl.ts"],"names":[],"mappings":"AASA,wBAAgB,WAAW,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,CAgDnD"}
@@ -3,6 +3,7 @@
3
3
  "use client";
4
4
  import * as React from "react";
5
5
  import * as THREE from "three";
6
+ import { cameraSnapshot, labelsFromParams, toQueryString, withLocationParams } from "../components/viewers/map/utils/urlLocation/locationParams";
6
7
  import { MenusContext, MapContext, BimContext, BuildingsContext } from "../store";
7
8
  import { ViewerNames } from "../types";
8
9
  function useShareUrl() {
@@ -19,15 +20,10 @@ function useShareUrl() {
19
20
  const pathname = window.location.pathname;
20
21
  const fallback = window.location.href;
21
22
  if (currentViewer === ViewerNames.map && map) {
22
- const params = new URLSearchParams({
23
- viewer: "map",
24
- lat: map.getCenter().lat.toFixed(7),
25
- lng: map.getCenter().lng.toFixed(7),
26
- zoom: map.getZoom().toFixed(3),
27
- bearing: map.getBearing().toFixed(1),
28
- pitch: map.getPitch().toFixed(1)
29
- });
30
- return `${origin}${pathname}?${params.toString()}`;
23
+ const current = new URLSearchParams(window.location.search);
24
+ const params = withLocationParams(current, cameraSnapshot(map), labelsFromParams(current));
25
+ params.set("viewer", "map");
26
+ return `${origin}${pathname}?${toQueryString(params)}`;
31
27
  }
32
28
  if (currentViewer === ViewerNames.bim && (world == null ? void 0 : world.camera)) {
33
29
  try {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/hooks/useShareUrl.ts"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as THREE from 'three'\n\nimport { MenusContext, MapContext, BimContext, BuildingsContext } from '../store'\nimport { ViewerNames } from '../types'\n\nexport function useShareUrl(): () => Promise<string> {\n const { state: menusState } = React.useContext(MenusContext)\n const { currentViewer } = menusState.menus\n\n const { state: mapState } = React.useContext(MapContext)\n const { map } = mapState.map\n\n const { state: bimState } = React.useContext(BimContext)\n const { world } = bimState.bim\n\n const { state: buildingState } = React.useContext(BuildingsContext)\n const { building } = buildingState.buildings\n\n return React.useCallback(async (): Promise<string> => {\n const origin = window.location.origin\n const pathname = window.location.pathname\n const fallback = window.location.href\n\n if (currentViewer === ViewerNames.map && map) {\n const params = new URLSearchParams({\n viewer: 'map',\n lat: map.getCenter().lat.toFixed(7),\n lng: map.getCenter().lng.toFixed(7),\n zoom: map.getZoom().toFixed(3),\n bearing: map.getBearing().toFixed(1),\n pitch: map.getPitch().toFixed(1),\n })\n return `${origin}${pathname}?${params.toString()}`\n }\n\n if (currentViewer === ViewerNames.bim && world?.camera) {\n try {\n const pos = new THREE.Vector3()\n const tar = new THREE.Vector3()\n world.camera.controls.getPosition(pos)\n world.camera.controls.getTarget(tar)\n const params = new URLSearchParams(new URL(window.location.href).search)\n params.set('viewer', 'bim')\n params.set('camX', pos.x.toFixed(3))\n params.set('camY', pos.y.toFixed(3))\n params.set('camZ', pos.z.toFixed(3))\n params.set('tarX', tar.x.toFixed(3))\n params.set('tarY', tar.y.toFixed(3))\n params.set('tarZ', tar.z.toFixed(3))\n if (building) params.set('buildingId', String(building.id))\n return `${origin}${pathname}?${params.toString()}`\n } catch {\n return fallback\n }\n }\n\n return fallback\n }, [currentViewer, map, world, building])\n}\n"],"mappings":";AAEA,YAAY,WAAW;AACvB,YAAY,WAAW;AAEvB,SAAS,cAAc,YAAY,YAAY,wBAAwB;AACvE,SAAS,mBAAmB;AAErB,SAAS,cAAqC;AACnD,QAAM,EAAE,OAAO,WAAW,IAAI,MAAM,WAAW,YAAY;AAC3D,QAAM,EAAE,cAAc,IAAI,WAAW;AAErC,QAAM,EAAE,OAAO,SAAS,IAAI,MAAM,WAAW,UAAU;AACvD,QAAM,EAAE,IAAI,IAAI,SAAS;AAEzB,QAAM,EAAE,OAAO,SAAS,IAAI,MAAM,WAAW,UAAU;AACvD,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,QAAM,EAAE,OAAO,cAAc,IAAI,MAAM,WAAW,gBAAgB;AAClE,QAAM,EAAE,SAAS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AACnC,YAAI,SAAU,QAAO,IAAI,cAAc,OAAO,SAAS,EAAE,CAAC;AAC1D,eAAO,GAAG,MAAM,GAAG,QAAQ,IAAI,OAAO,SAAS,CAAC;AAAA,MAClD,SAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,KAAK,OAAO,QAAQ,CAAC;AAC1C;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/hooks/useShareUrl.ts"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as THREE from 'three'\n\nimport { cameraSnapshot, labelsFromParams, toQueryString, withLocationParams } from '../components/viewers/map/utils/urlLocation/locationParams'\nimport { MenusContext, MapContext, BimContext, BuildingsContext } from '../store'\nimport { ViewerNames } from '../types'\n\nexport function useShareUrl(): () => Promise<string> {\n const { state: menusState } = React.useContext(MenusContext)\n const { currentViewer } = menusState.menus\n\n const { state: mapState } = React.useContext(MapContext)\n const { map } = mapState.map\n\n const { state: bimState } = React.useContext(BimContext)\n const { world } = bimState.bim\n\n const { state: buildingState } = React.useContext(BuildingsContext)\n const { building } = buildingState.buildings\n\n return React.useCallback(async (): Promise<string> => {\n const origin = window.location.origin\n const pathname = window.location.pathname\n const fallback = window.location.href\n\n if (currentViewer === ViewerNames.map && map) {\n const current = new URLSearchParams(window.location.search)\n const params = withLocationParams(current, cameraSnapshot(map), labelsFromParams(current))\n params.set('viewer', 'map')\n return `${origin}${pathname}?${toQueryString(params)}`\n }\n\n if (currentViewer === ViewerNames.bim && world?.camera) {\n try {\n const pos = new THREE.Vector3()\n const tar = new THREE.Vector3()\n world.camera.controls.getPosition(pos)\n world.camera.controls.getTarget(tar)\n const params = new URLSearchParams(new URL(window.location.href).search)\n params.set('viewer', 'bim')\n params.set('camX', pos.x.toFixed(3))\n params.set('camY', pos.y.toFixed(3))\n params.set('camZ', pos.z.toFixed(3))\n params.set('tarX', tar.x.toFixed(3))\n params.set('tarY', tar.y.toFixed(3))\n params.set('tarZ', tar.z.toFixed(3))\n if (building) params.set('buildingId', String(building.id))\n return `${origin}${pathname}?${params.toString()}`\n } catch {\n return fallback\n }\n }\n\n return fallback\n }, [currentViewer, map, world, building])\n}\n"],"mappings":";AAEA,YAAY,WAAW;AACvB,YAAY,WAAW;AAEvB,SAAS,gBAAgB,kBAAkB,eAAe,0BAA0B;AACpF,SAAS,cAAc,YAAY,YAAY,wBAAwB;AACvE,SAAS,mBAAmB;AAErB,SAAS,cAAqC;AACnD,QAAM,EAAE,OAAO,WAAW,IAAI,MAAM,WAAW,YAAY;AAC3D,QAAM,EAAE,cAAc,IAAI,WAAW;AAErC,QAAM,EAAE,OAAO,SAAS,IAAI,MAAM,WAAW,UAAU;AACvD,QAAM,EAAE,IAAI,IAAI,SAAS;AAEzB,QAAM,EAAE,OAAO,SAAS,IAAI,MAAM,WAAW,UAAU;AACvD,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,QAAM,EAAE,OAAO,cAAc,IAAI,MAAM,WAAW,gBAAgB;AAClE,QAAM,EAAE,SAAS,IAAI,cAAc;AAEnC,SAAO,MAAM,YAAY,YAA6B;AACpD,UAAM,SAAS,OAAO,SAAS;AAC/B,UAAM,WAAW,OAAO,SAAS;AACjC,UAAM,WAAW,OAAO,SAAS;AAEjC,QAAI,kBAAkB,YAAY,OAAO,KAAK;AAC5C,YAAM,UAAU,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAC1D,YAAM,SAAS,mBAAmB,SAAS,eAAe,GAAG,GAAG,iBAAiB,OAAO,CAAC;AACzF,aAAO,IAAI,UAAU,KAAK;AAC1B,aAAO,GAAG,MAAM,GAAG,QAAQ,IAAI,cAAc,MAAM,CAAC;AAAA,IACtD;AAEA,QAAI,kBAAkB,YAAY,QAAO,+BAAO,SAAQ;AACtD,UAAI;AACF,cAAM,MAAM,IAAI,MAAM,QAAQ;AAC9B,cAAM,MAAM,IAAI,MAAM,QAAQ;AAC9B,cAAM,OAAO,SAAS,YAAY,GAAG;AACrC,cAAM,OAAO,SAAS,UAAU,GAAG;AACnC,cAAM,SAAS,IAAI,gBAAgB,IAAI,IAAI,OAAO,SAAS,IAAI,EAAE,MAAM;AACvE,eAAO,IAAI,UAAU,KAAK;AAC1B,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAO,IAAI,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,YAAI,SAAU,QAAO,IAAI,cAAc,OAAO,SAAS,EAAE,CAAC;AAC1D,eAAO,GAAG,MAAM,GAAG,QAAQ,IAAI,OAAO,SAAS,CAAC;AAAA,MAClD,SAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,KAAK,OAAO,QAAQ,CAAC;AAC1C;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collabdt/core",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "CDT Core contains all the core technology for your CDT platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -84,7 +84,7 @@
84
84
  "@thatopen/ui-obc": "~3.4.0",
85
85
  "camera-controls": ">=3.1.2",
86
86
  "framer-motion": "^12.0.0",
87
- "lucide-react": ">=0.500.0",
87
+ "lucide-react": ">=1.45.0",
88
88
  "maplibre-gl": "^6.9.0",
89
89
  "next": "^15.0.0",
90
90
  "next-auth": "^5.0.0-beta.0",
@@ -206,7 +206,7 @@
206
206
  "geojson": "^0.5.0",
207
207
  "jest": "^30.0.5",
208
208
  "jest-environment-jsdom": "^30.0.5",
209
- "lucide-react": "^0.503.0",
209
+ "lucide-react": "^1.48.0",
210
210
  "maplibre-gl": "^6.9.0",
211
211
  "next": "15.5.13",
212
212
  "next-auth": "^5.0.0-beta.29",