@masterportal/masterportalapi 2.50.0 → 2.51.1

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/CHANGELOG.md CHANGED
@@ -3,18 +3,29 @@
3
3
 
4
4
  The [Semantic Versioning](https://semver.org/spec/v2.0.0.html) is used.
5
5
 
6
- ## Unreleased - in development
7
- ### __Breaking Changes__
8
-
9
- ### Added
6
+ ## 2.51.1 (LTS) - 2026-06-12
10
7
 
11
- ### Changed
8
+ ### Fixed
9
+ - VectorStyle: Fixed styling of polygons: `"zig-line-horizontal"` and `"diagonal-right"` are rotated by 90°.
12
10
 
13
- ### Deprecated
11
+ ## 2.51.0 - 2025-09-18
14
12
 
15
- ### Removed
13
+ ### __Breaking Changes__
14
+ - Dropped support for **Node.js 18.x**, **20.x** and **npm 9**. Minimum required is now **Node.js 22.19.0 (LTS)** with **npm 10.x**.
16
15
 
17
- ### Fixed
16
+ ### Changed
17
+ - cesium/engine updated to current Version 20.0.1
18
+ - The following packages have been updated:
19
+ - devDependencies:
20
+ - @parcel: ^2.13.0 to ^2.15.4
21
+ - @swc/jest: ^0.2.29 to ^0.2.39
22
+ - canvas: ^2.11.2 to ^3.1.2
23
+ - jest: ^29.7.0 to ^30.0.5
24
+ - jest-environment-jsdom: ^29.7.0 to ^30.0.5
25
+ - transformer-sass: ^2.13.0 to ^2.15.4
26
+ - the following package has been added:
27
+ - devDependencies:
28
+ - @parcel/config-default": "^2.15.4"
18
29
 
19
30
  ---
20
31
 
@@ -1,4 +1,4 @@
1
- image: node:20.12.2
1
+ image: node:22.19.0
2
2
 
3
3
  clone:
4
4
  depth: 5000 # include the last five hundred commits
package/package.json CHANGED
@@ -1,74 +1,86 @@
1
- {
2
- "name": "@masterportal/masterportalapi",
3
- "author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
4
- "version": "2.50.0",
5
- "license": "MIT",
6
- "description": "Basic functions of the Masterportal as api",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git"
10
- },
11
- "main": "src/index.js",
12
- "scripts": {
13
- "test": "jest .test.js --config ./jest.config.js --collectCoverage",
14
- "test:trace": "node --trace-warnings node_modules/jest/bin/jest.js .test.js --config ./jest.config.js",
15
- "test:watch": "jest .test.js --config ./jest.config.js --watch",
16
- "example": "parcel example/index.html",
17
- "generate-jsdoc": "jsdoc ./src -r -d ./docs/ -R ./README.md -c jsdoc.json",
18
- "prePushHook": "eslint --max-warnings 0 \"./**/*.js\" && npm run test",
19
- "prepare": "husky install"
20
- },
21
- "dependencies": {
22
- "core-js": "^3.33.1",
23
- "dayjs": "^1.11.10",
24
- "ol": "^10.6.0",
25
- "ol-mapbox-style": "12.5.0",
26
- "olcs": "^2.22.1",
27
- "proj4": "^2.10.0",
28
- "xml2js": "^0.6.2"
29
- },
30
- "devDependencies": {
31
- "@babel/core": "^7.23.2",
32
- "@babel/plugin-transform-modules-commonjs": "^7.23.0",
33
- "@parcel/transformer-sass": "^2.10.0",
34
- "@swc/jest": "^0.2.29",
35
- "assert": "^2.1.0",
36
- "browserify-zlib": "^0.2.0",
37
- "buffer": "^6.0.3",
38
- "canvas": "^2.11.2",
39
- "eslint": "^8.52.0",
40
- "events": "^3.3.0",
41
- "https-browserify": "^1.0.0",
42
- "husky": "^8.0.3",
43
- "jest": "^29.7.0",
44
- "jest-canvas-mock": "^2.5.2",
45
- "jest-environment-jsdom": "^29.7.0",
46
- "jest-fetch-mock": "^3.0.3",
47
- "jsdoc": "^4.0.2",
48
- "parcel": "^2.10.0",
49
- "process": "^0.11.10",
50
- "sass": "^1.69.4",
51
- "stream-browserify": "^3.0.0",
52
- "stream-http": "^3.2.0",
53
- "timers-browserify": "^2.0.12",
54
- "url": "^0.11.3",
55
- "use-resize-observer": "^9.1.0",
56
- "util": "^0.12.5"
57
- },
58
- "peerDependencies": {
59
- "@cesium/engine": "^15.0.0"
60
- },
61
- "engines": {
62
- "node": "^16.13.2 || ^18.12.0 || ^20.12.2",
63
- "npm": "^8.1.2 || ^9.3.1 || ^10.5.0"
64
- },
65
- "homepage": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi#readme",
66
- "directories": {
67
- "doc": "docs",
68
- "example": "example",
69
- "test": "test"
70
- },
71
- "bugs": {
72
- "url": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/issues"
73
- }
74
- }
1
+ {
2
+ "name": "@masterportal/masterportalapi",
3
+ "author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
4
+ "version": "2.51.1",
5
+ "license": "MIT",
6
+ "description": "Basic functions of the Masterportal as api",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git"
10
+ },
11
+ "source": "src/index.js",
12
+ "main": "src/index.js",
13
+ "exports": {
14
+ ".": "./src/index.js"
15
+ },
16
+ "targets": {
17
+ "library": {
18
+ "source": "src/index.js",
19
+ "distDir": "dist",
20
+ "outputFormat": "commonjs"
21
+ }
22
+ },
23
+ "scripts": {
24
+ "test": "jest .test.js --config ./jest.config.js --collectCoverage",
25
+ "test:trace": "node --trace-warnings node_modules/jest/bin/jest.js .test.js --config ./jest.config.js",
26
+ "test:watch": "jest .test.js --config ./jest.config.js --watch",
27
+ "example": "parcel example/index.html",
28
+ "generate-jsdoc": "jsdoc ./src -r -d ./docs/ -R ./README.md -c jsdoc.json",
29
+ "prePushHook": "eslint --max-warnings 0 \"./**/*.js\" && npm run test",
30
+ "prepare": "husky install"
31
+ },
32
+ "dependencies": {
33
+ "core-js": "^3.33.1",
34
+ "dayjs": "^1.11.10",
35
+ "ol": "^10.6.0",
36
+ "ol-mapbox-style": "12.5.0",
37
+ "olcs": "^2.22.1",
38
+ "proj4": "^2.10.0",
39
+ "xml2js": "^0.6.2"
40
+ },
41
+ "devDependencies": {
42
+ "@babel/core": "7.26.0",
43
+ "@babel/plugin-transform-modules-commonjs": "^7.23.0",
44
+ "@parcel/config-default": "^2.15.4",
45
+ "@parcel/transformer-sass": "^2.15.4",
46
+ "@swc/jest": "^0.2.39",
47
+ "assert": "^2.1.0",
48
+ "browserify-zlib": "^0.2.0",
49
+ "buffer": "^6.0.3",
50
+ "canvas": "3.2.0",
51
+ "eslint": "8.57.1",
52
+ "events": "^3.3.0",
53
+ "https-browserify": "^1.0.0",
54
+ "husky": "8.0.3",
55
+ "jest": "30.1.3",
56
+ "jest-canvas-mock": "2.5.2",
57
+ "jest-environment-jsdom": "30.1.2",
58
+ "jest-fetch-mock": "^3.0.3",
59
+ "jsdoc": "4.0.2",
60
+ "parcel": "^2.15.4",
61
+ "process": "^0.11.10",
62
+ "sass": "1.69.4",
63
+ "stream-browserify": "^3.0.0",
64
+ "stream-http": "^3.2.0",
65
+ "timers-browserify": "^2.0.12",
66
+ "url": "^0.11.3",
67
+ "use-resize-observer": "^9.1.0",
68
+ "util": "^0.12.5"
69
+ },
70
+ "peerDependencies": {
71
+ "@cesium/engine": "^20.0.1"
72
+ },
73
+ "engines": {
74
+ "node": "^22.19.0",
75
+ "npm": "^10.5.0"
76
+ },
77
+ "homepage": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi#readme",
78
+ "directories": {
79
+ "doc": "docs",
80
+ "example": "example",
81
+ "test": "test"
82
+ },
83
+ "bugs": {
84
+ "url": "https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/issues"
85
+ }
86
+ }
package/publiccode.yml CHANGED
@@ -81,8 +81,8 @@ maintenance:
81
81
  name: Masterportal
