Merge pull request #6432 from tchak/update-dependencies

Mise à jour des dépendances Javascript (#6432)
This commit is contained in:
Pierre de La Morinerie 2021-08-31 11:53:00 -05:00 committed by GitHub
commit b709a160fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 657 additions and 419 deletions

View file

@ -44,16 +44,11 @@ function MapEditor({ featureCollection, url, options, preview }) {
enabled: !preview,
cadastreEnabled
});
const {
style,
layers,
setStyle,
setLayerEnabled,
setLayerOpacity
} = useMapStyle(options.layers, {
onStyleChange,
cadastreEnabled
});
const { style, layers, setStyle, setLayerEnabled, setLayerOpacity } =
useMapStyle(options.layers, {
onStyleChange,
cadastreEnabled
});
if (!isSupported) {
return (

View file

@ -133,25 +133,20 @@ export function useMapboxEditor(
);
const addEventListeners = useCallback((events) => {
const unsubscribe = Object.entries(
events
).map(([eventName, [target, callback]]) =>
addEventListener(eventName, target, callback)
const unsubscribe = Object.entries(events).map(
([eventName, [target, callback]]) =>
addEventListener(eventName, target, callback)
);
return () => unsubscribe.map((unsubscribe) => unsubscribe());
}, []);
const {
createFeatures,
updateFeatures,
deleteFeatures,
...props
} = useFeatureCollection(featureCollection, {
url,
enabled: isSupported && enabled,
addFeatures,
removeFeatures
});
const { createFeatures, updateFeatures, deleteFeatures, ...props } =
useFeatureCollection(featureCollection, {
url,
enabled: isSupported && enabled,
addFeatures,
removeFeatures
});
const onStyleChange = useCallback(() => {
if (mapRef.current) {

View file

@ -13,20 +13,10 @@ import { useMapbox } from './useMapbox';
const Mapbox = ReactMapboxGl({});
const MapReader = ({ featureCollection, options }) => {
const {
isSupported,
onLoad,
onStyleChange,
onMouseEnter,
onMouseLeave
} = useMapbox(featureCollection);
const {
style,
layers,
setStyle,
setLayerEnabled,
setLayerOpacity
} = useMapStyle(options.layers, { onStyleChange });
const { isSupported, onLoad, onStyleChange, onMouseEnter, onMouseLeave } =
useMapbox(featureCollection);
const { style, layers, setStyle, setLayerEnabled, setLayerOpacity } =
useMapStyle(options.layers, { onStyleChange });
if (!isSupported) {
return (

View file

@ -1,5 +1,6 @@
import React from 'react';
import { createPortal } from 'react-dom';
import PropTypes from 'prop-types';
export function FlashMessage({ message, level, sticky, fixed }) {
return createPortal(
@ -22,3 +23,10 @@ function flashClassName(level, sticky = false, fixed = false) {
}
return className.join(' ');
}
FlashMessage.propTypes = {
message: PropTypes.string,
level: PropTypes.string,
sticky: PropTypes.bool,
fixed: PropTypes.bool
};

View file

@ -198,8 +198,7 @@ export default {
sources: {
'decoupage-administratif': {
type: 'vector',
url:
'https://openmaptiles.geo.data.gouv.fr/data/decoupage-administratif.json'
url: 'https://openmaptiles.geo.data.gouv.fr/data/decoupage-administratif.json'
},
openmaptiles: {
type: 'vector',

View file

@ -99,9 +99,8 @@ export default class AutoUploadController {
}
_hideErrorMessage() {
let errorElement = this.input.parentElement.querySelector(
'.attachment-error'
);
let errorElement =
this.input.parentElement.querySelector('.attachment-error');
if (errorElement) {
hide(errorElement);
}

View file

@ -1,25 +1,25 @@
{
"dependencies": {
"@babel/preset-react": "^7.12.13",
"@babel/preset-react": "^7.14.5",
"@headlessui/react": "^1.3.0",
"@heroicons/react": "^1.0.1",
"@mapbox/mapbox-gl-draw": "^1.2.2",
"@popperjs/core": "^2.9.2",
"@rails/actiontext": "^6.0.3",
"@rails/activestorage": "^6.0.3",
"@rails/ujs": "^6.0.3",
"@rails/actiontext": "^6.1.4-1",
"@rails/activestorage": "^6.1.4-1",
"@rails/ujs": "^6.1.4-1",
"@rails/webpacker": "5.1.1",
"@reach/combobox": "^0.13.0",
"@reach/slider": "^0.15.0",
"@reach/visually-hidden": "^0.15.2",
"@sentry/browser": "6.9.0",
"@sentry/browser": "6.11.0",
"@tmcw/togeojson": "^4.3.0",
"babel-plugin-macros": "^2.8.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"chartkick": "^3.2.0",
"core-js": "^3.6.5",
"debounce": "^1.2.0",
"dom4": "^2.1.5",
"debounce": "^1.2.1",
"dom4": "^2.1.6",
"email-butler": "^1.0.13",
"highcharts": "^9.0.0",
"intersection-observer": "^0.12.0",
@ -44,13 +44,13 @@
"devDependencies": {
"@2fd/graphdoc": "^2.4.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.22.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"netlify-cli": "^2.61.2",
"prettier": "^2.0.5",
"prettier": "^2.3.2",
"webpack-bundle-analyzer": "^3.7.0",
"webpack-dev-server": "^3.11.0"
},

978
yarn.lock

File diff suppressed because it is too large Load diff