@planet/maps 10.1.0 → 10.2.0
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/Map.js +2 -2
- package/internal/render.js +5 -1
- package/package.json +12 -10
package/Map.js
CHANGED
|
@@ -29,8 +29,8 @@ class Map extends Component {
|
|
|
29
29
|
|
|
30
30
|
this.targetRef = createRef();
|
|
31
31
|
|
|
32
|
-
const {id, style, className, innerRef, ...mapProps} = props;
|
|
33
|
-
this.map = new OLMap({});
|
|
32
|
+
const {id, style, className, innerRef, options, ...mapProps} = props;
|
|
33
|
+
this.map = new OLMap({...options});
|
|
34
34
|
if (innerRef) {
|
|
35
35
|
if (typeof innerRef === 'function') {
|
|
36
36
|
innerRef(this.map);
|
package/internal/render.js
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from './update.js';
|
|
23
23
|
|
|
24
24
|
const listenerRegex = /^on([A-Z].*)/;
|
|
25
|
+
const listenerColonRegex = /^onChange-/;
|
|
25
26
|
|
|
26
27
|
function upperFirst(str) {
|
|
27
28
|
return str[0].toUpperCase() + str.slice(1);
|
|
@@ -47,7 +48,10 @@ export function updateInstanceFromProps(instance, props, oldProps = {}) {
|
|
|
47
48
|
}
|
|
48
49
|
if (listenerRegex.test(key)) {
|
|
49
50
|
const listener = props[key];
|
|
50
|
-
const type = key
|
|
51
|
+
const type = key
|
|
52
|
+
.replace(listenerColonRegex, 'onChange:')
|
|
53
|
+
.replace(listenerRegex, '$1')
|
|
54
|
+
.toLowerCase();
|
|
51
55
|
instance.on(type, listener);
|
|
52
56
|
if (oldProps[key]) {
|
|
53
57
|
instance.un(type, oldProps[key]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planet/maps",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Declarative mapping components for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
"url": "git://github.com/planetlabs/maps.git"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"pretest": "npm run lint",
|
|
12
|
-
"test": "npm run test:rendering",
|
|
13
|
-
"test:unit": "vitest run -r ./tests/unit",
|
|
14
11
|
"lint": "eslint .",
|
|
12
|
+
"pretest": "npm run lint",
|
|
13
|
+
"test": "npm run test:lib && npm run test:rendering",
|
|
14
|
+
"test:lib": "vitest run --root ./tests/lib",
|
|
15
15
|
"test:rendering": "playwright test --config=tests/rendering/playwright.config.js",
|
|
16
|
+
"test:not-working": "vitest run -r ./tests/unit",
|
|
16
17
|
"start": "astro dev --root ./site",
|
|
17
18
|
"start:rendering": "vite serve --config=tests/rendering/vite.config.js",
|
|
18
19
|
"build": "astro build --root ./site",
|
|
@@ -29,22 +30,23 @@
|
|
|
29
30
|
"react": "*"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@astrojs/mdx": "^
|
|
33
|
+
"@astrojs/mdx": "^3.0.0",
|
|
33
34
|
"@astrojs/react": "^3.0.2",
|
|
34
35
|
"@octokit/rest": "^20.0.1",
|
|
35
36
|
"@playwright/test": "^1.25.2",
|
|
37
|
+
"@testing-library/react": "^16.0.0",
|
|
36
38
|
"@types/react": "^18.0.27",
|
|
37
39
|
"@types/react-dom": "^18.0.10",
|
|
40
|
+
"@vitest/browser": "^1.6.0",
|
|
38
41
|
"astro": "^4.0.3",
|
|
39
42
|
"es-main": "^1.2.0",
|
|
40
43
|
"eslint": "^8.57.0",
|
|
41
|
-
"eslint-config-planet": "^
|
|
42
|
-
"eslint-plugin-astro": "^
|
|
44
|
+
"eslint-config-planet": "^22.1.0",
|
|
45
|
+
"eslint-plugin-astro": "^1.2.0",
|
|
43
46
|
"eslint-plugin-mdx": "^3.0.0",
|
|
44
47
|
"eslint-plugin-react": "^7.32.1",
|
|
45
48
|
"fs-extra": "^11.1.0",
|
|
46
49
|
"import-meta-resolve": "^4.0.0",
|
|
47
|
-
"jsdom": "^24.0.0",
|
|
48
50
|
"mustache": "^4.2.0",
|
|
49
51
|
"ol": "^9.0.0",
|
|
50
52
|
"ol-mapbox-style": "^12.2.1",
|
|
@@ -57,8 +59,8 @@
|
|
|
57
59
|
"semver": "^7.3.7",
|
|
58
60
|
"shikiji": "^0.10.2",
|
|
59
61
|
"unified": "^11.0.2",
|
|
60
|
-
"vite": "^5.
|
|
61
|
-
"vitest": "^1.0
|
|
62
|
+
"vite": "^5.2.12",
|
|
63
|
+
"vitest": "^1.6.0",
|
|
62
64
|
"yargs-parser": "^21.1.1"
|
|
63
65
|
},
|
|
64
66
|
"eslintConfig": {
|