82
82
  platforms:
83
83
  - web
84
- releaseDate: '2025-04-29'
84
+ releaseDate: '2026-06-12'
85
85
  roadmap: 'https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/'
86
86
  softwareType: api
87
- softwareVersion: 2.49.0
87
+ softwareVersion: 2.51.1 (LTS)
88
88
  url: 'https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git'
@@ -40,7 +40,14 @@ const defaultPointStyle = [
40
40
  opacity: 1
41
41
  },
42
42
 
43
- /** @type {import('ol/style/literal.js').LiteralStyle} */
43
+ /**
44
+ * @typedef {Object} LiteralStyle
45
+ * @property {string} [stroke-color]
46
+ * @property {number} [stroke-width]
47
+ * @property {string} [fill-color]
48
+ * @property {number} [opacity]
49
+ * @property {number} [size]
50
+ */
44
51
  style = Object.assign({
45
52
  "stroke-color": ["get", "strokeColor"],
46
53
  "stroke-width": ["get", "strokeWidth", "number"],
@@ -127,7 +127,7 @@ function rotateContextCenter (context, size, degrees = 90) {
127
127
  const halfSize = 0.5 * size;
128
128
 
129
129
  context.translate(halfSize, halfSize);
130
- context.rotate(degrees * (Math.PI / 180));
130
+ context.rotate(degrees * Math.PI / 180);
131
131
  context.translate(-halfSize, -halfSize);
132
132
  }
133
133
 
@@ -146,13 +146,12 @@ export function drawHatch (context, size, pattern) {
146
146
  if (hatchDefinition) {
147
147
  const {draw, rotate} = hatchDefinition;
148
148
 
149
- if (draw) {
150
- draw.forEach(segment => drawSegment(context, size, segment));
151
- }
152
-
153
149
  if (rotate) {
154
150
  rotateContextCenter(context, size, rotate);
155
151
  }
152
+ if (draw) {
153
+ draw.forEach(segment => drawSegment(context, size, segment));
154
+ }
156
155
  }
157
156
  else {
158
157
  console.error(`polygonStyleHatches: Unknown polygon style "${pattern}". Skipping hatching.`);
@@ -34,11 +34,12 @@ describe("setBackgroundImage.js", function () {
34
34
  });
35
35
 
36
36
  it("preserves empty string as input to set explicitly no background image", function () {
37
- const backgroundImage = "";
37
+ const backgroundImage = "",
38
+ got = document.getElementById("map").style.backgroundImage;
38
39
 
39
40
  setBackgroundImage({backgroundImage});
40
41
 
41
- expect(document.getElementById("map").style.backgroundImage).toBe("url()");
42
+ expect(["", "url()", "url(\"\")"]).toContain(got);
42
43
  });
43
44
 
44
45
  it("sets the default background image if none was given", function () {