diff --git a/package-lock.json b/package-lock.json index 722e469a7..17fbcbd4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2596,6 +2596,8 @@ }, "node_modules/@maplibre/maplibre-gl-style-spec": { "version": "19.3.3", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.3.tgz", + "integrity": "sha512-cOZZOVhDSulgK0meTsTkmNXb1ahVvmTmWmfx9gRBwc6hq98wS9JP35ESIoNq3xqEan+UN+gn8187Z6E4NKhLsw==", "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", @@ -5394,13 +5396,6 @@ "@types/pbf": "*" } }, - "node_modules/@types/mapbox-gl": { - "version": "3.4.0", - "license": "MIT", - "dependencies": { - "@types/geojson": "*" - } - }, "node_modules/@types/mdx": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", @@ -5680,6 +5675,41 @@ "dev": true, "license": "ISC" }, + "node_modules/@vis.gl/react-mapbox": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@vis.gl/react-mapbox/-/react-mapbox-8.0.1.tgz", + "integrity": "sha512-s/OokvgK1T43Ev2/4hj21C0DKrf79nIigBCdYPtAkEX88qGLRQ5t5zCRqg5Zl+44xXfVxcVpX2/vWUKd9oYGKQ==", + "license": "MIT", + "peerDependencies": { + "mapbox-gl": ">=3.5.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + }, + "peerDependenciesMeta": { + "mapbox-gl": { + "optional": true + } + } + }, + "node_modules/@vis.gl/react-maplibre": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@vis.gl/react-maplibre/-/react-maplibre-8.0.1.tgz", + "integrity": "sha512-IFguo7DKIDZ9U9uRI4thZRfc5aTHEH4lWlIjedBeCpLeMm7wdrqtU2JshyEQt8dDO85kkEE7CbrtjMx5MplaoA==", + "license": "MIT", + "dependencies": { + "@maplibre/maplibre-gl-style-spec": "^19.2.1" + }, + "peerDependencies": { + "maplibre-gl": ">=4.0.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + }, + "peerDependenciesMeta": { + "maplibre-gl": { + "optional": true + } + } + }, "node_modules/@vitest/expect": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.5.tgz", @@ -6113,6 +6143,8 @@ }, "node_modules/arr-union": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6371,6 +6403,8 @@ }, "node_modules/assign-symbols": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6652,6 +6686,8 @@ }, "node_modules/bytewise": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", "license": "MIT", "dependencies": { "bytewise-core": "^1.2.2", @@ -6660,6 +6696,8 @@ }, "node_modules/bytewise-core": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", "license": "MIT", "dependencies": { "typewise-core": "^1.2" @@ -9211,6 +9249,8 @@ }, "node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" @@ -9861,6 +9901,8 @@ }, "node_modules/get-value": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10709,6 +10751,8 @@ }, "node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11344,6 +11388,8 @@ }, "node_modules/json-stringify-pretty-compact": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==", "license": "MIT" }, "node_modules/json-stringify-safe": { @@ -15467,17 +15513,17 @@ "dev": true }, "node_modules/react-map-gl": { - "version": "7.1.9", - "resolved": "https://registry.npmjs.org/react-map-gl/-/react-map-gl-7.1.9.tgz", - "integrity": "sha512-KsCc8Gyn05wVGlHZoopaiiCr0RCAQ6LDISo5sEy1/pV/d7RlozkF946tiX7IgyijJQMRujHol5QdwUPESjh73w==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/react-map-gl/-/react-map-gl-8.0.1.tgz", + "integrity": "sha512-VQjLcZdtyJCPXxy5xVL2QIgfA+YG3v+PzSdt07WWbVmXFhV4wUuy6DZSQYDdfqVH2BujKo/ImdL5zfEJApRnpg==", "license": "MIT", "dependencies": { - "@maplibre/maplibre-gl-style-spec": "^19.2.1", - "@types/mapbox-gl": ">=1.0.0" + "@vis.gl/react-mapbox": "8.0.1", + "@vis.gl/react-maplibre": "8.0.1" }, "peerDependencies": { "mapbox-gl": ">=1.13.0", - "maplibre-gl": ">=1.13.0 <5.0.0", + "maplibre-gl": ">=1.13.0", "react": ">=16.3.0", "react-dom": ">=16.3.0" }, @@ -16310,6 +16356,8 @@ }, "node_modules/set-value": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", @@ -16323,6 +16371,8 @@ }, "node_modules/set-value/node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -16510,6 +16560,8 @@ }, "node_modules/sort-asc": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16517,6 +16569,8 @@ }, "node_modules/sort-desc": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16536,6 +16590,8 @@ }, "node_modules/sort-object": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", "license": "MIT", "dependencies": { "bytewise": "^1.1.0", @@ -16625,6 +16681,8 @@ }, "node_modules/split-string": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "license": "MIT", "dependencies": { "extend-shallow": "^3.0.0" @@ -16635,6 +16693,8 @@ }, "node_modules/split-string/node_modules/extend-shallow": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "license": "MIT", "dependencies": { "assign-symbols": "^1.0.0", @@ -16646,6 +16706,8 @@ }, "node_modules/split-string/node_modules/is-extendable": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4" @@ -16656,6 +16718,8 @@ }, "node_modules/split-string/node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -17721,6 +17785,8 @@ }, "node_modules/typewise": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", "license": "MIT", "dependencies": { "typewise-core": "^1.2.0" @@ -17728,6 +17794,8 @@ }, "node_modules/typewise-core": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==", "license": "MIT" }, "node_modules/uglify-js": { @@ -17778,6 +17846,8 @@ }, "node_modules/union-value": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "license": "MIT", "dependencies": { "arr-union": "^3.1.0", @@ -18896,7 +18966,7 @@ "@turf/transform-translate": "^7.1.0", "lodash": "^4.17.21", "maplibre-gl": "^4.7.1", - "react-map-gl": "^7.1.7" + "react-map-gl": "^8.0.1" }, "peerDependencies": { "react": ">=18.0", diff --git a/ui-warped-map/package.json b/ui-warped-map/package.json index 0e2991958..4370dd04b 100644 --- a/ui-warped-map/package.json +++ b/ui-warped-map/package.json @@ -61,7 +61,7 @@ "@turf/transform-translate": "^7.1.0", "lodash": "^4.17.21", "maplibre-gl": "^4.7.1", - "react-map-gl": "^7.1.7" + "react-map-gl": "^8.0.1" }, "peerDependencies": { "react": ">=18.0", diff --git a/ui-warped-map/src/components/BaseMap.tsx b/ui-warped-map/src/components/BaseMap.tsx index a39dc85a4..88c2845a5 100644 --- a/ui-warped-map/src/components/BaseMap.tsx +++ b/ui-warped-map/src/components/BaseMap.tsx @@ -1,9 +1,9 @@ import React, { type PropsWithChildren, useEffect, useMemo, useState } from 'react'; -import { type StyleSpecification } from '@maplibre/maplibre-gl-style-spec'; import { bbox } from '@turf/bbox'; import { featureCollection } from '@turf/helpers'; import type { Feature, LineString } from 'geojson'; +import { type StyleSpecification } from 'maplibre-gl'; import ReactMapGL, { Layer, type LayerProps, type MapRef, Source } from 'react-map-gl/maplibre'; import { bboxAs2D } from '../core/helpers'; diff --git a/ui-warped-map/src/components/DataLoader.tsx b/ui-warped-map/src/components/DataLoader.tsx index 2cb7cb1f3..3f0fe6364 100644 --- a/ui-warped-map/src/components/DataLoader.tsx +++ b/ui-warped-map/src/components/DataLoader.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react'; -import { type StyleSpecification } from '@maplibre/maplibre-gl-style-spec'; import { featureCollection } from '@turf/helpers'; import type { Feature, FeatureCollection } from 'geojson'; +import { type StyleSpecification } from 'maplibre-gl'; import { createPortal } from 'react-dom'; import ReactMapGL, { Layer, type LayerProps, type MapRef, Source } from 'react-map-gl/maplibre'; diff --git a/ui-warped-map/src/components/TransformedDataMap.tsx b/ui-warped-map/src/components/TransformedDataMap.tsx index a4e3ee193..562b23e0e 100644 --- a/ui-warped-map/src/components/TransformedDataMap.tsx +++ b/ui-warped-map/src/components/TransformedDataMap.tsx @@ -1,13 +1,13 @@ import React, { type PropsWithChildren, useEffect, useMemo, useState } from 'react'; -import { type StyleSpecification } from '@maplibre/maplibre-gl-style-spec'; import { featureCollection } from '@turf/helpers'; import type { Feature, FeatureCollection, LineString } from 'geojson'; import { omit } from 'lodash'; +import { type StyleSpecification } from 'maplibre-gl'; import ReactMapGL, { Layer, type LayerProps, - type LineLayer, + type LineLayerSpecification, type MapRef, Source, } from 'react-map-gl/maplibre'; @@ -21,7 +21,7 @@ type TransformedDataMapProps = { sources: SourceDefinition[]; transformedData: Record; path?: Feature; - pathLayer?: Omit; + pathLayer?: Omit; log?: boolean; }; diff --git a/ui-warped-map/src/components/WarpedMap.tsx b/ui-warped-map/src/components/WarpedMap.tsx index 6d5b42e40..d316e79d6 100644 --- a/ui-warped-map/src/components/WarpedMap.tsx +++ b/ui-warped-map/src/components/WarpedMap.tsx @@ -1,10 +1,10 @@ import React, { type ComponentType, type PropsWithChildren, useEffect, useState } from 'react'; -import { type StyleSpecification } from '@maplibre/maplibre-gl-style-spec'; import { bbox } from '@turf/bbox'; import type { Feature, FeatureCollection, LineString } from 'geojson'; import { isNil, mapValues, omitBy } from 'lodash'; -import { type LineLayer } from 'react-map-gl/maplibre'; +import { type StyleSpecification } from 'maplibre-gl'; +import { type LineLayerSpecification } from 'react-map-gl/maplibre'; import DataLoader from './DataLoader'; import Loader from './Loader'; @@ -30,7 +30,7 @@ const DEFAULT_COMPONENTS: Components = { type WarpedMapProps = { path: Feature; - pathLayer?: Omit; + pathLayer?: Omit; sources: SourceDefinition[]; components?: Partial; mapStyle?: string | StyleSpecification; diff --git a/ui-warped-map/src/stories/Algorithms.tsx b/ui-warped-map/src/stories/Algorithms.tsx index 5df47eb6e..0b85df5da 100644 --- a/ui-warped-map/src/stories/Algorithms.tsx +++ b/ui-warped-map/src/stories/Algorithms.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import { featureCollection } from '@turf/helpers'; import type { Feature, LineString } from 'geojson'; -import { Layer, type LineLayer, Source } from 'react-map-gl/maplibre'; +import { Layer, type LineLayerSpecification, Source } from 'react-map-gl/maplibre'; import { OSM_BASE_MAP_STYLE, OSM_SOURCE } from './helpers'; import BaseMap from '../components/BaseMap'; @@ -14,7 +14,7 @@ import { useAsyncMemo } from '../core/useAsyncMemo'; const SOURCES: SourceDefinition[] = [OSM_SOURCE]; -const PATH_LAYER: Omit = { +const PATH_LAYER: Omit = { id: 'path-layer', source: 'path', type: 'line', diff --git a/ui-warped-map/src/stories/SampleMap.tsx b/ui-warped-map/src/stories/SampleMap.tsx index f90ff05d9..3756ec28d 100644 --- a/ui-warped-map/src/stories/SampleMap.tsx +++ b/ui-warped-map/src/stories/SampleMap.tsx @@ -3,7 +3,7 @@ import React, { useMemo } from 'react'; import { featureCollection } from '@turf/helpers'; import type { Feature, LineString } from 'geojson'; import 'maplibre-gl/dist/maplibre-gl.css'; -import { Layer, type LineLayer, Source } from 'react-map-gl/maplibre'; +import { Layer, type LineLayerSpecification, Source } from 'react-map-gl/maplibre'; import { OSM_BASE_MAP_STYLE, OSM_SOURCE } from './helpers'; import BaseMap from '../components/BaseMap'; @@ -14,7 +14,7 @@ import { useAsyncMemo } from '../core/useAsyncMemo'; const SOURCES: SourceDefinition[] = [OSM_SOURCE]; -const PATH_LAYER: Omit = { +const PATH_LAYER: Omit = { id: 'path-layer', source: 'path', type: 'line', diff --git a/ui-warped-map/src/stories/helpers.ts b/ui-warped-map/src/stories/helpers.ts index 63ace215d..0d39ca257 100644 --- a/ui-warped-map/src/stories/helpers.ts +++ b/ui-warped-map/src/stories/helpers.ts @@ -1,4 +1,4 @@ -import { type StyleSpecification } from '@maplibre/maplibre-gl-style-spec'; +import { type StyleSpecification } from 'maplibre-gl'; import { type LayerProps } from 'react-map-gl'; import { type SourceDefinition } from '../core/types';