From 2cd9cdb91b0ece840901a81c7622e781f3f0909d Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Mon, 11 Sep 2023 14:37:45 +0300 Subject: [PATCH 01/10] - added a map that contains the bus operators' images with the according operator_id - there are two different approaches to solve this issue: 1. add craco and load the images dynamically using require.context 2. use the second approach I commented in the code --- src/pages/RealtimeMapPage.tsx | 51 ++++++++---- src/pages/SingleLineMapPage.tsx | 19 +++++ src/pages/components/MapLayers/BusLayer.tsx | 60 ++++++++++---- .../utils/SvgComponent/SvgComponent.tsx | 15 ++++ .../utils/SvgComponent/imagesMap.tsx | 83 +++++++++++++++++++ src/resources/bus-logos/10.svg | 18 ++++ src/resources/bus-logos/14.svg | 18 ++++ src/resources/bus-logos/15.svg | 30 +++++++ src/resources/bus-logos/16.svg | 18 ++++ src/resources/bus-logos/18.svg | 18 ++++ src/resources/bus-logos/2.svg | 18 ++++ src/resources/bus-logos/20.svg | 18 ++++ src/resources/bus-logos/21.svg | 18 ++++ src/resources/bus-logos/23.svg | 18 ++++ src/resources/bus-logos/24.svg | 18 ++++ src/resources/bus-logos/25.svg | 18 ++++ src/resources/bus-logos/3.svg | 18 ++++ src/resources/bus-logos/31.svg | 18 ++++ src/resources/bus-logos/32.svg | 18 ++++ src/resources/bus-logos/34.svg | 18 ++++ src/resources/bus-logos/35.svg | 18 ++++ src/resources/bus-logos/37.svg | 18 ++++ src/resources/bus-logos/38.svg | 18 ++++ src/resources/bus-logos/4.svg | 18 ++++ src/resources/bus-logos/42.svg | 14 ++++ src/resources/bus-logos/44.svg | 14 ++++ src/resources/bus-logos/45.svg | 11 +++ src/resources/bus-logos/47.svg | 11 +++ src/resources/bus-logos/49.svg | 14 ++++ src/resources/bus-logos/5.svg | 18 ++++ src/resources/bus-logos/50.svg | 14 ++++ src/resources/bus-logos/51.svg | 11 +++ src/resources/bus-logos/6.svg | 18 ++++ src/resources/bus-logos/7.svg | 18 ++++ src/resources/bus-logos/8.svg | 18 ++++ src/resources/bus-logos/91.svg | 18 ++++ src/resources/bus-logos/93.svg | 18 ++++ src/resources/bus-logos/97.svg | 18 ++++ src/resources/bus-logos/98.svg | 31 +++++++ src/resources/bus-logos/default.svg | 11 +++ 40 files changed, 804 insertions(+), 35 deletions(-) create mode 100644 src/pages/components/utils/SvgComponent/SvgComponent.tsx create mode 100644 src/pages/components/utils/SvgComponent/imagesMap.tsx create mode 100644 src/resources/bus-logos/10.svg create mode 100644 src/resources/bus-logos/14.svg create mode 100644 src/resources/bus-logos/15.svg create mode 100644 src/resources/bus-logos/16.svg create mode 100644 src/resources/bus-logos/18.svg create mode 100644 src/resources/bus-logos/2.svg create mode 100644 src/resources/bus-logos/20.svg create mode 100644 src/resources/bus-logos/21.svg create mode 100644 src/resources/bus-logos/23.svg create mode 100644 src/resources/bus-logos/24.svg create mode 100644 src/resources/bus-logos/25.svg create mode 100644 src/resources/bus-logos/3.svg create mode 100644 src/resources/bus-logos/31.svg create mode 100644 src/resources/bus-logos/32.svg create mode 100644 src/resources/bus-logos/34.svg create mode 100644 src/resources/bus-logos/35.svg create mode 100644 src/resources/bus-logos/37.svg create mode 100644 src/resources/bus-logos/38.svg create mode 100644 src/resources/bus-logos/4.svg create mode 100644 src/resources/bus-logos/42.svg create mode 100644 src/resources/bus-logos/44.svg create mode 100644 src/resources/bus-logos/45.svg create mode 100644 src/resources/bus-logos/47.svg create mode 100644 src/resources/bus-logos/49.svg create mode 100644 src/resources/bus-logos/5.svg create mode 100644 src/resources/bus-logos/50.svg create mode 100644 src/resources/bus-logos/51.svg create mode 100644 src/resources/bus-logos/6.svg create mode 100644 src/resources/bus-logos/7.svg create mode 100644 src/resources/bus-logos/8.svg create mode 100644 src/resources/bus-logos/91.svg create mode 100644 src/resources/bus-logos/93.svg create mode 100644 src/resources/bus-logos/97.svg create mode 100644 src/resources/bus-logos/98.svg create mode 100644 src/resources/bus-logos/default.svg diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/RealtimeMapPage.tsx index bc7249e8..32d8b179 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/RealtimeMapPage.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo, useState } from 'react' import { MapContainer, useMap, Marker, Popup, TileLayer, Polyline } from 'react-leaflet' // import https://www.svgrepo.com/show/113626/bus-front.svg -import busIcon from '../resources/bus-front.svg' +import defaultIcon from '../resources/bus-front.svg' import MarkerClusterGroup from 'react-leaflet-cluster' import { TEXTS } from 'src/resources/texts' @@ -12,6 +12,9 @@ import { VehicleLocation } from 'src/model/vehicleLocation' import getAgencyList, { Agency } from 'src/api/agencyList' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' import { Spin } from 'antd' +// import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' +import svgsMap from './components/utils/SvgComponent/imagesMap' +import operatorIdToSvg from './components/utils/SvgComponent/imagesMap' export interface Point { loc: [number, number] @@ -30,33 +33,28 @@ interface Path { } export const colorIcon = ({ + busIcon, color, name, rotate = 0, }: { + busIcon: React.FunctionComponent> color: string name?: string rotate?: number }) => { + /* TODO: 2nd approach + const icon = (busIcon as any)?.default ?? defaultIcon + */ return new DivIcon({ className: 'my-div-icon', - html: `
-
-
-
${name}
+ html: ` + + +
${name}
`, }) } @@ -210,9 +208,21 @@ export default function RealtimeMapPage() { export function Markers({ positions }: { positions: Point[] }) { const map = useMap() const [agencyList, setAgencyList] = useState([]) + /* + TODO: 2nd approach + const [svgs, setSvgs] = useState(() => new Map()) + */ useEffect(() => { getAgencyList().then(setAgencyList) + /*TODO: 2nd approach + getAgencyList().then((agencyList) => { + setAgencyList(agencyList) + agencyList.forEach(async (agency) => { + const icon = await getSvgFromOperatorId(agency.operator_ref) + setSvgs(new Map(svgs.set(agency.operator_ref, icon))) + }) + })*/ }, []) useEffect(() => { @@ -228,6 +238,11 @@ export function Markers({ positions }: { positions: Point[] }) { + >,*/ + busIcon: operatorIdToSvg(pos.operator), color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator)?.agency_name, rotate: pos.bearing, diff --git a/src/pages/SingleLineMapPage.tsx b/src/pages/SingleLineMapPage.tsx index a0932746..6f8e06f9 100644 --- a/src/pages/SingleLineMapPage.tsx +++ b/src/pages/SingleLineMapPage.tsx @@ -26,6 +26,9 @@ import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' import { Spin } from 'antd' +// import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' +// import svgsMap from './components/utils/SvgComponent/imagesMap' +import operatorIdToSvg from './components/utils/SvgComponent/imagesMap' interface Path { locations: VehicleLocation[] @@ -44,11 +47,22 @@ const SingleLineMapPage = () => { const { operatorId, lineNumber, timestamp, routes, routeKey } = search const [routesIsLoading, setRoutesIsLoading] = useState(false) + /* TODO: 2nd approach + const [svgs, setSvgs] = useState(() => new Map()) + */ const [agencyList, setAgencyList] = useState([]) useEffect(() => { getAgencyList().then(setAgencyList) + /* TODO: 2nd approach + getAgencyList().then((agencyList) => { + setAgencyList(agencyList) + agencyList.forEach(async (agency) => { + const icon = await getSvgFromOperatorId(agency.operator_ref) + setSvgs(new Map(svgs.set(agency.operator_ref, icon))) + }) + })*/ }, []) useEffect(() => { @@ -170,6 +184,11 @@ const SingleLineMapPage = () => { + >,*/ + busIcon: operatorIdToSvg(pos.operator), color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator) ?.agency_name, diff --git a/src/pages/components/MapLayers/BusLayer.tsx b/src/pages/components/MapLayers/BusLayer.tsx index 4d290080..12006a82 100644 --- a/src/pages/components/MapLayers/BusLayer.tsx +++ b/src/pages/components/MapLayers/BusLayer.tsx @@ -1,40 +1,50 @@ import { DivIcon } from 'leaflet' import React, { useEffect, useState } from 'react' import getAgencyList, { Agency } from 'src/api/agencyList' -import busIcon from '../resources/bus-front.svg' import MarkerClusterGroup from 'react-leaflet-cluster' import { useMap, Marker, Popup } from 'react-leaflet' import { VehicleLocation } from 'src/model/vehicleLocation' +// import getSvgFromOperatorId from '../utils/SvgComponent/SvgComponent' +// import svgsMap from '../utils/SvgComponent/imagesMap' +import operatorIdToSvg from '../utils/SvgComponent/imagesMap' const colorIcon = ({ + busIcon, color, name, rotate = 0, }: { + busIcon: React.FunctionComponent> color: string name?: string rotate?: number }) => { - return new DivIcon({ + /* + TODO: 2nd approach + const icon = (busIcon as any)?.default ?? defaultIcon + */ + + /*return new DivIcon({ className: 'my-div-icon', html: `
-
-
${name}
- `, +
${name}
`, + })*/ + return new DivIcon({ + className: 'my-div-icon', + html: ` + + +
${name}
+ `, }) } @@ -59,9 +69,20 @@ export interface VehicleLocationMapPoint { export function BusLayer({ positions }: { positions: VehicleLocationMapPoint[] }) { const map = useMap() const [agencyList, setAgencyList] = useState([]) + /* TODO: 2nd approach + const [svgs, setSvgs] = useState(() => new Map()) + */ useEffect(() => { getAgencyList().then(setAgencyList) + /* TODO: 2nd approach + getAgencyList().then((agencyList) => { + setAgencyList(agencyList) + agencyList.forEach(async (agency) => { + const icon = await getSvgFromOperatorId(agency.operator_ref) + setSvgs(new Map(svgs.set(agency.operator_ref, icon))) + }) + })*/ }, []) useEffect(() => { @@ -77,6 +98,11 @@ export function BusLayer({ positions }: { positions: VehicleLocationMapPoint[] } + >,*/ + busIcon: operatorIdToSvg(pos.operator), color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator)?.agency_name, rotate: pos.bearing, diff --git a/src/pages/components/utils/SvgComponent/SvgComponent.tsx b/src/pages/components/utils/SvgComponent/SvgComponent.tsx new file mode 100644 index 00000000..abb81a18 --- /dev/null +++ b/src/pages/components/utils/SvgComponent/SvgComponent.tsx @@ -0,0 +1,15 @@ +import React from 'react' +import busIcon from '../../../../resources/bus-front.svg' + +async function getSvgFromOperatorId(operator_id: number | string) { + let icon = busIcon + try { + icon = (await import( + `../../../../resources/bus-logos/${operator_id.toString()}.svg` + )) as React.FunctionComponent> + } catch (err) { + icon = busIcon + } + return icon +} +export default getSvgFromOperatorId diff --git a/src/pages/components/utils/SvgComponent/imagesMap.tsx b/src/pages/components/utils/SvgComponent/imagesMap.tsx new file mode 100644 index 00000000..dc1fe08e --- /dev/null +++ b/src/pages/components/utils/SvgComponent/imagesMap.tsx @@ -0,0 +1,83 @@ +import icon2 from '../../../../resources/bus-logos/2.svg' +import icon3 from '../../../../resources/bus-logos/3.svg' +import icon4 from '../../../../resources/bus-logos/4.svg' +import icon5 from '../../../../resources/bus-logos/5.svg' +import icon6 from '../../../../resources/bus-logos/6.svg' +import icon7 from '../../../../resources/bus-logos/7.svg' +import icon8 from '../../../../resources/bus-logos/8.svg' +import icon10 from '../../../../resources/bus-logos/10.svg' +import icon14 from '../../../../resources/bus-logos/14.svg' +import icon15 from '../../../../resources/bus-logos/15.svg' +import icon16 from '../../../../resources/bus-logos/16.svg' +import icon18 from '../../../../resources/bus-logos/18.svg' +import icon20 from '../../../../resources/bus-logos/20.svg' +import icon21 from '../../../../resources/bus-logos/21.svg' +import icon23 from '../../../../resources/bus-logos/23.svg' +import icon24 from '../../../../resources/bus-logos/24.svg' +import icon25 from '../../../../resources/bus-logos/25.svg' +import icon31 from '../../../../resources/bus-logos/31.svg' +import icon32 from '../../../../resources/bus-logos/32.svg' +import icon34 from '../../../../resources/bus-logos/34.svg' +import icon35 from '../../../../resources/bus-logos/35.svg' +import icon37 from '../../../../resources/bus-logos/37.svg' +import icon38 from '../../../../resources/bus-logos/38.svg' +import icon42 from '../../../../resources/bus-logos/42.svg' +import icon44 from '../../../../resources/bus-logos/44.svg' +import icon45 from '../../../../resources/bus-logos/45.svg' +import icon47 from '../../../../resources/bus-logos/47.svg' +import icon49 from '../../../../resources/bus-logos/49.svg' +import icon50 from '../../../../resources/bus-logos/50.svg' +import icon51 from '../../../../resources/bus-logos/51.svg' +import icon91 from '../../../../resources/bus-logos/91.svg' +import icon93 from '../../../../resources/bus-logos/93.svg' +import icon97 from '../../../../resources/bus-logos/97.svg' +import icon98 from '../../../../resources/bus-logos/98.svg' +import iconDefault from '../../../../resources/bus-logos/default.svg' + +type OperatorId = string | number +type Svg = React.FunctionComponent> +const svgsMap = new Map([ + [2, icon2], + [3, icon3], + [4, icon4], + [5, icon5], + [6, icon6], + [7, icon7], + [8, icon8], + [10, icon10], + [14, icon14], + [15, icon15], + [16, icon16], + [18, icon18], + [20, icon20], + [21, icon21], + [23, icon23], + [24, icon24], + [25, icon25], + [31, icon31], + [32, icon32], + [34, icon34], + [35, icon35], + [37, icon37], + [38, icon38], + [42, icon42], + [44, icon44], + [45, icon45], + [47, icon47], + [49, icon49], + [50, icon50], + [51, icon51], + [91, icon91], + [93, icon93], + [97, icon97], + [98, icon98], + ['default', iconDefault], +]) +function operatorIdToSvg(operator_id: number | undefined): Svg { + if (!operator_id || !svgsMap.has(operator_id)) { + return iconDefault + } + return svgsMap.get(operator_id)! +} + +export default operatorIdToSvg diff --git a/src/resources/bus-logos/10.svg b/src/resources/bus-logos/10.svg new file mode 100644 index 00000000..c3a8764c --- /dev/null +++ b/src/resources/bus-logos/10.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/14.svg b/src/resources/bus-logos/14.svg new file mode 100644 index 00000000..e053a54d --- /dev/null +++ b/src/resources/bus-logos/14.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/15.svg b/src/resources/bus-logos/15.svg new file mode 100644 index 00000000..7601548a --- /dev/null +++ b/src/resources/bus-logos/15.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/16.svg b/src/resources/bus-logos/16.svg new file mode 100644 index 00000000..d1daec7a --- /dev/null +++ b/src/resources/bus-logos/16.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/18.svg b/src/resources/bus-logos/18.svg new file mode 100644 index 00000000..1f11732e --- /dev/null +++ b/src/resources/bus-logos/18.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/2.svg b/src/resources/bus-logos/2.svg new file mode 100644 index 00000000..9fb2a83a --- /dev/null +++ b/src/resources/bus-logos/2.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/20.svg b/src/resources/bus-logos/20.svg new file mode 100644 index 00000000..9f6492e4 --- /dev/null +++ b/src/resources/bus-logos/20.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/21.svg b/src/resources/bus-logos/21.svg new file mode 100644 index 00000000..12203db2 --- /dev/null +++ b/src/resources/bus-logos/21.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/23.svg b/src/resources/bus-logos/23.svg new file mode 100644 index 00000000..2e7fe974 --- /dev/null +++ b/src/resources/bus-logos/23.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/24.svg b/src/resources/bus-logos/24.svg new file mode 100644 index 00000000..38212cab --- /dev/null +++ b/src/resources/bus-logos/24.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/25.svg b/src/resources/bus-logos/25.svg new file mode 100644 index 00000000..1429a83c --- /dev/null +++ b/src/resources/bus-logos/25.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/3.svg b/src/resources/bus-logos/3.svg new file mode 100644 index 00000000..db9ad3f7 --- /dev/null +++ b/src/resources/bus-logos/3.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/31.svg b/src/resources/bus-logos/31.svg new file mode 100644 index 00000000..45127971 --- /dev/null +++ b/src/resources/bus-logos/31.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/32.svg b/src/resources/bus-logos/32.svg new file mode 100644 index 00000000..de4ff7c9 --- /dev/null +++ b/src/resources/bus-logos/32.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/34.svg b/src/resources/bus-logos/34.svg new file mode 100644 index 00000000..62549fe7 --- /dev/null +++ b/src/resources/bus-logos/34.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/35.svg b/src/resources/bus-logos/35.svg new file mode 100644 index 00000000..95b08a6a --- /dev/null +++ b/src/resources/bus-logos/35.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/37.svg b/src/resources/bus-logos/37.svg new file mode 100644 index 00000000..1d237ba6 --- /dev/null +++ b/src/resources/bus-logos/37.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/38.svg b/src/resources/bus-logos/38.svg new file mode 100644 index 00000000..d07d2bd3 --- /dev/null +++ b/src/resources/bus-logos/38.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/4.svg b/src/resources/bus-logos/4.svg new file mode 100644 index 00000000..f6c8e141 --- /dev/null +++ b/src/resources/bus-logos/4.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/42.svg b/src/resources/bus-logos/42.svg new file mode 100644 index 00000000..0320ea2e --- /dev/null +++ b/src/resources/bus-logos/42.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/44.svg b/src/resources/bus-logos/44.svg new file mode 100644 index 00000000..bfca8369 --- /dev/null +++ b/src/resources/bus-logos/44.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/45.svg b/src/resources/bus-logos/45.svg new file mode 100644 index 00000000..afc6f519 --- /dev/null +++ b/src/resources/bus-logos/45.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/bus-logos/47.svg b/src/resources/bus-logos/47.svg new file mode 100644 index 00000000..afc6f519 --- /dev/null +++ b/src/resources/bus-logos/47.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/bus-logos/49.svg b/src/resources/bus-logos/49.svg new file mode 100644 index 00000000..0320ea2e --- /dev/null +++ b/src/resources/bus-logos/49.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/5.svg b/src/resources/bus-logos/5.svg new file mode 100644 index 00000000..99f0c7df --- /dev/null +++ b/src/resources/bus-logos/5.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/50.svg b/src/resources/bus-logos/50.svg new file mode 100644 index 00000000..0320ea2e --- /dev/null +++ b/src/resources/bus-logos/50.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/51.svg b/src/resources/bus-logos/51.svg new file mode 100644 index 00000000..afc6f519 --- /dev/null +++ b/src/resources/bus-logos/51.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/bus-logos/6.svg b/src/resources/bus-logos/6.svg new file mode 100644 index 00000000..dceff215 --- /dev/null +++ b/src/resources/bus-logos/6.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/7.svg b/src/resources/bus-logos/7.svg new file mode 100644 index 00000000..9cb50fd8 --- /dev/null +++ b/src/resources/bus-logos/7.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/8.svg b/src/resources/bus-logos/8.svg new file mode 100644 index 00000000..69aa4ae7 --- /dev/null +++ b/src/resources/bus-logos/8.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/91.svg b/src/resources/bus-logos/91.svg new file mode 100644 index 00000000..17a93a18 --- /dev/null +++ b/src/resources/bus-logos/91.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/93.svg b/src/resources/bus-logos/93.svg new file mode 100644 index 00000000..896957b0 --- /dev/null +++ b/src/resources/bus-logos/93.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/97.svg b/src/resources/bus-logos/97.svg new file mode 100644 index 00000000..65ed3def --- /dev/null +++ b/src/resources/bus-logos/97.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/98.svg b/src/resources/bus-logos/98.svg new file mode 100644 index 00000000..37b38f0c --- /dev/null +++ b/src/resources/bus-logos/98.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/bus-logos/default.svg b/src/resources/bus-logos/default.svg new file mode 100644 index 00000000..afc6f519 --- /dev/null +++ b/src/resources/bus-logos/default.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + From 295e19727e960071b72c99c6bfe42c34a346543b Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Wed, 13 Sep 2023 13:04:38 +0300 Subject: [PATCH 02/10] - added craco to enable webpack's require.context - changed implementation of images loading --- craco.config.ts | 10 + package.json | 13 +- src/pages/RealtimeMapPage.tsx | 3 +- src/pages/SingleLineMapPage.tsx | 3 +- src/pages/components/MapLayers/BusLayer.tsx | 3 +- .../utils/SvgComponent/imagesMap2.tsx | 21 + src/resources/bus-front.svg | 32 -- src/resources/bus-logos/92.svg | 18 + src/resources/operators-logos/10.svg | 9 + src/resources/operators-logos/14.svg | 9 + src/resources/operators-logos/15.svg | 9 + src/resources/operators-logos/16.svg | 9 + src/resources/operators-logos/18.svg | 9 + src/resources/operators-logos/2.svg | 9 + src/resources/operators-logos/20.svg | 9 + src/resources/operators-logos/21.svg | 9 + src/resources/operators-logos/23.svg | 9 + src/resources/operators-logos/24.svg | 9 + src/resources/operators-logos/25.svg | 9 + src/resources/operators-logos/3.svg | 9 + src/resources/operators-logos/31.svg | 9 + src/resources/operators-logos/32.svg | 9 + src/resources/operators-logos/34.svg | 9 + src/resources/operators-logos/35.svg | 9 + src/resources/operators-logos/37.svg | 9 + src/resources/operators-logos/38.svg | 9 + src/resources/operators-logos/4.svg | 9 + src/resources/operators-logos/42.svg | 5 + src/resources/operators-logos/44.svg | 5 + src/resources/operators-logos/45.svg | 11 + src/resources/operators-logos/47.svg | 11 + src/resources/operators-logos/49.svg | 5 + src/resources/operators-logos/5.svg | 9 + src/resources/operators-logos/50.svg | 5 + src/resources/operators-logos/51.svg | 11 + src/resources/operators-logos/6.svg | 9 + src/resources/operators-logos/7.svg | 9 + src/resources/operators-logos/8.svg | 9 + src/resources/operators-logos/91.svg | 9 + src/resources/operators-logos/92.svg | 9 + src/resources/operators-logos/97.svg | 9 + src/resources/operators-logos/98.svg | 9 + yarn.lock | 442 +++++++++++++++++- 43 files changed, 797 insertions(+), 44 deletions(-) create mode 100644 craco.config.ts create mode 100644 src/pages/components/utils/SvgComponent/imagesMap2.tsx delete mode 100644 src/resources/bus-front.svg create mode 100644 src/resources/bus-logos/92.svg create mode 100644 src/resources/operators-logos/10.svg create mode 100644 src/resources/operators-logos/14.svg create mode 100644 src/resources/operators-logos/15.svg create mode 100644 src/resources/operators-logos/16.svg create mode 100644 src/resources/operators-logos/18.svg create mode 100644 src/resources/operators-logos/2.svg create mode 100644 src/resources/operators-logos/20.svg create mode 100644 src/resources/operators-logos/21.svg create mode 100644 src/resources/operators-logos/23.svg create mode 100644 src/resources/operators-logos/24.svg create mode 100644 src/resources/operators-logos/25.svg create mode 100644 src/resources/operators-logos/3.svg create mode 100644 src/resources/operators-logos/31.svg create mode 100644 src/resources/operators-logos/32.svg create mode 100644 src/resources/operators-logos/34.svg create mode 100644 src/resources/operators-logos/35.svg create mode 100644 src/resources/operators-logos/37.svg create mode 100644 src/resources/operators-logos/38.svg create mode 100644 src/resources/operators-logos/4.svg create mode 100644 src/resources/operators-logos/42.svg create mode 100644 src/resources/operators-logos/44.svg create mode 100644 src/resources/operators-logos/45.svg create mode 100644 src/resources/operators-logos/47.svg create mode 100644 src/resources/operators-logos/49.svg create mode 100644 src/resources/operators-logos/5.svg create mode 100644 src/resources/operators-logos/50.svg create mode 100644 src/resources/operators-logos/51.svg create mode 100644 src/resources/operators-logos/6.svg create mode 100644 src/resources/operators-logos/7.svg create mode 100644 src/resources/operators-logos/8.svg create mode 100644 src/resources/operators-logos/91.svg create mode 100644 src/resources/operators-logos/92.svg create mode 100644 src/resources/operators-logos/97.svg create mode 100644 src/resources/operators-logos/98.svg diff --git a/craco.config.ts b/craco.config.ts new file mode 100644 index 00000000..66da47bc --- /dev/null +++ b/craco.config.ts @@ -0,0 +1,10 @@ +import path from 'path' + +module.exports = { + webpack: { + alias: { + '@bus-logos': path.resolve(__dirname, 'src/resources/bus-logos'), + '@operators-logos': path.resolve(__dirname, 'src/resources/operators-logos'), + }, + }, +} diff --git a/package.json b/package.json index fa9ebb75..7f9ec7b4 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "license": "MIT", "name": "open-bus-map-search", "version": "0.1.0", "private": true, @@ -7,6 +8,7 @@ "@emotion/styled": "^11.11.0", "@mui/material": "^5.14.7", "@mui/x-date-pickers": "^6.12.1", + "@types/webpack-env": "^1.18.1", "antd": "^4.22.5", "axios": "^0.27.2", "classnames": "^2.3.2", @@ -37,9 +39,9 @@ "autoprefixer": "10.4.5" }, "scripts": { - "start": "react-scripts start", - "build": "CI=false react-scripts build", - "test": "react-scripts test", + "start": "craco start", + "build": "CI=false craco build", + "test": "craco test", "test:playwright": "playwright test", "eject": "react-scripts eject", "lint": "eslint .", @@ -59,6 +61,8 @@ ] }, "devDependencies": { + "@craco/craco": "^7.1.0", + "@craco/types": "^7.1.0", "@playwright/test": "^1.37.1", "@types/geolib": "^2.0.23", "@types/leaflet": "^1.7.11", @@ -77,5 +81,6 @@ "openapi-typescript-codegen": "^0.23.0", "prettier": "^2.7.1" }, - "packageManager": "yarn@1.22.19" + "packageManager": "yarn@1.22.19", + "cracoConfig": "craco.config.ts" } diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/RealtimeMapPage.tsx index 4638ccf7..bd5370ca 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/RealtimeMapPage.tsx @@ -13,8 +13,7 @@ import getAgencyList, { Agency } from 'src/api/agencyList' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' import { Spin } from 'antd' // import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' -import svgsMap from './components/utils/SvgComponent/imagesMap' -import operatorIdToSvg from './components/utils/SvgComponent/imagesMap' +import operatorIdToSvg from './components/utils/SvgComponent/imagesMap2' import { DataAndTimeSelector } from './components/DataAndTimeSelector' import moment from 'moment' diff --git a/src/pages/SingleLineMapPage.tsx b/src/pages/SingleLineMapPage.tsx index 3661443a..7bfafe17 100644 --- a/src/pages/SingleLineMapPage.tsx +++ b/src/pages/SingleLineMapPage.tsx @@ -21,8 +21,7 @@ import { VehicleLocation } from 'src/model/vehicleLocation' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' import { Spin } from 'antd' // import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' -// import svgsMap from './components/utils/SvgComponent/imagesMap' -import operatorIdToSvg from './components/utils/SvgComponent/imagesMap' +import operatorIdToSvg from './components/utils/SvgComponent/imagesMap2' import { DataAndTimeSelector } from './components/DataAndTimeSelector' import { Autocomplete, TextField } from '@mui/material' diff --git a/src/pages/components/MapLayers/BusLayer.tsx b/src/pages/components/MapLayers/BusLayer.tsx index 12006a82..14dc7bf6 100644 --- a/src/pages/components/MapLayers/BusLayer.tsx +++ b/src/pages/components/MapLayers/BusLayer.tsx @@ -5,8 +5,7 @@ import MarkerClusterGroup from 'react-leaflet-cluster' import { useMap, Marker, Popup } from 'react-leaflet' import { VehicleLocation } from 'src/model/vehicleLocation' // import getSvgFromOperatorId from '../utils/SvgComponent/SvgComponent' -// import svgsMap from '../utils/SvgComponent/imagesMap' -import operatorIdToSvg from '../utils/SvgComponent/imagesMap' +import operatorIdToSvg from '../utils/SvgComponent/imagesMap2' const colorIcon = ({ busIcon, diff --git a/src/pages/components/utils/SvgComponent/imagesMap2.tsx b/src/pages/components/utils/SvgComponent/imagesMap2.tsx new file mode 100644 index 00000000..66c22ea8 --- /dev/null +++ b/src/pages/components/utils/SvgComponent/imagesMap2.tsx @@ -0,0 +1,21 @@ +import iconDefault from '../../../../resources/bus-logos/default.svg' + +type OperatorId = string +type Svg = React.FunctionComponent> +const svgsMap = new Map() + +const bus_logos = require.context('@bus-logos', true, /\.svg$/) +bus_logos.keys().forEach((key) => { + const bus_logo = bus_logos(key) as Svg + const operator_id = key.replace('.svg', '').replace('.', '').replace('/', '') + svgsMap.set(operator_id, bus_logo) +}) + +function operatorIdToSvg(operator_id: number | undefined): Svg { + if (!operator_id || !svgsMap.has(operator_id.toString())) { + return iconDefault + } + return svgsMap.get(operator_id.toString())! +} + +export default operatorIdToSvg diff --git a/src/resources/bus-front.svg b/src/resources/bus-front.svg deleted file mode 100644 index 197909d9..00000000 --- a/src/resources/bus-front.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/resources/bus-logos/92.svg b/src/resources/bus-logos/92.svg new file mode 100644 index 00000000..c2585a94 --- /dev/null +++ b/src/resources/bus-logos/92.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/resources/operators-logos/10.svg b/src/resources/operators-logos/10.svg new file mode 100644 index 00000000..9c946b71 --- /dev/null +++ b/src/resources/operators-logos/10.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/14.svg b/src/resources/operators-logos/14.svg new file mode 100644 index 00000000..6c5d69ed --- /dev/null +++ b/src/resources/operators-logos/14.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/15.svg b/src/resources/operators-logos/15.svg new file mode 100644 index 00000000..e9d32ed1 --- /dev/null +++ b/src/resources/operators-logos/15.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/16.svg b/src/resources/operators-logos/16.svg new file mode 100644 index 00000000..3ff7b577 --- /dev/null +++ b/src/resources/operators-logos/16.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/18.svg b/src/resources/operators-logos/18.svg new file mode 100644 index 00000000..ff0b4e6f --- /dev/null +++ b/src/resources/operators-logos/18.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/2.svg b/src/resources/operators-logos/2.svg new file mode 100644 index 00000000..7254f06d --- /dev/null +++ b/src/resources/operators-logos/2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/20.svg b/src/resources/operators-logos/20.svg new file mode 100644 index 00000000..d39ee465 --- /dev/null +++ b/src/resources/operators-logos/20.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/21.svg b/src/resources/operators-logos/21.svg new file mode 100644 index 00000000..25c96881 --- /dev/null +++ b/src/resources/operators-logos/21.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/23.svg b/src/resources/operators-logos/23.svg new file mode 100644 index 00000000..29d7dd53 --- /dev/null +++ b/src/resources/operators-logos/23.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/24.svg b/src/resources/operators-logos/24.svg new file mode 100644 index 00000000..0b17f78e --- /dev/null +++ b/src/resources/operators-logos/24.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/25.svg b/src/resources/operators-logos/25.svg new file mode 100644 index 00000000..7332ecb0 --- /dev/null +++ b/src/resources/operators-logos/25.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/3.svg b/src/resources/operators-logos/3.svg new file mode 100644 index 00000000..8d5c11f7 --- /dev/null +++ b/src/resources/operators-logos/3.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/31.svg b/src/resources/operators-logos/31.svg new file mode 100644 index 00000000..765fdc9a --- /dev/null +++ b/src/resources/operators-logos/31.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/32.svg b/src/resources/operators-logos/32.svg new file mode 100644 index 00000000..2441475b --- /dev/null +++ b/src/resources/operators-logos/32.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/34.svg b/src/resources/operators-logos/34.svg new file mode 100644 index 00000000..9c9cb9de --- /dev/null +++ b/src/resources/operators-logos/34.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/35.svg b/src/resources/operators-logos/35.svg new file mode 100644 index 00000000..043ba156 --- /dev/null +++ b/src/resources/operators-logos/35.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/37.svg b/src/resources/operators-logos/37.svg new file mode 100644 index 00000000..553f8348 --- /dev/null +++ b/src/resources/operators-logos/37.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/38.svg b/src/resources/operators-logos/38.svg new file mode 100644 index 00000000..9b959416 --- /dev/null +++ b/src/resources/operators-logos/38.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/4.svg b/src/resources/operators-logos/4.svg new file mode 100644 index 00000000..f28322e7 --- /dev/null +++ b/src/resources/operators-logos/4.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/42.svg b/src/resources/operators-logos/42.svg new file mode 100644 index 00000000..2847eaa3 --- /dev/null +++ b/src/resources/operators-logos/42.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/resources/operators-logos/44.svg b/src/resources/operators-logos/44.svg new file mode 100644 index 00000000..585e9135 --- /dev/null +++ b/src/resources/operators-logos/44.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/resources/operators-logos/45.svg b/src/resources/operators-logos/45.svg new file mode 100644 index 00000000..0f5dba3b --- /dev/null +++ b/src/resources/operators-logos/45.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/operators-logos/47.svg b/src/resources/operators-logos/47.svg new file mode 100644 index 00000000..1fb73842 --- /dev/null +++ b/src/resources/operators-logos/47.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/operators-logos/49.svg b/src/resources/operators-logos/49.svg new file mode 100644 index 00000000..2847eaa3 --- /dev/null +++ b/src/resources/operators-logos/49.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/resources/operators-logos/5.svg b/src/resources/operators-logos/5.svg new file mode 100644 index 00000000..f597c78f --- /dev/null +++ b/src/resources/operators-logos/5.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/50.svg b/src/resources/operators-logos/50.svg new file mode 100644 index 00000000..2847eaa3 --- /dev/null +++ b/src/resources/operators-logos/50.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/resources/operators-logos/51.svg b/src/resources/operators-logos/51.svg new file mode 100644 index 00000000..1e1a8b42 --- /dev/null +++ b/src/resources/operators-logos/51.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/resources/operators-logos/6.svg b/src/resources/operators-logos/6.svg new file mode 100644 index 00000000..35054e5b --- /dev/null +++ b/src/resources/operators-logos/6.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/7.svg b/src/resources/operators-logos/7.svg new file mode 100644 index 00000000..4eba8ccb --- /dev/null +++ b/src/resources/operators-logos/7.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/8.svg b/src/resources/operators-logos/8.svg new file mode 100644 index 00000000..5398bbc5 --- /dev/null +++ b/src/resources/operators-logos/8.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/91.svg b/src/resources/operators-logos/91.svg new file mode 100644 index 00000000..d82ae5c9 --- /dev/null +++ b/src/resources/operators-logos/91.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/92.svg b/src/resources/operators-logos/92.svg new file mode 100644 index 00000000..91e1496f --- /dev/null +++ b/src/resources/operators-logos/92.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/97.svg b/src/resources/operators-logos/97.svg new file mode 100644 index 00000000..e5990c37 --- /dev/null +++ b/src/resources/operators-logos/97.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/resources/operators-logos/98.svg b/src/resources/operators-logos/98.svg new file mode 100644 index 00000000..68753286 --- /dev/null +++ b/src/resources/operators-logos/98.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/yarn.lock b/yarn.lock index 97da0505..0105cc4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1139,6 +1139,15 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" +"@babel/types@^7.19.3": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.17.tgz#f753352c4610ffddf9c8bc6823f9ff03e2303eee" + integrity sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.15" + to-fast-properties "^2.0.0" + "@babel/types@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.15.tgz#266cb21d2c5fd0b3931e7a91b6dd72d2f617d282" @@ -1153,6 +1162,38 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@craco/craco@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-7.1.0.tgz#12bd394c7f0334e214302e4d35a1768f68042fbb" + integrity sha512-oRAcPIKYrfPXp9rSzlsDNeOaVtDiKhoyqSXUoqiK24jCkHr4T8m/a2f74yXIzCbIheoUWDOIfWZyRgFgT+cpqA== + dependencies: + autoprefixer "^10.4.12" + cosmiconfig "^7.0.1" + cosmiconfig-typescript-loader "^1.0.0" + cross-spawn "^7.0.3" + lodash "^4.17.21" + semver "^7.3.7" + webpack-merge "^5.8.0" + +"@craco/types@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@craco/types/-/types-7.1.0.tgz#9bc9a83fad2a42ae53bf21ff5e587824f10fa31a" + integrity sha512-zdyk2G9UfEItrvnB+sd3xDHB5Mf3dsD6wE+Ex6V+Nch+GSXdFGQfXD/l+ZX9hO03R1rmnJPCxrIRPJUib8Q/MQ== + dependencies: + "@babel/types" "^7.19.3" + "@jest/types" "^27.5.1" + "@types/eslint" "^8.4.6" + autoprefixer "^10.4.12" + eslint-webpack-plugin "^3.2.0" + webpack "^5.74.0" + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@csstools/normalize.css@*": version "12.0.0" resolved "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz" @@ -1693,6 +1734,11 @@ resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz" @@ -1706,11 +1752,32 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/source-map@^0.3.3": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" + integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.9": version "0.3.15" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz" @@ -1719,6 +1786,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" @@ -2078,6 +2153,26 @@ resolved "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz" @@ -2208,6 +2303,14 @@ "@types/estree" "*" "@types/json-schema" "*" +"@types/eslint@^8.4.6": + version "8.44.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.2.tgz#0d21c505f98a89b8dd4d37fa162b09da6089199a" + integrity sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + "@types/estree@*": version "1.0.0" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz" @@ -2223,6 +2326,11 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" + integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== + "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": version "4.17.30" resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz" @@ -2474,6 +2582,11 @@ resolved "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.4.tgz" integrity sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg== +"@types/webpack-env@^1.18.1": + version "1.18.1" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.18.1.tgz#49699bb508961e14a3bfb68c78cd87b296889d1d" + integrity sha512-D0HJET2/UY6k9L6y3f5BL+IDxZmPkYmPT4+qBrRdmRLYRuV0qNKizMgTvYxXZYn+36zjPeoDZAEYBCM6XB+gww== + "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz" @@ -2641,21 +2754,44 @@ "@webassemblyjs/helper-numbers" "1.11.1" "@webassemblyjs/helper-wasm-bytecode" "1.11.1" +"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" + integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/floating-point-hex-parser@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== + "@webassemblyjs/helper-api-error@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== + "@webassemblyjs/helper-buffer@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz#b66d73c43e296fd5e88006f18524feb0f2c7c093" + integrity sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA== + "@webassemblyjs/helper-numbers@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" @@ -2665,11 +2801,25 @@ "@webassemblyjs/helper-api-error" "1.11.1" "@xtuc/long" "4.2.2" +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@xtuc/long" "4.2.2" + "@webassemblyjs/helper-wasm-bytecode@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== + "@webassemblyjs/helper-wasm-section@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" @@ -2680,6 +2830,16 @@ "@webassemblyjs/helper-wasm-bytecode" "1.11.1" "@webassemblyjs/wasm-gen" "1.11.1" +"@webassemblyjs/helper-wasm-section@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz#ff97f3863c55ee7f580fd5c41a381e9def4aa577" + integrity sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/ieee754@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" @@ -2687,6 +2847,13 @@ dependencies: "@xtuc/ieee754" "^1.2.0" +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== + dependencies: + "@xtuc/ieee754" "^1.2.0" + "@webassemblyjs/leb128@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" @@ -2694,11 +2861,23 @@ dependencies: "@xtuc/long" "4.2.2" +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== + dependencies: + "@xtuc/long" "4.2.2" + "@webassemblyjs/utf8@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== + "@webassemblyjs/wasm-edit@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" @@ -2713,6 +2892,20 @@ "@webassemblyjs/wasm-parser" "1.11.1" "@webassemblyjs/wast-printer" "1.11.1" +"@webassemblyjs/wasm-edit@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz#c72fa8220524c9b416249f3d94c2958dfe70ceab" + integrity sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-opt" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + "@webassemblyjs/wast-printer" "1.11.6" + "@webassemblyjs/wasm-gen@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" @@ -2724,6 +2917,17 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-gen@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz#fb5283e0e8b4551cc4e9c3c0d7184a65faf7c268" + integrity sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wasm-opt@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" @@ -2734,6 +2938,16 @@ "@webassemblyjs/wasm-gen" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" +"@webassemblyjs/wasm-opt@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz#d9a22d651248422ca498b09aa3232a81041487c2" + integrity sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + "@webassemblyjs/wasm-parser@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" @@ -2746,6 +2960,18 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz#bb85378c527df824004812bbdb784eea539174a1" + integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wast-printer@1.11.1": version "1.11.1" resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" @@ -2754,6 +2980,14 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" +"@webassemblyjs/wast-printer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz#a7bf8dd7e362aeb1668ff43f35cb849f188eff20" + integrity sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@xtuc/long" "4.2.2" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" @@ -2790,6 +3024,11 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== +acorn-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" @@ -2809,6 +3048,11 @@ acorn-walk@^7.0.0, acorn-walk@^7.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^7.0.0, acorn@^7.1.1: version "7.4.1" resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" @@ -2819,6 +3063,11 @@ acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +acorn@^8.4.1, acorn@^8.8.2: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + address@^1.0.1, address@^1.1.2: version "1.2.0" resolved "https://registry.npmjs.org/address/-/address-1.2.0.tgz" @@ -2978,6 +3227,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + arg@^5.0.2: version "5.0.2" resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz" @@ -3095,7 +3349,7 @@ at-least-node@^1.0.0: resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -autoprefixer@10.4.5, autoprefixer@^10.4.7: +autoprefixer@10.4.5, autoprefixer@^10.4.12, autoprefixer@^10.4.7: version "10.4.5" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.5.tgz#662193c744094b53d3637f39be477e07bd904998" integrity sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw== @@ -3570,6 +3824,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + clsx@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b" @@ -3774,6 +4037,14 @@ core-util-is@~1.0.0: resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +cosmiconfig-typescript-loader@^1.0.0: + version "1.0.9" + resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.9.tgz#69c523f7e8c3d9f27f563d02bbeadaf2f27212d3" + integrity sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g== + dependencies: + cosmiconfig "^7" + ts-node "^10.7.0" + cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz" @@ -3785,6 +4056,17 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" +cosmiconfig@^7, cosmiconfig@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" + integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + cosmiconfig@^7.0.0: version "7.0.1" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz" @@ -3796,6 +4078,11 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" @@ -4252,6 +4539,11 @@ diff-sequences@^27.5.1: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" @@ -4453,6 +4745,14 @@ enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.15.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" + integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + entities@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz" @@ -4511,6 +4811,11 @@ es-module-lexer@^0.9.0: resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.1.tgz#c1b0dd5ada807a3b3155315911f364dc4e909db1" + integrity sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q== + es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz" @@ -4729,7 +5034,7 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint-webpack-plugin@^3.1.1: +eslint-webpack-plugin@^3.1.1, eslint-webpack-plugin@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-3.2.0.tgz" integrity sha512-avrKcGncpPbPSUHX6B3stNGzkKFto3eL+DKM4+VyMrVnhPc3vRczVlCq3uhuFOdRvDHTVXuzwk1ZKUrqDQHQ9w== @@ -5770,6 +6075,13 @@ is-plain-obj@^3.0.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" @@ -5848,6 +6160,11 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" @@ -6692,6 +7009,11 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: dependencies: semver "^6.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" @@ -8912,6 +9234,15 @@ schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + schema-utils@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz" @@ -8991,6 +9322,13 @@ serialize-javascript@^6.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" + integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== + dependencies: + randombytes "^2.1.0" + serve-index@^1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz" @@ -9024,6 +9362,13 @@ setprototypeof@1.2.0: resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz" @@ -9509,6 +9854,17 @@ terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.2.5: serialize-javascript "^6.0.0" terser "^5.14.1" +terser-webpack-plugin@^5.3.7: + version "5.3.9" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1" + integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.17" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.1" + terser "^5.16.8" + terser@^5.0.0, terser@^5.10.0, terser@^5.14.1: version "5.14.2" resolved "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz" @@ -9519,6 +9875,16 @@ terser@^5.0.0, terser@^5.10.0, terser@^5.14.1: commander "^2.20.0" source-map-support "~0.5.20" +terser@^5.16.8: + version "5.19.4" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.19.4.tgz#941426fa482bf9b40a0308ab2b3cd0cf7c775ebd" + integrity sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" @@ -9598,6 +9964,25 @@ tryer@^1.0.1: resolved "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== +ts-node@^10.7.0: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz" @@ -9807,6 +10192,11 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz" @@ -9956,6 +10346,14 @@ webpack-manifest-plugin@^4.0.2: tapable "^2.0.0" webpack-sources "^2.2.0" +webpack-merge@^5.8.0: + version "5.9.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.9.0.tgz#dc160a1c4cf512ceca515cc231669e9ddb133826" + integrity sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz" @@ -10007,6 +10405,36 @@ webpack@^5.64.4: watchpack "^2.4.0" webpack-sources "^3.2.3" +webpack@^5.74.0: + version "5.88.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e" + integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^1.0.0" + "@webassemblyjs/ast" "^1.11.5" + "@webassemblyjs/wasm-edit" "^1.11.5" + "@webassemblyjs/wasm-parser" "^1.11.5" + acorn "^8.7.1" + acorn-import-assertions "^1.9.0" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.15.0" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.2.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.7" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + websocket-driver@>=0.5.1, websocket-driver@^0.7.4: version "0.7.4" resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" @@ -10081,6 +10509,11 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wildcard@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" + integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== + word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" @@ -10342,6 +10775,11 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" From 4edea2414437b1e1f7fb45a096acc8d48d11ade8 Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Wed, 13 Sep 2023 16:46:22 +0300 Subject: [PATCH 03/10] - moved the style of 'divIcon' to `map.scss` --- src/pages/Map.scss | 30 ++- src/pages/RealtimeMapPage.tsx | 178 ++++++++---------- src/pages/SingleLineMapPage.tsx | 83 ++++---- src/pages/components/MapLayers/BusLayer.tsx | 61 ++---- .../{imagesMap2.tsx => BusLogosLoader.tsx} | 17 +- .../utils/SvgComponent/imagesMap.tsx | 83 -------- 6 files changed, 149 insertions(+), 303 deletions(-) rename src/pages/components/utils/SvgComponent/{imagesMap2.tsx => BusLogosLoader.tsx} (50%) delete mode 100644 src/pages/components/utils/SvgComponent/imagesMap.tsx diff --git a/src/pages/Map.scss b/src/pages/Map.scss index 6d4a3c23..6258521d 100644 --- a/src/pages/Map.scss +++ b/src/pages/Map.scss @@ -1,4 +1,8 @@ -main, main > div, .map-container, .leaflet-container, .map-info { +main, +main>div, +.map-container, +.leaflet-container, +.map-info { display: flex; flex-direction: column; flex: 1 1 auto; @@ -6,12 +10,11 @@ main, main > div, .map-container, .leaflet-container, .map-info { .mask { display: block; - mask-repeat: no-repeat; - mask-position: center; - mask-size: contain; - -webkit-mask-repeat: no-repeat; + /*-webkit-mask-repeat: no-repeat; -webkit-mask-position: center; - -webkit-mask-size: contain; + -webkit-mask-size: contain;*/ + height: 50px; + background-repeat: no-repeat; } pre { @@ -20,8 +23,19 @@ pre { overflow-y: auto; } -.map-header-buttons{ +.map-header-buttons { display: flex; flex-direction: row; - margin-top: 10px; + margin-top: 10px; +} + +.bus-icon-container { + background-color: white; + width: 70px; + height: 70px; + border-radius: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; } \ No newline at end of file diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/RealtimeMapPage.tsx index bd5370ca..bc563058 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/RealtimeMapPage.tsx @@ -1,97 +1,85 @@ -import React, { useEffect, useMemo, useState } from 'react' -import { MapContainer, useMap, Marker, Popup, TileLayer, Polyline } from 'react-leaflet' -// import https://www.svgrepo.com/show/113626/bus-front.svg -import defaultIcon from '../resources/bus-front.svg' -import MarkerClusterGroup from 'react-leaflet-cluster' -import { TEXTS } from 'src/resources/texts' - -import './Map.scss' -import { DivIcon } from 'leaflet' -import useVehicleLocations from 'src/api/useVehicleLocations' -import { VehicleLocation } from 'src/model/vehicleLocation' -import getAgencyList, { Agency } from 'src/api/agencyList' -import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' -import { Spin } from 'antd' -// import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' -import operatorIdToSvg from './components/utils/SvgComponent/imagesMap2' - -import { DataAndTimeSelector } from './components/DataAndTimeSelector' -import moment from 'moment' -import MinuteSelector from './components/MinuteSelector' -import { Button } from '@mui/material' +import React, { useEffect, useMemo, useState } from 'react'; +import { MapContainer, Marker, Polyline, Popup, TileLayer, useMap } from 'react-leaflet'; +import MarkerClusterGroup from 'react-leaflet-cluster'; +import { TEXTS } from 'src/resources/texts'; + +import { Button } from '@mui/material'; +import { Spin } from 'antd'; +import { DivIcon } from 'leaflet'; +import moment from 'moment'; +import getAgencyList, { Agency } from 'src/api/agencyList'; +import useVehicleLocations from 'src/api/useVehicleLocations'; +import { VehicleLocation } from 'src/model/vehicleLocation'; +import './Map.scss'; +import { DataAndTimeSelector } from './components/DataAndTimeSelector'; +import MinuteSelector from './components/MinuteSelector'; +import operatorIdToSvg from './components/utils/SvgComponent/BusLogosLoader'; +import { getColorByHashString } from './dashboard/OperatorHbarChart/utils'; export interface Point { - loc: [number, number] - color: number - operator?: number - bearing?: number - point?: VehicleLocation - recorded_at_time?: number + loc: [number, number]; + color: number; + operator?: number; + bearing?: number; + point?: VehicleLocation; + recorded_at_time?: number; } interface Path { - locations: VehicleLocation[] - lineRef: number - operator: number - vehicleRef: number + locations: VehicleLocation[]; + lineRef: number; + operator: number; + vehicleRef: number; } export const colorIcon = ({ busIcon, - color, name, - rotate = 0, }: { - busIcon: React.FunctionComponent> - color: string - name?: string - rotate?: number + busIcon: React.FunctionComponent>; + name?: string; }) => { - /* TODO: 2nd approach - const icon = (busIcon as any)?.default ?? defaultIcon - */ return new DivIcon({ className: 'my-div-icon', html: ` - - -
${name}
+
+ + +
${name}
+
`, - }) -} + }); +}; function formatTime(time: string | number | Date) { - const date = new Date(time).toISOString() - return date + const date = new Date(time).toISOString(); + return date; } export function numberToColorHsl(i: number, max: number) { - const ratio = i / max + const ratio = i / max; // 0 - black. 1 - red - const hue = 0 - const saturation = ratio * 100 - const lightness = ratio * 50 - return `hsl(${hue}, ${saturation}%, ${lightness}%)` + const hue = 0; + const saturation = ratio * 100; + const lightness = ratio * 50; + return `hsl(${hue}, ${saturation}%, ${lightness}%)`; } export default function RealtimeMapPage() { const position: Point = { loc: [32.3057988, 34.85478613], // arbitrary default value... Netanya - best city to live & die in color: 0, - } - const [from, setFrom] = useState('2023-05-01T12:00:00+02:00') // arbitrary default value. this date is not important - const [to, setTo] = useState('2023-05-01T12:01:00+02:00') + }; + const [from, setFrom] = useState('2023-05-01T12:00:00+02:00'); // arbitrary default value. this date is not important + const [to, setTo] = useState('2023-05-01T12:01:00+02:00'); const { locations, isLoading } = useVehicleLocations({ from: formatTime(from), to: formatTime(to), - }) - console.log(locations) + }); + console.log(locations); - const loaded = locations.length + const loaded = locations.length; const positions = useMemo(() => { const pos = locations.map((location) => ({ @@ -101,7 +89,7 @@ export default function RealtimeMapPage() { bearing: location.bearing, recorded_at_time: new Date(location.recorded_at_time).getTime(), point: location, - })) + })); // keep only the latest point for each vehicle // pos = pos.filter((p) => @@ -111,29 +99,29 @@ export default function RealtimeMapPage() { // p2.recorded_at_time! <= p.recorded_at_time!, // ), // ) - return pos - }, [locations]) + return pos; + }, [locations]); const paths = useMemo( () => locations.reduce((arr: Path[], loc) => { - const line = arr.find((line) => line.vehicleRef === loc.siri_ride__vehicle_ref) + const line = arr.find((line) => line.vehicleRef === loc.siri_ride__vehicle_ref); if (!line) { arr.push({ locations: [loc], lineRef: loc.siri_route__line_ref, operator: loc.siri_route__operator_ref, vehicleRef: loc.siri_ride__vehicle_ref, - }) + }); } else { - line.locations.push(loc) + line.locations.push(loc); } - return arr + return arr; }, []), [locations], - ) + ); - console.log(paths) + console.log(paths); return (
@@ -145,9 +133,9 @@ export default function RealtimeMapPage() { { - const value = ts ? ts.format() : '' - setFrom(value) - setTo(formatTime(+new Date(value) + (+new Date(to) - +new Date(from)))) // keep the same time difference + const value = ts ? ts.format() : ''; + setFrom(value); + setTo(formatTime(+new Date(value) + (+new Date(to) - +new Date(from)))); // keep the same time difference }} showTimePicker={true} /> @@ -167,16 +155,16 @@ export default function RealtimeMapPage() { @@ -211,34 +199,22 @@ export default function RealtimeMapPage() {
- ) + ); } -export function Markers({ positions }: { positions: Point[] }) { - const map = useMap() - const [agencyList, setAgencyList] = useState([]) - /* - TODO: 2nd approach - const [svgs, setSvgs] = useState(() => new Map()) - */ +export function Markers({ positions }: { positions: Point[]; }) { + const map = useMap(); + const [agencyList, setAgencyList] = useState([]); useEffect(() => { - getAgencyList().then(setAgencyList) - /*TODO: 2nd approach - getAgencyList().then((agencyList) => { - setAgencyList(agencyList) - agencyList.forEach(async (agency) => { - const icon = await getSvgFromOperatorId(agency.operator_ref) - setSvgs(new Map(svgs.set(agency.operator_ref, icon))) - }) - })*/ - }, []) + getAgencyList().then(setAgencyList).catch(console.log); + }, []); useEffect(() => { navigator.geolocation.getCurrentPosition((position) => map.flyTo([position.coords.latitude, position.coords.longitude], 13), - ) - }, []) + ); + }, []); return ( <> @@ -247,14 +223,8 @@ export function Markers({ positions }: { positions: Point[] }) { - >,*/ busIcon: operatorIdToSvg(pos.operator), - color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator)?.agency_name, - rotate: pos.bearing, })} key={i}> @@ -264,5 +234,5 @@ export function Markers({ positions }: { positions: Point[] }) { ))} - ) + ); } diff --git a/src/pages/SingleLineMapPage.tsx b/src/pages/SingleLineMapPage.tsx index 7bfafe17..68ca52ae 100644 --- a/src/pages/SingleLineMapPage.tsx +++ b/src/pages/SingleLineMapPage.tsx @@ -1,29 +1,28 @@ -import React, { useContext, useEffect, useMemo, useState } from 'react' +import moment from 'moment' +import { useContext, useEffect, useMemo, useState } from 'react' +import { MapContainer, Marker, Polyline, Popup, TileLayer } from 'react-leaflet' +import { getRoutesAsync } from 'src/api/gtfsService' +import useVehicleLocations from 'src/api/useVehicleLocations' +import { Label } from 'src/pages/components/Label' import LineNumberSelector from 'src/pages/components/LineSelector' import OperatorSelector from 'src/pages/components/OperatorSelector' +import RouteSelector from 'src/pages/components/RouteSelector' import { Row } from 'src/pages/components/Row' import { INPUT_SIZE } from 'src/resources/sizes' -import { getRoutesAsync } from 'src/api/gtfsService' -import RouteSelector from 'src/pages/components/RouteSelector' -import { Label } from 'src/pages/components/Label' import { TEXTS } from 'src/resources/texts' -import { PageContainer } from './components/PageContainer' import { SearchContext } from '../model/pageState' +import { Point, colorIcon } from './RealtimeMapPage' import { NotFound } from './components/NotFound' -import moment from 'moment' -import useVehicleLocations from 'src/api/useVehicleLocations' -import { MapContainer, Marker, Polyline, Popup, TileLayer } from 'react-leaflet' -import { Point, colorIcon, numberToColorHsl } from './RealtimeMapPage' +import { PageContainer } from './components/PageContainer' -import './Map.scss' +import { Autocomplete, TextField } from '@mui/material' +import { Spin } from 'antd' import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' -import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' -import { Spin } from 'antd' -// import getSvgFromOperatorId from './components/utils/SvgComponent/SvgComponent' -import operatorIdToSvg from './components/utils/SvgComponent/imagesMap2' +import './Map.scss' import { DataAndTimeSelector } from './components/DataAndTimeSelector' -import { Autocomplete, TextField } from '@mui/material' +import operatorIdToSvg from './components/utils/SvgComponent/BusLogosLoader' +import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' interface Path { locations: VehicleLocation[] @@ -41,21 +40,11 @@ const SingleLineMapPage = () => { const { search, setSearch } = useContext(SearchContext) const { operatorId, lineNumber, timestamp, routes, routeKey } = search const [routesIsLoading, setRoutesIsLoading] = useState(false) - /* TODO: 2nd approach - const [svgs, setSvgs] = useState(() => new Map()) - */ + const [agencyList, setAgencyList] = useState([]) useEffect(() => { - getAgencyList().then(setAgencyList) - /* TODO: 2nd approach - getAgencyList().then((agencyList) => { - setAgencyList(agencyList) - agencyList.forEach(async (agency) => { - const icon = await getSvgFromOperatorId(agency.operator_ref) - setSvgs(new Map(svgs.set(agency.operator_ref, icon))) - }) - })*/ + getAgencyList().then(setAgencyList).catch(console.log) }, []) useEffect(() => { @@ -73,7 +62,7 @@ const SingleLineMapPage = () => { () => routes?.find((route) => route.key === routeKey), [routes, routeKey], ) - const selectedRouteIds = selectedRoute?.routeIds + const selectedRouteIds = selectedRoute?.routeIds; const { locations, isLoading: locationsIsLoading } = useVehicleLocations({ from: selectedRouteIds ? new Date(timestamp).setHours(0, 0, 0, 0) : 0, @@ -148,15 +137,15 @@ const SingleLineMapPage = () => { { //!routesIsLoading && routes && - (routes.length === 0 ? ( - {TEXTS.line_not_found} - ) : ( - setSearch((current) => ({ ...current, routeKey: key }))} - /> - )) + (routes.length === 0 ? ( + {TEXTS.line_not_found} + ) : ( + setSearch((current) => ({ ...current, routeKey: key }))} + /> + )) } {positions && ( { - >,*/ busIcon: operatorIdToSvg(pos.operator), - color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator) ?.agency_name, - rotate: pos.bearing, })} key={i}> @@ -206,19 +189,19 @@ const SingleLineMapPage = () => { - ) -} + ); +}; function FilterPositionsByStartTime({ positions, setFilteredPositions, locationsIsLoading, }: { - positions: Point[] - setFilteredPositions: (positions: Point[]) => void - locationsIsLoading: boolean + positions: Point[]; + setFilteredPositions: (positions: Point[]) => void; + locationsIsLoading: boolean; }) { - const [startTime, setStartTime] = useState('00:00:00') + const [startTime, setStartTime] = useState('00:00:00'); const options = useMemo(() => { const options = positions .map((position) => position.point?.siri_ride__scheduled_start_time) // get all start times @@ -286,4 +269,4 @@ function FilterPositionsByStartTimeSelector({ ) } -export default SingleLineMapPage +export default SingleLineMapPage; diff --git a/src/pages/components/MapLayers/BusLayer.tsx b/src/pages/components/MapLayers/BusLayer.tsx index 14dc7bf6..c94b2bf8 100644 --- a/src/pages/components/MapLayers/BusLayer.tsx +++ b/src/pages/components/MapLayers/BusLayer.tsx @@ -1,60 +1,38 @@ import { DivIcon } from 'leaflet' import React, { useEffect, useState } from 'react' -import getAgencyList, { Agency } from 'src/api/agencyList' +import { Marker, Popup, useMap } from 'react-leaflet' import MarkerClusterGroup from 'react-leaflet-cluster' -import { useMap, Marker, Popup } from 'react-leaflet' +import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' -// import getSvgFromOperatorId from '../utils/SvgComponent/SvgComponent' -import operatorIdToSvg from '../utils/SvgComponent/imagesMap2' +import operatorIdToSvg from '../utils/SvgComponent/BusLogosLoader' const colorIcon = ({ busIcon, - color, name, - rotate = 0, }: { busIcon: React.FunctionComponent> - color: string name?: string - rotate?: number }) => { - /* - TODO: 2nd approach - const icon = (busIcon as any)?.default ?? defaultIcon - */ - - /*return new DivIcon({ - className: 'my-div-icon', - html: `
-
-
${name}
`, - })*/ return new DivIcon({ className: 'my-div-icon', html: ` - - -
${name}
+
+ + +
${name}
+
`, }) } -function numberToColorHsl(i: number, max: number) { +/*function numberToColorHsl(i: number, max: number) { const ratio = i / max // 0 - black. 1 - red const hue = 0 const saturation = ratio * 100 const lightness = ratio * 50 return `hsl(${hue}, ${saturation}%, ${lightness}%)` -} +}*/ export interface VehicleLocationMapPoint { loc: [number, number] @@ -68,20 +46,9 @@ export interface VehicleLocationMapPoint { export function BusLayer({ positions }: { positions: VehicleLocationMapPoint[] }) { const map = useMap() const [agencyList, setAgencyList] = useState([]) - /* TODO: 2nd approach - const [svgs, setSvgs] = useState(() => new Map()) - */ useEffect(() => { - getAgencyList().then(setAgencyList) - /* TODO: 2nd approach - getAgencyList().then((agencyList) => { - setAgencyList(agencyList) - agencyList.forEach(async (agency) => { - const icon = await getSvgFromOperatorId(agency.operator_ref) - setSvgs(new Map(svgs.set(agency.operator_ref, icon))) - }) - })*/ + getAgencyList().then(setAgencyList).catch(console.log) }, []) useEffect(() => { @@ -97,14 +64,8 @@ export function BusLayer({ positions }: { positions: VehicleLocationMapPoint[] } - >,*/ busIcon: operatorIdToSvg(pos.operator), - color: numberToColorHsl(pos.color, 60), name: agencyList.find((agency) => agency.operator_ref === pos.operator)?.agency_name, - rotate: pos.bearing, })} key={i}> diff --git a/src/pages/components/utils/SvgComponent/imagesMap2.tsx b/src/pages/components/utils/SvgComponent/BusLogosLoader.tsx similarity index 50% rename from src/pages/components/utils/SvgComponent/imagesMap2.tsx rename to src/pages/components/utils/SvgComponent/BusLogosLoader.tsx index 66c22ea8..5d8805af 100644 --- a/src/pages/components/utils/SvgComponent/imagesMap2.tsx +++ b/src/pages/components/utils/SvgComponent/BusLogosLoader.tsx @@ -1,21 +1,22 @@ import iconDefault from '../../../../resources/bus-logos/default.svg' -type OperatorId = string type Svg = React.FunctionComponent> -const svgsMap = new Map() +const svgsMap = new Map() const bus_logos = require.context('@bus-logos', true, /\.svg$/) bus_logos.keys().forEach((key) => { - const bus_logo = bus_logos(key) as Svg - const operator_id = key.replace('.svg', '').replace('.', '').replace('/', '') - svgsMap.set(operator_id, bus_logo) + const regex = /([0-9]+)|(?:default)/ //get only the operator id or 'default' from the filename + + if (regex.test(key)) { + const operator_id = key.match(regex)![0] + const bus_logo = bus_logos(key) as Svg + svgsMap.set(operator_id as string, bus_logo) + } }) -function operatorIdToSvg(operator_id: number | undefined): Svg { +export default function operatorIdToSvg(operator_id: number | undefined): Svg { if (!operator_id || !svgsMap.has(operator_id.toString())) { return iconDefault } return svgsMap.get(operator_id.toString())! } - -export default operatorIdToSvg diff --git a/src/pages/components/utils/SvgComponent/imagesMap.tsx b/src/pages/components/utils/SvgComponent/imagesMap.tsx deleted file mode 100644 index dc1fe08e..00000000 --- a/src/pages/components/utils/SvgComponent/imagesMap.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import icon2 from '../../../../resources/bus-logos/2.svg' -import icon3 from '../../../../resources/bus-logos/3.svg' -import icon4 from '../../../../resources/bus-logos/4.svg' -import icon5 from '../../../../resources/bus-logos/5.svg' -import icon6 from '../../../../resources/bus-logos/6.svg' -import icon7 from '../../../../resources/bus-logos/7.svg' -import icon8 from '../../../../resources/bus-logos/8.svg' -import icon10 from '../../../../resources/bus-logos/10.svg' -import icon14 from '../../../../resources/bus-logos/14.svg' -import icon15 from '../../../../resources/bus-logos/15.svg' -import icon16 from '../../../../resources/bus-logos/16.svg' -import icon18 from '../../../../resources/bus-logos/18.svg' -import icon20 from '../../../../resources/bus-logos/20.svg' -import icon21 from '../../../../resources/bus-logos/21.svg' -import icon23 from '../../../../resources/bus-logos/23.svg' -import icon24 from '../../../../resources/bus-logos/24.svg' -import icon25 from '../../../../resources/bus-logos/25.svg' -import icon31 from '../../../../resources/bus-logos/31.svg' -import icon32 from '../../../../resources/bus-logos/32.svg' -import icon34 from '../../../../resources/bus-logos/34.svg' -import icon35 from '../../../../resources/bus-logos/35.svg' -import icon37 from '../../../../resources/bus-logos/37.svg' -import icon38 from '../../../../resources/bus-logos/38.svg' -import icon42 from '../../../../resources/bus-logos/42.svg' -import icon44 from '../../../../resources/bus-logos/44.svg' -import icon45 from '../../../../resources/bus-logos/45.svg' -import icon47 from '../../../../resources/bus-logos/47.svg' -import icon49 from '../../../../resources/bus-logos/49.svg' -import icon50 from '../../../../resources/bus-logos/50.svg' -import icon51 from '../../../../resources/bus-logos/51.svg' -import icon91 from '../../../../resources/bus-logos/91.svg' -import icon93 from '../../../../resources/bus-logos/93.svg' -import icon97 from '../../../../resources/bus-logos/97.svg' -import icon98 from '../../../../resources/bus-logos/98.svg' -import iconDefault from '../../../../resources/bus-logos/default.svg' - -type OperatorId = string | number -type Svg = React.FunctionComponent> -const svgsMap = new Map([ - [2, icon2], - [3, icon3], - [4, icon4], - [5, icon5], - [6, icon6], - [7, icon7], - [8, icon8], - [10, icon10], - [14, icon14], - [15, icon15], - [16, icon16], - [18, icon18], - [20, icon20], - [21, icon21], - [23, icon23], - [24, icon24], - [25, icon25], - [31, icon31], - [32, icon32], - [34, icon34], - [35, icon35], - [37, icon37], - [38, icon38], - [42, icon42], - [44, icon44], - [45, icon45], - [47, icon47], - [49, icon49], - [50, icon50], - [51, icon51], - [91, icon91], - [93, icon93], - [97, icon97], - [98, icon98], - ['default', iconDefault], -]) -function operatorIdToSvg(operator_id: number | undefined): Svg { - if (!operator_id || !svgsMap.has(operator_id)) { - return iconDefault - } - return svgsMap.get(operator_id)! -} - -export default operatorIdToSvg From ffecc4fab57ca039281be35d7bf381042f4381a7 Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 11:02:43 +0300 Subject: [PATCH 04/10] - added buses` and operator's logos to `public` folder - load buses`logos according to its operator_id in `colorIcon` --- .env | 1 + craco.config.ts | 10 --------- package.json | 7 +++--- {src/resources => public}/bus-logos/10.svg | 0 {src/resources => public}/bus-logos/14.svg | 0 {src/resources => public}/bus-logos/15.svg | 0 {src/resources => public}/bus-logos/16.svg | 0 {src/resources => public}/bus-logos/18.svg | 0 {src/resources => public}/bus-logos/2.svg | 0 {src/resources => public}/bus-logos/20.svg | 0 {src/resources => public}/bus-logos/21.svg | 0 {src/resources => public}/bus-logos/23.svg | 0 {src/resources => public}/bus-logos/24.svg | 0 {src/resources => public}/bus-logos/25.svg | 0 {src/resources => public}/bus-logos/3.svg | 0 {src/resources => public}/bus-logos/31.svg | 0 {src/resources => public}/bus-logos/32.svg | 0 {src/resources => public}/bus-logos/34.svg | 0 {src/resources => public}/bus-logos/35.svg | 0 {src/resources => public}/bus-logos/37.svg | 0 {src/resources => public}/bus-logos/38.svg | 0 {src/resources => public}/bus-logos/4.svg | 0 {src/resources => public}/bus-logos/42.svg | 0 {src/resources => public}/bus-logos/44.svg | 0 {src/resources => public}/bus-logos/45.svg | 0 {src/resources => public}/bus-logos/47.svg | 0 {src/resources => public}/bus-logos/49.svg | 0 {src/resources => public}/bus-logos/5.svg | 0 {src/resources => public}/bus-logos/50.svg | 0 {src/resources => public}/bus-logos/51.svg | 0 {src/resources => public}/bus-logos/6.svg | 0 {src/resources => public}/bus-logos/7.svg | 0 {src/resources => public}/bus-logos/8.svg | 0 {src/resources => public}/bus-logos/91.svg | 0 {src/resources => public}/bus-logos/92.svg | 0 {src/resources => public}/bus-logos/93.svg | 0 {src/resources => public}/bus-logos/97.svg | 0 {src/resources => public}/bus-logos/98.svg | 0 .../bus-logos/default.svg | 0 .../operators-logos/10.svg | 0 .../operators-logos/14.svg | 0 .../operators-logos/15.svg | 0 .../operators-logos/16.svg | 0 .../operators-logos/18.svg | 0 .../operators-logos/2.svg | 0 .../operators-logos/20.svg | 0 .../operators-logos/21.svg | 0 .../operators-logos/23.svg | 0 .../operators-logos/24.svg | 0 .../operators-logos/25.svg | 0 .../operators-logos/3.svg | 0 .../operators-logos/31.svg | 0 .../operators-logos/32.svg | 0 .../operators-logos/34.svg | 0 .../operators-logos/35.svg | 0 .../operators-logos/37.svg | 0 .../operators-logos/38.svg | 0 .../operators-logos/4.svg | 0 .../operators-logos/42.svg | 0 .../operators-logos/44.svg | 0 .../operators-logos/45.svg | 0 .../operators-logos/47.svg | 0 .../operators-logos/49.svg | 0 .../operators-logos/5.svg | 0 .../operators-logos/50.svg | 0 .../operators-logos/51.svg | 0 .../operators-logos/6.svg | 0 .../operators-logos/7.svg | 0 .../operators-logos/8.svg | 0 .../operators-logos/91.svg | 0 .../operators-logos/92.svg | 0 .../operators-logos/97.svg | 0 .../operators-logos/98.svg | 0 src/pages/RealtimeMapPage.tsx | 14 ++++-------- src/pages/SingleLineMapPage.tsx | 3 +-- src/pages/components/MapLayers/BusLayer.tsx | 14 ++++-------- .../utils/SvgComponent/BusLogosLoader.tsx | 22 ------------------- .../utils/SvgComponent/SvgComponent.tsx | 15 ------------- yarn.lock | 5 ----- 79 files changed, 13 insertions(+), 78 deletions(-) create mode 100644 .env delete mode 100644 craco.config.ts rename {src/resources => public}/bus-logos/10.svg (100%) rename {src/resources => public}/bus-logos/14.svg (100%) rename {src/resources => public}/bus-logos/15.svg (100%) rename {src/resources => public}/bus-logos/16.svg (100%) rename {src/resources => public}/bus-logos/18.svg (100%) rename {src/resources => public}/bus-logos/2.svg (100%) rename {src/resources => public}/bus-logos/20.svg (100%) rename {src/resources => public}/bus-logos/21.svg (100%) rename {src/resources => public}/bus-logos/23.svg (100%) rename {src/resources => public}/bus-logos/24.svg (100%) rename {src/resources => public}/bus-logos/25.svg (100%) rename {src/resources => public}/bus-logos/3.svg (100%) rename {src/resources => public}/bus-logos/31.svg (100%) rename {src/resources => public}/bus-logos/32.svg (100%) rename {src/resources => public}/bus-logos/34.svg (100%) rename {src/resources => public}/bus-logos/35.svg (100%) rename {src/resources => public}/bus-logos/37.svg (100%) rename {src/resources => public}/bus-logos/38.svg (100%) rename {src/resources => public}/bus-logos/4.svg (100%) rename {src/resources => public}/bus-logos/42.svg (100%) rename {src/resources => public}/bus-logos/44.svg (100%) rename {src/resources => public}/bus-logos/45.svg (100%) rename {src/resources => public}/bus-logos/47.svg (100%) rename {src/resources => public}/bus-logos/49.svg (100%) rename {src/resources => public}/bus-logos/5.svg (100%) rename {src/resources => public}/bus-logos/50.svg (100%) rename {src/resources => public}/bus-logos/51.svg (100%) rename {src/resources => public}/bus-logos/6.svg (100%) rename {src/resources => public}/bus-logos/7.svg (100%) rename {src/resources => public}/bus-logos/8.svg (100%) rename {src/resources => public}/bus-logos/91.svg (100%) rename {src/resources => public}/bus-logos/92.svg (100%) rename {src/resources => public}/bus-logos/93.svg (100%) rename {src/resources => public}/bus-logos/97.svg (100%) rename {src/resources => public}/bus-logos/98.svg (100%) rename {src/resources => public}/bus-logos/default.svg (100%) rename {src/resources => public}/operators-logos/10.svg (100%) rename {src/resources => public}/operators-logos/14.svg (100%) rename {src/resources => public}/operators-logos/15.svg (100%) rename {src/resources => public}/operators-logos/16.svg (100%) rename {src/resources => public}/operators-logos/18.svg (100%) rename {src/resources => public}/operators-logos/2.svg (100%) rename {src/resources => public}/operators-logos/20.svg (100%) rename {src/resources => public}/operators-logos/21.svg (100%) rename {src/resources => public}/operators-logos/23.svg (100%) rename {src/resources => public}/operators-logos/24.svg (100%) rename {src/resources => public}/operators-logos/25.svg (100%) rename {src/resources => public}/operators-logos/3.svg (100%) rename {src/resources => public}/operators-logos/31.svg (100%) rename {src/resources => public}/operators-logos/32.svg (100%) rename {src/resources => public}/operators-logos/34.svg (100%) rename {src/resources => public}/operators-logos/35.svg (100%) rename {src/resources => public}/operators-logos/37.svg (100%) rename {src/resources => public}/operators-logos/38.svg (100%) rename {src/resources => public}/operators-logos/4.svg (100%) rename {src/resources => public}/operators-logos/42.svg (100%) rename {src/resources => public}/operators-logos/44.svg (100%) rename {src/resources => public}/operators-logos/45.svg (100%) rename {src/resources => public}/operators-logos/47.svg (100%) rename {src/resources => public}/operators-logos/49.svg (100%) rename {src/resources => public}/operators-logos/5.svg (100%) rename {src/resources => public}/operators-logos/50.svg (100%) rename {src/resources => public}/operators-logos/51.svg (100%) rename {src/resources => public}/operators-logos/6.svg (100%) rename {src/resources => public}/operators-logos/7.svg (100%) rename {src/resources => public}/operators-logos/8.svg (100%) rename {src/resources => public}/operators-logos/91.svg (100%) rename {src/resources => public}/operators-logos/92.svg (100%) rename {src/resources => public}/operators-logos/97.svg (100%) rename {src/resources => public}/operators-logos/98.svg (100%) delete mode 100644 src/pages/components/utils/SvgComponent/BusLogosLoader.tsx delete mode 100644 src/pages/components/utils/SvgComponent/SvgComponent.tsx diff --git a/.env b/.env new file mode 100644 index 00000000..4f79a0f8 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +GENERATE_SOURCEMAP=false \ No newline at end of file diff --git a/craco.config.ts b/craco.config.ts deleted file mode 100644 index 66da47bc..00000000 --- a/craco.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import path from 'path' - -module.exports = { - webpack: { - alias: { - '@bus-logos': path.resolve(__dirname, 'src/resources/bus-logos'), - '@operators-logos': path.resolve(__dirname, 'src/resources/operators-logos'), - }, - }, -} diff --git a/package.json b/package.json index 3d056130..2650521c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "@emotion/styled": "^11.11.0", "@mui/material": "^5.14.7", "@mui/x-date-pickers": "^6.12.1", - "@types/webpack-env": "^1.18.1", "antd": "^4.22.5", "axios": "^0.27.2", "classnames": "^2.3.2", @@ -40,9 +39,9 @@ "autoprefixer": "10.4.5" }, "scripts": { - "start": "craco start", - "build": "CI=false craco build", - "test": "craco test", + "start": "react-scripts start", + "build": "CI=false react-scripts build", + "test": "react-scripts test", "test:playwright": "playwright test", "eject": "react-scripts eject", "lint": "eslint .", diff --git a/src/resources/bus-logos/10.svg b/public/bus-logos/10.svg similarity index 100% rename from src/resources/bus-logos/10.svg rename to public/bus-logos/10.svg diff --git a/src/resources/bus-logos/14.svg b/public/bus-logos/14.svg similarity index 100% rename from src/resources/bus-logos/14.svg rename to public/bus-logos/14.svg diff --git a/src/resources/bus-logos/15.svg b/public/bus-logos/15.svg similarity index 100% rename from src/resources/bus-logos/15.svg rename to public/bus-logos/15.svg diff --git a/src/resources/bus-logos/16.svg b/public/bus-logos/16.svg similarity index 100% rename from src/resources/bus-logos/16.svg rename to public/bus-logos/16.svg diff --git a/src/resources/bus-logos/18.svg b/public/bus-logos/18.svg similarity index 100% rename from src/resources/bus-logos/18.svg rename to public/bus-logos/18.svg diff --git a/src/resources/bus-logos/2.svg b/public/bus-logos/2.svg similarity index 100% rename from src/resources/bus-logos/2.svg rename to public/bus-logos/2.svg diff --git a/src/resources/bus-logos/20.svg b/public/bus-logos/20.svg similarity index 100% rename from src/resources/bus-logos/20.svg rename to public/bus-logos/20.svg diff --git a/src/resources/bus-logos/21.svg b/public/bus-logos/21.svg similarity index 100% rename from src/resources/bus-logos/21.svg rename to public/bus-logos/21.svg diff --git a/src/resources/bus-logos/23.svg b/public/bus-logos/23.svg similarity index 100% rename from src/resources/bus-logos/23.svg rename to public/bus-logos/23.svg diff --git a/src/resources/bus-logos/24.svg b/public/bus-logos/24.svg similarity index 100% rename from src/resources/bus-logos/24.svg rename to public/bus-logos/24.svg diff --git a/src/resources/bus-logos/25.svg b/public/bus-logos/25.svg similarity index 100% rename from src/resources/bus-logos/25.svg rename to public/bus-logos/25.svg diff --git a/src/resources/bus-logos/3.svg b/public/bus-logos/3.svg similarity index 100% rename from src/resources/bus-logos/3.svg rename to public/bus-logos/3.svg diff --git a/src/resources/bus-logos/31.svg b/public/bus-logos/31.svg similarity index 100% rename from src/resources/bus-logos/31.svg rename to public/bus-logos/31.svg diff --git a/src/resources/bus-logos/32.svg b/public/bus-logos/32.svg similarity index 100% rename from src/resources/bus-logos/32.svg rename to public/bus-logos/32.svg diff --git a/src/resources/bus-logos/34.svg b/public/bus-logos/34.svg similarity index 100% rename from src/resources/bus-logos/34.svg rename to public/bus-logos/34.svg diff --git a/src/resources/bus-logos/35.svg b/public/bus-logos/35.svg similarity index 100% rename from src/resources/bus-logos/35.svg rename to public/bus-logos/35.svg diff --git a/src/resources/bus-logos/37.svg b/public/bus-logos/37.svg similarity index 100% rename from src/resources/bus-logos/37.svg rename to public/bus-logos/37.svg diff --git a/src/resources/bus-logos/38.svg b/public/bus-logos/38.svg similarity index 100% rename from src/resources/bus-logos/38.svg rename to public/bus-logos/38.svg diff --git a/src/resources/bus-logos/4.svg b/public/bus-logos/4.svg similarity index 100% rename from src/resources/bus-logos/4.svg rename to public/bus-logos/4.svg diff --git a/src/resources/bus-logos/42.svg b/public/bus-logos/42.svg similarity index 100% rename from src/resources/bus-logos/42.svg rename to public/bus-logos/42.svg diff --git a/src/resources/bus-logos/44.svg b/public/bus-logos/44.svg similarity index 100% rename from src/resources/bus-logos/44.svg rename to public/bus-logos/44.svg diff --git a/src/resources/bus-logos/45.svg b/public/bus-logos/45.svg similarity index 100% rename from src/resources/bus-logos/45.svg rename to public/bus-logos/45.svg diff --git a/src/resources/bus-logos/47.svg b/public/bus-logos/47.svg similarity index 100% rename from src/resources/bus-logos/47.svg rename to public/bus-logos/47.svg diff --git a/src/resources/bus-logos/49.svg b/public/bus-logos/49.svg similarity index 100% rename from src/resources/bus-logos/49.svg rename to public/bus-logos/49.svg diff --git a/src/resources/bus-logos/5.svg b/public/bus-logos/5.svg similarity index 100% rename from src/resources/bus-logos/5.svg rename to public/bus-logos/5.svg diff --git a/src/resources/bus-logos/50.svg b/public/bus-logos/50.svg similarity index 100% rename from src/resources/bus-logos/50.svg rename to public/bus-logos/50.svg diff --git a/src/resources/bus-logos/51.svg b/public/bus-logos/51.svg similarity index 100% rename from src/resources/bus-logos/51.svg rename to public/bus-logos/51.svg diff --git a/src/resources/bus-logos/6.svg b/public/bus-logos/6.svg similarity index 100% rename from src/resources/bus-logos/6.svg rename to public/bus-logos/6.svg diff --git a/src/resources/bus-logos/7.svg b/public/bus-logos/7.svg similarity index 100% rename from src/resources/bus-logos/7.svg rename to public/bus-logos/7.svg diff --git a/src/resources/bus-logos/8.svg b/public/bus-logos/8.svg similarity index 100% rename from src/resources/bus-logos/8.svg rename to public/bus-logos/8.svg diff --git a/src/resources/bus-logos/91.svg b/public/bus-logos/91.svg similarity index 100% rename from src/resources/bus-logos/91.svg rename to public/bus-logos/91.svg diff --git a/src/resources/bus-logos/92.svg b/public/bus-logos/92.svg similarity index 100% rename from src/resources/bus-logos/92.svg rename to public/bus-logos/92.svg diff --git a/src/resources/bus-logos/93.svg b/public/bus-logos/93.svg similarity index 100% rename from src/resources/bus-logos/93.svg rename to public/bus-logos/93.svg diff --git a/src/resources/bus-logos/97.svg b/public/bus-logos/97.svg similarity index 100% rename from src/resources/bus-logos/97.svg rename to public/bus-logos/97.svg diff --git a/src/resources/bus-logos/98.svg b/public/bus-logos/98.svg similarity index 100% rename from src/resources/bus-logos/98.svg rename to public/bus-logos/98.svg diff --git a/src/resources/bus-logos/default.svg b/public/bus-logos/default.svg similarity index 100% rename from src/resources/bus-logos/default.svg rename to public/bus-logos/default.svg diff --git a/src/resources/operators-logos/10.svg b/public/operators-logos/10.svg similarity index 100% rename from src/resources/operators-logos/10.svg rename to public/operators-logos/10.svg diff --git a/src/resources/operators-logos/14.svg b/public/operators-logos/14.svg similarity index 100% rename from src/resources/operators-logos/14.svg rename to public/operators-logos/14.svg diff --git a/src/resources/operators-logos/15.svg b/public/operators-logos/15.svg similarity index 100% rename from src/resources/operators-logos/15.svg rename to public/operators-logos/15.svg diff --git a/src/resources/operators-logos/16.svg b/public/operators-logos/16.svg similarity index 100% rename from src/resources/operators-logos/16.svg rename to public/operators-logos/16.svg diff --git a/src/resources/operators-logos/18.svg b/public/operators-logos/18.svg similarity index 100% rename from src/resources/operators-logos/18.svg rename to public/operators-logos/18.svg diff --git a/src/resources/operators-logos/2.svg b/public/operators-logos/2.svg similarity index 100% rename from src/resources/operators-logos/2.svg rename to public/operators-logos/2.svg diff --git a/src/resources/operators-logos/20.svg b/public/operators-logos/20.svg similarity index 100% rename from src/resources/operators-logos/20.svg rename to public/operators-logos/20.svg diff --git a/src/resources/operators-logos/21.svg b/public/operators-logos/21.svg similarity index 100% rename from src/resources/operators-logos/21.svg rename to public/operators-logos/21.svg diff --git a/src/resources/operators-logos/23.svg b/public/operators-logos/23.svg similarity index 100% rename from src/resources/operators-logos/23.svg rename to public/operators-logos/23.svg diff --git a/src/resources/operators-logos/24.svg b/public/operators-logos/24.svg similarity index 100% rename from src/resources/operators-logos/24.svg rename to public/operators-logos/24.svg diff --git a/src/resources/operators-logos/25.svg b/public/operators-logos/25.svg similarity index 100% rename from src/resources/operators-logos/25.svg rename to public/operators-logos/25.svg diff --git a/src/resources/operators-logos/3.svg b/public/operators-logos/3.svg similarity index 100% rename from src/resources/operators-logos/3.svg rename to public/operators-logos/3.svg diff --git a/src/resources/operators-logos/31.svg b/public/operators-logos/31.svg similarity index 100% rename from src/resources/operators-logos/31.svg rename to public/operators-logos/31.svg diff --git a/src/resources/operators-logos/32.svg b/public/operators-logos/32.svg similarity index 100% rename from src/resources/operators-logos/32.svg rename to public/operators-logos/32.svg diff --git a/src/resources/operators-logos/34.svg b/public/operators-logos/34.svg similarity index 100% rename from src/resources/operators-logos/34.svg rename to public/operators-logos/34.svg diff --git a/src/resources/operators-logos/35.svg b/public/operators-logos/35.svg similarity index 100% rename from src/resources/operators-logos/35.svg rename to public/operators-logos/35.svg diff --git a/src/resources/operators-logos/37.svg b/public/operators-logos/37.svg similarity index 100% rename from src/resources/operators-logos/37.svg rename to public/operators-logos/37.svg diff --git a/src/resources/operators-logos/38.svg b/public/operators-logos/38.svg similarity index 100% rename from src/resources/operators-logos/38.svg rename to public/operators-logos/38.svg diff --git a/src/resources/operators-logos/4.svg b/public/operators-logos/4.svg similarity index 100% rename from src/resources/operators-logos/4.svg rename to public/operators-logos/4.svg diff --git a/src/resources/operators-logos/42.svg b/public/operators-logos/42.svg similarity index 100% rename from src/resources/operators-logos/42.svg rename to public/operators-logos/42.svg diff --git a/src/resources/operators-logos/44.svg b/public/operators-logos/44.svg similarity index 100% rename from src/resources/operators-logos/44.svg rename to public/operators-logos/44.svg diff --git a/src/resources/operators-logos/45.svg b/public/operators-logos/45.svg similarity index 100% rename from src/resources/operators-logos/45.svg rename to public/operators-logos/45.svg diff --git a/src/resources/operators-logos/47.svg b/public/operators-logos/47.svg similarity index 100% rename from src/resources/operators-logos/47.svg rename to public/operators-logos/47.svg diff --git a/src/resources/operators-logos/49.svg b/public/operators-logos/49.svg similarity index 100% rename from src/resources/operators-logos/49.svg rename to public/operators-logos/49.svg diff --git a/src/resources/operators-logos/5.svg b/public/operators-logos/5.svg similarity index 100% rename from src/resources/operators-logos/5.svg rename to public/operators-logos/5.svg diff --git a/src/resources/operators-logos/50.svg b/public/operators-logos/50.svg similarity index 100% rename from src/resources/operators-logos/50.svg rename to public/operators-logos/50.svg diff --git a/src/resources/operators-logos/51.svg b/public/operators-logos/51.svg similarity index 100% rename from src/resources/operators-logos/51.svg rename to public/operators-logos/51.svg diff --git a/src/resources/operators-logos/6.svg b/public/operators-logos/6.svg similarity index 100% rename from src/resources/operators-logos/6.svg rename to public/operators-logos/6.svg diff --git a/src/resources/operators-logos/7.svg b/public/operators-logos/7.svg similarity index 100% rename from src/resources/operators-logos/7.svg rename to public/operators-logos/7.svg diff --git a/src/resources/operators-logos/8.svg b/public/operators-logos/8.svg similarity index 100% rename from src/resources/operators-logos/8.svg rename to public/operators-logos/8.svg diff --git a/src/resources/operators-logos/91.svg b/public/operators-logos/91.svg similarity index 100% rename from src/resources/operators-logos/91.svg rename to public/operators-logos/91.svg diff --git a/src/resources/operators-logos/92.svg b/public/operators-logos/92.svg similarity index 100% rename from src/resources/operators-logos/92.svg rename to public/operators-logos/92.svg diff --git a/src/resources/operators-logos/97.svg b/public/operators-logos/97.svg similarity index 100% rename from src/resources/operators-logos/97.svg rename to public/operators-logos/97.svg diff --git a/src/resources/operators-logos/98.svg b/public/operators-logos/98.svg similarity index 100% rename from src/resources/operators-logos/98.svg rename to public/operators-logos/98.svg diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/RealtimeMapPage.tsx index de2d0362..9a51c1a9 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/RealtimeMapPage.tsx @@ -13,7 +13,6 @@ import { VehicleLocation } from 'src/model/vehicleLocation' import './Map.scss' import { DataAndTimeSelector } from './components/DataAndTimeSelector' import MinuteSelector from './components/MinuteSelector' -import operatorIdToSvg from './components/utils/SvgComponent/BusLogosLoader' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' export interface Point { @@ -32,18 +31,13 @@ interface Path { vehicleRef: number } -export const colorIcon = ({ - busIcon, - name, -}: { - busIcon: React.FunctionComponent> - name?: string -}) => { +export const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => { + const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg` return new DivIcon({ className: 'my-div-icon', html: `
- +
${name}
@@ -223,7 +217,7 @@ export function Markers({ positions }: { positions: Point[] }) { agency.operator_ref === pos.operator)?.agency_name, })} key={i}> diff --git a/src/pages/SingleLineMapPage.tsx b/src/pages/SingleLineMapPage.tsx index 7a3b0b3e..c478abd2 100644 --- a/src/pages/SingleLineMapPage.tsx +++ b/src/pages/SingleLineMapPage.tsx @@ -21,7 +21,6 @@ import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' import './Map.scss' import { DataAndTimeSelector } from './components/DataAndTimeSelector' -import operatorIdToSvg from './components/utils/SvgComponent/BusLogosLoader' import { getColorByHashString } from './dashboard/OperatorHbarChart/utils' interface Path { @@ -164,7 +163,7 @@ const SingleLineMapPage = () => { agency.operator_ref === pos.operator) ?.agency_name, })} diff --git a/src/pages/components/MapLayers/BusLayer.tsx b/src/pages/components/MapLayers/BusLayer.tsx index c94b2bf8..70b0963f 100644 --- a/src/pages/components/MapLayers/BusLayer.tsx +++ b/src/pages/components/MapLayers/BusLayer.tsx @@ -4,20 +4,14 @@ import { Marker, Popup, useMap } from 'react-leaflet' import MarkerClusterGroup from 'react-leaflet-cluster' import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' -import operatorIdToSvg from '../utils/SvgComponent/BusLogosLoader' -const colorIcon = ({ - busIcon, - name, -}: { - busIcon: React.FunctionComponent> - name?: string -}) => { +const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => { + const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg` return new DivIcon({ className: 'my-div-icon', html: `
- +
${name}
@@ -64,7 +58,7 @@ export function BusLayer({ positions }: { positions: VehicleLocationMapPoint[] } agency.operator_ref === pos.operator)?.agency_name, })} key={i}> diff --git a/src/pages/components/utils/SvgComponent/BusLogosLoader.tsx b/src/pages/components/utils/SvgComponent/BusLogosLoader.tsx deleted file mode 100644 index 5d8805af..00000000 --- a/src/pages/components/utils/SvgComponent/BusLogosLoader.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import iconDefault from '../../../../resources/bus-logos/default.svg' - -type Svg = React.FunctionComponent> -const svgsMap = new Map() - -const bus_logos = require.context('@bus-logos', true, /\.svg$/) -bus_logos.keys().forEach((key) => { - const regex = /([0-9]+)|(?:default)/ //get only the operator id or 'default' from the filename - - if (regex.test(key)) { - const operator_id = key.match(regex)![0] - const bus_logo = bus_logos(key) as Svg - svgsMap.set(operator_id as string, bus_logo) - } -}) - -export default function operatorIdToSvg(operator_id: number | undefined): Svg { - if (!operator_id || !svgsMap.has(operator_id.toString())) { - return iconDefault - } - return svgsMap.get(operator_id.toString())! -} diff --git a/src/pages/components/utils/SvgComponent/SvgComponent.tsx b/src/pages/components/utils/SvgComponent/SvgComponent.tsx deleted file mode 100644 index abb81a18..00000000 --- a/src/pages/components/utils/SvgComponent/SvgComponent.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import busIcon from '../../../../resources/bus-front.svg' - -async function getSvgFromOperatorId(operator_id: number | string) { - let icon = busIcon - try { - icon = (await import( - `../../../../resources/bus-logos/${operator_id.toString()}.svg` - )) as React.FunctionComponent> - } catch (err) { - icon = busIcon - } - return icon -} -export default getSvgFromOperatorId diff --git a/yarn.lock b/yarn.lock index f46fe6c0..ecfe8c9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2603,11 +2603,6 @@ resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.11.9.tgz#76a071d27e544e422dbf00f956818b1057f377b2" integrity sha512-M63wKUdsjDFUfyFt1TCUZHGFk9KDAa5JP0adNUErbm0U45Lr06HtANdYRP+GyleEopEoZ4UyBcdAC5TnW4Uz2w== -"@types/webpack-env@^1.18.1": - version "1.18.1" - resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.18.1.tgz#49699bb508961e14a3bfb68c78cd87b296889d1d" - integrity sha512-D0HJET2/UY6k9L6y3f5BL+IDxZmPkYmPT4+qBrRdmRLYRuV0qNKizMgTvYxXZYn+36zjPeoDZAEYBCM6XB+gww== - "@types/ws@^8.5.5": version "8.5.5" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" From 1e8810426721cc9ae5426e1739a356226f8723ea Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 11:05:15 +0300 Subject: [PATCH 05/10] - added comment in .env --- .env | 1 + 1 file changed, 1 insertion(+) diff --git a/.env b/.env index 4f79a0f8..09ebf1e2 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ +# solves issues with stylis-plugin-rtl : https://github.com/styled-components/stylis-plugin-rtl/issues/35#issuecomment-1550877823 GENERATE_SOURCEMAP=false \ No newline at end of file From 96a978480b8da8546b344ed26f07cf28b4c23a80 Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 11:09:42 +0300 Subject: [PATCH 06/10] -removed craco --- package.json | 5 +- yarn.lock | 179 +++------------------------------------------------ 2 files changed, 9 insertions(+), 175 deletions(-) diff --git a/package.json b/package.json index 2650521c..07307972 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,6 @@ ] }, "devDependencies": { - "@craco/craco": "^7.1.0", - "@craco/types": "^7.1.0", "@playwright/test": "^1.37.1", "@types/geolib": "^2.0.23", "@types/leaflet": "^1.7.11", @@ -81,6 +79,5 @@ "openapi-typescript-codegen": "^0.23.0", "prettier": "^2.7.1" }, - "packageManager": "yarn@1.22.19", - "cracoConfig": "craco.config.ts" + "packageManager": "yarn@1.22.19" } diff --git a/yarn.lock b/yarn.lock index ecfe8c9a..6e36c81c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1178,7 +1178,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.19.3", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.22.19" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.19.tgz#7425343253556916e440e662bb221a93ddb75684" integrity sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg== @@ -1192,38 +1192,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@craco/craco@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-7.1.0.tgz#12bd394c7f0334e214302e4d35a1768f68042fbb" - integrity sha512-oRAcPIKYrfPXp9rSzlsDNeOaVtDiKhoyqSXUoqiK24jCkHr4T8m/a2f74yXIzCbIheoUWDOIfWZyRgFgT+cpqA== - dependencies: - autoprefixer "^10.4.12" - cosmiconfig "^7.0.1" - cosmiconfig-typescript-loader "^1.0.0" - cross-spawn "^7.0.3" - lodash "^4.17.21" - semver "^7.3.7" - webpack-merge "^5.8.0" - -"@craco/types@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@craco/types/-/types-7.1.0.tgz#9bc9a83fad2a42ae53bf21ff5e587824f10fa31a" - integrity sha512-zdyk2G9UfEItrvnB+sd3xDHB5Mf3dsD6wE+Ex6V+Nch+GSXdFGQfXD/l+ZX9hO03R1rmnJPCxrIRPJUib8Q/MQ== - dependencies: - "@babel/types" "^7.19.3" - "@jest/types" "^27.5.1" - "@types/eslint" "^8.4.6" - autoprefixer "^10.4.12" - eslint-webpack-plugin "^3.2.0" - webpack "^5.74.0" - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@csstools/normalize.css@*": version "12.0.0" resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-12.0.0.tgz#a9583a75c3f150667771f30b60d9f059473e62c4" @@ -1770,7 +1738,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== @@ -1793,14 +1761,6 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.19" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" @@ -2174,26 +2134,6 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.20.2" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.2.tgz#215db4f4a35d710256579784a548907237728756" @@ -2316,7 +2256,7 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint@*", "@types/eslint@^7.29.0 || ^8.4.1", "@types/eslint@^8.4.6": +"@types/eslint@*", "@types/eslint@^7.29.0 || ^8.4.1": version "8.44.2" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.2.tgz#0d21c505f98a89b8dd4d37fa162b09da6089199a" integrity sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg== @@ -2887,17 +2827,12 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.2.4, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -3064,11 +2999,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - arg@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" @@ -3235,7 +3165,7 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -autoprefixer@10.4.5, autoprefixer@^10.4.12, autoprefixer@^10.4.13: +autoprefixer@10.4.5, autoprefixer@^10.4.13: version "10.4.5" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.5.tgz#662193c744094b53d3637f39be477e07bd904998" integrity sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw== @@ -3701,15 +3631,6 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" - clsx@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b" @@ -3911,14 +3832,6 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig-typescript-loader@^1.0.0: - version "1.0.9" - resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.9.tgz#69c523f7e8c3d9f27f563d02bbeadaf2f27212d3" - integrity sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g== - dependencies: - cosmiconfig "^7" - ts-node "^10.7.0" - cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" @@ -3930,7 +3843,7 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: +cosmiconfig@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== @@ -3941,11 +3854,6 @@ cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: path-type "^4.0.0" yaml "^1.10.0" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -4400,11 +4308,6 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -4941,7 +4844,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-webpack-plugin@^3.1.1, eslint-webpack-plugin@^3.2.0: +eslint-webpack-plugin@^3.1.1: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-3.2.0.tgz#1978cdb9edc461e4b0195a20da950cf57988347c" integrity sha512-avrKcGncpPbPSUHX6B3stNGzkKFto3eL+DKM4+VyMrVnhPc3vRczVlCq3uhuFOdRvDHTVXuzwk1ZKUrqDQHQ9w== @@ -6048,13 +5951,6 @@ is-plain-obj@^3.0.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" @@ -6163,11 +6059,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -7073,11 +6964,6 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -9463,13 +9349,6 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" @@ -10106,25 +9985,6 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== -ts-node@^10.7.0: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - tsconfig-paths@^3.14.2: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" @@ -10386,11 +10246,6 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" @@ -10536,14 +10391,6 @@ webpack-manifest-plugin@^4.0.2: tapable "^2.0.0" webpack-sources "^2.2.0" -webpack-merge@^5.8.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.9.0.tgz#dc160a1c4cf512ceca515cc231669e9ddb133826" - integrity sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg== - dependencies: - clone-deep "^4.0.1" - wildcard "^2.0.0" - webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" @@ -10565,7 +10412,7 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.64.4, webpack@^5.74.0: +webpack@^5.64.4: version "5.88.2" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e" integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== @@ -10708,11 +10555,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wildcard@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" - integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== - word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" @@ -10979,11 +10821,6 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From dd050b42ce0b571ede8a0a8cd8e02358c31d4175 Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 11:10:45 +0300 Subject: [PATCH 07/10] -license --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 07307972..bbe89c7d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "license": "MIT", "name": "open-bus-map-search", "version": "0.1.0", "private": true, From 06fe693ddb784efef5c398a962407c77f44075fa Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 11:51:15 +0300 Subject: [PATCH 08/10] remove comments from map.scss --- src/pages/Map.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/Map.scss b/src/pages/Map.scss index 6258521d..8c55090c 100644 --- a/src/pages/Map.scss +++ b/src/pages/Map.scss @@ -10,9 +10,6 @@ main>div, .mask { display: block; - /*-webkit-mask-repeat: no-repeat; - -webkit-mask-position: center; - -webkit-mask-size: contain;*/ height: 50px; background-repeat: no-repeat; } From bfbaeed1c657fc0e3b5c285dbbcc697b2374d0ba Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Tue, 19 Sep 2023 17:30:36 +0300 Subject: [PATCH 09/10] style: make things look better --- src/pages/Map.scss | 27 +++++++++++++-------- src/pages/RealtimeMapPage.tsx | 7 +++--- src/pages/components/MapLayers/BusLayer.tsx | 7 +++--- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/pages/Map.scss b/src/pages/Map.scss index 8c55090c..6e8cf04d 100644 --- a/src/pages/Map.scss +++ b/src/pages/Map.scss @@ -8,12 +8,6 @@ main>div, flex: 1 1 auto; } -.mask { - display: block; - height: 50px; - background-repeat: no-repeat; -} - pre { direction: ltr; height: 200px; @@ -27,12 +21,25 @@ pre { } .bus-icon-container { - background-color: white; - width: 70px; - height: 70px; - border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; + + > .bus-icon-circle{ + width: 50px; + height: 50px; + padding: 5px; + border-radius: 50%; + background-color: white; + img { + width: 100%; + height: 100%; + } + } + > .operator-name { + background-color: rgba(255, 255, 255, 0.4); + font-weight: bold; + font-size: 1.25em; + } } \ No newline at end of file diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/RealtimeMapPage.tsx index 9a51c1a9..53df5bb3 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/RealtimeMapPage.tsx @@ -37,9 +37,10 @@ export const colorIcon = ({ operator_id, name }: { operator_id: string; name?: s className: 'my-div-icon', html: `
- - -
${name}
+
+ ${name} +
+
${name}
`, }) diff --git a/src/pages/components/MapLayers/BusLayer.tsx b/src/pages/components/MapLayers/BusLayer.tsx index 70b0963f..a51df956 100644 --- a/src/pages/components/MapLayers/BusLayer.tsx +++ b/src/pages/components/MapLayers/BusLayer.tsx @@ -11,9 +11,10 @@ const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string } className: 'my-div-icon', html: `
- - -
${name}
+
+ ${name} +
+
${name}
`, }) From 2629b1501e5e52269d4388d755410edcfd5b9f13 Mon Sep 17 00:00:00 2001 From: "rzarviv@gmail.com" Date: Tue, 19 Sep 2023 17:43:01 +0300 Subject: [PATCH 10/10] - added noam's commit --- src/pages/Map.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Map.scss b/src/pages/Map.scss index 6e8cf04d..b5ea71ee 100644 --- a/src/pages/Map.scss +++ b/src/pages/Map.scss @@ -37,7 +37,7 @@ pre { height: 100%; } } - > .operator-name { + > .operator-name{ background-color: rgba(255, 255, 255, 0.4); font-weight: bold; font-size: 1.25em;