@mapcomponents/react-maplibre 1.2.0 → 1.3.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.
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ declare const storyoptions: {
3
+ title: string;
4
+ component: {
5
+ (props: import("./MlComponentTemplate").MlComponentTemplateProps): React.JSX.Element;
6
+ defaultProps: {
7
+ mapId: undefined;
8
+ };
9
+ };
10
+ argTypes: {};
11
+ decorators: import("@storybook/react/*").Decorator[];
12
+ };
13
+ export default storyoptions;
14
+ export declare const ExampleConfig: any;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  declare const GeoJsonProvider: ({ children }: {
3
- children: JSX.Element;
3
+ children: React.JSX.Element;
4
4
  }) => React.JSX.Element;
5
5
  export default GeoJsonProvider;
@@ -1,34 +1,29 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export interface MlMarkerProps {
3
- /**
4
- * Id of the target MapLibre instance in mapContext
5
- */
3
+ /** ID of the map to add the marker to */
6
4
  mapId?: string;
7
- /**
8
- * The layerId of an existing layer this layer should be rendered visually beneath
9
- * https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addlayer - see "beforeId" property
10
- */
5
+ /** Layer ID before which to insert the marker */
11
6
  insertBeforeLayer?: string;
12
- /**
13
- * Longitude of the marker position
14
- */
7
+ /** Longitude of the marker position */
15
8
  lng: number;
16
- /**
17
- * Latitude of the marker position
18
- */
9
+ /** Latitude of the marker position */
19
10
  lat: number;
20
- /**
21
- * Content of the description popup
22
- */
11
+ /** HTML content for the marker popup */
23
12
  content?: string;
13
+ /** CSS properties to apply to the marker dot */
14
+ markerStyle?: React.CSSProperties;
15
+ /** CSS properties to apply to the content container */
16
+ containerStyle?: React.CSSProperties;
17
+ /** CSS properties to apply to the iframe element */
18
+ iframeStyle?: React.CSSProperties;
19
+ /** CSS properties to apply to the body of the iframe */
20
+ iframeBodyStyle?: React.CSSProperties;
21
+ /** Offset in pixels between the marker and its content */
22
+ contentOffset?: number;
23
+ /** Whether mouse events pass through the marker content */
24
+ passEventsThrough?: boolean;
25
+ /** Anchor position of the marker relative to its coordinates */
26
+ anchor?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
24
27
  }
25
- /**
26
- * Adds a marker to the map and displays the contents of the "content" property in an iframe next to it
27
- */
28
- declare const MlMarker: {
29
- (props: MlMarkerProps): React.JSX.Element;
30
- defaultProps: {
31
- mapId: undefined;
32
- };
33
- };
28
+ declare const MlMarker: ({ passEventsThrough, contentOffset, ...props }: MlMarkerProps) => React.ReactPortal | null;
34
29
  export default MlMarker;
