mirror of
https://github.com/maputnik/editor.git
synced 2026-09-12 07:17:26 +00:00
Compare commits
2 Commits
f59e481280
...
5c1c3fd8cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c1c3fd8cb | |||
| 4424276073 |
@@ -2,9 +2,13 @@
|
||||
|
||||
### ✨ Features and improvements
|
||||
- Replace Cypress with Playwright for end-to-end tests and Vitest browser mode (Playwright provider) for component tests; drop the `@shellygo/cypress-test-utils` helper in favour of a `MaputnikDriver` page object
|
||||
- Upgrade to MapLibre GL JS 6 and Vite 8, and update the remaining dependencies
|
||||
- Serve the RTL text plugin from `@mapbox/mapbox-gl-rtl-text` instead of a pinned CDN URL, so its version is tracked in `package.json`
|
||||
- Exported HTML now loads MapLibre GL JS as an ES module, since v6 no longer ships a UMD bundle
|
||||
- _...Add new stuff here..._
|
||||
|
||||
### 🐞 Bug fixes
|
||||
- The map's data listener now fires on tile loads again, so source and vector layer field autocompletion is populated
|
||||
- _...Add new stuff here..._
|
||||
|
||||
## 3.1.0
|
||||
|
||||
@@ -14,6 +14,7 @@ export default defineConfig({
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
ignores: [
|
||||
"dist/**/*",
|
||||
"public/**/*",
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2024,
|
||||
|
||||
Generated
+939
-1405
File diff suppressed because it is too large
Load Diff
+19
-18
@@ -5,10 +5,11 @@
|
||||
"type": "module",
|
||||
"main": "''",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "tsc && vite build --mode=production",
|
||||
"build-desktop": "tsc && vite build --mode=desktop && cd desktop && make",
|
||||
"build-linux": "tsc && vite build --mode=desktop && cd desktop && make bin/linux/maputnik",
|
||||
"copy-rtl-text-plugin": "mkdir -p public && cp -p node_modules/@mapbox/mapbox-gl-rtl-text/dist/mapbox-gl-rtl-text.js public/",
|
||||
"start": "npm run copy-rtl-text-plugin && vite",
|
||||
"build": "npm run copy-rtl-text-plugin && tsc && vite build --mode=production",
|
||||
"build-desktop": "npm run copy-rtl-text-plugin && tsc && vite build --mode=desktop && cd desktop && make",
|
||||
"build-linux": "npm run copy-rtl-text-plugin && tsc && vite build --mode=desktop && cd desktop && make bin/linux/maputnik",
|
||||
"i18n:extract": "npx i18next-cli extract",
|
||||
"lint": "eslint",
|
||||
"test": "playwright test",
|
||||
@@ -30,7 +31,7 @@
|
||||
"@codemirror/lint": "^6.9.7",
|
||||
"@codemirror/state": "^6.7.1",
|
||||
"@codemirror/theme-one-dark": "^6.1.3",
|
||||
"@codemirror/view": "^6.43.8",
|
||||
"@codemirror/view": "^6.43.9",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
@@ -59,20 +60,20 @@
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.isequal": "^4.5.0",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"maplibre-gl": "^5.24.0",
|
||||
"maplibre-gl": "^6.4.1",
|
||||
"maputnik-design": "github:maputnik/design#172b06c",
|
||||
"ol": "^10.10.0",
|
||||
"ol-mapbox-style": "^13.4.2",
|
||||
"pmtiles": "^4.5.0",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^19.2.7",
|
||||
"react": "^19.2.8",
|
||||
"react-accessible-accordion": "^5.0.1",
|
||||
"react-aria-menubutton": "^8.0.0",
|
||||
"react-aria-modal": "^5.0.2",
|
||||
"react-collapse": "^5.1.1",
|
||||
"react-color": "^2.19.3",
|
||||
"react-dom": "^19.2.7",
|
||||
"react-i18next": "^17.0.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-i18next": "^17.0.11",
|
||||
"react-icons": "^5.7.0",
|
||||
"react-markdown": "^10.1.0",
|
||||
"reconnecting-websocket": "^4.4.0",
|
||||
@@ -115,22 +116,22 @@
|
||||
"@types/lodash.isequal": "^4.5.8",
|
||||
"@types/lodash.throttle": "^4.1.9",
|
||||
"@types/randomcolor": "^0.5.9",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-aria-menubutton": "^6.2.14",
|
||||
"@types/react-aria-modal": "^5.0.0",
|
||||
"@types/react-collapse": "^5.0.4",
|
||||
"@types/react-color": "^3.0.13",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/react-dom": "^19.2.4",
|
||||
"@types/string-hash": "^1.1.3",
|
||||
"@types/wicg-file-system-access": "^2023.10.7",
|
||||
"@vitejs/plugin-react": "5.2",
|
||||
"@vitest/coverage-v8": "^4.1.10",
|
||||
"@vitejs/plugin-react": "^6.0.5",
|
||||
"@vitest/coverage-v8": "^4.1.11",
|
||||
"cors": "^2.8.6",
|
||||
"eslint": "^10.8.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
"i18next-cli": "^1.69.0",
|
||||
"eslint-plugin-react-refresh": "^0.5.4",
|
||||
"i18next-cli": "^1.71.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"istanbul-lib-coverage": "^3.2.2",
|
||||
"nyc": "^18.0.0",
|
||||
@@ -142,9 +143,9 @@
|
||||
"stylelint-scss": "^7.2.0",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.67.0",
|
||||
"uuid": "^14.0.1",
|
||||
"vite": "^7.3.2",
|
||||
"uuid": "^14.0.2",
|
||||
"vite": "^8.2.1",
|
||||
"vite-plugin-istanbul": "^9.0.1",
|
||||
"vitest": "^4.1.10"
|
||||
"vitest": "^4.1.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import Color from "color";
|
||||
import ChromePicker from "react-color/lib/components/chrome/Chrome";
|
||||
import {type ColorResult} from "react-color";
|
||||
import {ChromePicker, type ColorResult} from "react-color";
|
||||
import lodash from "lodash";
|
||||
|
||||
function formatColor(color: ColorResult): string {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import {createRoot} from "react-dom/client";
|
||||
import MapLibreGl, {type LayerSpecification, type LngLat, type Map, type MapOptions, type SourceSpecification, type StyleSpecification} from "maplibre-gl";
|
||||
import * as MapLibreGl from "maplibre-gl";
|
||||
import {type LayerSpecification, type LngLat, type Map, type MapOptions, type SourceSpecification, type StyleSpecification} from "maplibre-gl";
|
||||
import MaplibreInspect from "@maplibre/maplibre-gl-inspect";
|
||||
import colors from "@maplibre/maplibre-gl-inspect/lib/colors";
|
||||
import { FeatureLayerPopup as MapMaplibreGlLayerPopup } from "./MapMaplibreGlLayerPopup";
|
||||
@@ -10,7 +11,7 @@ import { ZoomControl } from "../libs/zoomcontrol";
|
||||
import { type HighlightedLayer, colorHighlightedLayer } from "../libs/highlight";
|
||||
import "maplibre-gl/dist/maplibre-gl.css";
|
||||
import "../maplibregl.css";
|
||||
import "../libs/maplibre-rtl";
|
||||
import "../libs/maplibre-init";
|
||||
import MaplibreGeocoder, { type MaplibreGeocoderApi, type MaplibreGeocoderApiConfig } from "@maplibre/maplibre-gl-geocoder";
|
||||
import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
|
||||
import { withTranslation, type WithTranslation } from "react-i18next";
|
||||
@@ -238,7 +239,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
||||
});
|
||||
|
||||
map.on("data", e => {
|
||||
if(e.dataType !== "tile") return;
|
||||
if(e.dataType !== "source" || !e.tile) return;
|
||||
this.props.onDataChange!({
|
||||
map: this.state.map
|
||||
});
|
||||
|
||||
@@ -59,7 +59,6 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
|
||||
<meta charset="utf-8" />
|
||||
<title>${htmlTitle}</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<script src="https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.js"></script>
|
||||
<link href="https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
@@ -68,8 +67,9 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
const map = new maplibregl.Map({
|
||||
<script type="module">
|
||||
import {Map} from 'https://unpkg.com/maplibre-gl@${MAPLIBRE_GL_VERSION}/dist/maplibre-gl.mjs';
|
||||
const map = new Map({
|
||||
container: 'map',
|
||||
style: ${tokenStyle},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { setRTLTextPlugin, setWorkerUrl } from "maplibre-gl";
|
||||
import workerUrl from "maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url";
|
||||
|
||||
setWorkerUrl(workerUrl);
|
||||
setRTLTextPlugin(`${import.meta.env.BASE_URL}mapbox-gl-rtl-text.js`, false);
|
||||
@@ -1,3 +0,0 @@
|
||||
import MapLibreGl from "maplibre-gl";
|
||||
|
||||
MapLibreGl.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js", false);
|
||||
@@ -32,8 +32,6 @@ export class ZoomControl {
|
||||
|
||||
addEventListeners (){
|
||||
this._map!.on("render", () => this.updateZoomLevel());
|
||||
this._map!.on("zoomIn", () => this.updateZoomLevel());
|
||||
this._map!.on("zoomOut", () => this.updateZoomLevel());
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
|
||||
// SPACE HELPER
|
||||
.maputnik-space {
|
||||
@include mixins.vendor-prefix(flex-grow, 1);
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
// MESSAGE PANEL
|
||||
|
||||
@@ -101,8 +101,7 @@
|
||||
.maputnik-select {
|
||||
@extend .maputnik-input !optional; /* stylelint-disable-line */
|
||||
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: vars.$color-gray url("#{vars.$icon-down-arrow}") right center no-repeat;
|
||||
color: vars.$color-white;
|
||||
background-position: calc(100% - 2px) center;
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
line-height: 1.3;
|
||||
max-height: 50px;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 600ms, visibility 600ms;
|
||||
transition: opacity 600ms, visibility 600ms;
|
||||
|
||||
&:focus-within {
|
||||
|
||||
+2
-14
@@ -1,21 +1,9 @@
|
||||
@mixin vendor-prefix($name, $argument) {
|
||||
-webkit-#{$name}: #{$argument};
|
||||
-ms-#{$name}: #{$argument};
|
||||
-moz-#{$name}: #{$argument};
|
||||
-o-#{$name}: #{$argument};
|
||||
#{$name}: #{$argument};
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
display: -ms-flexbox;
|
||||
|
||||
@include vendor-prefix(flex-direction, row);
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
display: -ms-flexbox;
|
||||
|
||||
@include vendor-prefix(flex-direction, column);
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 6px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
background-color: #666;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"types": ["geojson", "@types/wicg-file-system-access", "node"],
|
||||
"types": ["geojson", "@types/wicg-file-system-access", "node", "vite/client"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
|
||||
+8
-2
@@ -7,7 +7,10 @@ export default defineConfig(({ mode }) => ({
|
||||
port: 8888,
|
||||
},
|
||||
build: {
|
||||
sourcemap: true
|
||||
sourcemap: true,
|
||||
rolldownOptions: {
|
||||
checks: { invalidAnnotation: false },
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
@@ -17,8 +20,11 @@ export default defineConfig(({ mode }) => ({
|
||||
forceBuildInstrument: true, // Instrument the source so e2e runs can collect coverage
|
||||
}),
|
||||
],
|
||||
optimizeDeps: {
|
||||
exclude: ["maplibre-gl/dist/maplibre-gl-worker.mjs"],
|
||||
},
|
||||
base: mode === "desktop" ? "/" : "/maputnik/",
|
||||
define: {
|
||||
global: "window"
|
||||
global: "globalThis"
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user