diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index ba69d30..12e8bc0 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -40,7 +40,6 @@ export class AllKnownLayouts { if (knownKeys.indexOf(key) >= 0) { continue; } - console.log(key) knownKeys.push(key); all.layers.push(layer); } diff --git a/Customizations/LayerDefinition.ts b/Customizations/LayerDefinition.ts index bdf480f..e1dbc86 100644 --- a/Customizations/LayerDefinition.ts +++ b/Customizations/LayerDefinition.ts @@ -70,7 +70,10 @@ export class LayerDefinition { */ style: (tags: any) => { color: string, - icon: any, + icon: { + iconUrl: string, + iconSize: number[], + }, }; /** @@ -119,16 +122,6 @@ export class LayerDefinition { this.wayHandling = options.wayHandling ?? LayerDefinition.WAYHANDLING_DEFAULT; } - asLayer(basemap: Basemap, allElements: ElementStorage, changes: Changes, userDetails: UIEventSource, - selectedElement: UIEventSource<{feature: any}>, - showOnPopup: (tags: UIEventSource, feature: any) => UIElement): - FilteredLayer { - return new FilteredLayer( - this, - basemap, allElements, changes, - selectedElement, - showOnPopup); - } } \ No newline at end of file diff --git a/Customizations/Layers/BikeParkings.ts b/Customizations/Layers/BikeParkings.ts index 67b0b89..765a954 100644 --- a/Customizations/Layers/BikeParkings.ts +++ b/Customizations/Layers/BikeParkings.ts @@ -1,7 +1,6 @@ import {LayerDefinition} from "../LayerDefinition"; import {And, Or, Tag} from "../../Logic/TagsFilter"; import {OperatorTag} from "../Questions/OperatorTag"; -import * as L from "leaflet"; import FixedText from "../Questions/FixedText"; import ParkingType from "../Questions/bike/ParkingType"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; @@ -47,11 +46,11 @@ export default class BikeParkings extends LayerDefinition { return function (properties: any) { return { color: "#00bb00", - icon: L.icon({ + icon: { iconUrl: self.icon, iconSize: [50, 50], iconAnchor: [25,50] - }) + } }; }; } diff --git a/Customizations/Layers/BikeShops.ts b/Customizations/Layers/BikeShops.ts index 6fa764b..e07b981 100644 --- a/Customizations/Layers/BikeShops.ts +++ b/Customizations/Layers/BikeShops.ts @@ -3,7 +3,6 @@ import Translations from "../../UI/i18n/Translations"; import {And, Tag} from "../../Logic/TagsFilter"; import FixedText from "../Questions/FixedText"; import { ImageCarouselWithUploadConstructor } from "../../UI/Image/ImageCarouselWithUpload"; -import * as L from "leaflet"; import ShopRetail from "../Questions/bike/ShopRetail"; import ShopPump from "../Questions/bike/ShopPump"; import ShopRental from "../Questions/bike/ShopRental"; @@ -71,11 +70,11 @@ export default class BikeShops extends LayerDefinition { return { color: "#00bb00", - icon: L.icon({ + icon: { iconUrl: icon, iconSize: [50, 50], iconAnchor: [25, 50] - }) + } } } } diff --git a/Customizations/Layers/BikeStations.ts b/Customizations/Layers/BikeStations.ts index ff2987b..cac60ae 100644 --- a/Customizations/Layers/BikeStations.ts +++ b/Customizations/Layers/BikeStations.ts @@ -1,6 +1,5 @@ import {LayerDefinition} from "../LayerDefinition"; import {And, Tag, TagsFilter, Or} from "../../Logic/TagsFilter"; -import * as L from "leaflet"; import BikeStationChain from "../Questions/bike/StationChain"; import BikeStationPumpTools from "../Questions/bike/StationPumpTools"; import BikeStationStand from "../Questions/bike/StationStand"; @@ -72,18 +71,18 @@ export default class BikeStations extends LayerDefinition { if (isOperational) { iconName = "pump.svg" } else { - iconName = "broken_pump.svg" + iconName = "broken_pump_2.svg" } } const iconUrl = `./assets/bike/${iconName}` return { color: "#00bb00", - icon: L.icon({ + icon: { iconUrl: iconUrl, iconSize: [50, 50], iconAnchor: [25, 50] - }) + } }; }; } diff --git a/Customizations/Layers/Birdhide.ts b/Customizations/Layers/Birdhide.ts index a917e79..ea9e642 100644 --- a/Customizations/Layers/Birdhide.ts +++ b/Customizations/Layers/Birdhide.ts @@ -3,7 +3,6 @@ import {And, Or, Tag} from "../../Logic/TagsFilter"; import {TagRenderingOptions} from "../TagRendering"; import FixedText from "../Questions/FixedText"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; -import L from "leaflet"; export class Birdhide extends LayerDefinition { @@ -13,8 +12,9 @@ export class Birdhide extends LayerDefinition { constructor() { super({ name: "vogelkijkplaats", + description: "Een plaats om vogels te kijken, zoals een vogelkijkhut of kijkwand", overpassFilter: Birdhide.birdhide, - elementsToShow: [new FixedText("hi")], + elementsToShow: [], icon: "assets/nature/birdhide.svg", minzoom: 12, wayHandling: LayerDefinition.WAYHANDLING_CENTER_AND_WAY, @@ -90,11 +90,11 @@ export class Birdhide extends LayerDefinition { return { color: "#0000bb", - icon: L.icon({ + icon: { iconUrl: icon, iconSize: [40,40], iconAnchor: [20,20] - }) + } } } diff --git a/Customizations/Layers/Bookcases.ts b/Customizations/Layers/Bookcases.ts index 1f67cbd..6092291 100644 --- a/Customizations/Layers/Bookcases.ts +++ b/Customizations/Layers/Bookcases.ts @@ -1,9 +1,9 @@ import {LayerDefinition} from "../LayerDefinition"; -import L from "leaflet"; import {And, Or, Tag} from "../../Logic/TagsFilter"; import {TagRenderingOptions} from "../TagRendering"; import {NameInline} from "../Questions/NameInline"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; +import Translations from "../../UI/i18n/Translations"; export class Bookcases extends LayerDefinition { @@ -16,7 +16,7 @@ export class Bookcases extends LayerDefinition { this.overpassFilter = new Tag("amenity", "public_bookcase"); this.minzoom = 11; - this.title = new NameInline("ruilboekenkastje"); + this.title = new NameInline(Translations.t.bookcases.bookcase); this.elementsToShow = [ new ImageCarouselWithUploadConstructor(), new TagRenderingOptions({ @@ -38,7 +38,7 @@ export class Bookcases extends LayerDefinition { question: "Hoeveel boeken passen in dit boekenruilkastje?", freeform: { renderTemplate: "Er passen {capacity} boeken in dit boekenruilkastje", - template: "Er passen $$$ boeken in dit boekenruilkastje", + template: "Er passen $nat$ boeken in dit boekenruilkastje", key: "capacity", placeholder: "aantal" }, @@ -159,10 +159,11 @@ export class Bookcases extends LayerDefinition { this.style = function (tags) { return { - icon: new L.icon({ + icon: { iconUrl: "assets/bookcase.svg", - iconSize: [40, 40] - }), + iconSize: [40, 40], + iconAnchor: [20,20] + }, color: "#0000ff" }; } diff --git a/Customizations/Layers/DrinkingWater.ts b/Customizations/Layers/DrinkingWater.ts index bfefdf8..579eed4 100644 --- a/Customizations/Layers/DrinkingWater.ts +++ b/Customizations/Layers/DrinkingWater.ts @@ -52,11 +52,11 @@ export class DrinkingWater extends LayerDefinition { return { color: "#00bb00", - icon: new L.icon({ + icon: { iconUrl: self.icon, iconSize: [50, 50], iconAnchor: [25,50] - }) + } }; }; } diff --git a/Customizations/Layers/GrbToFix.ts b/Customizations/Layers/GrbToFix.ts index 5c7fcf9..d92f8b3 100644 --- a/Customizations/Layers/GrbToFix.ts +++ b/Customizations/Layers/GrbToFix.ts @@ -1,5 +1,4 @@ import {LayerDefinition} from "../LayerDefinition"; -import L from "leaflet" import {And, Regex, Tag} from "../../Logic/TagsFilter"; import {TagRenderingOptions} from "../TagRendering"; @@ -18,11 +17,10 @@ export class GrbToFix extends LayerDefinition { this.style = function (tags) { return { - icon: new L.icon({ + icon: { iconUrl: "assets/star.svg", iconSize: [40, 40], - text: "hi" - }), + }, color: "#ff0000" }; diff --git a/Customizations/Layers/InformationBoard.ts b/Customizations/Layers/InformationBoard.ts index 240e9e1..7b696db 100644 --- a/Customizations/Layers/InformationBoard.ts +++ b/Customizations/Layers/InformationBoard.ts @@ -3,12 +3,12 @@ import FixedText from "../Questions/FixedText"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; import {TagRenderingOptions} from "../TagRendering"; import {And, Tag} from "../../Logic/TagsFilter"; -import L from "leaflet"; export class InformationBoard extends LayerDefinition { constructor() { super({ name: "Informatiebord", + description: "Een informatiebord of kaart", minzoom: 12, overpassFilter: new Tag("tourism", "information"), newElementTags: [new Tag("tourism", "information")], @@ -44,12 +44,10 @@ export class InformationBoard extends LayerDefinition { return { color: "#000000", - icon: L.icon( - { - iconUrl: icon, - iconSize: [50, 50] - } - ) + icon: { + iconUrl: icon, + iconSize: [50, 50] + } }; } diff --git a/Customizations/Layers/Map.ts b/Customizations/Layers/Map.ts index aeadf29..183db79 100644 --- a/Customizations/Layers/Map.ts +++ b/Customizations/Layers/Map.ts @@ -3,7 +3,6 @@ import FixedText from "../Questions/FixedText"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; import {TagRenderingOptions} from "../TagRendering"; import {And, Tag} from "../../Logic/TagsFilter"; -import L from "leaflet"; export class Map extends LayerDefinition { constructor() { @@ -36,12 +35,10 @@ export class Map extends LayerDefinition { return { color: "#000000", - icon: L.icon( - { - iconUrl: icon, - iconSize: [50, 50] - } - ) + icon: { + iconUrl: icon, + iconSize: [50, 50] + } }; } diff --git a/Customizations/Layers/NatureReserves.ts b/Customizations/Layers/NatureReserves.ts index 3481042..d3f13c6 100644 --- a/Customizations/Layers/NatureReserves.ts +++ b/Customizations/Layers/NatureReserves.ts @@ -72,7 +72,7 @@ export class NatureReserves extends LayerDefinition { freeform: { renderTemplate: "Bij problemen of vragen, de conservator kan bereikt worden via " + "{email}", - template: "$$$", + template: "$email$", key: "email" } }), @@ -83,7 +83,7 @@ export class NatureReserves extends LayerDefinition { freeform: { renderTemplate: "Bij problemen of vragen, de {conservator} kan bereikt worden via " + "{phone}", - template: "$$$", + template: "$phone$", key: "phone" } diff --git a/Customizations/Layers/Viewpoint.ts b/Customizations/Layers/Viewpoint.ts index 5012e79..442d94e 100644 --- a/Customizations/Layers/Viewpoint.ts +++ b/Customizations/Layers/Viewpoint.ts @@ -1,5 +1,4 @@ import {LayerDefinition} from "../LayerDefinition"; -import L from "leaflet" import {FixedUiElement} from "../../UI/Base/FixedUiElement"; import FixedText from "../Questions/FixedText"; import {Tag} from "../../Logic/TagsFilter"; @@ -17,10 +16,10 @@ export class Viewpoint extends LayerDefinition { wayHandling: LayerDefinition.WAYHANDLING_CENTER_ONLY, style: tags => { return { - color: undefined, icon: new L.icon({ + color: undefined, icon:{ iconUrl: "assets/viewpoint.svg", iconSize: [20, 20] - }) + } } }, maxAllowedOverlapPercentage: 0, diff --git a/Customizations/Layout.ts b/Customizations/Layout.ts index 077fbe5..5d11f29 100644 --- a/Customizations/Layout.ts +++ b/Customizations/Layout.ts @@ -14,8 +14,11 @@ import {UIEventSource} from "../UI/UIEventSource"; export class Layout { public name: string; - public icon: string = "./assets/add.svg"; + public icon: string = "./assets/logo.svg"; public title: UIElement; + public description: string | UIElement = Translations.t.general.about; + public socialImage: string = "" + public layers: LayerDefinition[]; public welcomeMessage: UIElement; public gettingStartedPlzLogin: UIElement; diff --git a/Customizations/Layouts/Bookcases.ts b/Customizations/Layouts/Bookcases.ts index d833d6e..0a4f1aa 100644 --- a/Customizations/Layouts/Bookcases.ts +++ b/Customizations/Layouts/Bookcases.ts @@ -1,29 +1,20 @@ import {Layout} from "../Layout"; import * as Layer from "../Layers/Bookcases"; +import Translations from "../../UI/i18n/Translations"; +import Combine from "../../UI/Base/Combine"; -export class Bookcases extends Layout{ +export class Bookcases extends Layout { constructor() { - super( "bookcases", - ["nl"], - "Open Bookcase Map", + super("bookcases", + ["nl", "en"], + Translations.t.bookcases.title, [new Layer.Bookcases()], 14, 51.2, 3.2, - - "

Open BoekenkastjesKaart

\n" + - "\n" + - "

" + - "Help mee met het creëeren van een volledige kaart met alle boekenruilkastjes!" + - "Een boekenruilkastje is een vaste plaats in publieke ruimte waar iedereen een boek in kan zetten of uit kan meenemen." + - "Meestal een klein kastje of doosje dat op straat staat, maar ook een oude telefooncellen of een schap in een station valt hieronder."+ - "

" - , - "

Begin met het aanmaken van een account\n" + - " of door je " + - " aan te melden.

", - "Klik op een boekenruilkastje om vragen te beantwoorden"); - this.locationContains= ["Bookcases.html", "Bookcase.html","bookcase"] + new Combine(["

",Translations.t.bookcases.title,"

", Translations.t.bookcases.description]) + ); + this.icon = "assets/bookcase.svg" } } \ No newline at end of file diff --git a/Customizations/Layouts/Cyclofix.ts b/Customizations/Layouts/Cyclofix.ts index 2cadb07..398e211 100644 --- a/Customizations/Layouts/Cyclofix.ts +++ b/Customizations/Layouts/Cyclofix.ts @@ -10,7 +10,7 @@ import Combine from "../../UI/Base/Combine"; export default class Cyclofix extends Layout { constructor() { super( - "pomp", + "cyclofix", ["en", "nl", "fr"], Translations.t.cyclofix.title, [new BikeServices(), new BikeShops(), new DrinkingWater(), new BikeParkings()], @@ -25,6 +25,8 @@ export default class Cyclofix extends Layout { "

" ]) ); - this.icon = "./assets/bike/pump.svg" + this.icon = "./assets/bike/logo.svg" + this.description = "Easily search and contribute bicycle data nearby"; + this.socialImage = "./assets/bike/cyclofix.jpeg" } } diff --git a/Customizations/Layouts/Groen.ts b/Customizations/Layouts/Groen.ts index 6faef2c..3ca7fe0 100644 --- a/Customizations/Layouts/Groen.ts +++ b/Customizations/Layouts/Groen.ts @@ -9,7 +9,7 @@ export class Groen extends Layout { constructor() { super("buurtnatuur", ["nl"], - "Buurtnatuur", + "Buurtnatuur.be", [new NatureReserves(), new Park(), new Bos(), new Viewpoint()], 10, 50.8435, @@ -52,6 +52,9 @@ export class Groen extends Layout { "" ); + this.icon = "assets/groen.svg" this.locationContains = ["buurtnatuur.be"] + this.socialImage = "assets/BuurtnatuurFront.jpg" + this.description = "Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje" } } \ No newline at end of file diff --git a/Customizations/Layouts/MetaMap.ts b/Customizations/Layouts/MetaMap.ts index c174bc6..6486e9b 100644 --- a/Customizations/Layouts/MetaMap.ts +++ b/Customizations/Layouts/MetaMap.ts @@ -15,5 +15,6 @@ export class MetaMap extends Layout{ "

Open Map Map

\n" + "This map is a map of physical maps, as known by OpenStreetMap."); + this.icon = "assets/osm-logo-buggy-attr.svg" } } \ No newline at end of file diff --git a/Customizations/Layouts/Natuurpunt.ts b/Customizations/Layouts/Natuurpunt.ts index a03d4b9..26566e4 100644 --- a/Customizations/Layouts/Natuurpunt.ts +++ b/Customizations/Layouts/Natuurpunt.ts @@ -18,5 +18,6 @@ export class Natuurpunt extends Layout{ "", "" ); + this.icon = "./assets/nature/birdhide.svg" } } \ No newline at end of file diff --git a/Customizations/Layouts/Statues.ts b/Customizations/Layouts/Statues.ts index d355fa4..90740bb 100644 --- a/Customizations/Layouts/Statues.ts +++ b/Customizations/Layouts/Statues.ts @@ -4,8 +4,8 @@ import {Artwork} from "../Layers/Artwork"; export class Statues extends Layout{ constructor() { super( "statues", - "Open Artwork Map", ["en"], + "Open Artwork Map", [new Artwork()], 10, 50.8435, diff --git a/Customizations/Layouts/StreetWidth.ts b/Customizations/Layouts/StreetWidth.ts index faaea76..7ad592c 100644 --- a/Customizations/Layouts/StreetWidth.ts +++ b/Customizations/Layouts/StreetWidth.ts @@ -84,9 +84,9 @@ export class StreetWidth extends Layout{ "
  • Het aantal woonerven uitbreiden
  • " + "
  • Grotere auto's meer belasten - ze nemen immers meer parkeerruimte in.
  • " + "
  • Laat toeristen verplicht parkeren onder het zand; een (fiets)taxi kan hen naar hun hotel brengen
  • " + - "
  • Voorzie in elke straat enkele parkeerplaatsen voor kortparkeren. Zo kunnen leveringen, iemand afzetten,... gebeuren zonder dat er een fietspad of een straat geblokkeerd wordt
  • "+ - "", - "", - ""); + "
  • Voorzie in elke straat enkele parkeerplaatsen voor kortparkeren. Zo kunnen leveringen, iemand afzetten,... gebeuren zonder dat er een fietspad of een straat geblokkeerd wordt
  • " + + ""); + this.icon = "assets/bug.svg"; + } } \ No newline at end of file diff --git a/Customizations/Questions/NameInline.ts b/Customizations/Questions/NameInline.ts index 5c9d4e6..2e28cf9 100644 --- a/Customizations/Questions/NameInline.ts +++ b/Customizations/Questions/NameInline.ts @@ -1,28 +1,25 @@ import {TagRenderingOptions} from "../TagRendering"; import {And, Tag} from "../../Logic/TagsFilter"; import {UIElement} from "../../UI/UIElement"; +import Translations from "../../UI/i18n/Translations"; export class NameInline extends TagRenderingOptions{ - static Upper(string){ - return string.charAt(0).toUpperCase() + string.slice(1); - } - - constructor(category: string ) { + constructor(category: string | UIElement ) { super({ question: "", freeform: { renderTemplate: "{name}", - template: "De naam van dit "+category+" is $$$", + template: Translations.t.general.nameInlineQuestion.Subs({category: category}), key: "name", extraTags: new Tag("noname", "") // Remove 'noname=yes' }, mappings: [ - {k: new Tag("noname","yes"), txt: NameInline.Upper(category)+" zonder naam"}, - {k: null, txt: NameInline.Upper(category)} + {k: new Tag("noname","yes"), txt: Translations.t.general.noNameCategory.Subs({category: category})}, + {k: null, txt: category} ] }); } diff --git a/Customizations/TagRendering.ts b/Customizations/TagRendering.ts index 73798d0..193e24e 100644 --- a/Customizations/TagRendering.ts +++ b/Customizations/TagRendering.ts @@ -15,7 +15,8 @@ import {FixedInputElement} from "../UI/Input/FixedInputElement"; import {RadioButton} from "../UI/Input/RadioButton"; import Translations from "../UI/i18n/Translations"; import Locale from "../UI/i18n/Locale"; - +import * as EmailValidator from 'email-validator'; +import { parsePhoneNumberFromString } from 'libphonenumber-js' export class TagRenderingOptions implements TagDependantUIElementConstructor { @@ -25,6 +26,12 @@ export class TagRenderingOptions implements TagDependantUIElementConstructor { "int": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)), "nat": (str) => str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) > 0, "float": (str) => !isNaN(Number(str)), + "email": (str) => EmailValidator.validate(str), + "phone": (str) => parsePhoneNumberFromString(str).isValid() + } + + public static formatting = { + "phone": (str) => parsePhoneNumberFromString(str).formatInternational() } /** @@ -345,7 +352,12 @@ class TagRendering extends UIElement implements TagDependantUIElement { const prepost = Translations.W(freeform.template).InnerRender().split("$"); const type = prepost[1]; - const isValid = TagRenderingOptions.inputValidation[type]; + let isValid = TagRenderingOptions.inputValidation[type]; + if(isValid === undefined){ + console.log("Invalid type for field type", type) + isValid = (str) => true; + } + let formatter = TagRenderingOptions.formatting[type] ?? ((str) => str); const pickString = (string: any) => { @@ -355,7 +367,7 @@ class TagRendering extends UIElement implements TagDependantUIElement { if (!isValid(string)) { return undefined; } - const tag = new Tag(freeform.key, string); + const tag = new Tag(freeform.key, formatter(string)); if (freeform.extraTags === undefined) { return tag; diff --git a/Helpers.ts b/Helpers.ts index 49043bd..22e7d38 100644 --- a/Helpers.ts +++ b/Helpers.ts @@ -70,6 +70,21 @@ export class Helpers { return confirmationMessage; //Webkit, Safari, Chrome }); + + document.addEventListener('visibilitychange',() => { + if(document.visibilityState === "visible"){ + return; + } + if (changes.pendingChangesES.data == 0) { + return; + } + + console.log("Upmoading: loss of focus") + changes.uploadAll(function () { + window.close() + }); + }) + } } \ No newline at end of file diff --git a/Logic/Basemap.ts b/Logic/Basemap.ts index f5c37e9..2c3edea 100644 --- a/Logic/Basemap.ts +++ b/Logic/Basemap.ts @@ -104,6 +104,5 @@ export class Basemap { self.LastClickLocation.setData({lat: e.latlng.lat, lon: e.latlng.lng}) }); } - - + } diff --git a/Logic/FilteredLayer.ts b/Logic/FilteredLayer.ts index 3053fd3..15fddf7 100644 --- a/Logic/FilteredLayer.ts +++ b/Logic/FilteredLayer.ts @@ -1,12 +1,13 @@ -import { Basemap } from "./Basemap"; -import { TagsFilter, TagUtils } from "./TagsFilter"; -import { UIEventSource } from "../UI/UIEventSource"; -import { ElementStorage } from "./ElementStorage"; -import { Changes } from "./Changes"; +import {Basemap} from "./Basemap"; +import {TagsFilter, TagUtils} from "./TagsFilter"; +import {UIEventSource} from "../UI/UIEventSource"; +import {ElementStorage} from "./ElementStorage"; +import {Changes} from "./Changes"; import L from "leaflet" -import { GeoOperations } from "./GeoOperations"; -import { UIElement } from "../UI/UIElement"; -import { LayerDefinition } from "../Customizations/LayerDefinition"; +import {GeoOperations} from "./GeoOperations"; +import {UIElement} from "../UI/UIElement"; +import {LayerDefinition} from "../Customizations/LayerDefinition"; +import {UserDetails} from "./OsmConnection"; /*** * A filtered layer is a layer which offers a 'set-data' function @@ -26,7 +27,7 @@ export class FilteredLayer { private readonly _map: Basemap; private readonly _maxAllowedOverlap: number; - private readonly _style: (properties) => { color: string, icon: any }; + private readonly _style: (properties) => { color: string, icon: { iconUrl: string } }; private readonly _storage: ElementStorage; @@ -59,7 +60,7 @@ export class FilteredLayer { this._style = layerDef.style; if (this._style === undefined) { this._style = function () { - return {icon: "", color: "#000000"}; + return {icon: {iconUrl: "./assets/bug.svg"}, color: "#000000"}; } } this.name = name; @@ -78,6 +79,20 @@ export class FilteredLayer { } }) } + + static fromDefinition( + definition, + basemap: Basemap, allElements: ElementStorage, changes: Changes, userDetails: UIEventSource, + selectedElement: UIEventSource<{feature: any}>, + showOnPopup: (tags: UIEventSource, feature: any) => UIElement): + FilteredLayer { + return new FilteredLayer( + definition, + basemap, allElements, changes, + selectedElement, + showOnPopup); + + } /** @@ -187,7 +202,7 @@ export class FilteredLayer { } else { marker = L.marker(latLng, { - icon: style.icon + icon: new L.icon(style.icon) }); } return marker; @@ -197,7 +212,7 @@ export class FilteredLayer { let eventSource = self._storage.addOrGetElement(feature); eventSource.addCallback(function () { if (layer.setIcon) { - layer.setIcon(self._style(feature.properties).icon) + layer.setIcon(L.icon(self._style(feature.properties).icon)) } else { console.log("UPdating", layer); @@ -212,7 +227,12 @@ export class FilteredLayer { console.log("Selected ", feature) self._selectedElement.setData({feature: feature}); const uiElement = self._showOnPopup(eventSource, feature); - const popup = L.popup() + + const iconInfo = self._style(feature.properties).icon; + + const popup = L.popup({ + autoPan: true, + }) .setContent(uiElement.Render()) .setLatLng(e.latlng) .openOn(self._map.map); diff --git a/Logic/GeoLocationHandler.ts b/Logic/GeoLocationHandler.ts index 8c4075c..e84c3c1 100644 --- a/Logic/GeoLocationHandler.ts +++ b/Logic/GeoLocationHandler.ts @@ -3,7 +3,6 @@ import {UIEventSource} from "../UI/UIEventSource"; import {UIElement} from "../UI/UIElement"; import L from "leaflet"; import {Helpers} from "../Helpers"; -import {UserDetails} from "./OsmConnection"; export class GeoLocationHandler extends UIElement { @@ -81,7 +80,7 @@ export class GeoLocationHandler extends UIElement { this.HideOnEmpty(true); } - protected InnerRender(): string { + InnerRender(): string { if (this.currentLocation.data) { return "locate me"; } @@ -114,6 +113,12 @@ export class GeoLocationHandler extends UIElement { if (!self._isActive.data) { self._isActive.setData(true); Helpers.DoEvery(60000, () => { + + if(document.visibilityState !== "visible"){ + console.log("Not starting gps: document not visible") + return; + } + self._map.map.findAccuratePosition({ maxWait: 10000, // defaults to 10000 desiredAccuracy: 50 // defaults to 20 diff --git a/Logic/LocalStorageSource.ts b/Logic/LocalStorageSource.ts index 3b1146c..f3ed37d 100644 --- a/Logic/LocalStorageSource.ts +++ b/Logic/LocalStorageSource.ts @@ -3,15 +3,19 @@ import {UIEventSource} from "../UI/UIEventSource"; export class LocalStorageSource { static Get(key: string, defaultValue: string = undefined): UIEventSource { - + + //* + // ignore when running from the console + return new UIEventSource(defaultValue); + /*/ const saved = localStorage.getItem(key); const source = new UIEventSource(saved ?? defaultValue); - // ignore when running from the console source.addCallback((data) => { localStorage.setItem(key, data); console.log("Wriging ", key, data) }); return source; + //*/ } } \ No newline at end of file diff --git a/UI/Image/ImgurImage.ts b/UI/Image/ImgurImage.ts index cf0e07d..c2d1041 100644 --- a/UI/Image/ImgurImage.ts +++ b/UI/Image/ImgurImage.ts @@ -32,7 +32,7 @@ export class ImgurImage extends UIElement { } - protected InnerRender(): string { + InnerRender(): string { const image = ""; if(this._imageMeta.data === null){ diff --git a/UI/Image/SimpleImageElement.ts b/UI/Image/SimpleImageElement.ts index 4c07045..1509ac1 100644 --- a/UI/Image/SimpleImageElement.ts +++ b/UI/Image/SimpleImageElement.ts @@ -8,7 +8,7 @@ export class SimpleImageElement extends UIElement { super(source); } - protected InnerRender(): string { + InnerRender(): string { return "img"; } diff --git a/UI/Image/WikimediaImage.ts b/UI/Image/WikimediaImage.ts index abdf132..ed71b3c 100644 --- a/UI/Image/WikimediaImage.ts +++ b/UI/Image/WikimediaImage.ts @@ -29,7 +29,7 @@ export class WikimediaImage extends UIElement { } - protected InnerRender(): string { + InnerRender(): string { let url = Wikimedia.ImageNameToUrl(this._imageLocation, 500, 400); url = url.replace(/'/g, '%27'); diff --git a/UI/Input/InputElementWrapper.ts b/UI/Input/InputElementWrapper.ts index 905a948..baf6b07 100644 --- a/UI/Input/InputElementWrapper.ts +++ b/UI/Input/InputElementWrapper.ts @@ -26,10 +26,6 @@ export class InputElementWrapper extends InputElement{ return this.input.GetValue(); } - ShowValue(t: T) { - return this.input.ShowValue(t); - } - InnerRender(): string { return this.pre.Render() + this.input.Render() + this.post.Render(); } diff --git a/UI/SlideShow.ts b/UI/SlideShow.ts index 8602d4c..254c03a 100644 --- a/UI/SlideShow.ts +++ b/UI/SlideShow.ts @@ -39,7 +39,7 @@ export class SlideShow extends UIElement { } - protected InnerRender(): string { + InnerRender(): string { if (this._embeddedElements.data.length == 0) { return this._noimages.Render(); } diff --git a/UI/UIElement.ts b/UI/UIElement.ts index 8bae413..f67e209 100644 --- a/UI/UIElement.ts +++ b/UI/UIElement.ts @@ -8,6 +8,9 @@ export abstract class UIElement { public readonly _source: UIEventSource; private _hideIfEmpty = false; + + // WOrkaround as document is not defined + public static runningFromConsole = false; protected constructor(source: UIEventSource) { this.id = "ui-element-" + UIElement.nextId; @@ -37,9 +40,10 @@ export abstract class UIElement { } Update(): void { - if(document === undefined){ - return ; // Running from console + if(UIElement.runningFromConsole){ + return; } + let element = document.getElementById(this.id); if (element === undefined || element === null) { // The element is not painted diff --git a/UI/i18n/Translation.ts b/UI/i18n/Translation.ts index d0f6375..58a1d8b 100644 --- a/UI/i18n/Translation.ts +++ b/UI/i18n/Translation.ts @@ -18,13 +18,11 @@ export default class Translation extends UIElement { const parts = template.split("{" + k + "}"); const el: string | UIElement = text[k]; let rtext: string = ""; - console.log(parts) if (typeof (el) === "string") { rtext = el; } else { Translation.forcedLanguage = lang; // This is a very dirty hack - it'll bite me one day rtext = el.InnerRender(); - console.log(rtext) } for (let i = 0; i < parts.length - 1; i++) { combined.push(parts[i]); diff --git a/UI/i18n/Translations.ts b/UI/i18n/Translations.ts index 9a5c871..a13e316 100644 --- a/UI/i18n/Translations.ts +++ b/UI/i18n/Translations.ts @@ -14,14 +14,14 @@ export default class Translations { static t = { cyclofix: { title: new T({ - en: 'Cyclofix bicycle infrastructure', - nl: 'Cyclofix fietsinfrastructuur', + en: 'Cyclofix - an open map for cyclists', + nl: 'Cyclofix - een open kaart voor fietsers', fr: 'TODO: FRENCH TRANSLATION' }), description: new T({ - en: "On this map we want to collect data about the whereabouts of bicycle pumps and public racks in Brussels." + + en: "On this map we want to collect data about the whereabouts of bicycle pumps and public racks in Brussels and everywhere else." + "As a result, cyclists will be able to quickly find the nearest infrastructure for their needs.", - nl: "Op deze kaart willen we gegevens verzamelen over de locatie van fietspompen en openbare stelplaatsen in Brussel." + + nl: "Op deze kaart willen we gegevens verzamelen over de locatie van fietspompen en openbare stelplaatsen in Brussel en overal ter wereld." + "Hierdoor kunnen fietsers snel de dichtstbijzijnde infrastructuur vinden die voldoet aan hun behoeften.", fr: "Sur cette carte, nous voulons collecter des données sur la localisation des pompes à vélo et des supports publics à Bruxelles." + "Les cyclistes pourront ainsi trouver rapidement l'infrastructure la plus proche de leurs besoins." @@ -293,9 +293,21 @@ export default class Translations { only: new T({en: 'This shop only sells second-hand bikes', nl: 'Deze winkel verkoopt enkel tweedehands fietsen', fr: 'TODO: fr'}), }, diy: { - question: new T({en: 'Are there tools here to repair your own bike?', nl: 'Biedt deze winkel gereedschap aan om je fiets zelf te herstellen?', fr: 'TODO: fr'}), - yes: new T({en: 'This shop offers tools for DIY repair', nl: 'Deze winkel biedt gereedschap aan om je fiets zelf te herstellen', fr: 'TODO: fr'}), - no: new T({en: 'This shop doesn\'t offer tools for DIY repair', nl: 'Deze winkel biedt geen gereedschap aan om je fiets zelf te herstellen', fr: 'TODO: fr'}), + question: new T({ + en: 'Are there tools here to repair your own bike?', + nl: 'Biedt deze winkel gereedschap aan om je fiets zelf te herstellen?', + fr: 'TODO: fr' + }), + yes: new T({ + en: 'This shop offers tools for DIY repair', + nl: 'Deze winkel biedt gereedschap aan om je fiets zelf te herstellen', + fr: 'TODO: fr' + }), + no: new T({ + en: 'This shop doesn\'t offer tools for DIY repair', + nl: 'Deze winkel biedt geen gereedschap aan om je fiets zelf te herstellen', + fr: 'TODO: fr' + }), } }, drinking_water: { @@ -305,6 +317,20 @@ export default class Translations { }) } }, + bookcases: { + title: new T({en: "Open Bookcase Map", nl: "Open Boekenkastjes kaart"}), + description: new T({ + en: "Search a bookcase near you and add information about them in the biggest shared map of the world.", + nl: "Help mee met het creëeren van een volledige kaart met alle boekenruilkastjes!" + + "Een boekenruilkastje is een vaste plaats in publieke ruimte waar iedereen een boek in kan zetten of uit kan meenemen." + + "Meestal een klein kastje of doosje dat op straat staat, maar ook een oude telefooncellen of een schap in een station valt hieronder." + } + ), + bookcase: new T({ + nl: "Boekenruilkastje" + }) + }, + image: { addPicture: new T({en: 'Add picture', nl: 'Voeg foto toe', fr: 'TODO: fr'}), uploadingPicture: new T({ @@ -424,8 +450,19 @@ export default class Translations { pickLanguage: new T({ en: "Choose a language", nl: "Kies je taal" + }), + about: new T({ + en: "Easily edit and add OpenStreetMap for a certain theme", + nl: "Easily edit and add OpenStreetMap for a certain theme" + + }), + nameInlineQuestion: new T({ + nl: "De naam van dit {category} is $$$" + }), + noNameCategory: new T({ + nl: "{category} zonder naam" }) - } + } } public static W(s: string | UIElement): UIElement { @@ -435,4 +472,35 @@ export default class Translations { return new FixedUiElement(s); } + public static CountTranslations() { + const queue: any = [Translations.t]; + const tr: Translation[] = []; + while (queue.length > 0) { + const item = queue.pop(); + if (item instanceof Translation || item.translations !== undefined) { + tr.push(item); + } else { + for (const t in item) { + const x = item[t]; + queue.push(x) + } + } + } + + const langaugeCounts = {}; + for (const translation of tr) { + for (const language in translation.translations) { + if (langaugeCounts[language] === undefined) { + langaugeCounts[language] = 1 + } else { + langaugeCounts[language]++; + } + } + } + for (const language in langaugeCounts) { + console.log("Total translations in ", language, langaugeCounts[language], "/", tr.length) + } + + } + } diff --git a/assets/add.svg b/assets/add.svg new file mode 100644 index 0000000..cc4b162 --- /dev/null +++ b/assets/add.svg @@ -0,0 +1,289 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/bike/broken_pump_2.svg b/assets/bike/broken_pump_2.svg new file mode 100644 index 0000000..72d4719 --- /dev/null +++ b/assets/bike/broken_pump_2.svg @@ -0,0 +1,219 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/bike/logo.svg b/assets/bike/logo.svg new file mode 100644 index 0000000..059b16e --- /dev/null +++ b/assets/bike/logo.svg @@ -0,0 +1,165 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..bd2eb3c --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,297 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logos/logo.svg b/assets/logos/logo.svg deleted file mode 100644 index 7e4cba1..0000000 --- a/assets/logos/logo.svg +++ /dev/null @@ -1,3300 +0,0 @@ - - - - - OpenStreetMap logo 2011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - OpenStreetMap logo 2011 - - - Ken Vermette - - - - April 2011 - - - OpenStreetMap.org - - - Replacement logo for OpenStreetMap Foundation - - - OSM openstreetmap logo - - - http://wiki.openstreetmap.org/wiki/File:Public-images-osm_logo.svg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 010110010011010110010011  - 010110010011010110010011  - - - diff --git a/assets/logos/logo192.png b/assets/logos/logo192.png deleted file mode 100644 index 0b71451..0000000 Binary files a/assets/logos/logo192.png and /dev/null differ diff --git a/assets/logos/logo512.png b/assets/logos/logo512.png deleted file mode 100644 index 9c9015d..0000000 Binary files a/assets/logos/logo512.png and /dev/null differ diff --git a/clean.sh b/clean.sh index 4fac85d..5021175 100755 --- a/clean.sh +++ b/clean.sh @@ -10,3 +10,16 @@ rm UI/*/*/*.js rm Customizations/*.js rm Customizations/*/*.js rm Customizations/*/*/*.js + +rm *.webmanifest +rm q*.html +rm assets/generated/* + +for f in ./*.html; do + if [[ "$f" == "./index.html" ]] || [[ "$f" == "./land.html" ]] || [[ "$f" == "./test.html" ]] + then + echo "Not removing $f" + else + rm $f + fi +done \ No newline at end of file diff --git a/createLayouts.ts b/createLayouts.ts index e1bdd71..8d92d73 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -1,12 +1,199 @@ -/* -*/ -import {Bookcases} from "./Customizations/Layers/Bookcases"; +import {Groen} from "./Customizations/Layouts/Groen"; +import {Bookcases} from "./Customizations/Layouts/Bookcases"; +import {GRB} from "./Customizations/Layouts/GRB"; +import Cyclofix from "./Customizations/Layouts/Cyclofix"; +import {WalkByBrussels} from "./Customizations/Layouts/WalkByBrussels"; +import {MetaMap} from "./Customizations/Layouts/MetaMap"; +import {StreetWidth} from "./Customizations/Layouts/StreetWidth"; +import {Natuurpunt} from "./Customizations/Layouts/Natuurpunt"; +import {AllKnownLayouts} from "./Customizations/AllKnownLayouts"; +import {Layout} from "./Customizations/Layout"; +import {readFileSync, writeFile, writeFileSync} from "fs"; +import {Utils} from "./Utils"; +import svg2img from 'promise-svg2img'; +import Translation from "./UI/i18n/Translation"; +import Locale from "./UI/i18n/Locale"; +import Translations from "./UI/i18n/Translations"; +import {UIElement} from "./UI/UIElement"; +import {LayerDefinition} from "./Customizations/LayerDefinition"; console.log("Building routers") -new Bookcases() -/* -for(const layout in AllKnownLayouts.allSets){ - console.log(layout) +UIElement.runningFromConsole = true; + +function enc(str: string): string { + return encodeURIComponent(str.toLowerCase()); } -*/ \ No newline at end of file + +function validate(layout: Layout) { + + const translations: Translation[] = []; + const queue: any[] = [layout] + + while (queue.length > 0) { + const item = queue.pop(); + for (const key in item) { + const v = item[key]; + if (v === undefined) { + continue; + } + if (v instanceof Translation || v?.translations !== undefined) { + translations.push(v); + } else if ( + ["string", "function", "boolean", "number"].indexOf(typeof (v)) < 0) { + queue.push(v) + } + } + } + + const missing = {} + const present = {} + for (const ln of layout.supportedLanguages) { + missing[ln] = 0; + present[ln] = 0; + for (const translation of translations) { + const txt = translation.translations[ln]; + const isMissing = txt === undefined || txt === "" || txt.toLowerCase().indexOf("todo") >= 0; + if (isMissing) { + console.log("Missing or suspicious translation for '", translation.txt, "'in", ln, ":", txt) + missing[ln]++ + } else { + present[ln]++; + } + } + } + + console.log("Translation completenes for", layout.name); + for (const ln of layout.supportedLanguages) { + const amiss = missing[ln]; + const ok = present[ln]; + const total = amiss + ok; + console.log(`${ln}: ${ok}/${total}`) + } + +} + + +const alreadyWritten = [] + +function createIcon(iconPath: string, size: number) { + + let name = iconPath.split(".").slice(0, -1).join("."); + if(name.startsWith("./")){ + name = name.substr(2) + } + const newname = `${name}${size}.png` + .replace(/\//g,"_") + .replace("assets_","assets/generated/"); + + if (alreadyWritten.indexOf(newname) >= 0) { + return newname; + } + alreadyWritten.push(newname); + try { + readFileSync(newname); + return newname; // File already exists - nothing to do + } catch (e) { + + } + + svg2img(iconPath, + // @ts-ignore + {width: size, height: size, preserveAspectRatio: true}) + .then((buffer) => { + console.log("Writing icon", newname) + writeFileSync(newname, buffer); + }).catch((error) => { + console.log("ERROR", error) + }); + return newname; +} + +function createManifest(layout: Layout, relativePath: string) { + const name = Utils.Upper(layout.name); + + const icons = []; + + if (layout.icon.endsWith(".svg")) { + // This is an svg. Lets create the needed pngs! + const sizes = [72, 96, 120, 128, 144, 152, 180, 192, 384, 512]; + for (const size of sizes) { + const name = createIcon(layout.icon, size); + icons.push({ + src: name, + sizes: size + "x" + size, + type: "image/png" + }) + } + icons.push({ + src: layout.icon, + sizes: "513x513", + type: "image/svg" + }) + } else { + + throw "Icon is not an svg for " + layout.name + } + const ogTitle = Translations.W(layout.title).InnerRender(); + const ogDescr = Translations.W(layout.description).InnerRender(); + + const manif = { + name: name, + short_name: ogTitle, + start_url: `${relativePath}/${layout.name.toLowerCase()}.html`, + display: "standalone", + background_color: "#fff", + description: ogDescr, + orientation: "portrait-primary, landscape-primary", + icons: icons + } + return manif; +} + +const template = readFileSync("index.html", "utf8"); + +function createLandingPage(layout: Layout) { + + Locale.language.setData(layout.supportedLanguages[0]); + + const ogTitle = Translations.W(layout.title).InnerRender(); + const ogDescr = Translations.W(layout.description).InnerRender(); + const ogImage = layout.socialImage; + + const og = ` + + + ` + + return template + .replace(`./manifest.manifest`, `./${enc(layout.name)}.webmanifest`) + .replace("", og) + .replace(``, + ``) +} + + +const blacklist = ["", "test", ".", "..", "manifest", "index", "land", "preferences", "account", "openstreetmap"] +const all = AllKnownLayouts.allSets; +for (const layoutName in all) { + if (blacklist.indexOf(layoutName.toLowerCase()) >= 0) { + console.log(`Skipping a layout with name${layoutName}, it is on the blacklist`); + continue; + } + const err = err => { + if (err !== null) { + console.log("Could not write manifest for ", layoutName, " because ", err) + } + }; + const layout = all[layoutName]; + validate(layout) + const manif = JSON.stringify(createManifest(layout, "/MapComplete")); + + const manifestLocation = encodeURIComponent(layout.name.toLowerCase()) + ".webmanifest"; + writeFile(manifestLocation, manif, err); + + const landing = createLandingPage(layout); + writeFile(enc(layout.name) + ".html", landing, err) +} + +Translations.CountTranslations(); \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index ff4b3be..4799663 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,10 +1,10 @@ #! /bin/bash -npx ts-node createLayout.ts - +ts-node createLayouts.ts npm run build rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/* cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ +./clean.sh cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ git add . git commit -m "New mapcomplete version" diff --git a/index.css b/index.css index b07c605..67af8a1 100644 --- a/index.css +++ b/index.css @@ -855,6 +855,13 @@ form { } .featureinfobox { + max-height: 80vh; + overflow-y: auto; +} + +.featureinfobox > div { + width: calc(100% - 2em); + padding-left: 1em; } .featureinfoboxtitle { diff --git a/index.html b/index.html index 319f83d..4e30fb9 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + @@ -7,23 +7,12 @@ MapComplete - - + + - - - + +
    diff --git a/index.ts b/index.ts index 50ce36b..86763b9 100644 --- a/index.ts +++ b/index.ts @@ -56,6 +56,11 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") { let defaultLayout = "all" +const path = window.location.pathname.split("/").slice(-1)[0]; +if (path !== "index.html") { + defaultLayout = path.substr(0, path.length - 5); + console.log("Using", defaultLayout) +} // Run over all questsets. If a part of the URL matches a searched-for part in the layout, it'll take that as the default for (const k in AllKnownLayouts.allSets) { @@ -75,6 +80,9 @@ defaultLayout = QueryParameters.GetQueryParameter("layout").data ?? defaultLayou const layoutToUse: Layout = AllKnownLayouts.allSets[defaultLayout] ?? AllKnownLayouts["all"]; console.log("Using layout: ", layoutToUse.name); +if(layoutToUse === undefined){ + console.log("Incorrect layout") +} // ----------------- Setup a few event sources ------------- @@ -190,7 +198,7 @@ for (const layer of layoutToUse.layers) { minZoom = Math.max(minZoom, layer.minzoom); - const flayer = layer.asLayer(bm, allElements, changes, osmConnection.userDetails, selectedElement, generateInfo); + const flayer = FilteredLayer.fromDefinition(layer, bm, allElements, changes, osmConnection.userDetails, selectedElement, generateInfo); const addButton = { name: Translations.W(layer.name), diff --git a/manifest.webmanifest b/manifest.manifest similarity index 75% rename from manifest.webmanifest rename to manifest.manifest index de7a335..c773208 100644 --- a/manifest.webmanifest +++ b/manifest.manifest @@ -1,24 +1,24 @@ { "name": "MapComplete", "short_name": "MapComplete", - "start_url": ".", + "start_url": "index.html", "display": "standalone", "background_color": "#fff", "description": "Easily edit OpenStreetMap", "orientation": "portrait-primary, landscape-primary", "icons": [ { - "src": "assets/logos/logo192.png", + "src": "./assets/add.svg", "sizes": "192x192", "type": "image/png" }, { - "src": "assets/logos/logo512.png", + "src": "./assets/add.svg", "sizes": "512x512", "type": "image/png" }, { - "src": "assets/logos/logo.svg", + "src": "./assets/add.svg", "sizes": "513x513", "type": "image/svg" } diff --git a/package-lock.json b/package-lock.json index a42c7c6..da89ba4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -779,6 +779,16 @@ "@babel/helper-plugin-utils": "^7.8.3" } }, + "@babel/polyfill": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.10.4.tgz", + "integrity": "sha512-8BYcnVqQ5kMD2HXoHInBH7H1b/uP3KdnwCYXOqFnXqguOyuu443WXusbIUbWEfY3Z0Txk0M1uG/8YuAMhNl6zg==", + "dev": true, + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.4" + } + }, "@babel/preset-env": { "version": "7.9.6", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz", @@ -992,6 +1002,12 @@ "physical-cpu-count": "^2.0.0" } }, + "@types/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-8GAYQ1jDRUQkSpHzJUqXwAkYFOxuWAOGLhIR4aPd/Y/yL12Q/9m7LsKpHKlfKdNE/362Hc9wPI1Yh6opDfxVJg==", + "dev": true + }, "@types/geojson": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", @@ -1014,6 +1030,12 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==" }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "acorn": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", @@ -1109,6 +1131,22 @@ } } }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1545,6 +1583,12 @@ "pkg-up": "^2.0.0" } }, + "btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "dev": true + }, "buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -1638,6 +1682,120 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz", "integrity": "sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw==" }, + "canvas": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.6.1.tgz", + "integrity": "sha512-S98rKsPcuhfTcYbtF53UIJhcbgIAK533d1kJKMwsMwAIFgfd58MOyxRud3kktlzWiEkFliaJtvyZCBtud/XVEA==", + "dev": true, + "requires": { + "nan": "^2.14.0", + "node-pre-gyp": "^0.11.0", + "simple-get": "^3.0.3" + } + }, + "canvg": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/canvg/-/canvg-1.5.3.tgz", + "integrity": "sha512-7Gn2IuQzvUQWPIuZuFHrzsTM0gkPz2RRT9OcbdmA03jeKk8kltrD8gqUzNX15ghY/4PV5bbe5lmD6yDLDY6Ybg==", + "dev": true, + "requires": { + "jsdom": "^8.1.0", + "rgbcolor": "^1.0.1", + "stackblur-canvas": "^1.4.1", + "xmldom": "^0.1.22" + }, + "dependencies": { + "abab": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + }, + "acorn": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", + "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=", + "dev": true + }, + "acorn-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", + "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", + "dev": true, + "requires": { + "acorn": "^2.1.0" + } + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "jsdom": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-8.5.0.tgz", + "integrity": "sha1-1Nj12/J2hjW2KmKCO5R89wcevJg=", + "dev": true, + "requires": { + "abab": "^1.0.0", + "acorn": "^2.4.0", + "acorn-globals": "^1.0.4", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.0 < 0.4.0", + "cssstyle": ">= 0.2.34 < 0.3.0", + "escodegen": "^1.6.1", + "iconv-lite": "^0.4.13", + "nwmatcher": ">= 1.3.7 < 2.0.0", + "parse5": "^1.5.1", + "request": "^2.55.0", + "sax": "^1.1.4", + "symbol-tree": ">= 3.1.0 < 4.0.0", + "tough-cookie": "^2.2.0", + "webidl-conversions": "^3.0.1", + "whatwg-url": "^2.0.1", + "xml-name-validator": ">= 2.0.1 < 3.0.0" + } + }, + "parse5": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", + "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", + "dev": true + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true + }, + "whatwg-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-2.0.1.tgz", + "integrity": "sha1-U5ayBD8CDub3BNnEXqhRnnJN5lk=", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "xml-name-validator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", + "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", + "dev": true + } + } + }, "cardinal": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.4.tgz", @@ -1681,6 +1839,12 @@ "upath": "^1.1.1" } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1754,6 +1918,11 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" }, + "closure": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/closure/-/closure-1.0.3.tgz", + "integrity": "sha1-5BD7MJWJaIGHfTeLjhSV93S2HEk=" + }, "coa": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", @@ -1764,6 +1933,12 @@ "q": "^1.1.2" } }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -1848,6 +2023,12 @@ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, "constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", @@ -2276,6 +2457,21 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2346,6 +2542,12 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -2365,6 +2567,17 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true + }, + "diff": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=" + }, "diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -2509,6 +2722,11 @@ } } }, + "email-validator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", + "integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==" + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -2895,6 +3113,15 @@ "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", "dev": true }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2915,6 +3142,59 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -3096,6 +3376,12 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -3310,6 +3596,15 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, + "ignore-walk": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, "import-fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", @@ -3347,6 +3642,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -3590,6 +3891,27 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=" + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=" + } + } + }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -3772,6 +4094,24 @@ "type-check": "~0.3.2" } }, + "libphonenumber": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/libphonenumber/-/libphonenumber-0.0.10.tgz", + "integrity": "sha1-54u/ZgGYnNCfpDUEdkaI1BeUFIw=", + "requires": { + "closure": "1.0.3", + "mocha": "^2.4.5" + } + }, + "libphonenumber-js": { + "version": "1.7.55", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.7.55.tgz", + "integrity": "sha512-vYT83akP6uJq5QiMgzzVsWrGWJpQ4KgX2SmW0RBgLFD1UzICjVgp+7ajEep3oRcv2838kMTu1gj7KHPi0Y6Y6w==", + "requires": { + "minimist": "^1.2.5", + "xml2js": "^0.4.17" + } + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -3822,6 +4162,11 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, "magic-string": { "version": "0.22.5", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", @@ -3937,6 +4282,12 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -3960,6 +4311,25 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } + }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -3987,6 +4357,89 @@ "minimist": "^1.2.5" } }, + "mocha": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz", + "integrity": "sha1-FhvlvetJZ3HrmzV0UFC2IrWu/Fg=", + "requires": { + "commander": "2.3.0", + "debug": "2.2.0", + "diff": "1.4.0", + "escape-string-regexp": "1.0.2", + "glob": "3.2.11", + "growl": "1.9.2", + "jade": "0.26.3", + "mkdirp": "0.5.1", + "supports-color": "1.2.0", + "to-iso-string": "0.0.2" + }, + "dependencies": { + "commander": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=" + }, + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "requires": { + "inherits": "2", + "minimatch": "0.3" + } + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=" + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + }, + "supports-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", + "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=" + } + } + }, "monotone-convex-hull-2d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/monotone-convex-hull-2d/-/monotone-convex-hull-2d-1.0.1.tgz", @@ -4003,8 +4456,7 @@ "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "optional": true + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, "nanomatch": { "version": "1.2.13", @@ -4024,6 +4476,28 @@ "to-regex": "^3.0.1" } }, + "needle": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.0.tgz", + "integrity": "sha512-o/qITSDR0JCyCKEQ1/1bnUXMmznxabbwi/Y4WwJElf+evwJNFNwIDMCCt5IigFVxgeGBJESLohGtIS9gEzo1fA==", + "dev": true, + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4076,11 +4550,39 @@ } } }, + "node-pre-gyp": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", + "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", + "dev": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, "node-releases": { "version": "1.1.56", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.56.tgz", "integrity": "sha512-EVo605FhWLygH8a64TjgpjyHYOihkxECwX1bHHr8tETJKWEiWS2YJjPbvsX2jFjnjTNEgBCmk9mLjKG1Mf11cw==" }, + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, "normalize-html-whitespace": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-1.0.0.tgz", @@ -4096,6 +4598,44 @@ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==" }, + "npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-packlist": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "dev": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -4104,6 +4644,18 @@ "boolbase": "~1.0.0" } }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwmatcher": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", + "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", + "dev": true + }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -4284,6 +4836,28 @@ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, "osm-auth": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/osm-auth/-/osm-auth-1.0.2.tgz", @@ -5082,6 +5656,19 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "promise-svg2img": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/promise-svg2img/-/promise-svg2img-0.2.0.tgz", + "integrity": "sha512-XkbyV+5pU/2iO+BIB06WG8M8iXh7ZjlL5ylukChk9Y8A8LueaFJ5cGf6m+ARib78HOh86nk6Q14nTkMviJXl8Q==", + "dev": true, + "requires": { + "@types/atob": "^2.1.2", + "atob": "^2.0.0", + "btoa": "^1.1.2", + "canvas": "^2.6.0", + "canvg": "^1.5.3" + } + }, "protocol-buffers-schema": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.4.0.tgz", @@ -5180,6 +5767,18 @@ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, "read-file": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz", @@ -5414,6 +6013,12 @@ "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=" }, + "rgbcolor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", + "integrity": "sha1-1lBezbMEplldom+ktDMHMGd1lF0=", + "dev": true + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -5635,11 +6240,33 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true + }, + "simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "dev": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -5857,6 +6484,12 @@ "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" }, + "stackblur-canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-1.4.1.tgz", + "integrity": "sha1-hJqm+UsnL/JvZHH6QTDtH35HlVs=", + "dev": true + }, "static-eval": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.5.tgz", @@ -6039,6 +6672,12 @@ "ansi-regex": "^3.0.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "stylehacks": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", @@ -6094,6 +6733,21 @@ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, "terser": { "version": "3.17.0", "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", @@ -6155,6 +6809,11 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, + "to-iso-string": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/to-iso-string/-/to-iso-string-0.0.2.tgz", + "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=" + }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -6737,9 +7396,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", - "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, "uncss": { @@ -7042,6 +7701,27 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -7105,6 +7785,20 @@ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==" }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -7125,6 +7819,12 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "yargs": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", diff --git a/package.json b/package.json index 52bfb33..474f320 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "A small website to edit OSM easily", "main": "index.js", "scripts": { - "start": "parcel index.html land.html test.html UI/** Logic/** assets/**/* vendor/* vendor/*/*", - "build": "rm -rf dist/ && parcel build --public-url ./ index.html land.html assets/* assets/*/* vendor/* vendor/*/*", + "start": "parcel *.html UI/** Logic/** assets/**/* vendor/* vendor/*/*", + "build": "rm -rf dist/ && parcel build --public-url ./ *.html assets/* assets/*/* vendor/* vendor/*/*", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ @@ -15,18 +15,23 @@ "author": "pietervdvn", "license": "MIT", "dependencies": { + "email-validator": "^2.0.4", "jquery": "latest", "leaflet": "^1.6.0", + "libphonenumber": "0.0.10", + "libphonenumber-js": "^1.7.55", "osm-auth": "^1.0.2", "osmtogeojson": "^3.0.0-beta.4", "parcel": "^1.12.4", "turf": "^3.0.14" }, "devDependencies": { - "fs": "0.0.1-security", + "@babel/polyfill": "^7.10.4", "@types/node": "^7.0.5", + "fs": "0.0.1-security", + "promise-svg2img": "^0.2.0", "read-file": "^0.2.0", - "typescript": "^3.9.3", + "typescript": "^3.9.7", "write-file": "^1.0.0" } } diff --git a/vendor/images/layers-2x.png b/vendor/images/layers-2x.png new file mode 100644 index 0000000..200c333 Binary files /dev/null and b/vendor/images/layers-2x.png differ diff --git a/vendor/images/layers.png b/vendor/images/layers.png new file mode 100644 index 0000000..1a72e57 Binary files /dev/null and b/vendor/images/layers.png differ diff --git a/vendor/images/marker-icon.png b/vendor/images/marker-icon.png new file mode 100644 index 0000000..950edf2 Binary files /dev/null and b/vendor/images/marker-icon.png differ diff --git a/vendor/leaflet.css b/vendor/leaflet.css new file mode 100644 index 0000000..983d605 --- /dev/null +++ b/vendor/leaflet.css @@ -0,0 +1,640 @@ +/* required styles */ + +.leaflet-pane, +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-tile-container, +.leaflet-pane > svg, +.leaflet-pane > canvas, +.leaflet-zoom-box, +.leaflet-image-layer, +.leaflet-layer { + position: absolute; + left: 0; + top: 0; + } +.leaflet-container { + overflow: hidden; + } +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + -webkit-user-drag: none; + } +/* Prevents IE11 from highlighting tiles in blue */ +.leaflet-tile::selection { + background: transparent; +} +/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ +.leaflet-safari .leaflet-tile { + image-rendering: -webkit-optimize-contrast; + } +/* hack that prevents hw layers "stretching" when loading new tiles */ +.leaflet-safari .leaflet-tile-container { + width: 1600px; + height: 1600px; + -webkit-transform-origin: 0 0; + } +.leaflet-marker-icon, +.leaflet-marker-shadow { + display: block; + } +/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ +/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ +.leaflet-container .leaflet-overlay-pane svg, +.leaflet-container .leaflet-marker-pane img, +.leaflet-container .leaflet-shadow-pane img, +.leaflet-container .leaflet-tile-pane img, +.leaflet-container img.leaflet-image-layer, +.leaflet-container .leaflet-tile { + max-width: none !important; + max-height: none !important; + } + +.leaflet-container.leaflet-touch-zoom { + -ms-touch-action: pan-x pan-y; + touch-action: pan-x pan-y; + } +.leaflet-container.leaflet-touch-drag { + -ms-touch-action: pinch-zoom; + /* Fallback for FF which doesn't support pinch-zoom */ + touch-action: none; + touch-action: pinch-zoom; +} +.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { + -ms-touch-action: none; + touch-action: none; +} +.leaflet-container { + -webkit-tap-highlight-color: transparent; +} +.leaflet-container a { + -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); +} +.leaflet-tile { + filter: inherit; + visibility: hidden; + } +.leaflet-tile-loaded { + visibility: inherit; + } +.leaflet-zoom-box { + width: 0; + height: 0; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 800; + } +/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ +.leaflet-overlay-pane svg { + -moz-user-select: none; + } + +.leaflet-pane { z-index: 400; } + +.leaflet-tile-pane { z-index: 200; } +.leaflet-overlay-pane { z-index: 400; } +.leaflet-shadow-pane { z-index: 500; } +.leaflet-marker-pane { z-index: 600; } +.leaflet-tooltip-pane { z-index: 650; } +.leaflet-popup-pane { z-index: 700; } + +.leaflet-map-pane canvas { z-index: 100; } +.leaflet-map-pane svg { z-index: 200; } + +.leaflet-vml-shape { + width: 1px; + height: 1px; + } +.lvml { + behavior: url(#default#VML); + display: inline-block; + position: absolute; + } + + +/* control positioning */ + +.leaflet-control { + position: relative; + z-index: 800; + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } +.leaflet-top, +.leaflet-bottom { + position: absolute; + z-index: 1000; + pointer-events: none; + } +.leaflet-top { + top: 0; + } +.leaflet-right { + right: 0; + } +.leaflet-bottom { + bottom: 0; + } +.leaflet-left { + left: 0; + } +.leaflet-control { + float: left; + clear: both; + } +.leaflet-right .leaflet-control { + float: right; + } +.leaflet-top .leaflet-control { + margin-top: 10px; + } +.leaflet-bottom .leaflet-control { + margin-bottom: 10px; + } +.leaflet-left .leaflet-control { + margin-left: 10px; + } +.leaflet-right .leaflet-control { + margin-right: 10px; + } + + +/* zoom and fade animations */ + +.leaflet-fade-anim .leaflet-tile { + will-change: opacity; + } +.leaflet-fade-anim .leaflet-popup { + opacity: 0; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } +.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { + opacity: 1; + } +.leaflet-zoom-animated { + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + will-change: transform; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); + -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); + transition: transform 0.25s cubic-bezier(0,0,0.25,1); + } +.leaflet-zoom-anim .leaflet-tile, +.leaflet-pan-anim .leaflet-tile { + -webkit-transition: none; + -moz-transition: none; + transition: none; + } + +.leaflet-zoom-anim .leaflet-zoom-hide { + visibility: hidden; + } + + +/* cursors */ + +.leaflet-interactive { + cursor: pointer; + } +.leaflet-grab { + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; + } +.leaflet-crosshair, +.leaflet-crosshair .leaflet-interactive { + cursor: crosshair; + } +.leaflet-popup-pane, +.leaflet-control { + cursor: auto; + } +.leaflet-dragging .leaflet-grab, +.leaflet-dragging .leaflet-grab .leaflet-interactive, +.leaflet-dragging .leaflet-marker-draggable { + cursor: move; + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; + } + +/* marker & overlays interactivity */ +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-image-layer, +.leaflet-pane > svg path, +.leaflet-tile-container { + pointer-events: none; + } + +.leaflet-marker-icon.leaflet-interactive, +.leaflet-image-layer.leaflet-interactive, +.leaflet-pane > svg path.leaflet-interactive, +svg.leaflet-image-layer.leaflet-interactive path { + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } + +/* visual tweaks */ + +.leaflet-container { + background: #ddd; + outline: 0; + } +.leaflet-container a { + color: #0078A8; + } +.leaflet-container a.leaflet-active { + outline: 2px solid orange; + } +.leaflet-zoom-box { + border: 2px dotted #38f; + background: rgba(255,255,255,0.5); + } + + +/* general typography */ +.leaflet-container { + font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; + } + + +/* general toolbar styles */ + +.leaflet-bar { + box-shadow: 0 1px 5px rgba(0,0,0,0.65); + border-radius: 4px; + } +.leaflet-bar a, +.leaflet-bar a:hover { + background-color: #fff; + border-bottom: 1px solid #ccc; + width: 26px; + height: 26px; + line-height: 26px; + display: block; + text-align: center; + text-decoration: none; + color: black; + } +.leaflet-bar a, +.leaflet-control-layers-toggle { + background-position: 50% 50%; + background-repeat: no-repeat; + display: block; + } +.leaflet-bar a:hover { + background-color: #f4f4f4; + } +.leaflet-bar a:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.leaflet-bar a:last-child { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom: none; + } +.leaflet-bar a.leaflet-disabled { + cursor: default; + background-color: #f4f4f4; + color: #bbb; + } + +.leaflet-touch .leaflet-bar a { + width: 30px; + height: 30px; + line-height: 30px; + } +.leaflet-touch .leaflet-bar a:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px; + } +.leaflet-touch .leaflet-bar a:last-child { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + } + +/* zoom control */ + +.leaflet-control-zoom-in, +.leaflet-control-zoom-out { + font: bold 18px 'Lucida Console', Monaco, monospace; + text-indent: 1px; + } + +.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { + font-size: 22px; + } + + +/* layers control */ + +.leaflet-control-layers { + box-shadow: 0 1px 5px rgba(0,0,0,0.4); + background: #fff; + border-radius: 5px; + } +.leaflet-control-layers-toggle { + background-image: url(images/layers.png); + width: 36px; + height: 36px; + } +.leaflet-retina .leaflet-control-layers-toggle { + background-image: url(images/layers-2x.png); + background-size: 26px 26px; + } +.leaflet-touch .leaflet-control-layers-toggle { + width: 44px; + height: 44px; + } +.leaflet-control-layers .leaflet-control-layers-list, +.leaflet-control-layers-expanded .leaflet-control-layers-toggle { + display: none; + } +.leaflet-control-layers-expanded .leaflet-control-layers-list { + display: block; + position: relative; + } +.leaflet-control-layers-expanded { + padding: 6px 10px 6px 6px; + color: #333; + background: #fff; + } +.leaflet-control-layers-scrollbar { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 5px; + } +.leaflet-control-layers-selector { + margin-top: 2px; + position: relative; + top: 1px; + } +.leaflet-control-layers label { + display: block; + } +.leaflet-control-layers-separator { + height: 0; + border-top: 1px solid #ddd; + margin: 5px -10px 5px -6px; + } + +/* Default icon URLs */ +.leaflet-default-icon-path { + background-image: url(images/marker-icon.png); + } + + +/* attribution and scale controls */ + +.leaflet-container .leaflet-control-attribution { + background: #fff; + background: rgba(255, 255, 255, 0.7); + margin: 0; + } +.leaflet-control-attribution, +.leaflet-control-scale-line { + padding: 0 5px; + color: #333; + } +.leaflet-control-attribution a { + text-decoration: none; + } +.leaflet-control-attribution a:hover { + text-decoration: underline; + } +.leaflet-container .leaflet-control-attribution, +.leaflet-container .leaflet-control-scale { + font-size: 11px; + } +.leaflet-left .leaflet-control-scale { + margin-left: 5px; + } +.leaflet-bottom .leaflet-control-scale { + margin-bottom: 5px; + } +.leaflet-control-scale-line { + border: 2px solid #777; + border-top: none; + line-height: 1.1; + padding: 2px 5px 1px; + font-size: 11px; + white-space: nowrap; + overflow: hidden; + -moz-box-sizing: border-box; + box-sizing: border-box; + + background: #fff; + background: rgba(255, 255, 255, 0.5); + } +.leaflet-control-scale-line:not(:first-child) { + border-top: 2px solid #777; + border-bottom: none; + margin-top: -2px; + } +.leaflet-control-scale-line:not(:first-child):not(:last-child) { + border-bottom: 2px solid #777; + } + +.leaflet-touch .leaflet-control-attribution, +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + box-shadow: none; + } +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + border: 2px solid rgba(0,0,0,0.2); + background-clip: padding-box; + } + + +/* popup */ + +.leaflet-popup { + position: absolute; + text-align: center; + margin-bottom: 20px; + } +.leaflet-popup-content-wrapper { + padding: 1px; + text-align: left; + border-radius: 12px; + } +.leaflet-popup-content { + margin: 13px 19px; + line-height: 1.4; + } +.leaflet-popup-content p { + margin: 18px 0; + } +.leaflet-popup-tip-container { + width: 40px; + height: 20px; + position: absolute; + left: 50%; + margin-left: -20px; + overflow: hidden; + pointer-events: none; + } +.leaflet-popup-tip { + width: 17px; + height: 17px; + padding: 1px; + + margin: -10px auto 0; + + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + } +.leaflet-popup-content-wrapper, +.leaflet-popup-tip { + background: white; + color: #333; + box-shadow: 0 3px 14px rgba(0,0,0,0.4); + } +.leaflet-container a.leaflet-popup-close-button { + position: absolute; + top: 0; + right: 0; + padding: 4px 4px 0 0; + border: none; + text-align: center; + width: 18px; + height: 14px; + font: 16px/14px Tahoma, Verdana, sans-serif; + color: #c3c3c3; + text-decoration: none; + font-weight: bold; + background: transparent; + } +.leaflet-container a.leaflet-popup-close-button:hover { + color: #999; + } +.leaflet-popup-scrolled { + overflow: auto; + border-bottom: 1px solid #ddd; + border-top: 1px solid #ddd; + } + +.leaflet-oldie .leaflet-popup-content-wrapper { + zoom: 1; + } +.leaflet-oldie .leaflet-popup-tip { + width: 24px; + margin: 0 auto; + + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); + } +.leaflet-oldie .leaflet-popup-tip-container { + margin-top: -1px; + } + +.leaflet-oldie .leaflet-control-zoom, +.leaflet-oldie .leaflet-control-layers, +.leaflet-oldie .leaflet-popup-content-wrapper, +.leaflet-oldie .leaflet-popup-tip { + border: 1px solid #999; + } + + +/* div icon */ + +.leaflet-div-icon { + background: #fff; + border: 1px solid #666; + } + + +/* Tooltip */ +/* Base styles for the element that has a tooltip */ +.leaflet-tooltip { + position: absolute; + padding: 6px; + background-color: #fff; + border: 1px solid #fff; + border-radius: 3px; + color: #222; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + pointer-events: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.4); + } +.leaflet-tooltip.leaflet-clickable { + cursor: pointer; + pointer-events: auto; + } +.leaflet-tooltip-top:before, +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + position: absolute; + pointer-events: none; + border: 6px solid transparent; + background: transparent; + content: ""; + } + +/* Directions */ + +.leaflet-tooltip-bottom { + margin-top: 6px; +} +.leaflet-tooltip-top { + margin-top: -6px; +} +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-top:before { + left: 50%; + margin-left: -6px; + } +.leaflet-tooltip-top:before { + bottom: 0; + margin-bottom: -12px; + border-top-color: #fff; + } +.leaflet-tooltip-bottom:before { + top: 0; + margin-top: -12px; + margin-left: -6px; + border-bottom-color: #fff; + } +.leaflet-tooltip-left { + margin-left: -6px; +} +.leaflet-tooltip-right { + margin-left: 6px; +} +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + top: 50%; + margin-top: -6px; + } +.leaflet-tooltip-left:before { + right: 0; + margin-right: -12px; + border-left-color: #fff; + } +.leaflet-tooltip-right:before { + left: 0; + margin-left: -12px; + border-right-color: #fff; + }