Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
4ab0e88347 chore(deps): Bump react from 19.2.0 to 19.2.3
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 19.2.0 to 19.2.3.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.3/packages/react)

---
updated-dependencies:
- dependency-name: react
  dependency-version: 19.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-12 17:10:48 +00:00
15 changed files with 385 additions and 691 deletions

View File

@@ -21,9 +21,9 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: '.nvmrc'
- run: npm ci
@@ -41,9 +41,9 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: '.nvmrc'
- run: npm ci
@@ -90,12 +90,12 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- run: npm ci
- run: npm run test-unit-ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
files: ${{ github.workspace }}/coverage/coverage-final.json
verbose: true
@@ -108,7 +108,7 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- run: npm ci
- name: Cypress run
@@ -118,7 +118,7 @@ jobs:
start: npm run start
browser: chrome
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
files: ${{ github.workspace }}/.nyc_output/out.json
verbose: true
@@ -129,7 +129,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- run: npm ci
- name: Cypress run
@@ -139,7 +139,7 @@ jobs:
start: docker run --rm --network host maputnik --port=8888
browser: chrome
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
files: ${{ github.workspace }}/.nyc_output/out.json
verbose: true

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -16,13 +16,13 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
ref: main
- name: Use Node.js from nvmrc
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"

View File

@@ -12,11 +12,11 @@ jobs:
contents: write
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
- name: Use Node.js from nvmrc
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: '.nvmrc'
@@ -50,6 +50,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- run: docker build -t ghcr.io/maplibre/maputnik:main .
- run: docker push ghcr.io/maplibre/maputnik:main

View File

@@ -15,14 +15,14 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
ref: main
persist-credentials: false
- name: Use Node.js from nvmrc
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
@@ -42,13 +42,13 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
ref: main
- name: Use Node.js from nvmrc
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"

View File

@@ -12,7 +12,6 @@
- Upgraded codemirror from version 5 to version 6
- Add code editor to allow editing the entire style
- Add support for sprite object in setting modal
- Set the correct map view when opening a new style on an empty map
- Allow root-relative urls in the stylefile
- _...Add new stuff here..._

View File