@@ -29,7 +29,7 @@ export interface MlNavigationToolsProps {
29
29
  /**
30
30
  * Additional JSX Elements to be rendered below MlNavigationTools buttons
31
31
  */
32
- children?: JSX.Element;
32
+ children?: React.JSX.Element;
33
33
  /**
34
34
  * Style attribute for NavigationTools container
35
35
  */
@@ -21,6 +21,14 @@ export interface MlSketchToolProps {
21
21
  * First parameter contains all geometries in the `geometries` prop.
22
22
  */
23
23
  onChange?: (para: SketchStateType) => void;
24
+ /**
25
+ * Determines whether the instruction text should be shown.
26
+ */
27
+ showInstruction?: boolean;
28
+ /**
29
+ * Callback function triggered when the "Show instructions" checkbox is toggled.
30
+ */
31
+ onShowInstructionChange?: (value: boolean) => void;
24
32
  }
25
33
  type SketchStateType = {
26
34
  selectedGeoJson?: Feature;
@@ -88,7 +88,7 @@ export interface MlWmsLoaderProps {
88
88
  /**
89
89
  * Custom buttons to display for the WMSLoader
90
90
  */
91
- buttons?: JSX.Element;
91
+ buttons?: React.JSX.Element;
92
92
  sortable?: boolean;
93
93
  }
94
94
  export type LayerType = {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface LayerListProps {
3
3
  mapId?: string;
4
- children?: JSX.Element | JSX.Element[];
4
+ children?: React.JSX.Element | React.JSX.Element[];
5
5
  }
6
6
  declare function LayerList(props: LayerListProps): React.JSX.Element;
7
7
  export default LayerList;
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  interface LayerListFolderProps {
3
3
  visible: boolean;
4
- name?: string;
5
- children: JSX.Element | JSX.Element[];
4
+ name?: string | ReactNode;
5
+ children: React.JSX.Element | React.JSX.Element[];
6
6
  setVisible?: (visible: boolean | ((val: unknown) => boolean)) => void;
7
7
  }
8
8
  declare function LayerListFolder({ visible, name, children, setVisible }: LayerListFolderProps): React.JSX.Element;
@@ -1,16 +1,16 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { SxProps } from '@mui/material';
3
3
  interface LayerListItemProps {
4
- layerComponent: JSX.Element;
4
+ layerComponent: React.JSX.Element;
5
5
  visible: boolean;
6
6
  configurable: boolean;
7
7
  type?: 'background' | 'background-labels' | 'layer' | 'wms-layer' | 'vector-tile-layer';
8
- name: string;
8
+ name: string | ReactNode;
9
9
  description?: string;
10
10
  setLayerState?: (state: unknown) => void;
11
11
  showDeleteButton?: boolean;
12
12
  listItemSx?: SxProps;
13
- buttons?: JSX.Element;
13
+ buttons?: React.JSX.Element;
14
14
  layerId?: string;
15
15
  sortable?: boolean;
16
16
  }
@@ -9,7 +9,7 @@ interface LayerTreeListItemProps {
9
9
  setLayerState?: (state: unknown) => void;
10
10
  showDeleteButton?: boolean;
11
11
  listItemSx?: SxProps;
12
- buttons?: JSX.Element;
12
+ buttons?: React.JSX.Element;
13
13
  sortable?: boolean;
14
14
  mapConfigKey: string;
15
15
  layerOrderConfig: LayerOrderItem;
@@ -3,7 +3,7 @@ import { BubbleForInstructionProps } from './BubbleForInstructions';
3
3
  export interface StepObject {
4
4
  duration: number;
5
5
  props: BubbleForInstructionProps;
6
- content: JSX.Element;
6
+ content: React.JSX.Element;
7
7
  }
8
8
  export interface InstructionProps {
9
9
  steps: StepObject[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcomponents/react-maplibre",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "main": "dist/index.cjs.js",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.esm.js",
@@ -24,20 +24,23 @@
24
24
  "@dnd-kit/core": "^6.3.1",
25
25
  "@dnd-kit/modifiers": "^9.0.0",
26
26
  "@dnd-kit/sortable": "^10.0.0",
27
+ "@dnd-kit/utilities": "^3.2.2",
27
28
  "@emotion/css": "^11.13.5",
28
29
  "@emotion/react": "^11.14.0",
29
30
  "@emotion/styled": "^11.14.0",
30
31
  "@eslint/eslintrc": "^3.3.1",
31
- "@eslint/js": "^9.23.0",
32
+ "@eslint/js": "^9.24.0",
32
33
  "@mapbox/mapbox-gl-draw": "1.4.3",
33
34
  "@mapbox/mapbox-gl-sync-move": "^0.3.1",
34
- "@mui/icons-material": "^7.0.0",
35
- "@mui/material": "^7.0.0",
35
+ "@mui/icons-material": "^7.0.1",
36
+ "@mui/material": "^7.0.1",
37
+ "@mui/system": "^7.1.0",
36
38
  "@reduxjs/toolkit": "^2.6.1",
37
39
  "@rollup/plugin-json": "^6.1.0",
38
- "@storybook/theming": "^8.6.11",
40
+ "@storybook/theming": "^8.6.12",
39
41
  "@testing-library/dom": "^10.4.0",
40
42
  "@tmcw/togeojson": "^7.0.0",
43
+ "@turf/helpers": "^7.2.0",
41
44
  "@turf/turf": "^7.2.0",
42
45
  "@types/d3": "^7.4.3",
43
46
  "@types/geojson": "^7946.0.16",
@@ -48,7 +51,7 @@
48
51
  "d3": "^7.9.0",
49
52
  "globals": "^16.0.0",
50
53
  "jspdf": "^3.0.1",
51
- "maplibre-gl": "5.3.0",
54
+ "maplibre-gl": "5.5.0",
52
55
  "osm2geojson-lite": "^1.0.3",
53
56
  "pako": "^2.1.0",
54
57
  "react-color": "^2.19.3",
@@ -56,7 +59,7 @@
56
59
  "react-redux": "^9.2.0",
57
60
  "redux": "^5.0.1",
58
61
  "redux-thunk": "^3.1.0",
59
- "three": "^0.174.0",
62
+ "three": "^0.175.0",
60
63
  "topojson-client": "^3.1.0",
61
64
  "uuid": "^11.1.0",
62
65
  "wms-capabilities": "^0.6.0"
@@ -68,17 +71,17 @@
68
71
  "@rollup/plugin-babel": "^6.0.4",
69
72
  "@rollup/plugin-commonjs": "^28.0.3",
70
73
  "@rollup/plugin-url": "^8.0.2",
71
- "@storybook/addon-actions": "^8.6.11",
72
- "@storybook/addon-docs": "^8.6.11",
73
- "@storybook/addon-essentials": "^8.6.11",
74
- "@storybook/addon-links": "^8.6.11",
74
+ "@storybook/addon-actions": "^8.6.12",
75
+ "@storybook/addon-docs": "^8.6.12",
76
+ "@storybook/addon-essentials": "^8.6.12",
77
+ "@storybook/addon-links": "^8.6.12",
75
78
  "@storybook/addons": "^7.6.17",
76
- "@storybook/node-logger": "^8.6.11",
77
- "@storybook/react": "^8.6.11",
78
- "@storybook/react-webpack5": "^8.6.11",
79
- "@storybook/test": "^8.6.11",
79
+ "@storybook/node-logger": "^8.6.12",
80
+ "@storybook/react": "^8.6.12",
81
+ "@storybook/react-webpack5": "^8.6.12",
82
+ "@storybook/test": "^8.6.12",
80
83
  "@storybook/testing-react": "^2.0.1",
81
- "@testing-library/react": "^16.2.0",
84
+ "@testing-library/react": "^16.3.0",
82
85
  "@types/chai": "^5.2.1",
83
86
  "@types/elasticlunr": "^0.9.5",
84
87
  "@types/enzyme": "^3.10.18",
@@ -89,13 +92,13 @@
89
92
  "@types/mapbox__vector-tile": "^2.0.0",
90
93
  "@types/mocha": "^10.0.10",
91
94
  "@types/pako": "^2.0.3",
92
- "@types/react": "^19.0.12",
93
- "@types/react-dom": "^19.0.4",
95
+ "@types/react": "^19.1.0",
96
+ "@types/react-dom": "^19.1.1",
94
97
  "@types/sql.js": "^1.4.9",
95
- "@types/three": "^0.174.0",
98
+ "@types/three": "^0.175.0",
96
99
  "@types/uuid": "^10.0.0",
97
- "@typescript-eslint/eslint-plugin": "^8.28.0",
98
- "@typescript-eslint/parser": "^8.28.0",
100
+ "@typescript-eslint/eslint-plugin": "^8.29.0",
101
+ "@typescript-eslint/parser": "^8.29.0",
99
102
  "avj": "^0.0.0",
100
103
  "babel-jest": "^29.7.0",
101
104
  "babel-loader": "^10.0.0",
@@ -105,9 +108,9 @@
105
108
  "chai": "^5.2.0",
106
109
  "cypress": "^14.2.1",
107
110
  "elasticlunr": "^0.9.5",
108
- "eslint": "^9.23.0",
111
+ "eslint": "^9.24.0",
109
112
  "eslint-config-prettier": "^10.1.1",
110
- "eslint-plugin-react": "^7.37.4",
113
+ "eslint-plugin-react": "^7.37.5",
111
114
  "eslint-plugin-storybook": "^0.12.0",
112
115
  "glob": "^11.0.1",
113
116
  "jest": "29.7.0",
@@ -120,25 +123,25 @@
120
123
  "node-fetch": "^3.3.2",
121
124
  "postcss": "^8.5.3",
122
125
  "prettier": "3.5.3",
123
- "react": "^19.0.0",
126
+ "react": "^19.1.0",
124
127
  "react-app-polyfill": "^3.0.0",
125
128
  "react-dev-utils": "^12.0.1",
126
- "react-dom": "^19.0.0",
129
+ "react-dom": "^19.1.0",
127
130
  "react-draggable": "^4.4.6",
128
131
  "react-i18next": "^15.4.1",
129
- "rollup": "^4.37.0",
132
+ "rollup": "^4.39.0",
130
133
  "rollup-plugin-delete": "^3.0.1",
131
134
  "rollup-plugin-import-css": "^3.5.8",
132
135
  "rollup-plugin-node-externals": "^8.0.0",
133
136
  "rollup-plugin-typescript2": "^0.36.0",
134
137
  "showdown": "^2.1.0",
135
138
  "sql.js": "^1.13.0",
136
- "storybook": "^8.6.11",
139
+ "storybook": "^8.6.12",
137
140
  "storybook-source-link": "^4.0.1",
138
- "ts-jest": "^29.3.0",
141
+ "ts-jest": "^29.3.1",
139
142
  "ts-loader": "^9.5.2",
140
143
  "ts-node": "^10.9.2",
141
- "typescript": "^5.8.2"
144
+ "typescript": "^5.8.3"
142
145
  },
143
146
  "jest": {
144
147
  "roots": [
@@ -167,7 +170,7 @@
167
170
  "^.+\\.svg$": "<rootDir>/config/jest/fileTransform.js"
168
171
  },
169
172
  "transformIgnorePatterns": [
170
- "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
173
+ "[/\\\\]node_modules[/\\\\](?!three/examples/jsm/).+\\.(js|jsx|mjs|cjs|ts|tsx)$",
171
174
  "^.+\\.module\\.(css|sass|scss)$"
172
175
  ],
173
176
  "modulePaths": [],