diff --git a/swc.json b/.swcrc similarity index 100% rename from swc.json rename to .swcrc diff --git a/package.json b/package.json index afe18d7b..76474707 100644 --- a/package.json +++ b/package.json @@ -12,23 +12,23 @@ "types:react-leaflet": "yarn workspace react-leaflet run build:types", "build:types": "yarn run types:core && yarn run types:react-leaflet", "build:website": "yarn workspace website run build", - "build": "yarn turbo run build:js && yarn run build:types && yarn run build:website" + "build": "yarn turbo run build:clean && yarn run build:types && yarn turbo run build:js && yarn run build:website" }, "devDependencies": { "@skypack/package-check": "^0.2.2", "@swc/cli": "^0.1.55", - "@swc/core": "^1.2.126", - "@swc/jest": "^0.2.15", + "@swc/core": "^1.2.129", + "@swc/jest": "^0.2.17", "@testing-library/react": "^13.0.0-alpha", "@testing-library/react-hooks": "^8.0.0-alpha", "@types/jest": "^27.4.0", "@types/leaflet": "^1.7.8", "@types/warning": "^3.0.0", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "cross-env": "^7.0.3", "del-cli": "^4.0.1", - "eslint": "^8.6.0", + "eslint": "^8.7.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-node": "^11.1.0", @@ -43,7 +43,8 @@ "react": "^18.0.0-rc", "react-dom": "^18.0.0-rc", "react-test-renderer": "^18.0.0-rc", - "turbo": "^1.0.24", + "ts-jest-resolver": "^2.0.0", + "turbo": "^1.0.28", "typescript": "^4.5.4" }, "jest": { @@ -53,12 +54,8 @@ }, "turbo": { "pipeline": { - "clean": {}, - "build:js": { - "dependsOn": [ - "^clean" - ] - } + "build:clean": {}, + "build:js": {} } } } diff --git a/packages/core/package.json b/packages/core/package.json index 6b72f294..12f8f302 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,9 +30,9 @@ "sideEffects": false, "scripts": { "build:clean": "del lib", - "build:js": "swc src -d ./lib --config-file ../../swc.json", + "build:js": "swc src -d ./lib --config-file ../../.swcrc", "build:types": "tsc --emitDeclarationOnly", - "build": "yarn run build:clean && yarn run build:js && yarn run build:types", + "build": "yarn run build:clean && yarn run build:types && yarn run build:js", "test:types": "tsc --noEmit", "test:unit": "cross-env NODE_ENV=test jest", "test": "yarn run test:types && yarn run test:unit", @@ -45,19 +45,19 @@ "react": "^18.0.0-rc", "react-dom": "^18.0.0-rc" }, - "devDependencies": { - "@react-leaflet/jest-resolver": "^1.0.0" - }, "jest": { "extensionsToTreatAsEsm": [ ".ts", ".tsx" ], - "resolver": "@react-leaflet/jest-resolver", + "resolver": "ts-jest-resolver", "testEnvironment": "jsdom", "transform": { "^.+\\.(t|j)sx?$": [ - "@swc/jest" + "@swc/jest", + { + "root": "../.." + } ] } } diff --git a/packages/core/src/component.tsx b/packages/core/src/component.tsx index d8aef112..1f74d20e 100644 --- a/packages/core/src/component.tsx +++ b/packages/core/src/component.tsx @@ -22,9 +22,9 @@ export type PropsWithChildren = { export function createContainerComponent( useElement: ElementHook, ) { - function ContainerComponent(props: P, ref: Ref) { + function ContainerComponent(props: P, forwardedRef: Ref) { const { instance, context } = useElement(props).current - useImperativeHandle(ref, () => instance) + useImperativeHandle(forwardedRef, () => instance) return props.children == null ? null : ( {props.children} @@ -38,11 +38,11 @@ export function createDivOverlayComponent< E extends DivOverlay, P extends PropsWithChildren, >(useElement: ReturnType>) { - function OverlayComponent(props: P, ref: Ref) { + function OverlayComponent(props: P, forwardedRef: Ref) { const [isOpen, setOpen] = useState(false) const { instance } = useElement(props, setOpen).current - useImperativeHandle(ref, () => instance) + useImperativeHandle(forwardedRef, () => instance) useEffect( function updateOverlay() { if (isOpen) { @@ -61,9 +61,9 @@ export function createDivOverlayComponent< } export function createLeafComponent(useElement: ElementHook) { - function LeafComponent(props: P, ref: Ref) { + function LeafComponent(props: P, forwardedRef: Ref) { const { instance } = useElement(props).current - useImperativeHandle(ref, () => instance) + useImperativeHandle(forwardedRef, () => instance) return null } diff --git a/packages/jest-resolver/LICENSE.md b/packages/jest-resolver/LICENSE.md deleted file mode 100644 index fe96104c..00000000 --- a/packages/jest-resolver/LICENSE.md +++ /dev/null @@ -1,33 +0,0 @@ -@react-leaflet/jest-resolver Copyright 2022 Paul Le Cam and contributors (“Licensor”) - -Hippocratic License Version Number: 2.1. - -Purpose. The purpose of this License is for the Licensor named above to permit the Licensee (as defined below) broad permission, if consistent with Human Rights Laws and Human Rights Principles (as each is defined below), to use and work with the Software (as defined below) within the full scope of Licensor’s copyright and patent rights, if any, in the Software, while ensuring attribution and protecting the Licensor from liability. - -Permission and Conditions. The Licensor grants permission by this license (“License”), free of charge, to the extent of Licensor’s rights under applicable copyright and patent law, to any person or entity (the “Licensee”) obtaining a copy of this software and associated documentation files (the “Software”), to do everything with the Software that would otherwise infringe (i) the Licensor’s copyright in the Software or (ii) any patent claims to the Software that the Licensor can license or becomes able to license, subject to all of the following terms and conditions: - -- Acceptance. This License is automatically offered to every person and entity subject to its terms and conditions. Licensee accepts this License and agrees to its terms and conditions by taking any action with the Software that, absent this License, would infringe any intellectual property right held by Licensor. - -- Notice. Licensee must ensure that everyone who gets a copy of any part of this Software from Licensee, with or without changes, also receives the License and the above copyright notice (and if included by the Licensor, patent, trademark and attribution notice). Licensee must cause any modified versions of the Software to carry prominent notices stating that Licensee changed the Software. For clarity, although Licensee is free to create modifications of the Software and distribute only the modified portion created by Licensee with additional or different terms, the portion of the Software not modified must be distributed pursuant to this License. If anyone notifies Licensee in writing that Licensee has not complied with this Notice section, Licensee can keep this License by taking all practical steps to comply within 30 days after the notice. If Licensee does not do so, Licensee’s License (and all rights licensed hereunder) shall end immediately. - -- Compliance with Human Rights Principles and Human Rights Laws. - - 1. Human Rights Principles. - - (a) Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights and the United Nations Global Compact that define recognized principles of international human rights (the “Human Rights Principles”). Licensee shall use the Software in a manner consistent with Human Rights Principles. - - (b) Unless the Licensor and Licensee agree otherwise, any dispute, controversy, or claim arising out of or relating to (i) Section 1(a) regarding Human Rights Principles, including the breach of Section 1(a), termination of this License for breach of the Human Rights Principles, or invalidity of Section 1(a) or (ii) a determination of whether any Law is consistent or in conflict with Human Rights Principles pursuant to Section 2, below, shall be settled by arbitration in accordance with the Hague Rules on Business and Human Rights Arbitration (the “Rules”); provided, however, that Licensee may elect not to participate in such arbitration, in which event this License (and all rights licensed hereunder) shall end immediately. The number of arbitrators shall be one unless the Rules require otherwise. - - Unless both the Licensor and Licensee agree to the contrary: (1) All documents and information concerning the arbitration shall be public and may be disclosed by any party; (2) The repository referred to under Article 43 of the Rules shall make available to the public in a timely manner all documents concerning the arbitration which are communicated to it, including all submissions of the parties, all evidence admitted into the record of the proceedings, all transcripts or other recordings of hearings and all orders, decisions and awards of the arbitral tribunal, subject only to the arbitral tribunal's powers to take such measures as may be necessary to safeguard the integrity of the arbitral process pursuant to Articles 18, 33, 41 and 42 of the Rules; and (3) Article 26(6) of the Rules shall not apply. - - 2. Human Rights Laws. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any Human Rights Laws. “Human Rights Laws” means any applicable laws, regulations, or rules (collectively, “Laws”) that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights; provided, however, that such Laws are consistent and not in conflict with Human Rights Principles (a dispute over the consistency or a conflict between Laws and Human Rights Principles shall be determined by arbitration as stated above). Where the Human Rights Laws of more than one jurisdiction are applicable or in conflict with respect to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply. - - 3. Indemnity. Licensee shall hold harmless and indemnify Licensor (and any other contributor) against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor’s reasonable attorneys’ fees, arising out of or relating to Licensee’s use of the Software in violation of Human Rights Laws or Human Rights Principles. - -- Failure to Comply. Any failure of Licensee to act according to the terms and conditions of this License is both a breach of the License and an infringement of the intellectual property rights of the Licensor (subject to exceptions under Laws, e.g., fair use). In the event of a breach or infringement, the terms and conditions of this License may be enforced by Licensor under the Laws of any jurisdiction to which Licensee is subject. Licensee also agrees that the Licensor may enforce the terms and conditions of this License against Licensee through specific performance (or similar remedy under Laws) to the extent permitted by Laws. For clarity, except in the event of a breach of this License, infringement, or as otherwise stated in this License, Licensor may not terminate this License with Licensee. - -- Enforceability and Interpretation. If any term or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction; provided, however, subject to a court modification pursuant to the immediately following sentence, if any term or provision of this License pertaining to Human Rights Laws or Human Rights Principles is deemed invalid, illegal, or unenforceable against Licensee by a court of competent jurisdiction, all rights in the Software granted to Licensee shall be deemed null and void as between Licensor and Licensee. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by Laws, the court may modify this License to affect the original purpose that the Software be used in compliance with Human Rights Principles and Human Rights Laws as closely as possible. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party. - -- Disclaimer. TO THE FULL EXTENT ALLOWED BY LAW, THIS SOFTWARE COMES “AS IS,” WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, AND LICENSOR AND ANY OTHER CONTRIBUTOR SHALL NOT BE LIABLE TO ANYONE FOR ANY DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THIS LICENSE, UNDER ANY KIND OF LEGAL CLAIM. - -This Hippocratic License is an Ethical Source license (https://ethicalsource.dev) and is offered for use by licensors and licensees at their own risk, on an “AS IS” basis, and with no warranties express or implied, to the maximum extent permitted by Laws. diff --git a/packages/jest-resolver/index.js b/packages/jest-resolver/index.js deleted file mode 100644 index c2df2d0a..00000000 --- a/packages/jest-resolver/index.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = (request, options) => { - const { defaultResolver } = options - try { - return defaultResolver(request, options) - } catch (e) { - try { - return defaultResolver(request.replace(/\.js$/, '.ts'), options) - } catch (e) { - return defaultResolver(request.replace(/\.js$/, '.tsx'), options) - } - } -} diff --git a/packages/jest-resolver/package.json b/packages/jest-resolver/package.json deleted file mode 100644 index cc23857d..00000000 --- a/packages/jest-resolver/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "@react-leaflet/jest-resolver", - "version": "1.0.0", - "description": "Jest resolver for React Leaflet unit tests", - "main": "index.js", - "repository": { - "type": "git", - "url": "https://github.com/PaulLeCam/react-leaflet.git" - }, - "author": "Paul Le Cam ", - "license": "Hippocratic-2.1", - "bugs": { - "url": "https://github.com/PaulLeCam/react-leaflet/issues" - }, - "homepage": "https://github.com/PaulLeCam/react-leaflet" -} diff --git a/packages/react-leaflet/package.json b/packages/react-leaflet/package.json index d733ac97..1974c0b6 100644 --- a/packages/react-leaflet/package.json +++ b/packages/react-leaflet/package.json @@ -31,9 +31,9 @@ "sideEffects": false, "scripts": { "build:clean": "del lib", - "build:js": "swc src -d ./lib --config-file ../../swc.json", + "build:js": "swc src -d ./lib --config-file ../../.swcrc", "build:types": "tsc --emitDeclarationOnly", - "build": "yarn run build:clean && yarn run build:js && yarn run build:types", + "build": "yarn run build:clean && yarn run build:types && yarn run build:js", "test:types": "tsc --noEmit", "test:unit": "cross-env NODE_ENV=test jest", "test": "yarn run test:types && yarn run test:unit", @@ -50,7 +50,6 @@ "react-dom": "^18.0.0-rc" }, "devDependencies": { - "@react-leaflet/jest-resolver": "^1.0.0", "@types/leaflet": "^1.7.8" }, "jest": { @@ -58,11 +57,14 @@ ".ts", ".tsx" ], - "resolver": "@react-leaflet/jest-resolver", + "resolver": "ts-jest-resolver", "testEnvironment": "jsdom", "transform": { "^.+\\.(t|j)sx?$": [ - "@swc/jest" + "@swc/jest", + { + "root": "../.." + } ] } } diff --git a/packages/react-leaflet/src/SVGOverlay.tsx b/packages/react-leaflet/src/SVGOverlay.tsx index cdc68c7f..0c59a9f7 100644 --- a/packages/react-leaflet/src/SVGOverlay.tsx +++ b/packages/react-leaflet/src/SVGOverlay.tsx @@ -45,10 +45,10 @@ export const useSVGOverlay = createLayerHook(useSVGOverlayElement) function SVGOverlayComponent( { children, ...options }: SVGOverlayProps, - ref: Ref, + forwardedRef: Ref, ) { const { instance, container } = useSVGOverlay(options).current - useImperativeHandle(ref, () => instance) + useImperativeHandle(forwardedRef, () => instance) return container == null || children == null ? null diff --git a/packages/website/docs/api-components.md b/packages/website/docs/api-components.md deleted file mode 100644 index 0998c0ec..00000000 --- a/packages/website/docs/api-components.md +++ /dev/null @@ -1,479 +0,0 @@ ---- -title: Child components ---- - -:::caution MapContainer required -Child components can only be used as descendants of a [MapContainer component](api-map.md#mapcontainer). -::: - -## Props - -Child components in React Leaflet use their props as options when creating the corresponding Leaflet instance, as described in [Leaflet's documentation](https://leafletjs.com/reference.html). - -By default these props should be treated as **immutable**, only the props explicitely documented as **mutable** in this page will affect the Leaflet element when changed. - -## Behaviors - -Child components in React Leaflet support common behaviors described below, implementing logic related to React or Leaflet. - -### Referenceable behavior - -Makes the Leaflet instance for the given component accessible with the [`useRef()` hook](https://reactjs.org/docs/hooks-reference.html#useref). - -```tsx Example component with Referenceable behavior -function MyComponent() { - const circleRef = useRef() - - useEffect(() => { - const radius = circleRef.current.getRadius() - }) - - return -} -``` - -### ParentComponent behavior - -The component will render its mutable React children components, based on the `children?: ReactNode` prop. - -```tsx Example component with ParentComponent behavior - - Hello world - -``` - -### Evented behavior - -Adds support for the `eventHandlers?: LeafletEventHandlerFnMap` prop, adding and removing event listeners. - -```tsx Example component with Evented behavior - { - console.log('marker clicked') - }, - }} -/> -``` - -### Attribution behavior - -Applies to layer components, making their [`attribution`](https://leafletjs.com/reference.html#layer-attribution) prop mutable. - -```tsx Example component with Attribution behavior - -``` - -### Pane behavior - -Applies to layer components, adding support for the [`pane`](https://leafletjs.com/reference.html#layer-pane) prop or context from a [`Pane` component](#pane) ancestor. - -```tsx Example component with pane prop - -``` - -```tsx Example component with Pane ancestor - - - -``` - -### Path behavior - -Applies to [vector layer components](#vector-layers), adding support for a [`pathOptions: PathOptions`](https://leafletjs.com/reference.html#path) mutable prop. - -```tsx Example component with PathOptions behavior - -``` - -### MediaOverlay behavior - -Applies to components using [Leaflet's ImageOverlay class](https://leafletjs.com/reference.html#imageoverlay), adding support for mutable [`bounds: LatLngBounds`](https://leafletjs.com/reference.html#latlngbounds), [`opacity: number`](https://leafletjs.com/reference.html#imageoverlay-opacity) and [`zIndex: number`](https://leafletjs.com/reference.html#imageoverlay-zindex) props. - -```tsx Example component with MediaOverlay behavior -const bounds = new LatLngBounds([40.712216, -74.22655], [40.773941, -74.12544]) - - -``` - -### CircleMarker behavior - -Applies to components using [Leaflet's CircleMarker class](https://leafletjs.com/reference.html#circlemarker), adding support for mutable `center: LatLngExpression` and [`radius: number`](https://leafletjs.com/reference.html#circlemarker-radius) props. - -```tsx Example component with CircleMarker behavior - -``` - -### GridLayer behavior - -Applies to components using [Leaflet's GridLayer class](https://leafletjs.com/reference.html#gridlayer), adding support for mutable [`opacity: number`](https://leafletjs.com/reference.html#gridlayer-opacity) and [`zIndex: number`](https://leafletjs.com/reference.html#gridlayer-zindex) props. - -```tsx Example component with GridLayer behavior - -``` - -### Control behavior - -Applies to [control components](#controls), making their [`position: ControlPosition`](https://leafletjs.com/reference.html#control-position) prop mutable. - -```tsx Example component with Control behavior - -``` - -## UI layers - -### Marker - -[Leaflet reference](https://leafletjs.com/reference.html#marker) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `draggable` | `boolean` | No | **Yes** | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `icon` | `Leaflet.Icon` | No | **Yes** | -| `opacity` | `number` | No | **Yes** | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `position` | `LatLngExpression` | **Yes** | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `zIndexOffset` | `number` | No | **Yes** | - -### Popup - -[Leaflet reference](https://leafletjs.com/reference.html#popup) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `position` | `LatLngExpression` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### Tooltip - -[Leaflet reference](https://leafletjs.com/reference.html#tooltip) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ---------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `position` | `LatLngExpression` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -## Raster layers - -### TileLayer - -[Leaflet reference](https://leafletjs.com/reference.html#tilelayer) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ------------------------------ | -------- | ------- | ---------------------------------------- | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `opacity` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `url` | `string` | **Yes** | No | -| `zIndex` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | - -### WMSTileLayer - -[Leaflet reference](https://leafletjs.com/reference.html#tilelayer-wms) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ---------------------------------- | -------- | ------- | ---------------------------------------- | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `opacity` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `params` | `WMSParams` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `url` | `string` | **Yes** | No | -| `zIndex` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | - -### ImageOverlay - -[Leaflet reference](https://leafletjs.com/reference.html#imageoverlay) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `bounds` | `LatLngBounds` | **Yes** | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `opacity` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `url` | `string` | **Yes** | **Yes** | -| `zIndex` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | - -### VideoOverlay - -[Leaflet reference](https://leafletjs.com/reference.html#videooverlay) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ------------------------------------------ | -------- | ------- | ---------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `bounds` | `LatLngBounds` | **Yes** | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `play` | `boolean` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `url` | `string`, `string[]` or `HTMLVideoElement` | **Yes** | **Yes** | -| `zIndex` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | - -## Vector layers - -### Circle - -[Leaflet reference](https://leafletjs.com/reference.html#circle) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `center` | `LatLngExpression` | **Yes** | **Yes** | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | -| `radius` | `number` | **Yes** | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### CircleMarker - -[Leaflet reference](https://leafletjs.com/reference.html#circlemarker) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `center` | `LatLngExpression` | **Yes** | **Yes** | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | -| `radius` | `number` | **Yes** | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### Polyline - -[Leaflet reference](https://leafletjs.com/reference.html#polyline) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ---------------------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | -| `positions` | `LatLngExpression[]` or `LatLngExpression[][]` | **Yes** | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### Polygon - -[Leaflet reference](https://leafletjs.com/reference.html#polygon) - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ------------------------------------------------------------------------ | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | -| `positions` | `LatLngExpression[]`, `LatLngExpression[][]` or `LatLngExpression[][][]` | **Yes** | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### Rectangle - -[Leaflet reference](https://leafletjs.com/reference.html#rectangle) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ------------------------------ | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `bounds` | `LatLngBoundsExpression` | **Yes** | **Yes** | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### SVGOverlay - -[Leaflet reference](https://leafletjs.com/reference.html#svgoverlay) - -**Props** - -The `attributes` must be valid [`SVGSVGElement` properties](https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement). - -| Prop | Type | Required | Mutable | Behavior | -| ------------- | ------------------------------- | -------- | ------- | -------------------------------------------- | -| `attributes` | `Record` | No | No | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -## Other layers - -### LayerGroup - -[Leaflet reference](https://leafletjs.com/reference.html#layergroup) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### FeatureGroup - -[Leaflet reference](https://leafletjs.com/reference.html#featuregroup) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### GeoJSON - -[Leaflet reference](https://leafletjs.com/reference.html#geojson) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | -------------------------------- | -------- | ------- | -------------------------------------------- | -| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `data` | `GeoJsonObject` | **Yes** | No | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `pane` | `string` | No | No | [Pane](#pane-behavior) | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | -| `style` | `PathOptions` or `StyleFunction` | No | **Yes** | | - -## Controls - -### ZoomControl - -[Leaflet reference](https://leafletjs.com/reference.html#control-zoom) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------------- | -------- | ------- | ---------------------------------------- | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `position` | `ControlPosition` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### AttributionControl - -[Leaflet reference](https://leafletjs.com/reference.html#control-attribution) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ---------------------------------------- | -------- | ------- | ---------------------------------------- | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `position` | `ControlPosition` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### LayersControl - -[Leaflet reference](https://leafletjs.com/reference.html#control-layers) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | ----------------------------------- | -------- | ------- | ---------------------------------------- | -| `collapsed` | `boolean` | No | **Yes** | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `position` | `ControlPosition` | No | **Yes** | -| `ref` | `RefObject` | No | **Yes** | [Referenceable](#referenceable-behavior) | - -### LayersControl.BaseLayer - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| ---------- | ----------- | -------- | ------- | -------------------------------------------- | -| `checked` | `boolean` | No | **Yes** | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `name` | `string` | **Yes** | No | - -### LayersControl.Overlay - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| ---------- | ----------- | -------- | ------- | -------------------------------------------- | -| `checked` | `boolean` | No | **Yes** | -| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | -| `name` | `string` | **Yes** | No | - -### ScaleControl - -[Leaflet reference](https://leafletjs.com/reference.html#control-scale) - -**Props** - -| Prop | Type | Required | Mutable | Behavior | -| --------------- | --------------------------------- | -------- | ------- | ---------------------------------------- | -| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | -| `position` | `ControlPosition` | No | **Yes** | -| `ref` | `RefObject + Hello world + +``` + +### Evented behavior + +Adds support for the `eventHandlers?: LeafletEventHandlerFnMap` prop, adding and removing event listeners. + +```tsx Example component with Evented behavior + { + console.log('marker clicked') + }, + }} +/> +``` + +### Attribution behavior + +Applies to layer components, making their [`attribution`](https://leafletjs.com/reference.html#layer-attribution) prop mutable. + +```tsx Example component with Attribution behavior + +``` + +### Pane behavior + +Applies to layer components, adding support for the [`pane`](https://leafletjs.com/reference.html#layer-pane) prop or context from a [`Pane` component](#pane) ancestor. + +```tsx Example component with pane prop + +``` + +```tsx Example component with Pane ancestor + + + +``` + +### Path behavior + +Applies to [vector layer components](#vector-layers), adding support for a [`pathOptions: PathOptions`](https://leafletjs.com/reference.html#path) mutable prop. + +```tsx Example component with PathOptions behavior + +``` + +### MediaOverlay behavior + +Applies to components using [Leaflet's ImageOverlay class](https://leafletjs.com/reference.html#imageoverlay), adding support for mutable [`bounds: LatLngBounds`](https://leafletjs.com/reference.html#latlngbounds), [`opacity: number`](https://leafletjs.com/reference.html#imageoverlay-opacity) and [`zIndex: number`](https://leafletjs.com/reference.html#imageoverlay-zindex) props. + +```tsx Example component with MediaOverlay behavior +const bounds = new LatLngBounds([40.712216, -74.22655], [40.773941, -74.12544]) + + +``` + +### CircleMarker behavior + +Applies to components using [Leaflet's CircleMarker class](https://leafletjs.com/reference.html#circlemarker), adding support for mutable `center: LatLngExpression` and [`radius: number`](https://leafletjs.com/reference.html#circlemarker-radius) props. + +```tsx Example component with CircleMarker behavior + +``` + +### GridLayer behavior + +Applies to components using [Leaflet's GridLayer class](https://leafletjs.com/reference.html#gridlayer), adding support for mutable [`opacity: number`](https://leafletjs.com/reference.html#gridlayer-opacity) and [`zIndex: number`](https://leafletjs.com/reference.html#gridlayer-zindex) props. + +```tsx Example component with GridLayer behavior + +``` + +### Control behavior + +Applies to [control components](#controls), making their [`position: ControlPosition`](https://leafletjs.com/reference.html#control-position) prop mutable. + +```tsx Example component with Control behavior + +``` + +## UI layers + +### Marker + +[Leaflet reference](https://leafletjs.com/reference.html#marker) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `draggable` | `boolean` | No | **Yes** | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `icon` | `Leaflet.Icon` | No | **Yes** | +| `opacity` | `number` | No | **Yes** | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `position` | `LatLngExpression` | **Yes** | **Yes** | +| `zIndexOffset` | `number` | No | **Yes** | + + + + +```js +import { Marker } from 'https://cdn.skypack.dev/react-leaflet@next/Marker.js' +``` + + + + +```js +import { Marker } from 'react-leaflet/Marker' +``` + + + + +### Popup + +[Leaflet reference](https://leafletjs.com/reference.html#popup) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `position` | `LatLngExpression` | No | **Yes** | + + + + +```js +import { Popup } from 'https://cdn.skypack.dev/react-leaflet@next/Popup.js' +``` + + + + +```js +import { Popup } from 'react-leaflet/Popup' +``` + + + + +### Tooltip + +[Leaflet reference](https://leafletjs.com/reference.html#tooltip) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `position` | `LatLngExpression` | No | **Yes** | + + + + +```js +import { Tooltip } from 'https://cdn.skypack.dev/react-leaflet@next/Tooltip.js' +``` + + + + +```js +import { Tooltip } from 'react-leaflet/Tooltip' +``` + + + + +## Raster layers + +### TileLayer + +[Leaflet reference](https://leafletjs.com/reference.html#tilelayer) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------- | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `opacity` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `url` | `string` | **Yes** | No | +| `zIndex` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | + + + + +```js +import { TileLayer } from 'https://cdn.skypack.dev/react-leaflet@next/TileLayer.js' +``` + + + + +```js +import { TileLayer } from 'react-leaflet/TileLayer' +``` + + + + +### WMSTileLayer + +[Leaflet reference](https://leafletjs.com/reference.html#tilelayer-wms) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------- | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `opacity` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `params` | `WMSParams` | No | **Yes** | +| `url` | `string` | **Yes** | No | +| `zIndex` | `number` | No | **Yes** | [GridLayer](#gridlayer-behavior) | + + + + +```js +import { WMSTileLayer } from 'https://cdn.skypack.dev/react-leaflet@next/WMSTileLayer.js' +``` + + + + +```js +import { WMSTileLayer } from 'react-leaflet/WMSTileLayer' +``` + + + + +### ImageOverlay + +[Leaflet reference](https://leafletjs.com/reference.html#imageoverlay) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `bounds` | `LatLngBounds` | **Yes** | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `opacity` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | +| `url` | `string` | **Yes** | **Yes** | +| `zIndex` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | + + + + +```js +import { ImageOverlay } from 'https://cdn.skypack.dev/react-leaflet@next/ImageOverlay.js' +``` + + + + +```js +import { ImageOverlay } from 'react-leaflet/ImageOverlay' +``` + + + + +### VideoOverlay + +[Leaflet reference](https://leafletjs.com/reference.html#videooverlay) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | ------------------------------------------ | -------- | ------- | -------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `bounds` | `LatLngBounds` | **Yes** | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `play` | `boolean` | No | **Yes** | +| `url` | `string`, `string[]` or `HTMLVideoElement` | **Yes** | **Yes** | +| `zIndex` | `number` | No | **Yes** | [MediaOverlay](#mediaoverlay-behavior) | + + + + +```js +import { VideoOverlay } from 'https://cdn.skypack.dev/react-leaflet@next/VideoOverlay.js' +``` + + + + +```js +import { VideoOverlay } from 'react-leaflet/VideoOverlay' +``` + + + + +## Vector layers + +### Circle + +[Leaflet reference](https://leafletjs.com/reference.html#circle) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `center` | `LatLngExpression` | **Yes** | **Yes** | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | +| `radius` | `number` | **Yes** | **Yes** | + + + + +```js +import { Circle } from 'https://cdn.skypack.dev/react-leaflet@next/Circle.js' +``` + + + + +```js +import { Circle } from 'react-leaflet/Circle' +``` + + + + +### CircleMarker + +[Leaflet reference](https://leafletjs.com/reference.html#circlemarker) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `center` | `LatLngExpression` | **Yes** | **Yes** | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | +| `radius` | `number` | **Yes** | **Yes** | + + + + +```js +import { CircleMarker } from 'https://cdn.skypack.dev/react-leaflet@next/CircleMarker.js' +``` + + + + +```js +import { CircleMarker } from 'react-leaflet/CircleMarker' +``` + + + + +### Polyline + +[Leaflet reference](https://leafletjs.com/reference.html#polyline) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | ---------------------------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | +| `positions` | `LatLngExpression[]` or `LatLngExpression[][]` | **Yes** | **Yes** | + + + + +```js +import { Polyline } from 'https://cdn.skypack.dev/react-leaflet@next/Polyline.js' +``` + + + + +```js +import { Polyline } from 'react-leaflet/Polyline' +``` + + + + +### Polygon + +[Leaflet reference](https://leafletjs.com/reference.html#polygon) + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | ------------------------------------------------------------------------ | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | +| `positions` | `LatLngExpression[]`, `LatLngExpression[][]` or `LatLngExpression[][][]` | **Yes** | **Yes** | + + + + +```js +import { Polygon } from 'https://cdn.skypack.dev/react-leaflet@next/Polygon.js' +``` + + + + +```js +import { Polygon } from 'react-leaflet/Polygon' +``` + + + + +### Rectangle + +[Leaflet reference](https://leafletjs.com/reference.html#rectangle) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `bounds` | `LatLngBoundsExpression` | **Yes** | **Yes** | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `pathOptions` | `PathOptions` | No | **Yes** | [Path](#path-behavior) | + + + + +```js +import { Rectangle } from 'https://cdn.skypack.dev/react-leaflet@next/Rectangle.js' +``` + + + + +```js +import { Rectangle } from 'react-leaflet/Rectangle' +``` + + + + +### SVGOverlay + +[Leaflet reference](https://leafletjs.com/reference.html#svgoverlay) + +**Props** + +The `attributes` must be valid [`SVGSVGElement` properties](https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement). + +| Prop | Type | Required | Mutable | Behavior | +| ------------- | ------------------------ | -------- | ------- | -------------------------------------------- | +| `attributes` | `Record` | No | No | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | + + + + +```js +import { SVGOverlay } from 'https://cdn.skypack.dev/react-leaflet@next/SVGOverlay.js' +``` + + + + +```js +import { SVGOverlay } from 'react-leaflet/SVGOverlay' +``` + + + + +## Other layers + +### LayerGroup + +[Leaflet reference](https://leafletjs.com/reference.html#layergroup) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | + + + + +```js +import { LayerGroup } from 'https://cdn.skypack.dev/react-leaflet@next/LayerGroup.js' +``` + + + + +```js +import { LayerGroup } from 'react-leaflet/LayerGroup' +``` + + + + +### FeatureGroup + +[Leaflet reference](https://leafletjs.com/reference.html#featuregroup) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | + + + + +```js +import { FeatureGroup } from 'https://cdn.skypack.dev/react-leaflet@next/FeatureGroup.js' +``` + + + + +```js +import { FeatureGroup } from 'react-leaflet/FeatureGroup' +``` + + + + +### GeoJSON + +[Leaflet reference](https://leafletjs.com/reference.html#geojson) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------------- | -------- | ------- | -------------------------------------------- | +| `attribution` | `string` | No | **Yes** | [Attribution](#attribution-behavior) | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `data` | `GeoJsonObject` | **Yes** | No | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `style` | `PathOptions` or `StyleFunction` | No | **Yes** | | + + + + +```js +import { GeoJSON } from 'https://cdn.skypack.dev/react-leaflet@next/GeoJSON.js' +``` + + + + +```js +import { GeoJSON } from 'react-leaflet/GeoJSON' +``` + + + + +## Controls + +### ZoomControl + +[Leaflet reference](https://leafletjs.com/reference.html#control-zoom) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | ---------------------------- | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `position` | `ControlPosition` | No | **Yes** | + + + + +```js +import { ZoomControl } from 'https://cdn.skypack.dev/react-leaflet@next/ZoomControl.js' +``` + + + + +```js +import { ZoomControl } from 'react-leaflet/ZoomControl' +``` + + + + +### AttributionControl + +[Leaflet reference](https://leafletjs.com/reference.html#control-attribution) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | ---------------------------- | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `position` | `ControlPosition` | No | **Yes** | + + + + +```js +import { AttributionControl } from 'https://cdn.skypack.dev/react-leaflet@next/AttributionControl.js' +``` + + + + +```js +import { AttributionControl } from 'react-leaflet/AttributionControl' +``` + + + + +### LayersControl + +[Leaflet reference](https://leafletjs.com/reference.html#control-layers) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | ---------------------------- | +| `collapsed` | `boolean` | No | **Yes** | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `position` | `ControlPosition` | No | **Yes** | + + + + +```js +import { LayersControl } from 'https://cdn.skypack.dev/react-leaflet@next/LayersControl.js' +``` + + + + +```js +import { LayersControl } from 'react-leaflet/LayersControl' +``` + + + + +### LayersControl.BaseLayer + +Attached to the [`LayersControl` component](#layerscontrol). + +Note: a `ref` cannot be attached to this element, it should be attached to the child element. + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| ---------- | ----------- | -------- | ------- | -------------------------------------------- | +| `checked` | `boolean` | No | **Yes** | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `name` | `string` | **Yes** | No | + +### LayersControl.Overlay + +Attached to the [`LayersControl` component](#layerscontrol). + +Note: a `ref` cannot be attached to this element, it should be attached to the child element. + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| ---------- | ----------- | -------- | ------- | -------------------------------------------- | +| `checked` | `boolean` | No | **Yes** | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `name` | `string` | **Yes** | No | + +### ScaleControl + +[Leaflet reference](https://leafletjs.com/reference.html#control-scale) + +**Props** + +| Prop | Type | Required | Mutable | Behavior | +| --------------- | -------------------------- | -------- | ------- | ---------------------------- | +| `eventHandlers` | `LeafletEventHandlerFnMap` | No | **Yes** | [Evented](#evented-behavior) | +| `position` | `ControlPosition` | No | **Yes** | + + + + +```js +import { ScaleControl } from 'https://cdn.skypack.dev/react-leaflet@next/ScaleControl.js' +``` + + + + +```js +import { ScaleControl } from 'react-leaflet/ScaleControl' +``` + + + + +## Other + +### Pane + +[Leaflet reference](https://leafletjs.com/reference.html#map-pane) + +**Props** + +:::caution +The `name` prop must be unique to the pane and different from the [default Leaflet pane names](https://leafletjs.com/reference.html#map-pane) +::: + +| Prop | Type | Required | Mutable | Behavior | +| ----------- | --------------- | -------- | ------- | -------------------------------------------- | +| `children` | `ReactNode` | No | **Yes** | [ParentComponent](#parentcomponent-behavior) | +| `className` | `string` | No | No | +| `name` | `string` | **Yes** | No | +| `pane` | `string` | No | No | [Pane](#pane-behavior) | +| `style` | `CSSProperties` | No | No | + + + + +```js +import { Pane } from 'https://cdn.skypack.dev/react-leaflet@next/Pane.js' +``` + + + + +```js +import { Pane } from 'react-leaflet/Pane' +``` + + + diff --git a/packages/website/docs/api-map.md b/packages/website/docs/api-map.mdx similarity index 54% rename from packages/website/docs/api-map.md rename to packages/website/docs/api-map.mdx index 88836c42..4ddefb8f 100644 --- a/packages/website/docs/api-map.md +++ b/packages/website/docs/api-map.mdx @@ -2,9 +2,12 @@ title: Map creation and interactions --- +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + ## MapContainer -The `MapContainer` component is responsible for creating the [Leaflet Map](https://leafletjs.com/reference.html#map) instance and providing it to its [child components](api-components.md), using a [React Context](https://reactjs.org/docs/context.html). +The `MapContainer` component is responsible for creating the [Leaflet Map](https://leafletjs.com/reference.html#map) instance and providing it to its [child components](api-components.mdx), using a [React Context](https://reactjs.org/docs/context.html). When creating a `MapContainer` element, its props are used as options to [create the Map instance](https://leafletjs.com/reference.html#map-l-map). @@ -22,7 +25,31 @@ The following additional props are supported: | `whenReady` | `() => void` | Except for its `children`, `MapContainer` props are **immutable**: changing them after they have been set a first time will have no effect on the Map instance or its container. -The Leaflet `Map` instance created by the `MapContainer` element can be accessed by [child components](api-components.md) using one of [the provided hooks](#hooks) or the [`MapConsumer` component](#mapconsumer). +The Leaflet `Map` instance created by the `MapContainer` element can be accessed by [child components](api-components.mdx) using one of [the provided hooks](#hooks). + + + + +```js +import { MapContainer } from 'https://cdn.skypack.dev/react-leaflet@next/MapContainer.js' +``` + + + + +```js +import { MapContainer } from 'react-leaflet/MapContainer' +``` + + + ## Hooks @@ -46,6 +73,30 @@ function MyMapComponent() { } ``` + + + +```js +import { useMap } from 'https://cdn.skypack.dev/react-leaflet@next/hooks.js' +``` + + + + +```js +import { useMap } from 'react-leaflet/hooks' +``` + + + + ### useMapEvents Hook attaching the provided `LeafletEventHandlerFnMap` event handlers to the map instance and returning the instance in any descendant of a [`MapContainer`](#mapcontainer). @@ -72,6 +123,30 @@ function MyMapComponent() { } ``` + + + +```js +import { useMapEvents } from 'https://cdn.skypack.dev/react-leaflet@next/hooks.js' +``` + + + + +```js +import { useMapEvents } from 'react-leaflet/hooks' +``` + + + + ### useMapEvent Hook attaching a single event handler to the map instance and returning the instance in any descendant of a [`MapContainer`](#mapcontainer). @@ -92,3 +167,27 @@ function MyMapComponent() { ) } ``` + + + + +```js +import { useMapEvent } from 'https://cdn.skypack.dev/react-leaflet@next/hooks.js' +``` + + + + +```js +import { useMapEvent } from 'react-leaflet/hooks' +``` + + + diff --git a/packages/website/docs/core-api.md b/packages/website/docs/core-api.mdx similarity index 100% rename from packages/website/docs/core-api.md rename to packages/website/docs/core-api.mdx diff --git a/packages/website/docs/core-architecture.md b/packages/website/docs/core-architecture.md index b6d6c32c..781164ec 100644 --- a/packages/website/docs/core-architecture.md +++ b/packages/website/docs/core-architecture.md @@ -8,6 +8,10 @@ This page describes the core architecture by presenting how to build an example Most of React Leaflet's public APIs are using the core APIs as described in this page to provide their functionalities. +:::info Bare import identifiers +For simplicity, bare import such as `import L from 'leaflet'` are used in the following examples rather than absolute imports. +::: + ## Identifying necessary Leaflet APIs The first step to implement a component in React Leaflet is to identify the necessary APIs made available by Leaflet and potentially third-party plugins to achieve the desired functionalities. @@ -58,7 +62,7 @@ function MyMap() { } ``` -First, we need to access the context created by the [`MapContainer` component](api-map.md#mapcontainer), by calling the [`useLeafletContext` hook exported by the core APIs](core-api.md#useleafletcontext): +First, we need to access the context created by the [`MapContainer` component](api-map.mdx#mapcontainer), by calling the [`useLeafletContext` hook exported by the core APIs](core-api.mdx#useleafletcontext): ```ts const context = useLeafletContext() @@ -71,7 +75,7 @@ const bounds = L.latLng(props.center).toBounds(props.size) const square = new L.Rectangle(bounds) ``` -The created layer needs to be added to a container provided in the context, either a parent container such as a [`LayerGroup`](api-components.md#layergroup), or the `Map` instance created with the context: +The created layer needs to be added to a container provided in the context, either a parent container such as a [`LayerGroup`](api-components.mdx#layergroup), or the `Map` instance created with the context: ```ts const container = context.layerContainer || context.map @@ -187,7 +191,7 @@ useEffect(() => { ## Element hook factory -The above code gets very repetitive as it's needed for most components in React Leaflet, this is why the core APIs provide functions such as the [`createElementHook` factory](core-api.md#createelementhook) to simplify the process: +The above code gets very repetitive as it's needed for most components in React Leaflet, this is why the core APIs provide functions such as the [`createElementHook` factory](core-api.mdx#createelementhook) to simplify the process: ```tsx {2-3,13-15,17-21,23,27} import { @@ -245,7 +249,7 @@ function MyMap() { } ``` -First, instead of having the Leaflet element creation and updating logic in `useEffect` callbacks, we can extract them to standalone functions implementing the [expected interface](core-api.md#createelementhook) using the [`createElementObject` function](core-api.md#createelementobject): +First, instead of having the Leaflet element creation and updating logic in `useEffect` callbacks, we can extract them to standalone functions implementing the [expected interface](core-api.mdx#createelementhook) using the [`createElementObject` function](core-api.mdx#createelementobject): ```ts function createSquare(props, context) { @@ -282,7 +286,7 @@ useEffect(() => { ## Layer lifecycle hook -The core APIs provide additional hooks to handle specific pieces of logic. Here, we can replace the `useEffect` hook used previously to add and remove the layer by the [`useLayerLifecycle` hook](core-api.md#uselayerlifecycle): +The core APIs provide additional hooks to handle specific pieces of logic. Here, we can replace the `useEffect` hook used previously to add and remove the layer by the [`useLayerLifecycle` hook](core-api.mdx#uselayerlifecycle): ```tsx {4,28} import { @@ -332,7 +336,7 @@ render( ## Higher-level createPathHook -The core APIs also provide higher-level factory functions implementing logic shared by different hooks, such as [`createPathHook`](core-api.md#createpathhook). +The core APIs also provide higher-level factory functions implementing logic shared by different hooks, such as [`createPathHook`](core-api.mdx#createpathhook). Here we can extract the logic previously implemented in the component to a hook factory, and simply call the created hook in the component: ```tsx {4,23,26} @@ -380,11 +384,11 @@ function MyMap() { } ``` -[`createPathHook`](core-api.md#createpathhook) also implements further logic, notably calling the [`useEventHandlers`](core-api.md#useeventhandlers) and [`useLayerLifecycle`](core-api.md#uselayerlifecycle) hooks as well. +[`createPathHook`](core-api.mdx#createpathhook) also implements further logic, notably calling the [`useEventHandlers`](core-api.mdx#useeventhandlers) and [`useLayerLifecycle`](core-api.mdx#uselayerlifecycle) hooks as well. ## Component factory -Following the changes above, we can see that the `Square` component gets very simple as all the logic is implemented in the `useSquare` hook. We can replace it by the [`createLeafComponent` function](core-api.md#createleafcomponent) that implements similar logic: +Following the changes above, we can see that the `Square` component gets very simple as all the logic is implemented in the `useSquare` hook. We can replace it by the [`createLeafComponent` function](core-api.mdx#createleafcomponent) that implements similar logic: ```tsx {4,25} import { @@ -428,11 +432,11 @@ function MyMap() { } ``` -[`createLeafComponent`](core-api.md#createleafcomponent) also provides additional logic in order to make the Leaflet element instance available using React's `ref`. +[`createLeafComponent`](core-api.mdx#createleafcomponent) also provides additional logic in order to make the Leaflet element instance available using React's `ref`. ## Supporting children elements -All the steps above focus on displaying the `Square` element only. However, it is common for React Leaflet components to also have children when possible. Our `Square` being a Leaflet layer, overlays such as [`Popup`](api-components.md#popup) and [`Tooltip`](api-components.md#tooltip) could be attached to it: +All the steps above focus on displaying the `Square` element only. However, it is common for React Leaflet components to also have children when possible. Our `Square` being a Leaflet layer, overlays such as [`Popup`](api-components.mdx#popup) and [`Tooltip`](api-components.mdx#tooltip) could be attached to it: ```tsx {2,6,15,18,30,41-43} import { @@ -483,7 +487,7 @@ function MyMap() { } ``` -In order to support these overlays, we need to update the `createSquare` function to set the created layer as the context's `overlayContainer`. Note that we use the [`extendContext` function](core-api.md#extendcontext) here in order to make the extended context immutable. +In order to support these overlays, we need to update the `createSquare` function to set the created layer as the context's `overlayContainer`. Note that we use the [`extendContext` function](core-api.mdx#extendcontext) here in order to make the extended context immutable. ```ts function createSquare(props, context) { @@ -495,13 +499,13 @@ function createSquare(props, context) { } ``` -We also need to replace the component factory by one taking care of providing the changed context and rendering the children, [`createContainerComponent`](core-api.md#createcontainercomponent): +We also need to replace the component factory by one taking care of providing the changed context and rendering the children, [`createContainerComponent`](core-api.mdx#createcontainercomponent): ```ts const Square = createContainerComponent(useSquare) ``` -In addition to the `createLeafComponent` and `createContainerComponent` functions, [`createOverlayComponent`](core-api.md#createoverlaycomponent) can be used to create overlays such as [`Popup`](api-components.md#popup) and [`Tooltip`](api-components.md#tooltip). +In addition to the `createLeafComponent` and `createContainerComponent` functions, [`createOverlayComponent`](core-api.mdx#createoverlaycomponent) can be used to create overlays such as [`Popup`](api-components.mdx#popup) and [`Tooltip`](api-components.mdx#tooltip). ## Higher-level component factory @@ -516,7 +520,7 @@ const useSquare = createPathHook(useSquareElement) const Square = createContainerComponent(useSquare) ``` -This logic is similar for other types of layers and is therefore provided as a higher-level component factory, [`createPathComponent`](core-api.md#createpathcomponent), as used below: +This logic is similar for other types of layers and is therefore provided as a higher-level component factory, [`createPathComponent`](core-api.mdx#createpathcomponent), as used below: ```tsx {3,26} import { @@ -563,4 +567,4 @@ function MyMap() { } ``` -The core APIs export other [high-level component factories](core-api.md#high-level-component-factories) that can be used in a similar way. +The core APIs export other [high-level component factories](core-api.mdx#high-level-component-factories) that can be used in a similar way. diff --git a/packages/website/docs/core-introduction.md b/packages/website/docs/core-introduction.mdx similarity index 64% rename from packages/website/docs/core-introduction.md rename to packages/website/docs/core-introduction.mdx index dbee2597..17c3b097 100644 --- a/packages/website/docs/core-introduction.md +++ b/packages/website/docs/core-introduction.mdx @@ -2,6 +2,9 @@ title: React Leaflet Core --- +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + ## Introduction React Leaflet's core APIs are implemented in the `@react-leaflet/core` package to provide a separation from the public APIs. @@ -15,7 +18,7 @@ You might want to learn about the core APIs if you want to: - Implement new components not provided by React Leaflet - Simply learn more about how React Leaflet works -If you're only interested in using the public APIs of React Leaflet, their usage is covered in the previous sections of this documentation, notably the [getting started](start-introduction.md) and [public API](api-map.md) pages. +If you're only interested in using the public APIs of React Leaflet, their usage is covered in the previous sections of this documentation, notably the [getting started](start-introduction.md) and [public API](api-map.mdx) pages. ## Installation @@ -23,9 +26,31 @@ The `@react-leaflet/core` package is a dependency of the `react-leaflet` one. Th ## Usage -All the [core APIs](core-api.md) can be imported from the `@react-leaflet/core` package, such as +All the [core APIs](core-api.mdx) can be imported from the `@react-leaflet/core` package, such as + + + + +```js +import { createControlComponent } from 'https://cdn.skypack.dev/@react-leaflet/core@next' +import { Control } from 'https://cdn.skypack.dev/leaflet' + +export const ZoomControl = createControlComponent( + (props) => new Control.Zoom(props), +) +``` + + + -```ts +```js import { createControlComponent } from '@react-leaflet/core' import { Control } from 'leaflet' @@ -34,4 +59,7 @@ export const ZoomControl = createControlComponent( ) ``` + + + The following page presents the architecture and usage in more details. diff --git a/packages/website/docs/extra-plugins.md b/packages/website/docs/extra-plugins.md index e77b7f3c..ddd1cad4 100644 --- a/packages/website/docs/extra-plugins.md +++ b/packages/website/docs/extra-plugins.md @@ -2,6 +2,6 @@ title: Third-party plugins --- -Plugins compatible with React Leaflet v3 can use the `react-leaflet-v3` tag to be [listed on npm](https://www.npmjs.com/search?q=keywords%3Areact-leaflet-v3). +Plugins compatible with React Leaflet v4 can use the `react-leaflet-v4` tag to be [listed on npm](https://www.npmjs.com/search?q=keywords%3Areact-leaflet-v4). These plugins are not officially supported by React Leaflet, please **do not open issues** on React Leaflet's repository about them. diff --git a/packages/website/docs/start-installation.mdx b/packages/website/docs/start-installation.mdx index 29d05825..c70b4bca 100644 --- a/packages/website/docs/start-installation.mdx +++ b/packages/website/docs/start-installation.mdx @@ -21,10 +21,39 @@ Before using React Leaflet, you must setup your project following [Leaflet's Qui ## Adding React Leaflet +:::caution Alpha version +React Leaflet v4 is currently in alpha and will only officially support React v18, even if it works with React v17. +::: + +### Using ESM imports + +React Leaflet export [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) that can be imported by URL, notably from CDNs such as [Skypack](https://www.skypack.dev/): + +```js +import { MapContainer } from 'https://cdn.skypack.dev/react-leaflet@next/MapContainer.js' +import { TileLayer } from 'https://cdn.skypack.dev/react-leaflet@next/TileLayer.js' +import { useMap } from 'https://cdn.skypack.dev/react-leaflet@next/hooks.js' +``` + +Or importing the full library at once: + +```js +import { + MapContainer, + TileLayer, + useMap, +} from 'https://cdn.skypack.dev/react-leaflet@next/index.js' +``` + +### Using a package registry + +A package registry such as [npm](https://www.npmjs.com/) can be used to install React Leaflet and its dependencies. + React, React DOM and Leaflet are required peer dependencies. You must add them to your project if they are not already installed: ```bash -npm install react react-dom leaflet +npm install react@^18.0.0-rc react-dom@^18.0.0-rc leaflet ``` ```bash -yarn add react react-dom leaflet +yarn add react@^18.0.0-rc react-dom@^18.0.0-rc leaflet ``` @@ -50,6 +79,7 @@ Then you can install React Leaflet: ```bash -npm install react-leaflet +npm install react-leaflet@next ``` @@ -71,18 +101,27 @@ yarn add react-leaflet -Finally, you can import the necessary components. For example: +Modules can then be imported using bare specifiers when supported by a bundler such as [webpack](https://webpack.js.org/). + +```js +import { MapContainer } from 'react-leaflet/MapContainer' +import { TileLayer } from 'react-leaflet/TileLayer' +import { useMap } from 'react-leaflet/hooks' +``` + +Alternatively, all the components and hooks can be imported from the module entry-point: ```js -import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet' +import { MapContainer, TileLayer, useMap } from 'react-leaflet' ``` -## Using TypeScript +## TypeScript support React Leaflet provides TypeScript definitions in the installed packages, but needs Leaflet's definitions to be present. If you have not installed them yet, you will need to add them: ` element when rendering the [`MapContainer` component](api-map.md#mapcontainer) and the contents of [UI layers components](api-components.md#ui-layers). +React only renders a `
` element when rendering the [`MapContainer` component](api-map.mdx#mapcontainer) and the contents of [UI layers components](api-components.mdx#ui-layers). ### Component properties @@ -19,11 +19,17 @@ During the first render, all these properties should be supported as they are by Mutable properties changes are compared by reference (unless stated otherwise) and are applied calling the relevant method on the Leaflet element instance. +### Leaflet elements references + +Unless stated otherwise, all components exported by React Leaflet support [refs](https://reactjs.org/docs/glossary.html#refs) exposing the created Leaflet element instance or DOM element (for panes). + +This allows applications to access Leaflet's imperative APIs when required, but may create inconsitencies with props being set and should be used carefully. + ### React context React Leaflet uses [React's context API](https://reactjs.org/docs/context.html) to make some Leaflet elements instances available to children elements that need it. -Each Leaflet map instance has its own React context, created by the [`MapContainer` component](api-map.md#mapcontainer). Other components and hooks provided by React Leaflet can only be used as descendants of a `MapContainer`. +Each Leaflet map instance has its own React context, created by the [`MapContainer` component](api-map.mdx#mapcontainer). Other components and hooks provided by React Leaflet can only be used as descendants of a `MapContainer`. ## Lifecycle process diff --git a/yarn.lock b/yarn.lock index 5c1a58f6..dd793eae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1702,7 +1702,7 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/create-cache-key-function@^27.3.1": +"@jest/create-cache-key-function@^27.4.2": version "27.4.2" resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.4.2.tgz#09b585f9dbafec0f56cfb0e4d4edfe2bec0e0768" integrity sha512-aSSCAJwUNX4R1hJQoyimsND5l+2EsFgzlepS8NuOJJHjXij/UdxYFngac44tmv9IYdI+kglAyORg0plt4/aFMQ== @@ -2098,98 +2098,98 @@ slash "3.0.0" source-map "^0.7.3" -"@swc/core-android-arm-eabi@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.127.tgz#4834adc6d1e8eda34fd72965640f21ae2303ea5a" - integrity sha512-/bF4gupb+96Fi1FmcGFRig9zToQrAIH/2+NgZMDlCESJP1Dio/bbAB59vPllXgTsfvAQsbv26sScm4VmBmgttw== - -"@swc/core-android-arm64@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.127.tgz#3441b2816e36eb509a406e49493db717f54043ff" - integrity sha512-DqSSjaRrZaY23vbYEBwjU0WxPSfAgnabJK8Dx08DQmTrUXAbsvWkF7QyVdsdZuroC1GiJui/slT33xxNnLVVBg== - -"@swc/core-darwin-arm64@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.127.tgz#91db79341e4c8a9dbad5c593adf210963e1f5926" - integrity sha512-9aAS7CZzKKHngdN9eHMDveoVcoiyq6EYRGi46CrRDwiEdZ14DzznYlJ37I71cUz1vHapb4YbIWN5/jxb34r/RA== - -"@swc/core-darwin-x64@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.127.tgz#341907ab5a83e3259fec8f2fce528988d83e04d1" - integrity sha512-GSZHGEhpjWStOdpAJvOPZmIEHTksbKezwnNEq1M27lNaiT8dPfrBWi28z/NfQp8HEpEi5U7hTB41PPIXT66MUA== - -"@swc/core-freebsd-x64@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.127.tgz#be673f1600db5cc15cda253c3d05dbd9b33475fa" - integrity sha512-BJBmcWCSZbdkyq+ZDxvzkvqtz67wgLDsVuAfpIdCEw1KoFTJSxwc6K7dKZqfd68xULnj2aHRFZr0SyK3kXeirg== - -"@swc/core-linux-arm-gnueabihf@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.127.tgz#d392ccf04b92e0a1036e1337061379a165c2ad1b" - integrity sha512-wE6JzkbmQ7Kq5U/BRyE1893//MRrpees7bNvcION5rq9Yd0on2XY7ifaSlGeEEMgO/RRIsHXUJTUjsfY4XVvMQ== - -"@swc/core-linux-arm64-gnu@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.127.tgz#c59d7c75cabbd525a07c6ae46a4b97a75d5e5b55" - integrity sha512-oenvsF18KUNiNvDxHmUwY3uXJoqeienSAPAiWQfThrNOyadVLeKs6ecmkFxoCEZOV05gek4A/hBHImdby0UTcw== - -"@swc/core-linux-arm64-musl@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.127.tgz#a0e66a0e8918991cd4c4f3c03fd99784b9aa8d49" - integrity sha512-R371z8YH3t0uevQA8AfimS5GwBHwoPifpsKjl3sH1LXlYEm+XAw/yUe/z/bRBUx465IhqdNW+ZrUswCtxo1fVw== - -"@swc/core-linux-x64-gnu@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.127.tgz#1d303c1e9620ce7b9a78e52858c8a617f4a44878" - integrity sha512-QAn3KVRQOKmvJxUb/0gNcb4BeFfBVWV+Ry5o4HMfnxdRSLl7sGlDYAbH7V2atM6P/4OT5cpiorQvjCdOXNSS1Q== - -"@swc/core-linux-x64-musl@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.127.tgz#8221ed344e023a465219480f20edf42d0049769e" - integrity sha512-UeBPFWXndeefjcsoW6JBwT5aSdGQpaqqoiA1Sa7aHa87O/Egun2dMawGhTqbyzeKapS70rcZlvaY9UCHj2TEiQ== - -"@swc/core-win32-arm64-msvc@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.127.tgz#4d0a1a3b6153c8ba3cd89ab0bfcdb577126aa31b" - integrity sha512-4S7LZvOo0k121dXZgfE9Rs4DYNOmLy9OXI4kB5wk52B4llfzNhiZjARwqI4f5oqk8znyOuPV8JIzDUnNPzxkTA== - -"@swc/core-win32-ia32-msvc@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.127.tgz#ad2690892d5b600807204ea0e41565e4eb20a6cf" - integrity sha512-7oM0G+1KASIEujhBYD/a6xDwFFhN31pZ34rEfrXvu+lGlx0e5i0q/vHI9fXkxNimMpePCQJ21aTIeCxs0HzZ6g== - -"@swc/core-win32-x64-msvc@1.2.127": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.127.tgz#700f778bfadace84636659a3c4a6c8b64890d8e0" - integrity sha512-AglGNIi5VYJEbrqWiA0VbrKFG0Xta6yBLCy39XQgImgL8yl3R586vNRts+kPv2+hC2MOx9yr8eUXFnKpBCr9hA== - -"@swc/core@^1.2.126": - version "1.2.127" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.127.tgz#c3cfca338df09475d99964c3adb7b3f00441eb98" - integrity sha512-JF2xOOPgKT1XRs5eXiKAk2kV7BwJvPTIfBT79Pk3cEEQzDgxGSs3spVWXHA0EhCbh1MquJgR7bElt0Pyk/CRbg== +"@swc/core-android-arm-eabi@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.129.tgz#4fb265ecaaba17e879be179213b8a81ae7730c72" + integrity sha512-5/q+32xm9Ile5NWJeGKa3UhPrMxjx6rVph7yauJlzOOxPsE3v7vhKhBFBkNMzlscoKbC4PFyu54xaRR8TTvrww== + +"@swc/core-android-arm64@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.129.tgz#7a58be94f9f11516ae91f0960dc9c75c085c1a75" + integrity sha512-e8n8g5BLQFXxOP/t6KY5JlK/40L+opjZyUZb3NHLuvFct7p9j5QpSPR8jkDYBPzvD75N7cPNE1KxPaU7QT5qYQ== + +"@swc/core-darwin-arm64@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.129.tgz#d52a858a960186b8a800f5bd8fcddd5de20dc7d2" + integrity sha512-l86EpZb73PKFaOYR1Wsd3kXCz1/vgBrBLGB9JzKNTiH0yVDtRWl5PonMhntUBdg6AzwZToyeAumLWZ3Xo21GqQ== + +"@swc/core-darwin-x64@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.129.tgz#8f283c71770edec26e22b05e934f75023bf43967" + integrity sha512-yd1hMErfoF4xrjt9jj/qWDtR74/5eCDc4+kSbe/hkZ4lCXaYpE8Po962trPgUd+mCLkW58ElArGP3uEPXvJofQ== + +"@swc/core-freebsd-x64@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.129.tgz#4b885ca8a70a1b5441f8f79b6e065d50835e23bb" + integrity sha512-u0ONxga6YOH1Bt0nihwtWPjLM/nB0x1RfK5R/J1xTZyV3d5AMu4Dp2LQi37K6gT9BIto/h7h2wTuHtgqhIDA+g== + +"@swc/core-linux-arm-gnueabihf@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.129.tgz#1b25b58dfa4146c2ae90fca7ec8a21b77344f3d1" + integrity sha512-Tr3IwKRASqSFJnv1NV+fHunIGh0lqRY89GDwEiGbWnEiEIrviRdFdQd3w+zJk3SQFj9raaZTZoWuAfHduePSwg== + +"@swc/core-linux-arm64-gnu@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.129.tgz#fa1542bb2f1bde31c73e0a75c374868bfd3faa93" + integrity sha512-r0SrNxI1ZLZLvkl3a2UeGBEGiylL9XKKFbrlWebvgsZcRA3fzBiuJ3NVHO0PzE4S4+KvV73sCwA9MusFv28jvQ== + +"@swc/core-linux-arm64-musl@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.129.tgz#09f6cf78ff685e0d5e82ae252947ed3df81ac9b2" + integrity sha512-8BBLmBDsGm+/rrZ8AAk9AktemnVxe1m9csZ5OElzyvqcsHWjqfION657Ae1UEzUtFTzdeP5Lx0WeEqigBu2W8A== + +"@swc/core-linux-x64-gnu@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.129.tgz#95a687b5cb2a8056a5cee1f3c185e29f2103625a" + integrity sha512-iL4sM+0pLD0V2H6QJrkFpvL6hjWzjEMww8peXG/+0b1jXleD0GuN+NuguMmZHEbr64+uqm2KFA9ctKyTBH9aQQ== + +"@swc/core-linux-x64-musl@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.129.tgz#11815cf7055cd40337c0d4391d316e451d54ec42" + integrity sha512-4RKrA1KhQVx6no5AxO7lqwnijYAx1GQ1v0xywiiYSrQkDxi2Q+yAqxDvWS9UT2LtEaOO9HzCr3vWEoHp+wDd2w== + +"@swc/core-win32-arm64-msvc@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.129.tgz#055fd3513321743dc4304ba9b62122de200033ca" + integrity sha512-Qrh0vytLHzkZezHemNcZFQSj3AQ559WA35Dwzt7BO6a0UvwjHAJHdKSIaF8pYeVdr44VcwqcS0BO9D7rDHWNkQ== + +"@swc/core-win32-ia32-msvc@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.129.tgz#bb4c28edcf3affec83a624112978523bd85d332f" + integrity sha512-wXUqCoQeH0ktOEPkAJXwt4KAhrChmDJD82ydJzkrDFyFyQnY5axBFDLX1XespsI5eNRxzag/FemewMbagnHoSw== + +"@swc/core-win32-x64-msvc@1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.129.tgz#122f747a5f80777aa2f94d835067fb3602a7cedb" + integrity sha512-SqfiGn1KTlunTK42gtJ7XUP0IaVkYKQAfBEP6PT+t5xoQVcxOla5lR8cvoN5b2wQkFUL/yLkc+HuFjzi5vdppg== + +"@swc/core@^1.2.129": + version "1.2.129" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.129.tgz#58f1b9f402d2c82fc6d0393cb2011621838c5f1c" + integrity sha512-Ay2Vt/uI+vRn6Nu5nRTjcuRlXejN5VfYOCCsNGqA5DIrhO0VSwxyOncL/kYlGtzE5XhYBE5eU8QIkRC+koI/fw== dependencies: "@node-rs/helper" "^1.0.0" optionalDependencies: - "@swc/core-android-arm-eabi" "1.2.127" - "@swc/core-android-arm64" "1.2.127" - "@swc/core-darwin-arm64" "1.2.127" - "@swc/core-darwin-x64" "1.2.127" - "@swc/core-freebsd-x64" "1.2.127" - "@swc/core-linux-arm-gnueabihf" "1.2.127" - "@swc/core-linux-arm64-gnu" "1.2.127" - "@swc/core-linux-arm64-musl" "1.2.127" - "@swc/core-linux-x64-gnu" "1.2.127" - "@swc/core-linux-x64-musl" "1.2.127" - "@swc/core-win32-arm64-msvc" "1.2.127" - "@swc/core-win32-ia32-msvc" "1.2.127" - "@swc/core-win32-x64-msvc" "1.2.127" - -"@swc/jest@^0.2.15": - version "0.2.15" - resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.15.tgz#e0418c88bce0c9ad49ba78a5fb29f7ba33490da9" - integrity sha512-Ja+YCVPOGPX/nFnPvPKaWpx2HUwrtuvHP1onHOey1gNGhq8CktQ7xQhCFSuyYBQJiW3WOZ+qMsv3aZk1XUBSOg== - dependencies: - "@jest/create-cache-key-function" "^27.3.1" + "@swc/core-android-arm-eabi" "1.2.129" + "@swc/core-android-arm64" "1.2.129" + "@swc/core-darwin-arm64" "1.2.129" + "@swc/core-darwin-x64" "1.2.129" + "@swc/core-freebsd-x64" "1.2.129" + "@swc/core-linux-arm-gnueabihf" "1.2.129" + "@swc/core-linux-arm64-gnu" "1.2.129" + "@swc/core-linux-arm64-musl" "1.2.129" + "@swc/core-linux-x64-gnu" "1.2.129" + "@swc/core-linux-x64-musl" "1.2.129" + "@swc/core-win32-arm64-msvc" "1.2.129" + "@swc/core-win32-ia32-msvc" "1.2.129" + "@swc/core-win32-x64-msvc" "1.2.129" + +"@swc/jest@^0.2.17": + version "0.2.17" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.17.tgz#0a36083cf5bca39c3c03323cdfc84b61fd670ac2" + integrity sha512-n/g989+O8xxMcTZnP0phDrrgezGZBQBf7cX4QuzEsn07QkWbqmMsfaCxdF0kzajXublXWJ8yk5vRe3VNk1tczA== + dependencies: + "@jest/create-cache-key-function" "^27.4.2" "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -2582,14 +2582,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz#382182d5cb062f52aac54434cfc47c28898c8006" - integrity sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ== +"@typescript-eslint/eslint-plugin@^5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz#e5a86d7e1f9dc0b3df1e6d94feaf20dd838d066c" + integrity sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/type-utils" "5.9.0" + "@typescript-eslint/experimental-utils" "5.9.1" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/type-utils" "5.9.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -2608,15 +2608,15 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/experimental-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz#652762d37d6565ef07af285021b8347b6c79a827" - integrity sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g== +"@typescript-eslint/experimental-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz#8c407c4dd5ffe522329df6e4c9c2b52206d5f7f1" + integrity sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -2631,30 +2631,30 @@ "@typescript-eslint/typescript-estree" "3.10.1" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/parser@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.0.tgz#fdbb08767a4caa6ca6ccfed5f9ffe9387f0c7d97" - integrity sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ== +"@typescript-eslint/parser@^5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" + integrity sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g== dependencies: - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz#02dfef920290c1dcd7b1999455a3eaae7a1a3117" - integrity sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg== +"@typescript-eslint/scope-manager@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" + integrity sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ== dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" -"@typescript-eslint/type-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz#fd5963ead04bc9b7af9c3a8e534d8d39f1ce5f93" - integrity sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ== +"@typescript-eslint/type-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz#c6832ffe655b9b1fec642d36db1a262d721193de" + integrity sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" + "@typescript-eslint/experimental-utils" "5.9.1" debug "^4.3.2" tsutils "^3.21.0" @@ -2663,10 +2663,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== -"@typescript-eslint/types@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" - integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== +"@typescript-eslint/types@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" + integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== "@typescript-eslint/typescript-estree@3.10.1": version "3.10.1" @@ -2682,13 +2682,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" - integrity sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw== +"@typescript-eslint/typescript-estree@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" + integrity sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A== dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" @@ -2702,12 +2702,12 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@typescript-eslint/visitor-keys@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" - integrity sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw== +"@typescript-eslint/visitor-keys@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" + integrity sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg== dependencies: - "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/types" "5.9.1" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -4833,6 +4833,11 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== +eslint-visitor-keys@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" + integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== + eslint@^7.9.0: version "7.32.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" @@ -4879,10 +4884,10 @@ eslint@^7.9.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -eslint@^8.6.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.6.0.tgz#4318c6a31c5584838c1a2e940c478190f58d558e" - integrity sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw== +eslint@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c" + integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" @@ -4891,11 +4896,10 @@ eslint@^8.6.0: cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.1.0" + eslint-visitor-keys "^3.2.0" espree "^9.3.0" esquery "^1.4.0" esutils "^2.0.2" @@ -4904,7 +4908,7 @@ eslint@^8.6.0: functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.6.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" @@ -4915,9 +4919,7 @@ eslint@^8.6.0: minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" regexpp "^3.2.0" - semver "^7.2.1" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" @@ -6602,7 +6604,7 @@ jest-resolve-dependencies@^27.4.6: jest-regex-util "^27.4.0" jest-snapshot "^27.4.6" -jest-resolve@^27.4.6: +jest-resolve@^27.2.5, jest-resolve@^27.4.6: version "27.4.6" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.6.tgz#2ec3110655e86d5bfcfa992e404e22f96b0b5977" integrity sha512-SFfITVApqtirbITKFAO7jOVN45UgFzcRdQanOFzjnbd+CACDoyeX7206JyU92l4cRr73+Qy/TlW51+4vHGt+zw== @@ -9846,6 +9848,13 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +ts-jest-resolver@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ts-jest-resolver/-/ts-jest-resolver-2.0.0.tgz#45ff6b328b32748bb0bd39a7aa0da0fa45589f3f" + integrity sha512-yr/lgqJtVBUXhnaxD5Es0XFGHoIYT6NgbUW1VUiAPTEDINHByiUfcnfDf6VOK3CRibqaqWyTEAppBBcXeIuGAw== + dependencies: + jest-resolve "^27.2.5" + tsconfig-paths@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" @@ -9873,83 +9882,83 @@ tsutils@^3.17.1, tsutils@^3.21.0: dependencies: tslib "^1.8.1" -turbo-darwin-64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.0.24.tgz#f135baff0e44f9160c9b027e8c4dd2d5c8bb10a7" - integrity sha512-A65Wxp+jBMfI3QX2uObX6DKvk+TxNXTf7ufQTHvRSLeAreB8QiVzJdYE0nC6YdrRwfPgFY3L72dhYd2v8ouXDg== - -turbo-darwin-arm64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.0.24.tgz#c360d7cc6a7403855733e3aebb841b1227fbbb2e" - integrity sha512-31zfexqUhvk/CIfAUk2mwjlpEjIURXu4QG8hoWlGxpcpAhlnkIX6CXle+LoQSnU3+4EbNe2SE92fYXsT/SnHAg== - -turbo-freebsd-64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-freebsd-64/-/turbo-freebsd-64-1.0.24.tgz#9ef8914e7d1aaa995a8001a0ad81f7cc4520d332" - integrity sha512-vZYbDkOHH5eeQrxsAYldrh2nDY884irtmgJdGbpjryJgnJx+xzriZfoFalm/d1ZfG3ArENRJqGU+k6BriefZzw== - -turbo-freebsd-arm64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-freebsd-arm64/-/turbo-freebsd-arm64-1.0.24.tgz#12644e8f1b077f9d7afb367f2b8c2a2e0592ca72" - integrity sha512-TDIu1PlyusY8AB69KGM4wGrCjtfbzmVF4Hlgf9mVeSWVKzqkRASorOEq1k8KvfZ+sBTS2GBMpqwpa1KVkYpVhw== - -turbo-linux-32@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-32/-/turbo-linux-32-1.0.24.tgz#6129f7560f5c48214c1724ae7e8196dedc56de21" - integrity sha512-lhhK7914sUtuWYcDO8LV7NQkvTIwpAZlYH0XEOC/OTiYRQJvtKbEySLvefvtwuGjx7cGNI6OYraUsY3WWoK3FA== - -turbo-linux-64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.0.24.tgz#221e3e14037e8fc3108e12a62de209d8a47f0348" - integrity sha512-EbfdrkwVsHDG7AIVQ1enWHoD6riAApx4VRAuFcQHTvJU9e+BuOQBMjb7e9jO4mUrpumtN3n20tP+86odRwsk5g== - -turbo-linux-arm64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.0.24.tgz#95891e7d4375ccbf2478677568557948be33717a" - integrity sha512-H4rqlgP2L7G3iAB/un/7DclExzLUkQ1NoZ0p/1Oa7Wb8H1YUlc8GkwUmpIFd5AOFSPL75DjYvlS8T5Tm23i+1A== - -turbo-linux-arm@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-arm/-/turbo-linux-arm-1.0.24.tgz#f5acb74170a8b5a787915e799e7b52840c7c6982" - integrity sha512-lCNDVEkwxcn0acyPFVJgV5N5vKAP4LfXb+8uW/JpGHVoPHSONKtzYQG05J1KbHXpIjUT+DNgFtshtsdZYOewZQ== - -turbo-linux-mips64le@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-mips64le/-/turbo-linux-mips64le-1.0.24.tgz#f2cc99570222ac42fdcc0d0638f13bc0176859f9" - integrity sha512-AmrgQUDIe9AdNyh5YrI6pfMTUHD/gYfbylNmedLuN5Al3xINdZObcISzd/7VWd+V8wNW/1b9lUnt70Rv/KExfA== - -turbo-linux-ppc64le@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-linux-ppc64le/-/turbo-linux-ppc64le-1.0.24.tgz#4d9508290d24cfdbaca24e57d8bcd0127281e2ed" - integrity sha512-+6ESjsfrvRUr1AsurNcRTrqYr+XHG8g763+hXLog1MP9mn1cufZqWlAyE4G8/MLXDHsEKgK+tXqPLIyLBRjLEw== - -turbo-windows-32@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-windows-32/-/turbo-windows-32-1.0.24.tgz#2bf906c0cc9d675afc4693221fc339ade29e6c13" - integrity sha512-pqRys+FfHxuLVmW/AariITL5qpItp4WPAsYnWLx4u7VpCOO/qmTAI/SL7/jnTm4gxjBv3uf//lisu0AvEZd+TA== - -turbo-windows-64@1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.0.24.tgz#5dd30b10110f2bb69caa479ddd72b4c471fb0dea" - integrity sha512-YHAWha5XkW0Ate1HtwhzFD32kZFXtC8KB4ReEvHc9GM2inQob1ZinvktS0xi5MC5Sxl9+bObOWmsxeZPOgNCFA== - -turbo@^1.0.24: - version "1.0.24" - resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.0.24.tgz#5efdeb44aab2f5e97b24a3e0ed4a159bfcd0a877" - integrity sha512-bfOr7iW48+chDl+yKiZ5FIWzXOF6xOIyrAGPaWI+I5CdD27IZCEGvqvTV/weaHvjLbV7otybHQ56XCybBlVjoA== +turbo-darwin-64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.0.28.tgz#662392368698c4e698b31871f0953836872f7b0e" + integrity sha512-uvARrncW6HNTFi7PFe4sq4JqSOKs1vPgWjJjOEyVhsCFwBgYkXxYsJSdDfO8OhvJa3wv+eYFAK5RaUCk80Z8eg== + +turbo-darwin-arm64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.0.28.tgz#3ba1a6f9a960321391b8cf809ed8fab0276a499d" + integrity sha512-d/ANU+RIq4Fx/MphkqFThvwOpb+NYDuR+07aV5w8cwI7ljw7hPAe3EW3CSlkPJhvjs6P/oh+F86jhh1Q581mVA== + +turbo-freebsd-64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-freebsd-64/-/turbo-freebsd-64-1.0.28.tgz#f94e39dc455573c0a42f96f1a84649b252bf0571" + integrity sha512-JMJWftuWhJan+Momc39vbbwaLYEcMpYyBxIrumyIrIkQVaiSKs/6oEFzh1YA+KE16kAgzTPJPXFDkmsY3idAQg== + +turbo-freebsd-arm64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-freebsd-arm64/-/turbo-freebsd-arm64-1.0.28.tgz#5551f5c67a82a16ce1ba3193410764bae0849d1a" + integrity sha512-fGJNE8qJUhosaIK5sGBheeve9y074FLWv8KfYuXMyV/6+dxpNV60HoAFvw8tL3q8TNp47pU6x8e8h+u1/rn1wQ== + +turbo-linux-32@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-32/-/turbo-linux-32-1.0.28.tgz#742340e6ca7d77c4fb884159bbc8c7faa8d61026" + integrity sha512-fE0qIExxYuVFo5WlVWY0DJ1YZ/w+EC9RheT9nc1tU2EK83XPE1CZFW4lFIsWsXnIy9337zUeNDFVoVxOxCBSUQ== + +turbo-linux-64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.0.28.tgz#167acbd2899c0da9252f755ae74d619aaf99efe6" + integrity sha512-e+f/O1MlcKCMhJf10q1x+1KSImHwuFUW2+A6DbLk+ekBUW5RELC2qF7hGypCzcpm8xIqtj5A0kP3blFy60AMxw== + +turbo-linux-arm64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.0.28.tgz#785415e2a04125a69c7b1d45073150dbab3985f6" + integrity sha512-zN0nQClxp4nP4edinbdTd/9CpPjgNPsULc8LgunuJD+B9A0NRcRP5NCDo8/6ctTWs456sE3UhUF3t2b+uEgDzw== + +turbo-linux-arm@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-arm/-/turbo-linux-arm-1.0.28.tgz#f6de485aa732ba14cc1c851ba30b0f0a901507f3" + integrity sha512-PbB/RzN4W9M6sNZTvcjmc3PZ2S4CeFyQv/53tSs82pIlwM7NKVJzxVC0j3xCtoqoDDgXoJBhCpPV7MUEjCARQg== + +turbo-linux-mips64le@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-mips64le/-/turbo-linux-mips64le-1.0.28.tgz#4f993f387d90fa99037ad9592e98648fdb9ca608" + integrity sha512-7LKmFS9M+AKW5slTHLz00Y4ovZh2CpjgMUkNNC6qtJB8YyWwXwoU0U7Yz28q3+rNVkcEiqWWx4l1Tj1AotTlaA== + +turbo-linux-ppc64le@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-linux-ppc64le/-/turbo-linux-ppc64le-1.0.28.tgz#053163e9042790102ceb1d299a3b79b1aa197be4" + integrity sha512-R382Op75XxcIiY1pWPnVnefxOeVbrVAeABIHLL1hKetbu9UPNzKAnQKqJYGzKIdTRKtPh5CQuErEFzs/Ky2ZgA== + +turbo-windows-32@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-windows-32/-/turbo-windows-32-1.0.28.tgz#b2b735fa56182aaf4095c9e4555fcf39ba050561" + integrity sha512-SjDgimlD5TMvkrFRtsJb4uVP7T44gwr0HqiIpAuWj1m5d8Pz/OisOoUkM/ISPKqVycIU5JF8wx0+CTnxC7YNhQ== + +turbo-windows-64@1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.0.28.tgz#7a2ad6f8416f04f20a1445c8b7123b80c6b16583" + integrity sha512-nT7bgcdl/9QNGBiwCYwTQ2VszcsqJ4NqT4YkE954KFZYxgSwMjjVTdoXcsnXMHpWiMiYfFF7HZLecUNnDm1uUA== + +turbo@^1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.0.28.tgz#fb33cecd2d025e3140ddbcc8c274f0ed7328f09d" + integrity sha512-5xmyVabNYqA0sCAU4VLdUS2A6GwIyy8FTszB/Fx4eNHwHudQwo00F2qORcDFwBHE4MqtnRoBFhL3ZJzo8c9A2w== optionalDependencies: - turbo-darwin-64 "1.0.24" - turbo-darwin-arm64 "1.0.24" - turbo-freebsd-64 "1.0.24" - turbo-freebsd-arm64 "1.0.24" - turbo-linux-32 "1.0.24" - turbo-linux-64 "1.0.24" - turbo-linux-arm "1.0.24" - turbo-linux-arm64 "1.0.24" - turbo-linux-mips64le "1.0.24" - turbo-linux-ppc64le "1.0.24" - turbo-windows-32 "1.0.24" - turbo-windows-64 "1.0.24" + turbo-darwin-64 "1.0.28" + turbo-darwin-arm64 "1.0.28" + turbo-freebsd-64 "1.0.28" + turbo-freebsd-arm64 "1.0.28" + turbo-linux-32 "1.0.28" + turbo-linux-64 "1.0.28" + turbo-linux-arm "1.0.28" + turbo-linux-arm64 "1.0.28" + turbo-linux-mips64le "1.0.28" + turbo-linux-ppc64le "1.0.28" + turbo-windows-32 "1.0.28" + turbo-windows-64 "1.0.28" type-check@^0.4.0, type-check@~0.4.0: version "0.4.0"