@@ -22,21 +22,6 @@ describe("map", () => {
"Zoom: " + (zoomLevel + 1)
);
});
it("via style file definition", () => {
when.setStyle("zoom_7_center_0_51");
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldContainText(
"Zoom: " + (7)
);
then(get.locationHash().should("contain", "#7/51/0"));
// opening another stylefile does not update the map view again
// as discussed in https://github.com/maplibre/maputnik/issues/1546
when.openASecondStyleWithDifferentZoomAndCenter();
then(get.locationHash().should("contain", "#7/51/0"));
});
});
describe("search", () => {
@@ -48,7 +33,6 @@ describe("map", () => {
describe("popup", () => {
beforeEach(() => {
when.setStyle("rectangles");
then(get.locationHash().should("exist"));
});
it("should open on feature click", () => {
when.clickCenter("maplibre:map");

View File

@@ -10,7 +10,6 @@ export default class MaputnikCypressHelper {
};
public get = {
locationHash: (): Cypress.Chainable<string> => cy.location("hash"),
...this.helper.get,
};

View File

@@ -92,20 +92,6 @@ export class MaputnikDriver {
fixture: "example-style-with-fonts.json",
},
});
this.helper.given.interceptAndMockResponse({
method: "GET",
url: baseUrl + "example-style-with-zoom-7-and-center-0-51.json",
response: {
fixture: "example-style-with-zoom-7-and-center-0-51.json",
},
});
this.helper.given.interceptAndMockResponse({
method: "GET",
url: baseUrl + "example-style-with-zoom-5-and-center-50-50.json",
response: {
fixture: "example-style-with-zoom-5-and-center-50-50.json",
},
});
this.helper.given.interceptAndMockResponse({
method: "GET",
url: "*example.local/*",
@@ -134,20 +120,13 @@ export class MaputnikDriver {
waitForExampleFileResponse: () => {
this.helper.when.waitForResponse("example-style.json");
},
openASecondStyleWithDifferentZoomAndCenter: () => {
cy.contains("button", "Open").click();
cy.get('[data-wd-key="modal:open.url.input"]')
.should("be.enabled")
.clear()
.type("http://localhost:8888/example-style-with-zoom-5-and-center-50-50.json{enter}");
},
chooseExampleFile: () => {
this.helper.given.fixture("example-style.json", "example-style.json");
this.helper.when.openFileByFixture("example-style.json", "modal:open.file.button", "modal:open.file.input");
this.helper.when.wait(200);
},
setStyle: (
styleProperties: "geojson" | "raster" | "both" | "layer" | "rectangles" | "font" | "zoom_7_center_0_51" | "",
styleProperties: "geojson" | "raster" | "both" | "layer" | "rectangles" | "font" | "",
zoom?: number
) => {
const url = new URL(baseUrl);
@@ -170,9 +149,6 @@ export class MaputnikDriver {
case "font":
url.searchParams.set("style", baseUrl + "example-style-with-fonts.json");
break;
case "zoom_7_center_0_51":
url.searchParams.set("style", baseUrl + "example-style-with-zoom-7-and-center-0-51.json");
break;
}
if (zoom) {

View File

@@ -1,19 +0,0 @@
{
"id": "test-style",
"center": [50,50],
"zoom": 5,
"version": 8,
"name": "Test Style",
"sources": {
"rectangles": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": []
}
}
},
"glyphs": "https://example.local/fonts/{fontstack}/{range}.pbf",
"sprites": "https://example.local/fonts/{fontstack}/{range}.pbf",
"layers": []
}

View File

@@ -1,17 +0,0 @@
{
"id": "test-style",
"center": [0,51],
"zoom": 7,
"version": 8,
"name": "Test Style",
"sources": {
"rectangles": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": []
}
}
},
"layers": []
}

875
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -28,9 +28,9 @@
"dependencies": {
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lint": "^6.9.2",
"@codemirror/state": "^6.5.4",
"@codemirror/state": "^6.5.2",
"@codemirror/theme-one-dark": "^6.1.3",
"@codemirror/view": "^6.39.11",
"@codemirror/view": "^6.39.6",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
@@ -44,15 +44,15 @@
"codemirror": "^6.0.2",
"color": "^5.0.3",
"detect-browser": "^5.3.0",
"downshift": "^9.0.13",
"downshift": "^9.0.12",
"events": "^3.3.0",
"file-saver": "^2.0.5",
"i18next": "^25.7.4",
"i18next": "^25.7.2",
"i18next-browser-languagedetector": "^8.2.0",
"i18next-resources-to-backend": "^1.2.1",
"json-stringify-pretty-compact": "^4.0.0",
"json-to-ast": "^2.1.0",
"lodash": "^4.17.23",
"lodash": "^4.17.21",
"lodash.capitalize": "^4.2.1",
"lodash.clamp": "^4.0.3",
"lodash.clonedeep": "^4.5.0",
@@ -63,16 +63,16 @@
"maputnik-design": "github:maputnik/design#172b06c",
"ol": "^10.7.0",
"ol-mapbox-style": "^13.2.0",
"pmtiles": "^4.3.2",
"pmtiles": "^4.3.0",
"prop-types": "^15.8.1",
"react": "^19.2.0",
"react": "^19.2.3",
"react-accessible-accordion": "^5.0.1",
"react-aria-menubutton": "^7.0.3",
"react-aria-modal": "^5.0.2",
"react-collapse": "^5.1.1",
"react-color": "^2.19.3",
"react-dom": "^19.2.0",
"react-i18next": "^16.5.3",
"react-i18next": "^16.3.5",
"react-icons": "^5.5.0",
"react-markdown": "^10.1.0",
"reconnecting-websocket": "^4.4.0",
@@ -126,28 +126,28 @@
"@types/string-hash": "^1.1.3",
"@types/wicg-file-system-access": "^2023.10.7",
"@vitejs/plugin-react": "^5.1.2",
"@vitest/coverage-v8": "^4.0.17",
"@vitest/coverage-v8": "^4.0.16",
"cors": "^2.8.5",
"cypress": "^15.9.0",
"cypress": "^15.8.2",
"cypress-plugin-tab": "^1.0.5",
"eslint": "^9.39.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.26",
"eslint-plugin-react-refresh": "^0.4.23",
"i18next-parser": "^9.3.0",
"istanbul": "^0.4.5",
"istanbul-lib-coverage": "^3.2.2",
"postcss": "^8.5.6",
"react-hot-loader": "^4.13.1",
"sass": "^1.97.2",
"stylelint": "^17.0.0",
"stylelint-config-recommended-scss": "^17.0.0",
"stylelint-scss": "^7.0.0",
"stylelint": "^16.26.1",
"stylelint-config-recommended-scss": "^16.0.2",
"stylelint-scss": "^6.13.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.53.0",
"typescript-eslint": "^8.50.1",
"uuid": "^13.0.0",
"vite": "^7.3.0",
"vite-plugin-istanbul": "^7.2.1",
"vitest": "^4.0.17"
"vitest": "^4.0.16"
}
}

View File

@@ -99,7 +99,6 @@ type AppState = {
lng: number,
lat: number,
},
_from: "map" | "app"
},
maplibreGlDebugOptions: Partial<MapOptions> & {
showTileBoundaries: boolean,
@@ -149,7 +148,6 @@ export default class App extends React.Component<any, AppState> {
lng: 0,
lat: 0,
},
_from: "app"
},
isOpen: {
settings: false,
@@ -337,13 +335,6 @@ export default class App extends React.Component<any, AppState> {
...opts,
};
// Detect empty style
const oldStyle = this.state.mapStyle;
const isEmptySources = !oldStyle.sources || Object.keys(oldStyle.sources).length === 0;
const isEmptyLayers = !oldStyle.layers || oldStyle.layers.length === 0;
const isEmptyStyle = isEmptySources && isEmptyLayers;
// For the style object, find the urls that has "{key}" and insert the correct API keys
// Without this, going from e.g. MapTiler to OpenLayers and back will lose the maptlier key.
@@ -475,25 +466,15 @@ export default class App extends React.Component<any, AppState> {
this.saveStyle(newStyle);
}
const zoom = newStyle?.zoom;
const center = newStyle?.center;
this.setState({
mapStyle: newStyle,
dirtyMapStyle: dirtyMapStyle,
mapView: isEmptyStyle && zoom && center ? {
zoom: zoom,
center: {
lng: center[0],
lat: center[1],
},
_from: "app"
} : this.state.mapView,
errors: mappedErrors,
}, () => {
this.fetchSources();
this.setStateInUrl();
});
};
onUndo = () => {
@@ -684,7 +665,6 @@ export default class App extends React.Component<any, AppState> {
lng: number,
lat: number,
},
_from: "map" | "app"
}) => {
this.setState({
mapView,
@@ -696,7 +676,6 @@ export default class App extends React.Component<any, AppState> {
const mapProps = {
mapStyle: (dirtyMapStyle || mapStyle),
mapView: this.state.mapView,
replaceAccessTokens: (mapStyle: StyleSpecification) => {
return style.replaceAccessTokens(mapStyle, {
allowFallback: true

View File

@@ -52,14 +52,6 @@ type MapMaplibreGlInternalProps = {
onDataChange?(event: {map: Map | null}): unknown
onLayerSelect(index: number): void
mapStyle: StyleSpecification
mapView: {
zoom: number,
center: {
lng: number,
lat: number,
},
_from: "map" | "app"
};
inspectModeEnabled: boolean
highlightedLayer?: HighlightedLayer
options?: Partial<MapOptions> & {
@@ -68,7 +60,7 @@ type MapMaplibreGlInternalProps = {
showOverdrawInspector?: boolean
}
replaceAccessTokens(mapStyle: StyleSpecification): StyleSpecification
onChange(value: {center: LngLat, zoom: number, _from: "map" | "app"}): unknown
onChange(value: {center: LngLat, zoom: number}): unknown
} & WithTranslation;
type MapMaplibreGlState = {
@@ -125,11 +117,6 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
map.showTileBoundaries = this.props.options?.showTileBoundaries!;
map.showCollisionBoxes = this.props.options?.showCollisionBoxes!;
map.showOverdrawInspector = this.props.options?.showOverdrawInspector!;
// set the map view when the prop was updated from outside
if (this.props.mapView._from === "app") {
map.jumpTo(this.props.mapView);
}
}
if(this.state.inspect && this.props.inspectModeEnabled !== this.state.inspect._showInspectMap) {
@@ -152,15 +139,6 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
style: this.props.mapStyle,
hash: true,
maxZoom: 24,
// make root relative urls in stylefiles work as maplibre gl js does
// not support this for everything:
// https://github.com/maplibre/maplibre-gl-js/issues/6818
transformRequest: (url) => {
if (url.startsWith("/")) {
url = `${window.location.origin}${url}`;
}
return { url };
},
// setting to always load glyphs of CJK fonts from server
// https://maplibre.org/maplibre-gl-js/docs/examples/local-ideographs/
localIdeographFontFamily: false
@@ -173,7 +151,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
const mapViewChange = () => {
const center = map.getCenter();
const zoom = map.getZoom();
this.props.onChange({center, zoom, _from: "map"});
this.props.onChange({center, zoom});
};
mapViewChange();